How do I control for some patients providing multiple samples in my training data?

Question: I have a dataset with 50 patients. The patients are tracked over many years with a set of a few thousand features measured at somewhat random intervals. I am trying to predict a certain outcome (this is a regression problem) which is measured either once, twice, or three times per patient over the entire time period the patient is tracked. So far, I have been assuming that each outcome feature is a data point in my Y vector, and using the closest time point where the features are measured for the patient. I want my final model to be able to predict the outcome variable from only one measure of features, which is why I am OK ignoring the temporal aspect of the data. However, I am not sure how to control for the fact that some patients contribute 2 or even 3 samples to my training data. Wouldn't this affect the performance of my model since there is some in-patient variation? How do I account for this?
Comment: Welcome to the site! Ensure that a patient does not appear in both training and test sets.
Answer: Like all models, the final outcome will depend heavily on the data you use to train.
Given you don't have many samples for each patient and that the samples are temporally irregular, I imagine you might be lumping all recorded data (from all patients) into a single training set... ? In that case, it will be important to either perform random sampling or something like stratified sampling - both without replacement - to make sure patients don't appear in both train and test sets. Stratification simply means to create training/test splits, which do their best to preserve class balance. So if you select one feature as most important, stratification will make sure that training and test sets each have a proportional number of samples exhibiting that feature.
If you are using R, look into the Caret package - here is an example of usage. That is a very powerful package in general and worth investigating (if you use R or not!).
If you are using Python, have a look at the Splitter Classes, which include: Stratified K-folds and Stratified Shuffle Split, among others.
If temporal ordering does play a big role, taking the most recent sample is usually considered best practice. For example, measurements driven by general information flow, e.g. finance, would also consider the most recent measurement as the most valueable for prediction.
This is the case in many applications, but perhaps not with your measurements - in medical data, behavioural/environmental conditions of the patient around the time of measuring may outweigh the recentness of the data.
One more observation, in the you are trying to predict some feature that is very specific to a single patient (and you say you may only have one observation from each patient!), then you might have a hard time making accurate predictions.
Answer: It depends on your data. You may want to keep only the last sample for each patient. Or you may want to add a column with an integer value that shows the sample count for each patient.


second order ODE with non-constant coefficients

Question: I'd like to know how to solve the differential equation: $u_{tt}+\frac{1-2s}{t}u_t-u=0$ where s is a constant. Let $u(0)=1$ and $\lim_{t \to 0+} t^{1-2s}u_t = c$. I'm studying a fractional laplacian equation and this ODE arose after applying the Caffarelli-Silvestre extension (https://arxiv.org/pdf/math/0608640.pdf). I have only learnt how to solve second order linear ODEs with constant coefficients, so I wasn't sure how to go about solving this equation.
Answer: Let $u=t^{s} v$. Therefore we have $u' = t^{s}v' + st^{s-1}v$ and $u'' = t^{s}v'' + 2s t^{s-1}v' + s(s-1)t^{s-2}v$. Substituting into the ODE yields
\begin{align}
t^{s}v'' + 2s t^{s-1}v' + s(s-1)t^{s-2}v + \frac{1-2s}{t}(t^{s}v' + st^{s-1}v) - t^{s} v = & \, 0  \\
\implies t^2v'' + 2s tv' + s(s-1)v + \frac{1-2s}{t}(t^{2}v' + stv) - t^2v = & \, 0\\
\implies t^2v'' + tv'  -(s^2+t^2)v = & \, 0.
\end{align}
This is the modified Bessel equation. To get to the classic Bessel equation we make the transformation $t\to i x$. Therefore $\frac{d}{dt}=-i \frac{d}{dx}$ and thus
$$ x^2 v'' + x v' + (x^2-s^2)v=0.$$
This is Bessel's equation https://en.wikipedia.org/wiki/Bessel_function.
Edit:
In response to the comment on initial conditions I am expanding my answer a bit. Let us consider the solution
$$ u(t) =t^s\left ( C_1 I_s(t) + C_2 K_s(t) \right ) $$
where $I_s$ and $K_s$ are modified Bessel functions. Assuming $s> 0$ (or $\Re (s) > 0$ for the complex case) the condition $u(0)=1$ leads to
$$ 1 = \lim_{t\to 0^+} t^s\left ( C_1 I_s(t) + C_2 K_s(t) \right ) = C_2 \lim_{t\to 0^+}t^s K_s(t).$$
This still works as $K_s(t)=O(t^{-s})$ as $t\to 0$. I think (but you should check) that we get
$$ \lim_{t\to 0^+} t^s K_s(t) = 2^{s-1}\Gamma (s). $$
Thus we find that $C_2 = \frac{1}{\Gamma(s)} 2^{1-s}$. The case $s=0$ needs to be considered separately. I will leave it to you to solve for the other condition.
Note:
I checked the other condition and I think both can only be satisfied if $0 \le s \le 1$. If this is an unacceptable limitation then you may want to check both my work, and your work in deriving the equation and IC's. A physical interpretation of what $s$ is may help.
Comment: I see, however, wouldn't this contradict the initial condition $u(0)=1$? We would have $u(t)=t^s I_s(t)$ where $I_s$ is a modified Bessel function. For all $s \neq 0$, $I_s(0)=0$.


Migrating GNU Mailman server to new hardware

Question: We have a GNU Mailman server running on some old hardware that is due to be retired soon. I have been trying to figure out where the list/archive data stored so I can just rsync it over to the new server when it comes in but I haven't had much luck. Does anyone know where this data is stored by default? Also, is there anything else I should be concerned about when making a move like this? I don't have much experience with Mailman so any help would be much appreciated.
Comment: Which OS are you running this on, and are you using OS-supplied packages or was it installed manually?
Comment: Old server is running RHEL4 and mailman was installed via the Redhat supplied RPM. The exact package name is mailman-18.104.22.168-34.rhel4.6. The new server would be running RHEL6
Answer: The files you want are located in /var/lib/mailman the directories you want to copy are
<code>/var/lib/mailman/data
/var/lib/mailman/archives
/var/lib/mailman/lists
</code>
After you have migrated the server just run
<code>check_perms -f
</code>
To fix the permissions
Comment: I would add a somewhat obvious step of ensuring `mailman` is stopped on both hosts before copying the files. Also _do not_ rebuild the archives. It will change all the public links.
Comment: when I run check_perms -f it finds about 400 issues but says I need to run as root to fix. After elevating to root I run the command again but it won't actually fix the permissions, just  find them. Any ideas?


World download for servers

Question: I was playing a server which consists of insane builds. I wanted to download these maps, but when I tried the world downloader mod, it does not work. Is there a solution to download it without using any mods?
Comment: Ask the server owners for a copy of the world? That would be the most certain way.
Comment: Isn't your real question why the mod doesn't work? Why switch to a completely different piece of software instead of trying to get the original software to run?
Answer: You can't download server worlds without mods, however if you are willing to use mods i recommend Schematica http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1285818-schematica
Before downloading anything contact the creator for permission

World download for servers


RF dielectric measurement of a sample

Question: during non contact dielectric measurement of any sample using VNA and patch antennas,should the antenna dielectric be taken into consideration for calculations?
i want to use a ultra wide band patch antenna but i have no idea about its dielectric or material it is  made of. Usually which material is used for making UWB patch antennas operating in GHz?
Answer: The best substrate dielectric measurements are made by etching your own test pieces onto the substrate under test. That way, you have only one material in play.
It sounds like from your question, you are using patch antennae to couple to a substrate under test. What the VNA will measure is the perturbation of the patch antenna when loaded by the substrate under test. You need to analyse the whole system to get any meaning results from the measurements. Depending on the measurement geometry you use, this may be more or less sensitive to geometry and analysis errors. That's why it's better to use only the substrate you are testing.
Rogers 4350 is the 'go to' material for many applications in the GHz. It's readily available, and can be processed using the same workflow as FR4, and indeed is frequently bonded with FR4 to make a hybrid multi-layer board.
Comment: i want to measure dielectric of a liquid say water then how should the test setup be? suppose i place the water filled test tube in between two antennas and then measure its parameters using VNA. how can i get only the dielectric value of the liquid and eliminate the effects of other materials like antenna and coaxial cable and connectors.
Comment: is there any specific method or formula to calculate the dielectric of liquid that is based on this antenna method?
Comment: It's simply a perturbation method, where you measure your test cell full of air, then full of liquid. The air measurement is, as much as anything, to make sure you have calculated correctly what it should be for air. Cables and connectors are 'automatically' eliminated if they match the impedance of the VNA. If you have to ask that bit, then you indeed have a long learning curve ahead before you can make microwave measurements of complicated things. The simplest is to cut the end off a cable, dip it into the liquid, measure S11. Analyse that before you try anything harder.
Comment: thanks for responding but i do not want to do  open ended coaxial method. i want to do non contact free space dielectric measurement.

RF dielectric measurement of a sample


Do people who never paid FICA taxes get paid Social Security when they retire?

Question: From @Chad's comment:

It is how SSI works. There are some exceptions for people with disabilities where they receive money based on what they could have contributed, but yes you have to contribute to be eligible for SSI at retirement

This seems strange to me, for at least 2 situations. I'd like clarification on whether people in those situation indeed get no Social Security benefits, or if they do, how does that square with @Chad's comment:

Do elderly people who weren't around to pay FICA tax (e.g. recent legal immigrants) get Social Security benefits?
What happens to someone when they were on welfare all their life, or made too little income to have paid FICA tax otherwise?  Do they get no Social Security benefits?
Comment: @SoylentGray Actually FICA is precisely SS and Medicare. There is a 6.2% employer and employee Social Security tax and a 1.45% employer and employee Medicare tax. There is also a 0.9% Medicare surtax. http://www.bizfilings.com/toolkit/sbg/tax-info/payroll-taxes/employers-responsibility-fica-payroll-taxes.aspx This isn't the only source of money for the programs which also receive self-employment taxes, fraud fines, certain premiums and interest in the various trust funds. But, those taxes don't enter the general fund.
Comment: @SoylentGray any amount withheld that is not part of SS or medicare is also not part of FICA and therefore out of scope of the question.
Comment: @SoylentGray I rather suspect that you are the one who doesn't understand how the real world works.  When I divide the non-income taxes from my last pay stub by the gross pay, I get 8.4%, not 23.4%.
Comment: I do not know for sure but i am pretty sure that SSI is taken out of the cash benefit of welfare.  It also counts as income that must be reported at tax time. There is only one thing you can be sure of and that is the government makes sure it gets its taxes.
Comment: In Hungary we have problems because of it. I don't know how it works, that's why I write comment. The people who didn't pay it, get benefits, and these constantly paid by people who are working currently. The young generation gets burdened, and they are having less children, because they can't afford it since the taxes are high and their salary is enough only if they have two jobs. So the pensions and social security benefits are fulfilled but the system kills itself in this way. I can't say it's a bad system generally, under these circumstances and adding up the corruption: it is not working.
Comment: @SoylentGray FICA taxes are not imposed on cash welfare benefits and do not count as taxable income. Unemployment insurance payments, however, are taxable income.
Comment: @SoylentGray There are non-FICA taxes withheld (FUTA which is not part of FICA which is only 0.8 percent of the first $7,000 in practice since there is a credit for state unemployment premiums paid against that amount https://www.surepayroll.com/resources/terminology/payroll-taxes/federal-unemployment-tax-act), and federal income tax withholding tax (which is also not FICA) that becomes a credit against your federal income taxes. Sometimes there are state and local taxes as well. None of these withholding amounts have any relevance to Social Security and Medicare.
Answer: No you can not:
SOURCE

Everyone born in 1929 or later needs 40 Social Security credits to be
  eligible for retirement benefits. You can earn up to four credits per
  year, so you will need to work at least 10 years to become eligible
  for retirement benefits.
During your working years, earnings covered by Social Security are
  posted to your Social Security record  and you earn credits based on
  those earnings.
Each year the amount of earnings needed for a credit rises as average
  earnings levels rise. In 2010, you receive one credit for each $1,120
  of earnings, up to the maximum of four credits per year.

You will need to work for at least 10 years to collect Social Security.  And qualified earnings are those earning where you paid social security employment tax.  Any income that is not subject to SSI Tax (like capitol gains) is not qualified earnings.
If you become disabled there is a schedule linked on the source page that explains the requirements to collect the Social Security Disability benefits.
Totalization agreements are an exception.  If a worker has a total of 10 years between their home country and the US then they can qualify for a partial payment of Social Security benefits.  With respect to Mexico if a worker has at least 6 credits in the US and can show that they have a combined total of 40 quarters of contributions to the US and Mexican Social Security systems, then the worker can draw a prorated benefit payment from both systems. Source (p7-9)
Comment: Note: Clergy in the United States may also choose not to pay into the system. If they make this declaration, however, they are not eligible for benefits.  It may help your answer to include this case.
Comment: Down voted since inaccurate. Sometimes someone who didn't pay into the system can receive survivor's benefits earned by a parent or spouse, rather than from their own account. https://www.ssa.gov/planners/survivors/onyourown2.html About 6 million people (10% of the total) at any time receive benefits this way. https://www.ssa.gov/policy/docs/quickfacts/stat_snapshot/
Comment: @affableGeek -  The question is do people who didnot pay in get benefits not do people who paid in get denied benefits... I Am not sure you are right either... I think that it is only true if you have never paid in.  If you have ever paid in then you lose the ability to claim religous exemption.  So even though I am ready to go Amish I wont get the tax benefits... now to kick my SE addiction :p
Comment: @ohwilleke - The question is specifically about SS Benefits **WHEN THEY RETIRE** go troll somewhere else.
Comment: @SoylentGray 3 million people who didn't pay FICA taxes receive SS retirement benefits. You simply don't understand the program as well as you claim that you do.
Comment: *3 million people who didn't pay FICA taxes receive SS retirement benefits* Citation Required or go troll another bridge
Answer:

Do elderly people who weren't around to pay FICA tax (e.g. recent legal immigrants) get Social Security benefits?
What happens to someone when they were on welfare all their life, or
  made too little income to have paid FICA tax otherwise? Do they get no
  Social Security benefits?

Elderly recent legal immigrants are often entitled to social welfare benefits from the country where they spent their working years. For example, if someone works until retirement age in Germany, then moves to Chicago as a legal immigrant to live with an adult child, that elderly immigrant will usually continue to receive Germany social insurance benefits.

Also, work in the U.S. while a legal immigrant who is not a citizen still counts towards Social Security eligibility. Many illegal immigrants pay FICA taxes without receiving the eligibility benefits of Social Security because their taxes are not paid for their own Social Security numbers.

As noted in other posts, there are also "Totalization" agreements with Mexico and some other countries allowing someone to receive some Social Security benefits despite working less than the required 40 quarters in the U.S., if they have worked enough years in their home country.
A legal immigrant must have a sponsor in the U.S. who assumes financial responsibility for them. This can provide a source of support.

In practice, few people immigrate to the U.S. after their working years are done and without having secured eligibility for pension benefits or social insurance in their home country, so this comes up mostly in the case of refugees migrating in old age with their families because the country that they have left behind has imploded.
In these cases, adult children living and working in the U.S. as refugee immigrants often live with and economically support their elderly parents. It also wouldn't be uncommon for the elderly parent to marry someone in the U.S. who can support them.
If the sponsor of an immigrant to the U.S. is a spouse and the marriage ends but the spouse is still a legal immigrant or U.S. citizen, but has not been married long enough to be eligible for ex-spouse benefits under Social Security, usually, there will be a maintenance award in a divorce or a significant inheritance from a spouse following the spouse's death.

If someone has a U.S. spouse of someone eligible for Social Security, or someone is a minor child of a person entitled to Social Security, that person can receive survivor's benefits, without having personally paid any FICA or self-employment taxes (which are paid in lieu of FICA taxes by self-employed persons). Almost 10% of Social Security beneficiaries (about 6 million people) receive Survivor's Benefits.
Another 3 million people (about 5% of beneficiaries) are spouses or children of retired workers who are not receiving Social Security retirement benefits on their own behalf. If you were married for at least ten years to someone entitled to Social Security benefits, you can receive social security benefits based upon their earnings, even if you are no longer married due to death or divorce.
Many other people who don't work 40 quarters may qualify for Social Security Disability Benefits. About one in six Social Security beneficiaries (about 10.6 million people) receive Social Security disability benefits either on their own behalf or because they have a disabled parent or spouse. Of those, about 1.8 million people are spouses or children rather than workers, who are not receiving benefits on their own behalf.

All told between the programs described in (4), (5) and (6) above, about 10.8 million Social Security beneficiaries receive benefits earned by a spouse or parent rather than from their own earnings.

Keep in mind that 40 quarters is only 10 years over a lifetime and not much needs to be earned in each of the quarters to qualify. For people who barely qualify for Social Security working only low wage jobs intermittently and part-time, they will still qualify for Social Security benefits and the minimum benefit is much larger than a return on what was paid into the system.

Cash welfare benefits are not social security earnings and are not subject to FICA taxation. Unemployment insurance benefits are taxable income for income tax purposes but are not subject to FICA taxation or self-employment taxation. Self-employed people pay self-employment taxes together with their income taxes in lieu of FICA taxation on their self-employment income.

There is also a means tested part of the Social Security program called SSI (Supplemental Security Income).

WHO IS ELIGIBLE FOR SSI?
Anyone who is:

aged (age 65 or older);
blind; or
disabled.

And, who:

has limited income; and
has limited resources; and
is a U.S. citizen or national, or in one of certain categories of aliens; and

NOTE In general, an alien who is subject to an active warrant for
  deportation or removal does not meet the citizenship/alien
  requirement.

is a resident of one of the 50 States, the District of Columbia, or the Northern Mariana Islands; and
is not absent from the country for a full calendar month or  for 30 consecutive days or more; and
is not confined to an institution (such as a hospital or prison) at the government's expense; and
applies for any other cash benefits or payments for which he or she may be eligible, (for example, pensions, Social Security benefits);
  and
gives SSA permission to contact any financial institution and request any financial records about you; and
files an application; and
certain other requirements.

Finally, many state governments have a limited welfare program to pay cash benefits to elderly people who don't qualify for Social Security benefits often called something like "General Relief". Twenty-six states have such programs and eligibility for these programs varies widely.

The percentage of people who don't qualify for any form of Social Security benefits is quite small, however, so General Relief programs are usually not very expensive for state governments.
In particular, it usually isn't possible to receive cash welfare benefits all of your life without being disabled, in which case you are usually going to be eligible for Social Security Disability payments or SSI. Most people who don't pay enough FICA taxes to qualify are either spouses of someone who is covered and entitled to benefits that way, or are government employees who may be eligible for a pension benefit from their government employer (even if they don't qualify for a defined benefit government pension, they will usually receive the governmental equivalent of a defined contribution 401(k) plan).
About 10% of seniors are under the official poverty line in the U.S. and many of them have some significant assets to support themselves even if they lack income. Seniors have a lower poverty rate than any other age group in the United States, but it isn't zero either. Many of the seniors in poverty still qualify for some Social Security or SSI benefits, but not enough to keep them out of poverty.
Answer: tl;dr It depends upon what you mean by "didn't pay I to the system." The non-partisan Government Accountibility Office (GAO) has released several reports, and there seems to be a wide range ($0 to as few as 18 months) of how much you have to pay into FICA to begin collecting Social Security checks.
As a government employee, you might pay as little as $0. In the GAO 2010 report, SOCIAL SECURITY ADMINISTRATION
Management Oversight Needed to Ensure Accurate Treatment of State and Local Government Employees noted:

At present, SSA and IRS managers do not know the extent to which wages are reported accurately or to which Social Security taxes are paid in accordance with program rules
State and federal officials found that, over decades, [...] in hundreds of districts, [...] some teachers were incorrectly paying Social Security taxes when they were not eligible to receive Social Security coverage. Others were not paying Social Security taxes although they were covered by Social Security.
Since IRS did not collect any back taxes from audited school districts, SSA and IRS officials told us that the U.S. Treasury and Social Security Trust Funds would effectively bear the cost of any long-standing coverage errors and FICA taxes that school districts and employees did not pay.

You might argue that those we're clerical errors, and shouldn't count, just because the mistakes occurred to long ago for the IRS to correct the error. There are other cases of government employees working only a single day, paying as little as $3 in FICA and collecting thousands in annual social security checks, fully following the law.

In 2004, Congress closed the loophole with legislation requiring public employees be employed for five years in a job covered by Social Security in order to be eligible for full spousal benefits.

The GAO report, SOCIAL SECURITY
Congress Should Consider Revising the Government Pension Offset "Loophole" notes:

Social Security's Government Pension Offset (GPO) exemption [...] prevents workers from receiving a full Social Security spousal benefit on top of a pension earned from government employment not covered by Social Security. However, the law provides an exemption from the GPO if an individual's last day of state/local government employment is in a position that is covered by both Social Security and their state/local pension system. In these cases, the GPO will not apply, and Social Security spousal benefits will not be reduced> In 2002, one-fourth (or 3,521) of all Texas public education retirees took advantage of this exemption.
In most schools, teachers typically worked a single day [...] the Social Security contributions deducted from their pay would total about $3 for the day. We estimate that the average annual spousal benefit resulting from these last-day transfers would be about $5,200.

So, before 2004 you could work as little a one day, and your spouse would be entitled to full spousal benefits. After 2004, as a government employee you only need to work five years instead of the typical ten years.
Illegal aliens are also entiltled to Social Security benefits, even if they weren't working in the U.S. legally at the time. In fact, the Totalizaion agreement with Mexico encourages them to do so, because they are entilted to benefits from working as few as 18 months, to as much as 9.75 years, even under a stolen identity. The 2003 GAO report SOCIAL SECURITY -
Proposed Totalization Agreement with Mexico Presents Unique Challenges notes:

SSA provided no information showing that it assessed the reliability of Mexican earnings data and the internal controls used to ensure the integrity of information that SSA will rely on to pay social security benefits.
Mexican workers [...] could qualify for partial social security benefits with as few as 6 coverage credits. In addition, under the proposed agreement, more family members of covered Mexican workers would become newly entitled
Under the Social Security Act, all earnings from covered employment in the United States count towards earning social security benefits, regardless of the lawful presence of the worker, his or her citizenship status, or country of residence.
Comment: *It depends upon what you mean by "didn't pay I to the system."* - The question stated did not pay FICA taxes which include the contribution to social security.
Comment: @Chad, if you consider $3 paying into Social Security (when you are likely to collect benefits for years, so be it)
Comment: - I agree that was an abuse...   But it is different than not paying anything ever and getting benefits.  Especially since the benefits were being paid to people who did fully contribute to SS.
Comment: @Chad, indeed they are different. That is why I said there was a range of paying into the system, anywhere from $0 to as little as 18 months of payments (where the "normal" amount is 120 months)
Comment: The question is about not paying in at all though.   Your answer, while containing good information, really does not answer that core question.  I think you are saying basically no, but you can get pretty close in some circumstances but it is really hard to be sure.  If there is a way for a person to get directly compensated (ie not through their spouse) then I would highlight that.
Answer: Yes. People collect SS without paying in one cent. A spouse who never worked a day in their life can collect 1/2 of their working spouse plus the working spouse gets all of theirs. Example; John collects $2,000 SS per month. His spouse never worked but collects $1,000 SS per month and John get his $2,000. That means $1,000 is paid from the fund even though no payment was paid into the fund by the spouse. And we wonder why SS is almost broke.
Comment: Also, if the working spouse dies, the non-working spouse will receive the full benefit.  I.e. the $2000 in your example.  But it's not quite true that nothing was paid in for the non-working spouse.  Spousal benefits have always been part of the system.  You could just as well say that people without non-working spouses are leaving money on the table.  It's much newer that both spouses work.  The reason why Social Security is running out of money is because people are living longer but not paying more.
Comment: @indigochild This post is accurate, if a bit snide. It is referring to survivor's benefits which are part of the social security program. https://www.ssa.gov/planners/survivors/onyourown2.html About 6 million people at any given time (about 10% of Social Security beneficiaries) receive survivor's benefits.
Comment: I downvoted for several reasons. The thesis isn't supported by the evidence (you would need some estimates for how many people actually do this). There are also no citations for any of this.
Comment: Re "*spouse who never worked a day*":  this is either poorly worded or factually incorrect.  Homemaking spouses generally do the unpaid work of maids, cooks, chauffeurs, day care, etc.  In effect their unpaid work enables the paid spouse to do more paid work -- it's therefore feasible that homemakers should be entitled to a share of those proceeds.
Comment: @agc The point is that someone who wasn't paid into the SS Trust Fund via FICA taxes through wage withholding, or through self-employment taxes can still be entitled to a Social Security benefit. This is a good policy IMHO, and importantly was a design feature of SS in the first place (and SS is not in fact "almost broke" which is a question for another day).


Doctrine: GROUP BY HAVING

Question: I'm trying to do this:
SELECT
     userId, count(userId) as counter
 FROM
     quicklink
 GROUP BY
     userId
 HAVING
     count(*) >= 3'

In doctrine with the querybuilder, I've got this:
$query = $this->createQueryBuilder('q')
            ->select('userId, count(userId) as counter')
            ->groupby('userId')
            ->having('counter >= 3')
            ->getQuery();

        return $query->getResult();

Which gives me this error:
[Semantical Error] line 0, col 103 near 'HAVING count(*)': Error: Cannot group by undefined identification variable.

Really struggling with doctrine. :(
Comment: I think it's complaining that `count(*)` is not `count(UserId)`
Comment: `count(*)` is not an identifier. You should use your alias `counter`.
Answer: Your SQL is valid, Your query builder statement is invalid
All cause db will execute that query in following order:
 1. FROM      $query = $this->createQueryBuilder('q')
 2. GROUP BY  ->groupby('userId') // GROUP BY
 3. HAVING    ->having('counter >= 3')
 4. SELECT    ->select('userId, count(userId) as counter')

So as You can see counter is defined after its use in having.
Its SQL Quirk. You can not use definitions from select in where or having statements.
So correct code:
$query = $this->createQueryBuilder('q')
            ->select('userId, count(userId) as counter')
            ->groupby('userId')
            ->having('count(userId) >= 3')
            ->getQuery();

return $query->getResult();

Do note repetition in having from select
Answer: I am going to answer for people who still have this type of error.
First things first, you seem to have translated a native sql query inside a query builder object. More so, you have named your object as q
$query = $this->createQueryBuilder('q');

What this means, in general, is that every condition or grouping etc you have in your logic should address fields of q: q.userId, q.gender, ...
So, if you had written your code like below, you would have avoided your error:
$query = $this->createQueryBuilder('q')
            ->select('q.userId, count(q.userId) as counter')
            ->groupby('q.userId')
            ->having('counter >= 3')
            ->getQuery();

return $query->getResult();

Answer: I think you are missing the 'from' statement
Comment: `createQueryBuilder`, called inside a repository, doesn't need a root entity declaration (aka FROM). The root entity is the repository's related entity.
Answer: $query = "t, count(t.userId) as counter FROM YourBundle:Table t group by t.userId having counter >1 ";
return $this->getEntityManager()->createQuery($query)->getResult();

This should work. You can even do left joins or apply where clausules.
Answer: you can define HAVING parameter via setParameter() method as well
 $qb->groupBy('userId');
 $qb->having('COUNT(*) = :some_count');
 $qb->setParameter('some_count', 3);

Doctrine: GROUP BY HAVING


Value investing

Question: Does value investing work? More specifically, I've taken Dr. Damodaran's course on valuation (available online at his website) and have read parts of his textbook "Investment Valuation", and am coming from a dcf vantage point. The fundamental ideas behind it (that you are buying a real company whose value is the future cash flows discounted by its risk) seems to make sense (at least, if I was buying a business next door that's what I would do). On the other hand it's common knowledge that it is notoriously difficult if not impossible to consistently beat the market (Malkiel, Fogle etc.) and it's better to buy index funds. So my question is, is there any evidence that value investing actually beats the market? Is the whole field a waste of time (applied to the stock market, it would presumably be useful in actual buy outs)? As an aside, why does it seem to be difficult to get a conclusive answer to this question?
Comment: @JackSwayzeSr I agree completely that professionals have more time, information and skill, but now the problem becomes how good are you at finding a manager that is good at value investing.  In the end is that worth 75bps in fees?  The data is much more clear here a pretty strong no.  Here is a great review article  http://papers.ssrn.com/sol3/papers.cfm?abstract_id=955807
Comment: It is very difficult to get a conclusive answer to this question because everyone has a different bias towards the market. Even in value investing, different analysts will give the same company a different value, because the value is based on future cashflows, so one analyst will make different assumptions from the information they have at hand to get to a valuation different from other analysts. And lastly it is not impossible to consistantly beat the market, I have seen some beat it cosistantly each year for more than 20 years, and not by a couple of % point but by more than double.
Comment: You are aware that one way an index fund saves money is that they use the research done by another group to make decisions. Thus there can be a value index fund.
Comment: My combined index fund investment has been beating the market over the long term, at moderately low risk... but its design goal was just to deliver market rate of return. If there was an easy way to beat the market, people would be using it and market rate of return would adjust itself accordingly.
Comment: Define "work" here. Fama and French's study would be my initial thought on value investing working but it depends a great deal on how precisely can you define your terms here without being wishy washy or having grand ideas, e.g. that value investing is a silver bullet is a bit of a myth.
Comment: http://www.ft.com/intl/cms/s/0/21237608-ad00-11e3-af3e-00144feab7de.html#axzz3xEWkATMq may be useful as an article on value investing with some references to consider, e.g. Buffett and Graham.
Comment: I assume that you mean 'does value investing work when __you__ do the evaluation (of the individual companies). Answer: maybe, if you have sufficient time, resource information and skill. However, wouldn't a dedicated, professional have more time, information and skill than you? I know a professional would have more time, info, and skill than I would. So wouldn't it be worth the 0.75% (or so) management fee to have a professional actively manage a fund dedicated to value? So the answer is to find a value fund, not to do the analysis of individual companies yourself.
Comment: @JBKING By "work" I mean beat the market over the long term. The term value investing doesn't have a clear definition but I would probably define it as an attempt to buy companies which are underpriced. Different value investors may have different ways of measuring value but I'm *assuming* that the strategies won't be wildly different. Also, I can't see that article but it does look interesting, so if you could cite the relevant parts that would be very useful.
Answer: The June 2014 issue of Barclays Wealth's Compass magazine had a very nice succinct article on this topic: "Value investing – does a rules-based approach work?".  It examines the performance of value and growth styles of investment in the MSCI World and S&P500 arenas for a few decades back, and reveals a surprisingly complicated picture, depending on sector, region and time-period.
Their summary is basically:

A closer look however shows that the overall success of value
  strategies derives mainly from the 1970s and 1980s. ... in the US, value has underperformed growth for over 25 years
  since peaking in July 1988. Globally, value experienced a 30% setback
  in the late 1990s so that there are now periods with a length of
  nearly 13 years over which growth has outperformed.

So the answer to "does it beat the market?" is  "it depends...".
Update in response to comment below: the question of risk adjusted returns is interesting.  To quote another couple of fragments from the piece:

Since December 1974, [MSCI world] value has outperformed growth by
  2.6% annually, with lower risk. This outperformance on a risk-adjusted
  basis is the so-called value premium that Eugene Fama and Kenneth
  French first identified in 1992...

and

That outperformance has, however, come with more risk. Historical
  volatility of the pure style indices has been 21-22% compared to 16%
  for the market. ... From a maximum drawdown perspective, the 69% drop
  of pure value during the financial crisis exceeded the 51% drop of the
  overall market.
Comment: Are these numbers quoted on risk adjusted or absolute return figures?
Comment: @SMeznaric: Article does mention risk in a couple of places (will update answer above to quote them) but is more interested in total return.  I have seen it *claimed* elsewhere that value style *should* have less potential downside because... well, if cheap stuff got any cheaper it'd be snapped up.  No idea how true that is though.
Answer:
As an aside, why does it seem to be difficult to get a conclusive answer to this question?

I'm going to start by trying to answer this question and I think the answer here will help answer the other questions.  Here is a incomplete list of the challenges involved:

Defining value investing: Mr. Damodaran has one method, but there are thousands of thoughts on the matter.  For instance, Fama/French and Warren Buffet both have methods of determining "value" that are very different from Damodaran.
Turning signals into portfolios: how much do you buy of each?  Only U.S. stocks?  How long do you hold to see if your signal works? These questions can make a huge difference.
Testing: What time period? Do you control for risk?  What do you define as "the market."
Persistance Even on average how certain are you that things that worked in the past will continue to work?  Especially if a bunch of people are trying to do the same thing now that it is famous and bidding the prices up...
Randomness: You can find the perfect value investment and it could be an Enron or the whole market could tank.

So my question is, is there any evidence that value investing actually beats the market?

Yes there is a lot of evidence that it works and there is a lot of evidence that it does not.  timday's has a great link on this.  Some rules/methods work over some periods some work during others.  The most famous evidence for value investing probably comes from Fama and French who were very careful and clever in solving many of the above problems and had a large persistent data set, but their idea is very different from Damodaran's, for instance, and hard to implement though getting easier.

Is the whole field a waste of time?

Because of the above problems this is a hard question.  Some people like Warren Buffet have clearly made a lot of money doing this.  Though it is worth remembering a good amount of the money these famous investors make is off of fees for investing other peoples' money.
If you understand fundamental analysis well you can get a job making a lot of money doing it for a company investing other peoples' money.  The markets are very random that it is very hard for people to tell if you are good at it and since markets generally go up it is easy to claim you are making money for people, but clearly banks and hedge funds see significant value in good analysts so it is likely not entirely random. Especially if you are a good writer you can make a more money here than most other jobs.
Is it worth it for the average investor saving for retirement?  Very, very hard to say.  Your time might be better spent on your day job if you have one. Remember because of the fees and added risk involved over say index investing more "Trading is Hazardous to Your Wealth."
Answer: One aspect of this - no matter which valuation method you choose - is that there are limited shares available to buy.
Other people already know those valuation methods and have decided to buy those shares, paying higher than the previous person to notice this and take a risk.
So this means that even after you have calculated the company's assets and future growth, you will be possibly buying shares that are way more expensive and overvalued than they will be in the future. You have to consider that, or you may be stuck with a loss for decades. And during that time, the company will get new management or their industry will change, completely undermining whatever fundamentals you originally considered.
Answer: The Investment Entertainment Pricing Theory (INEPT) has this bit to note:

The returns of small growth stocks are ridiculously low—just 2.18
  percent per year since 1927 (versus 17.47 percent for small value,
  10.06 percent for large growth, and 13.99 percent for large value).

Where the S & P 500 would be a blend of large-cap growth and value so does that meet your "beat the market over the long term" as 1927-1999 would be long for most people.
Comment: This may be biased by the current trend of investors demanding that small companies be managed for dividend rather than growth.
Answer: If you take a look at any stocks in the stock market, you will see at least a 50% percent move for every stock between the 52-week-low and the 52-week-high. Especially during 2021 - 2022, Chinese ADRs traded on New York Stock were going through a real rollercoaster ride. For e.g. $PDD dropped over 80% in 13 months and made a 3-fold from the very low in the next 12 months. You really not gonna believe that the value of the company was really that volatile. Value investors took advantage of those stocks, invested with a margin of safety, and made a fortune.
But there were also many value investors who got scared and dumped $BABA during the drop. Some factors that scared them:

a military confrontation between China and USA / Taiwan
Delisting
Crackdown of Chinese companies by Xi
Covid etc.

But most of them were either unjustified and temporary headwinds
An excerpt from Buffett's 1987 annual letter already discussed it:
<code>Ben Graham, my friend and teacher, long ago described the
mental attitude toward market fluctuations that I believe to be
most conducive to investment success.  He said that you should
imagine market quotations as coming from a remarkably
accommodating fellow named **Mr. Market** who is your partner in a
private business.  Without fail, Mr. Market appears daily and
names a price at which he will either buy your interest or sell
you his.
     Even though the business that the two of you own may have
economic characteristics that are stable, Mr. Market's quotations
will be anything but.  For, sad to say, the poor fellow has
incurable emotional problems.  At times he feels euphoric and can
see only the favorable factors affecting the business.  When in
that mood, he names a very high buy-sell price because he fears
that you will snap up his interest and rob him of imminent gains.
At other times he is depressed and can see nothing but trouble
ahead for both the business and the world.  On these occasions he
will name a very low price, since he is terrified that you will
unload your interest on him.
     Mr. Market has another endearing characteristic: He doesn't
mind being ignored.  If his quotation is uninteresting to you
today, he will be back with a new one tomorrow.  Transactions are
strictly at your option.  Under these conditions, the more manic-
depressive his behavior, the better for you.
But, like Cinderella at the ball, you must heed one warning or everything
will turn into pumpkins and mice:

Mr. Market is there to serve you, not to guide you.
It is his pocketbook, not his wisdom, that you will find useful.
If he shows up some day in a particularly foolish mood,
you are free to either ignore him or to take advantage of him,
but it will be disastrous if you fall under his influence.
Indeed, if you aren't certain that you understand
and can value your business far better than Mr. Market,
you don't belong in the game.

As they say in poker, "If you've been in the game 30 minutes
and you don't know who the patsy is, you're the patsy."
</code>
The existence of Mr. Marekt is the most important reason why value investors like Buffett can compound money over 80 years with a CAGR of over 20%.
Watch my channel or other value investing channels that show you how everyone can be a value investor and beat the market consistently, then you'll learn more (channel in profile description)
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).

Value investing


Can I rsync directories to replace a node with a new server?

Question: I have cluster cassandra-2.2.19-1 with 4 nodes. I want to move one of the nodes to a new server. Is it possible to just rsync the cassandra directories, put out the old node and start a new one. Will this method work?
Answer: Yes, if you rsync the directories (data and config, mainly), stop the old node and start the new one, it shouldn't be able to tell the difference.
The real question is, can the new node have the same IP address as the old?  If not, then you might be able to make that work by specifying a replacement address in the conf/cassandra-env.sh:
JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address=address_of_old_node

Answer: Using rsync to populate the disk on the new node is going to be problematic because the data directories are not static and are constantly mutating with new SSTables from memtable flushes (new writes) and compaction tasks.
The recommended procedure for replacing nodes in a cluster is the "replace address" method. This operation "swaps" out a node and replaces it with a new server.
Here are the steps:
Preparation
Step A1 - Perform a rolling repair, one node at a time, by running the following on ALL nodes in ALL DCs:
$ nodetool repair -pr

Step A2 - Install Cassandra on the new server.
Step A3 - Configure Cassandra on the new server.
Replace method
Step B1 - Stop Cassandra on the existing node (node to be replaced).
Step B2 - Reconfigure Cassandra on the existing node to prevent it from rejoining the cluster by accident. For example, set the following properties in cassandra.yaml:
cluster_name: 'REPLACED'

seed_provider:
    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
      parameters:
          - seeds: "127.0.0.1"

Step B3 - On the new server, add the following line to the end of conf/cassandra-env.sh:
JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address=IP_of_existing_node

Step B4 - Confirm that auto_bootstrap: false is NOT set in cassandra.yaml because it will prevent the node from requesting data from other replicas in the cluster.
Step B5 - Start Cassandra on the new node.
Monitor the progress of the startup process with nodetool netstats and watching the system.log.
When the startup has completed successfully, the Cassandra process will be listening for CQL client connections on port 9042 (default) and you will see a log entry similar to:
... Starting listening for CQL clients on ...

Cleanup
Step C1 - When Cassandra has started successfully on the new node, remove the replace_address flag from conf/cassandra-env.sh added in step B3 above. Cheers!


Uncaught SyntaxError: Unexpected token ) when using void()

Question: I get this error and I've managed to narrow it down to:
aaa

That line of code is now the only thing in my source code and still I get the error in title. Any idea why so?
Even when surrounded with the appropriate HTML elements (html, head, body etc) I am still thrown the error. The error shows up in Chrome dev console and via alert if I include a
window.onerror

function in the head tag. It also occurs when the myFunction() method actually exists. As far as I can gather, there is absolutely nothing wrong with that above statement whatsoever.
Answer: Use
aaa

void expects a parameter.
There's an interesting discussion on using void(0) or other techniques here.
Answer: Is because void takes one argument.
You want:
aaa

Answer: void is an operator, not a function. It requires a single expression as its operand. () is not a valid expression. The correct syntax is:
aaa

You can put parentheses around 0, but they're not necessary, just as you don't need parentheses around 0 when writing 3 + 0.


How can I prevent a neighborhood tomcat from harassing my neutered female cat when she goes outside?

Question: We live in a fairly agricultural area, so we don't keep a litter box.  My 2-year-old female cat goes outside to play and do her business.  She was spayed at around 7 months old, but the large neighborhood tomcat continues to terrorize her.  I had assumed once she was spayed, there wouldn't be any issues.  I don't want to lock my cat inside.
What can I do to prevent these attacks?
Comment: Is the Tom a stray?  If so you could "Fix" the problem (Neuter not sopranno style) that might reduce the territoriality that it is showing.
Comment: @Chad - Catch and fix might not work, either. In my experience, a tom neutered as an adult is likely to stay territorial and keep asserting his dominance. On the plus side, a fixed tom isn't going to be siring kittens on every intact queen in his territory.
Comment: Problem solved! I managed to trap the tomcat and relocate him. He was too busy asserting his dominance to try to exit through the one open window in the house right next to him.
Comment: Not sure whether it's a stray. The problem is how to catch him, though.
Comment: [Live Trap](https://www.google.com/shopping/product/5533338092752124313?q=live+catch+traps+for+cats) - You could also relocate the tom to an area far away or to a shelter if it is a stray. We have a shelter that is home to many feral cats nearby.  You may have one too.
Comment: I have the same problem. My lady cat is 10 years old, and there are two toms nextdoor who are similar age. For many years we had no problem, but then a few years ago both toms decided to mark my place as their property, and would several times a day 'patrol' and chase my lady if they found her. She went from being content in her garden, to being nervous, and several stress signs started to appear (overgrooming). I cannot think of any way of keeping them out, apart from 24/7 vigilance - which isn't possible. Just to complicate it, she seems to miss them when they are not around.
Answer: In my experience there really isn't much you can do - without getting a dog (and having the "fun" of introducing your cat to the dog) the best I've ever managed is to chase the offending cat off my property any time I see him around. That tends to make the tomcat a bit more circumspect around your property - which should give your cat a safe-ish outdoor area.
The only other option I can suggest is an outdoor cat run she can access from indoors (usually via a cat door) where she has plenty of space but the tomcat can't get to her. That's going to cost you either money or time.
Unfortunately, your cat being spayed isn't enough for some toms, particularly if there's a queen in heat and they can't get to her. They're going to try to mate with anything feline that holds still long enough.
Also, there's some dominance behavior going on here - the tom regards your property as part of his territory, and he's trying to ensure that your cat acknowledges him as the top cat.
I'd suggest you keep an eye on her - in situations like this it's not uncommon for the female cat to be injured trying to escape the tom. More than once I've had to take neutered females to the vet to treat bad claw wounds near the base of the tail.
Comment: I have a permanently open window that she can use to get inside, but as you rightly said, it's while escaping from the tom that she gets injured and loses her fur :|


Military Symbols in Flex Viewer 2

Question:
I want to create Military Symbols in Flex Viewer 2. How I can accomplish it, including all the names and their code in an XML file and calling it within flex viewer is a pain. Is there any SDK available for this purpose. That can generate symbols for me with like MOLE provides.
If the SDK is available for JAVA or .NET, Please point it out, I will get an idea from it. I had heard about Defense Solution SDK and ARC Objects but want a bit guidance.
Answer: Create your MXD and add military symbols as described in help topic Adding Military Symbols to a Map. Publish the MXD (or MSD) to ArcGIS Server. Then add the MapServer or FeatureServer as a layer in your flex viewer. It will automatically pick up the symbols.
Comment: Hmmm... Not sure how you could easily do that. There are thousands (possibly 10,000's) military symbols. Your best bet may be to build an Server Object Extension that navigates the military symbology database and returns search results to the end user.
Comment: Thanks for the answer. I think my question was incomplete. Actually I want to allow users to draw MOLE Symbols on the run time. Not a published symbol. I will provide those symbols in widget, so that users can choose and draw from them.

Military Symbols in Flex Viewer 2


Is it possible to install a solid state drive into a Sun Ultra 40 M2 workstation?

Question: Our Sun Ultra 40 M2 workstations came with SAS drives, but my understanding is that the backplane will support both SAS and SATA. Sun's docs specify a very limited number of supported drives, but I'm wondering if anyone has actual experience installing a solid state drive. We're looking at the Corsair P128, but any advice is welcome.
Answer: That model will definitely support 3.5" SATA disks so if you buy wisely you'll be able to fit SSDs inside, get them connected correctly and use them. That said be aware that generally speaking a regular disk will rarely, if ever, reach it's highest temperature, they tend to top-out at about 55 degrees centigrade, in my own tests of SSDs inside servers I've seen SSDs hit, and stay around, 70 degrees under load - and not all servers or disk enclosures are built to scrub that kind of heat - I just wanted you to be aware.
Answer: Sun like most vendors doesn't want you to install third party equipment if they can help it, that being said SAS and SATA are both standards and most of the solid state drives I have used over the years are standards compliant and will slot right in without any problems.
Comment: So do you need to get a SATA backplane to slot in a SATA SSD or can you just plug into the Ultra 40 motherboard?
Comment: I think the ultra 40 motherboards are SATA compatible (as thats the standard drive) and you can plug it in. But to make sure find out what the controller is from Sun. I don't have this hardware on hand.


How does the Little Sister Madness mechanic work in Dragon Star Varnir?

Question: What exactly is it that increases the Little Sisters' madness levels in Dragon Star Varnir? Picking up chests, number of battles, time spent, or what?
Answer: Answering my own question here because I scoured the internet for the answer before I spent 2 days running experiments to prove the answer. The definitive answer is distance traveled, and nothing else. If you walk for 2 minutes and 15 seconds, the sisters will go from green to blue. Another 2:15 for blue to yellow, 4:30 to red, 6:45 to purple, and another 6:45 until they disappear. Feeding them 5 dragon meat "heals" approximately one and a half blue states, that is, about 3:30 worth of walking, though it cannot go below zero.
For a much deeper dive on this and the methodology I used to find this out, and some advice on how to mitigate this and stay below red the entire game but still get every core and chest, check here: https://gamefaqs.gamespot.com/ps4/243641-dragon-star-varnir/faqs/79247


When should the jungler give mid blue buff?

Question: As a jungler, mid always asks for the second blue, but I need the experience and the buff. Am I wrong to think this? Generally speaking, when should you give blue to your mid, and when should you keep it for yourself?
Answer: It depends.
If the mid player uses a champion that can take great advantage of blue buff - for example Anivia, Ahri, Karthus and most other mana based casters - then giving them the blue buff is the most important action you can do to win the game.
Having blue buff on one of the mid characters often means they can win the lane so they will be twice as strong in the lategame which will then allow your team to win every teamfight later on.
This is also the reason why you should try to deny the opponents blue buff if you get the opportunity - if both have blue buff it cancels out. Every second that your mid has blue and the opponent doesn't is a second that he can bully the opponent out of CS.
As Jungler your goal is not to win the game, your goal is to help the others win their lanes. Missing out on that experience and gold is easily worth it.
However, there are exceptions:

As first exception there is of course the case where mid doesn't need the mana and does not rely that much on the cooldowns. As an example champions like Kennen or Vladimir - while they do benefit from blue buff - can do ok without.
In that case you should look at who else in the team could use the blue buff, for example if you are on the blue side and you have Jax in the top lane he can make good use of an early blue since he's very mana reliant in the early game.
Another exception are mana dependant Junglers like Amumu and Fiddle that usually need the second blue for themselves before their mana regen becomes good enough. In that case take it but the third and following ones should still go to the others in your team.
The last exception - something you should avoid at all times but sometimes can't - is when your team is just bad. I don't mean mid dying once or twice, i mean when they go 0/5 under the enemy tower and such, then you might be able to do more with the blue buff than they would do, after all it's better someone on your team has blue than your mid donating it straight to the opponent.

When in doubt, give blue to your teammates.
Comment: Another consideration is if you're able to steal the enemy team's blue, if *both* the jungle and mid have blue you'll have a serious advantage.
Answer: This is of course your own decision. You are the jungler, you are in charge of the jungle. If you decide to keep the blue and the midlaner attempts to take it, make sure you have smite.
Be careful, as some people get very offended when they don't get blue, especially at mid rating.
Answer: I'm going to disagree; unless you're Fiddles, you should be giving the second one to your mid lane and all others after, and I'm not sure you are playing Fiddles, so you can afford to give your blue to your mid.  The blue buff is a huge deal for an AP caster.  The spell spam gives them an increase in lane control and the CDR is a big damage increase during fights.  The CDR isn't going to be as strong on the jungler, and the jungles that have mana issues can just get a Philosophor's Stone, which leads to a Shurelia's ,which is always a big deal for initiation in teamfights.
Answer: If your midlaner just doing bad and you know what you're doing just keep it. Said enough


Can I use the KVV (Karlsruher Verkehrsverbund) regiomove app without an address in Germany, Austria, Switzerland, or France?

Question: I'm visiting Baden-Baden for little under a week, and it would be convenient to be able to use the public transport system to get around. As such, I downloaded  their app and verified my phone number and email, but then I hit a roadblock: the app asks for my name and address. Name is fine, but address is a problem as they only allow Germany, Austria, Switzerland, and France as countries. I don't have an address in any of these countries. I tried calling their support, but he was unable to do anything and instead suggested I go to their customer support office in Karlsruhe, which is over an hour away from where I'm at. Their English website doesn't even seem to mention the app1, which is understandable given that the app doesn't seem to have an English translation. Is there any way I can use this app without having to have an address in Germany, Austria, Switzerland, or France? Or, alternatively, some other way of buying tickets for public transport in this area from my phone?
Comment: This seems to be part of their **regiomove** system which includes booking of tickets. They state that the address is needed for any future contact/contract. If you have a hotel address use that. Their hotline is +4972161075885.
Comment: I'm pretty sure you can put your hotel/AirBnB address
Comment: More phone numbers: https://www.kvv.de/service/kundenzentren.html
Answer: Yeah, the Regiomove app sucks, but there are alternatives: you can buy KVV tickets through Deutsche Bahn's DB Navigator app, which lets you select an address in a country basically anywhere. And there's also the Fairtiq app, which doesn't require an address at all (note that you have to have location and internet always on for Fairtiq, as it calculates the fare based on actual distance travelled).
If you require further assistance, there's a Baden-Baden public transport customer centre at Augustaplatz.


Authorizing someone else for in-person passport renewal

Question: I need my US passport renewed in the next two weeks, but I'm unable to make it in person to a passport office. If I send my documents to a family member, can they apply for an expedited renewal in-person on my behalf?
Answer: According to Get a Passport in a Hurry:

Note: If you are a first time applicant, or if your most recent passport is lost or stolen or was issued more than 15 years ago, you must submit a Form DS-11 and apply in person at an authorized passport acceptance facility.

If you must apply in person (for the above reasons), then you must sign the form in the presence of the Acceptance Agent. From First Time Applicants:

Please note that you:

Must not sign the application until instructed to do so by the Acceptance Agent.
Comment: This makes sense. Any insight into whether my presence is required if I want to register in person for a reason _other_ than the ones specified? Namely, I need the renewal expedited, but I am not a first-time applicant nor has my last passport been lost or stolen.
Comment: Well I don't know anything other than what I read there, but it seems like you should be able to apply for expedited service by mail.


Value-at-Risk formula with GARCH-model

Question: I'm totally aware of that if we look at some loss process $L_t$, then $\text{VaR}(\alpha)$ is a quantile of the loss distribution. If we assume that $L_t=-X_t$ is the negative returns and they follow a GARCH-model, such that $X_t=\sigma_t Z_t$ where $Z_t$ is i.i.d. noise with mean 0 and variance 1, how do one prove the following formula:
$$\text{VaR}_t(\alpha)=\sigma_t F_t^{-1}(\alpha)$$
where $F_t^{-1}$ is the inverse assumed distribution function for the noise process? I can't find the way through since I would expect $F_t^{-1}(\alpha)$ to be the inverse distribution function of $\sigma_t Z_t$. Which properties of the inverse distribution function are we using to get through?
Answer: $Z_t$ has some distribution with zero mean and unit variance. The $\alpha$-level quantile of $Z_t$ is $F_{Z_t}^{-1}(\alpha)$. If you scale the distribution of $Z_t$ by multiplying it by $\sigma_t$, you get that each quantile gets multiplied by $\sigma_t$ (recall that $Z_t$ has zero mean; otherwise an adjustment for a nonzero mean would be due). Your confusion likely stems from the following false intuition:

$F_{Z_t}^{-1}$ is the inverse assumed distribution function for the noise process <...> I would expect $F_{Z_t}^{-1}(\alpha)$ to be the inverse distribution function of $\sigma_t Z_t$.

(I have replaced $F_t$ in your notation by $F_{Z_t}$ when quoting.) The problem is that
multiplication of $Z_t$ by $\sigma_t$ shifts the quantile; $Z_t$ and $\sigma_t Z_t$ do not have the same quantile unless $\sigma_t=1$.
Answer: In VaR it is the distribution function of your loss forecast. You make a forecast of volatility for time period $t+h$ as: $\hat \sigma_{t+h}|I_t$, which allows you to propose the distribution of losses $\hat L_{t+h}|I_t$. In particular for next period $h=1$ forecast $\hat L_{t+1}|I_t$ in GARCH it's very simple, since you assume the normal distribution of noise. Hence, $F(L)$ is the CDF of normal distribution $\mathcal N(0,\hat \sigma^2_{t+1})$. Notice that for $t+1$ in GARCH the volatility forecast is not stochastic, you know all the inputs at time $t$ to calculate $\hat\sigma^2_{t+1}$.
It gets a bit more complicated when you make $h>1$ steps ahead forecast. In this case the usual approach is to simulate volatility paths $\hat\sigma_{t+i}$ for $i=1,\dots,h$ recursively, you'll be sampling from $r_i\sim\mathcal N(0,\hat\sigma^2_{t+i-1})$ to get the next $\hat\sigma_{t+i}$ until reaching $\hat\sigma_{t+h}$. At which point you sample a loss $L_{t+h}\sim\mathcal N(0,\hat\sigma^2_{t+h})$. After repeating this in Monte Carlo setup, you get the set of $\hat L_{t+h}$ from which you can calculate VaR using a variety of techniques as simple as $\alpha$ quantiles.

Value-at-Risk formula with GARCH-model


How to turn off alternative Enter with Ctrl+M in Linux

Question: Why is Ctrl+M bound to Enter in Ubuntu Jaunty? How to turn it off?
I'm using Emacs and would like to bind Ctrl+M to some other command.
Comment: Linux is a too general term, you will at least need to tell us which distribution and terminal emulator you're running.
Comment: @adamse: I've got Ubuntu Jaunty.
Comment: Am removing linux tag because it's nothing to do with Linux.
Comment: @Trey: I was not initially sure where I neede to change the key binding in Linux or in Emacs, but the answers came out to be about Emacs. However now I'm pretty sure I need to change the binding in Linux so I'm creating a new question http://stackoverflow.com/questions/2299142/how-to-assign-newline-functionality-in-ubuntu-jaunty-to-enter-directly.
Answer: I think your question is backwards. It is not C-m that is bound to Enter, it is Enter that is bound to C-m. And C-m is the same as RET.
If you run C-h k C-m, you will see something like "RET runs the command ...". C-m sends RET because it is a control code, see http://en.wikipedia.org/wiki/Control_character.
The Enter key is bound to C-m; if you run C-h k Enter, you will see something like "RET (translated from <return>) runs the command ...". See, Enter is being interpreted by emacs as <return> and then that key is getting translated to C-m.
What you want to do is first remove the translation from <return> to RET by binding it directly to what it's currently indirectly bound, e.g. (global-set-key (kbd "<return>") 'newline). Then you're free to bind C-m to whatever you want without affecting Enter.
This assumes you're using the graphical emacs. If you're running it in a terminal, this won't work, because Enter will send C-m, not <return>. You can check that using the window-system variable though.
Comment: "Then you're free to bind C-m to whatever you want without affecting Enter." - well.. wrong! For one thing the recipe breaks  behavior in minibuffer context.
Comment: 'C-h k' runs the command 'describe-key', which will ask you which key you want to describe, then pop up a help buffer which tells you what command the key is bound to and what that command does.
Answer: Note: The issue isn't limited to Linux, it exists on Windows (and presumably Mac) as well.  Read the other (non stack-overflow) source of all knowledge: Wikipedia on Carriage Return.
If you want to rebind C-m, be sure to all bind <return> otherwise you run the risk of no longer being able to use the Enter/Return key.  Also, in a terminal, Emacs cannot distinguish between the two (C-m and <return>).
In a plain Emacs, the Enter/Return key is bound to <return>, which is (by default) translated to RET (same thing as C-m).  If you only rebound the C-m, you'd also be affecting the Enter/Return key.
Try C-h k <return> and you'll see

RET (translated from <return>)

So, rebind both in the appropriate keymap to make sure you get the behavior you want.
It might be instructive to play with the following code:
(defun my-return ()
  (interactive)
  (message "return"))
(defun my-ret ()
  (interactive)
  (message "RET"))
(defun my-c-m ()
  (interactive)
  (message "C-m"))
(global-set-key (kbd "<return>") 'my-return)
(global-set-key (kbd "C-m") 'my-c-m)
(global-set-key (kbd "RET") 'my-ret)

Put that in your *scratch* buffer and press C-j after each line (to evaluate the sexp).  Then play with the Enter/Return keys and C-m.
Answer: input-decode-map does the trick. Quote from the emacs manual:

This keymap has the same structure as other keymaps, but is used differently: it specifies translations to make while reading key sequences, rather than bindings for key sequences.

It's the same principle like I've presented above, transforming Ctrl+m to something, say Ctrl+1
and map Ctrl+1 to your command. I use Ctrl+m for backward-kill-word.
Here you go:
(global-set-key (read-kbd-macro "C-1") 'backward-kill-word)
(define-key input-decode-map "\C-m" [?\C-1])

Comment: `(define-key input-decode-map (kbd "C-m") [?\C-6])
(define-key input-decode-map (kbd "C-6") [?\C-m])
(define-key input-decode-map (kbd "") [?\C-m])`
What do you think about that @StefanH? Seems to work - no search mode trouble or like. But I'm not emacs expert, so any thoughts? :)
Comment: This works most of the time. A problem that I've seen using this, is when I'm trying to escape i-search mode with RET , it executes backward-kill-word.
Answer: It's unclear whether the previous answers have solved this question, so here's another spin on it:
Historically, "return" frequently meant two things: Carriage Return, and Line Feed.
Quoting wikipedia:

Originally, carriage return was the
  term for a mechanism or lever on a
  typewriter that would cause the
  cylinder on which the paper was held
  (the carriage) to return to the left
  side of the paper after a line of text
  had been typed, and would usually move
  the paper to the next line as well.
  Later it was used for the control
  character in Baudot code on a
  teletypewriter for end of line return
  to beginning of line and did not
  include line feed.

Long story short, there are two ASCII codes that are relevant to end-of-line (and, therefore, potentially to the return key): CR (ASCII decimal 13, or Ctrl-m) and LF (ASCII decimal 10, or Ctrl-J).
I think the general convention these days is for the return or enter keys to map to ASCII 13, and thus be "return" (RET in emacs messaging).  But if you're running emacs from a terminal emulator, this may mean that you don't have the option of having a C-m binding that's different from RET.  When I try running emacs in a terminal (GNU Emacs 23.2.1 on MacOS X in Terminal.app), and I try typing C-h c <return> (i.e. pressing my return/enter key), I get:
RET runs the command newline

If I type, instead, C-h c C-m (i.e. holding down control and pressing M), I get:
RET runs the command newline

In other words, the exact same thing.  Emacs (nor any other program run from the terminal) can't tell the difference between the two.  (Knowing this can sometimes be handy -- if you're logged in to a system that maps things differently than the system you're coming from, you can type C-m or C-j to get the thing you want, depending on the way the mapping is screwed up.)
And speaking of having the mapping screwed up, I'll just mention that there are some stty settings that can be relevant to such things: inlcr, inlcr, and igncr (these three are related to how input is processed -- there are also some output-related ones).  I doubt that making stty changes is going to be useful to this particular problem, but I thought it worth mentioning.
In the end, I think your choices are:

Live with not having C-m that means anything different than return/enter
Run a graphical version of emacs, instead of the terminal version.  This should have access to the distinct keycodes, which the terminal emulator isn't passing along (because it's emulating a terminal, which didn't have such things in the same way as modern computers do).
Answer: (global-set-key (kbd "C-m") 'cmd) ;
Where cmd is your command should remap control m...
As for why ctrl+m is bound to enter. I believe it had something to do with some older keyboard not having enter,tab, backspace, etc... ( I could be grossly mistaken)
For example ctrl+h is backspace, some unix operating systems will output ^H when you hit backspace on them!
Comment: Okay, what I wanted to say is that since Enter is interpreted as  and it in its turn is translated to RET, Enter starts to work as cmd as well as Ctrl+m.
Comment: Saves 'pinky stretch' on my keyboard, so I actually find it rather handy when used with the Ctrl --> Caps Lock remap. One less reason to leave the home keys. Perhaps this was more pronounced on earlier keyboards?
Answer: The main source of the problem is that Enter and Ctrl-M both map to the same ASCII code (13). You would only be able to map them distinctly on a system that can distinguish them.
Comment: Ctrl-M is synonymous with ASCII (decimal) code 13, which is CR (Carriage Return).  There's also code 10, a.k.a. Ctrl-J, a.k.a. NL (New Line), or sometimes called LF (Line Feed).  It's true that the return/enter key is often mapped to the former, but that's not *always* the case.
Answer: Actually, this is a very tricky question, you won't get it right with:
(global-set-key (kbd "") 'newline)
because that return (RET) is newline in just some particular cases. You will see the weirdness I'm talking about if you try that in your .emacs
I've found an ugly but working solution by using some KDE events application,  and bound Ctrl+m to Ctrl+1 . I've chosen that because I wouldn't use that combination (Ctrl+1) but you can choose something else.
This way, in emacs (but in my X environment) I don't get the RET (or linefeed character) when I press Ctrl+m, instead I get Ctrl+1.
And then, I did something like:
(global-set-key "\C-1" 'mycmd)
The problem is, that now I use awesome window manager, and I don't know how to do that X mapping again.
If you don't use KDE, you search for something similar in Gnome.
Answer: Some very good explanations here as to the nature of the problem, and I won't expound on those issues. However, I want to address the original question directly. I solved the problem for changing the (control m) sequence bound to 'newline command by the following code in my ~/.xemacs/custom.el file:
(defun my-compile-hook-for-c-and-cpp-mode ()
  "My compile hook for C and C++ mode"
  (local-set-key [(control m)] 'compile)
  )

(add-hook 'c-mode-hook 'my-compile-hook-for-c-and-cpp-mode)
(add-hook 'c++-mode-hook 'my-compile-hook-for-c-and-cpp-mode)

In the above example, I have changed (control m) to run the 'compile command (M-x compile) when the c-mode or c++-mode is active.
Note that you can change the behavior of (control m) globally as well, without the mode related bindings. In that case, just add the following to your ~/.xemacs/custom.el file:
(global-set-key [(control m)] 'compile)

Comment: PS: I just checked with emacs 23 as well, and you can add these lisp statements in the `~/.emacs.d/init.el` file and they work just as described above.
Comment: Emacs 24 here. This still rebinds the return key.


can one recite Tachanun standing?

Question: If one doesn't have a chair available can one recite tachanun standing since he cant do nefillas apayim anyway sitting without a sefer torah as a yachid at home ?
Comment: I've always assumed sitting went hand-in-hand with nefilas apayim, but see [here](https://judaism.stackexchange.com/q/2553/6592) and [here](https://shulchanaruchharav.com/nefilas-apayim-in-an-area-without-a-sefer-torah/) for more discussion.
Answer: The OU writes:

Shulchan Aruch (OC 131:2) writes that the proper position for
nefilas apayim is to be sitting. The Mishnah Berurah (131:10)
cites the Beis Yosef who writes this is based on Kabbalistic sources.
However, the Mishnah Berurah (131:38) notes that the Rivash
disagrees and writes that both sitting and standing are acceptable for
nefilas apayim. The Mishnah Berurah concludes that in cases of
necessity, one may rely on the Rivash and stand. For example, if a
person standing behind you is reciting Shemoneh Esrei and as such, it
is not permissible to sit, Tachanun should be said with nefilas apayim
while standing. The Eliyah Rabbah (131:4) writes that if one is reciting Tachanun without nefilas apayim (such as when there is no Sefer Torah), Tachanun may be said sitting or standing, though the Kaf Hachayim (131:38) is not in agreement.
Comment: Note unquestionably the proper position for falling on ones face is fallen face down on the floor. This is all discussion of what best to do when various approximate submissive postures are impractical since even if you skip tachanun entirely you still fulfilled your obligation in shmone esrei.
Comment: How so in the Amidah? Through the forgiveness tefillah ?

can one recite Tachanun standing?


Parity and chirality

Question: I don't exactly understand how parity is related to chirality. On wikipedia it says that the parity transformation can be thought of as a test for chirality of a physical phenomenon. How those two concepts are related?
Comment: relevant  my answer here https://physics.stackexchange.com/questions/678426/why-do-we-care-about-chirality/678437#678437
Answer: Chiralty comes from the greek word for hand and can be traduced as handedness in english.
Something is chiral if it is not invariant under a parity transformation. Prototypes of this appear in classical mechanics and field theory. An example of a chiral object in classical mechanics is the angular momentum.
I see particle physics mentioned as a topic, but even though the term chiral is most often used in particle physics I feel like as a term it is equally valid in any other fild of physics.
I'm gonna still use the Dirac equation as an example of chirality in particle physics because maybe it is the most common example. The Dirac equation reads
\begin{equation}
(i\gamma^\mu\partial_\mu - m)\psi = 0
\end{equation}
The chirality operator is $\gamma^5 = i \gamma^0\gamma^1\gamma^2\gamma^3$ and in an appropriate representation of the Clifford algebra $\{\gamma^\mu, \gamma^\nu\} = 2\eta^{\mu\nu}$ called the chiral representation this matrix is diagonal. A parity transformation of a spinor is represented by the matrix $\gamma^0 $ hence computing the transformed chirality operator
\begin{equation}
\gamma^0\gamma^5(\gamma^0)^{-1} = - \gamma^5
\end{equation}
In this sense a left handed fermion (i.e. eigenvector of $\gamma^5$ with eigenvalue 1) becomes a right handed fermion under parity.
Comment: Why is the parity transformation represented by gamma^0 in the dirac spinor space?

Parity and chirality


Can Pantheon's ult dodge Karthus' ult?

Question: Can Pantheon dodge Karthus' ult while in the air from his own ult?
Also, can other champions dodge it with their abilities, such as Fizz's E?
Answer: Unlike Fizz, Pantheon's Grand Skyfall imparts no kinds of invulnerability. Case in point: if Pantheon ults on top of Viktor's Gravity Field, he will get stunned before landing.
Pantheon is unable to be selected by targeted abilities, due to not being physically on the map, but any AoE effects, including Reqiuem (Karthas' Ult) will have no trouble dealing damage.
Answer: OLD question, but I've wondered the same thing after seeing this clip:

Pantheon can dodge Karthus ultimate.

Can Pantheon's ult dodge Karthus' ult?


How do I help to heal a bird that has fallen from its nest?

Question: I was going to mow my lawn, when I heard a eally high pitched squeal from my tree. I went over to examine, and their was a small blue bird. I don't really see blur birds, and they aren't exactly what you can consider your common bird. I want to do anything I can to help the birdy heal. It doesn't seem exactly hurt, and I need to know what to do because it will not climd back into its tree, and is so scared. I feel so bad for the poor guy!
Comment: If it has sustained any injury or not, you must visit vet.
Comment: Voting to close as off topic [per this meta post](https://pets.meta.stackexchange.com/questions/13/are-questions-about-semi-domesticated-wild-animals-on-topic) it would be ok on The Great Outdoors, but would be duplicate there so not migrating [How should I rescue a baby bird, including when it's wet?](https://outdoors.stackexchange.com/questions/19625)
Answer: Unless you are able to put the bird back into its nest, there is very little you can do.
It is sad, but true; sometimes the strongest chick in a nest pushes its siblings out of the nest. This is nature's way to be sure the strongest chick survives.
If the chick is almost ready to fly you can try to feed it back to health, but this is very hard to do. First of all, you need to give it the right food and you need to feed it about every 20 minutes; and second, you need to keep it warm and this is hard, hard to do; it needs a temperature of about 39 °C (this is the body temperature of many birds).
You can ask a vet if there are any organisations doing bird rescue in your area.
Answer: Keep it in a warm place and feed it , the first thing it needs is water.  If you can put back into the nest that would be good.In the states it would likely be a bluebird but they are not nesting in winter. You should be able to identify it and find out what food it needs on the internet, feed it soon. Vets are not likely much help ; for our parrots we must search to find a vet that knows much about them. I raised a crow , its nest was 80 ft high so no help. It was very young. I was able to feed it but mostly by luck ( before the "net"). It left the following spring although it was loose outside the first summer and fall, it hung around the house.


Drawing "transparent" text via C# Graphics, but in a way that it turns the drawn text to be "missing" so it's transparent in the resulting image

Question: I am looking to draw a string on a DC (Graphics - I am using C#) - but I want the drawn text to be "deleted" from the image so that what's left is essentially a cut-out of the text.
If I was to DrawString with a transparent brush obviously nothing would have happened.
Is there a way of drawing something like that, or do I need to use 2 DCs and BitBlt with some combination of NOTs or XOR or whatever (I did similar things years ago, but was wondering if there's an easiery way)?
Answer: If you want to cut sth out of the image, you can do it like this:
Drawing2D.GraphicsContainer c = graphics.BeginContainer();
GraphicsPath p = new GraphicsPath();

p.AddString(...);

graphics.SetClip(p, CombineMode.Xor);
graphics.DrawImage(this.Image, this.Location);

graphics.EndContainer(c);

It's like the solution farther above, but first without SetClip the Graphics-Object doesn't get updated, and second, you need to use Xor.
Note, that making a GraphicsContainer is optional, but makes encapsulation easier, especially if you work with transforms.
Answer: You might want to try:
// g is your Graphics object
using (var path = new GraphicsPath())
{
    path.AddString(.... );
    g.Clip.Exclude(path);
}
// Do your other painting here

Sounds like this may require you to make a new image and draw the old one on top.  I'm not to sure of your situation though.
Answer: From a quick search it unfortunately doesn't look like System.Drawing supports XOR drawing and you need to use unmanaged calls to GDI+. This answer to a similar question links to a page that might explain how to do that - the interesting file is here.
Hope this helps.
Answer: You could set Graphics.CompositingMode to CompositingMode.SourceCopy - but I'm not sure if that will work with transparent content.
The way around this is to:

Draw your text to a separate image using red brush over black background.
Iterate over each pixel of text image and target image...
...manually set target image pixel color's Alpha value according to text's image Red component.

If speed is not a concern and you deal with small bitmaps, you can use GetPixel and SetPixel methods. But I would recommend using LockBits to access BitmapData directly and process pixels in a byte array. This is fast and not-so-hard-to-implement solution, although you'll have to deal with "unsafe" code (or use the Marshal class).
LockBits reference on MSDN
Marshal reference on MSDN
Comment: Thanks.. I gave up on this particular endevour... I started doing the get-pixel solution, but it just was not worth the effort.


List/Workflow Calculations set field and display updated results in real-time?

Question: I have what I can only assume is such a basic issue that I am overcomplicating and that is why I can't seem to find a solution.
I have a list and want it to add two columns together and place the total in a third column. I can make a workflow to do this but for some reason I am unable to find a way to have the total display on the workflow. Nothing happens until the page is refreshed. This also leads to the potential problem of people changing numbers without the list refreshing and then getting conflicts.
Is there not a simple way to run basically the equivalent of a SUM function in Excel that is immediately (at least relatively) saved and updated in the list?
Update: Going to assume I can't comment because I had only set up a guest account initially. That may work if it updates in real-time. I'm surprised something so simple isn't... simpler. I was hoping to avoid getting into the code but nothing else seems to work so I'll give it a shot. Thank you for the response!
Comment: you mean calculated columns? https://msdn.microsoft.com/en-us/library/office/bb862071(v=office.14).aspx
Answer: I ended up just embedding a Google spreadsheet using the following instructions and it was extremely easy to set up, supports formulas, support live updates to the data, and even has multiple tabs. Wish I had found that option a week ago!
http://googledrive.in30minutes.com/google-sheets-embed-live-spreadsheet/


Ubuntu Server 12.04 remote desktop access

Question: I have an Ubuntu 12.04 server at home with GUI running.
It does many things, like Apache virtual hosts (several WordPress sites hosted for me and my mates), Samba server, Mini DLNA server and some other stuff. It's great, we think it's the ants pants in our house, it serves media all round the house flawlessly (much more useful and better than our old rig which ran Windows 7). I use Webmin to manage just about everything on it. Big up to Webmin, it's great, but it has limitations (for me and my limited skills).
Here's the thing. When I am away from home (a lot), I want to be be able to drive the Ubuntu server desktop (is that an oxymoron? maybe I mean Ubuntu server GUI) remotely (I know I should learn command prompt via ssh, but I am stupid and don't have time. ;) Last time I opened the port (22) to SSH, I read the logs and was getting hammered by hacking attempts. So I closed the port on the router.
Our Internet connection at home is cable and super fast. When I am away from home I use a 3G connection on an iPad retina and a laptop running Windows. Way too slow to get torrents (not to mention expensive for data).
So, my question is "How do I connect to my server remotely with VNC client or something like that and operate it like I am sitting in front of it with the GUI?"
Webmin is good, but I want to use a browser on the server remotely and start torrents. So when I get home, everything is done and waiting for me to watch on my DLNA enabled devices at home.
Comment: Have you looked at [VNC](http://www.realvnc.com/)?
Comment: I read somewhere that there is something like VNC installed already with Ubuntu server. I'd like to use a "native" application rather than something that uses more resources and may not be optimised. Maybe VNC is it. I have used VNC at work previously, seemed pretty good (on a windows machine). Is this "the one" that I should use? I'll read the stuff on it and get it working if it is. I guess I am looking for advice on the best software to use, please.
Comment: BTW my server GUI is Unity
Answer: Use TeamViewer.
It is the best free solution available for Ubuntu.
By best I also mean easiest to setup. And by easy to setup, I am not saying that I am 100% sure that no tweaks are required after installing it. But that you don't have worry about network settings or anything like that. Just have it installed on both devices and you can connect to other device and control it as you would be sitting behind it.
Answer: For management of a server I highly suggest ssh which is a command line tool. The vast majority of server management is editing files, installing software, and starting stopping services, all of which is trivial on the command line.
For ssh security, use keys and disable password authentication. See:
https://help.ubuntu.com/community/SSH/OpenSSH/Keys
How to harden an SSH server?
Installing a desktop such as Unity adds very little, and VNC servers are commonly cracked. If you must VNC, tunnel it over ssh or use FreeNX with is fast and secure. I am not sure about TeamViewer.
In addition, IMO, a large desktop such as Unity adds packages potentially introducing security hole and complicating server management (upgrades).
IMO the best graphical solution is webmin. Webmin is a graphical interface for server management and is better suited to server management then any of the desktops (unity/gnome/kde/etc).

For webmin see: https://wiki.ubuntu.com/webmin
http://ubuntuserverguide.com/2012/06/how-to-install-webmin-on-ubuntu-server-12-04-lts.html
Answer: Type in Unity Search: Remote Desktop
and activate the settings.
This allows you to connect remotely to your Ubuntu.
See the following article for more details:
http://www.makeuseof.com/tag/ubuntu-remote-desktop-builtin-vnc-compatible-dead-easy/


What is/is there a word for singing through your nose?

Question: I recall there being a word for nasal singing, I might be imagining things, but haven't had any luck finding that word on Google. Does any one have any suggestions?
Comment: Are you referring to "humming"?
Comment: I'd read about Bobby McFerrin. If there's a specific name (other than humming), it will be found somewhere around him.
Answer: Are you talking about nasal voices? If you are I have some medical jargon for you.
rhinolalia is the medical term for this nasal speech.
This can be further classified into hyponasal speech (hypo-rhinolalia) and hypernasal speech (hyper-rhinolalia). Wikipedia has a superficial discussion on these topics if you care.
Hope this is helpful.
Answer: How about the term "rhinophonia?"


Junction object allows to create only one related list

Question: I have created a junction object that relates Case (with related list "A") and Account (with related list "B") objects with each other. I want to place both Related Lists on the Case Layout page, but for some reason only related list "B" of the Account object is available to include on this layout from the Related Lists selection box. The related list "A" bar does not even appear in the Related Lists box to select fields, lists, quick actions etc. from. How can I make it work to include both of the lists?
Answer: This is working as expected. You can't add the Case related list to a Case layout as your junction object will be linking that Case to many Account records. You'll see the same behavior if you attempt this from the Account object.


Can the ArcGIS Pro deep learning tools detect objects in non-nadir imagery?

Question: I have been asked to look into developing a deep learning tool to identify objects from 360 degree panoramas. Can this be done using the deep learning tools in ArcGIS Pro? I suppose there are two issues here. First is it suitable for images not at a nadir angle and secondly are stitched panoramas a suitable source. Very new to all of this.
Answer: In Esri's world non-nadir imagery is referred to as oriented imagery. This video on Driving Intelligence from Video and Oriented Imagery at Scale Using AI in ArcGIS (presenters David Yu, Shairoz Sohail, and Rob Fletcher) from the Esri 2020 Developer's Summit talks about one example of how oriented imagery could be used with AI in ArcGIS. This should answer the first part of your question - can the Esri AI tools be used with non-nadir imagery. I don't know enough about the topic to be able to answer the second part of your question regarding stiched 360 degree panoramas.


Are pans allowed in hand luggage?

Question: I am traveling via Easy Jet from Berlin airport. am I allowed to take metal/steel pans + sandwich maker in my hand luggage?
Comment: Does this answer your question? [Larger metal objects in hand luggage](https://travel.stackexchange.com/questions/20130/larger-metal-objects-in-hand-luggage)
Comment: The accepted answer to the question linked by David is as much official info as you can get. As an anecdote, I personally flew several times in the EU with a carry-on full of pots, pans and other kitchen implements and nobody batted an eyelid. It's hard to imagine you could hijack a plane using a pan, so you shouldn't have trouble convincing curious security people that these are not on the forbidden list. However, leave extra time for the security check as your luggage might get selected for thorough examination, which can easily take half an hour.
Answer: In my personal experience, I have travelled several times in the EU with metal pans (and even cutlery at times) in my carry-on, heading for a camping trip.
I have never had issues with it, but it seems to vary according to airports and people who check your bag.
I agree with @TooTea. Not a very formal reply, but pans do not seem to be strictly regulated on planes.
Hope it helps!

Are pans allowed in hand luggage?


Obtaining user table for one site on multisite set up

Question: I'm trying to select only users that are registered for a specific site on my multisite set up and see that the table for the users has collected everyone that is on the network. Is there away I can get only the users on a specific site? Or only select the users from that specific site?
Answer: Yes, all the WordPress Multisite users go into the {$wpdb->prefix}users table; that way they form a pool of users that can each be given access to one or more sites in your network.
You can get the users for a given site by using get_users(), which can take as an argument the ID of a given site:
// get users for site example.com/my-site
$args = array(
    'blog_id' = get_id_from_blogname( 'my-site' ),
);
$users_for_site = get_users( $args );

If you're using Multisite, and the blog_id argument isn't set, you'll get the users for the current site.
Comparing email addresses
By default, get_users() returns an array of WP_User objects, so you should be able to compare your list of email addresses (assumed to be contained in the array $my_user_emails in the code below) to the list of addresses returned by get_users():
// uses $users_for_site from the previous code block

$no_email_entered = array();
foreach( $users_for_site as $user ) {
    if( ! in_array( $user->user_email, $my_user_emails ) ) {
        $no_email_entered[] = $user->user_email;
    }
}
// $no_email_entered should now contain all the email addresses
// in the list of site users that are *not* in your table

References

get_users()
get_id_from_blogname()
WP_User class
Comment: Thanks, how could I compare this information to the data in a separate table? I want to see how many registered users did not input their email into a form I created and made a table for.
Comment: I've updated my answer to cover one way to do this. There are probably more elegant ways to do it, but this should work.