Why do VR motors like sinusoidal current?

Question: I have a question regarding powering electrical motors, variable reluctance motors to be more precise (ie. Stepper motors). This kind of motor, in a perfect situation would like to be powered with current thats shape is a sin wave and a cosine wave (for stepper). Even when doing microstepping, one should try to follow the shape of sin and cos to have the smoothest rotor rotation. Also if VRM was used as generator, it would  generate sinusoidal current. This all seems logical, looking at the circle construction of the machine. I believe if one was to unroll the vr motor and make it drive in a plane motion way, it wouldnt have to be powered with sin/cos and also wouldnt generate current in that shape. My question is- would someone please explain me in a more "fact and proof" way why does the current shape has to be sinusoidal for a vr motor? Also, please correct me if anything i wrote was not true. I would apreciate all help!
Comment: To be short: when you sum the magnetic fields created from 3 phases you get a constant rotating field that it's amplitude is 1.5x of phase amplitede.
Answer: Because a sinusoidal current will make the torque applied to the motor constant, whetever the position of the shaft.
Let's say we have winding A and B, and supply current I. If you apply a square current to both windings, you'll have:

a phase where a current I is applied to winding A, and no current in winding B
a phase where a current I is applied for both A and B, resulting in more power being applied to the motor then in the previous phase
a phase where a current I is applied to winding B, and no current to winding A

So you see, the power given to the motor varies (sometimes I, sometimes 2*I), depending on the position of the shaft, so it will not run smoothly.
To solve this, you have to apply sinusoidal currents. Then, even when both winding are powered, the torque is kept constant.
Why a sine and not a triangle wave ?
Think of what you need to provide when the shaft is at 45° (both windings powered): the power provided to the motor is twice V*I (once for each winding). V and I are linked by Ohm's law (if we assume steady state and rule out inductance). So the power is twice RI². Whereas when the shaft is at 0°, the power is only once RI². Now, how to make this constant ? By setting the I at 45° to sqrt(0.5)*I at 0°. Indeed : 2*R*(sqrt(0.5)I)² = RI². Now, what is sqrt(0.5) ? It is cos(45°). So you can start visualising the sine wave. Basically, what is required is that I² in winding A + I² in winding B is constant. That is the definition of sin and cos.
And yes, basically, it comes from the fact that the motor turns in circle.
Comment: I understand the concept of commutation, but the question is why does it have to be sine? I can apply triangle the same way as sine and cosine but the motor movement wont be const. I believe it has to be sine because of the circle construction of the motor. I just dont know how to describe it.
Comment: @ŁukaszPrzeniosło I edited the answer to explain this
Comment: Thank you for edit. At the moment I am driving a stepper motor in the exact way you have described: sin(I^2) + cos(I^2) = 1. Using this equasion current will always be "constant". But one also has to distiguish magnetic field angle and physical angle, which also is a bit confusing for me. What we talk about here is in regard of magnetic angles and physically motor make only 4 steps in a full sine wave coarse. Could you reffer to that?
Comment: I'm sorry, I don't really understand what you asked here. What is true is that the 45° / 0° angle is not actually real. Because there are much more than just two windings in the motor (a stepper does not do a full rotation in 4 coarse steps, it usually has much more steps), it is just a simplified view. But the principle is the same, you just have to divide the angle by the actual number of A/B windings. Is that what you asked ?
Comment: I understand this as well. By saying that full sine wave is needed to do 4 steps, I means 4 out of 200 total steps of the motor. Sorry, I forgot to add that. In this case to make a full physical rotation of the rotor, one has to provide 50 full sine waves (if the motor has 200 steps in total). So full sine wave gives 360 degrees of magnetic rotation, but only 7.2 degrees of physical rotation. Even though the physical rotation is very little, current is still aplied as full sine wave- Full magnetic rotation for only little physical rotation, how to explain this?
Comment: Maybe https://www.youtube.com/watch?v=Qc8zcst2blU ? It does not change the fact that, whatever the type of stepper motor, whatever the number of steps, the ideal driving scheme is sine and cosine when there are two windings, or 3*sine, each with a 60° phase difference when there are three windings. So that the sum of the squares of all currents is always constant.
Comment: I will check the video. Thank you for your answer and followups.
Comment: @dim Your first statement, that the torque is constant if the current is sinusoidal, can you give the calculation that brings you to that conclusion? Also, does it allow for pole tip or even general saturation?


How was the endurance test in the Cessna 172 legal?

Question: The flight in the Cessna 172 lasted around 64 days with two pilots switching to fly the plane. To my knowledge both FAA and EASA have rest periods which pilots have to follow. Also the refueling was done by a truck matching the speed and handing over a hose to refuel. How was this flight legal regarding rest periods and refueling maneuver?
Comment: Plus this was done way before those types of rules existed.
Comment: A private Part 91 flight like this has different rest requirements for the pilots than do airline pilots.
Answer: Regarding flight time, duty periods, or rest requirements, no current regulations would have specifically imposed limitations on this flight. This flight would have been operated as a private flight under 14 CFR 91 under today's regulations.
The flight, duty, and rest requirements are specified only for certain commercial operations including airline, charter, and fractional. Flight instruction is also generally limited to 8 hrs in a 24 hr period. Paid pilots routinely fly 12-14+ hours in a day, including in certain patrol activities and in flying private jets.
Refueling is not generally restricted by FAA aiation regulations in a way that would specifically impact this operation. As with the flight time concern, the catch all "careless and reckless" regulation might apply first.
For some of the same reasons that the crew flight time was not restricted, many of the maintenance requirements such as 100 hr inspections, would not be required of a private flight. However, the 100 hr seat rail inspection AD would be problematic today.
Answer: The flight you're referring to occurred in 1959.
The Federal Aviation Agency, a precursor to the Federal Aviation Administration, had just been newly established in 1958, and hadn't drafted the rules you're referring to yet.
Comment: O tempora, o mores.
Answer: As noted in the comments Crew Rest Periods are only applicable to commercial flights operating under part 121, 135 and 91K as per the FAA's regulation, specifically 14 CFR § 121.471. But it does not apply for flights strictly operating under part 91 which they likely were.
You can make a case that they could have potentially been in violation of

14 CFR § 91.13 - Careless or reckless operation.
(a) Aircraft
  operations for the purpose of air navigation. No person may operate an
  aircraft in a careless or reckless manner so as to endanger the life
  or property of another.

but that is the FAA's catch all and somewhat broadly applicable when they see fit. There have been various endurance records set over the years (all legally) and in all cases precautions were taken to ensure that the flight was safe. Generally this involves two pilots taking shifts however the recent Solar Impulse flight set the solo record.
As for the refueling, there is no regulation that an aircraft must be on the ground, or stopped in order to re-fuel, the military refuels mid air quite often.
Comment: This is inaccurate. Crew rest periods also apply to §135 and §91K operations.
Comment: "Endanger the life or property **of another**" does not really apply, I think. :)
Comment: @JWalters updated to reflect


How to give access to records of lookup users?

Question: In an Account Object a field called 'Sales Person' and it has lookup relation with the user object. If the user is selected as the salesperson for a record, that user able to see those records, but OWD is private, record owner and admin will not share any records.
Comment: Is there a reason why you're not leveraging record ownership for this use case?
Answer: This appears to me to be a textbook use case for Apex-Managed Manual Sharing.
You'd use a trigger on the Account object to programmatically insert and maintain AccountShare records. The trigger would need to react to changes in the lookup field, as well as to changes of ownership (since Manual sharing records don't survive ownership changes). It'd remove any shares to the previously-assigned Sales Person and create and insert new shares for the new value.
True Apex-Managed Sharing is not available on standard objects.


Why are both C and CP violation necessary for baryogenesis?

Question: Sakharov condition states both C and CP violation is necessary for baryogenesis. Now consider, for example, a theory with B-number violating interaction and C-violation. Therefore, if $p\to e^+\gamma$ is an allowed B-violating process, C-violation would imply that the C-conjugated process $\bar{p}\to e^-\gamma$ would occur at a different rate. Shouldn't therefore, C-violation be sufficient for baryogenesis? Why do we also need CP-violation?
Answer: Assume You have only $C$-violation. Then it implies that the rate $\Gamma$ of hypothetical process $p^{-} \to e^{-}\gamma$ won't be equal to the rate of hypothetical process $p^{+} \to e^{+}\gamma$, but only for the given helicities $L/R$. Say,
$$
\tag 1 \Gamma\big(p_{L}^{+} \to e^{+}_{R}\gamma_{L}\big) \neq \Gamma(p_{L}^{-} \to e^{-}_{R}\gamma_{L}),
$$
and
$$
\tag 2 \Gamma\big(p_{R}^{+} \to e^{+}_{L}\gamma_{R}\big) \neq \Gamma(p_{R}^{-} \to e^{-}_{L}\gamma_{R})
$$
(note that the "photon" $\gamma$ has helicities $\pm 1$ while the "electron" $e$ and the "proton" $p$ have helicites $\pm \frac{1}{2}$). (Added) This is because the $C$-transformation changes the particle on corresponding antiparticle without changing the helicity.
But let's assume that such processes respect $CP$-symmetry, (added) under which the left/right particle is changed on right/left antipatrticle. Then there must be
$$
\tag 3 \Gamma (p^{-}_{L} \to e^{-}_{R}\gamma_{L}) = \Gamma (p^{+}_{R} \to e_{L}^{+}\gamma_{R})
$$
Let's add separately the left and the right hand-sides of $(1)$ and $(2)$ and use $(3)$. We obtain
$$
\Gamma\big(p_{R}^{+} \to e^{+}_{L}\gamma_{R}\big) + \Gamma\big(p_{L}^{+} \to e^{+}_{R}\gamma_{L}\big) = \Gamma(p_{L}^{-} \to e^{-}_{R}\gamma_{L})+ \Gamma(p_{R}^{-} \to e^{-}_{L}\gamma_{R}),
$$
and no total baryon-asymmetry will be generated.
Therefore we require the CP-asymmetry.
Comment: @SRS : typically at baryogenesis era particles are massless, so there is no problem with calling the helicity left or right.
Comment: -For massive particles L,R refer to chiralities, not helicities.
Comment: How did you get eqn. 1 and eqn. 2 for C-violation? I mean why can I not directly claim that they $\Gamma(p\to e^+\gamma)\neq\Gamma(\bar p\to e^-\gamma)$?
Comment: @srs : as for Your second question, note that charge conjugation converts a particle in the corresponding antiparticle with the **same chirality** (helicity). Therefore, if only C-symmetry is violated then You can talk only about the violation of equalities $$ \Gamma(p^{+}_{L/R}\to e^{+}_{R/L}+\gamma_{L/R}) = \Gamma (p^{-}_{L/R}\to e^{-}_{R/L}+\gamma_{L/R})$$ separately for each given helicity.


Calculate Field in Model Builder does not show join table fields

Question: Using Pro 3.03.  I am using Add Join in Model Builder to join a table to a feature class.  The resulting layer is the input to a Calculate Field tool.  Essentially, I'm trying to calculate a field in the input layer based on a field in the joined table.
In the Calculate Field tool, I'm used to seeing the join table fields (such as JoinTable.FieldName).  Not so now.
I have played around with both Make Feature Layer and Make Table View results feeding into Add Join and even into Calculate Field.  But I still can no longer access the join table fields.  I realize the tool hasn't technically run but I am sure this was possible previously.
Comment: If you right-click the "Add Join" tool (in the model), and then "Run" just that part of the model, does that enable the "Calculate Field" tool to display the fields that you expect?  (Ie, don't attempt to run the entire model, but only run the "Add Join" tool within the model.)
Comment: @SonofaBeach Nope   Expression builder in Calculate Field only shows fields from the target table, not the input table, even after a Run command in Model Builder
Comment: I have the exact same issue. Anyone found an answer? Frustrating. It works in a webmap, but not in model builder.
Comment: I believe this to be a bug introduced into modelbuilder, I similar issues with the merge and append tool. I have logged it with ESRI and hopefully they will sort it out on the next release.
Answer: I have the same issue using ArcGIS Pro 3.1.0. In the ModelBuilder, I tried all sort of combination (Add Join -> Calculate Field or Make Feature Layer -> Add Join -> Calculate Field) and joined field names do not appear in the Calculate Field geoprocessing tool (in ModelBuilder). However, I opened the layer in the Map Content and right-click the field to calculate and selected all field names to write my calculation. Instead of running the calculate field in the Map, I simply copy & paste the calculation into the Calculate Field in the ModelBuilder. Magic! ModelBuilder did recognize the joined fields and the calculation went well. It may help for the time being as a workaournd.


Capturing the difference between "I go nowhere." vs "I don't go anywhere" in Spanish

Question: "I am going nowhere" and "I don't go anywhere" both translate to "No voy a ningún lugar" as they basically mean the same thing.  But there is is a change in emphasis between the two (reference: https://english.stackexchange.com/questions/147931/i-am-going-nowhere-or-i-am-not-going-anywhere).  Is there a way to capture that difference in a Spanish translation?  Maybe by putting emphasis on a particular word, and if so which word(s)?
Comment: Could you include the emphasis in your explanation? So there is no need to dig into another page to get the difference you want to make. Some examples would help
Comment: Thats a good point but I don't really know how to express it.  I am considering the question generally ("I don't know anyone" / "I know no one." /etc) but even in the specific case I don't know how to express it otherwise.
Comment: Some examples would help. Note this is a site about Spanish, so the nuances about the English language cannot be assumed to be known by everyone
Answer: Possible ways to say this in Spanish are

No me voy a ningún lado.
No me voy a ninguna parte.

Generally one would use the "reflexive" pronoun because if the idea is deciding to leave a place, the preferred verb is pronominal irse, not basic ir. Note ningún ("not any") before a masculine noun, not ninguno ("not one").
An emphatic way of saying this would be

No me voy nada.
No me voy nada a ningún lado. (or ...a ninguna parte)

You can also emphasize the place:

De aquí no me voy. (or De acá... depending on dialect)

This would be appropriate if you're being invited to leave a place and you want to stand your ground and sound really angry. There are surely other ways to express this in different dialects.
I don't really understand the difference in English, but in any case there's no way to translate directly into Spanish.
Comment: Your first versions are appropriate for the usual form "I am not going anywhere". I think your last one captures one of the usages of "I am going nowhere" said defiantly. There is also the rather depressive use of "I am going nowhere" = I am drifting pointlessly, have come up to a dead end, and so on. Not sure if your middle two capture that at all.
Comment: I second @mdewey here. For the `My life is a wilderness of despair. I'm going nowhere.` the correct translaction should rather be `mi vida es un páramo de desesperación, no voy a ninguna parte|
Comment: Thank you.  I was feeling like there wasn't a general way to express the difference but was wondering if I was missing something.  I think you're correct that  no+irse does capture the difference in this specific case.
Comment: (...that is *without the reflective pronoun* "me" )
Answer: People would tend to say "I am going nowhere" to indicate lack of progress in some endeavor, and not failure to travel geographically.
One way to say this in Spanish might be

No salgo adelante.
Answer: "I am going nowhere" has a special meaning, which expresses despondency.  This could be expressed in Spanish as

No llego a nada. [I'm not getting anywhere.]
No soy nadie. [I'm a nobody.]

The answer more generally, such as "I don't know anyone" / "I know no one," which you included in an explanatory comment:
In Spanish, they would both become *No conozco a nadie" or "No conozco a ninguno."
This is a case where there is not a unique, one to one correspondence between the two languages.


Is it haram to talk to a guy online as friends?

Question: i have a friend who is a male online and we text and sometimes play games together. i have no intention of being anything more than friends and i know i have a strong mind which can refrain from it. we have never seen eachothers face and sometimes we call while playing games but thats it and we only call so we can play the game and have more fun and talk about the game instead of texting. can someone who is well educated tell me if being friends with the opposite gender is haram? and if it has been said in the Qur'an? i have tried searching for answers but everyone gives me a different answer.
Answer: Aslamu Walaykum
According to these verses of the holy Quran, it is strictly forbidden to have a friend that is the opposite gender:
33:32 O wives of the Prophet! You are not like any other women: if you are mindful ˹of Allah˺, then do not be overly effeminate in speech ˹with men˺ or those with sickness in their hearts may be tempted, but speak in a moderate tone.
24:30 ˹O Prophet!˺ Tell the believing men to lower their gaze and guard their chastity. That is purer for them. Surely Allah is All-Aware of what they do.
24:31 And tell the believing women to lower their gaze and guard their chastity, and not to reveal their adornments except what normally appears. Let them draw their veils over their chests, and not reveal their ˹hidden˺ adornments except to their husbands, their fathers, their fathers-in-law, their sons, their stepsons, their brothers, their brothers' sons or sisters' sons, their fellow women, those ˹bondwomen˺ in their possession, male attendants with no desire, or children who are still unaware of women's nakedness. Let them not stomp their feet, drawing attention to their hidden adornments. Turn to Allah in repentance all together, believers, so that you may be successful.
Talking to someone of the opposite gender in person or via the internet is prohibited. Males should always look down and avoid talking to people who are of the opposite gender unless necessary.


Would you say that "headhunter" (as in recruitment) carries derogatory connotations?

Question: I've seen the expression being used quite a lot in non-English speaking countries by recruiters themselves and I find it a bit odd. Have they chosen the wrong way to be cool?
Comment: I don't believe it has a derogatory connotation. It's used as a slang in English speaking countries, so the term would have spread from there.
Comment: The source contradicts your assertion that recruiters call themselves headhunters.  But it is wrong because some certainly do, and they would be unlikely to describe themselves with a derogatory term.
Comment: @rudeovski I'm not the only one:
http://community.ere.net/blogs/recruiting-is-more-fun-than-you-think/2009/11/dear-sarah-iii-whats-the-difference-between-a-head/
Comment: For the etymology, see: http://english.stackexchange.com/questions/87846/oed-appeals-antedatings-of-headhunter
Answer: It's certainly not derogatory towards the people whose heads are being hunted. In the usual modern sense of the word, headhunters are typically executive search firms that recruit skilled professionals for jobs that usually offer competitive or superior pay and benefits. The analogy with primitive hunters who collect human heads as trophies is, when separated from the significant disadvantages of actually being killed and decapitated, rather flattering for the quarry: to be headhunted is to have a head worth hunting, after all.
The earliest citation in the OED is from a 1961 issue of Fortune magazine: "McCulloch had no compunction about using these executive recruiting firms. They were, he knew, often derisively called 'body snatchers', 'head hunters', 'flesh peddlers', and 'pirates'." I wish there were more context, but my guess would be that these were considered terms of derision by employers who didn't appreciate having their best employees poached away from them, rather than by the firms' customers or the candidates they recruited.
It's worth noting that the OED definition itself ("orig. U.S., an employment agent or agency specializing in the recruitment of managers and other skilled personnel by identifying and approaching preferred candidates; one who recruits using these methods") doesn't say anything about it being considered a derogatory term today.
edit: You reference this link, which makes the analogy with real estate agents who prefer to be called realtors or real estate salespeople. I don't think that's the best analogy ("Realtors" is a trademark of the National Association of Realtors, and nonmembers aren't supposed to use it), but we might also consider an individual who wishes to be called a sanitation engineer, but whom everyone else would simply call a garbage collector. In all three cases, the situation involves the subjects preferring an overtly positive term over a term that most disinterested observers would probably consider neutral at worst. I would differentiate between that and a term that is actually derogatory, though some may disagree.
Comment: I am asking about hunters, not hunted…
Comment: @Dan - I think the principle is the same: if "headhunter" is offensive, the people who would be entitled to take offense would be the hunted, and I don't believe they do. There may be some recruiters who dislike the term themselves, but they would seem to be in the minority.
Comment: re edit: that's a subtle distinction, it does seem that the members of the group feel themselves unease by the term.
Comment: The people who take offense are not those being recruited, they are the people from whom the recruits are being taken.  Thus the term is one used by companies who lose valuable staff to competitors not by employees looking for a better job in a different organization.
Answer: For a job recruiter, the term 'headhunter' is only slightly derogatory. One might consider using it to the person's face but it might feel a bit strange by connection with the other original meaning. A recruiter is probably very aware of this term and has probably been inured to it through over-use. The dictionary will not say it it is derogatory because it is not taboo enough, but it does have a slight connotation of negativity ('garbage man' is not derogatory but other terms like 'refuse collector' or 'waste management personnel' might be favored.
Disclaimer: I have no data or reference to support this answer other than inner reflection. I'm not sure exactly how to support such claims of nuance other than by bald statement.
Comment: +1 Agreed.  The term is slightly derogatory.  People who do this for a living will have gotten over taking offense.  I'm sure if you looked at their LinkedIn profiles, however, they would describe themselves as "recruiters" not "headhunters".
Comment: i think the term is only derogatory to the extent that the profession is - like calling someone an estate agent (realtor). The derogatory term, at least in software, is pimp

Would you say that “headhunter” (as in recruitment) carries derogatory connotations?


Adding CKEditor first party packages

Question: The plugin documentation for craft ckeditor says that first party packages include a build file that I need to add the plugin. I'm not seeing a build directory in any of the ckeditor first party packages. Am I missing something?
Comment: I have struggled with this one too, we could really do with some more detailed instructions on how to setup first party packages in the plugin
Answer: The GitHub repository for CKEditor plugins doesn't include the bundled package, just the source files. You can build the plugins yourself, or you can grab the build from npm.
If your project already includes npm, you can install the package like this (this is for the highlight plugin, replace with your desired plugin):
npm install @ckeditor/ckeditor5-highlight

Then you can grab the build folder from the node_modules and copy it to your AssetBundle. If you don't want to install the plugin and just grab the build folder, you can instead download the module as a tar file:
npm pack @ckeditor/ckeditor5-highlight
tar -xzf ckeditor-ckeditor5-highlight-41.2.0.tgz

The pack command will download the package and place it in the current directory as an archive, tar -xzf will extract it. Then you can copy the build folder from the extracted folder.
You can find more info on where to place the plugin folder in my answer here.

Adding CKEditor first party packages


Intra-rater reliability for categorical (non-binary) data with variable observations

Question: Here's what my data look like:
From a mark-recapture study on a population of birds, I have data on the coloration score for each individual bird. The coloration score is a simple visual score that places an individual into one of four color categories: Yellow, Patchy Orange, Uniform Orange, or Red. Coloration was scored for each individual every time an individual was captured (note: different individuals were not captured the same number of times). Only one observer (me) assigned coloration scores throughout the study. The study took place over a short enough time scale that we can reasonably assume the coloration of a given individual does not change over time (at least not enough to 'move' a given individual from one color category to another)
The problem:
I want to evaluate how repeatable my assessment of coloration was during the study. As I understand it, my data seem to violate many of the features of data that can be analyzed with common measures of repeatability.
Can anyone provide me with any suggestions for measurements of repeatability that I might use?
Answer: Cohen's weighted kappa may be an appropriate statistic for calculating IRR for categorical data.


Can I shift from D to 2 or L while my Toyota Corolla is moving?

Question: I drive a Toyota Corolla (E120, year 2000). It has automatic transmission with these options: P, R, N, D, 2, L. I almost always drive using "D". If I am driving at around 70 km/h (e.g. on level road or down a hill), is it safe to shift from "D" to "2" or "L"? Does the answer depend on whether or not I am pressing the gas pedal and/or accelerating while shifting?
Comment: It's not advisable selecting 2 (2nd gear) at speeds above approximately 32kph or redline on the tachometer. Selecting 2 or 1 keeps the transmission in that gear until you shift back to D mode for automatic shifting of gears.
Comment: If you are descending a steep hill where you need a lower gear to help with the braking, first slow the car with the brakes to the safe speed and then engage the lower gear. Its purpose is to stop the gearbox shifting back up when there is no power demand from the engine. Those antiquated designs  are not very clever. A modern DSG gearbox would probably figure this out for you, and the purpose of its gear hold is mostly marketing.
Answer: While I am not familiar with this particular car, I would not think twice to gear down an automatic transmission if I'm going downhill and I need engine braking.
It is up to the transmission control mechanism to prevent the engine from going into unsafe rpm numbers. This means that you may or may not get the braking action expected, no matter how much important is this for you.
Anyway, the signs 1/2/3/L on the stick do not mean anymore "limit to the 1/2/3/lowest gear". What these mean on a model year 2000 or newer car is simply "I need my engine more responsive right now and I am ok with the increased fuel usage, wear and noise, so switch gears at higher rpm, please".
If you don't like this, drive manual. 20-ish percent better economy and a marginal possibility to break your engine by shifting gears.
Comment: *It is up to the transmission control mechanism to prevent the engine from going into unsafe rpm numbers.*  I think this is incorrect.  It's up to the driver to follow the instructions in the manual.  On my old automatic Toyota, if you threw it into low gear while moving fast, it would redline, possibly damaging the engine.  Of course, if the brakes aren't working, it might well be worth it.
Comment: @RockPaperLz-MaskitorCasket How much old is your old Toyota? 2000+ or way older? Manuals are good (joke!), but few people read them and even those who do sometimes do especially stupid things. I used Toyota (not Corolla) from 1996 or 1998 and it was pretty much OK to gear down at any speed. My 2002 Chrysler Grand Voyager (much lower tech than any Toyota from 2000) is safe either - otherwise, either I or my equally manual-trained wife would break it at the first downhill.
Comment: That Toyota was from 1988, IIRC.  That's newish, right? ;)  I initially missed the part in your answer referring to model year 2000 or newer.  How certain are you about your claim?  If you're pretty certain, I'll add it to my brain as "possibly correct useful new information learned from an online stranger". :)  In all seriousness, if you're correct, that's a big (and most welcome) improvement to automatic transmissions.  And I'm grateful to you for learning about it here.
Comment: @RockPaperLz-MaskitorCasket I am pretty sure about anything that has electronically-controlled automatic transmission (i.e. solenoids inside the box) and also anything that has "hydraulic logic" (whatever the manufacturer calls it). The technology changeover is somewhere before the year 2000, but I am an European and I avoid automatics by instinct so I don't know the exact year per brand.
Comment: Thanks.  I'll keep my eyes out for those buzzwords.  Because most rental vehicles are relative new (typically newer than model year 2000) and have automatic transmissions (for better or worse), it's good to learn that they will likely incorporate this "modern" technology.


Object as fluid

Question: Hello Im new to Blender.
I am trying to make a character playing with a glass of wine, so rotating it a bit.
so I need the wine to be fluid. I found just tutorials how to make inflow simulation for
fluid. how do i give an object physics of fluid without inflow simulation..
thanx
Answer: Just choose geometry instead of Inflow for Flow behaviour.
Comment: I tried it but there is some problem. i'd appreciate if you could have a look (I added a pic) . @Chris
Answer: Yes it works.
I had to hide the wine object so just the domain to be seen.
and resolution high to 128 so the liquid would look good.

Object as fluid


How does having different scales on features make an elliptical contour plot?

Question: I have been taking Andrew Ng's Machine Learning course, and in the lesson on feature scaling's effect on gradient descent, I just can't understand how because of the different scales on the features cause an elliptical contour plot of the cost function. I made the inference from the contour plot that the cost function increases and decreases very rapidly with an increase of decrease in theta 1, and it increases or decreases very slowly with an increase or decrease in theta 2.
(X1=Sq feet of the house.
X2=Number of bedrooms.)
But I still cant understand how having different ranges fuels that. Please help
Answer: We can use two functions here as examples to help to understand the concept of derivative.
$$f_1 (x_1, x_2) =x_1^2+x_2^2$$
$$f_2 (x_1, x_2) =x_1^2+10x_2^2$$
If we plot the contour we will find $f_2$ is elliptical. The reason is that along the $x_2$ direction, we can reduce to cost more quickly than $x_1$ direction.
For example, if we are at point $(1,1)$, $f_1(1,1)=2$. For next point, $f_1(0.9,1)=f_1(1,0.9)=1.81$, i.e., they have the same value.
But for $f_2$, it is a different story. $f_2(1,1)=11$, $f_2(0.9,1)=10.81$ and $f_2(1,0.9)=9.1$. So, we can see, if we reduce $x_2$ it is more effective to reduce the cost.
This is why it make make the elliptical contour.
Comment: Ok, so according to you, if x2 is of large value, then we can reduce to cost function more faster, but it makes the elliptical contour?
Comment: But my professor says that θ will descend quickly on small ranges and slowly on large ranges, which is the opposite of what you said, please clarify.


Best preservation of parma ham?

Question: We were recently in Italy and bought a large piece of parma ham, which we'd like to use over a protracted period. It is vacuum packed at the moment, what is the best way to preserve it once opened?
Answer: To best preserve it's texture, especially that slightly moist part a good ham is supposed to have, I've found wrapping cured meats in plastic foil and keeping them in the fridge at a temperature where there is little condensation (not extremely cold, but you have to know your fridge) works for a decently long time (couple of weeks at least, if not months).
However things wrapped in plastic in the fridge tend to get moldy over time, there is no escaping that. And dried salted meats are after all a product of ancient preservation techniques. So if you really need it to last storing it in a dark and a bit chilly area, wrapped in a clean dry cloth or paper it should also stay good for long, although it will dry up some after it is cut and not vacuum sealed.
Last option is to wrap it in some paper and leave it on the bench. The paper should protect against dust and moisture, but at that point I would suggest that just eating it is a better way of storing it if it is a really good piece you spent some effort in acquiring.
Answer: I can't comment specifically on parma ham, but I find that in general for cured meats and firmer cheeses that wrapping in butcher paper and then placing in the fridge works quite well.  It's possible that you might have a little bit of dried outer layer that you have to deal with, but it's less likely to go moldy on you, making you want to throw away the whole thing.
If you don't have butcher paper, I've also had good luck wrapping blocks of cheese (I admit, haven't tried this one with meats) in a paper towel, then placing it in an unsealed plastic bag.  This helps to wick away any surface moisture, and the open bag slows the evaporation but keeps you from accumulating too much moisture.  (note that the 'meat drawer' on many fridges works like the open plastic bag -- it holds in a bit of moisture to keep things from drying out too fast)

Best preservation of parma ham?


Depedency injection in custom X509CertificateValidator class in WCF using Unity

Question: We are using WCF service along with certificate based authentication with wsHttpBinding.
I have written custom class to do authentication. This class is inhereting from System.IdentityModel.Selectors.X509CertificateValidator.
 public class MyX509CertificateValidator : System.IdentityModel.Selectors.X509CertificateValidator
    {

        public override void Validate(X509Certificate2 certificate)
        {
            /// Custom code goes here
        }
    }

This class is configured in web.config
 <behavior name="customBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceCredentials>
            <clientCertificate>
              <authentication certificateValidationMode="Custom"
                              customCertificateValidatorType="**SampleClass.MyX509CertificateValidator** ,SampleClass"
                              revocationMode="NoCheck"/>
            </clientCertificate>
            <serviceCertificate
              findValue="XXXXXXXXXXXXXXXX"
              x509FindType="FindByThumbprint"
              storeLocation="CurrentUser"
              storeName="My"/>
          </serviceCredentials>

I am using Unity.WCF nuget package for adding DI support to the WCF. My problem is I am unable inject dependency inside above class. This class is not served by Unity. It is being called automatcally by WCF runtime when WCF is invoked.
Can we really add dependency injection support in above class?
Answer: You can still inject dependencies into a custom certificate validator:
You can accept it via the constuctor:
public class CertificateValidator : X509CertificateValidator
{
    private IMyDependency _dependency;

    public CertificateValidator(IMyDependency dependency)
    {
        _dependency = dependency;
    }

    public override void Validate(X509Certificate2 certificate)
    {
        ...

And then pass it when you configure the service host:
serviceHost.Credentials.ClientCertificate.Authentication.CustomCertificateValidator =
    new CertificateValidator(dependency);

You can use an IOC container to supply the dependency to the part of your program that creates the service host.


Dystopian world where the cities were built miles above planet's surface

Question: I am trying to locate a book from the 1970s/80s that I started but never finished when I was a kid. All I can remember is that it was set in a dystopian world where the cities were built miles and miles above the planet's surface and that there were sophisticated atmospheric controls used in the cities' highest levels to allow residents to breathe normally. The protagonist was possibly an adolescent female and maybe a thief? I've been racking my brain on this for ages and appreciate any help offered.
Comment: People seem to really be [looking for a book with this description](http://scifi.stackexchange.com/q/87501/5184) in the past day.
Comment: Maybe they're in the same book club?
Answer: It could be you're confusing Zelda with a book or fell asleep during a floating city episode of Star Trek.
Or from the Wikipedia page on "Floating cities in science fiction":

The novel Orion Shall Rise by Poul Anderson features an aerostat city
  called Skyholm, located above present-day France.
In the novel The Ringworld Engineers, Louis Wu seeks a way to save the
  Ringworld by bartering for information in the library of a floating
  city.
Airhaven is a floating city in the Mortal Engines Quartet, that,
  through attaching gas bags, lifted itself into the air to avoid cities
  trying to eat it according to Municipal Darwinism.
There are numerous floating habitats on the Venus-like planet Chilo in
  Tobias S. Buckell's novel Sly Mongoose. Buckell credits Geoffrey A.
  Landis with providing the background information on the floating
  cities.
Saga of Seven Suns by Kevin J. Anderson has giant, manned, gas mining
  platforms, that mine the hydrogen necessary to, among other things,
  distill into ekti, a vital stardrive fuel.
Charles Stross's novel Saturn's Children begins in a floating city on
  Venus.
In Hannu Rajaniemi's novel The Quantum Thief, the Mars colony began as
  a slave-labor latifundia. After war developed, all entities began
  taking turns being the beings who kept the city rolling (and
  deflecting the permanent attack vectors that had been created during
  the war). The city kept rolling, with everyone's help.
The Cities in Flight series by James Blish propose a universe in which
  cities cast adrift from the Earth, powered by a fictional spindizzy
  drive.
Comment: Thanks. I'm pretty sure that the cities weren't floating but were different levels of a continguous structure.


How to render glass with XNA or DirectX 9

Question: Any good pointers on how to get the refractive look of glass? I'm looking to create a think piece of glass type of look, sort of the type that you'd have on bathroom shower doors.
Answer: I am a little confused about what you are asking. I think you might be asking how to create water droplets in an indirect way. I will answer both. =)
If you want to create water droplets you can use a very simple distortion shader to offset the current pixel coordinates. However, there are many ways to do water droplets. Here is one which works well: Link
If you want to create the refractive look of glass then you are going to have to create an environment map. This essentially is your scene rendered from the 6 sides of a cube, if you choose a cube map. I suggest using XNA 4 because it now comes with a built in EnvironmentMapEffect shader.

EnvironmentMapEffect — An environment
map effect uses a diffuse texture to
color or detail an object, and a cube
map texture containing an environment
map to shade the object due to the
environment. Because the object
reflects the scene, this makes the
object look more like it is in a real
scene. Also, you can use the fresnel
parameter to tune the amount of light
reflected (shininess) based on the
geometry of the surface.

Here are some articles which describe the process in more detail (keep in mind the new EnvironmentMapEffect for XNA 4.0):
http://digierr.spaces.live.com/blog/cns!2B7007E9EC2AE37B!585.entry?wa=wsignin1.0&sa=736960100
http://xna-uk.net/blogs/randomchaos/archive/2009/01/06/basic-hlsl-lighting-techniques-episode-6-environment-maps-reflection-amp-refraction.aspx
Comment: Thanks, it was the environment mapping that I was after, thanks for the links, I did try to find stuff like this but I think I had the wrong taxonomy.
Answer: If you want refractions, you will need to copy your back buffer to use as a texture for a distortion pass. There are a couple of ways to do this pass, but the most common is to create a distortion buffer some where early in your rendering pipeline after your Z has been written where you blend in your distortion directions.
You can then do a pass where you find it suitable (after opaque and before transparent for example) where you copy screen to a texture and distort back onto the screen using your distortion map. It will not be correct but it will be quite fast.
An alternative is to copy screen for each glass that is supposed to distort, this will give you a more correct look but it will cost a lot.


Concatenating videos (mp4) in Mac

Question: I got a bunch of mp4 videos (different parts of a same film) downloaded from YouTube. Is there a way to join them to make a single video? I have a Macbook.
Comment: Use mp4box:  http://superuser.com/questions/133413/joining-h264-without-re-encoding
Answer: Quicktime 7 Pro is able to concatenate videos.
Alternatively, you can write a SMIL file describing a movie composed of a sequence of your videos:
<code><smil>
<head>

<layout>
    <root-layout width="640" height="480" background-color="gray" />
    <region id="main" width="100%" height="100%" fit="fill" />
</layout>

</head>
<body>

<seq>
<video region="main" src="myVideo001.mov" />
<video region="main" src="myVideo002.mov" />
<video region="main" src="myVideo003.mov" />
<video region="main" src="myVideo004.mov" />
</seq>

</body>
</smil>
</code>
SMIL is a format readable by Quicktime.
Comment: In Quicktime, I get this error when opening SMIL files: `The document "video.smil" could not be opened. QuickTime Player cannot open files in the "synchronized multimedia integration language" format.`
Comment: Is it latest version of Quicktime player (shipped with Snow Leopard)? In this case, you can download Quicktime Player 7.6.4 from Apple.
Answer: Since those youtube videos probably come in a codec Apple software understands, you could open iMovie (comes with every mac), drag the mp4 files to the program and then concatenate them, with the addition of being able to edit the clips, adjust their sounds, etc.

Start with an empty project in iMovie.
Drag one file into iMovie.
Drag another one into iMovie.
Now that both are imported, you can arrange them in the timeline of your project.

Check the iMovie manual for more information on how to do this.
The problem with iMovie is that during importation the files are recompressed into Apple's intermediate codec, exploding the required file size for the project (tends to go into the GB range).
Similar software to what has already been suggested is MPEG Streamclip, which allows you to open a video, select all, copy it to the clipboard, then open another one and paste it. It also allows minimal edition features withour requiring intermediate recompression of the source files, but the interface is not polished and easy to use as iMovie.
Comment: 1. Start with an empty project in iMovie.
2. Drag one file into iMovie.
3. Drag another one into iMovie.
4. Now that both are imported, you can arrange them in the timeline of your project. Check the iMovie manual for more information on how to do this.
Comment: I could not find a way to concatanate files in iMovie
Answer: I wanted to add how to do it with recent Quicktime Versions (i. e. the one shipped with Lion), so users who find this thread looking for a solution (like I was) find a current answer.
Just open the first clip and select from the menu: "EDIT" -> "Add clip at the end..." (or so, my menu is German).
Select the movie you wanna add. Repeat for the other parts.
Then select "FILE" -> "Export". This might take a while and can change the encoding of your videos, but it works without installing anything and is pretty easy.
Answer: You can try ffmpeg. There is a Mac GUI named ffmpegX that includes ffmpeg among other things.
Answer: I use VisualHub, which is no longer produced, sold or maintained, but there are various methods of still getting hold of it.
Answer: with Mplayer: http://www.mplayerhq.hu
you could do:
mencoder -oac copy -ovc copy -idx -o output.mp4 video1.mp4 video2.mp4 video3.mp4
"-oac copy" copies the audio codec
"-ovc copy" copies the video codec
"-idx" build the index for the resulting video
on linux is ok, i think also on mac!
Comment: This is also my favorite approach. But for copy to work it is important they were encoded with completely same settings. Very often you got to reencode them. Though it's not much harder.
Comment: I tested this using MEncoder 1.3.0-4.2.1 on Mac OS, and while it appeared to work in the terminal, the resulting MP4 file wouldn't play in Quicktime Player, and actually crashed VLC when it hit what should have been the join point between the two input videos. Both videos were produced on the same equipment (dashcam) and used the exact same codec, resolution, bitrate, etc. I am at a loss to explain why it doesn't work, but it doesn't.
Answer: VisualHub would be my #1 recommendation. VisualHub can still be found on several Mac software sites. Due to it's discontinued nature, it would be advisable to visit several mac "shares" sites in search of a usable serial number. Alternatively you could try to contact the developer, but I do not believe he is accepting payment for any new serials at this time.

Concatenating videos (mp4) in Mac


Active Directory

Question: Is it possible for a C# application to find all users on a windows domain such that the application runs outside the domain and is not on the same network may be over http?
Answer: You need some component of the application to run within the "zone" where it can interrogate Active Directory.
This could be a small server-side component exposed as a WCF web service, that you can query for what you need from anywhere via HTTP (won't be secure, by default).
Answer: It depends on the security set up of the domain.  It is certainly possible, not directly over http though, to bind to a domain controller from outside a domain.  Assuming that they haven't blocked the ports at a firewall, you can use a regular LDAP connection or rely on the Active Directory classes in .NET. Most likely you'll have to use a secure connection and it will be on a non-standard port. You'll need to supply domain credentials for the connection in order to be able to connect.  Because you're outside the domain, you will probably also have to specify the domain controller to which to bind -- see the PrincipalContext in System.DirectoryServices.AccountManagement, particuarly the constructor that allows you to supply credentials and the controller name/port.
Answer: public DataTable getActiveDirectoryUsers()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add(new DataColumn("Name"));
            dt.Columns.Add(new DataColumn("POCode"));
            dt.Columns.Add(new DataColumn("Active"));
            DataRow dtrow;

            DirectoryEntry myLdapConnection = createDirectoryEntry();
            List<Users> listAlluers = new List<Users>();

            DirectorySearcher search = new DirectorySearcher(myLdapConnection);
            SearchResult result;
            SearchResultCollection resultCol = search.FindAll();

            //search.PropertiesToLoad.Add("cn");//user name
            //search.PropertiesToLoad.Add("title"); //design

            if (resultCol != null)
            {
                for (int counter = 0; counter < resultCol.Count; counter++)
                {
                    string UserNameEmailString = string.Empty;
                    result = resultCol[counter];
                    if (result.Properties.Contains("cn") && result.Properties.Contains("title"))
                    {
                        dtrow = dt.NewRow();
                        dtrow[0] = (String)result.Properties["cn"][0];
                        dtrow[1] = (String)result.Properties[BusinessLayer.UserConfig.UniqueField][0];
                        dtrow[2] = (String)result.Properties["useraccountcontrol"][0];
                        dt.Rows.Add(dtrow);
                    }
                }
            }

        return dt;
    }
    static DirectoryEntry createDirectoryEntry()
    {

        String Path = "LDAP://your.server.Ip";
        DirectoryEntry ldapConnection = new DirectoryEntry(Path, "username", "password");

        return ldapConnection;
    }

Active Directory


Spherical inversion in terms of special conformal transformation

Question: I want to consider conformal maps on suitable compactifications of $\mathbb{R}^{n}$. I know that a special conformal transformation: $$x_i\mapsto\frac{x_i-x^{2}b_i}{1-2b\cdot x+b^{2}x^{2}}$$ can be written as a composition of a spherical inversion, a translation (by $b$) and another inversion about the same circle. Since the conformal group is generated by special conformal transformations, translations, dilations and rotations, it should be possible to write the spherical inversion: $$x_i\mapsto\frac{x_i}{x^{2}}$$ as a composition of these maps. I can't, however, think of such a representation. How can it be obtained?
Comment: This might be better to ask on [math.stackexchange.com](http://math.stackexchange.com).
Answer: The special conformal transformations as well as the translations, dilations and rotations are all continuously connected to the identity. This means that they contain parameters such that at some particular value the trasformation becomes trivial. For example, for $b=0$ the special conformal trasformation you write is simply $x_i\mapsto x_i$. The inversion map
$$x_i \mapsto \frac{x_i}{x^2},$$
on the other hand, is not connected to the identity.
We can also note that an inversion changes the orientation of the space, while the other conformal transformations preserve the orientation. In $D$ (Euclidean) dimensions the special conformal transformations, translations, dilations and rotations together form the Lie group $SO(D+1,1)$. This is what, at least in physics, is normally referred to as "the conformal group". If we also allow for inversions this group is extended to $O(D+1,1)$.
Comment: Note that the argument about the orientation does not rule out $x_i\rightarrow-\frac{x_i}{x^2}$ (in D=2n+1).
Comment: In fact, adding any transformation that saves the orientation (e.g. reflection) to the invesion map gives the result in the connected component of identity.
Answer: I am talking about Euclidian signature.
It is true that you cannot obtain
$$x_i \mapsto \frac{x_i}{x^2}$$
from special conformal transformations, dilatations, translations and rotations because, as Olof has noted, this map changes the orientations, whereas the listed transformations preserve it. However, what you can obtain is e.g.
$$
x_i \mapsto R_{1ik}\frac{x_k}{x^2},
$$
where $R_1$ is the reflection 'along' first axis. In odd-dimensional spaces this allows you to get e.g.
$$
x_i\mapsto -\frac{x_i}{x^2},
$$
which is pretty close to your goal. To show this, consider the following composition of special conf.transformation and translation:
$$
x_i \mapsto \frac{x_i-b_i x^2}{1-2b\cdot x+b^2x^2}+\frac{b_i}{b^2}=\frac{x_i+\frac{1-2b\cdot x}{b^2}b_i}{b^2x^2\left(1+\frac{1-2b\cdot x}{b^2x^2}\right)}.
$$
Now, add dilatation with factor $b^2$ to obtain
$$
x_i\mapsto\frac{x_i+\frac{1-2b\cdot x}{b^2}b_i}{x^2\left(1+\frac{1-2b\cdot x}{b^2x^2}\right)}\xrightarrow[b\to\infty]{}\frac{x_i-2x^{1}_i}{x^2}=R_{1ik}\frac{x_k}{x^2},
$$
where the limit $b\to\infty$ means that $b$ goes to infinity along the 1st axis, and $x^1_i$ is the vector projection of $x_i$ onto the 1st axis.
You can have a look at this video. It is for $D=2$, and the above mentioned limit is demonstrated at 2:00. You can notice that result differs from inversion by a reflection.
Answer: Edit. I just realized that I didn't answer your question; I'll leave this up in case it helps answer your real question...
Let use denote the operations of inversion and translation by
$$
  I(x) = \frac{x}{x^2}, \qquad T_b(x) = x+b
$$
Then notice what happens when we perform the following composite transformation:
\begin{align}
  I\circ T_{-b}\circ I (x)
&=I(T_{-b}(I(x)))
= I(T_{-b}(x/x^2))
= I(x/x^2 - b) \\
&= \left(\frac{x}{x^2}-b\right)^{-2}\left(\frac{x}{x^2}-b\right) \\
&= \frac{x^4}{x^2-2b\cdot xx^2+b^2x^4}\frac{x-bx^2}{x^2} \\
&= \frac{x-x^2b}{1-2b\cdot x+b^2x^2}
\end{align}
But this is precisely the special conformal transformation we wanted.  So we see that a special conformal transformation can be written as an inversion followed by a translation, followed by an inversion.


Is SPFx client web part durable? Is this good approach to develop web pages to publish in SharePoint online (Office 365)?

Question: I have some dynamic pages in my intranet website (CRUD operation plus search/filter). I have office 365 SharePoint online version. I want to develop client web part using reactjs and restAPI to work with my premise SQL server data. Is SPFx client webpart durable? Also how robust it is to achieve CRUD operations and filter/search using RestAPI development? I also might have to access the sharePoint files stores using SharePoint RestAPI or other methods if available. But most of the time I will be using my premise SQL server since I have lot of procedures already working in place.
Answer: You should look at SharePoint provider hosted add-ins for your case. In this way you can deploy your add-in as Azure Web app, create a site-to-site VPN with your on-premises data center (unless express route already exists in your environment) and use SQL server on premises data in your add-in through hybrid connection.
As per Microsoft, The SharePoint Framework (SPFx) is a page and web part model that provides full support for client-side SharePoint development, easy integration with SharePoint data, and support for open source tooling. With the SharePoint Framework, you can use modern web technologies and tools in your preferred development environment to build productive experiences and apps that are responsive and mobile-ready from day one. The SharePoint Framework works for SharePoint Online and also for on-premises (SharePoint 2016 Feature Pack 2 and SharePoint 2019).
Using SPFx you might be able to build the UI of your application and make use of SharePoint data, but you also need to think about connecting to your on-premises SQL Server database.
Otherwise you might have to think about exposing your SQL server data using a WCF service and make it available in SharePoint online through BCS, which will have limited scope to work with your data comparing to provider hosted add-in.
Comment: Let me know if the concept has helped you to achieve your goal, please mark as answer if it did.
Comment: Hi UBK, thank you for your answer and your time. Right now I am doing SPFx client webpart test to access external hosted APIs of premise sql server. I know there is the security challenges but I know how to handle that. I have read data and also display in web part from my external APIs using ReactJS UI. This works fine. My question is I am not sure this is the right path to achieve my goals.
Comment: Isn't that [SharePoint provider hosted add-ins](https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/get-started-creating-provider-hosted-sharepoint-add-ins) is only for on-premise SharePoint version?
Comment: Provider hosted add-ins can work in on-premises SharePoint as well, but it is certainly not limited to on-premises. If you have externally hosted APIs then it is kind of similar to having a provider hosted add-in, it was not mentioned in your question, hence I thought of it, since you will need some mechanism to make use of you on premises SQL server procedures and need to deal with exposing the data to SharePoint online SPFx webpart. I feel you are in the correct path already.


Moving from assembly to C

Question: About four years ago i stumbled upon some electronics projects on the internet and ever since i fell in love with it. So I started at basic circuits then moved to analog circuits and spent very little there then logic circuits then microcontrollers.
Each step made the abstraction of the next one very clear and easy to 'de-abstract' if i can say.
So after spending some good time writing code in assembly and with the programs growing more complex and longer , the need for another transition for me from assembly to C has arisen.
The thing is that i didn't know any other programming language before learning assembly , and trying to learn embedded C from the current sources i have seems to be very hard for me as i can't 'de-abstract' the meaning of many of the language syntax.
So i would like that good sources for embedded C language learning be suggested which if possible links the explanations to lower language assembly not higher ones that i already can't 'de-abstract'.
Comment: I almost made a rant as an answer. My answer: don't. To me assembly and C (however similar) are fundamentally different in thing: assembly is a set of instructions for the machine. C is a form of expression for **YOU** to describe your algorithm. A form of expression which is actually understandable for the machine. But that's just a personal opinion from a programmer.
Comment: MostfaMahmoud - As gbulmer said, I agree this is not a good fit for EE.SE. However I'll try to help a little. I also moved from mainly assembler programming, to C programming, so I have experienced your problem. You said that you "can't 'de-abstract' the meaning of many of the language syntax" - stop trying to do that! Just accept that programming in C changes your mindset from handling every little detail (as with assembler), to describing what you want the machine to do. This is what @JanDorniak has said in a previous comment.
Comment: The thing people usually have trouble with in C is pointers. Coming from assembly, I'd be surprised if you have trouble with that. C is one of the most low-level languages out there.
Comment: Your question seems very broad, and answers would likely be based on opinion, so it is a poor fit for this community. Please read the [help] to learn how to ask good questions. Try to be more specific. What sources have you already found, and what are you finding difficult, or that they do not explain?
Comment: Or take a look at LLVM's Intermediate Representation language, which is sort-of in between C and assembly: https://en.wikipedia.org/wiki/LLVM#LLVM_Intermediate_Representation
Comment: @JanDorniak That may be true for C programs targeted for "general use", but for embedded platforms when you have 2 kB of Flash and  CPU running at 32 kHz, you can gain a lot by understanding roughly what will happen on the machine level when writing things in C.
Comment: @AdamHaun Agreed. Once you learn your compiler, it's essentially an optimizing macro assembler. :)
Comment: @pipe true that, but with the increasingly cheap cortex-m I don't really see any reason to go to weaker MCUs... but as already said I'm a programmer who only made a few simple (say water meter) projects on relatively powerful MCUs like cortex-m 0.
Comment: [This one](http://users.ece.utexas.edu/~valvano/embed/toc1.htm) seems nice. Just don't spend too much time on the MCU-specific hardware stuff.
Answer: Microchip has several free Compilers that are paired with the free MPLABX IDE (Integrated Development Environment).  You can get a compiler for 8, 16 and 32-bit microcontrollers.
The difference between the free versions and the paid ones is the latter optimize the code, making the finished binary much smaller.  I've seen size of the binary shrink by half.
One feature of the IDE is that you can open a disassembly window which will show you your C program followed bu the code that it generated.  The following is from a PIC32 program (32-bit MIPS assembly):
Comment: Is there a free program with similar feature for AVR since i'm already accustomed to its instruction set and internal architecture, or should i learn PIC assembly (which i think it wont be hard as learning a specific assembly language for the first time).
Comment: @MostfaMahmoud What processor did you write assembly code for before?  I think that would be your best place to start.
Comment: AVR 8-bit microcontroller .
Comment: @MostfaMahmoud Sorry, I should have picked up that before when you said you were familiar with its instruction set.  I'm not familiar with the native AVR development tools, but it appears Atmel has a [free development suite](http://www.atmel.com/Microsite/atmel-studio/).
Answer: Get ahold of K&R 2nd Edition. It's a compact and dense book that covers what you need to know.
C and assembly are not that far apart, so you should make rapid progress.
Comment: I'd highly recommend K&R 2 as well. There are more recent books and larger books, but nothing more comprehensive or lucid.
Comment: I read about people who have difficulty learning from K&R 2, exactly because it is so dense. :-( And of course that book is stuck in a C89/90 era. So, although not aimed specifically at the assembler-to-C transition of the topic's OP, here is the canonical Stack Overflow topic on good C books, for readers who want to find alternatives: http://stackoverflow.com/questions/562303/the-definitive-c-book-guide-and-list
Comment: As someone who has worked full-time with embedded C programming for the past 15 years, I would strongly recommend to **avoid** this ancient book. It is terribly outdated, it is full of errors, it contains lots of bad programming practice. The concept of proper program design is completely absent throughout the book. I'm sick and tired of re-teaching proper, modern C to people who have been damaged by this book. Also note that the book's main focus are hosted systems, mainly Unix, and not embedded systems. Instead pick something modern, that covers C99 and C11.
Comment: @Lundin Well i think that advice is a bit late , as i have  already skimmed through half the book, however , before i begun reading it i decided to take it lightly because embedded C isnt its main focus as you have mentioned earlier, but i decided to read it first just to get a general idea, then i will read Embedded C Programming and the Atmel AVR, 2e Barnett ,cox and o'cull (without leaving exercises like i'm doing with K&R).
So i would really appreciate your advice and other book (instead of what i mentioned) recommendation and if i should leave K&R  at all without completing it.
Comment: @MostfaMahmoud I don't really know of any beginner-friendly C books, but you should try to find one which covers at least the C99 standard. Any yeah drop K&R asap. What you should do eventually is to look into MISRA-C:2012, which is a coding standard laying out rules that lead to safe, bug-free C programs. Very suitable for embedded systems in particular - it is becoming industry de facto standard. It is not easy reading for beginners though, but knowing about it is a merit that employers will look for.
Comment: @Lundin I'm really grateful for your advice, but i think it will be awhile till i dig into that as it is obvious that one needs to learn the language first before learning the guidelines of writing good code into it, however i think it will be worth it.

Moving from assembly to C


How sure Microsoft will replace traditional addin dev method with SPfx?

Question: How sure Microsoft will replace traditional addin dev method with SPfx? Where we can get the roadmap of SPfx?
Answer: Microsoft has no plans to remove the Add-in model if that is what you are asking. In terms of the SharePoint Framework, all indications are that Microsoft is committed to SPFx as the SharePoint development model moving forward. In my opinion, the big issue is the pace at which they are adding features that we can use. It's more than two years since they announced SharePoint Framework and all we have are web parts and extensions.
As to your last questions, you can find the roadmap here: SharePoint Framework roadmap
Comment: Yes, pace is slow. The "placeholders" only support "top" and "bottom", which is not useful.


How can the oscillating states of many atoms in a lattice combine to give even a larger number of possible states?

Question: Basically, I was studying the band theory and there was that thing that I couldn't understand, and it appeared to be connected to another question: how is the blackbody radiation appear continuous rather than quantized.
I would like to know how can energy states add together and allow the emission of various quanta of energy ?
I was asking this problem because I knew that an atom of hydrogen has specific emission lines, and the same goes for helium and all elements. However, the sun gives us seemingly all the spectrum (discluding absorption lines) rather than discrete frequencies.
Answer: Let us break it down to the simpler question: if I have an atom that emits radiation of one very particular wavelength, how do I get other wavelengths from it? One easy way is to let the emitted photon scatter inelastically off a bunch of other atoms, so that it loses some energy, and becomes a photon of a different wavelength (There is also a possibility of inverse Compton scattering, which can cause it to gain energy instead). This is what gives rise to the continuous, close-to-blackbody spectra of macroscopic bodies. An astronomical number of scattering events convert a line spectrum into a continuous spectrum in the sun. Since the sun has enough atoms for photons to scatter off from, the wavelength that is emitted in the interior of the sun is not the wavelength that escapes from the surface. Sidenote: it takes thousands of years for a photon emitted deep in the interior of the sun to reach the surface. That should give you an impression of the number of scattering processes it encounters before leaving the sun. The resultant spectrum therefore has little similarity with the line spectra of individual nuclei or atoms.
Update to include bands in a solid: the number of states does not change. That is to say, if one atom has $n$ states, then $N$ atoms have exactly $Nn$ states. The difference is, for $N$ isolated atoms, the ground states would be degenerate. Once they are close enough to affect each other, Pauli exclusion forbids this, and degenerate energy levels become non-degenerate, with a gap between them. The width of the gap is inversely related to the number of states there were to begin with. So for bands in a solid with $10^{23}$ atoms, the spacing of degenerate energy levels is infinitesimal, and they form a band.
Comment: But how can scientists perform analysis to the spectra from starts to know their components and this stuff?  Also does making the bands or states infinitesimal make the emitted energy follow the black body radiation ( seem continuous)?
Comment: the answer to both your questions is the same. it's difficult to get a pure blackbody spectrum starting with a line spectrum, and that is precisely why we can still analyze stellar spectra. eventhough the spectrum is continuous, not all features of the line spectrum are lost, and certain wavelengths are much more prominent than others in a stellar spectrum, and this characterizes the composition of the star.


Cyren (Zxyel) classified my fresh website as a "Spam Site". I have never hosted a mail server. What now?

Question: About a month ago I bought a cheap VPS from a popular provider, and also bought a new domain name for it. It hosts Nextcloud and TT-RSS, and I have never sent an email from it -- yet on http://sitereview.cloud.zyxel.com/, it is classified as a "Spam Site". Because of this, several corporate networks block access my site, which is quite annoying (on the internal Access Denied page, the above link is offered as a contact for reclassification requests).
There are no spam site hits on any other reputation checker sites, such as MXToolbox. I was certain that I has no malware, but nevertheless ran chrootkit and LMD, and of course nothing was found. I tried to contact Cyren several times weeks ago, through the reclassification form on the first link above, but I did not get any replies. (To be fair, I am not sure I filled the request form properly. What do "Category 1" and "Category 2" even mean?)
I thought about changing the server to get a new IP, but I think that Cyren filters based on URL, not IP (as the site is a URL checker).
What should I do so that Cyren reclassifies my site and it can be accessed again from everywhere? I am pretty much at my wit's end about this.
(Some additional notes for context: the site uses a Let's Encrypt SSL certificate, serves status code 500 on the front page to discourage web crawlers, and all content is on various subdomains.)
Answer: This type of web filtering service classifies every web site they can find into one or more of several categories. Their clients then choose which categories of web sites to allow or block on their networks.
It's likely your site was classified as "spam" due to actions of the previous owner of the domain name.
The only thing you can do is to suggest more appropriate categories for the site in the reclassification form. You won't usually get a reply, but these reports do get reviewed and the classifications do get changed if they make sense. The catch is that, if the network from which you tried to access the site also blocks the new categories, you still won't be able to access the site.


Validating SSIS 2012 packages programatically via SSIS Catalog Managed Object Model

Question: I'd like to validate and then execute SSIS package stored in SSIS Catalog (Project Deployment Model) via objects from Microsoft.SqlServer.Management.IntegrationServices namespace.
When I execute Validate method from PackageInfo class it only runs validation, but no wait till its end. In one example I've found author fires validation in 'fire and forget' mode - why fire it when we don't bother with result? In another one execution is fired without previous validation.

Should I verify package before every execution?
If so, how to do it in synchronous mode?
I'm also curious with ValidationOperation Status property. It's
wrapped catalog.validations status column and can have, inter
alia, values succeeded (7) and completed (9) - what is
difference between them?
Answer: Ad 2: I was able to wait for validation result in a loop:

var validationId = package.Validate(false, PackageInfo.ReferenceUsage.UseAllReferences, null);
ValidationOperation validation = package.Parent.Parent.Parent.Validations[validationId];
do
{
    Thread.Sleep(1000);
    validation.Refresh();
}
while (!validation.Completed);


Are evolution and reinforcement learning related?

Question:
Are evolution and reinforcement learning related?

Evolution and reinforcement learning are related in that they both involve a process of learning and adaptation over time.
Evolution is a biological process that occurs over generations, where traits that enhance an organism's survival and reproduction are passed down to future generations. Evolution is driven by natural selection, favouring traits that provide an advantage in the struggle for survival.
Reinforcement learning, on the other hand, is a machine learning type involving an agent learning from its environment through trial and error. The agent receives feedback in the form of rewards or punishments for its actions, and over time, it learns to choose activities that maximize its reward.
Both evolution and reinforcement learning involve a selection process, where certain traits or actions are favoured over others based on their performance in the environment. In evolution, the process of selection occurs over generations, while in reinforcement learning, it occurs within the lifespan of the agent.
Furthermore, both evolution and reinforcement learning can lead to the emergence of complex and adaptive behaviour. In evolution, complex behaviours and adaptations emerge through the gradual accumulation of small changes over many generations. In reinforcement learning, complex behaviours emerge through the trial-and-error process of learning.

Questions

Since we can see the similarities, what is their origin? (When you see similar cookies, it means a mould exists somewhere.)

In evolution, an organism evolves, but in RL, a strategy (Policy). So are we not more than a strategy, an idea?
Comment: The more direct parallel to evolution in AI / algorithms is [genetic algorithms](https://en.wikipedia.org/wiki/Genetic_algorithm), which is fairly directly based on evolution, featuring combining and mutating genetics as well as selecting based on fitness. We made AI algorithms up, long after we discovered evolution and much, much longer after we discovered other methods of learning. So the connection between AI and the things it's based on is the fact that AI is based on those things. The connection to philosophy here seems weak. It's much more just about AI.
Comment: Yes and no. Both use trial and error, but in evolution "trials" (mutations) are purely random, whereas agents are typically more deliberate with what they try, and in evolution natural selection is very indiscriminate, it goes down to binary survival/extinction, whereas rewards and punishments have more targeted ends. Reinforcement learning is more like purposeful [selective breeding](https://en.wikipedia.org/wiki/Selective_breeding) than evolution by natural selection. As for being a strategy, agents do more than just reinforcement learning, deliberate and reflect, for example, so no.
Comment: @NotThatGuy What if we take reinforcement learning in general, not the code we can write on a computer? We humans learn through trial and error. It's not about copying the evolutionary technics to build algorithms.
Comment: RL could be viewed as memetic rather than genetic evolution
Comment: @ShrimanKeshri Learning through trial and error can arguably still be boiled down to natural selection. Any species that doesn't try new things will have a hard time adapting, and any species that keeps doing something that doesn't work will die out pretty quickly.
Comment: If you just equate type-proportions in the population to mixed strategy then the analogy you spotted will be formal. See this recent paper for more: [The cost of information acquisition by natural selection](https://www.biorxiv.org/content/10.1101/2022.07.02.498577v1.abstract)
Answer: It's incorrect to think of evolution as a 'reward/punishment' system. In fact, it's incorrect to think of evolution in individual terms at all. Evolution (as it's currently understood) is ablative. Genes are introduced into a species' genome by random processes, and then a slew of creatures from that species pour out into the world. If those with that gene survive and reproduce in sufficient numbers, the gene is retained; if not, not.
Evolution is like throwing spaghetti at the wall to see what sticks, over and over, reusing the ones that stick and idly adding new pastas over time. Biology doesn't 'learn'. Biology copes.
Reward/punishment systems are an evolutionary adaptation that often (but not necessarily) gives individual members of a species a greater chance of surviving and passing on their genes. It only applies to Animalia with sufficient nervous systems to seek out prey and avoid predation. Plants, fungi, filter-feeders, etc don't seem to have an equivalent, and yet they are still products of evolution.
We'll get different answers to the question "Are evolution and reinforcement learning related?" depending on how broadly we interpret it. Sure, there's a correlation here, but the correlation seems to be more by metaphor or analogy than by anything concrete and practical. In the real world these principles operate on different scales: the first on the level of the genome, the second on the level of an individual expression of the genome. The capacity for learning certainly has an impact on evolution within a given species, but from the evolutionary prospecting the capacity for learning is just a different kind of pasta tossed at the wall.
Answer: We can say that both reward/punishment and evolution increase or decrease the prevalence of certain patterns. In reinforcement learning, reward increases ("reinforces") the prevalence of the pattern of behavior that led to the reward. In evolution, successful reproduction increases the prevalence of the genetic patterns that led to the successful reproduction. They are equivalent in that way, and that is the key feature of both.
Note that genetic algorithms can be used for reinforcement learning. They are not mutually exclusive. We can think of genetic algorithms, and evolution, as specific examples of reinforcement learning. Specific examples of the principle that "if, when a pattern leads to X, you increase its prevalence, then you will end up with a greater prevalence of patterns that lead to X."
Also, whether the prevalence of the pattern actually increases depends on the amount of reward compared to a background level. Generally the pattern has to lead to more reward than competing patterns, in order to increase in prevalence. Or in an evolutionary context, the genetic pattern has to lead to more offspring than competing genetic patterns.
This principle is easily seen in policy-gradient methods within RL. In these methods, you let an agent perform a series of actions with some random variations, leading to some amount of reward. Then you adjust the agent's parameters to make it either more likely or less likely to perform those actions. The more reward the actions led to, the more you adjust the parameters to make the actions more likely.
The principle is still present in other RL algorithms, just with a little indirection. For instance, in algorithms based on value iteration, the agent learns to predict the reward resulting from different actions. The agent is more likely to select actions that it predicts will produce greater reward. This means that if the agent receives a large reward, it will more frequently perform the actions that led to that reward.
Answer:
Evolution is a biological process that occurs over generations, where traits that enhance an organism's survival and reproduction are passed down to future generations. Evolution is driven by natural selection, favouring traits that provide an advantage in the struggle for survival.

Not really. That makes it sound far too much like a planned process and implies a continuity and connection between agents of different generations. But it's really just "who's alive is alive".
Like if you start with 1000 people then after 200 years all of them are dead. None of them was better or worse suited to live and regardless of their features all of them are dead. Now if some of them engaged in cloning and starting the clock on that clone anew, then 200 years from now still all the original 1000 people are dead but those clones are still around. And because they are perfect clones they will proceed in the same way so maybe it's not even the original clones that are around but the clones of the clones.
So if you're only interested in the question of the features of the people who are or will be still around, then this process would be "static" or at least "periodic" because you run through the same cycles over an over again. But for the individual in it, each cycle will be the only cycle they'll ever see and it's far from static or periodic, but full of unique experiences.
And the same applies if you don't produce a perfect clone but a slightly imperfect clone or in terms of humans a mixture of 2 people. They will also just live their life and die of natural (or unnatural) causes and if they reproduce their clones will be alive later on and if they didn't then other's or no one will be around. But for the individual agent there's no difference between that, because by that time they won't be around anyway. So purely in terms of evolution, there is no improvement or enhancement happening for the agent and they don't pass on genes that are beneficial for survival, they only pass on their own genes and if they had been able to survive for long enough to do so, then that might have been genes well suited for survival...  Or they might just have been lucky. Like picture a school of fish and a predator just randomly eating a few. Might have been the fastest, brightest, most athletic or the opposite and either way it doesn't really matter. Seriously it could even go backwards. Like the offspring of a fighter might be less strong, but still survive due to their parents protecting them and so on or how inbreeding nobility didn't create "aristocrats" (the best), but more like the opposite of that.
So in terms of biological evolution it's not even trial and error and you don't so much learn from mistakes, it's rather that "mistakes" or bad luck, just remove you from the gene pool.
On the other hand learning by trial and error IS an improvement of the individual. The concept is basically that you encounter the same or similar situations often and rank your experience with them. So what was good is done again what is bad is avoided, mixed might be tried again, might be not. And as those who like things that get them killed are more likely to get themselves killed, while those who like things that let them survive long enough to pass on their genes are more likely to do so, there might be a connection between evolution and learning by trial and error. So it might have been necessary at some point to match patterns, store and identify them, and thus realize that we're running in circles, then to take the paths in them that felt the most beneficial and have beneficial be "living long enough to pass on their genes".
Now with regards to machine learning we're basically looking at the same problem from the other end. Meaning we have identified that the environment fits individuals according to it's needs. Not really but that's what it looks like and for our intents and purposes that is all that matters.
So instead of being the agent and living your life. You create an environment that matches a problem of yours in order to make it fit individuals according to it's needs, that ultimately help you solve the problem.
So the first iteration would be a genetic algorithm, so you really just throw everything at it and see what sticks. The one(s) that stick the best are copied and modified a little less and the process starts anew. More often than not people literally call each of these training cycles a "generation".
Though if you do that on the computer than the difference between a genetic algorithm and a reinforcement learning system really aren't that large because whether one iteration is a training cycle or whether at the end of an iteration you kill all those performing bad and clone the rest, the result is pretty much the same. And as the set of parameters that you've updated to perform better on the challenge is a continuous object or a newly generated is completely irrelevant for the computer who treats that as the same thing.
If you do 1000 runs with a single agent or 1 run with 1000 agents that are slightly modified doesn't really matter. If you have the processing power you likely make large number of runs with large number of agents anyway.
It might be a little conceptually different as one has the ranking of the situation be a property of the environment, while the other has it as a property of the agent, but depending on the implementation that might be similarly irrelevant like whether it's a persistent or new set of parameters.
Comment: @anongoodnurse The point was to dispel the notion that evolution is a directed process or that evolution inevitably favors survival skills. Evolution isn't an active process to begin with it's just a name we give for something we observe about the usual passage of time. So no individuals don't improve by evolution they die it's just the observation that animals in the future and past are similar but different to those now. The length is irrelevant I just wanted to take a length when they would all be dead. Also an eternal life could also see evolution but likely via a different process.
Comment: "Like if you start with 1000 people then after 200 years all of them are dead. None of them was better or worse suited to live and regardless of their features all of them are dead." Evolution isn't about length of life, it's about the ability to reproduce and pass on the genes that made you more favorable to live in an environment and more likely to reach reproductive age and to do so. I understand you got into this a bit later, but the opening statement is misleading. A mutation allowing eternal life in one unable to reproduce is evolutionarily worthless.
Comment: TBH, the OP's definition is better than your correction on the whole. Maybe you are reading a teleological characteristic to it when there was none intended. It is quite accurate.


In "Does he have it?", why doesn't 'have' agree with 'he'?

Question: We say "He/She has it", ie "he" or "she"  which are singular is followed by "has". Similarly "they" or "you" which are plural, are followed by "have".
But we ask "Does he have it?" ie here "he" is followed by "have". Of course I know it doesn't seem correct to say "Does he has it?". But still why is it so?
Comment: But ***have*** in your example *doesn't* "agree with ***he***". It's an "unmarked infinitive",  which doesn't change even if the subject is changed to a plural - for example, ***Do they have it?***
Comment: Short answer: because **to do** has already been conjugated into **does**.  You don't conjugate both verbs in this phrasing.
Answer:
Does he have it?
  Do they have it?

In the sentences above, "have" doesn't agree with anything.   It's a bare infinitive form, not directly attached to any subject.   The verb that agrees with the subjects in these questions is to do.
These are questions.   The first word of the verb construction appears before the subject.   Despite the separation provided by subject/auxiliary inversion, the verb constructions here are "does have" and "do have".
There is no "does has" construction in English, since both "does" and "has" are finite forms.   They don't naturally combine.
Comment: "The verb that agrees with the subjects in these questions is *to do*." How can *to do* agree with the subject if it's an infinitive, which don't conjugate?
Comment: The infinitive is a part of the verb's conjugation.  I often use the full infinitive form to refer to the verb in general, without regard to its form.  Otherwise I'd have to type things like "do/does".
Answer:
Does he have it?

There are three reasons why have does not agree with he in this example:

We can only have one tensed verb in each verb phrase in English.
Only tensed verbs can agree with their subjects.
The tensed verb must always be the first verb in the verb phrase.

In the Original Poster's example, the first verb is the verb does. For this reason does is present tense and takes third person singular agreement to agree with he. Because have is not the first verb it cannot be tensed and cannot agree with the Subject. The form of any non-tensed verbs depends on the auxiliary verb which they follow. Here the auxiliary verb is DO, and so the verb have is in the plain form (or infinitive).

In “Does he have it?”, why doesn't ‘have’ agree with ‘he’?


Change custom post taxonomy values from front-end

Question: I'm developing a ticketing system which already has the custom post type for the tickets with a "status" taxonomy. I have the tickets displayed in a table on the front-end and the status column has the status values in a dropdown with the current status selected by default. How can I change the status taxonomy on the back-end based on the selection of the dropdown on the front-end?
Answer: That would be achieved using the wp_set_post_terms function.
https://codex.wordpress.org/Function_Reference/wp_set_post_terms
You could run an ajax request on the change event of the dropdown to either wp-admin/admin-ajax.php or a custom JSON API endpoint (preferred but more work) with a payload like this
{
    new_status: 123
    post_id: 321
}

Ensure 100% that the user that is logged in has authorization to modify the post
$post = get_post( filter_var( $_POST['post_id'], FILTER_SANITIZE_NUMBER_INT ) );
if( /*Test User Auth*/ ){
    wp_set_post_terms( $post->ID, [
        filter_var( $_POST['new_status'], FILTER_SANITIZE_NUMBER_INT )
    ], 'status' );
}


how to delete old account and credit card info by

Question: How do you delete some one else's account off your Android phones play store there is no credit card on it but it makes me have to go and find me and then I can see my info if not it goes to the lady I bought my phone from
Answer: Settings > Accounts > Google then select the account which you wish to remove.
Settings > Accounts > Google >  select the account which you wish to remove > More  > Remove account.
PS: You'll need to stop Syncing first.
On older versions (1.5 > 2.3.5) there is no way to remove an account, only by resetting the device to the factory settings.
Comment: In older versions, there's no *official* way. De facto, there is one which is a bit tricky. You don't need a full factory reset, but just delete data from the corresponding Google apps. But of course that also means all accounts would be dropped – no way to drop a single account only there.
Comment: Exactly, but the account will still be present in the phone.
Comment: No. But this is not a discussion area, and apart from that, the percentage of users interested in that an old Android version is rather low :) Which is why I didn't post the complete procedure.


What happens to the air in a water bottle when it falls?

Question: (ignoring the air resistance that causes the bottle to take positions in mid air. Let's say it is dropped in a vacuum with earth's gravity accelerating it downwards) I just cannot catch what happens with the bubble with my bare eye, and I thought I should better ask some experts :)
Answer: If you drop a bottle without any residual motion (that is, it is not spinning etc) then everything inside that bottle will be in "free fall". The air and the water will attempt to fall at the same rate.
There is a nice video of what happens to water when it "spills" in the International Space Station: it becomes a "blob" because of the surface tension. Add to that a small amount of attraction between the liquid and the bottle it is in (hydrophilic surface - attracting rather than repelling water) and you see that the water will actively want to stay in the bottom of the bottle: there is no force to move it away, and there is actually a (weak) force keeping it there.
So the air stays on top, and the water at the bottom. When it hits the ground, it will make a big mess - but that's not what you were asking about...
Comment: The hydrophilic effect would cause the water to climb the side of the bottle. However, it could just as well be hydrophobic.
Comment: @BlackbodyBlacklight you are right - but the climbing (increase in contact area) will be limited by the surface tension (increase in surface area) until the contact angle is reached. Inertia should take care of the rest...
Answer: I think nothing. Example #1: Calculate the rms speed of an oxygen gas molecule, O2, at 31.0 °C
Solution:
$v=\sqrt{\frac{3RT}{M}}=\sqrt{\frac{3 \times 8.31447 \times 304.0}{0.0319988}}=486.8 m/s$
That is pretty high average speed of oxygen molecules. The acceleration of the bottle does not change it much at beginning. The direction of molecules motion is random if the speed of the bottle is much less than computed above number, but with time they will slow drift up relative to the bottle.
Comment: Yeah, my bad, I formulated the question incorrectly. Which direction do you think it flows towards or stays? (talking about the air bubble)
Comment: May I assume that the bottle is closed since there is vacuum around?
Comment: Yes, it inside contains this bubble of oxygen but arround there's vaccum, and it is left to fall from an X distance.
Comment: Ooooh, okay, thanks man, I think I'll reformulate this question and ask it again :)... one last thing... what do you think the question should look like to get the right impression of what I'm asking?
Comment: ok, i have started getting what you mean. Average speed. Interesting... At which time scale are you going to average? or you want to average instantly over all molecules?
Comment: I have added some corrections.
Comment: I... don't think I'm getting what you mean, sorry... I just wanted to know in which direction would the air bubble positionate as the bottle is falling... I guess the  answer would be upwards..ish? (acording to your solution)
Comment: i have edited the question
Answer: The environment in a free-falling object is the same as one without a gravitational field (neglecting gradients in the gravitational field, i.e. tidal forces).
So, before you drop the bottle, gravity is holding the water at the bottom and creating a slight air pressure gradient between the top and the surface of the water, and a water pressure gradient between the surface and the bottom.
When you drop the bottle, gravity "vanishes." The pressure gradients disappear. The air at the surface pulls upward a bit as its pressure falls. More significantly, if it's not a rigid material, the bottom of the bottle will rebound a bit because it's no longer counteracting any water pressure.
The net effect is that, even without air resistance or prior water currents, the water will tend to start sloshing and mixing with the air.
Answer: A liquid / gas mixture in an enclosed vessel in a zero-g environment can be quite weird. Given enough time, the contents of the tank eventually become an ethereal mix of blobs of liquid, bubbles of gas, and foam. This creates a significant design challenge for liquid fuel tanks intended for use in space. One solution is to use a bladder to separate the liquid from the ullage gas. That's no fun! There is no mix of liquid and gas in such a tank. (Plus the bladder is a point of failure.)
Sans a bladder, the only ways to get fuel from the tank to the thruster are to never stop firing the thrusters (thereby forcing the fuel to one end of the tank), rotating the tank so as to centrifuge the fuel, or to use devices (typically passive devices) based on surface tension that collect the fuel. These are called propellant management devices, and there are lots of patents for such devices.
Answer: In the short term, the sloshing of the water as you not-completely-cleanly let go of the bottle will be the dominant effect. In the long term, since you're ignoring air resistance, and if we assume the bottle isn't spinning in any way, then surface tension will dominate.
Different material interfaces have different energies, and absent other forces those energies will try to minimize. For instance, all else being the same the water and air will rearrange to make the air/water interface as small as possible. Depending on the plastic (and its wettability) the plastic/air or plastic/water interface may also minimize to varying amounts. (I took 3.091, "Introduction to Solid State Chemistry", from Professor August Witt at MIT in 1980; what an awesome lecturer!)
For example, if the plastic is extremely hydrophobic, then the water/plastic interface will be minimized and you'll end up with one big ball of water floating in the middle of the bottle. Or, if the plastic is extremely hydrophilic, then you'll end up with a big ball of air floating in the middle of the bottle.