How to get a turret to shoot at player in a shmup

Question: I'm developing a basic vertical shoot em up on the DS and am trying to get stationary turrets to shoot at the player in a shoot em up. Early on I simply had them shooting in fixed 8 directions N, S, E W, NE, NW, SE, SW, depending on the player's relative position, but I want something more specific. My attempts have been awkward at best, and my aiming algorithm is not very crude and often the turrets miss by a mile. I am looking for a simple algorithm that plots a basic straight line trajectory towards the player's xy position. Nothing fancy like predictive aiming. Does anybody know of an algorithm or an article that covers such an algorithm?
Answer: This can be achieved using trigonometry and vector mathematics. First, calculate the direction (or normalized vector) that the turret should face:

Where a is the target vector subtracted by the turret position:
direction = Vector2.Direction(targetPos - turretPos);

Assign this value to a Vector2 direction inside your bullet class. You should to increment your bullet position by its direction:
bullet.position += bullet.direction;

You won't need to update the direction unless you want the bullet to seek the target like a missile. The same direction code can be used to define the turret's rotation.
Answer: Luckily it's pretty simple!
To have a turret shoot a bullet at a target point, you need to figure out the normalized vector from the turret to the target.
To get this, first subtract the target point from the turret point.  This gives you a vector but the length is not normalized.  To normalize this vector, you just divide x and y by the length of the vector.
Now you have a vector that has a length of 1, that points from the turret to the target.
If you multiply this normalized vector by the speed you want it to move per frame, you then can spawn a bullet at the turret and move it this amount every frame.  It will move from the turret to the players position at the appropriate speed.
Like you pointed out though, this is not predictive, and if the player moves, the bullet will miss.
Comment: Ok just checking-- when you say 'divide x and y by the vector' does that mean divide each distance by the hypotenuse if I were to triangulate?
Comment: Right exactly. You get the length of the hypotenuse (which is the length of the vector) then you divide x and y by this value to normalize it. The vector will then have a length of 1 which is nice because then you can scale it up (or down) to any desired speed by multiplying x and y by the desired speed.
Comment: OK I ran into a problem: the DS doesn't perform floating point arithmetic, so when I divide the x and y distances by the vector the results truncate to zero. The bullets literally just float in one spot now. Is there a workaround for this?
Comment: I shipped a ds game so I am sympathetic hehe.  One solution is to use fixed point math. Another solution would be to get the vector length to normalize, but multiply by the desired speed before dividing by the vector length.  Another way would be to work with angles instead of vectors.  Atan2 of the vector from turret to target will give you an angle, then you could do trig stuff. I think fixed point is the most reasonable solution, but might be hard if you have a whole lot of existing code that works only with integers.
Comment: Also you might have some luck if you Frankenstein something using bresenhams line drawing algorithm.  It works only with integers and traces a path on a grid so might have some play here for you.  Probably will be quite a bit of work, but here's more info if you are interested: http://blog.demofox.org/2015/01/17/bresenhams-drawing-algorithms/
Comment: I went with the "multiply by speed before dividing" route and it works great. Sometimes it fires off a bullet faster than the others but I can fix that with some tweaking. Thanks for the solution!
Comment: No problem. My hat is off to you. The ds is quite a beast, you are a true champion hehe.


extended kalman filter equation for orientation quaternion

Question: I have a body pose data sampled with a given frequency. Using model with constant velocity motion between frames i filter position with EKF. State equation is given by:
$$
\begin{pmatrix}
x_{k+1} \\
y_{k+1} \\
z_{k+1} \\
\dot{x}_{k+1} \\
\dot{y}_{k+1} \\
\dot{z}_{k+1} \\
\end{pmatrix} =
\begin{pmatrix}
1 & 0 & 0 & dt & 0 & 0 \\
0 & 1 & 0 & 0 & dt & 0 \\
0 & 0 & 1 & 0 & 0 & dt \\
0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 1 \\
\end{pmatrix} *
\begin{pmatrix}
x_k \\
y_k \\
z_k \\
\dot{x}_k \\
\dot{y}_k \\
\dot{z}_k \\
\end{pmatrix}
$$
How can i add orientation into the model? The same idea seems to be correct, assume the body is rotated with a constant angular speed. But what equation should i use? And what representation of orientation is suitable? Orientation in the form of rotation matrix (which i can convert to orientation quaternion) is given at the same points in time as it is with position.
Comment: Look at the true state kinematics in the following document: http://www.iri.upc.edu/people/jsola/JoanSola/objectes/notes/kinematics.pdf
Comment: thank you very much, will work on that
Answer: The biggest issue with dealing with rotation in an EKF is the fact that (so far as I know) there is no sensible way to define the rotation in a vector space.  Euler angles, Quaternions and rotation matrices are not vectors, but instead form groups.
This is a problem for the EKF because it assumes that all state variables are vectors.  Think, for example, how you would form a covariance matrix about a quaternion.  A covariance matrix is defined as:
$$ E[(x-\hat{x})(x-\hat{x})^\top]$$
But, in the case of a quaternion, what does $(q-\hat{q})$ even mean?  It's no longer a unit quaternion.  Same thing goes for rotation matrices.  Euler angles are a little more subtle, but similar logic applies (if you subtract two "vectors" of euler angles, what does the result really mean?)
Given a linearization, euler angles actually work okay. Here's an example of a quadrotor EKF using euler angles as the orientation states Quadrotor Dynamics and Control -Beard.  Obviously, euler angles have issues with gimbal lock that this source doesn't address, and euler angles are extremely computationally inefficient due to all that trigonometry, but it's meant as an introductory kalman filter implementation.  If you're just getting started, it might make sense to start here.
However, to get around these problems, some smart people in spacecraft attitude estimation worked on this and came up with the "Multiplicative" EKF.  In the MEKF, you can think of the covariance being defined with respect to an "error vector" about some quaternion reference state.  You propagate the quaternion using standard quaternion dynamics, but then update the quaternion and define the covariance using a 3-vector parameterized as a gibbs vector or rodriguez parameters. Multiplicative vs Additive Filtering for spacecraft attitude determination - Markley.  The gibbs vector actually is a vector, but it has a singularity, so it's only good for small rotations.  Therefore you need a reference quaternion, and you define small "errors" to that reference with a vector.  The "multiplicative" term comes from the fact that you end up "multiplying" this error vector into the reference quaternion, rather than add it with simple vector addition like you would all the other states.
This practice of dealing with non-vector components of filter states has recently been a little bit better formalized with some new notation that makes it more natural and cleans up the syntax significantly Integrating Generic Sensor Fusion Algorithms with Sound State Representations through Encapsulation of Manifolds -Hertzberg et al.. This avoids the use of error state variables, and allows you to "pretend" like you are dealing with vector states rather than these group objects (such as quaternions).  The paper I linked has an example UKF implementation using quaternions, which could serve as a decent basis for your implementation.
Comment: Last link is broken. I believe it was referencing the resource titled "Integrating Generic Sensor Fusion Algorithms with
Sound State Representations through Encapsulation of Manifolds" by Hertzberg et al, available ([here](https://pdfs.semanticscholar.org/4613/727ef686c6186cab69e6b8be8cb1fa3ba800.pdf))
Comment: That's strange, it's working for me, but yes, you're right.  I'm referencing that hertzberg paper.  Thanks!
Comment: I think arxiv was just down for a while ([source](https://arxiv.org/new#mar26_2018)), but for future reference it would be a good idea to have the resource title in your text instead of the URL :D. P.S. I take it you're studying how the MSCKF works.
Comment: Yep! along with rovio, vins and imu preintegration on manifold.  (Pretty much all visual-inertial stuff)
Comment: I found an EKF for Quaternions on a website of University of Munich (http://campar.in.tum.de/Chair/KalmanFilter). Is EKF with Quaternions really not working?
Comment: @Soccertrash - The U. Munich reference contains a variation on the MEKF.  "The quaternion r is updated through a quaternion multiplication with d which represents the difference caused by angular velocity."  I can't figure out how they are coming up with their jacobians A, W, H, and V.  This is usually the trickiest part of writing a consistent MEKF.
Comment: Pretty late to the party but you should checkout section 5 of: "Quaternion kinematics for the error-state Kalman filter" - By Joan Sola [link](http://www.iri.upc.edu/people/jsola/JoanSola/objectes/notes/kinematics.pdf), it has a full derivation of how to construct the jacobians.


I can't get an arrayed object to follow bezier curve

Question: I've done this hundreds of times in 2.7x but in 2.81 I just can't get it to work no matter what I've tried. Sample file attached. I have a simple object I want to array to be, say, 5 kilometers long. I have bezier curve I want it to follow.  It just doesn't work and gets twisted and distorted in weird ways. What on earth is wrong... Same scale, same origins, same orientations. What I want is to make it follow the path of the bezier curve, like a road.
https://www47.zippyshare.com/v/gs2pl6wj/file.html
Answer: There are two things that cause trouble:
1. Array orientation (little trouble)
Your array is facing the wrong way.
Just rotate it like this and set the Relative offset on the X axis.

2. Curve radius (big trouble)
The curve radius is set to 200 (waaay too high), which causes significant distortion.
Either change the curve radius to 1.
Or uncheck Radius in the curve properties.
Change curve radius to 1.
Sidebar > Item > Mean Radius

Or disable radius influence altogether
Curve > Shape > Radius (uncheck).
Comment: That is not correct. Your object is flipped twice. It should look like road from above. Not that thing that is rotated 90 degrees and arrayed to wrong direction (Y+ should be forward).
Comment: The thing I just can't figure out is why is there some scaling when certain defoirmation axis and relative offset combinations are used. Where does that come from??
Comment: Do you have explanation why the Y-direction does not work?
Comment: Well, it works as expected. It's just it in the wrong direction - the width of the road, instead of length :).


Minecraft 1.10: Damaged Item Variants Not Working!

Question: After watching a YouTube video on how to make a resource pack where the texture of an item is different depending on its damage, I decided to try to try and do it myself. I copied the code, got an image, and made the code for both the image file and the wood sword, which is the item that will have a different texture when damaged. Unfortunately, when I load the resource pack, the item has a "unknown" texture (the black and purple pattern of doom). I'm positive I typed the code right, what did I do wrong?
Answer: I typed in the exact same things from your screenshot and ran it (i used a golden sword instead of npcArtifact.png, and i called the JSON custom.json instead of npcArtifact.json. Other than that, it's the exact same thing, and it works just fine.
Have you made sure to include npcArtifact.png in assets/minecraft/textures/items? That's where it belongs. Also make sure it's a png, not a renamed gif or jpg. you can make sure by opening it in gimp and exporting it with the appropriate file extension.
Also, your npcArtifact.json should be located at assets/minecraft/models/item. double-check you didn't put it into the textures folder.
Lastly, even though this sounds rediculous, but it happened to me a couple of times (being a resourcepack maker myself): make sure to put the files into the same resourcepack you are loading ingame - e.g. if you load a "respack.zip", but are working with the files inside a folder of your filesystem, make sure you copy them over into respack.zip before starting up minecraft!
hope that helps.
here's what my testfiles look like:
\assets\minecraft\models\item\wooden_sword.json
{
"parent": "item/handheld",
"textures": {
    "layer0": "items/wood_sword"
},
"overrides":[
{"predicate":{"damaged":1,"damage":0.25},
"model":"item/custom"}]
}

\assets\minecraft\models\item\custom.json
{
"parent":"item/handheld",
"textures":{"layer0":"items/gold_sword"}
}

and the texture for the gold_sword is obviously located at \assets\minecraft\textures\items\gold_sword.png which is where your texture should go.
Comment: Thanks! But-there is a problem... When I copied and pasted your exact code in, and edited it, it didn't work. Yet when I used Inspect (a Google Chrome feature where you can edit a website's code, but it goes away when you reload the page) on your code and replaced it with my code, copied it, and pasted it into my code. It worked. This is very strange for me! Do you know how to fix this as well?
Comment: Weelll.... apart from the possibility that you didn't highlight all of the text the first time you copied it, i'm afraid no.
other than that, my code is really just your code, edited, so if you use my code and edit it, you essentially just get your code back.
either way, i'm glad it worked for you, and sometimes it's just that minecraft didn't properly load the texturepack, i.e. because it was still being written to when mc fetched its contents on launch :)
Answer: The problem you have, is that you are using a mac. I also using a mac, discovered the same problem . There are workarounds like the one you said, using an online text editor, but Text Edit changes the format.
Hope this helps!


Counterweight in arm designs

Question: I wonder why most robotic arms use large J2 (shoulder) motors rather than counterweights. What sort of complexity do they add to the design beside increase in overall weight? In fact, rather than using extra weight as counterweight, the J3 (elbow) motor could be shifted down past J2 and use J3 motor as counterweight, but why isn't it done?
Comment: the weight is probably not the issue, but the mass probably is ... i would think that the designer would want to limit inertia as much as possible
Comment: Look at the parallelogram designs, such as the Fanuc S400.  Or the American Robots Merlin robots. They both took advantage of the "weight vs torque" design concept.
Comment: @jsotola But if the elbow motor was shifted past the shoulder motor, there won't be an increase in inertia, right?
Answer: The weight of the motors is less then the weight of the gears and bearings in the joint. So moving the motors only not that advantageous. Moving the gearboxes can be done, but bearings still need to be left at the joint. If motors and gearboxes are moved, but bearings are not, then additional bearings are required for the "moved" gearboxes and some kind of transmission shaft or mechanism will also be needed, which adds further weight.
Many large robots include a hydro-pneumatic "spring" at J2 instead of a mass. This has more flexibility than a mess, since the force of this spring can be more easily adjusted (by increasing/decreasing the pressure). Usually this is set up based on the intended load of the robot.
J3 is sometimes co-axial with J2, but this is more common for older robot models or currently for palatalizing robots.

As for the J3 axis, moving J4-6 behind J3 is currently more popular then moving J3 behind or next to J2. Some manufacturers favour this approach, but even if all 3 motors are placed behind J3 a counterweight might still be needed, as this image shows. The black element behind the 3 motors next to J3 is a counterweight. this counterweight is optional, based on the intended load.  (Please also note the hydro-pneumatic spring next to J2).
Comment: "The weight of the motors is less than the weight of the gears and bearings in the joint" - I'm not sure this is true.  If you take a look at harmonic drive actuators, for example, I think you will find that the motor and gear box weigh about the same.

Counterweight in arm designs


Is this use case is correct and proper according to uml?

Question: Is This use case is correct/proper according to UML? if not please give some input to improve it..
The ways we can look on it as the boundary value "Use Cases" can be described something as "Release Phase 1"?
Writer Module/Reader Module should be proper Ator?
alt text http://img190.imageshack.us/img190/6708/usecaseh.jpg
Comment: on what basis use case boundary should be defined, as we used "USE CASES" can be use here as "Status Check"
Comment: yes Michael i added the image..
Comment: Inside the bondary are the capabilities of the system that you are building. The Actors are people and existing systems that Use those capabilities. If you ae building Writer Module it is not an Actor and should not be on this diagram. I don't understand what you mean by 'as we used "USE CASES" can be use here as "Status Check" '
Comment: i also felt that boundary heading is not coreect here
Answer: This diagram is telling me that there is something external to the system you are developing called a "Writer Module".  The Writer needs three Use Cases, for example Initialization.
Similarly another actor needs Check Status and StackUp.
If that is what you intended to say, then this diagram works. Do you really mean it? Does only the Writer module Initialise the system? Or does the system initialise itself? Can the Reader check whether the system has been initialised, before it has been initialised? Is there another Use Case?
Small improvement: make the Use Case names match in their parts of speech. Initialisation is a "Thing", Check Status is an "Action".  Perhaps Initialize System might be better? "Stack Up" not "StackUp", be consistent.
Comment: Also all usecases should be goal oriented statements.
Answer: Normally the reason you group the use cases using a box is to show what system is helping meet or realize the use case. It is formally known as a system boundry ("The system you are building".  Normally the systems, modules, etc that are actors are more black box, existing, or use only.  If there are many new or modified systems this definition gets confusing.
The other comments are semantics of what you are showing, but are not sytax, still important.
Page 103 of Martin Fowler has a diagram and discription that uses the system boundry concept and system actors.
Answer: To pick on an example: this diagram says that Check Status is a scenario with two participants, a Writer and a Reader. Is that what you want to say?
Also, I don't remember seeing boxes around (sets of) Use Cases in general.
Answer: Use cases are meant to show how someone uses a system to get something of value.  Actors always represent persons, in the sense of an independent being who has goals and is capable of seeking something of value.
Actors are represented in one of several ways, either directly by name, or by inclusion through a role, or by proxy in the form of an agent acting on behalf of a person or role (the "system" actor).  Regardless of the form, the actor is always independent, and always capable of "acting" upon the system to achieve its own ends.
The diagram you have here is NOT a use case diagram.  "Modules" are not independent, goal-seeking entities, they appear to be simply components of some system.  They are not capable of "seeking" anything, they are just implementation details.
The diagram you are probably looking for is the Deployment diagram (if you want to model how specific components are wired together), the Activity diagram (if you want to model application logic), or the Class diagram (if you want to model the formal relationships between components).


Sitecore - Remove related publish option

Question: Is there any way to remove the related publish option or always uncheck this option when I publish?
Answer: If you are using the xmcloud and experience edge, you can use this setting:
<settings role:require="XMCloud">
  <setting name="ExperienceEdge.ProcessRelatedItems" set:value="false" />
</settings>

If you are using Experience Platform, I suggest to create a role, based on https://doc.sitecore.com/xp/en/developers/101/platform-administration-and-architecture/the-security-roles.html
The custom role can inherits from:

Sitecore Client Advanced Publishing
Sitecore Client Publishing
based on your requirements.

Then you can deny read access to the "/sitecore/system/Settings/Security/Policies/Publish/Can Publish Related Items"
in the core database:

which hide the option from the dialog:

I hope it helps.

Edited: Furthermore, if the users have checked the publish with related item, it is already saved on their profiles. You can check it and reset them, for example with powershell or c# code:
$user = Get-User -Identity "sitecore\testuser"
$user.Profile.GetCustomProperty("/sitecore\testuser/Publish/PublishRelatedItems")
$user.Profile.GetCustomProperty("/sitecore\testuser/Publish/Republish")
$user.Profile.GetCustomProperty("/sitecore\testuser/Publish/PublishChildren")
#Set it to false
$user.Profile.SetCustomProperty("/sitecore\testuser/Publish/PublishRelatedItems",$false)

It need a bit more work, and provided powershell script is just a sample to give you an idea. The Registry cache also need to be updated, maybe if you do a clear cache, you can skip that step.
I suggesst to study these two classes, for creating the correct script:

Sitecore.Web.UI.HtmlControls.Registry (see how caching works)
Sitecore.Shell.UserOptions
Answer: I can think of 2 solutions that will work for you.

Customize Publish.xml

Copy Publish.xml file from sitecore\shell\Applications\Dialogs\Publish folder to sitecore\shell\override folder, so that you don't messed up original file in case if you want to revert back your changes.
Apply Visible="false" on  and style="display:none" on
 as below.

<Checkbox ID="PublishRelatedItems" Header="Publish related items"  Visible="false"/>

           <ThemedImage Src="office/16x16/information.png" Align="Center" />
           <Literal class="publish-wizard-tooltiptext" Text='${Translate.Text(Texts.PublishesAllReferencesToTheItemThisMayIncreaseTheTimeItTakesToPublish)}' />

- By customize PublishForm

Create a new C# class library project and override the OnLoad method of the PublishForm class and add the following code:

using Sitecore;
using Sitecore.Diagnostics;
using Sitecore.Shell;
using Sitecore.Shell.Applications.Dialogs.Publish;
using Sitecore.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SitecoreCustom
{
    class CustomPublishForm : PublishForm
    {
        public CustomPublishForm()
            : base()
        {

        }

        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);
            //Modify role as per your requirement
            if (Sitecore.Context.User.IsInRole("sitecore\\ContentEditor"))
            {
                base.PublishRelatedItems.Checked = false;
                base.PublishRelatedItems.Disabled = true;
            }
        }
    }
}

Compile the solution and put dll in bin folder of website root.
Duplicate Publish.xml file and paste it at \Website\sitecore\shell\Override\Applications\Dialogs\Publish\
Open Publish.xml which we have just duplicated and update Publish Form code-beside class to use our custom code-beside class instead of Sitecore's default class.
You have to make below changes:

<WizardForm CodeBeside="SitecoreCustom.CustomPublishForm,SitecoreCustom">

The format is <namespace>.<class name>, <assembly name>. For example SitecoreCustom is a namespace, CustomPublishForm is a class name and SitecoreCustom is the assembly name.

Login into Sitecore with the user who is part of sitecore\\ContentEditor role (or any other specific role as per your requirement)

Select an item and try to publish it.

Hope it helps!
Comment: I tried the first method you mentioned, which successfully hides the related publish option. But, if someone publishes the item with this option before, this option will be checked as well even though it has been hidden.

So the second approach is more suitable for me?
Comment: Yes, second option works best in your case, also check if you restart your cm server then login back with same user and dose it persist with users last setting of publish related item. If not then first option should work.


Meaning of Old Babylonian word pāqidūtum

Question: I am learning the Old Babylonian language and just stumbled  over the word/form pāqidūtum. It seems to be a third person male stativ singular + u + the female ending tum of the verb paqadum (to care for), but that does not make any sense to me. Does anybody have an idea?
Comment: No one can help you without a context.
Comment: What exercise is it? (As in, what book is it from, etc?)
Comment: @fdb I wish I could add some context. its a word that occurs in an exercise (the exercise just consists of single words which have to be translated). in the chapter the stativ and suboridnate clauses were introduced so i think it has something to do with these, but i still cant determine the grammatical form
Comment: @Draconis its on page 48, exercise A.4 of the following script https://www.assyriologie.uni-muenchen.de/studium_lehre/hinweise/akkadisch_mit_keilschrift1.pdf
the script is in german though.
Answer: The word pāqidūtum is not listed in the CAD, which suggests that it's likely not historically attested. But the word pāqidu(m) = "provider, overseer, caretaker", also included in the exercise you cited, is listed on CAD volume 12 (P) page 137.
One page 35 of the lecture notes you linked, you will also find the abstractifying suffix -ūtum, used to derive abstract terms for "the state of being something" (and sometimes collectives like "all somethings") from concrete nouns, such as šarrūtum = "kingship" from šarrum = "king" or awīlūtum = "humanity, mankind" from awīlum = "(free) man, person".
Thus, by analogy, pāqidūtum can be fairly regularly and transparently analyzed as "providership" or "the role of a pāqidum".
Answer: pāqidūtu(m) is the nominative plural of pāqidu(m), the active participle of the verb paqādu "to entrust etc."
(In theory it could also be an abstract noun in -ūtu, as suggested in the other reply, but such a word, if it existed, would have merited a separate entry in the lexica. Also, the fact that the author does not introduce this suffix until a later lesson indicates that he would not expect students to know it at this point.)
Comment: thank you very much! is the t indicating that it is a female nominative?
Comment: @maxE. No. Adjectives have the masculine plural ending -ūtu instead of -ū.


What does it mean to 'turn pro' in a sport?

Question: In tennis (and for golf too, I believe), players are said to turn pro after a few years of Challenger and lower-grade Tennis.
What does the phrase mean?
Answer: It's a bit of a nebulous term, really. I am not familiar with the world of golf enough to speak on the details of "turning pro" in that sport, but in tennis it really just boils down to two things:

You have requested and been given an IPIN number by the ITF
You are playing in an ITF, ATP or WTA event (Futures, Challengers or Tour level event) and you are accepting any prize money you might earn from your participation in the event.

Some younger players (teenagers, typically) that are good enough to qualify for pro level events that pay prize money have to make a decision about whether to accept the money or not in order to maintain their "amateur" status in the sport since playing college tennis usually means you cannot have been considered a "pro" before.
Comment: Basically, yes. And playing at the college level doesn't mean you can't still "turn pro" afterwards. Also - a lot of the tournaments they would be playing - at least initially - wouldn't be paying out a whole lot of prize money. Futures and Challenger events typically only pay somewhere between 1,000-7,500 to the singles champion. For results like losing in the 2nd or 3rd round for the week, you're looking at a pay day of more like $300. So it's not like playing professionally instead of going to college means you're going to make enough $$ to cover the cost of the scholarship.
Comment: What advantage do they have by staying amateur and playing in college tournaments?
Comment: Well, a scholarship and the opportunity to get an education from that college, typically. Same as any other student athlete.
Comment: Oh sorry, I don't have too much idea about Univs and sports scholarships. So, it's either turn pro and earn cash from tournaments or study free at college?
Answer: It depends on the sport; some have very strictly defined rules for "amateur" versus "professional". Golf is one of them, and I believe tennis also makes this distinction.
Basically, if you've ever been paid to play the game, or have accepted a prize for winning an event beyond a certain monetary value, you are said to have lost your "amateur status"; you are now a "professional" player, and cannot compete in events that are open to amateurs only, under threat of disqualification from the event, as well as possible criminal charges if by fraudulently competing as an amateur you win money or a prize.
There are some exceptions; there is a minimum prize value that triggers this change, so amateur tournaments can give meaningful, valuable prizes to players without causing those players to unwittingly "turn pro". Additionally, token payments for instruction, like "gas money" or buying your instructor a beer in the clubhouse, don't trigger loss of amateur status.
Additionally, an amateur player can, without any money changing hands, "renounce" his or her amateur status at any time. This is rarely done; typically a player will announce they are "turning pro" by accepting something that would invalidate their amateur status as a matter of course, such as taking the top prize at the U.S. Open or accepting a sponsorship deal.

In most other circumstances, being a "professional" simply means you're paid to play the game. Some make a distinction between "semi-pro" (yeah, you're paid to do it but you still need a "day job") and truly "professional" (you make enough that playing is your day job). A few sports will allow players who have previously played professionally to compete at lower levels, ranking players more on current skill level (so a 60-year-old former NHL player might be welcomed into a B or C-league hockey team), but others do still make the distinction that if you've ever played professionally, you can't go back.


How to make carts go up an incline?

Question: I've made some tracks and a cart but I can't figure out how to make the cart "go." It kind of glides along slowly when I put it down on the track and hop in, but does not have enough momentum to even go up a 1 cube incline.
Comment: With this: http://www.youtube.com/watch?v=wwXTQHlACE8 (also, any other way of building enough momentum, be it boosters, gravity or powered minecarts)
Comment: @Yourdoom I'm not sure if by "booster" you meant "powered rails" or the side-by-side cart trick that increases speed.  If it's the latter, I hate to break the news to you that boosters have been identified as a bug and are going to be fixed with next week's 1.6 update.  Rail systems everywhere will suffer :)
Comment: Yeah I meant powered rails, never gotten boosters to work (haven't tried much which might be the reason though :p). Slimes still work though :D
Answer: For a short term solution, a Powered Minecart is probably adequate if you're not going up severe inclines.

The extensive use of coal over long periods of time probably isn't worth it though.  If you are going to want to continue to use this setup for a long time, you should look into powered rails.  They're more expensive to create, but they also don't require any materials for continued usage.  If you go with powered rails, you will be interested to read this previously asked question
Comment: As I commented on the linked question, switches are a cheap and useful way to power the powered rails; you get to save your redstone for repeaters, wire and tracks, and the switch allows you to disable the booster without breaking a torch.
Answer: The answer your looking for, other than a powered mine cart, is a powered rail.
Answer: This might work:
https://minecraft.wiki/w/Powered_Minecart

How to make carts go up an incline?


What is the symbol rate achieved with raised cosine filter?

Question: The bandwidth of the raised cosine filter is w=0.5(1+r)Rs, where Rs is the symbol rate, and r is the roll-off factor. r=0 represents the Nyquist filter, for which Rs=2w.
Any higher value for the roll-off factor will lead increasing the bandwidth, what about the symbol rate? is the symbol rate transmitted using the raised cosine filter higher or lower than the symbol rate transmitted using the Nyquist filter? What about the bit rate in the two cases? I know that more bandwidth can support more bit rate.
Answer: When comparing communications systems with different pulses, it's convenient to keep either the bandwidth $B$ or the pulse rate $R_s$ constant.
Say you have a channel with bandwidth $B$. Then, using sinc pulses you could transmit at rate $R_s = 2B$ baud. Using (square root) raised cosine pulses with excess bandwidth $\alpha$, you could transmit at rate $R_s = 2B/(1+\alpha)$ baud.
Now, say you want to transmit symbols at rate $R_s$. When using sinc pulses, you would need a channel with bandwidth $B=R_s/2$ hertz. On the other hand, if using square root raised cosine pulses, you would need $B=R_s(1+\alpha)/2$ hertz.
The bit rate is a separate issue; given a rate $R_s$, you can achieve the same bit rate regardless of the pulse used simply by using constellations with the same cardinality.
However, given a fixed bandwidth $B$, the pulse rate $R_s$ obtained with raised cosine pulses is lower. In order to match bit rates, the raised cosine system will need to use a larger constellation.
Answer: The symbol rate is not changed by the roll off factor.  Consider the spectrum with no pulse shaping — the result in frequency is a Sinc function with the first null at $R$ where $R$ is the symbol rate (so the main lobe in frequency in that case has a null to bill BW equal to $2R$). The theoretical brick wall in frequency performance with an infinite duration pulse shaping filter (also as a Sinc but in time!) has a bandwidth in frequency equal to $R$. It is the implementation of realizable filters that leads to excess bandwidth over the theoretical brick wall limit and that doesn't change anything about the symbol rate itself.


Need help in creating a macro for extracting data from list of web url

Question: Need to write a macro for importing a table from all URLs present in column A of Symbols sheet, each URL table should be written to a new sheet with the sheet being named as per the names in column B of Symbols sheet.
Using the below formula to extract table information from URL, which is working.
=IMPORTHTML(symbols!A1, "table",1)
=IMPORTHTML(symbols!A1, "table",3)

A sample sheet URL is below.
https://docs.google.com/spreadsheets/d/1uJPjfAZLRCwafetbH4-nPJPSpTvvgixlFvGG6gYITBU/edit?usp=sharing
Need to customize a few rows and columns which are not required. I believe this can be done by recording a macro and copy-pasting those modification lines to macro.
Edit: I am able to achieve this in MS Excel, one click does the job of importing table, creating a new sheet, copying the table, little formatting. Want to achieve the same in googlesheets.
Answer: check the INDEX and ARRAY_CONSTRAIN functions (probably also QUERY and FILTER function too) which are able to trim off the input exactly as you need to.


Restoring Time Machine backup do a different user folder location

Question: I have a 27" iMac. Its original 1Tb drive failed a few days ago. I decided to replace it with a 2Tb drive and replace my CD/DVD drive with an SSD drive. The SSD drive is small - 128Gb. I intend to only have the OS and install apps there. All user data will be on 2Tb drive. Restoring all data on OS drive and moving it over is not an option - complete backup is 465Gb. Is there a way to force TM to restore my files where I want them?
Comment: I thought mapping /Users folder to my 2Tb volume would solve the problem. Unfortunately, TM seems to concentrate on the boot SSD drive as its prime restore target.
Answer: Simply mount your time machine backups volume then navigate to /Backups.backupdb//Latest.  Under there is your latest backup.  You can then copy and paste the files manually wherever you want them.


Session Handling in WCF with a Java Client

Question: What's the best way to implement Session Handling in a WCF Service if the client that is using the service is not a WCF client but a Java client ?
Is it possible to use the integrated Service model?
Thank you!
Dominik
Answer: The session is controller by the WCF service and how it is configured.  Set to an instance more of PerSession, that WCF object will last as long as the client proxy is in use and all calls on that proxy will be serviced by that object.


Idiom meaning let's leave it at that

Question: In Danish there is an idiom that litterally translates peace with that (fred med det), that indicates that the speaker wishes to end a discussion. Let's leave it at that has the same meaning but a different tone. Is there something closer?
Comment: The more common form of the idiom is _fred være med det_ 'peace be with it/that'. And it doesn't really mean that the speaker wishes to end a discussion as such; more that the speaker doesn't view the thing talked about as important enough to warrant discussing at any length, but more as a minor side issue or detail that can be left either way without really influencing the main point. The closest match I can think of in a comparable context in English would be something like, "whatever/whichever… but, anyway".
Comment: And of course a second, very common, usage is to indicate that some behaviour or topic doesn't bother the speaker, at least not enough that they want to bother being bothered about it, even if it is perhaps not entirely by the book. For example, "A lot of people go skinny-dipping in the lake here at night, and _fred være med det_. But when they start doing it in the middle of the day, with families with children having picnics right on the banks, then it becomes problematic." Can't think of an English idiom to match that sense off the top of my head.
Comment: Are you sure it can't be used to end a discussion (with no implication about its importance or unimportance)?
Comment: What's wrong with, 'Let's leave it at that'?
Comment: It's not used in an "I don't want to talk about it" kind of way, to end a discussion completely. It can be used more 'aggressively' in a dismissive way, but still in the sense "but that doesn't matter, it's unimportant; what I want to talk about is X"—more a case of ending a particular part of a discussion (seen as a digression) and steering the discussion towards what are to you more important parts.
Comment: I don't know. Maybe I feel the Danish phrase has a slightly jocular quality, which I like.
Comment: "That's it" or "that's all?"   Or, "that's all there is to it" if you want to be more explicit.
Comment: *give it a rest*
Answer: Let's agree to disagree
"The term 'agree to disagree' or 'agreeing to disagree' is a phrase in English referring to the resolution of a conflict (usually a debate or quarrel) whereby all parties tolerate but do not accept the opposing position(s). It generally occurs when all sides recognise that further conflict would be unnecessary, ineffective or otherwise undesirable. They may also remain on amicable terms while continuing to disagree about the unresolved issues."  Wikipedia
This phrase can mean anything from "I don't want to waste any more time arguing with an idiot" to "you have valid points, but I am not convinced and I like you too much to argue with you" depending on the tone of the speaker and how he/she tries to change the subject right after uttering the phrase.
Answer: How about the informal "end of story"?

end of story
phrase (informal)
used to emphasise that there is nothing to add on a matter just mentioned

Source: Google/Oxford Dictionaries
Comment: This is more harsh and asseverative than what I seek. (I don't want it to imply that the speaker is right.)

Idiom meaning let’s leave it at that


interlis/ili2gpkg: export to XTF with multiple geometries

Question: I am trying to export a XTF-File from a geopackage with ili2gpkg. The Interlis-Model is KbS_Basis_V1_4/KbS_LV95_V1_4. The data consists of point-features (table "belastete_standorte") from which some also have an additional polygon-geometry (table "polygonstructure"). The data export via
java -jar ili2gpkg.jar --export --models KbS_LV95_V1_4;KbS_Basis_V1_4 --dbfile kbs.gpkg kbs.xtf

passes without errors, but when reimporting the XTF-file the features only appear with point geometries. I suspect that I am missing some export option that states the data consists also of polygon geometries.
For creating the scheme I use:
java -jar ili2gpkg.jar --schemaimport --dbfile schema.gpkg --models KbS_LV95_V1_4;KbS_Basis_V1_4

I am using version 4.3.0 (2019-09-20).
Answer: The problem is solved: There has been a polygon in "polygonstructure" without a correspondent feature in "belastete_standorte".


Are there alternatives to using polynomials in defining the different notions of efficient computation?

Question: Is invoking polynomials in defining the different notions of efficient computation the real obstacle to resolve the P vs NP problem? Do we need a paradigm shift by redefining what constitute an efficient computation?
Answer: From the very beginning $P$ has drawn flak for allowing high degree polynomials to count as efficient (Edmonds essentially introduced $P$ to argue that his $O(n^4)$ matching algorithm should be considered efficient, but for computers in 1965 $O(n^4)$ was definitely not efficient), but there are very good reasons that the definition has stuck:

Polynomials have nice closure properties.  If $O(n)$ is efficient, and we allow an efficient algorithm to call an efficient subroutine a reasonable number of times, we are forced to conclude that $O(n^2)$ is efficient too, and iterating this reasoning leads us to conclude that $O(n^c)$ is efficient for all $c$ if we want to avoid a totally arbitrary cutoff.
$P$ is robust to changes in the underlying model of computation.  Complexity theory is about what problems are solvable in some reasonable model of computation.  There are a huge variety of equivalent models of computation that can simulate one another in polynomial time (Turing machines, register machines, stack machines, and other stranger models) and tons of variations (how many tapes does your Turing machine have?  How many states?), and we have no real reason to favor one over another.  If we design an algorithm for a RAM but need to preserve our definition of efficient from model to model, then we need to allow polynomial overhead for simulation.  Aliens may well have computer totally different from anything we have imagined, but their definition of $P$ would be the same.
$P$ is robust to technological advancement.  History has shown that computer science research that is not future-proof will quickly lose its relevance.  Over time, as computing power has increased, the definition of "truly efficient" has expanded to include larger polynomials, but $P$ has remained relevant.
In practice, problems requiring high degree polynomials are actually rarely an issue.  Generally, the difficult step is getting from exponential time to some polynomial, and once we have an algorithm in $P$ it is relatively easy to reduce the degree to something small.  There is an old joke that I have heard in several talks: "every time someone proves a problem is in $P$ Bob Tarjan makes it linear."
Comment: But let's not forget the Deterministic Time Hierarchy Theorem, which implies that for any $k \ge 1$ there exist problems in P that _cannot_ be solved in $O(n^k)$ time.  In particular, I'd like to see a linear time algorithm for Gaussian elimination, or a general linear time algorithm for recognition of hereditary graph classes...
Comment: Funny anecdote, and a good list defending our old friend P.
Answer: We are so far from $P \neq NP$ that the use of polynomials in running time is not the primary obstacle to lower bounds. The main obstacle is much more basic than this.
The most natural alternative to polynomials of $n$ that I have seen is quasi-linear functions of $n$, that is, functions of the form $f(n) = n (\log n)^{O(1)}$. One can define quasi-linear complexity classes that are analogues of $NP$ and $P$, i.e.
$NQL = \bigcup_{c \geq 1} NTIME[n (\log n)^c]$ and
$DQL = \bigcup_{c \geq 1} TIME[n (\log n)^c]$,
and now the question becomes whether $NQL = DQL$. (For simplicity, let's fix the model of computation to be random access machines.) We have $P \neq NP$ implies $DQL \neq NQL$, and indeed this looks like a much weaker question. For a reference, see

Ashish V. Naik, Kenneth W. Regan, D. Sivakumar: On Quasilinear-Time Complexity Theory. Theor. Comput. Sci. 148(2): 325-349 (1995)

However, the $NQL$ vs $DQL$ question is still open. We cannot even rule out a linear time algorithm for SAT. So even if we severely restrict the running time of our algorithms, we are still lost as to how to prove a nontrivial time lower bound for SAT.
Comment: Or, in other words, it's not the "P" bit of P?=NP that is the trouble.
Comment: And in fact NL versus L is open as well.
Answer: Polynomials are involved in the notion of efficient computation due to Cobham and Edmonds, who proposed polynomials as a robust class.  (Alan Cobham, The intrinsic computational difficulty of functions, Proc. 1964 International Congress for Logic, Methodology, and Philosophy of Sciences, Y. Bar-Hellel (ed.), North Holland, 24–30, 1965; Jack Edmonds, Paths, Trees, and Flowers, Canadian Journal of Mathematics 17, 449–467, 1965.)
Around the same time, Hartmanis and Stearns proved fundamental results including the deterministic time hierarchy theorem: this shows that there are decision problems that can be solved in polynomial time, but that require the polynomial time bounds to be of arbitrarily large degree.  (J. Hartmanis and R. E. Stearns, On the computational complexity of algorithms, Transactions of the AMS 117, 285–306, 1965.)
There are of course other notions of "efficient computation".  Schnorr and later Gurevich/Shelah explored quasi-linear time, a robust class based on notions of realtime computing.  NC for many years was regarded as capturing the notion of parallelisable computation.  LOGCFL is another natural class, of languages that are logspace-reducible to languages generated by context-free grammars.
I personally tend to agree that polynomial-time computation is the wrong notion of "efficient": I don't think we really want to consider problems that provably require $O(n^{1000})$ time to decide as being efficiently computable.  The Cobham-Edmonds thesis seems to be that polynomial-time is an upper bound: for truly efficient computing, we want to look for a class that is contained in P.
(I would greatly appreciate a pointer to the Cobham paper online, if anyone knows of one.)
Comment: Thank you for this answer. It's well thought out and very thorough. Of course, it leaves the question about P vs NP unanswered. But since the answer is easily "no" and because I'd never heard of the Cobham-Edmonds thesis I've upvoted. Cheerio!
Comment: I'm not going to step into the P vs. NP quagmire right now...
Comment: I don't blame you. :-)
Answer: This is an old question; I hope thread necromancy is not considered poor etiquette around here.
The previous responses have focused on justifying why P and hence NP are natural classes from a complexity-theoretic point of view: it's the transitive closure of the class of linear-time problems under various natural operations, and so on.
A completely different angle on the nature of NP comes from logic. In Fagin's paper Generalized first-order spectra and polynomial-time recognizable sets he showed that the languages in NP are exactly those that can be defined by an existential formula in second-order logic.
The connection between complexity theory and logic goes way back: Ackermann's function famously cannot be proved total in primitive-recursive arithmetic, and there is a general principle in ordinal analysis whereby the strength of a formal system is related to the growth rate of those functions it can prove total. However, Fagin's analysis is still startling. If there was ever any doubt in your mind that NP is rightfully the centerpiece of complexity theory, his paper should dispel all trace of that.
Comment: (Successful) necromancy is rewarded with a badge.  So SE certainly seems to think it is OK.


No clean solder VS no clean, water soluble

Question: Is there a difference between "no clean" and "no clean, water soluble" solder? I am being told there is no difference but I find the "no clean, water soluble" harder to use.
Comment: Possible duplicate of [What does "no clean" solder actually mean?](https://electronics.stackexchange.com/questions/186069/what-does-no-clean-solder-actually-mean)
Answer: No-clean flux is very difficult to get off of boards, and is not recommended if you need the boards to be 100% clean (ie. if you need to apply a conformal coating to the board).  No-clean water soluble means that you can clean the flux off of the board with a water wash process if needed.
If your boards are for hobby or light industrial use where no-clean flux residue is OK, I recommend just using no-clean flux.  If you plan to apply a conformal coating, I would recommend using no-clean water soluble flux and cleaning the board with a wash process before applying the coating.
Answer: AFAIK, "no-clean" refers to the flux in the solder not needing to be cleaned off a board, whereas "no-clean, water-soluble" means it can be cleaned with just water rather than requiring harsh solvents. The only difference is the composition of the flux, so if you don't particularly care about cleaning, use whichever you find easier to use.


How would a world occupied by just teenagers occur?

Question: My story is set in a post apocalyptic setting where there are only teenagers and children. Also, cities are overrun with knee high grass and large lakes. Animals have evolved and have gotten more dangerous. A literal concrete jungle. Technology is very primitive again. Some teenagers though have mutations with give them powers that are dangerous to everyone even themselves. I'm thinking diseases or something.
Comment: The adults left to preserve their sanity, I suspect. :-)
Comment: Or Star Trek Season 3: [*And the Children Shall Lead*](https://en.wikipedia.org/wiki/And_the_Children_Shall_Lead)
Comment: Every person, on his/her 19th birthday, must walk out into the corn, never to be seen again. Bad Things happen every time someone tries to avoid this.
Comment: Accept for the mutation powers sounds like you're writing [The Tribe](https://en.wikipedia.org/wiki/The_Tribe_(1999_TV_series))
Comment: + for "overrun by large lakes"
Comment: I strongly disagree that this is a duplicate of the linked question. In the linked question, society will be **eventually** dominated by physically young, mature-minded people. In this question, there will never be mature people, and society will consist mostly of children.
Comment: @user535733 That was a really good episode, I wish that they had done an updated version in the later iterations of the show. Now that I think about it, they actually *did* kind of do that in Star Trek Voyager.
Comment: Planet of Eternal Spring Break collides with Planet of the Baby Sitters
Comment: @user535733 or Logan's Run
Comment: If not a dup of what I indicated, it's probably a dup of [this](https://worldbuilding.stackexchange.com/q/7168/40609) or [this](https://worldbuilding.stackexchange.com/q/94952/40609).
Comment: [Maybe like this?](https://worldbuilding.stackexchange.com/q/19487/2235)
Comment: Are the lakes predatory, or merely ambulatory?
Comment: I also strongly disagree with this being closed as duplicate... though TBH I don't entirely understand Alexander's comment. The alleged duplicate asks what such a society would be like. This asks how such a society might come into existence. Those are *clearly* different questions.
Answer: from OP:  /Some teenagers though have mutations with give them powers that are dangerous to everyone even themselves. /
The older you get, the more powerful you are.  And the more dangerous you become.
The powers grow.  Just when a teen has got the hang of it, the volume goes up and new powers sprout.  These powers are tempting to use but risky, because your abilities will have increased since the last time you used them.
Teenagers wind up dying in accidents, or during a dream.  It can be messy.  Some teens leave to protect the people they care about from themselves.  There may be some adults roaming the wild lands, alone and mentally unhinged from the godlike powers raging inside them.
Comment: wow this is great
Answer: Aliens want pets
Aliens want all sorts of exotic pets. They do, however, have an Animal Rights Society, that guarantees the treatment of all semi-sentient creatures.
Some evil Alien smugglers want to obtain these pets illegally, and to get away with their evil schemes, they biologically engineer a 'plague' on Earth that guarantees any human over a certain age dies. In the ensuing panic, no one will ever notice if a few mature adult humans are abducted. As to why they don't take children, they have enough adults to choose good ones from, and are constantly monitoring the situation. Why train them when they'll train themselves?
To make the pets even more useful, they have injected humanity with superpowers, and they will be watching for those who end up manifesting exotic powers...
Who knows, though, whether these evil aliens will have it their way forever? After all, teens will always rebel.

A more serious answer (but this works with the alien idea too!):
Superhuman Disease
A disease has manifested, which causes humans to exhibit super-powers. Humans, upon receiving the disease, will find that their appendix's potential has been unlocked, and is now capable of passively generating huge amounts of energy, and they can use this energy to cause various phenomenon (How this grants them superpowers can be explored in other worldbuilding answers).
The issue here, is that with age, the organ's ability to control the energy deteriorates as the organ starts to lose function. As a person passes from their teens to adulthood, their ability to control the energy slowly decreases, until there is no longer any way to control the energy anymore.
At this point, the body begins to break down, unable to bear the massive amounts of energy. Thus, there are very little humans who make it past their teens.
The only way to survive is to grasp the methods of controlling the energy within when their organ is fully functional, and this is much easier for people in the their childhood periods. These people with excellent control will have relatively longer lifespans, being able to handle more energy than the non-ability users. Someday, however, they will also be unable to handle the energy within, and their body will start to break down as well.
Answer: A shock shortage of resources in a demographic that has a significant fraction of people over 20 means that, realistically, on a small proportion of the population can survive long term. In such a case, a society could decide to sacrifice those older than a certain age for the survival of those younger. It's conceivable that the stress is so bad that one has to make that certain age very low, and that there would be a high enough fraction of those left in their late teens that society judges that these late teen people could afford the leadership and nurturing needed to keep society going.
Of course, not everyone is going to agree to this plan, so you would need to flesh the details out. Some older people would be compelled if the culture were extremely society-focussed so that a vast majority of the older generation would decide for the altruistic alternative. You might have an extremely high proportion of people in the demographic who have below-20 aged children.
Indeed, the above idea is not original, something very like it is the basis of the 1967 novel "Logan's Run", by William F. Nolan and George Clayton Johnson and the 1976 Film and TV Series grounded on this book.
Answer: A more virulent for of coronavirus has swept over the world. In children and teenagers the disease is almost asymptomatic, while in adults over 20 years of age is has a very high fatality rate.
This world, though, would have a rapidly declining population (assuming there's no modern level medical care) because teenagers can't reproduce fast enough to compensate for the population loss.
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/105933/discussion-on-answer-by-alexander-how-would-a-world-occupied-by-just-teenagers-o).


how to set hostname via DHCP in Ubuntu 20.04 or 18.04?

Question: I'm new to the systemd world (and Ubuntu in general), but I tried to dig as deep as I could to try to answer this question myself, but not really getting anywhere.
I'm setting up VMs for both Ubuntu 18.04 and 20.04, and trying to have the hostname automatically set via DHCP. I can't seem to get it to work.
I guess one issue is that I'm not sure my DHCPd (Infoblox) is actually sending the hostname field in the DHCPv4 request. This is due to the fact that if I check on the /run/systemd/netif/leases/* file, there is no HOST* field. The netplan documentation seems to suggest that if the lease includes HOSTNAME, then by default the hostname should be set (use-hostname is true by default). I've also tried removing the /etc/hostname file which didn't do anything.
Has anyone successfully gotten their bionic or focal Ubuntu server's hostname set via DHCP? Anything special that needs to be done?
Answer: Disable cloud-init service:
sudo touch /etc/cloud/cloud-init.disabled

Delete file /etc/hostname:
sudo rm /etc/hostname

Remove line with 127.0.1.1 in the file /etc/hosts
Reboot
Comment: Could you elaborate further on the diabling of the cloud-init -- would this be post-install?
Comment: I'm running 20.04, and these steps did not work.


Can i still get my certificate of employment after i took them a year ago?

Question: Can i still get another COE from my previous company after a got one a year ago? I was planning on getting one this month because i can't seem to find it anywhere since it was a year ago is there any expiration to it?
Comment: Welcome to the site - could you give us your location? That might have a bearing on the answers.
Answer: This might also depend on your countrys law, but in most countrys the COE can only be demanded while you work or shortly after you leave the company. This is due to the circumstance that also other employments might change and no one might know what you did exactly. A mere confirmation can but often be achieved without further troubles.
My suggestion: Call the company and if possible the person you got your last COE from, surely this person still has a copy or might write you a new one. If you never got a COE or the old one is lost, tell them you will write the COE and send it to them, if they want to change anything you will frankly accept it and be happy about it. Stay positive and friendly throughtout the conversation! (If you do all the work they most likely will just sign the paper without changes and everybody is happy!)
Answer: Your certificate of employment (issued by the employer) should never expire as your employment during the relevant period is not something that will change over your lifetime.
Regarding the lost certificate, check with your former employer (I suggest emailing HR) and your declaration that you lost the original certificate should be enough for them to issue a duplicate. Since the matter on such certificates typically follows a template, it should not be a big deal for them and the new certificate for all purposes should be exactly identical to the previous one other than very few details like the issue date, the signature(s) and perhaps a note that this is a "duplicate" issued as per your request. If you happen to have a copy of the original certificate, that will make matters easy for everyone involved.
If the original certificate had some customized details which only you and your immediate team/boss knew about, that may pose a problem because you may not get an identical one especially if the current management is not aware of those details.


How to fix the Cairo Dock?

Question: I have been trying to replace Unity with Cairo Dock, and I am almost there! The only question I have is how can I turn off the Cairo Dock Auto Hide, so as to fix it in place no matter what?
Answer: I may be preaching to the converted but here goes:
Right click on Cairo, select Cairo Dock > Configure
On the Configuration>Behaviour tab:

Visibility: Keep the dock below
Visibility: Appear on mouseover.
Behaviour of Taskbar: integrated or separated depending on what you prefer.

Click apply and close.
Click the Applications menu, find Startup Applications.
Answer: You need to use the "Reserve space for the dock" option. It fixes the dock in place, doens't hide it, nor does it interact with open windows.
Right click cairo dock > configure > behavior and select "Reserve space for the dock" as visibility value.

How to fix the Cairo Dock?


I am transit passenger and turkish airline will provide hotel, how much time it takes to get visa at the airport?

Question:
Is it too long line for transit passenger to get visa (Turkish airline and I am canadian)?
Is there any pharmacy inside Istanbul airport to buy medicine?
Comment: If you have another passport besides Canadian you might want to use that instead; the visa fee may be lower.
Answer: 1) If you apply for an E-visa online before you fly, you will be able to join the immigration queue immediately:
. https://www.evisa.gov.tr/en/
2) Pharmacy - Günay Eczanesi. Location: International Terminal, landside, Arrivals.
https://www.sleepinginairports.net/europe/istanbul.htm
This was a question for Google. Not Stack Exchange.
Answer: From the airport perspective you are not a transit passenger if you are intending to go to a hotel, you are an arriving passenger.  This is important because if you were a transit passenger you would not need a visa, however as an arriving passenger you do.
For Canadian citizens you can either obtain an e-visa in advance by going to https://www.evisa.gov.tr (cost US$60) or you can obtain a visa on arrival (cost US$70).  The visa-on-arrival option requires you to first go to a separate area to obtain/pay for your visa, and then return to the normal arrivals immigration queue.
The line at the visa on arrival queue is generally fairly short, but the lines at immigration itself are frequently very long, so even if it only takes 5 minutes to obtain your visa, that could easily add 20+ minutes to your total time due to you joining the immigration queue later. For this reason (plus the lower cost) getting an e-visa in advance would be strongly recommended!
Once you pass through immigration and collect your bags, you will proceed to the Turkish Airlines Hotel counter (turn right and head towards Starbucks - it's about 20 metres before it on the right).  Keep in mind that it could take a further 30+ minutes or more to arrange the hotel and then wait for the shuttle.
And yes, there is a pharmacy landside at Istanbul Ataturk airport.  It is located on the departure level, so you will need to go from the arrivals level up to the departure level, then back to the arrivals level to get to the hotel desk.  (Do NOT try and go to the hotel desk first as you will likely miss the shuttle bus they arrange for you to the hotel)
Comment: This answer is so natural it makes you feel like you're there and going through this process. +1
Comment: @HankyPanky That's probably because I have been there and been through that process multiple times :)


Confusion with using different classes in neural networks (training vs testing)

Question: I am new to deep learning and I am confused about having a neural network trained on certain classes and tested on different ones. Suppose I want to have a convolutional neural network that learns authorship attribution (Identifying the author of a certain text). For example, this model is trained on 10,000 authors/classes over hundreds of thousands of texts. How does the model generalize what it learnt to predict the author of a new author/class in a test set? Will it not be trained to identify the authors it was initially trained on and not the new one? For example, a CNN that learns whether an image is a cat or a dog is trained as such and when testing it predicts the same classes.
Answer: You are correct, most models in general don't perform well when asked to predict something they haven't seen before. Normally when you are splitting the data into Train and Test datasets, you want to include all examples in each dataset. In the train_test_split library, stratify is used to do this for you.
In the real world, sometimes the new class is not available during training, such as if you are predicting future data that may have a new label. When this occurs, typically your model won't categorize that correctly until you have built up several examples of that data and then rebuilt your model including these new examples in your dataset.
In the meantime, you can try to create a category named "other" and train your model to use this category when it can't categorize into a known class.
Answer: It will not
In a very simple language, the model learns the characteristics in terms of the feature and map to result that you provide as a class. That mapping can be very simple or very complex(a big neural network)
What ever data it will get, it will divide the full space and everything will be mapped to a Class.e.g. >10000 will be mapped to Class-A depending on the data, so it will predict Class-A even for 1Mn unless you train with new data for >10k-20K-Class-a, 20k-30k-Class-b etc.
In your case, it will predict the Author which is nearest to the new Author in terms of the type of work.
 Using "Other as a Class" will only work when both the data and class are new.
e.g. If the model sees the data is matching 80* with Author-A, it will predict Author-A with 0.8 confidence and you will have to accept it but in real-life the author is different but the model didn't have distinct data during training.
"Other" can help if the data is for a new type of Author and model is not much confident for any of the Author.
On a lighter note - My 3 years old kid was very confident in identifying a Kingfisher's image as a Parrot. This was his first interaction with Kingfisher.


How do I make a transparent canvas in html5?

Question: How can I make a canvas transparent? I need to because I want to put two canvases on top of one another.
Answer: Canvases are transparent by default.
Try setting a page background image, and then put a canvas over it. If nothing is drawn on the canvas, you can fully see the page background.
Think of a canvas as like painting on a glass plate.
To clear a canvas after having drawn on it, just use clearRect:
const context = canvas.getContext('2d');
context.clearRect(0, 0, canvas.width, canvas.height);

Comment: So much for standards, as usual.
Comment: I think these answers are missing the point. Similar to the above question, I want to have two layered canvases: the bottom one has a static image, but the top one will have animated sprites. This top layer needs to have a transparent background, but also has to be 'cleared' and redrawn with every animation frame. Yes, it starts transparent by default, but how do you reset it to transparent and the start of every new  animation frame?
Comment: Canvas has a black background on mobile so layering canvases doesn't work there. (At least on Chrome for Android)
Comment: This is how to clear a canvas anytime : http://stackoverflow.com/questions/2142535/how-to-clear-the-canvas-for-redrawing
Comment: Since you got soo many upvotes Can you at least answer the question too? How do you make a non transparent canvas transparent?
Comment: I ran into problems because I was using  instead of . Only the latter works.
Answer: I believe you are trying to do exactly what I just tried to do:
I want two stacked canvases... the bottom one has a static image and the top one contains animated sprites. Because of the animation, you need to clear the background of the top layer to transparent at the start of rendering every new frame. I finally found the answer: it's not using globalAlpha, and it's not using a rgba() color. The simple, effective answer is:
context.clearRect(0,0,width,height);

Answer: Iif you want a particular <canvas id="canvasID"> to be always transparent you just have to set
#canvasID{
    opacity:0.5;
}

Instead, if you want some particular elements inside the canvas area to be transparent, you have to set transparency when you draw, i.e.
context.fillStyle = "rgba(0, 0, 200, 0.5)";

Comment: FYI: `opacity` changes will have no effect if there is a background fill in the canvas.
Answer: Paint your two canvases onto a third canvas.
I had this same problem and none of the solutions here solved my problem. I had one opaque canvas with another transparent canvas above it. The opaque canvas was completely invisible but the background of the page body was visible. The drawings from the transparent canvas on top were visible while the opaque canvas below it was not.
Answer: Just set the background of the canvas to transparent.
#canvasID{
    background:transparent;
}

Comment: This answer does not work in all situations, context.clearRect(0, 0, width, height) is the solution that worked for me
Answer: If you're exporting your canvas, remember to export as png!!
Been there, failed at that xD
Comment: This!!!! I've been hitting my head here hours and the issue is that I was exporting as jpeg. Blerg.
Answer: fillStyle might not be what you are looking for because it can't really clear the canvas; it will either paint it with a solid color or with a transparent color which doesn't paint anything.
The trick that did for me relies on an implementation detail about the <canvas></canvas>. They "reset" when resized (tested on Chrome and Firefox):
canvas.width = canvas.width

This phenomenon initially struck me as a very annoying behavior, but it also became the only way I know to hard reset the canvas.
Answer: Here's a minimal proof of concept of the default transparency of canvases, and using position: absolute to stack them on top of each other:

const canvases = [...Array(4)]
  .map(() => document.createElement("canvas"));

canvases.forEach((canvas, i) => {
  document.body.appendChild(canvas);
  const ctx = canvas.getContext("2d");
  const saturation = 100 / canvases.length * (i + 1);
  ctx.strokeStyle = `hsl(160, ${saturation}%, 60%)`;
  ctx.lineWidth = 10;
  ctx.strokeRect(i * 50 + 10, i * 15 + 10, 100, 80);
});
canvas {
  position: absolute;
  border: 1px solid black;
}
Answer: Can't comment the last answer but the fix is relatively easy. Just set the background color of your opaque canvas:
#canvas1 { background-color: black; } //opaque canvas
#canvas2 { ... } //transparent canvas

I'm not sure but it looks like that the background-color is inherited as transparent from the body.


How to turn the white colour portion to transparent

Question: I got this map icon in work in illustrator, and would like to turn those white dash line and the white outline of the location mark to transparent. Can you please advise me how to do it? Thank you in advance.
Answer: Okay, the answer given by Chris is pretty legit but it seems like you are quite new to illustrator ...So this is somewhat detailed explanation

So in your particular case, both dashed line and the outline of the map marker should be done in separate ways to achieve the effect you want
So let's start with the dashed line on the road,
Step 1: Select the dashed line ,then Object > Path > Outline Stroke .this will make your dashed lines to a single object
step 2:select objects of both road and the dashed line .Now you need pathfinder tools ( if it's not in you hud it can be turned on from window->Pathfinder)
 in this pathfinder window click the 'minus front' option (the marked one in the image below)

Icon of this tool is pretty self-explanatory ,it substracts top layer from the bottom layer
so that'll do the job for the dashed line

Now for the map marker ... The method is almost similar
Here you must select both 'Map Object' and 'map marker object' , select Object > Path > Outline Stroke
open layers and you will find that your maps marker will be changed to a group consisting of two objects one object of outline and other will be the fill color ..
here select the map object and the outline object or map marker .now do same as step two in the previous case..After doing this sometimes the order of layers may mess up,  so you could simply reorder it in layers menu (or by using the shortcut cntrl+[ or cntrl+] )
hope this helps
Comment: Bravo... Many thanks to you Jovis! You're very rigth, new chick here in Illustrator!
Comment: Happy to hear that it helped you...
Answer: Outline your strokes <code>(Object > Path > Outline Stroke)</code> so that the offset lines and the dotted lines become shapes and then use pathfinder (probably the minus front function) to knock those shapes our of the underlying elements. You may need to duplicate some of the shapes in place before applying the pathfinder tool. There are several ways to approach this so you may need to experiment a little, but the above steps will get you there.


Ensuring payment from client

Question: How can I ensure that I receive my payment from a client if I am working from home for an international client (not employment; a fixed-price job)? I want to ensure that I receive payment for my service. Should there be a contract that agrees that I will be paid? What if the client still doesn't want to pay? Thank you
Comment: If the client does not pay, you have to take the client to court. Alternatively, consider requiring that the money be placed in escrow.
Answer: Use some form of escrow agent:
Some freelancer sites provide payment escrow services (e.g. E-Lance). In this system the client puts money in escrow for the project in advance and then when they accept the project it forwards the payment to the provider.
Progress Payments
Arrange a progress payment approach with the client where they pay at certain milestones rather than a single payment at the end of the project. Ideally you would have them pre-pay for each milestone before you start work on it. However, you could ask for payment after each milestone, which might be easier to sell to your client. It does leave some risk, but minimizes that risk somewhat.
Answer: You should absolutely have a contract between you and your client stipulating the quid-pro-quos of the arrangement. They get the product, you get the money.
First off, this contract should specify what you must do, and what they must do, for the contract to be "satisfied". This isn't necessarily just product for money; your client may be under deadlines to approve the product in various stages of work in process. Depending on the product, the client may be required to provide starting materials (like existing logos/slogans for advertising/marketing graphics), information on or access to computer systems (for software or infrastructure consulting, or accounting auditing), etc.
Second, if you provide a tangible product like graphics or software, the contract should clearly state that "intellectual property transfers on satisfaction of contract"; they don't own what you have made until they have accepted it and paid you accordingly. If they try to stiff you by taking what you made them and using it before you've been paid, you can take them to the cleaner's for copyright violations.
Third, you should structure a payment schedule; don't do too much for free. You can get the money in thirds, for instance; a third up front, a third at some defined halfway point and a third on final delivery and acceptance.
Lastly, you should stipulate that the client is responsible for all expenses incurred by you as a result of their failure to pay as stipulated, up to and including attorney's fees.
Definitely have a lawyer draft these agreements; contract law is a many-layered area of law with hundreds of years of case law and slightly different nuances in every state. A competent lawyer will know things that can and can't be stipulated in a contract, and if you try to do it alone you'll wish you hadn't when the contract's tossed out by a judge because of some technicality.
If they refuse to pay, get the lawyer on the phone and file suit. A well-written contract drafted by a competent lawyer, which you have lived up to on your end, will give your client no loopholes to slip through. As far as recovering damages, it shouldn't matter whether he's in the U.S. or not; if he does business in the U.S. then he very probably has money in banks that have to listen to U.S. courts (or at least court orders).

Ensuring payment from client


Do I need a transit visa for layover in Italy?

Question: I am flying from Chicago to Istanbul and my flight will layover in Rome for an hour and a half. I am holding a US green card and am traveling with Iraqi passport. I am not sure if I will require an Italian transit visa or will I be fine since am not leaving the transit area? I tried the Italy embassy support line and they keep telling me to check the website and there was not a clear answer for that.
Answer: From this page, it would seem that you do not need an transit visa to transit in Italy.
Comment: This answer seems correct, why -1?


What area's of mathematics are needed to make a basic understanding of the FFT algorithm ?

Question: I know FFT is used in signal processing ( at last check), the Lucas-Lehmer Test and probably many other things. But what is the Fast Fourier Transform and what area's of math will help me understand transforms like it ( and yes I know of the area Fourier analysis, just not if anything about it)  I've read a little of the FFT wikipedia article and some on DFT etc. But I'm not even sure I understand them enough. and yes I know it's not for simpletons like me.
Comment: The algorithm itself, at its core, is just a straightforward divide-and-conquer algorithm: if you have a vector $x$ of length $2^n$; divide it into the two vectors of length $2^{n-1}$ consisting of the even-index and the odd-index elements; and calculate the Fourier transforms of these two vectors recursively - then a small amount of mathematics allows you to express the Fourier transform of the original vector in terms of the Fourier transforms of the smaller vectors.
Comment: You can understand the discrete Fourier transform (and the FFT algorithm) using only linear algebra.  I gave a short explanation of the DFT here: https://math.stackexchange.com/a/1944778/40119
Comment: so is karatsuba in theory but I guess I'm just too stupid right now.
Answer: First let me begin with a simple explanation of the fourier transform. It takes a signal from the time-domain to the frequency domain. This means that instead of seeing a sine wave we see a point on a graph. And because any real signal can be described as the sum of sines, we get many points, that if connected form a line graph in the frequency plot.
The Fast fourier transform is a mathematical trick that significantly reduces the time it takes to do a fourier transform significantly.
FFT algorithms require that you have samples in powers of 2, because they all divide the problem into tiny parts. The small parts are faster to calculate (here the discrete fourier transform formula is used), and the final result is combined from all the small ones.
So instead of doing 1 DFT of size 4096, it can do 256 DFTs of size 16.
The mathematical explanation is pretty advanced, check out the Cooley Tukey algorithm.
Answer: http://download.ni.com/evaluation/pxi/Understanding%20FFTs%20and%20Windowing.pdf
I used this for my senior thesis on signal processing. Just make an account and you'll be able to open the paper, it is very reliable.


Which database is good for automotive GPS tracker?

Question: we are developing a recording system for automotive gps trackers production of our company.
we log their data nearly 1 year and each gps node sends data to record each 5 seconds. each data contain about 50 bytes and we think nearly 5000 gps nodes we need to record in each server.
it means we have more than 20billion of records and nearly 1tbytes hard to save.
Can anyone help us which database is proper for such case?
We use mysql database now, but we think  it may cant handle after data increases.
Answer: For such type of data and such size will be good to use kind of NoSQL key-value database. This will give you option for better scalability in sense of disk space, paralleling search operations.
One possible option is MongoDB with very powerful select type command and very good scalability.
Other option is etcd which support extreme write speed (1000 records/s per host).


Topologies on topologies

Question: Let $(X,\tau)$ be a topological space.  Is there anything like "dual space" whose points are members of $\tau$?  Would there be a natural way to define the topology on $\tau$?
Comment: Um,... you just did?
Comment: This sounds like the beginnings of the construction of Čech homology/cohomology ...
Comment: @TedShifrin do you mean Stone-Čech compactification?
Comment: @fleablood to define a topology you have to specify the open sets, not just the points.
Answer: For one example, see the following paper and the references that Lorch cites.
Edgar Raymond Lorch, Continuity and Baire functions, American Mathematical Monthly 78 #7 (August-September 1971), 748-762.

(from bottom of p. 756) In order to penetrate further into this subject it is necessary to give an appropriate structure to $T,$ the set of all coherent topologies. As mentioned earlier, this appropriate structure is itself a topology. This circumstance, that a collection of topologies is topologized, may seem a bit incestuous.

I posted this reference and quote in my 3 June 2002 sci.math post Incestuous Mathematics, where you can find some other examples of a mathematical structure whose underlying set consists of elements each of which has the same (or very similar) type of mathematical structure. See also my 14 September 2006 sci.math post The metric space of metrics. Incidentally, an example that I did not know about back then is Gromov–Hausdorff convergence --- see, for example, Chapter 7 in A Course in Metric Geometry by Burago/Iwanow/Burago (2001).
Answer: In Stone duality, given a Boolean algebra $A$, the homomorphisms $\text{hom}(A,2)$ are the ultrafilters and make up the Stone space of $A$. Ultrafilters on $A$ is not the same thing as open sets, but they're related. And the sets that are both closed and open are in correspondence with $A$ again.
There are other versions of this duality. The $C^*$ algebra of continuous functions on a compact Hausdorff space. The embedding of a space into its Stone-Čech compactification. Maximal ideals of the continuous functions on a variety with Zariski topology.
Comment: I'm looking for something where the space with underlying set $\tau$ is, of course, related to the original space, but has potential to be different in some ways.
Comment: @ForeverMozart The space _is_ different than the topology. It's the topology on the topology that's the same as the space. Analogous to the double dual of a vector space. Ultrafilters is a topology on the topology.

Topologies on topologies


How can I use Sencha Touch 2 in a Rails 3 app?

Question: Sencha Touch 2 is a framework for writing web or native applications targeted towards mobile devices. See: http://www.sencha.com/products/touch/
I can make apps quickly that work out of the box under a standard LAMP install, but things quickly fall apart when I try and use Sencha with Rails in an active, existing project. Additionally, I can't have it sit in the root directory like most tutorials would like you to do.
I've configured the code enough to allow the app to sit at m.example.com/ and have its resources exposed via example.com/sencha/app (app.json), example.com/sencha/js (sencha-touch.js), and example.com/sencha/css (sencha-touch.css).
I can load my app in my browser by including the bootstrap js in a Rails view, but I'm merely greeted with the blue screen and 3 flashing dots. There are no errors in the Chrome console, and nothing else happens.
Tutorials on the web are scarce, and I've worked through most of them on separate occasions, but they're all for Rails 2 that I've seen. I tried

http://mikehoitomt.wordpress.com/2011/03/10/sencha-touch-application-with-ruby-on-rails-part-1/ and
http://blog.joshsoftware.com/2011/12/14/sencha-touch-mvc-with-rails/

But I've also seen the question Sencha Touch Rails 3.1, so I know someone has made it work, somewhere.
Where can I find help on making Sencha Touch 2 work in existing Rails 3 apps?
Answer: Try it under Safari or check the Chrome console for errors.  I think Chrome gives an error in the basic setup related to security:
Phonegap + Sencha + Android : ajax request with a basic access authentication failled
In this question, I use an index.html that points to a Sencha Touch 2 CDN.  This is all you need to set up ST2.
Creating a 2x2 Button Grid with Centered Buttons?


What is the 'cock's crow'?

Question: Another question of semantics - was the cock's crow which Jesus prophesied Peter would hear before he betrayed Him thrice, the crow of a rooster or a trumpet blast which happened every 3 hours, or so.
Comment: this could be a good question, but it's a fairly low quality post as it stands. Typically on SE on general, I expect to see some work put into grappling with the question. There should probably be some elaboration, some reasoning why you'd think that it's not meant literally, and a Bible quote.
Comment: Not sure why I received a down-vote.  I have heard scholors state that loose fowl would not be permitted in the temple complex (because of the risk of becoming unclean due to their waste).
Answer: A cock's crow can be heard from a long distance, depending on various factors, so there is no reason to assume the bird was within the temple area. Given it could be simply and literally a cock's crow, there seems to be no logic in searching for another, more complicated explanation, which would need to be backed up by strong historical evidence to have, in my view, any credibility.
Comment: As well, based on [Matthew 26](http://www.biblegateway.com/passage/?search=Matthew+26&version=NASB), Peter was in the courtyard of the High Priest.  However, this might not have been within the temple complex.  (It was somewhere that a servant girl was permitted, at least.)  And in any case, the Old City of Jerusalem really wasn't very big.
Comment: As one who has chickens, I suggest that the miracle was that a rooster could be silent long enough for Peter to say three sentences! Those things are loud and unlike what you see in cartoons, they crow all night long.
Comment: @AffableGreek Thats funny i live with chickens and they dont cry all night otherwise wed kill em...They start at around 4.30..!
Comment: ["residence was connected to the temple complex by an overhead causeway"](http://www.biblesearchers.com/yahshua/passovertrial/arrestinterrogation.shtml) suggests it was not - though I've no idea how reliable this source is
Answer: This is a good question because the Mishnah (m.Bava Kamma 7:7) states that:

אין מגדלין תרנגולים בירושלים.
We may not raise chickens in Jerusalem.

The reason for this is not the dung directly (dung is not actually ritually unclean). But there is a concern that the chickens may contaminate the sacrifices with the unclean creatures they might drag out of the dungheaps. (Remember, some sacrifices were eaten anywhere in Jerusalem, not just the Temple courts.)
"Cock's crow" is a technical term in Jewish law: kri'at hagever (קריאת הגבר). It is a time of day prior to dawn that marks the end of night.
The Mishnah (m.Yoma 1:8) describes how the removal of the ashes form the altar in the Temple was performed:

בכל יום תורמין את המזבח בקריאת הגבר או סמוך לו, בין לפניו בין לאחריו.
Every day they would remove the ashes at kri'at hagever or around that time, before or after.

In the Gemara (b.Yoma 20b) there is a disagreement as to whether the term kri'at hagever literally means "call of the man" or "call of the rooster":

מאי קריאת הגבר? רב אמר קרא גברא, רבי שילא אמר: קרא תרנגולא.
What is kri'at hagever? Rav said, "Call of the man." Rabbi Shila said, "Call of the rooster."

The Gemara continues by explaining that they are both right. In the Temple precinct, there was a Temple crier who called out to begin the service. Everywhere else, the time would be determined by an actual rooster crowing.

גביני כרוז מהו אומר ־ עמדו כהנים לעבודתכם ולוים לדוכנכם וישראל למעמדכם, והיה קולו נשמע בשלש פרסאות. מעשה באגריפס המלך שהיה בא בדרך ושמע קולו בשלש פרסאות, וכשבא לביתו שיגר לו מתנות.
Gabbini the Temple crier--what did he say? "Rise up, O priests, to your service, and Levites, to your platform, and Israelites to your posts!" His voice was audible for three parasangs. Once it happened that King Agrippa was going along and heard his voice from three parasangs, and when he got home he sent him gifts.
Comment: +1 very interesting answer. I've never heard that this idiom might actually refer to something other than a rooster.
Comment: No, the Temple crier would call out the proper times for various events throughout the morning.
Comment: So, Aaron, how do you understand the cock's crow occurring three times? Does that mean three dawns?
Comment: On a early morning when its very still you can hear a cock from 3 Km...!
Answer: Cock's crowing Instead of running to the Jewish customs, or to the barnyard for an answer, no matter how interesting, or possible, we need only turn the pages of the Bible to find an answer!
Watch ye therefore, for ye know not when the master of the house cometh: at even, or at midnight, or at the cock-crowing, or in the morning... Mark 13:35
The land of Judea--and Jerusalem--was under Roman control and customs.  One such custom was the night "watches," when the trumpet was blown at each watch. The melody of the tune played changed with each watch, so the town would know approximately what time it was.  Jesus was merely referring to the third watch of the night, showing how quickly Peter was going to betray Him.  The Gospel of Mark listed these watches for us.
HISTORY The Jews, historically, had three watches of the night: (1) Beginning of the watch-Lam. 2:19 (sunset to 10 pm), (2) Middle watch-Jud. 7:19 (10 pm to 2 am), (3) morning watch-Exodus 14:24 (2 am to sunrise).
But when the Romans conquered Israel, the 4 watches of the Roman time were implemented: these are listed in Mark 13:35 (see above).  It is of little doubt that Jesus was referring to the Cockcrow of the Romans when He confronted Peter with his humanity. This trumpet blast would be heard throughout Jerusalem overhead, and in the depths of Peter's soul within.

What is the 'cock's crow'?


Why Magento Cloud doesn't show product's image in the admin, but showing it in the frontend?

Question: I'm adding product images in the admin panel, but after save it's not showing the image in the backend.
The result is 200 and opening it in a new window the image is blank, what could I do?
Answer: By looking at the details you provided and the screenshot.
Fastly IO is turned on, but it looks like your Screenshot has a response header:
fastly-io-error: not a supported image format

What is your source image format?
Does it have valid image data? (some corrupted images returns responses like this)

I think that would be a good place to start the investigation.

Furthermore, when I checked it in my sandbox, It should render like below.

Fastly IO is turned ON: Header fastly-stats: 1
Fastly IO info is valid: fastly-io-info: ifsz=*** ...


"Citizen Patrol" badge mis-titled

Question: The explanation for the "Citizen Patrol" badge is simply "First flagged post", which is admirably concise, but wrong.  It should be "Flagged first post", because the badge goes to the flagger, not the poster. (And yes, I was genuinely confused when I first read it.)
Answer: Some of the badge descriptions describe the object of the action that causes you to get the relative badge; for example:

First rollback: The rollback has been done by you, not from somebody else on your posts.
First down vote: The down-vote has been done by you, not from somebody who down-voted one of your posts.
First edit: The edit has been done by you, not from somebody who edited one of your posts.
First retag: The retag has been done by you, not from somebody who changed one of the tags used in one of your question.

The description of the badge is intentionally not clear because, as Jeff Atwood said:

Badges are supposed to be a little mysterious; you should view them as minor puzzles with obvious hints.

What activity is this badge referring to?
How do I perform this activity?
Why is this activity important and necessary?
Who should normally perform this activity, and when?
Comment: On the first half of this: yes, exactly my point.  But thanks for the second half, which explains a lot.

"Citizen Patrol" badge mis-titled


What is the equivalent of "npm install  --save" in Yarn?

Question: I am using Yarn to install the dependencies of my project. What is the equivalent of "npm install <package_name> --save " in Yarn to update the entry in my package.json file? I can use "npm install <package_name> --save " here, but I want to use Yarn as much as possible to improve performance and avoid confusion between npm and Yarn.
Answer: The yarn equivalent tonpm install <name> --save is:
yarn add <name>

Here's the link to the docs for the full list of commands in comparison to npm.
Comment: @estus the `--save` flag is not required anymore when using npm. If you don't want npm to save we now have to use `npm --no-save` :)
Comment: `yarn add` does not appear to update package.json by default
Comment: Notice that the documentation (erroneously) states that NPM counterpart is `npm install [package]`, while it's `npm install --save [package]` in fact.
Comment: Thanks for reminding. I have `save` option disabled globally in order for NPM to be consistent between versions.
Comment: @toastyghost I've just migrated from Yarn 1.x to 3.x and never esperienced a package not being added/removed from pakage.json using `yarn add|remove` I'm recommending the use of LTS versions. Try deleting `node_modules` and clean the cache then reinstall, there might be another issue regarding to this link: https://stackoverflow.com/questions/48654681/yarn-add-does-not-install-dependencies
Answer: Use the following command :
yarn add [package_name]

Comparing npm and Yarn Commands
Install dependencies
npm install => yarn

Install a package
npm install [package_name] => yarn add [package_name]

Install a package globally
npm install -g [package_name] => yarn global add [package_name]

Install a package as a development dependency
npm install --save-dev [package_name] => yarn add --dev [package_name]

Uninstall a package
npm uninstall [package_name] => yarn remove [package_name]

Uninstall a package globally
npm uninstall -g [package_name] => yarn global remove [package_name]

Uninstall a development dependency package
npm uninstall --save-dev [package_name] => yarn remove [package_name]

Update the dependencies
npm update => yarn upgrade

Update a package
npm update [package_name] => yarn upgrade [package_name]

Create a new package
npm init => yarn init

Run a script defined in the package.json
npm run => yarn run

Test a package
npm test => yarn test

Publish a package
npm publish => yarn publish

Remove all data from the cache
npm cache clean => yarn cache clean

Comment: Thanks for this cheat sheet. I keep referring to this comment whenever I need :)
Comment: Very helpful. Although I never will understand why they decided to change these commands.
Answer: Using --dev or -D will install one or more packages in your devDependencies.
yarn add <package...> [--dev/-D]

Yarn add documentation