Unable to publish Microsoft project on PWA

Question: I have created a Microsoft project on my local PC and trying to publish it on SharePoint PWA. If I create a project with normal/simple project template then there is an option foto publish it on SharePoint But When I create a project with any other project template the publish option is faded out.
Comment: I mean the Microsoft project professional templates.  The Microsoft project ask you when you create new file in it. There are options such as blank project,  software development etc. Then pre-existing entries are already created in it.
Comment: Please check my answer :)
Comment: what do you mean with  normal/simple project template  ? are you mean enterprise project ttype (EPT) ? or project site template  ?
Answer: Based on your question ,

You opened Microsoft Project > connect to server select the blank project template and in this case, you can find the Publish button.
But if you have selected another template like commercial ...etc , you can't find the Publish button.

This is because The selected templated is not saved to project server

So if you need to use another template you should first publish it to project server as EnterPrise template by doing the following :

Open Microsoft Project.
At login > at Profile > select the URL of Project Server, not computer.
Now Select your favorite template like software development.
From File Menu > click Save as.
In Save > in type > select template.

Now close , and open Microsoft Project again, and select from Enterprise tab your project template that you have already saved.

Now you will see the publish button activated.


Where can I find a review of discrete math

Question: I'm looking for course notes and assignments  and hopefully some example exams for Discrete Math, I'm taking a placement exam in the subject after having taken it 4 years ago.
Comment: What kind and what level of discrete math you are talking about? Combinatorics, graph theory, some elementary number theory? It's easier if you find reviews on each individual topic, discrete math is a large field.
Comment: I was looking mostly for the equivalent of a first course in Discrete Mathematics. The usual content if I remember correctly was basically just a overview of everything you mentioned. Logic, Proof Techniques(induction), Number Theory, Sets, Abstract Algebra, Graph theory...  Nothing in depth but just an overview of it all.
Answer: When wanting to know about a particular mathematics subject, I often find that starting with the "further reading" section of the relevant wikipedia page is a good way in.
Answer: This is the discrete math course one in my school. It contain lecture notes, homework and previous exams. http://www.cs.sunysb.edu/~cse547/
Answer: if you don't mind shell out a good amount of money, Concrete Mathematics by Graham, Knuth and Patashnik could be nice (I own the first edition)
Comment: @Thomas: I second that, you can get depressed by this book as it really for advanced students (pretty good at math). Its certainly a GEM but not the right tool for this purpose.
Comment: That is well beyond discrete mathematics, at least what is taught in discrete mathematics at the undergraduate level at my university.
Answer: When it comes to textbooks, the Kenneth Rosen text Discrete Mathematics and its Applications is highly recommended. I was first introduced to it at my university, but I've seen it cited in several places.
Comment: Good book suggestion, I have a copy of the book from the last time I took the course, I was just hoping to find material that would let me check what I remember and then be able to dive into what I forgot by reading the book section needed.
Comment: In terms of assignments, we just worked problems right from the book. And most of the test problems were either from the book or based on problems in the book. I would suggest just doing that - reading the chapter and picking out a few questions and checking your work and answers with the solution guide. Unfortunately, I can't provide you with links to the material from when I took the course - they aren't on any public web pages. :(
Answer: For quick review Schaum's Discrete Mathematics is good.
If you have time, read Foundations of Computer Science By Aho-Ullman. It's free and available online. Around 800 pages.


Is there a gender neutral pronoun in mandarin?

Question: I am current a high school student and am taking mandarin at school. My teacher and I both identify as non-binary. After all the research I've done the closest thing I can find is 它, but from what I can tell that is really "it" and not used for people. I'd really like to find an alternative to 他 and 她.
Comment: 他 used to be gender-neutral. 她 was invented in the 1920s. Today in speech it still doesn't matter because 他 and 她 sound exactly the same. In written form you can just call your teacher X老师 (X being your teacher's family name). This is more polite anyway. Third person pronoun with gender is not a universal concept. In many languages people just use expressions like 'that person'.
Comment: 他 is used in gender neutral situations or when the gender is unknown. I got in an argument about this on duolingo that resulted in me being shadowbanned. I hope this isn't a case of you unwilling to accept how the language functions due to your radical political beliefs.
Answer: Nowadays, it's common for authors use the English letters "TA" to avoid indicating a gender.  For example:

TA是什么性格的人[src]
Literal translation: They are what personality person?
Translation: What is their personality?

Many more examples are found in Baidu News by searching for "TA".
See also: What would a non-binary tā (他/她) look like?
Comment: This should still be considered informal.
Comment: 'Ta' is not 'English letters'. It's pinyin (Chinese romanization system).
Comment: When I wrote the answer, I thought "maybe I should change 'English' to 'Latin'", but accepted that was a bit nit-picky.  Sure, "TA" (as a whole) is derived from pinyin, but I feel it's reasonable to individually call "T" and "A" English letters.


After Effects melting film strip in the old projector

Question: I want to make the effect of a melting film strip in the old projector. Please tell me how this can be done with After Effects? I have all the necessary footages, but after blending it does not look realistic. I want the film strip  to start melting from below, and then the fire gradually destroyed the frame and burst out.
Answer: I would try using a displacement map. You can use a solid with turbulent noise on it and use it as your map, then animate the evolution, contrast and brightness so it displaces the film accordingly. If your burn is a separate layer, you can also use this as the matte for the solid with turbulent-noise in it with the effect "set matte".
Also, you might want to try to using a similar turbulent noise layer as a matte for the whole comp, meaning that the spreading bubbles from the noise (you can spread it out by pulling up a mask and keyframing the mask expansion) effectively get shuffled into your alpha-layer. If you then duplicate all this, move it one layer below, shift it to the right in the timeline (so the lower layer is about 10 frames later than the upper) and then drastically increase the contrast and lower the brightness, you will achieve some dark edges to the burnt parts.
Comment: Thanks for the tip. A displacement map is a great solution, but I can't figure out how to move displacement along Z axis. I want the film strip to swell in the shape of a bulb before the flame appears.


What is the difference between "accolade", "câlin" et "étreinte"?

Question: What are the nuances between them?
Is it like so?:
accolade = standard, neutral
câlin = is stronger than accolade
étreinte = more for couples that are in love
Comment: Didn't know that *accolade* was still used in modern French, since it was borrowed into English in contexts related to medieval knighthood (the ceremony once included a ritual hug from the liege lord awarding the new title). It makes sense that *étreinte* is more formal than *câlin* though; Adam Hargreaves' character "Little Miss Hug" became Madame Câlin when the book, written for young children, was translated into French.
Answer: Accolade originally means a hug where you hold the neck of the other person. In accolade there is col which is (with cou) the word for neck.
But accolade usually means some kind of formal hug between two people, eg. politicians.
Accolade is also the French for curly brace.
Câlin indeed involves some kind of tenderness. Câlin applies to : a mom to her child, a kid to his teddy bear, friends or two lovers.
As for étreinte, there is a notion of strength or a lack of equilibrium between the people involved.
Étreinte can describe something wilder, and sometimes unwanted. You would use the word for a wrestler holding his opponent for example. It also means a passionate hug.
Answer: "Accolade" is more neutral, formal between two persons.
"Câlin" is more signifiant for two people who have a more strong connection, like two friends or two lovers.
"étreinte" is more related to lovers, like a hug that last longer.
So yes, it is more like you were thinking ;)
Answer: accolade
câlin
étreinte
accolade is somewhat literary or formal. It means to embrace in a way that involves the neck.
câlin is what parents do with children. They cuddle them. The expression is faire un câlin. It can also be translated as: to give hugs to someone or physical affection.
étreinte is usually associated with a close embrace that lasts longer than a simple hug and does not necessarily involve the neck. It is often associated with an embrace associated with sexual relations. The lovers clasped each other tightly. Les amants se tenaient par une forte étreinte. But it can also be used in a negative way:
Il n'arrivait pas à s'échapper de l'étreinte de son ennemi. He could not escape his enemy's grasp. And also means grasp in the sense of being held by something or someone one wishes to escape from.


MySQL get a lock to update certain rows and prevent other sessions to read that row

Question: my question is:
How can I get a certain row to update and on the other side, block that row to be selected by other sessions. I don't want a simple SELECT .. FOR UPDATE or SELECT .. LOCK IN SHARE MODE. I want the second session not to be able to select the row at all. Maybe some isolation level, I tried them all but nothing.
Thanks
Comment: Please explain _why_ you want that behavior.  Then we will explain a _different_ way to achieve that goal.
Comment: If the particular row is being updated I don't want other sessions to be able to select it and look at its data. Like skipping it at all
Answer: Unless you set the transaction level to read uncommitted, a transaction will see the unmodified row. The second session only has to acknowledge the existence of the first session when both sessions want to lock that row, otherwise they will act as if the other transaction doesn't exist (as that session could rollback at any time) - which is the whole point of using transactions.
In MySQL, you can get a locking read by either explicitly using SELECT .. FOR UPDATE or SELECT .. LOCK IN SHARE MODE, or by using the "serializable"-isolation level for the second transaction, which implicitly adds the LOCK IN SHARE MODE for you to every select in that transaction:

This level is like REPEATABLE READ, but InnoDB implicitly converts all plain SELECT statements to SELECT ... LOCK IN SHARE MODE if autocommit is disabled. If autocommit is enabled, the SELECT is its own transaction. It therefore is known to be read only and can be serialized if performed as a consistent (nonlocking) read and need not block for other transactions. (To force a plain SELECT to block if other transactions have modified the selected rows, disable autocommit.)

So if you can force the second transaction to use that transaction level and to not enable autocommit, you can lock that row for this session; but keep in mind that this mode can slow down concurrent queries, as every read locks, so you might want to use this mode only when you need it.
This behaviour complies with the requirements of the sql standard. The exact implementation is a design choice, and other databases will do this differently. E.g. the MSSQL Server will not read your modified, uncommitted row (unless the isolation level is read uncommitted).


Need advice for changing battery terminals

Question: Hey so I have a 2000 toyota corolla 4A-FE manual, its had connection problems in the past so got a new battery and it didn't start one morning so I tightened the terminals (and put fuel in it) and its been fine after that. But since there looks like corrosion on both I want to replace them and its cheap and easy. The problem I have is I'm confused on how to cut the positive cable and whether there will be enough wire left to reach afterwards:
Comment: I've seen corroded battery terminals, and those ain't them. Those are _incredibly_ clean for a 21 year old car!
Comment: I just realized what a small battery that is at only 330 CCA, lol. I guess you don't need a large battery for a small engine/car. My daughter's Honda Fit had a smaller one, I think, but yah ... you'd think its a lawn mower battery or something ;-)
Comment: Yeah haha I was surprised but it works fine
Answer: That the car now cranks and runs correctly tells us that the battery and the cables are conducting electricity acceptably. I see no need to cut and refasten either cable, especially (as you note) the (+) cable may not be long enough to allow connection after it's made shorter.
The minor corrosion visible in the photo is external to the clamp surfaces, shouldn't be a concern, and you don't need to wrestle with the too-short-cable issue. If you want to make things cleaner, disconnect the (-) cable, then clean the (-) post and the inside of the (-) clamp. Leaving the (-) cable disconnected, then disconnect and clean the (+) connection parts. Then reconnect the (+) cable, and finally reconnect the (-) cable.
Comment: I agree, that looks pretty typical to me.
Answer: From the images I'm seeing very little corrosion. I think your bigger issue is the clamps themselves seem to be worn out. While you say it is "cheap and easy", you also ask "where do I cut them at" ... the answer to that is, you don't. There is the nut on top which is there. This, when removed, separates the battery cable from the clamp. You can replace the part between the cable and the battery post without having to cut anything. Just replace the clamp itself, then reattach the cable to the new clamp. Very easily done and should solve all of your issues.
Also, unless you're replacing the battery, you should use these same nuts to disconnect the battery from the car. This will save wear-n-tear on the clamps and is actually easier to accomplish.
Comment: It looks like they have already had some packing between the clamp and the post.
Comment: I just realized both pictures are the positive post ... guess I need to pay better attention. Doesn't change my answer any, but that's assuming the negative post looks the same and has the same connection type as the positive post has.
Comment: @Paulster I agree 100% with this answer. In the photos the clamps have been overtightened. Just replace them.
Comment: That makes sense now looking at the positive, thank you! I added a photo of the negative  terminal
Comment: @HandyHowie agreed - looks like a cylinder of soft metal used to adapt a small-post battery to a slightly larger-holed clamp.


Does SoundManager2 work on Android 2.2 without flash?

Question: I'm trying to get SoundManager2 to work on Android, but so far it will not play any audio. Does anyone know if there is any way to get this to work on Android without flash being present? If so, please could you provide an example or a page that discusses the issues around this.
Answer: Verify that html5 audio support is there in 2.2 by going to http://html5test.com/
I have Froyo (2.2) on Milestone and the page says audio-element: yes but No to PCM, mp3, AAC, Ogg, WebM. This is probably the reason why it is not working.
I assume that you are using the latest version of SoundManager2 (V2.97a.20110306 - HTML5 audio updates, Flash/HTML5 mode detection, IE flash init tweaks, reuse and instance options fixes). The revision history says "HTML5 audio: If no flash, try forcing useHTML5Audio = true (eg. desktop
safari on new Macs which don't come with Flash.) Related: flash detection code tweak."
But it is better to explicitly specify soundManager.useHTML5Audio = true; in the script or useHTML5Audio :true when you call soundManager.createSound(). This will ensure that SoundManager2 is not the reason why html5-audio is not working.
Answer: I visited the http://html5test.com/ on my Galaxy S2 from T-mobile in the default web browser provided by Google (on Android 2.e.6).  It said 189 and 1 bonus point out of 500 points.  It also said it supported mp3 playing.  The REAL test came when I actually visited the soundmanager2 website at http://www.schillmania.com/projects/soundmanager2/ on this same phone and tried their demos.  The examples do NOT work on my phone.  Oh well.


Sideloading apps on Windows 8.1 Lumia

Question: Is there a way to side load apps (appx) on a Windows 8.1 phone? I have built an app but it's not loaded on the windows store yet. I would like to send to a few friends to test out but I can't find a way to load up these apps without Visual Studio.
Answer: The easiest way would be to publish it to the store as a hidden app and provide your friends with promotion codes so only they can find & download it.
Afaik you need the developer tools to unlock your phone for sideloading otherwise.
Answer: There is an easier way than what has been desdcribed to you, I own a Microsoft Lumia 435 and I was able to do this with an app I had developed.

Go to Settings → For Developers, and enable the "Sideload Apps" option.
Now you need to plug your Lumia into a USB port on your computer/laptop and copy the .xap file from your computer to your Lumia's SD card.
Unplug from USB port and open Windows Store, then press the "More" option and then press "Install Local Apps".
Now install the app you wanted to install.

Job Done ;)
Comment: I don't see a "For Developers" option in Settings.
Answer: You would have to be a "Developer" and then using Visual Studio, push the .xap to your phone. When I signed up, it was $15 a year for me to be a Developer, I'm not sure how much it is now.

Sideloading apps on Windows 8.1 Lumia


Formatting list row based on status column Office365

Question: I am trying to change the background color of each row in SharePoint list on office 365. I have been looking online for two days there are so many solutions and most of them don't work on new list experience.
My main objective to conditional format a row based on a value of a status column.
can someone help me with this?
Answer: Yes, it is possible.
You can use View Formatting in Office 365 to color the rows based on the Status field.
Use below JSON code to color the rows in your list:
{
  "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
  "additionalRowClass": "=if([$Status] == 'Done', 'sp-field-severity--good', if([$Status] == 'In progress', 'sp-field-severity--low' ,if([$Status] == 'In review','sp-field-severity--warning', if([$Status] == 'Has issues','sp-field-severity--blocked', ''))))"
}

You can put above code by selecting Format current view option as given below:

Reference:
1. Use view formatting to customize SharePoint.
Update:
To use customized colors and formatting you need to use rowFormatter in JSON formatting:
You can find view samples on GitHub.
Comment: sorry I wasn't clear with my question. I need specific color not predefined color . is this possible?
Comment: Which colors do you want?
Comment: in this case, you need to use `rowFormatter`. check updated answer.
Comment: I need to do this for several lists. I need to have at least 20 different colors.
Comment: You need to add the json code in each list separately.


My manager is asking me to take work laptop at home

Question: My manager is asking me to take work laptop home because he says "I might need it anytime". Now I signed up for typical 8 hours 5 days a week developer job and I like to keep work things at workplace while my team members take it home. As I am a fresher I am not sure what the industry norm is about this but If I say no I might come up as someone is not very co-operative and not well integrated with the team in the eyes of my manager at the same time I don't want to work at non-working hours. How should I say no to this without risking the job?
Comment: Did your manager say anything about what you're expected to do at home and what the compensation for working from home is? Also, did you make it clear during the hiring process that you want a 9-5 job and aren't willing to work emergencies?
Comment: An employer asked me to do the same at the end of the first Friday at the job (hinting that I might use it during the weekend). I told him I had a laptop at home and locked the work laptop away in my locker, which he saw. He got the message and never mentioned it again.
Comment: @Erik In the contract I am only expected to work and compensated for the hours discussed. During interview I made very clear that I'll be working for the agreed hours as I have other commitments.
Comment: Maybe on some days, your boss just wants everybody to remote in, without coming to the office during work hours.  ;)
Answer: You have to ask your boss.
Some reasons why your boss might want you to take the laptop home:

On bad weather days you can work from home.
On a business trip you don't have to bring your personal laptop.
They might allow you to work from home one day a week.
On a day when you aren't feeling well you can do a little work from home.
One a day when you have to be home while the heater is being repaired you can still do some work.
They want you to be able to work 7 days a week.

All are reasons. There are probably even more. The only way to know which ones apply is to ask.
Letting you take a laptop home means that on a snow day you can't say I would have done work, but I don't have X on my computer, or I had no way of checking email, or I couldn't VPN. But with the laptop you get paid if you work, instead of having to take a day of vacation.
After you ask, and they tell you why, you can still decide you don't want to have it at home. In some cases you can keep it at work, and only take it home when you need to. Of course that doesn't help you if the reason you are home is due to an emergency.
You also have to decide if the reason for not wanting to take it home (potential loss of work life balance) is big enough to put up a fight now, before you even take the laptop home.
Comment: This - ask!  He might need to you work from home in an emergency, but then you get 2X pay for shift differential and get to comp out the regular work hours.  Just say "what's the company policy about required work from home?  I'm not familiar with it."  Or ask HR, or read the employee manual that everyone gets but no one reads.
Answer:
How should I say no to this without risking the job?

Just refuse, but be prepared for repercussions, because refusing to do something and citing contracts and working hours is great in theory, but in practice it's not a good look although I would think that it's not something you'd get sacked over.
One possible strategy is you don't want to be responsible for the equipment at your place, because it's not safe at your domicile. That worked for me as a student living with several others in an apartment in a bad area.
Comment: +1 for "you don't want to be responsible for the equipment." If this is just an excuse, however, OP may want to take the laptop home to conform with the request, but not turn it on, and postpone discussion about out-of-hours work to when the question is raised.
Answer:
he says "I might need it anytime". Now I signed up for typical 8 hours 5 days a week developer job

I don't agree that 8 hours x 5 days is "typical" for a developer's job. My experience says otherwise.
But more important is that it is possible that you and your boss have different opinions regarding the job requirements. The only way to know is to ask.
You should get to the bottom of this right away. During your next one-on-one meeting with your boss, you should talk about job expectations, including the expectation to be available off-hours when needed.

How should I say no to this without risking the job?

Don't say "No". Instead ask about the expectations.
It's possible that you are being asked to take the laptop with you in case you choose to work from home during normal work hours (due to commuting problems, etc). My company asks people to take their laptop home in case the office datacenter is down (due to power outage, or system failure, etc). Workers can connect to the VPN of a remote office and still get work done.
If you expect to work only 8x5=40 hours, and the company expects something different, then this may not be the right job for you. It would have been better to clarify that during the interview process so that you could have made a good decision, it's still important to know that as soon as possible now.
Comment: From my experience 40 hour work weeks are typical.  It probably varies culture to culture.  Most of mine have been 40 plus emergency deadlines which weren't often.
Comment: My work weeks have varied from 40h to as much as 70+h when required (Thankfully those kinds of weeks are the rare exception). I'd rather put in those extra hours at home after dinner and work from 8pm-midnight when the kids are in bed than work at the office til 9pm.
Comment: In my country 35-40h work weeks are typical. Overtime is very untypical. Unpaid overtime is flat out illegal end of.
Comment: @JoeStrazzere I know. I was just describing how it works here across the pond in europe.
Comment: @JoeStrazzere Salary, how I love and despise it. ;-) Constant pay, but with the lack of OT it can be tiring. Mostly, here at my job, it's the "on call" weekends that are killer, when they expect that laptop to go everywhere with you so that you can respond within 10 minutes to any issue...meaning I'm leashed to WiFi. ;-)
Answer: It could very well be the norm for your industry.
Instead of saying no outright, I would take the laptop home and see what happens.  It could be that you never have to use it.  It could be that you use it once a year in an extraordinary situation.
Asking you to take the laptop home is not the same as asking you to work 10 hours at home each week outside of your normal working hours.  I would wait for that demand to be made before saying no.
Answer: It seems like this issue is part of a bigger problem with you understanding what is expected.
Talk to the team. Find out how much time they're spending at home on work. Is the work they're doing expected or are they just clearing out boring things like email, so they can focus on other things at work or maybe they just surf the internet.
Determine how much time at home and/or over 40 hours are you willing to do. My experience is it is a pipe-dream to think you will never go over 40 if you're on salary. It's going to happen. Prepare to deal with it.
Finally, talk to your boss and try to get an understanding of why you expect to only work 40 hrs/week and never from home. This is important with every job you take in the future. You need to ask the right questions from multiple sources during the interview process to learn what is going to be expected.
Once you fully understand the expectations, you can determine how to handle them if you don't want to do them. Keep this in mind if you decide to start looking for another job. You may find over 40 hours is more common than you think in your industry.
Answer: This could be  part of the business continuity strategy.  Some workplaces have a requirement to take the laptop home every night, but not to use regularly.  If the main location was uninhabitable (say a A/C failure in Tucson), you could still connect and work without having to come into the closed office.
I require my critical personnel to be issued laptops that they either take home each night or leave at home.  We occasionally test connectivity from home to our production data centers to make sure we can perform failover tasks.
Comment: Welcome to the Workplace -- this is a great observation but does not appear to actually answer the question. Can you include more detail to address the main question ("How should I say no to this without risking the job")?


Is it possible to land a plane only with the Garmin® Synthetic Vision?

Question: A synthetic vision system shows the pilot the position of his plane in a 3D-modelled flight environment.
It's like a 3D TAWS. It also shows the position on the runway:

As I have seen, this feature works quite good. It's sometimes a bit off the centerline, but on the runway.
It is clearly stated that this is only to be used as feature to enhance the situational awareness. And I am also quite sure that this is not authorized as primary navigation source.

But imagine: You are flying in zero visibility. You have an emergency and must land. There is no ILS. (You have done no flight planning and the bad weather surprised you)

Would it theoretically be possible to land a plane only with this synthetic vision?
Is it accurate enough?
Would the plane at least come down in one part?
Answer: Apparently yes, according to this 2008 review of the system in a Diamond DA40:

With [a safety pilot], I stayed under
  the hood for the entire flight—takeoff, en route, approach and
  landing—using the system's visual cues. I managed to land the airplane
  without breaking anything, barely. It wasn't pretty, but it
  demonstrated what was possible.


Simple question about BGV scheme

Question: While I'm trying to implement BGV scheme myself, I found that I'm really confusing about the encryption and decryption of the scheme. Here's my understanding:
Let $p$ be a plaintext modulus and $q$ be a ciphertext modulus (they are coprime). Let $\mathbb{Z}_{m} = (-m/2, m/2] \cap \mathbb{Z}$ be the fixed set of representatives modulo $m$ and $[\cdot]_{m}: \mathbb{Z} \to \mathbb{Z}_{m}$ be modulo $m$ map. Let $R = \mathbb{Z}[x] / (x^{n} + 1)$, $R_{m} = \mathbb{Z}_{m}[x]/(x^{n}+1)$ as usual ($n$ is a power of 2). I would ignore the level and bootstrapping stuffs.

Key generation

$a \leftarrow U_{q}$, where $U_{q}$ is uniform distribution over $R_{q}$
$s \leftarrow \{-1, 0, 1\}^{n}$
$e \leftarrow GD(\sigma)^{n}$, where $GD(\sigma)$ is a (discrete) Gaussian distribution with standard deviation $\sigma$
$b = [as + pe]_{q} \in R_{q}$ and $pk = (a, b) \in R_{q}^{2}$

Encryption:

$r \leftarrow \{-1, 0, 1\}^{n}$, with $P(X=0) = 1/2$ and $P(X=-1) = P(X=1) = 1/4$.
$e_0, e_1 \leftarrow GD(\sigma)^{n}$.
message $m \in R_{p}$
$c_{0} = [br + pe_{0} + m]_{q} \in R_{q}$
$c_{1} = [ar + pe_{1}]_{q} \in R_{q}$
Encrypt $m$ as $\mathrm{Enc}(m) = (c_{0}, c_{1}) \in R_{q}^{2}$

Decryption

For a ciphertext $(c_{0}, c_{1})$, decrypt it as $[[c_{0} - c_{1}s]_{q}]_{p}\in R_{p}$.

I understand how this is intended to be $\mathrm{Dec}(\mathrm{Enc}(m)) = m$, but when I tried to do some toy examples with own hands, I found that there's something I'm missing now.
What I think is that, there are two modulus (plaintext and ciphertext) and using both actually makes decryption fail. This is because $[[x]_{q} + [y]_{q}]_{p} \neq [[x+y]_{q}]_{p}$ and $[[x]_{q}[y]_{q}]_{p} \neq [[xy]_{q}]_{p}$ in general. Especially, if $x + pe \not\in \mathbb{Z}_{q}$, then reducing modulo $q$ would make $[[x+pe]_{q}]_{p} \neq [[x]_{q}]_{p}$ which yields decryption fail. I think I'm missing something really simple but I can't figure out.
Answer: You must choose q so that the noise in the ciphertext doesn't overflow. For example, if $p = 2$ and $n = 256$ you can use $q = 7681$ (taken from Kyber). There are many possible instantiations, and the important point is that the norm $||c_0 - c_1 s||_\infty = ||p (e r + e_2 - e_1 s) + m||_\infty$ is less than $q/2$.

Simple question about BGV scheme


Is it possible to use the Goode Homolosine projection in QGIS?

Question: Is it possible to use the Goode Homolosine projection in QGIS? Both QGIS and GRASS seem to have trouble with the interruptions, squashing the higher latitudes together. I tried +proj=goode +ellps=sphere +datum=wgs84 as a custom CRS.
Answer: With QGIS Lisboa, there is now a basic support for Goode Homolosine projection.
I downloaded IGH data from http://edc2.usgs.gov/glcc/fao/data_specifications.php
and set up this user CRS:
+proj=goode +lon_0=-100 +x_0=-11119487.43 +y_0=0 +a=6370997 +b=6370997 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

for North America.
lon_0 and x_0 are from Appendix 03 of this document: http://proceedings.esri.com/library/userconf/proc98/proceed/TO850/PAP844/P844.HTM
Overlaying natural Earth world boundaries_m, I get this picture:

Fitting good in North America (about 20km misplaced), and distorted in other regions.

EDIT
Just noticed that proj knows interrupted goode homolosine by now:
+proj=igh +ellps=sphere +towgs84=0,0,0 +lon_0=100w +x_0=-11119487.43

gives me this picture of Natural Earths world boundaries and a 10-degree-vector grid:

I'm not sure which parameteres apart from +proj=igh are necessary anymore.
Comment: Using the definition above I get a pixel shift. For me the definition `+proj=igh +towgs84=0,0,0` worked just fine
Answer: QGIS 2.18 is nigh on fully supporting the Homolosine for rasters. You just need to be aware of issue #959: perform any raster warpping directly with GDAL using the CHECK_WITH_INVERT_PROJ parameters and you are good.
Regarding vectors things are still complex. Some of the errors AndreJ shows in his answer prevail. The cause is simple: QGis is not aware that it is a Cartographic programme and considers the co-domain of any projection to be an infinite space.
This has a simple fix: intersect any vector layer imported into QGis with the Homolosine co-domain. Some time back I made available a discrete co-domain vector defined at intervals of one degree longitude and latitude.
Comment: Thank you! It works perfectly!
Answer: There has been a question on interrupted projections before: Discontinuous or Interrupted map projections?
The conclusion was that proj4 (which is used for projection handling in QGIS and GRASS) does not support interrupted projections.
Comment: All projections are interrupted... i.e. the counter domain is a finite space, not infinite ;)
Comment: I should have mentioned a ticket on the Proj.4 tracker for Goode Homolosine support (which was created after that question was asked): http://trac.osgeo.org/proj/ticket/106. Looks like I don't have as new a proj as I thought, though; I'll try updating my proj and see how it goes. Sorry for the duplicate question.


coolant flush in cold temperatures

Question: I need to flush my coolant however I don't have access to a warm garage (without paying for a tow). Was curious if it's bad/possible to flush it outside when temperatures are below freezing? Any suggestions welcome I am very new to all this. Thank you.
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Comment: Related: https://mechanics.stackexchange.com/questions/50899/why-is-my-car-overheating-in-the-winter
Answer: It shouldn't be an issue changing the coolant in your vehicle no matter what temperature. What you need to be aware of is to prepare yourself appropriately in doing the work.
Several things to consider -

Ensure you have a container which will hold all of the coolant you take out of the system. Look up for your car how much coolant it takes. Make sure you have a lot more container than you will coolant.
Know ahead of time where you can turn the used coolant into. Used coolant is highly recyclable. It shouldn't just go down the drain. Also, it's highly toxic if someone or animals were to drink it, so get it bottled up quickly after you've done your work.
When doing the work, keep your hands covered. Using nitrile gloves work great. There isn't an issue with coolant getting on your skin (not toxic to your skin), but you don't want it evaporating off your skin in cold weather as it can possibly cause frostbite.
It's a lot easier to use 50/50 premix coolant than to get full strength coolant and try to mix it down with distilled or ionized water to get the correct concentration.
You may want to warm the car up some, but not completely before you go to change it out. Warming it up a little will help you not to get frozen by cold coolant. You don't want it too warm, though, as when you pop the radiator cap it will have pressure and may spew. Warm the car up just to the point where the temperature gauge comes up off of the cold mark. It's a lot easier to work on a warm engine than a cold engine ... just ensure it isn't hot or all kinds of heck could break loose!

I don't really know why it's imperative for you to change your coolant out in cold weather. If it can wait until it's warmer out, I'd do it. Just my humble opinion.
Comment: @paulster2 Thank you so much for the response! I am in need of changing it because I am troubleshooting another problem. In the summer I changed my radior but forgot to put coolant in my system. Fast forward to winter time...my cars starts to sound bad, it's cold and i remember I forgot to add coolant. So I added some. However, now my car is auto revving when I try and start it. I read: https://honda-tech.com/forums/honda-prelude-4/changed-coolant-now-engine-revs-up-down-2700444/that trying to "burp" or flush the coolant solved this problem. Any other input would be welcome! Thanks!

coolant flush in cold temperatures


Can matter be described as the result of the curvature of space, instead of vice versa?

Question: Can matter be described as the result of the curvature of space, rather than the curvature of space being the result of matter, and energy being the cause of the curvature of space?
Comment: One difficulty that has not yet been addressed in the answers is that matter has to obey quantum mechanics, but it is not yet clear how to get the curvature of spacetime to obey quantum mechanics.
Comment: One historical tidbit: Einstein & Rosen (1935) represented an electron as Schwarzschild's curved spacetime. However in retrospect, we reinterpret their work as a "wormhole" solution with nothing to do with an electron.
Comment: speculation: Maybe describing something as "matter" or "spacetime curvature" is ultimately a matter of taste, like say a particle or wave representation.
Answer: Maybe one day.
This idea, at least it's mathematical genesis seems to have begun with Riemann and later Clifford. In 1870 Clifford (a very good mathematician), building upon Riemann gave a lecture stating:

1) That small portions of space are in fact analogous to little hills
  on a surface which  is on the average flat namely that the ordinary
  laws of geometry are not valid.
2) That this property of being curved or distorted is continually being
  passed on from one portion of space to another after the matter of a
  wave.
3) That this variation of curvature of space is what really happens in
  that phenomena we call the motion of matter, whether ponderable or
  etherial.
4)That in the physical world nothing else takes place but this
  variation, subject (possibly) to the law of continuity.

This was the type of thinking that Led Einstein to consider space and time as dynamic entities and develop General Relativity(using Riemann's then developed geometry).   Many others have sought to describe more of the universe than gravity through this type of program.
As of now, it's a no; however some progress has been made.
Because Electromagnetism curves spacetime like matter does, it has been shown (Rainich, Misner, Wheeler) that just the "footprints" left on spacetime by electromagnetic fields are enough to reconstruct the fields themselves (up do a "duality" rotation). This of course only holds for classical electrodynamics. This was called "Geometrodynamics" by Wheeler (who was famous for coining other phrases like blackhole and wormhole as well).
Wheeler showed analytically that a properly constructed ball of gravitational and electromagnetic radiations would possess the properties of a massive object (he called this a geon) and he applied similar topological ideas such that electric charges can appear to exist when there is in fact none (a trick of spacetime geometry).
To go further, one would need to be able to describe the gauge fields of the standard model in terms of geometry and properly quantize it. Whether these things can be found withing the topology of general relativity's spacetime, well that jury is still out.
The equations involved here are highly nonlinear, especially when you have the feedback effect of describing say the electromagnetic field through geometry which in turn effects the geometry again.
Anyway, when I read your question I am literally reading a book in front of my face:
"The Geometrodynamics of Gauge Fields. On the geometry of Yang-Mills
 fields and Gravitational gauge theories" Eckehard W. Mielke
I'll update this when I'm done maybe, it's an excellent book by the way.
PS: I had the pleasure of seeing Kip Thorne Lecture this (last?) year and he seems a large proponent of geometrodynamics. As one of the founders of LIGO (we're FINALLY detecting gravitational waves!!! still can't believe it) there's a potential to test such theories in the foreseeable future.
Answer: The answer is yes !
In General Relativity, there's a not very well known theorem called the Campbell-Magaard theorem that states that any metric in 4D spacetime (including matter) could be represented (or embeded) as a metric in empty 5D spacetime (Ricci flat spacetime, wich implies pure geometry) :
https://en.wikipedia.org/wiki/Campbell%27s_theorem_(geometry)
https://arxiv.org/abs/gr-qc/0302015
There are several simple solutions to Einstein's equation in 5D vacuum ($R_{AB}^{(5)} = 0$) that represent matter in 4D ($R_{\mu \nu}^{(4)} \ne 0$).  This could be interpreted as matter made of pure geometry, in higher dimensions spacetimes.
Here's a very simple example.  Consider the following metric in 5D spacetime ($\theta$ is a cyclic coordinate in the fifth dimension) :
\begin{equation}\tag{1}
ds_{(5)}^2 = dt^2 - a^2(t) (dx^2 + dy^2 + dz^2) - b^2(t) \, d\theta^2.
\end{equation}
Substitute this metric into the 5D Einstein's equation without any matter :
\begin{equation}\tag{2}
R_{AB}^{(5)} = 0.
\end{equation}
Then you get as a non-trivial solution these two scale factors :
\begin{align}\tag{3}
a(t) &= \alpha \, t^{1/2}, & b(t) &= \beta \, t^{- 1/2}.
\end{align}
This is the same as pure radiation in an homogeneous 4D spacetime :
\begin{equation}\tag{4}
ds_{(4)}^2 = dt^2 - a^2(t) (dx^2 + dy^2 + dz^2).
\end{equation}
With
\begin{equation}\tag{5}
R_{\mu \nu}^{(4)} - \frac{1}{2} \, g_{\mu \nu}^{(4)} \, R^{(4)} = -\, \kappa \, T_{\mu \nu}^{(4)},
\end{equation}
and $T_{\mu \nu}^{(4)}$ describing a perfect fluid of incoherent radiation ($p_{rad} = \frac{1}{3} \, \rho_{rad}$):
\begin{equation}\tag{6}
T_{\mu \nu}^{(4)} = (\rho_{rad} + p_{rad}) \, u_{\mu}^{(4)} \, u_{\nu}^{(4)} - g_{\mu \nu}^{(4)} \, p_{rad}.
\end{equation}
This is the subject of the induced matter hypothesis, and is extremely fascinating!  For more on the Campbell-Magaard theorem and the induced-matter theory :
https://arxiv.org/abs/gr-qc/0507107
https://arxiv.org/abs/gr-qc/0305066
https://arxiv.org/abs/gr-qc/9907040
Comment: How are $\rho_{rad}$ and $p_{rad}$ related to the geometric parameters $a(t)$ and $b(t)$?
Comment: @lurscher : $\rho_{rad} \propto a(t)^{- 4}$, which is the standard relation between energy density of radiation and the scale factor, in FLRW cosmologies.
Comment: @Cham          Is this a special 4d case of the Nash embedding theorem?
Comment: @R.Rankin, I don't know the Nash embedding theorem.  Have you some references?
Comment: Appears, Nash embedding is a  case of whitney embedding. Here's a great stackexchange answer, but there are papers on them everywhere if your looking: https://math.stackexchange.com/questions/236285/is-the-nash-embedding-theorem-a-special-case-of-the-whitney-embedding-theorem


GfCI trips in bathroom

Question: Hi I have a bathroom gfci which is connected to the lights , fan and receptacles in bathroom , bedroom and landing . It's about a 45 year old house . Without protecting the circuits in the bedroom how do I wire the bathroom box as there are 3 switches and the gfi in one box . At present all black wires and white wires are pigtailed together but the gfi keeps tripping , is it too much on one circuit .
I think there are about 10 items , lights and receptacles total .
Comment: Have you tried replacing the GFCI, and have you tested the wiring for any shorts to ground? Is there a shared neutral, loads from a motor, or any smart switches that use a ground wire?
Comment: What have you changed (or are you currently changing)?  Is this a new problem, or has the GFCI never worked?  Are you installing a GFCI in this location for the first time?
Answer: GFCIs trip when the incoming "hot" current does not return on the neutral line. This situation could arise due to:

normal operation of an inductive device (like a motor, such as you would find in a fan or refrigerator). These devices shouldn't be on a GFCI.
A neutral / ground fault. This would be due to a defect in the wiring or an appliance.
An electric path to ground through something else, like a person. This is the primary purpose of a GFCI and the reason they're required in wet locations: to save your life!

An over-current condition should not cause the GFCI to trip. (Although it might trip the circuit breaker. Circuit breakers have entirely different purposes and detect a different category of problems.)
Note also that you can have a GFCI on a circuit without the entire circuit being protected by the GFCI outlet. Anything attached to the "load" side (e.g. downstream) of the GFCI outlet will be protected. Anything on the "line" side (e.g. upstream) will not affect the GFCI outlet.
To find out exactly where the problem is, it would be helpful to know if the GFCI outlet trips immediately after you reset it, when any device is turned on, or when a particular device is turned on.
Answer: Don't know if this reply is factual, but I have been informed by at least 2 sources, that starting load for refrigerators is quite high and that this quite often causes the GFI to trip on start-up.   This also would cause any other GFI on any other circuit to also trip when the fridge is plugged into it.  Also, I'm told that all GFI's are now made with a "fail point" after a period of time.  This is to insure correct operation of the GFI as it get older and "weaker".  Again, don 't know is that is true, but suggest replacing the GFI on the fridge circuit and see if it corrects the problem.  So far, it has on ours.-------------No electrician am I
Bald Mountain
Comment: A GFI **IS NOT** a circuit breaker, and does NOT trip under high current or short circuit conditions. A GFI trips due to a current imbalance between the normal current flowing on the hot and neutral.

GfCI trips in bathroom


What are the consequences of not following a gag order?

Question: Recently I have been hearing a lot about gag orders given by the United States, such as Lavabit, etc.  What are the actual repercussions for still talking out about the gagged subject?
Comment: Are you asking about court-imposed gag order,or the National Security gag order (e.g. Lavabit's)?
Answer: Gag orders are created by courts. Violating a judicial order is Contempt of Court.
The phrase gag order is slang, not a judicial term, so you can't easily find this definition on a court website. But here's some sources:

Revealing classified information or disobeying an order from the FISA Court would most likely fall under the espionage act, Opsahl said. They could be found in contempt of court and there would be a fine
The gag order applies to attorneys and their staffs, potential witnesses, law enforcement officers and court employees. Violators would be held in contempt of court.
saying that she should be cited for contempt of court for violating a gag order that was instituted last week
Comment: What about national security ones? Are they created by courts too?
Comment: Yes. The first link is an NSA case handled by the FISA court.
Comment: Within a company, I'd expect quite a few people to be informed about the gag order. I'd also expect that within a company people would be able to "conspire" to make a leak which can't be linked to a specific person. However, this doesn't seem to happen. Why? Oh, and what about a public statement (on the company website) that says "We didn't receive any gag orders." that is removed when it's no longer true.
Answer: Reading up the stories on Lavabit, the federal prosecutor has the court order demanding cooperation.  There is no difference between an NSA gag order and a court gag order. The government has the option to put anyone violating a gag order in jail immediately. This gets interesting for something like this, are they further placed in solitary confinement?
Comment: I disagree. Violating a court gag order is a contempt of court issue that would get you a few days in jail. Violating a security clearance or otherwise release classified NSA info can get you treason or even the death penalty. They fall under different statutes and have drastically different penalties.


Preventing a duplicate node from being created

Question: I'm building a site with a content type that includes a URI. Is there a module that would prevent a node of that content type being created if the URI it includes is already referenced in an existing node? i.e., so that the site can't have two nodes with the same URI field?
Answer: There is the Unique Field module that does this.
Answer: There might be a quicker solution for this. If not, you could use hook_validate() function. For e.g your_module_name_validate(). Inside that function, you could make a query to the database to make sure the the entered url does not match with the existing url in the database for that cck field.


How to splice new disposal power cord to old outlet wiring

Question: I just got a new disposal. It came with 2 foot 3 prong power cord. The old disposal was wired to an outlet I can't get to. The wires for the old disposal were spliced right under it. I figured I could just splice the new cord to the old one, but the old wires have black, white, and a ground whereas the new disposal has 1 green and no color for the other 2. I assume on the new cord, green is ground, but the other 2 don't have  any colored insulation. How do I know which wires from the disposal go to which wires that are connected to the switch? The 2 main  prongs are the same size and shape, does that mean hot/neutral are interchangable? Herebare the pictures:
Comment: The green wire is ground. Model # of disposal? Did the disposal come with a plug and you chopped it off? Hindsight 20/20 (of course), you could have installed a box + receptacle to the cable coming from the switch and then be able to just plug in the disposal.
Comment: Easiest way is if you still have the plug then use a multimeter to see which wire goes to the neutral pin https://www.familyhandyman.com/electrical/electrical-repair/wiring-a-plug-replacing-a-plug-and-rewiring-electronics/view-all/
Comment: Waste king L-3200. Idigire green is ground, but what about the other 2? yep, it came with a plug I chopped off. Yep, should have taken your approach @manassehkatz
Comment: I have learned over the years to never chop off power cord ends unless I am **really** sure. That has served me well - e.g., I contemplated doing that a year or two ago with a light fixture and glad I didn't because if I had then I wouldn't have been able to return it when it failed under warranty.
Comment: I take it you plan to make these splices in a box with a strain relief for the cord, no?
Answer: The neutral wire is usually the one with the writing or ribs. This is common and required for ul listing. Connect the wire with writing to your white the other to the black and ground to ground and you will have connected the way it was to the old disposal.
Comment: I hate spell check yes I did type UL
Comment: I'd reinforce your note on using the BOX and grommet in your answer, but this is it :)
Comment: "up listing"? Maybe "UL listing"?
Answer: Grounded outlets are polarized, with the neutral slot being wider than the hot; this is to maintain polarization for many two-prong plugs which have their neutral blades wider than their hot. For example, a cord for a non-grounded lamp with an Edison base bulb will be polarized so that the body of the lightbulb socket will be neutral and the central pin will be hot.
Since the chopped-off plug has a ground pin, its hot and neutral blades may not be different size, but you can figure out which is which by referring to the ground pin. Going clockwise around the outlet, the pins will be Ground, Neutral, then Hot; obviously the plug will be reversed.
The two outside (non-ground) wires of the cable are marked to show which is which; generally the neutral wire will have ridges on it (as the top wire in your lower picture does), but in any case you'll be able to match the wires from the (now severed) plug with the wires from the disposal.
Maybe the disposal won't care if you get hot and neutral swapped, or maybe it will, but you'll never know unless it causes some problem, and the problem could be nasty (e.g. the sink becoming live, although the ground should prevent that). So, you should do your best to get the polarity right.
Comment: Might want to add a GFCI recommendation here.
Comment: The 2 main prongs are the same size and shape, does that mean hot/neutral are interchangable?
Comment: The neutral is stamped, ridged or has a stripe not the hot.
Comment: Well, that's two more times my memory has failed me. Fixed both: thanks.


Does anybody know how to solve this Earth-Venus-Sun problem?

Question: How can I find (in terms of the angle) the moment when in the system Sun-Earth-Venus, Venus can be seen the most bright if its brightness (flow received in Earth) is proportional to the size projected in its illuminated side? ¿What percentage of Venus's surface can be seen illuminated from Earth at that moment? We have to assume circular orbits for the Earth and Venus around the Sun and the distances between those planets and the Sun are known (1 UA and 0,723 AU)
Comment: Just realized you asked for illuminated percentage, that can be computed from the phase angle as $ k = \frac{1+\cos i}{2} $, where $ i $ is the phase angle.
Comment: The brightness of Venus situation is really interesting! Because it is only a slim crescent when closest and full disk when furthest, these tend to cancel and the overall brightness is fairly constant. See for example answers to [Venus' magnitude during inferior conjunction](https://astronomy.stackexchange.com/q/33797/7982) and [Can you see the difference with the naked eye whether Venus is at the other side of the Sun or at the Earths' side?](https://astronomy.stackexchange.com/q/36232/7982)
Comment: JPL Horizons can compute this in actual terms rather than hypothetical.  Select "Phase angle" and "Visual Mag" from the Observer Table Settings.  It only computes data for a given instant, so you'll want have it compute it at daily intervals for a year.
https://ssd.jpl.nasa.gov/horizons
Answer: Setting up the problem
Here is a little picture of our geometry (nothing to scale):

Here, $i$ is the phase angle, $v$ is the distance from the Sun to Venus, $e$ is the distance from the Sun to Earth and $d$ is the distance from Venus to Earth. Please pretend the line segments originate from the center of each body.
The brightness $b$ of Venus will be proportional to $p$ the percentage illuminated, given by Greg Miller in the notes as $p=\frac{1}{2}(1+\cos i)$.  It will be inversely proportional to the square of the distance $d$ between Venus and Earth.  We can express this as:
$$b \propto \frac{p}{d^2}$$
We just need to define $d$ as a function of $i$ and then we can find where $b$ is maximized.
Finding the distance as a function of Phase Angle
From the law of cosines, we have $$e^2=d^2+v^2-2dv\cos i$$  We can write this as a quadratic polynomial in $d$: $$d^2-(2v\cos i)d-(e^2-v^2)=0$$  We can solve for $d$ using the quadratic formula to get two solutions:
$$d=\frac{2v\cos i \pm \sqrt{(2v\cos i)^2+4(e^2-v^2)}}{2}$$
We will get negative distance if we subtract the radical, so we can consider only the positive cases with a single solution of $d$ in terms of $i$ as:
$$d=\frac{2v\cos i + \sqrt{(2v\cos i)^2+4(e^2-v^2)}}{2}$$
Defining brightness as a function of phase angle
Plugging $d$ and $p$ back in to $b$ and simplifying, we get
$$b \propto \frac{p}{d^2} = \frac{2(1+\cos i)}{(2v\cos i + \sqrt{(2v\cos i)^2+4(e^2-v^2)})^2}$$
This now looks like a classic calculus problem, where we can take the derivative of $b$ with respect to $i$, set the result equal to zero and solve to find a value for $i$ which maximizes $b$.  But why do calculus when you have a computer?
What phase angle yields maximum brightness?
Here is a graph of the (proportional) value of b through all phase angles in one degree increments:

Zero degrees is fully illuminated Venus at maximum distance from Earth.  180 degrees is fully shadowed Venus at minimum distance.  The maximum brightness is at 119 degrees phase angle $i$.  That is at about 26% illumination.
Note:

We make the additional assumption that the Earth and Venus orbits are coplanar.
I never make misnakes, but please feel free to check my work.
Comment: "I never make _misnakes_, but please feel free to check my work." talk about irony ;D


What is the full formula for calculating a FICO 9 credit score?

Question: I'm familiar with the percentage breakdown of how a credit score is calculated.  I'm wondering what is the exact formula is that can be used to come up with a point value based on specific input parameters? I am wondering specifically about the latest method of FICO 9.
Comment: FICO scoring formula held by Fair Isaac is proprietary and they do not share the methodology with anyone other than their select top tier partners and those who pay for the $35k (at last check) price tag for the training. It makes sense because they don't want people gaming the system. But there are a slew of fairly accurate anecdotal evidence that can help you get there, a simple search can lead you to them. Hint: start at myFICO.com forums.
Answer: The FICO score is an invention of one company, FICO (formerly called Fair Isaac).  The exact formula is a trade secret that the company does not reveal.  This allows them to maintain a monopoly on FICO scores.  The only way to know what your real FICO score is is to ask that single company what it is.  They will not tell you, or anyone else, how to calculate it yourself, beyond the rough percentage guidelines you mentioned.


How can I get a Mandarin teacher while living in a small town without Chinese schools/institutions?

Question: I've been learning Chinese for 2 months and I'm finding it too hard to learn by myself. So as I asked in the title, I'd like to get a tutor so that I can learn basic grammar and practice conversations. I hope someone can give advice! Thank you in advance.
Comment: 有钱能使鬼推磨 .......
Comment: R u native English speaker, if so, you can do language exchange program?
Comment: Language exchange is a good idea, bro.

But where exactly do you live, China or other countries?
Answer: There are a few options:

Finding an online tandem partner who speaks Chinese and is interested in learning a language that you can teach (your native language or another language in which you have a near-native proficiency). Mosalingua lists a few sites where you can find a tandem partner; there are several other ones, e.g. Polyglot club. See also How I found Chinese speaking friends online on ChineseForums.com.
Finding a paid tutor or teacher. The classifieds section on ChineseForums.com might be helpful here. Some of the sites that help you connect with tandem partners can also help you find paid tutors or teachers. The actual teaching may work through Skype lessons or through video conferencing functionality built into the site.
Comment: Good!I always hope that duolingo has a Chinese teaching section so I can learn a language like playing a game.None of other apps can help me like a real teacher, so I still decided to find a tutor online.Thanks for your advice!
Answer: I know a online website offer some Chinese courses: Chinlingo. I don't know what kind of method they use, but I believe they have some free courses and one-to-one courses.
And if you need tandem-partner and you are a English native speaker, maybe we can help each other, I am learning English and perparing TOEFL :)
Answer: One thing that really helped me was Middlebury online. It costs a bit, but if you are working through a school or university, they'll typically cover the cost. If not, it doesn't cost too much. That really helped me because you can speak with a tutor online and set up lessons.


Making 100 starting with two 1s

Question: You have an empty blackboard. At each step, you can either write two ones on the blackboard,
or erase two copies of a number n and replace them with n−1 and n+1.
What is the fewest number of steps it takes to write 100 on the board?
Comment: I assume that the [lateral-thinking] answer of having a 1, 0, and 0 side-by-side doesn't count? :)
Comment: @bobble, nice idea, but right, this does not count!
Answer: I think the answer is

 $164275$.

The closed formula solution is

 $a_n = \frac 1 {12}(2n^3 - 3n^2 + 13n - 3) + \frac14(-1)^{\lfloor \frac n 2\rfloor}$.

 It can be shown that the following "greedy" algorithm is always the best: always take the largest two identical numbers and transform them. If there are no identical numbers $\geq $1, then add two $1$'s.

 Then it is just a matter of counting the number of steps in this algorithm.
Comment: I bruteforced the first several terms and then found a linear recurrence relation. Proving it should not be much trouble.
Comment: Your formula looks good. How did you find it?
Answer: Taking the algorithm of @WhatsUp for granted, counting more constructively:

 We can reorder our steps to take all the steps that write two ones before any other steps (or, equivalently, suppose we have an inexhaustible supply of ones). Then consider what happens at each subsequent step to our set of numbers ignoring zeros and ones.

 If we just have a consecutive sequence from $2$ to $k$, then in $k$ steps, we will produce $k + 1$ leaving behind one copy of each of $2$ to $k - 1$, but no copy of $k$. But then $k - 1$ steps will change this new initial sequence into $k$ leaving behind $2$ to $k - 2$. This will repeat until all the holes are filled, taking $T_k = 1 + \dots + k$ steps. ($T_k$ is the $k$-th triangular number.) Note, it also takes just $1 = T_1$ step to get from the empty set to just $2$.

 Thus, to get from the empty set to the consecutive sequence from $2$ to $k$ takes $Te_{k-1} = T_1 + \dots + T_{k-1}$ steps. ($Te_k$ is the $k$-th tetrahedral number.)

 The number of one pairs we have to write on the board to get the sequence from $2$ to $k$ is easy to count, as the other operation preserves the sum of all the numbers (and we produce no negative numbers). So the number of pairs of ones is $\lceil \frac{1}{2}(2 + \dots + k) \rceil = \lceil\frac{1}{2}(T_k - 1)\rceil = \lfloor \frac{1}{2} T_k \rfloor$.

 So, to count the total number of steps to get to the first $k$, we count the number of steps to get from the empty set to all the numbers from $2$ to $k - 1$ plus the number of one pairs needed to produce this plus one more one pair plus the number of steps needed to then produce the $k$. So, our formula is $Te_{k-2} + \lfloor \frac{1}{2} T_{k-1} \rfloor + k = {k \choose 3} + \lfloor \frac{1}{2}{k \choose 2}\rfloor + {k \choose 1}$.

Making 100 starting with two 1s


Regex last part of string not consistent pattern or length

Question: I'm trying to write a regex style condition to only extract the last part of a long string. I'm having trouble getting it to work as the string format is not consistent. I've included an example below:
2:0000:PlaceOne|2:30000:PlaceTwo|187768:20003:PlaceThree|187904:20011:PlaceFour|2614991:20033:PlaceFive|1166533:60006:PlaceSix

In this example what I need the output to be is PlaceSix. In other examples it could be PlaceFive, PlaceSeven etc so the length is not always the same for the entire string or for what I'm extracting. The only consistent pattern is it will always be at the end of the string and comes after the last colon (all characters after that colon). I'm sure this must be possible with regex but so far regrettably have been unable to get this to work.
Also expanding on this logic I have a related question, if it is possible to do this via regex, can I also use the same logic to extract another part of the string if needed? So for instance for the same example above, if I wanted to extract PlaceTwo instead is that possible? Problem is there is no consistent pattern I can think of, not even being at the end of the string like with the previous PlaceSix example. It does come after a colon but as you can see there are multiple colons within the string. The numbers will also seem random corresponding to the places. Was thinking maybe something along the lines of after x number of colons extract text inbetween: and | although I'm not even sure if that's actually possible.
Main question is the first question though, if that's possible I'll consider this question answered. The second part is more of a bonus question if the first one is possible, being so similar didn't think it was worth posting two separate questions.
Hopefully I've explained this correctly, please let me know if any further clarifications are required. Many thanks.
Answer: How's this
:([^:]*)$

You can test it here
And to answer your other question, i would say that as long as you know what it is you are looking for, there should be a way to find it.
To give an example, if i want to get the content after the fourth : every single time, its as simple as:
^(?:[^:]*:){4}([^:]*)

And to change the position, all you have to do is change the 4 to whatever you want
Test it here
Answer: drop table t;
create table t (str varchar(1000));
insert into t (str) values ('2:0000:PlaceOne|2:30000:PlaceTwo|187768:20003:PlaceThree|187904:20011:PlaceFour|2614991:20033:PlaceFive|1166533:60006:PlaceSix
');

select  split_part(split_part(str,'|',1),':',3) as c1
       ,split_part(split_part(str,'|',2),':',3) as c2
       ,split_part(split_part(str,'|',3),':',3) as c3
       ,split_part(split_part(str,'|',4),':',3) as c4
       ,split_part(split_part(str,'|',5),':',3) as c5
       ,split_part(split_part(str,'|',6),':',3) as c6

from    t
;

+----------+----------+------------+-----------+-----------+----------+
| c1       | c2       | c3         | c4        | c5        | c6       |
+----------+----------+------------+-----------+-----------+----------+
| PlaceOne | PlaceTwo | PlaceThree | PlaceFour | PlaceFive | PlaceSix |
+----------+----------+------------+-----------+-----------+----------+

select  arr[1*3] as c1
       ,arr[2*3] as c2
       ,arr[3*3] as c3
       ,arr[4*3] as c4
       ,arr[5*3] as c5
       ,arr[6*3] as c6

from   (select  regexp_split_to_array(str,'[|:]') as arr
        from    t
        ) t

+----------+----------+------------+-----------+-----------+----------+
| c1       | c2       | c3         | c4        | c5        | c6       |
+----------+----------+------------+-----------+-----------+----------+
| PlaceOne | PlaceTwo | PlaceThree | PlaceFour | PlaceFive | PlaceSix |
+----------+----------+------------+-----------+-----------+----------+

select  arr[1+1] as c1
       ,arr[2+1] as c2
       ,arr[3+1] as c3
       ,arr[4+1] as c4
       ,arr[5+1] as c5
       ,arr[6+1] as c6

from   (select  regexp_split_to_array('|'||str,'\|([^:]+:){2}') as arr
        from    t
        ) t

+----------+----------+------------+-----------+-----------+----------+
| c1       | c2       | c3         | c4        | c5        | c6       |
+----------+----------+------------+-----------+-----------+----------+
| PlaceOne | PlaceTwo | PlaceThree | PlaceFour | PlaceFive | PlaceSix |
+----------+----------+------------+-----------+-----------+----------+

select  arr[1] as c1
       ,arr[2] as c2
       ,arr[3] as c3
       ,arr[4] as c4
       ,arr[5] as c5
       ,arr[6] as c6

from   (select  regexp_matches(str,'^.*?:([^:|]*)\|.*?:([^:|]*)\|.*?:([^:|]*)\|.*?:([^:|]*)\|.*?:([^:|]*)\|.*?:([^:|]*)$') as arr
        from    t
        ) t

+----------+----------+------------+-----------+-----------+----------+
| c1       | c2       | c3         | c4        | c5        | c6       |
+----------+----------+------------+-----------+-----------+----------+
| PlaceOne | PlaceTwo | PlaceThree | PlaceFour | PlaceFive | PlaceSix |
+----------+----------+------------+-----------+-----------+----------+

Comment: Thank you very much, interesting solution with arrays split, another great solution!
Comment: You're welcome. Still checking additional solutions. PostgreSQL... endless possibilities.
Comment: O.K., enough playing for 1 day :-)
Comment: Thanks again, great to see multiple solutions, will certainly use this logic for similar future regex needs. All the best.


Is it the right choice to lose the queen for two rooks?

Question: Is it the right choice to lose the queen for two rooks for this situation?
Comment: Yes, last move of Rook is indicated in pale yellow
Comment: Is it white's move?
Comment: It's not "lost", it's known as exchange.
Answer: If it is white to move, he should probably play c3, Qb2 and only then Rxb7, not even allowing black the choice to trade the queen for two rooks. I don't see how black can defend against this and the resulting position should be winning for white. Maybe a computer will tell you that immediately taking on b7 is even stronger, but for a human this entails a certain amount of risk, whereas c3,Qb2,Rxb7 keeps complete control.
If it is black to move, he should probably play Kb8 with idea of playing Ka7 and Rb8, defending against c3, Qb2, Rxb7. In that case Rxb7 might be whites best choice and it looks indeed like a strong continuation. Something like 2.Rxb7 Qxb7 3.Rxb7 Kxb7 4.Qb4 Ka7 5.c6 Rb8 6.Qc5+ Ka8 7.Qxc4 Ka7 8.Qc5+ Ka8 9.Qe7 Rc8 would also result in a position where white is in complete control and can push his extra pawns with c4, d5 and maybe intrude with the king h4, Kh2,Kg3,Kf4,Kg5,Kf6.
Not taking the rook after Rxb7 is not really a choice for black. In that case he would just be lost without any counterchances.
Answer: The answer is IN THIS position NO (if you're black) However it's a forced win anyways
http://en.lichess.org/jEK9MC3O#10
Here is the game's result against a lvl 6 stockfish (I played against it) which is just over 2000 rating. It's a won game due to the pawn structures. Keep in mind stockfish rating goes up and down depending on people's wins and loses so it might not be 2000 it may be more like 2100 or even lower like 1900.
Of course you can ignore the latter part of the game since the AI on the site doesn't resign :)
Also, for the most part trading 2 rooks for a Queen is considered as material loss instead of gain. Mathematically speaking, a Queen is worth 9 points, a rook is worth 5, meaning both rooks are worth a total of 10.
And you have a lot of proof for this, a very simple example is King + 2 rooks vs King + Queen... This is a draw, and I am talking about a fully empty board just these pieces on, it's a forced draw...
However just like in this position, sometimes the location of rooks and pawn structure of the game makes this sacrifice a game winner... Black can't really defend against anything white throws at him, unless white blunders heavily.
And as you can see from the game link you have the explanation of the advantage of each move played after the sacrifice.
Hope I helped.


Could I hire someone on Stack Overflow to do some projects for me?

Question: Occasionally I come across a good programmer that I could use to do some projects for me. I have lots of ideas and need help sometimes. I wondered if it's allowed to hire someone?
Comment: Somewhat related: *[A Terms of Service update restricting companies that scrape your profile information without your permission](https://meta.stackexchange.com/questions/277369/)* and *[Etiquette of screen-scraping Stack Overflow](https://meta.stackexchange.com/questions/443/)*
Answer: You should go with the Stack Overflow Careers-specific site to hire people:
http://careers.stackoverflow.com/
It is not a good idea to try to hire people within the questions and answers site by leaving comments. That's not what the comments are meant for. Though, if you find the person's email on the profile, well then you can contact them. The profile is public, so if someone leaves their email, it's okay to communicate with them.
Comment: As long as they aren't leaving off-topic comments about trying to hire a user, nobody will care. Heck, I got the job I'm about to start because someone came to my profile, looked up my email and asked me to fly in for an interview.
Comment: This answer is obsolete. Stack Overflow Jobs and Developer Story were shut down.
Comment: The relevant announcement on MSO: [Sunsetting Jobs & Developer Story](https://meta.stackoverflow.com/q/415293/1478931)
Answer: Assuming you have a legitimate project, and you're not filling answer comments with job solicitations, then
Go for it
I got hired in my current—dream—job after my current employer went to my profile, browsed to  my website, found my email address, and contacted me.
Comment: @Ken - don't care.  My job's awesome and high paying, and I got it from a user contacting me through my profile.  Everything else is just noise as far as I'm concerned.
Comment: The question asked nothing about asking through the profile, and neither did your answer. (And thus my comment.) If you meant "through their profile if an address is available", you should say that so that it's clear (as Hugo did). :-) Your answer sounds like "Sure. Contact them.", which leaves open asking in comments and other places, and that's what newcomers who find it will think you meant.
Comment: This answer is just wrong. Posting job ads here anywhere but Careers is outside the scope of the sites, and violates every faq I've ever seen here. SO, for instance, requires that they be specific programming questions about actual problems, and trying to find an employee (even if it's for a coding job) is not a programming problem any more than my asking for a list of good lunch spots because I'm starting a job at Google and programmer's gotta eat to keep up their strength for writing code.
Comment: @Ken - OP didn't specify how he wanted to contact people, and my answer was quite clear on how **I** was contacted; I hope I didn't imply that making comments for this purpose was ok.
Comment: Adam, that's the immediate impression I got (and the reason I posted the comment I did and the downvote), and I'm not new here. :-) If I misunderstood what you meant, I'd suspect someone new here could do so easily. I wouldn't have had any objection to it if it was clear how the contact should be made. (Note I said "Posting job ads" in my comment.)
Comment: @Ken - whoa - delphi :)  Ok, I've edited my answer to be a bit clearer.
Comment: And you're insinuating... what exactly? :-) Delphi does Win32/64, OS X, supports generics and closures, and will soon be supporting iOS and Android, all from the same language. But I've got a few badges in other tags, too, and I reed n rite purdy gud when I try rilly hard n consintrait. ;-)
Comment: @Ken - I'm no language snob (unless it's VB, naturally).  Delphi is just not a common language to see in these parts.  Sorta like seeing a gold badge in Ada :-)
Comment: Adam, no offense taken (you saw the smile, right)? I'm used to it somewhat. :-)
Comment: Oh none intended, @Ken :)
Comment: I got many enquiries from various people looking at my profile to, following to my webpage and finding my contact detail. Lots of interesting jobs ... and no boring ones.. hey what you know. SO is full of interesting people :) I see this as a small reward from SO for all the hard work I put in to help reach millions of people (stats from my profile, not making numebrs up)


Do I need to pay tax in the USA on my Australian superannuation?

Question: I've been living in the USA for six years and have never paid any tax on my superannuation back in Australia - I've always assumed it was a pension fund, and have never had a tax preparer ask me about it ever, but recently I was told that it's counted instead as a trust and I needed to pay taxes on the whole amount or the interest.  Does anyone know what the actual situation is with regard to the status of Australian superannuation being counted as foreign income on US taxes?
Answer: Two things you can be certain of, death and taxes, and you definitely want to protect yourself. When it comes to this subject, it is advisable to consult a tax attorney (I am not).
This article may point you in the right direction, written by a US law firm in Washington, DC, Castro & Co, which specializes in international tax law (again, no affiliation, the result of a Google search 'pay US taxes on Australia superannuation').

U.S. Tax Treatment of Australian Superannuation Funds
How Are Australian Superannuation Funds Treated in the U.S.?
Under domestic U.S. tax law, Australian Superannuation Funds can be treated as either a foreign grantor trust or an annuity depending on whether the assets within the fund are preserved or non-preserved. There may also be hybrid treatment where a portion of the Superannuation Fund is treated as an annuity and the other portion is treated as a foreign grantor trust. Generally, gains within a foreign grantor trust are taxable in the U.S., which can result in a tremendous tax burden, especially if an Australian national does a rollover from one Superannuation fund to another while a U.S. tax resident.
Under the U.S.-Australia Income Tax Treaty, however, there is an opportunity to lawfully avoid U.S. taxation on Australian Superannuation Funds. By taking this legal position, Australia would have exclusive taxing rights over Australian Superannuation Funds, which effectively allows Australian nationals residing in the U.S. to lawfully exclude any gains within or even future distributions from their Australian Superannuation Fund from their U.S. federal income tax returns.
This not only makes the U.S. a more attractive retirement jurisdiction for Australian nationals, it also allows Australian nationals to work in the United States without concern that their tax-preferred Superannuation Funds will be unfairly taxed by the United States. As explained above, however, you are required to fully explain the legal basis of any treaty-based position on IRS Form 8833. Without the legal explanation of the position in Section 6 of IRS Form 8833, you risk an IRS audit, civil tax penalties, and even criminal tax prosecution unless there is a legal basis for not filing the form.
Will My Funds Be Taxed?
In order to obtain the legal basis to take this position regarding US tax Australian superannuation, it is necessary to obtain a tax opinion from our firm. A tax opinion is a legal opinion issued by a U.S. tax firm that shields taxpayers from certain tax penalties and interest thereon. The tax opinion also guarantees that, in the event of an audit, our firm will represent you without additional charge and fully defend the position to shield you from any and all liability. The tax opinion perpetually exempts the Australian Superannuation Fund from U.S. taxation regardless of the amount of gains within, distributions from, and income attributable to the fund.
Moreover, if you've paid U.S. tax on your Australian Superannuation Fund in prior tax years, we can file amended tax returns to recover those taxes. Contact our firm today to obtain the tax opinion and shield your Australian Superannuation Fund from U.S. taxation.


Is Freelancing a Conflict of Interest

Question: I currently work as a Design Engineer at my company, and I have been debating some different "Side Hustles." One idea is to be a freelance designer for Fiverr, but I don't want to risk a Conflict of Interest at my job. Would it be fine as long as I don't accept jobs from competitors?
Comment: What your contract and company handbook say about this?
Comment: @JoeStrazzere - I have a feeling this is one of those cases where the OP was worried about getting a 'No' from the employer, and was looking to get an answer here without risking an explicit No from the company  ;-)
Comment: What do you mean by "would it be fine?" Are you worried about getting sacked, getting stressed, getting sued, damaging your career at your current company, or ruining your friendship with your current boss? (There's also the possibility that you'll have to lie to the people you freelance for, as they may not want someone who's working full time at another job.)
Comment: @JoeStrazzere - completely agreed, but some people like the mental comfort of "Oh, but this person / these people said it'd be okay.  It'll be fine."
Answer: Shortest Answer: It's Probably Not Okay
Slightly Longer Answer: This will depend on your employment agreement, your boss' attitude towards out-of-office programming, and your ability to do freelancing without burning out
Here's why it's probably not okay.  Most employers frown pretty hard on doing side-programming jobs.  Some don't like it because of conflict of interest issues - but most don't like it because it can burn out their employees.  Doing 40 hours of programming a week can be a drain sometimes... and then trying to add another 20 on top of it for a completely separate project?  It can easily burn someone out - which the company has a vested interest in not having happen.  Some write in clauses like this in the contract, some will heavily encourage you not to do it.
So, for it to be okay, here's all that has to happen:

Your employment contract has to not outright forbid it
Your boss has to be cool with it.  (Yeah, you can technically do this if your boss doesn't want you to - it's your time after all - but you pick those 'doing it despite the boss wanting me not to' battles very carefully)
You have to be capable, long-term, of working the extra job.  (Generally, if you're young enough to think you can do this, you might not be aware of how easy it is to burn out on programming...)
Comment: "Your employment contract has to not outright forbid it" depending on location, this sort of clause may be unenforceable.
Answer:
Is Freelancing a Conflict of Interest

If you have another job then yes it is. You are taking on clients and will have some kind of contract with them. This may only be a verbal contract, but still a contract.
What happens if you get behind on work or miss a deadline, or something really urgent crops up and the client wants you to action it immediately. Who gets priority?

I don't want to risk a Conflict of Interest at my job. Would it be fine as long as I don't accept jobs from competitors?

Check your contract and see what it says about IP and non-compete. Generally speaking, what you do in your own time is your business, so long as you don't break the contract, steel clients from your day job, or use their tools (such as laptops and software licenses)
I would expect the majority of people that go into freelance start while they're working a full time job in a similar area. The freelancers I've known all say they just never told their employer and kept it quiet.
You can ask your employer for permission, but I would only suggest doing that if your contract requires it, and you'll only know that for sure if you get some proper legal advice, which I suggest doing.
If your contract doesn't prevent it, then it's up to you to make a judgement call. I personally would not tell my employer, because there's a chance they will say no, even if the contract doesn't prevent it. This could cause them to update the contract so it does prevent you freelancing.
Comment: This answer accurately gets across 2 things: (1) it can easily create conflicts but (2) lots of people do it anyway.
Answer:
Would it be fine as long as I don't accept jobs from competitors?

You should check your contract to know if it is ok. Also check if you signed any NDA or non-compete agreement that could limit your options to do freelancing.
If not clear consider asking your manager/boss/hr (depending on the size/nature of your company) for clarification on that aspect.
Answer: First and foremost - check your contract and employee handbook.
Look for a non compete and external projects clauses.
if you are not going to be in breach of that, or if there are none there, it is completely at your discretion
Employer have no right to dictate what you do on your own time and resources.
Two things to watch for:

Employer time and resources are off limits for side projects - when at work you work

Burnout, with Covid thing, tensions are high as is already, adding more stress can be detrimental.

Some say, doing something else is already a vacation, perhaps your side projects can be fun and relaxation, kind of focus switch from your main job.
Answer: There is another aspect that you need to be aware of: Many employment contracts state that anything you create from the time you sign the contract to the day you end the contract (and sometimes even to a period of time after the contract) belongs to them. In short, a side hustle you do still belongs to the company. You can't sell it or give it away without their permission.
Anyone with that kind of clause in their employment contract has to get permission to do anything on the side including some activity totally outside of what their job is. For example, when I was employed as a software developer, I would have needed the company's permission to sell art work that I created on the side. Typically, when the side activity is totally outside of the company's interests, there is no problem. However, something like doing development on the side when hired as a developer will likely be denied permission.

Is Freelancing a Conflict of Interest


Downgrade Aura Component API version

Question: I am trying to downgrade aura component api version to 39.0 from visual studio code, and push it back to sandbox. I can see that it's been changed in visual studio, but hasn't changed in Salesforce environment when I am checking it from UI. I am also trying to delete some lines of code from client side controller, having same issue there as well, I can see deleted lines in developer console but not in visual studio.
Comment: I'm not sure if its because of the api that you're selecting, but if you go into the UI and open the component in the dev console, you can click on component bundle version and change the api version from there, but Salesforce limits you to only a few versions ago, and 39 is not available for me. This may be why it is not pushing to Salesforce from the IDE (maybe it's being blocked because the version that you have selected is too old for SFDC to allow).
Answer: You can run the below SOQL in Developer Console and update "ApiVersion" directly from there.
<code>SELECT Id, DeveloperName, ApiVersion, Description FROM AuraDefinitionBundle WHERE DeveloperName = "<Component name>"
</code>

Downgrade Aura Component API version


How can I generate legal random chess setups?

Question: Is there a free online website that attempts to generate "legal" random chess setups X amount of moves into the game?
Comment: I'm curious why you would find such a tool useful
Comment: @altvali: No reason.
Comment: How random do you want them ? Equiprobable ? Do you need a series of moves to lead to that position ? If that's random, what sense does "X moves into the game" exactly make ? **In what format do you want the result ?** (FEN, diagram, series of moves…)
Answer: I stumbled upon Chess Hero.  It looks very nice, but it is not online.  Per the website:

You supply a set of PGN files
The program picks random positions from the PGN files and challenges you to guess the best move computed by a chess engine
On every attempt you are given a penalty (the difference in score between your move and the engine best)

The software can be found here.
Comment: +1 @xaisoft: Interesting, wonder why someone would build a system that's not online. Anyway, as you might guess, this is not really the problem I'm attempting to solve, that being a point-based guess the next move based on archival PGN files; though weighting the random selection of a move on a scale of best to worst was a more advance feature I'd hoped for in the "random opening" game; meaning that you would handicap one-sides opening in a semi-random, yet statistically weighted way.
Answer: Find an online database of games.  Choose a random game and a random move in that game.  Voila, an instant realistic and legal position.
Comment: If that's all you need, then what you're talking about would be pretty easy to write.  Given that what we're talking about seems useless, I doubt it exists on the web anywhere.
Comment: @blunders no, I'm saying that if you want realistic positions, pulling them from real games would be easy. If you want random positions, generating them randomly would be easy.
Comment: It's not the same thing, meaning while it's possible the select of the game, and the point within it might be selected randomly -- the openings would not be random. That said, I realize now that the use of "natural" in the body of the question was confusing, so I've replaced it with legal. Also, might note that currently the answer posted by me covers roughly, if not exactly the method of board generation I'm talking about. Thanks of the suggestion, and I agree that if attempt to select a randomly select a "natural" game it'd be the way to go.
Comment: So, you're saying that using stats from [chess opening explorer](http://www.chessgames.com/perl/explorer) would be more useful (which is likely true), but I'm saying my way would be more fun, and lead to more creative games.
Answer: I've actually programmed precisely that in PHP to test a hypothesis two days ago.
If you're interested, I've uploaded the code to github for you: https://github.com/dennisvink/php-random-chess-move-generator
Answer: I was unable to find an online tool to do this, but in terms of how, the following appears to be the logic that would be used:

Both white and black pieces would be in the correct starting positions;
White would start;
Turns following white's start would be exchanged between white and black;
Any piece able to move during a turn would be a member of the list of pieces to be randomly selected to move;
Once a piece was selected, all squares for that piece that are legal moves would be added to the list of possible moves, and a move would be selected randomly from that list;
Attacks would not take place unless the attack was randomly selected as a move. If an attack does take place, then the attacked pieced would be removed from the board.
Iterations of randomly selected moves would stop once the number of moves into the game set before generating the board had been reached.
Comment: I was searching for this as well and was unable to find something that was automatic.
Comment: @xaisoft: Clearly me either, though I haven't seen a name for this chess variant either, which would likely help. As you likely know, [Fischerandom chess is related, here's a tool that generates setups](http://www.chessgames.com/perl/fischerandom).
Answer: Besides the two ways already mentioned:

Pick a random position from a database.
Play a random amount of random moves.

We should also mention the most simple:

Generate a totally random position. Validate it. If not legal repeat.

You should be able to find lots of tools for analyzing if a position is legal. (E.g. exactly one king on each side etc.)
Answer: How about using live games from lichess? Here is an example call to the server. See the docs for pulling a list of users currently playing.
Answer: I think Lichess training do just that. It's software take a game position from it's database and challenge you to pick the best one based on Stockfish analysis.


What is the process for reimplementing a back up WordPress?

Question: WordPress noob here. I'm helping a friend migrate her WordPress themes and change servers. I've already moved the WP across servers, but now I'm working on changing the theme on my localhost dev site through a child theme. After I'm done rebuilding the child theme, can I just make a backup of that database, activate the theme in the actual new WordPress and reimplement the backup? Is there anything else I should be aware of?
Answer: As long as there have been no changes to the live since since you took the backup of it to work on in your dev environment, then yes you can replace the existing database with yours.
You do not need to activate the new theme on the live server - the currently active theme is stored in the database, which you will be overwriting with your database backup from dev.
You will need to make sure the database name, database username and database user password are changed if you were not using strong/safe passwords/names in dev.
You should install any plugins on live that you might have added to the site in dev before replacing the database.
You will also need to place the theme & child theme files on live before replacing the live database.
While working in your dev environment are you using a hosts file to get your urls to resolve correctly?  If not and you did a find & replace in the dev db to be able to effectively use urls like http://localhost/category/this-is-the-url-of-my-post then you will need to reverse this and do a find & replace on the dev db for http://localhost and replace it with the live url.