Is there an example of a variety over the complex numbers with no embedding into a smooth variety?

Question: Is there an example of a variety over the complex numbers with no embedding into a smooth variety?
Comment: I don't understand the question. What if the variety is singular? Or do you mean embedding of an analytic variety into an algebraic variety?
Comment: @shenghao: I think the OP is not insisting on an *open* embedding. A singular projective veriety admits an embedding into a nonsingular one!
Answer: Yes, there are even toric varieties. In fact, there are complete toric varieties with trivial picard group (see e.g., Eickelberg "Picard groups of compact toric varieties..." 1993). We have the following simple observations:
1) Any variety which can be embedded into a smooth variety has an ample family of line bundles.
2) A proper variety with trivial picard group cannot have an ample family of line bundles.
Comment: wait, isn't that a proof that it's not projective?
Comment: If it does not have any non-trivial line-bundles then, as you say, it cannot be projective. BUT, it can also not have any ample family of line bundles (any such family would be trivial => scheme is quasi-affine which is a contradiction to the properness) and thus cannot be embedded into a smooth variety by 1).
Comment: Section 2 of the paper "Higher K-theory of Schemes" (or SGA 6) has facts about ample families of line bundles; MR data is at http://www.ams.org/mathscinet-getitem?mr=1106918
Answer: A really neat well known example is as follows:
Choose a conic $C_1$ and a tangential line $C_2$ in $\mathbb{P}^2$ and asssociate to a point $P$ on $C_1$ the point of intersection $Q$ of $C_2$ and the tangent line to $C_1$ at $P$. This gives a birational isomorphism from $C_1$ to $C_2$. Identify the curves by this map to get the quotient variety $\phi:\mathbb{P}^2\rightarrow{X}$ with $C:=\phi(C_1)$. Now if there was an embedding of $X$ in a smooth scheme then, there would surely exist an effective line bundle on $X$, say $L$ whose pull back to $\mathbb{P}^2$ will obviously be effective. Let us see why this is a contradiction. Let $L'$ be the pullback of $L$ to $\mathbb{P}^2$. Note that the degrees of $L'|C_1$ and $L'|C_2$ both coincide with the degree of $L|C$ and are therefore equal. But $L'\cong\mathcal{O}(k)$ and therefore the degrees in question are $2k$ and $k$ respectively for $C_1$ and $C_2$. Therefore $k=0$ and $L'\cong\mathcal{O}$, which is non-effective! A contradiction!
In view of VA's comment, I give a complete proof here for constructing $X$ as a scheme.
In our special case it is a trivial pushout construction: Here I am thinking of $Y$ as $C_1\amalg{C_2}$, $Y'=C$ (the quotient by the birational isomorphism above), and $Z=\mathbb{P}^2$, but the argument is more general provided any finite set of closed points in $Z$ is contained in an affine open set. $X$ will denote the quotient.
Claim: Suppose $j:Y\rightarrow{Z}$ is a closed subscheme of a scheme $Z$, and $g:Y\rightarrow{Y'}$ is a finite surjective morphism which induces monomorphism on coordinate rings. Then there is a unique commutative diagram (which I don't know how to draw here, but one visualize it easily): $Y\xrightarrow{j}{Z}$, $Y\xrightarrow{g}Y'$, $Y'\rightarrow{X}$, $Z\xrightarrow{h}X$ where $X$ is a scheme, $h$ is finite and induces monomorphisms on coordinate rings and $Y'\rightarrow{X}$ is a closed immersion.
Proof: First assume that $Z$ is affine, in which case $Y,Y'$ are both affine too. Let $A,A/I,B$ be their respective coordinate rings. Then $B\subset{A/I}$ in a natural way. Let's use $j$ again to denote the natural map $A\rightarrow{A/I}$. Put $A'=j^{-1}(B)$ and $Spec(A')=X$. The claim is clear for $X$. Also if $Z$ is replaced by an open subset $U$ such that $g^{-1}g(U\cap{Y})=U\cap{Y}$, $X$ would be replaced by $U'=h(U)$ which is an open subset.
Now this guarantees the existence of $X$ once it has been shown that $Z$ can be covered by affine open subsets $U$ such that $g^{-1}g(U\cap{Y})=U\cap{Y}$. But this is obvious in our example. For our example it is also clear from the construction of $X$ that it is actually reduced and irreducible. QED.
I hope this is satisfactory.
Comment: "There would surely exist an effective (and nonzero) line bundle on X" for the following reason: take an open affine neighborhood U on the ambient smooth scheme Y which intersects X. Take a divisor $D_U$ on Y intersecting X, and let D be its closure. Then the restriction of $O_Y(D)$ to X is the required effective nonzero line bundle.

But why is it obvious that the quotient X is a scheme? It is an algebraic space by general Artin's results but why a scheme? The usual trick of proving that X is projective (and therefore a scheme) does not work.
Comment: @VA: I have edited my answer to include the proof.
Comment: I am almost sure that your Claim is false in general (without assuming existence of an invariant cover, which of course exists in our case). For example, let $Z$ be the affine line with doubled points, $Y=Spec(k[x]/(x^2)\oplus k[y]/(y^2))$, where $x$ and $y$ are the coordinates near the two copies of the doubles point, and $Y'=Spec(k[x,y]/(x^2,xy,y^2))$.
Comment: @t3suji: yes you are right. The correct hypothesis is that $Z$ must be such that any finite set of closed points is contained in an affine open set. This is how your example will not work. I will insert this into my answer now. Thanks!
Comment: I agree that gluing an affine scheme along a closed subscheme gives an affine scheme via a dual construction for rings. And having an invariant affine cover reduces the problem to the affine case. Very nice explicit example!
Answer: See example 4.9 in Ravi Vakil's paper http://math.stanford.edu/~vakil/files/asnjun18.pdf , and the references therein.


How do I store a value in a global variable and then use it in subsequent steps of a scenario in protractor cucumber typescript based project

Question: I want to retrieve a value in 'Given' function and then store it in a global variable so that the value is accessible in subsequent steps of a scenario in protractor cucumber typescript based automation project.
Answer: Go to your conf.js file and create an onPrepare function, there you can define and initialize a global variable. Below is a sample:
<code>exports.config = {
        directConnect: true,
        capabilities: {
            'browserName': 'chrome'
        },
        framework: 'jasmine',
        baseUrl: "http://url.com",
        specs: ['./*_specs.js'],

        onPrepare: function() {
            browser.driver.manage().window().maximize();
            //create a global variable like below
global.variableName = "hello";
        }
}
</code>


Should I mention that I quit my job and give up good salary to take a PhD degree in the personal statement?

Question: I have a good job and salary now. And I want to quit my job to take a Ph.D. degree, which means my income will be cut in half. Should I mention that in my personal statement to prove my dedication to academia? Would that be like I am looking down the academia as I quantify the benefits academia brings me with the money?
Comment: Out of curiosity, in which country and field is twice a PhD stipend a "competitive" salary?
Comment: One example, in the Netherlands, the PhD salary is up to 30,000 EUR. So double that would certainly be a competitive salary (overall, not accounting for age and area).
Comment: Everyone in academia knows how students are paid. *Everyone* applying to grad school is giving up a chance better salary somewhere else, at least temporarily if not permanently, so this won't set you apart I'm afraid..
Comment: Yeah, I know many people earn a lot. In fact, the "competitive" means "I am satisfied with". I will modify my words.
Comment: I didn't mean to imply anything, I was just genuinely curious.
Answer: In my opinion no. You should mention your current work and any relation it has to doing a PhD, and that you wish to now do research and gain a PhD. Emphasize why you want to do a PhD but do not compare your current job with that. Anyone reading your reference will likely make positive inferences about you having real-world experience and that you are following your heart. Generally try and steer away from any negative comments.
Answer: Being honest about your intentions should never be a bad thing...unless of course your intentions are bad! - I would suggest that you state that "in spite of a good job and good salary..." (or some such words) that you feel compelled to pursue your PhD (for whatever reasons you have.)  Quantifying the difference between current salary and PhD stipend does not necessarily 'prove' your dedication to academia so I would leave it out. Good luck!
Answer: If you don't mention it, they may have concerns about your plans. Broadly speaking, the "why do you want a PhD" discussion is much more important for applicants like you than it is for straight-from-college applicants. Some concerns they might have:

Does this person realize how low the stipend is?
Are they really prepared to give up that much money just for a PhD?
Are they going to try to negotiate for part-time status or something else that we don't allow?
Are they going to drop out after a year because they can't survive on the stipend?
Do they have a realistic understanding of what we do here? (As opposed to assuming that academia is a magical place where everything is perfect except money.)
Do they have realistic plans for what to do after they graduate?

So, I think giving some indication that you are aware of the financial implications of your application and have a plan for approaching them is very appropriate.


Reach IP in Parent Network

Question: We have a router (Router 2) inside a network (Router 1) with a client (Client in Router 2) that needs to make a TCP connection to a client in router 1. We only have access to configure Router 2 and the IP address of the client in Router 1 can change. How do we configure Router 2?
Comment: @RonTrunk Its not for school its a legitimate question. I just tried to phrase is as simply as possible to make people life easier to answer. R1 and R2 are directly connected (as shown on the diagram)
Comment: Welcome to Network Engineering!  This question sounds very much like a school assignment or homework problem, which is off-topic here.   If not, we would need more information.  Are R1 and R2 directly connected, or is there an intermediate network(s) between them?
Comment: Client 2 will need the address of Client 1 to initiate a TCP connection with Client 1. It must send a SYN to Client 1 at its IP address to start the TCP connection. For example, you do not know my IP address, so you could not initiate a TCP connection with my PC.
Answer: R2's configuration doesn't need to change, but client 2 needs to know the address of client 1, or it needs to resolve the DNS name for it.
It would be the same problem if there were no routers between client 1 and client 2.
Comment: Hi Ron, thanks for your answer. We do have the ip address of client 1, when we try to open a tcp connection from client 2 to client 1 using that ip address, it doesn't work.
Comment: Perhaps you can provide more specifics. Maybe the problem isn't your router.

Reach IP in Parent Network


Mobile Phone tethering in Ubuntu 14.04

Question: I have a Nokia C3-01.5 mobile phone I use it to get access to the internet on occasions from my laptop. I recently changed from Windows XP to Ubuntu 12.10. Tethering worked fine with blue tooth but I couldn't get my wireless to work. I changed to version 13.10 and I could then get my wireless to work but not tethering. I have now installed and updated version 14.04. My wireless works but I still can not get tethering to work either via blue tooth or USB Cable. After pairing the phone I select the "Access the Internet using your mobile phone (DUN) option but get an error message "Error timed out detecting phone details."
Can someone please tell me how I can get DUN through my phone in Ubuntu 14.04? I looked at some answers to similar problems when I had Version 13.10 installed and one suggested installing Modemanager but all this did was to stop my wireless working.
Comment: When you connect the phone and try to tether do you see any errors in /var/log/syslog?
Answer: I was able to get bluetooth tethering working in 14.04 with my lg phone. AT&T would not authorize my phone to do this without upgrading to a 5gb+ plan.
I installed https://play.google.com/store/apps/details?id=jp.co.nicumaru.bluetoothtetheronoff
and this seems to flip the switch allowing me to tether that AT&T and/or LG was blocking.

Mobile Phone tethering in Ubuntu 14.04


How to use SQLite database with the windows phone 7?

Question: I am developing window phone 7 application. I am new to the window phone 7 application. I am new to the  Application.GetResourceStream() method. I am using the following link in my application.
http://wirebear.com/blog/2010/11/12/using-sqlite-in-your-wp7-app
I am following the steps described in the above link. I am facing problem at  Application.GetResourceStream() method. In the above method I am using the following code
Stream src = Application.GetResourceStream(
                 new Uri(@"/SQLiteConnectivity;component/" + dbName,
                     UriKind.Relative)).Stream;

I have right clicked my project name & selected the properties & found the assembly name as 'SQLiteConnectivity'. After running the application I am getting the null reference exception error at Application.GetResourceStream(). I am also unaware of what should I use instead of 'component' in  Application.GetResourceStream() method. Can you please provide me any code or link or any solution through which I can resolve the above issue ?
Yes I got the answer as described in the answer section. I solved the above issue by setting the 'Build
Action' in properties of my database as 'Resource' & 'Copy to Output Directory' as 'Copy always'. But I am now facing the new problem
I have declared the following code in my app.xaml.cs
public partial class App : Application
{
    public PhoneApplicationFrame RootFrame { get; private set; }

    private DBHelper _db;
    public DBHelper db
    {
        get
        {
            if (_db == null)
                _db = new DBHelper("ExpenseManager.db");
            return _db;
        }
    }
}

and calling it in my mainpage.xaml.cs as follows
private void button1_Click(object sender, RoutedEventArgs e)
{
      // Code runs "for real"

    _customerEntries = (Application.Current as App).db.SelectObservableCollection<Category>("SELECT  Category_Name FROM Category WHERE Category_ID=1");
    textBox1.Text = _customerEntries.ToString();
}

I have added one class in below the the mainpage class as follows
public class Category
{
    public int Category_ID { get; set; }
    public string Category_Name { get; set; }
}

Now when I run my application I get the error on button click as 'file is encrypted or is not in a database' in the following function of SQLClient.cs at BindAll(ppStmt);
Sqlite3.Vdbe Prepare()
{
    Sqlite3.Vdbe ppStmt=new Sqlite3.Vdbe();
    if (Sqlite3.sqlite3_prepare_v2(_db, CommandText, CommandText.Length, ref ppStmt, 0) != Sqlite3.SQLITE_OK)
        throw new SQLiteException(Sqlite3.sqlite3_errmsg(_db));
    BindAll(ppStmt);
    return ppStmt;
}

Can you please provide me any code or link through which I can resolve the above issue ? If I am doing anything wrong then please guide me.
Comment: hi Shailesh, were you able to resolve this issue? I'm facing the same problem. The interesting part is, in the sample program a file name "Database.db" is attached and if i remove this file, sample program gives the same problem i'm facing. Check out http://sviluppomobile.blogspot.com/2010/03/sqlite-for-wp-7-series-proof-of-concept.html
Answer: You will want to verify your Database file's build property is set to resource and you will want to check the value of the dbName property to ensure it is the full file's name including any folder structure.
The db property of the App needs to be setup differently.  In your App.xaml.cs file please change this line:
public DBHelper db = new DBHelper("DATABASE.s3db");

to this:
private DBHelper _db;
public DBHelper db
{
  get
  {
    if (_db == null)
      _db = new DBHelper("DATABASE.s3db");
    return _db;
  }
}

Be sure to replace the DATABASE.s3db with the name of your database file including the folder structure.
For the error:
'file is encrypted or is not in a database'

What version of SQLite did you create this database in?  You must be using SQLite version 3.  If you are using SQLite3, do you have a password set on this database?
Comment: yes database files's build property is set to resource. Also there is no folder structure for dbName.
Comment: Great to here from you that 'let me know if you have any issues'. Thanks for your coopeartion. I am now facing one new problem. I have editied my question. Please guide me.
Comment: I have updated the answer with a couple of things to look for.
Answer: We can use like this...
private void button1_Click(object sender, RoutedEventArgs e)
{
  // Code runs "for real"

_customerEntries = (Application.Current as App).db.SelectObservableCollection<Category>("SELECT  Category_Name FROM Category WHERE Category_ID=1");
   foreach (Category me in _customerEntries )
     {
         fielddiscription.Add(me.field_description);//add to list
     }
}


Is it good to give food or drinks to a toddler at night after weaning off breast milk?

Question: I am in the process of weaning my toddler from breastfeeding. At the moment he still drinks milk (breastfeeds) at night. Once he stops breastfeeding completely, what should I do if he wakes up and seems hungry at night? Is it OK to offer milk, juice, or cereal?
Comment: "At night" as in "during the night" or as in "before bedtime"? And welcome to the site!
Comment: And how old is your child?
Comment: Nancy, welcome to Parenting.SE. We will need a bit more information about your child's age and the timing of the additional foods to give you a good, clear answer. Also, what information are you looking for when you say "good" -- healthy, important, good habits? Can you please **[edit]** to clarify?
Comment: we used to mix a tiny bit of rice cereal at the last bottle-feeding of the night for our daughters to have extra sustenance to sleep the night.  Part of sleeping through the night is metabolism.  I'm surprised that there aren't "sleep-the-night" formulations for baby-formula.  It is about having a little body-mass and a little nutrition - then it is about training habits.  Best of luck.
Answer: It's certainly OK to offer food or drinks at night, but teeth need to be brushed afterward.
You might decide to wean your child off eating at night in order to get uninterrupted sleep for baby and uninterrupted sleep for you too!  According to Ferber and my personal experience, in weaning off night feeds, when done gradually, your toddler will get used to not having a meal at that time. Eventually the hunger will shift to other times of day.
I weaned off breastfeeding at night, and replaced it with formula or whole milk for the first couple weeks when my toddler was waking for her middle of the night feed; I would reduce the amount in the bottle each night. I found that to be easier than cutting down on nursing time (putting her back in bed after 5 minutes of nursing made her really mad and awake).  But if the bottle only had a small amount in it, that was easier for her to accept.
Maybe that technique will work for you too.  At 18 months, we only give her water at night; she wakes maybe once night per week asking for water.
Answer: A snack before bed, brush teeth, then off to bed. If they wake at night offer a bottle of water.
With one of my children the night waking was so constant that I finally placed a bottle of water in her crib at night, she would wake, find it and drink a bit, then dose off again. When she moved into a bed the bottle was replace with a sippy cup of water.


Can I connect more than one breakout board to the Raspberry pi?

Question: I want to use Magstripe Reader,
Fingerprint sensor and the NFC reader all together,
Is it possible and if so it would be nice if you can reffer me where I can read how to do it,
Thank you.
Comment: Hello and welcome. While one could of course connect multiple devices to one Pi this cannot be answered in a general fashion. Please edit to include specific details for the devices to be connected... and remove the signature while you're at it (see tour and helpcenter to learn more).
Comment: I see you have added links to your question identifying the specific peripherals you are interested in connecting to a RPi.  Let us say it is possible.  But since these peripherals are not specifically designed for the RPi there is considerable work to be done both in hardware and software.  Guessing, based on the general terms used in your question, this will be challenging for you.  At this point, I need to also point out that even asking about how to connect just 1 of these peripherals  will take more than 1 stackexchange question / answer...
Comment: ...I suggest using the forums where you are purchasing these peripherals and start a discussion there.  A forum sounds like the format you need to get started.  However, if you are new to this, this will be a challenge.  A RPi is way more complex in terms of software and what it can do than an Arduino.  And the examples on the sellers site are connecting some of these peripherals only to an Arduino.
Answer: These three items are going to be difficult to directly link to the RasPi.
The MagStripe Reader and the Fingerprint reader are basically 5v devices and need TTL serial. The problem is that there is only one real serial port on the Raspberry Pi. You can get USB serial ports and you'd need two of them.
The NFC breakout board can use 3.3V I2C or SPI. This can be done directly through the Raspberry Pi's GPIO and the proper library.
My personal preference would be to use one of the small Arduino clones (or a PIC) that runs at 5 volts and has two serial ports. Or, if I couldn't find one with two serial ports, I would bit-bang one of them (using the hardware timers to emulate a serial port); this is much easier on a microcontroller than on a Raspberry Pi. The microcontroller can then communicate with the Raspberry Pi through I2C or SPI.
Just remember that you will need a level-shifter to go from a 5v device to the Raspberry Pi which is a 3.3v device. I would use this board.
Happy Making


Profile provder to limiting

Question: I am developing an app using .net mvc 2 c#.
I am using the built in membership and profiling framework of ASP.NET 2.0.
I have how run into a big problem. My profile provider has many properties, and I want to build a dynamic search feature of my members, using their profiles as filters.
This is a big problem because of the serialized way that profile data is stored - I'm not going to be able to be able to perform linq queries on this data.
Does anyone have any suggestions on what I should do?
I want to keep the membership api and sqlMembershipProvider, but want to also develop a custom table to hold my profile data?
Can any one point me in the right direction?
Thanks
Answer: This can be solved using the SQL Table Profile Provider in ASP.NET 4 Web Applications

Profile provder to limiting


Why there is no before-undelete event in Salesforce triggers?

Question: All events are having before and after events, but why is there no before-undelete event in Salesforce triggers?
Answer: Because, there will be no record available before Undelete to update. But After Undelete you will be having a record to update something with that record.
Answer: There is a record, it has the field isDeleted set to True.  Standard security means that these records are not visible, either via the UI or Apex, so an undelete trigger wouldn't be able to see the records that it needs.
Answer: Undelete means..already a record is deleted  from Salesforce DB/System and  trying to get that deleted record back to Salesforce Db/System.SO the record which is already deleted is not in the Scope of SalesForce System  and it will be in Recycle_Bin(Out of Salesforce System Scope)..So there is no "Before Undelete" Event in SalesForce.
Answer: The undelete operation creates a new Id for the restored record. Allowing the before event means that changes can be made to the record before it is put back into the database, which is the same as doing an insert operation since a new Id is created. To keep the authenticity of the data by guaranteeing that what goes to the recycle garbage can is exactly what is received during the restoration, the before event has been removed for undelete. This way we can guarantee the reliability of the data coming from the recycle garbage can and make a clear difference between the undelete and insert operations.


Calculation query in Access produces null result all the time

Question: I am trying to create a community database in Access (2003 preferably).  Part of the main table has several fields relating to personal relationships, with field names such as "Partner", Child_LT_16", Child_GT_16", "Parent", "Sibling" etc.  On the entry form each of these fieldu can have a number entered for the number of each kind of relation.  Each field is defined as "Integer".  The entry and normal display via a form is OK for this basic operation.  However I now want to have an additional field to be ised on Forms and Reports that show the total number of relations for each record.
I have constructed a query, with a calculated field of the form
Total_Relations:[Partner]+[Child_LT_16]+[Child_GT_16]+[Parent]+[Sibling]
This query doesn't throw any errors and runs without problems, BUT it doesn't return any value for any record.  In all cases the Total_Relations column stays blank (empty).
It is as though the query engine is seeing all the field values as EITHER empty (some are empty others have values usually between 1 and 3, virtually all have a numeriacl value somewhere in the various relations fields) OR taking the field value as text and giving it a NULL value (but the fields are defined as Integers.
I have tried various things including using VAL([Partner]) etc. in case the fields were being taken as Text.  In this case any record that had any NULL field threw-up an error message, only records where all relevent fiels had numeric values did not throw the error, but they still did't show a total (or any) value either.
I have tried recreating the query gain, from scratch, several time, but with the same result each time
I have done this type of calculation loads of time before without problem, but this one has me climbing upm the walls.
Any suggestions from anyone?
PLEASE............
Answer: In MS Access, if you add two (or more) values together and any one of them is null, then the result is null.
You need to check is each value null, or make the fields not null-able, so there will be zero values in there if nothing is entered.
Have a look at this for working with Nulls in MSAccess, Tip #5 is the one you want
Comment: @Old Gent: You could show your appreciation by upvoting this answer and/or selecting it as the correct answer. Just saying . . . :)
Comment: Thanks for the reply.  When I read it I really did feel stupid.  How could I forget something so relatively simple as NULL handling.  I am normally very careful at setting default values, but in this case left these values un-defaulted as i wanted the text-boxes on the form to be clear, not showing "0", but in the process forgot that this would leave the fields with NULL values.
Comment: I am now using Total_Relations:NZ([Partner])+NZ([Child_LT_16])+NZ([Child_GT_16])+NZ([Parent])+NZ([Sibling]) so that any Nulls will be treated as zeros.  This has solved the problem.  Thanks again for the help.


Can an operator acting on a wave function be equal to taking a measurement?

Question: I'm aware in general when an operator acts on a quantum wave function it is not the same as taking a measurement ie the hamiltonian acting on a superposition state will not give a constant multiplied by that state as taking an energy measurement on a superposition state will instead collapse it down to one energy eigenfunction probabalistically and will give the energy eigenvalue associated with that state. I am also aware that not all operators are hermitian so won't give real observables. However, would i be able to say that a hermitian operator acting on one of its corresponding eigenfunctions is the same as taking a measurement?
Answer: Mathematically, such an operator in that particular situation would have the same effect as an (ideal) measurement of the eigenized observable, i.e. it leaves the state unchanged, for the "state" is not the vector but rather the associated Hilbert space ray, and the introduced eigenvalue factor doesn't change that. But I would caution against reading too much into this - if anything, it's more of a "mathematical coincidence" than anything helpful about thinking of how measurements work in quantum theory.
Instead, a "better" way to think of Hermitian operators in the classic formulation of quantum theory is they serve as the analogues of physical quantities, but have the right mathematical structure to deal with the fundamental informational tradeoffs present at the quantum level. Hence there is not really a lot of direct meaning to the action of an observable operator $\hat{O}$ upon a state vector $|\psi\rangle$, i.e.
$$\hat{O} |\psi\rangle$$
defies any "intuitive" interpretation, and you should not seek one.
That said, I will admit that this is a bit of an unsatisfactory approach to quantum theory, because as you point out, say, the Hamiltonian actually represents an "action" being performed, namely the effect of dynamics, and the term "operator" also carries as kind of connotation of action, and so we might like to have a formalism where that carries to measurements too. And in fact, you can come up with such a formalism, and here's how.
The idea is basically to note that we can consider "measurement" of an observable to really be "answering a question" regarding its value or, that is to say, procurement of the truth or falsity of a proposition thereabout. For example, when it comes to the classic "spinning electron" problem with its "spin up" vs. "spin down" states, we are asking the question "what is the $z$-component of the spin of the electron?" which then in turn can be broken down into two yes-no questions, viz. "is the relevant component spin-up?" and "is the relevant component spin-down?" To each of those two questions, we can then assign a projector operator (or what I call an "answer operator") $\hat{\Pi}_{S_z}(S_z)$ which has the effect of changing a state vector $|\psi\rangle$ to another which is basically that one but with the information that the component had the value $S_z$, i.e. the post-measurement state you are thinking of. Hence, we can represent the observable as the total collection of such yes/no questions about whether individual outcomes did or did not obtain, and thus mathematically, a function that returns projection operators for each possible outcome - much like how a probability mass function assigns a probability to each possible outcome.
And likewise, in the most general case so we can also accommodate continuously-valued observables, we can describe these as analogous to probability measure functions, i.e.
$$P(X \in E)$$
the probability that the measurement of the variable $X$ lies within the set $E$, i.e. an event. Only here, what want is something that returns a projector operator that represents the action that happens, as you say, when a measurement reveals that the variable does indeed lie in that set:
$$\hat{\Pi}_O(O \in E).$$
Such a construction is generally called a Projection-Valued Measure or PVM, and you can, in fact, build QM on PVMs without ever needing to touch the classic "eigen" Hermitian-operator stuff. It's just that then more mathematical work is required to develop things like how that, say, the algebra of such PVMs, when understood as standing for observable quantities, would have to work. Personally, I actually would prefer the PVM approach because it lets you talk right off the bat about measurements with limited precision (i.e. "between which two ticks on the ruler does it lie?") and is more intuitive for just the reason you suggest - the application of the above to a state vector does exactly what you are trying to say it does, i.e. it makes it into what it would be after the measurement.
Moreover, a generalization of a PVM, called a POVM, or positive operator-valued measure, provides the most realistic model of the results of actual measurements in quantum theory. In particular, they are precisely what you get when you overlay the same kind of classical statistics that we would use to talk about errors in measurements at a classical-physics or general experimental science level, atop the PVM formalism just described.
Comment: @FlatterMann : yes, but the tenor of OP's post points to a different conclusion as to what _they mean_ by the term "measurement", and there they are referring to a certain term in a theory. The relationship of that term to real world application is, of course, a different question in its own right. But that doesn't change that they are asking a question about the formalism.
Comment: Except that what all of these prescriptions are predicting are not what experimental physicists are actually measuring in the laboratory. What we are really measuring can only be found in actual experimental papers and textbooks on the phenomenology of atomic, nuclear, solid state, high energy etc. physics. At this level the theory barely connects to the experiment, which in case of electron spins might be a magnetic field gradient splitting one beam into two. What we call "quantum measurement" is really just an abstraction that drops all of the actual physics.
Comment: @FlatterMann: Sure, but unless that evidences novel principles that are not present in quantum theory at all and that those principles are formulated into a coherent set of physics at the same level of logical cogency (which somehow never comes up in even one discussion of these foundational matters), some variant of the above postulates will be needed _somewhere_ in giving a complete theoretical account of that experiment.
Comment: Moreover, OP wants to know about how the structure of quantum theory works. Talking about how to describe a realistic setup in excruciating detail with quantum theory is like talking about how to describe a realistic fluid dynamics calculation in classical mechanics as a way to understand the structure of classical mechanics.
Comment: It is not about new principles but about a fundamental misunderstanding of the relationship between the theory and the actual phenomenology. Experimentalists are not performing what is called a measurement in the von Neumann formalism. Many practical experiments (but not all) are measuring scattering cross sections instead. Atomic, nuclear and high energy physics are falling into this category and many observations in solid state physics (crystallography) are of this type as well. In neither case can we ever hope to fully reconstruct a wave function from experimental data.
Comment: The question was about measurement. As far as I know measurements are still done in the physical domain and not on paper. If not, then we can shut CERN down right away and leave it to the theoreticians to come up with the TOE without any further hints from nature. That would also be much cheaper.
Comment: It is never too late for getting a different perspective, though.
Answer: No. I am aware of only two uses of operators acting on states:

Generating time, space translations and rotations using Schrodinger-like equations

$\langle \psi |A| \psi \rangle$ is the expected value of the operator in a large number of measurements. This is the closest thing to what you want.
Answer: No, operators are not the same thing as "taking a real measurement". At the end of the day a quantum measurement is always an irreversible energy, momentum, angular momentum and charge transfer but in an experiment this can become a frequency, a distance measurement, a time difference or even a temperature measurement (among a plethora of other things). If we take many such quantum measurements, however, and do a bit of post-processing, then we can recover probability distributions that are similar to what we get from some of the measurement operators in von Neumann's Hilbert space formalism. The details of this post-processing depend very much on the physical system we are investigating. It is usually done by experimentalists rather than theorists (or theorists who are working on the experimental side) and the details can be found in textbooks about atomic, nuclear, high energy and solid state physics, among others. They are rarely mentioned in theoretical textbooks about quantum mechanics because there is no simple, one-size-fits-all kind of explanation for what real measurements are. Most of the details of the translation process depend on how experimentalists manage to use the limited tools that nature provides us with (vs. the unlimited mathematical expressions that theorists have access to).
A simple example of the necessary intermediate step are optical line spectra in atomic and molecular physics. The formalism gives us energy levels but in an experiment we can only measure differences between energy levels and even then we don't know a priori which levels they belong to. That has to be reconstructed from other data, e.g. how the wavelengths shift with an external electric and magnetic field. That may not sound like a big deal, but it does give you a hint that the math that we use to solve the Schroedinger equation is not quite the same as the physics of actual quantum systems.


Using Associated Press photos

Question: I am kinda unclear on how/if I can use AP photos.  There are quite a few sites that use it with a credit underneath it.  Is that enough?  Do you still need the express written consent they talk about on their site?  Does anyone run a site using AP photos?
Answer: They have a page called "Buy AP Photos". I'd say that implies they require either purchase or licensing. That page also lists whom to contact about it:

To reprint AP photos/graphics for commercial or editorial use
E-mail:email@example.com
Fax:+1.212.621.1955.
Answer: According to their FAQ you need to submit a request in writing.
Comment: Ya I saw that too, but if you are writing a news story, won't it take too long to turn around a request like that?  That's why I was hoping to hear from someone who's done it before...everytime I want to use one and writing for permission seems...onerous.
Answer: Newspapers or TV stations can enter into agreements between the Associated Press and their organization for content licensing. However, since you asked only about images, I'm assuming that you're not an online newspaper.
Besides for that, there are two options:
First, and I quote the AP:

If you are not a member of The Associated Press, but want to receive AP news for your Web site or wireless service, company intranet, desktop or other interactive application, you can contact AP Digital by e-mail at firstname.lastname@example.com.

You may be able to discuss multiple image licensing with AP Digital, if that is what you want (as I understand from your comment on BenV's answer).
Second, as John Conde points out, AP Images may be able to help you out as well, and they may also be able to answer questions about multiple image licensing.
Or, if for some odd reason you should prefer to use traditional mail (dunno why since you're here on Webmasters, but still), AP's licensing division can be reached at:

Copyright
The Associated Press
450 W. 33rd St.
New York, NY 10001
Answer: In 2021 you no longer need to contact the AP via email or snail mail about using their images.   They have a site where you can purchase subscriptions to use their images: http://www.apimages.com/
Their how to purchase page lists several options which allow you to download a number of stock images and use them non-exclusively without recurring payments; or purchase time limited licenses for images based on placement, project, and image size.
Comment: They don't seem to be very transparent on their subscription charges

Using Associated Press photos


Python kill hanging function

Question: I'm sure this has been asked before, but I can't find a similar example.  I need to be able to call a function with an execution time-limit.  If the function takes over this time, then the whole script exits.
This can't be done by timing the whole script! And I only want one, small function to be timed.  Is it possible?
For example
<code>    def sleep():
        time.sleep(60)

time("sleep()", limit=30, violation="sys.exit(1)")
</code>
Very basic and horrid looking example I know, but it might help the explanation.
Answer: Here's a recipe (unix only) http://code.activestate.com/recipes/534115-function-timeout/

Python kill hanging function


Establishing VPN connection sets NetworkCapabilities.TRANSPORT_WIFI to false?

Question: As the old way of detecting wifi connection (getNetworkInfo) is deprecated in android, I am trying to migrate my app to the latest way, below is what I have for now (in Kotlin):
fun isWifiConnected(context: Context): Boolean {
    val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager?
    cm?.activeNetwork?.let { network ->
        cm.getNetworkCapabilities(network)?.let { capability ->
            return capability.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)
        }
    }
    return false
}

It works well until I get vpn connected (on my samsung s8 + shadowsocks), the capability in above code no longer has TRANSPORT_WIFI transport, but TRANSPORT_VPN instead. And if I connect vpn without wifi then get wifi connected, isWifiConnected returns true again (capability has both TRANSPORT_WIFI and TRANSPORT_VPN in this case).
It seems that the previous transport capabilities would all be reset to false when vpn connection gets established, which sounds like a bug to me, why having one new capability needs to reset old capabilities?
I was hoping this is just a bug of my vpn app (shadowsocks) but I tested same cases on my pixel 2 + shadowsocks, which works quite fine, isWifiConnected returns true as long as wifi is connected, no matter having vpn or not.
So this is a Samsung bug?
Comment: @PaulW, yes, I now use WifiManager instead of ConnectivityManager. See the posted answer below as sample.
Comment: have you had any answer / workaround ? I have the same issue on my side. The above code can't detect the presence of wifi when using VPN over wifi.
Answer: The solution works well so far:
fun isWifiEnabled(context: Context): Boolean {
    val wm = context.getSystemService(Context.WIFI_SERVICE) as WifiManager?
    return wm?.isWifiEnabled ?: false
}


How is Schrödinger evolution experimentally verified?

Question: This is surely a pretty ignorant question, but I'm just starting out learning physics. In quantum theory the evolution of a particle's wavefunction is supposed to have two stages: deterministic evolution according to the Schrödinger equation when the particle is not being observed/measured, and nondeterministic collapse to an eigenfunction when it is being observed/measured. If this is the case, how have we experimentally verified that the Schrödinger equation holds for the deterministic stage?
Comment: [The double-slit experiment](https://en.wikipedia.org/wiki/Double-slit_experiment) is at least one experimental way to verify! We're able to use results to retroactively determine behavior, so without observing the electrons, we're able to discern that they had behaved as either particles or waves.
Comment: So has someone actually solved Schrodinger's equation for a double-slit potential (perhaps numerically) and compared the calculated values of $|\psi|^2$ on the screen to the measured intensity values? I'd like to see a reference that treats this problem rigorously, because so far all the discussions of the double-slit experiment I have seen were merely qualitative and using analogies with wave optics.
Answer: Nice question. Let's split this into three parts:
(1) The Schrödinger equation has features that exist more broadly as fundamental principles of quantum mechanics. Briefly, these are: all information about the state is in the wavefunction; linearity; inner product; self-adjoint observables; unitary evolution; completeness.
(2) The Schrödinger equation has specific features that are not more generally valid in quantum mechanics. For example, it's nonrelativistic.
(3) Collapse.
Taking these in order:

We see no evidence that any of these are violated, but we also don't have any good ways of singling out any particular principle from this list and testing it quantitatively. To do that, we would need a test theory that differs from quantum mechanics but is viable, and right now nobody has any idea how to construct a useful test theory. The trouble is that there are no-go theorems showing that quantum mechanics is very brittle. That is, if you try to introduce any violation of these basic principles, no matter how small, the whole thing seems to break down. Some material about this is given in Aaronson, "Is Quantum Mechanics An Island In Theoryspace?," http://arxiv.org/abs/quant-ph/0401062 .
We find, for example, that the Schrödinger equation predicts the energy levels of the hydrogen atom pretty accurately. The errors are at about the level we expect based on the fact that the Schrödinger equation is nonrelativistic, and an electron in a hydrogen atom has $v\sim0.01c$. We can verify various other effects in the Schrödinger equation, such as tunneling and the behavior of the two-state system.
The part about collapse isn't actually part of the theory, it's just a feature of the Copenhagen interpretation. The Copenhagen interpretation is optional. There is absolutely no evidence for any actual physical process resembling the collapse described by the Copenhagen interpretation. All actual observations can be explained in other ways, e.g., in explanations based on decoherence.
Comment: I'm not sure this addresses the OP's question. In my reading the question is a conceptual one regarding the validity of QM as a theory, based on the misunderstanding you identify in (3) that 'collapse' is inherently part of QM.
Answer: By checking that the results of measurements correspond to what the deterministic evolution predicts: note that this is the same as the case for classical mechanics. The difference is that the predictions are inherently probabilistic.
Answer: Rephrasing your question as: "How do we experimentally confirm the deterministic evolution of the wavefunction (when measurements require collapse of this wavefunction)?"
This is actually very simple. We repeat the same experiment over and over and see if our output probability distribution matches what we expect our wave-function to deterministically evolve. If we get a probability distribution that doesn't match the (square of) wavefunction, then the theory is wrong.
You might be wondering "Does collapse get in the way of really truely knowing what the wavefunction was before it was measured"? It does, and that's why we redo the whole experiement after each time we measure the state.
If you're wondering if maybe somehow the collapse affected the earlier deterministic evolution, look at the example of a quantum Mach–Zehnder interferometer. You take a single photon, split it into two possible directions, and then recombine them again. You can see that when recombining the states, quantum interference controls which of the two output paths the state travels through. You can infact get the quantum interference to cancel so perfectly (by changing the difference in distance of the two paths) that you can completely control if the photon exits one of the two output paths or the other path. Here the deterministic evolution of the wavefunction is interfering, producing a completely deterministic, measureable outcome. So you don't have to have any concern over the indeterminism of quantum mechanics getting in the way of observing the determinism!


Sorting and filtering items in Cartthrob

Question: I've been trying to find a proper way to do this but no luck so far. How does one go filtering products in Cartthrob. For example if the user wants to change the number of products displayed by clicking the relevant link (show items: 16, 64) (limit=16, limit=64 and so on). I've tried using Mo'variables and pass a limit variable on the url (i.e. /books?limit=16) however this messes up pagination and category filtering. Is there a guide or something on how to achieve this without loosing your hair? :)
Answer: You're on the right track. This advice applies to EE 2.7.2+, so if you're on an earlier version of EE, sorry. First, you don't need to use Mo' Variables. All you need to do is set the dynamic_parameters="limit". Now when limit=X is in your url query string, the channel:entries loop will automatically use that limit. To get it to work with pagination, you need to do this (add the query string to the pagination links):
{paginate}
  {pagination_links}

      {page}

{pagination_page_number}

      {/page}

  {/pagination_links}
{/paginate}

Docs on dynamic parameters: http://ellislab.com/expressionengine/user-guide/modules/channel/dynamic_parameters.html
Docs on current_query_string global variable: http://ellislab.com/expressionengine/user-guide/templates/globals/single_variables.html#current-query-string
Comment: Its working but with multiple variables it becomes a mess. Have to change the pagination_base and check if a query string exists and so on. It is messy! Especially when filtering by categories and have to keep the url along with the query_string and pagination url...


How do you defeat Sigdis Gauldurson?

Question: On the quest "Forbidden Legend", I can't figure out how to kill the eldest son of Archmage Gauldurson, Sigdis Gauldurson. He just keeps teleporting away, and there are three of him! Every time I kill one of them they just teleport and then there are three of them again! Please give me your advice if you have any idea on how do defeat Sigdis Gauldurson.
Answer: This advice depends on whether you are a melee fighter/ranged/mage etc so YMMV. He is a very tough opponent at lower levels.
But when I started out to kill Sigdis for the first time, the thing I was looking was for to differentiate the real Sigdis and his illusions were :

Sigdis had his helmet's horns curled down (biggest giveaway IMO).
Sigdis had his health bar affected when he was hit like @Yves said
already.
Sigdis was not surrounded by blue illusion adornments like his (oh
well) illusions were.
The illusions die after one hit with your weapon bow/axe/spell etc

With time I got better at recognizing him.
If you are a melee class then the fourth point does you no good because he will simply teleport away. Instead look for the other three points and go for this guy with a vengeance. If you are an archer/mage types then you can deal damage from a distance almost hiding from him if you wish. In that case the fourth point applies.
You can still defeat him if you are a melee type, just takes a lot of patience going back and forth across the room (a lot IMO).
This is one battle where patience does pay out well. Just be patient. Do not make haste. And he can be brought down no matter your play style.
Answer: There is only one real version of him; the other two are clones.
The easiest way to tell him from his clones is by checking the target's health before attacking. The real Gauldurson should already have some health missing from your attacks, whereas the clones will spawn with full health bars.
Comment: Thanks, I'll see if I can figure out which is real. Besides, with my "Orcish Bow of Soul Devouring" (orcish bow with "soul trap" enchantment) and a lot of empty soul gems, I could fill the lot on clone after clone after clone. So there's a bright side to it. Thank you both, much appreciated.
Comment: The real one also has horns on his helmet, while the others do not.
Answer: Stand in the circle where he gets out of his tomb and stand directly in front of the tomb...make sure you have a bow and a good amount of arrows. By standing in front of his tomb he can only spawn straight back parallel from where you'd be standing or on one of the two platforms in the middle of the room. Then just play the guessing game with the three of him it's pretty easy cause the illusions die from one arrow. Also stay crouched because right when he reappears your hidden and have a better chance of getting the first hit. I'm currently a low level and found this as the most effective way to kill him.
Answer: If your weapon has a paralyze effect on it then it will bug out after 1 hit, he will appear as if hes dead and only the illusions will spawn.  Got stuck on this for over an hour because of this and then just switched out my weapon with an unenchanted weapon and killed him easily.
Answer: when he teleports, hide behind a pillar and shoot him with bow if he dies in one hit its a decoy shoot another one if still die in one hit its a decoy shoot the last one (most likely it will not be last one) keep shooting real sigidis he will not move for a bit unless it took you a long time to kill decoys repeat that over and over again until he's dead
Answer: I found it very helpful as a full melee-er to just pick up a bow, gather some arrows and shoot him from a distance. If you're too low of a level and you're struggling to take him down, this is a very easy way. Bear in mind that you take a bloody eternity to take him down. If you run out of arrows, just let the fake Sigdis' shoot at you but don't let them hit you and pick up the arrows!
Answer: Just keep attacking all one of him, he will eventually die.
Comment: Thanks, I'll see if I can figure out which is real. Besides, with my "Orcish Bow of Soul Devouring" (orcish bow with "soul trap" enchantment) and a lot of empty soul gems, I could fill the lot on clone after clone after clone. So there's a bright side to it. Thank you both, much appreciated.
Answer: I'm a different player from this answer up here.. just posting here since someone brought up Sigdis showing dead and only 2 clones showing.
Well, if this happens to you, like it happened to him and also to me, what I did was I walked to the "dead" Sigdis and I shouted him off the circle.. immediately Sigdis got up and I ran to him and finished him.
Comment: Can you clarify your answer, and maybe get rid of information irrelevant to the question?
Answer: Press ~, then type tgm and you're done.
Comment: Saying "enable godmode" doesn't actually answer the question.
Comment: @dramerius To avoid downvotes, provide more details on your answer. e.g. explain what`tgm` does, and that one might want to disable it afterwards to not play the whole game in 'god mode'.

How do you defeat Sigdis Gauldurson?


Eladrin population centers in Nerath/Nentir Vale?

Question: Looking for something to reference in a character background. PHB says some of their cities fade in and out of 'this world' on a daily cycle. Ideally somewhere feasibly accessible to Nentir Vale, but beggars can't be choosers.
Answer: You know as much as we do – as covered in this question, the setting was never detailed more than the loose sketch provided in the PHB. As mentioned, there were a few adventures that were set in specific places and in that way added slightly to the setting, but the overall geography and population information was never expanded on.
This is both a feature and a bug. It's a feature because it's intended that DMs could create as much material as they wanted without contradicting anything "official". It's a bug because players like you who want official detail don't get any support.
Ask your DM to make up an Eladrin city and put it somewhere suitable for your character to hail from.
Comment: I looked into a lot of the Points of Light stuff and found a good bit of blogs for current campaigns where people were homebrewing, but I'd hoped that there might be something squirreled away in one of the hundred or so books I don't have. Just settled on Mithrendain since that seems about the only known Feytown. Thanks.


Baking a diamond Material

Question: I made a diamond material for my mesh diamond. How can i bake the material as a texture for the diamond, so i can it export for a game
Answer: Diamonds are heavily influenced by the environment they are in. The colors around them and mostly the way the light strikes them. You need to know if the diamond will be seen up close and personal with how the light shimmers and gleams through it, or will it be viewed only from a distance? That will effect how much you set up for it.
How will it be used in the game too? Will it be seen once and only for a few seconds? Will it only be seen from one direction? Will there me movement around it? Do you want the lighting where it is to flicker or be steady?
That effects if you will need to bake more then a diffuse map of the diamond.
Either way the first step is to select the edges to make as seams then to unwrap it.
Then you will want to create the image that will be the map you are making.
I cycles you will have to go to the shader editor and ad an image texture node with the image that will be your map. Only then can you go to the render tool shelf and set up the bake for the type of map you want to make. Once that is set up you click bake. If you are only baking the diffuse you will get one result, if you are baking everything at once you will get another.
I would recommend baking it in a scene that is a near as possible as what it will be in in the game, especially if it will be seen up close and personal. It won't matter if only baking the diffuse, but as diamonds are transparent and sparkly, you are going to want to bake it different.

Baking a diamond Material


What is the best way to git patch a subrange of a branch?

Question: In Subversion, it is easy to merge a range of changesets/diffs from a branch using "svn merge -r a:b mybranch". But in git, I found it is only possible to cherry-pick a single commit from a branch to apply that patch to my current working branch. So I am wondering if there is a fast way to apply all the commits in one swoop between two tags in a bugfix branch to my current master branch?
Answer: The easiest way to perform the action that you are looking for is with git rebase. Here's a recipe. Assume that tag A is the commit on top of which the patch series that you want to select is based and that tag B is the commit of the final patch in the series. Also, assume that br is the name of the current branch and the branch where the new patch series should be applied.
# Checkout a new temporary branch at the current location
git checkout -b tmp

# Move the br branch to the head of the new patchset
git branch -f br B

# Rebase the patchset onto tmp, the old location of br
git rebase --onto tmp A br

Comment: Oh, and just to clarify 'cause I didn't get it, the tag A is actually the commit -right-before- the first one in the series you want to include.  So tag A won't be included, only the tags after.
Comment: It should be noted that you can't retain information about the origin of those commits this way.
Comment: I needed this exact functionality about five times in the past three days. So much better than cherry picking each commit.
Comment: Excellent.  This is the useful kind of "move a whole set of commits in a really weird way" effect that I needed.
Comment: Just used this trick; did a very complex merge that WOULD NOT BE POSSIBLE in most other VCS s, in 30 minutes.!!!
Answer: The easiest way I've found to do this is:
git cherry-pick starthash..endhash

Note that the two dots have no spaces separating them from the hash labels. Also, this will not cherry-pick starthash, but rather everything after starthash up to and including endhash. To include starthash do git cherry-pick starthash^..endhash.
Answer: As far as I know, you can't git merge this way. Merge is intended to join two branches which have a history in common, not for picking up several commits or patch series. I feel like cherry-picking is fundamentally what you're asking for.
You can use git cherry (not cherry-pick!) to find out which commits should be inserted into your branch, then git cherry-pick them. You can also explicitly ask git cherry-pick to record the origin of those commits in case you're cherry-picking from a public branch. This is probably the best way to deal with this problem. (Another could have been to export them via git format-patch and then importing them with git-am/git-apply, but that would likely be slower, plus it won't record the origin of the commits.)
EDIT: "Public" (branch) should be understood as something not subject to history editing. Of course, you can do this when developing closed-source software without the code being public.


About learning with error rings with only constant coefficient

Question: I am new to RLWE, would like to ask whether what I am thinking make sense
Suppose I have a message e.g.: x=5
And I have a lattice based encryption scheme, e.g.: BGV
could I encrypt x with BGV by treating x as a polynomial ring with constant coefficient=5, and other coefficient =0?
Thanks
Answer: Yes, you could encrypt the message $5$ as a polynomial $f = 5$ in the polynomial ring, which is usually something like $R := \mathbb Z [X] / \langle x^N + 1 \rangle$ with $N$ being quite large $>2^{10}$ in practice. All the homomorphic algorithms, e.g., addition, multiplication, and others, will work fine with this message.
However, encrypting only constant messages is a huge waste of both computation time and storage space, since RLWE supports SIMD (single instruction multiple data) operations. I.e. in such a polynomial $f$ one can encrypt more than one constant message, details omitted here.


How can I power-level my recruits?

Question: In Defender's Quest: Valley of the Forgotten I have just finished Hero Mode++. I would like to complete all maps on Extreme without restarting from scratch but I believe the six standard heroes will not be enough for some of the harder maps. Is there a way I can efficiently power-level new recruits up to the level range 40-60 with minimal effort?
Comment: You are able to increase the amount of experience gained in the settings, which might be a good place to start.
Comment: Hero Mode++ implies 300% experience gain to prevent mental breakdown.
Answer: The last level you were able to clear comfortably with your standard heroes on the highest difficulty should also be the easiest place to level generic recruits.
Just make the recruits, play the level as you normally would and rake in the experience points (depending on your choice of settings you may need to actually deploy your new recruits, but that shouldn't be much of a hurdle).
Also, congratulations on your Hero Mode++, I love the game but couldn't be bothered to push for it.

How can I power-level my recruits?


Was Number 6 John Drake?

Question: Was the character in The Prisoner, Number 6, supposed to be the same character from Danger Man, John Drake? Patrick McGoohan denied it, but co-creator, George Markstein said otherwise.
Answer: Tricky question; for sure, the inspiration did come from Danger Man...
From the Wikipedia entry on the Prisoner:

Part of Markstein's inspiration from his research into World War II, where he found that some people had been incarcerated in a resort-like prison called Inverlair Lodge. Markstein suggested that Danger Man lead, John Drake (played by McGoohan), could suddenly resign, and be kidnapped and sent to such a location. McGoohan added Markstein's suggestion to material he had been working on, which later became The Prisoner. Furthermore a 1960 episode of Danger Man, "View from the Villa", had exteriors filmed in Portmeirion, a Welsh resort village that struck McGoohan as a good location for future projects.

(Info taken from: "In The Prisoner: The Official Companion to the Classic TV Series" by Robert Fairclough)
Now, McGoohan should be considered the ultimate source for this data, as:

McGoohan wrote a forty-page show Bible, which included a "history of the Village, the sort of telephones they used, the sewerage system, what they ate, the transport, the boundaries, a description of the Village, every aspect of it…".

Now, you were referencing the 1985 interview, and assuming McGoohan to be the ultimate authority, it should be conclusive:

McGoohan stated in a 1985 interview that No.6 is not the same character as John Drake, further adding that he had originally wanted another actor to portray the character.

Then, there is the issue:

Furthermore, Rogers states that Markstein had wanted the character to be a continuation of Drake, but that doing so would have meant paying royalties to Ralph Smart, creator of Danger Man

So what's it break down to?  Number 6 certainly displayed a lot of similar behaviors and skills that Drake possessed, but 'in-universe', he wasn't ever shown to be Drake directly, and there were some hints that he was not; since McGoohan wrote the show's bible (from which everything was supposed to follow), I would think that should be the deciding factor.
Sadly, much of the above info is contested.. It's really hard to say for sure who wrote what..
All that being said, what really happened?  You had two strong personalities involved, one who wanted it one way, one who wanted it the other, and then there was the issue of royalties... Unable to come to an agreement, they took advantage of the nature of the show, and left it ambiguous, which was totally in keeping with the theme of the show.
Comment: Now, for some real fun... Think about the final episodes... And consider that Number 6 may have, in fact, been Number 1 all along, testing the facility that he came up with the idea of, OR, the first real prisoner that it contained.  (One argument says that he hypothesized the entire idea of the village, and then resigned when he discovered this 'inhuman' idea had been made a reality, only to find himself taken there.)
Answer: Just passing through, friends.
Patrick McGoohan is a widely respected actor. Given the above data, and the universal respect for his work, I conclude he had only one failure: If he wanted Number 6 to NOT be John Drake, he did a very poor job of it. Anything, literally anything substantive could have derailed that idea. A mustache. A scar, a different haircut. Instead, he acts and reacts just the same as JD. (Mostly reaction, because of the evils around him).
So, either McGoohan failed to act-out a different character, or else there is some reason for him to fake left and move right, to act like John Drake, but say it isn't so.
My theory: It started out as John Drake, but the allegorical ending makes the idea in retrospect to be inoperative. If I may drill deeper: Since the story is about individual freedom, maybe PM is saying, "I can act any way I want, and claim to be any character I want to be, or any character I do not want to be".
My lands, he even made a finale that couldn't be put in a box!
Comment: If he admitted it was John Drake, then they'd have to pay royalties.
Answer: There is no way that No.6 could be John Drake as Patrick McGoohan stated that In reference to The Prisoner "John Drake of Secret Agent is gone.." in an interview in the Los Angeles Times August 1966. This was a full month before the cameras began to roll.
It is also nonsense that The Prisoner was based on George Markstein's concepts as McGoohan had outlined the premise of The Prisoner in an interview with Ian Sproat in 1965 before he ever met Markstein. Further McGoohan had already sold The Prisoner to Lew Grade before Markstein even had any knowledge of Inverlair Lodge which was made public knowledge at a later date.
Answer: This might be a helpful link: http://www.cosmoetica.com/B39-DES18.htm
Who is 6?
More specifically: Who is 6 John Drake (of Danger Man)?
PM has always insisted NO! 6 is never named by anyone, even when he re-encounters a former fiancé. Within the context of the show this is highly odd- even his fiancé? Surely, someone must slip up? Yet George Markstein, the principle writer for the show, has always said YES. Outside the series' reality it is apparent that PM originally intended 6 to be Drake, but gradually went about obscuring this fact when fans started expecting a James Bondian villain behind the Village. Yet, some fans have claimed that in the show's opening sequence the ID card that 6 turns in is stamped with computerese that spells John Drake, & there is, indeed, the aforementioned alleged 'slip' of 2 (or actor Leo McKern?) in Once Upon A Time where he calls 6 Drake by name (or not?). In the 'I'm not a rat' tete-a-tete does 2 say 'Report to my study in the morning, Drake.' or 'Report to my study at the morning break.'?
Let there be no more confusion. My wife, Jessica, & I own the 10 DVD box set of TP, called The Complete Prisoner. & while on videotape it may still be arguable as to what 2 actually says to 6, on DVD it is clear: 2 calls 6 by name, he says, 'Report to my study in the morning, Drake.' It occurs about 18:55 minutes into Once Upon A Time.
The evidence?
1) 2 says 'Drake' with a D, not 'break' with a B! I heard it, Jess heard it, & while playing the disk to a visiting Jason Sanford & his wife, they heard the D sound clearly.
2) Vocalize the D & B sounds in a mirror. You will see that your lips are parted when you utter the D sound (even followed by the R sound) while your lips are together & pursed to form the B sound (even followed by the R sound). It's a clear distinction, & at 18.55 into the episode 2's lips are clearly apart. A lipreader can confirm. The D sound is uttered. Jess spotted this right away. It is about 99% certain that you hear the D sound spoken, but 100% that 2's lips form a D, not a B.
3) Right before 2 utters 'Drake' or 'break' he is supposed to have uttered either 'in' if he's summoning 'Drake', or 'at' if he's ordering 6 to meet him at a 'break'. There is no doubt that 2 utters 'in' not 'at'- both soundwise & lipwise the difference is even starker than in 'Drake/break'. Listen & watch the DVD- it is 100% certain that 'in' is uttered.
4) Since 2 definitely utters 'in' not 'at' he cannot be ordering 6 to 'Report to my study in the morning break.' for it does not make sense grammatically nor logically. People do things AT or ON a break- not IN. But, even if 1 accepts that Anglo phraseology differs from American, in that Brits go IN breaks, not ON, the other 3 points still rule it out, as well that 2 clearly states IN.
5) The reverse, however, is grammatically & logically fine: 'Report to my study in the morning, Drake.' People often ask or tell people things, & append the addressee's name afterward. Why would 2 ask 6 to 'Report to my study at the morning, Drake.'? It's illogical.
6) The situation, at this point in the episode, is that 2 is playacting to convince a drugged 6 that he is different authority figures from 6's past. Here, 2 is pretending he is the Schoolmaster of 6's Elementary or High School. In formal schools, & even rigid public schools (in the US or UK) it is customary to address young males by their family names (whether or not preceded by a 'Mr.' or 'Master')- especially when being disciplined- as the situation is aiming for. Since 6 is going back to a time long before 6 was a spy, there is a no reason for 2 (as 6's Schoolmaster) to address him as anything but his last name- if 2 DID call 6 '6' it might snap 6 back to reality, lapse him out of believing he's an errant child, & ruin 2's hopes for getting information from 6. 2, therefore, must call 6 by his real name- as a disciplining Schoolmaster would! Think: 2 is pretending he is someone from the past, before 6 was 6, or a spy- he was just another kid with a familial name to be addressed.
These 6 points leave no doubt. 6 is Drake, as in John Drake. He looks like Drake, talks like Drake, has Drake's temperament & beliefs, was in the same line of work as Drake, & his captors know & call him 'Drake'- albeit only when it's necessary to attempt to secure information, etc. In short, if it walks, talks, & quacks like a Drake- it is a Drake! While this may shatter the belief systems of some fans, it shouldn't. Ask yourself- is Joseph K. any less an Everyman because we know his name is Joseph? Is Ishmael any less an everyman? Is Travis Bickle? Merely because we now know 6 is John Drake (or JD) lessens his everyman status not in the least. Others have claimed 6- regardless of being JD or not- is a misogynist &/or misanthrope. As usual, they trot out a set of arguments pro & con- but I won't address that here as that seems yet another case of minutiae run rampant.
Yet, others have claimed that 6 is not JD, but, rather PM himself! These folk see the whole show as PM's rejection of his persona as TV star. Others insist 6 must never be named, lest he could not be an everyman. We now know his identity & that his 'necessary anonymity' is not really necessary. While 6's identity is 1 of the most hotly debated questions TP has inspired, there are others. The most obvious corollary to Who is 6?, is Is 6 #1? & if 1 is not 6, then who or what is 1?
Comment: Just a suggestion - paragraphs would make this much more readable.
Answer: I would like Number 6 to be John Drake but ... Danger Man definitely took place in the real world (*) yet the Village is guarded by Rover ... and where exactly in the real world in the 1960s did that come from?
(*) It's true that in Danger Man Drake visited an awful lot of countries with names that are unrecognizable in the modern (or even 1960s) atlas.  But, obviously, that was a subterfuge by the studio trying to prevent the show from being shut down for causing diplomatic problems between Great Britain and the actual benighted South American and Eastern European countries that everyone in the audience knew were being represented.
Answer: No, No.6 was not John Drake. McGoohan stated in the Los Angeles Times, August 1966, that "John Drake of Secret Agent is gone..." and John Drake was not the "new character" who was to be No.6 in The Prisoner.
Professional lip readers have stated the word spoken by No.2 is 'break' not 'Drake'. Besides the fully published shooting scripts clearly state the word as 'break' in print.
Comment: Can you back up this assertion; "Professional lip readers have stated"... Stated **where**, precisely?
Comment: Can you provide a link to the shooting script.

Was Number 6 John Drake?


What is the best practice for posting certificates online?

Question: I have been slowly acquiring birth, marriage and death certificates. Is there a best practice or accepted procedure for posting the United States certificates online, including to Geanealogy.se (to add necessary information to a question)? I would not post a certificate for any living person - however, how about a certificate for a deceased person whose children are still living?  For instance, the marriage certificate might include living witnesses and the death certificate might include a living person.
Comment: @RobertShaw, Jeni has already sought advice on meta about how to pose this question. Also, re your statement that certificates should not be posted here -- is that an answer to the question? In which case you need to explain why you believe that.
Comment: This belongs on meta.genealogy.stackexchange.com, not here.  (Also, in general certificates should not be posted here.)
Comment: @ColeValleyGirl, Besides the Meta advice, my comment did bring up a thought relevant to the original question. However, it is now irrelevant since the question has been radically edited, changing from asking about how to post certificates on StackExchange, to asking about how to post certificates online generally.
Comment: @RobertShaw Do you think the guidance would be different about posting certificates to SE and posting them elsewhere? If so, roll the edit back.
Comment: @ColeValleyGirl, It's now evident the question is about general considerations for posting certificates online, and as such, it applies to genealogy.SE as much as to any site.  The original question appeared to be about how to post (images of) certificates on this site specifically, and I thought such things were appropriate for Meta.
Answer: There are three elements to consider when publishing certificates online:
(1) Copyright, i.e. do you have the right to publish the certificate. This will depend on how you acquired it and the constraints imposed by the provider of the certificate, and will vary from country to country.
(2) Privacy, i.e. what does the certificate reveal about living people.  I would process the image to redact any information about living people before publishing it.
(3) Sensitivity, i.e. understanding the concerns of living individuals about publishing facts that the certificate reveals, e.g. suicide as a cause of death, illegitimacy or other details that some relatives might feel were best kept private. Certificates are records of facts that are often public and discoverable by other means, but each researcher must make their own assessment of how much weight they give to the sensitivities of others.
The above applies whether you publish an image of the certificate or an abstract or transcription of the information (although copyright concerns are different for transcriptions, as facts cannot be copyrighted).


Ceiling Fan/light and 2 Switches

Question: I have a switch with 14/2 wire that is split to two fans with lights. I also have another switch with 14/2 wire that goes to one light, no fan. I want to take out the single light fixture and connect the 14/2 wire from it to both of the lights on the ceiling fans so I can control the fan with one switch and the lights with the other. Do I just run 14/2 wire from the already existing light wiring to both fan lights?
Comment: Can you post photos of the insides of all the boxes involved please?
Answer: That would work, but it depends on the fan/light combo fixture... does it have separate feeds for each function?  I.e. one pair of white & black wires for the light, and another pair for the fan?  If so, then yes.
You would have to remove the light pair from the feed coming from the switch that currently controls the fans/light combo.  Then, they can be tied to the new run of 14/2 coming from the switch you want controlling the lights.  You would have to extend that leg to the other fan (i.e. another 14/2 run going from one fan to the other), and do the same thing to that fan/light combo.
So, it depends on what the wiring inside the fan/light fixture looks like.  I would guess that it has one pair of wires for each function.
Be sure that power is off at the breaker box for BOTH light switches.  They may not necessarily be on the same circuit breaker.
Be sure everything is grounded properly.
If you're not comfortable doing electrical work, or if you don't understand the explanation above, I recommend getting help from a pro or at least someone who does understand it.
Comment: And, as ThreePhaseEel says, show some pictures!

Ceiling Fan/light and 2 Switches


Is it bad to have my virtualenv directory inside my git repository?

Question: I'm thinking about putting the virtualenv for a Django web app I am making inside my git repository for the app. It seems like an easy way to keep deploy's simple and easy. Is there any reason why I shouldn't do this?
Answer: I use pip freeze to get the packages I need into a requirements.txt file and add that to my repository.  I tried to think of a way of why you would want to store the entire virtualenv, but I could not.
Comment: You can save the unnecessary space in your repo and still deploy to a new server in a single command: virtualenv --no-site-packages --distribute .env && source .env/bin/activate && pip install -r requirements.txt
Comment: If you, say `pip install mysql-python`, on a 64 bit machine, and then someone with a 32 bit machine tries to use it, it will not work. It uses a C module, like many Python modules do, to increase performance. I imagine Windows->Linux would also not work.
Comment: just a remark: we got bit in the past because somehow libraries are becoming unavailable from pip (version too old), forcing an upgrade while the site was down. so... I will now never rely on `pip freeze` again to do this. the issue is that during your forced upgrade redeploy, no one pays for it, and for intermediate upgrades ("best practice" maintenance) no one does either.
Comment: Note on the @RayanBrady comment: The `--distribute` and `--setuptools` options are now no-op. (distribute, that was a fork of setuptools has been merged back long ago).  `--no-site-packages` is DEPRECATED, it is now the default behavior
Comment: I'm giving you the answer to this question, since it is probably the "best practice" and you offered it first. I have definitely encountered some of the problems that everyone has mentioned. I'm estimating I give myself another day messing with it before I just do what you guys have been suggesting all along and use pip and a requirements file. Thanks for your help!
Comment: @CONTRACTSAYSI'MRIGHT Yes, I had the same situation. I spent hours to match the new environment's packages with the old one's when I tried to setup the new environment by requirements file. The project was 2 years old and most of the packages were old. However, I do not have any idea about how virtual environment behaves on different architectures.
Comment: @aod nowadays, hard drive space is SO cheap, we resorted to just set up another repo in these cases, and store the whole virtualenv thing (I also do that for node apps, where tbh the problem isn't as common, with node_modules), if it is a production app. Sure, it is cool to not have to do it, but if the app constitutes your customer's livelihood, it's just not worth the space savings. Worst to worst, you *need* to be able to restore it ASAP, build artifacts and everything.
Comment: Great suggestion! I understand that I can use a requirements.txt file to keep track of packages. However, the reason why I would like to keep the virtualenv in the repository is to make deploying new servers easier. If the virtualenv is contained inside the application, I don't have to create a new virtualenv in new instances I bring up, all I have to do is pull the code.

I know I could use something like fabric to set up the env for me, but it just seems like an unnecessary step if I can just keep the env in my repo.
Comment: Awesome, I'll keep that example in mind. But, it sounds like, beyond the extra space requirements, there's no reason why I can't just include the env in the repo.
Comment: Take a look at buildout approach. It's like virtualenv but declarative. You create one file buildout.cfg (requirements.txt on steroids) that defines required packages, versions, package sources (including git repos) and than just build the environment. [buildout.org](http://www.buildout.org/), [my example usage](https://github.com/munhitsu/cr3template-django-minimal)
Comment: I do the same, however I was trying to find a way to export my environment Ina file such as I can create my env with the same name from this file instead only to get my dependencies from my requirements.txt that is to avoid to let git automatically stage the env folder once created
Answer: Storing the virtualenv directory inside git will, as you noted, allow you to deploy the whole app by just doing a git clone (plus installing and configuring Apache/mod_wsgi).  One potentially significant issue with this approach is that on Linux the full path gets hard-coded in the venv's activate, django-admin.py, easy_install, and pip scripts.  This means your virtualenv won't entirely work if you want to use a different path, perhaps to run multiple virtual hosts on the same server.  I think the website may actually work with the paths wrong in those files, but you would have problems the next time you tried to run pip.
The solution, already given, is to store enough information in git so that during the deploy you can create the virtualenv and do the necessary pip installs.  Typically people run pip freeze to get the list then store it in a file named requirements.txt.  It can be loaded with pip install -r requirements.txt.  RyanBrady already showed how you can string the deploy statements in a single line:
# before 15.1.0
virtualenv --no-site-packages --distribute .env &&\
    source .env/bin/activate &&\
    pip install -r requirements.txt

# after deprecation of some arguments in 15.1.0
virtualenv .env && source .env/bin/activate && pip install -r requirements.txt

Personally, I just put these in a shell script that I run after doing the git clone or git pull.
Storing the virtualenv directory also makes it a bit trickier to handle pip upgrades, as you'll have to manually add/remove and commit the files resulting from the upgrade.  With a requirements.txt file, you just change the appropriate lines in requirements.txt and re-run pip install -r requirements.txt.  As already noted, this also reduces "commit spam".
Comment: Note that --distribute is now deprecated (at least in 15.1.0):

```--distribute          DEPRECATED. Retained only for backward compatibility.   This option has no effect.```
Comment: `--no-site-packages` is deprecated in 15.1.0 as well, as that's now the default.
Answer: I used to do the same until I started using libraries that are compiled differently depending on the environment such as PyCrypto. My PyCrypto mac wouldn't work on Cygwin wouldn't work on Ubuntu.
It becomes an utter nightmare to manage the repository.
Either way I found it easier to manage the pip freeze & a requirements file than having it all in git. It's cleaner too since you get to avoid the commit spam for thousands of files as those libraries get updated...
Comment: Hmm. I definitely won't have problems with stuff being compiled differently in different environments. I guess its probably worth not doing it just to avoid the commit spam.
Comment: @LylePratt: I think the opposite: better not include whole virtualenv in the repository just to avoid issues with having such great tools as PyCrypto or PIL.
Answer: I think one of the main problems which occur is that the virtualenv might not be usable by other people. Reason is that it always uses absolute paths. So if you virtualenv was for example in /home/lyle/myenv/ it will assume the same for all other people using this repository (it must be exactly the same absolute path). You can't presume people using the same directory structure as you.
Better practice is that everybody is setting up their own environment (be it with or without virtualenv) and installing libraries there. That also makes you code more usable over different platforms (Linux/Windows/Mac), also because virtualenv is installed different in each of them.
Comment: This is right-on as to why it's a bad idea to keep a virtualenv in SCM, but it's worth considering either something like @RJBrady's suggestion or event [a bootstrap.py script](http://www.virtualenv.org/en/latest/), as having some means of recreating the same environment across machines is a serious need when working with other people.
Comment: I'm not really sure the problem you mentioned would be a problem in my situation exactly. My Django app contains a .wsgi file that defines where the virtualenv is relative to it's location (2 directories up '../../env'). So, in my scenario, the absolute path problem should not negatively effect me...right?
Comment: If you run your app always with WSGI then you might get away with it. If you use the development server (via `manage.py`) you will run into problems for sure.
Comment: spot on, all the legit reasons and highly increases the flexibility of the code (making it more viable, Specifically on Windows due to its differences in architechture)
Answer: It's not a good idea to include any environment-dependent component or setting in your repos as one of the key aspects of using a repo, is perhaps, sharing it with other developers.  Here is how I would setup my development environment on a Windows PC (say, Win10).

Open Pycharm and on the first page, choose to check out the project from your Source Control System (in my case, I am using github)
In Pycharm, navigate to settings and choose "Project Interpreter" and choose the option to add a new virtual environment , you can call it "venv".
Choose the base python interpreter which is located at C:\Users{user}\AppData\Local\Programs\Python\Python36 (make sure you choose the appropriate version of Python based on what you have installed)
Note that Pycharm will create the new virtual environment and copy python binaries and required libraries under your venv folder inside your project folder.
Let Pycharm complete its scanning as it needs to rebuild/refresh your project skeleton
exclude venv folder from your git interactions (add venv\ to .gitignore file in your project folder)

Bonus: If you want people to easily (well, almost easily) install all the libraries your software needs, you can use
pip freeze > requirements.txt

and put the instruction on your git so people can use the following command to download all required libraries at once.
pip install -r requirements.txt

Comment: @jbuddy_13 Nope, its misleading to think to interpret this freeze literally.
Comment: Perhaps dumb question, pip doesn't need to be "unfrozen" after this command to resume normal operation, does it?
Answer: I use what is basically David Sickmiller's answer with a little more automation. I create a (non-executable) file at the top level of my project named activate with the following contents:
[ -n "$BASH_SOURCE" ] \
    || { echo 1>&2 "source (.) this with Bash."; exit 2; }
(
    cd "$(dirname "$BASH_SOURCE")"
    [ -d .build/virtualenv ] || {
        virtualenv .build/virtualenv
        . .build/virtualenv/bin/activate
        pip install -r requirements.txt
    }
)
. "$(dirname "$BASH_SOURCE")/.build/virtualenv/bin/activate"

(As per David's answer, this assumes you're doing a pip freeze > requirements.txt to keep your list of requirements up to date.)
The above gives the general idea; the actual activate script (documentation) that I normally use is a bit more sophisticated, offering a -q (quiet) option, using python when python3 isn't available, etc.
This can then be sourced from any current working directory and will properly activate, first setting up the virtual environment if necessary. My top-level test script usually has code along these lines so that it can be run without the developer having to activate first:
cd "$(dirname "$0")"
[[ $VIRTUAL_ENV = $(pwd -P) ]] || . ./activate

Sourcing ./activate, not activate, is important here because the latter will find any other activate in your path before it will find the one in the current directory.
Comment: Loving this approach! Sounds very reasonable, thank you for sharing.
Comment: I had to change the first line to `[[ $_ != $0 ]] || { echo 1>&2 "source (.) this script with Bash."; exit 2; }` to detect if the script was being executed as opposed to sourced
Answer: If you just setting up development env, then use pip freeze file, caz that makes the git repo clean.
Then if doing production deployment, then checkin the whole venv folder. That will make your deployment more reproducible, not need those libxxx-dev packages, and avoid the internet issues.
So there are two repos. One for your main source code, which includes a requirements.txt. And a env repo, which contains the whole venv folder.
Answer: I think is that the best is to install the virtual environment in a path inside the repository folder, maybe is better inclusive to use a subdirectory dedicated to the environment (I have deleted accidentally my entire project when force installing a virtual environment in the repository root folder, good that I had the project saved in its latest version in Github).
Either the automated installer, or the documentation should indicate the virtualenv path as a relative path, this way you won't run into problems when sharing the project with other people. About the packages, the packages used should be saved by pip freeze -r requirements.txt.


How can I quickly level up my party members?

Question: There are a lot of party members in Xenoblade Chronicles X, and seemingly all of them have special sidequests which require using them. Since only characters in your active party get experience, how can I quickly and efficiently level up all my party members? I don't have any trouble keeping Lin and Elma leveled as they're mandatory for the bulk of story missions, but the 10+ other characters all end up behind.
Answer: What I do is as follows:
Hop in a skell (preferably one with very heavy-hitting weapons such as HOMURA, G-BUSTER, and PHOENIX -- intergalactic quality if you can).
Go to FN 306 and fly to the northeast hex, and up the cliff.
Here, there's a level 70 saltat. It's very easy to kill repeatedly and grants a great amount of XP - I've been leveling up my characters relatively easily due to this.
That said, if that spot is too difficult for where you're at in the game, there are also level 51-53 saltats one hex NW (and around) of FN 106. The strategy here is the same - attempt to one-shot them, then finish them off in other ways.
Comment: This seems to be the best method. The locations may change based on your own level and skell selection, but the core of this (using Skells to fight average sized monsters of a higher level) is very hard to beat.
Answer: The above strategy works. However in the end game (when you get the flight pack) there is a better site. Fast travel to noctilum and go to the divine roost ( 3 north most fun sites) plant probes then using skells fly to top of central plant thing ( I recommend all 4 team members have skells your character having a level 50 and the other level 30 heavy skells (Adamius and masters work and equipped with buster and snipers,explosive spare weapons and also if possible the phoenix back weapon ( makes the fight MUCH easier).
Now use phoenix on the level 60 Blatta ( to start the fight use phoenix to trim enemy health, ( don't mind uncontrollable playing the level 90 tyrant is actually really weak (it's a oversized Blatta so shouldn do to much damage.)
Use the explosive weapons to deal with the swarming level 60 Blatta and the if confident focus on the level 90 tyrant if you can't kill it don't worry just run as it can't follow.
Then after the fight look at your exp bar, this fight should level you up immediately if you under level 55.
Answer: What I did was I bought a full set of EXP XII armor, which gave me a 120% EXP boost to everything I killed, so I didn't have to go out of the way to level up.
Comment: What manufacturer makes this armor? And do you know what level it becomes available? If you could add these things to your answer, that would be awesome :)


Subtract lines from lines in QGIS

Question: I have two shape files with lines: one has 41k+ lines and the other has 606 lines. Lines from these layers often overlap. I want to use the second one as a mask to clip lines from the first one so I have a layer with around 40,5k with overlapping features deleted.
I have tried "Difference" and "Symmetrical difference" operations in QGIS but they didn't work for me. How can I do it then?
Comment: Have you made sure, the lines are in the exact same spots?
Comment: @Erik I thought I was sure everything is perfectly aligned but at the most minimal scale they are in slightly different spots. That's the problem, thanks for helping me find it!
Answer: You may be able to accomplish this, using the clip function and a buffer. If you place a very thight buffer and delete everything that either touches it or is completly encased you may get your results.
Comment: Yes! It helped! There was a tiny distance between the lines from different layers, I created a buffer and it worked like a charm. Thank you!

Subtract lines from lines in QGIS