Holonomic and non-holonomic constraints

Question:
Is it possible for a system to have holonomic and non-holonomic constraints at the same time?
If so, in this scenario does it make sense to talk about a set of independent 'generalized coordinates'?
Answer:
Yes. E.g. take your favorite $d$-dimensional non-holonomic system and pretend that it lives in $d+1$ dimensions by imposing a holonomic constraint that the extra dimension is a constant.
No, not in the conventional sense of the word generalized coordinates $(q^1, \ldots, q^n)$. They are by definition constructed out of a larger set of coordinates [typically $({\bf r}_1, \ldots, {\bf r}_N)$] by imposing a set of holonomic constraints only. If we now impose further [e.g. non-holonomic$^\dagger$] constraints, the generalized coordinates  $(q^1, \ldots, q^n)$ wont be completely independent anymore.

--
$^\dagger$ Semiholonomic constraints can be implemented with the help of Lagrange multipliers, cf. e.g. my Phys.SE answer here.
Answer: Why not?

A holomonic constraint in classical mechanics are relations between the position variables (and possibly time)

And this means that a constraint can be written as

$f(q_1,...,q_n,t) =0

Where of course the variables $q_1,...,q_n$ are the usual generalised position variables.
Thus a non-holonomic constraint is one that includes a dependence upon a generalised velocity.
Since we can have more than one constraint, it's obviously possible to have a holonomic and non-holonomic constraint.

Holonomic and non-holonomic constraints


The meaning of get you

Question: I have a question about the sentence below:

Do not let bygones(or the past) get you

I was wondering what "get you" could mean in this context.
Comment: Don't let bygones catch,  apprehend, or block you.
Answer: In that context, it's an informal way of saying "annoy", "bother" or "worry".
An example from Oxford Advanced Learner's Dictionary:
What gets me is having to do the same thing all day long.
Answer: 'Get' does a lot of work in English. It can mean so meany different things. It's primary meaning is to obtain or receive, but that has slipped into many metaphorical and underspecified meanings. The OED (available online in the US and UK through your local library) has 34 distinct entries for 'get', and this hides a number of sub-specializations. They're all somewhat related but it is not obvious what a particular usage may mean unless you know already.
In your example,

Do not let (something) get you

it means that you shouldn't let that something bother you. From OED definition #14 'to concern, worry, or annoy' chiefly US:

1867   B. Harte Condensed Novels 280   "To have let bigger things go by, and to be taken in by this cheap trick..is what gets me."

The derivation is that this something has taken obtained control over your mental well-being. It is often said "Don't let it get to you" but without 'to' is the same thing (no sentence accent on the 'to', I'm just pointing it out).
Answer: If I get you, you're afraid that the boogeyman's going to get you because you don't understand the meaning of "get you" in your example.
It's perhaps a little more properly worded as "get to you", referring to a worry or irritation which may annoy you if allowed to fester.

The meaning of get you


Does Omnipotence of God imply nonexistence of physical laws

Question: I have already asked a similar question about omniscience of God implying determinism. I was corrected by people that this is actually fatalism and that there are different forms of omniscience.
Here I want to ask the question, whether the premise of an omnipotent God implies non-existence of fundamental physical laws. I think there are ways to reconcile these two notions with probabilistic laws. This would mean that there are laws but there is enough room for a being to enforce its omnipotence. Is there any literature on this?
Comment: To the contrary, being omnipotent, God can establish fundamental physical laws if he so pleases. This was the idea behind the [clockwork universe](https://en.wikipedia.org/wiki/Clockwork_universe).
Answer: No, the premise of an omnipotent god does not rule-out absolute physical laws, because you can interpret absolute physical laws as meaning laws imposed by god, who, presumably, retains the power to change or overrule them.
Comment: No, my point was that you can define fundamental as meaning laid down by god. It is all an empty argument about the meaning of words.
Comment: Ok but if the laws can be changed then they're not fundamental anymore.
Comment: @eeqesri If an omnipotent thingme changes the laws of physics, then that thingme will make sure that you don't complain about it. Your mouth will be shut forever. (You didn't think an omnipotent thingme would be nice, did you? )
Answer: In addition to @MarcoOcram's answer (+1) omnipotence may mean that there are physical laws, but that God is not subject to them in the same way.  If I write a computer simulation of a world (c.f. The Matrix) then I can write physical laws into that simulation that apply universally to all entities in the simulation, but I can still write a "backdoor" that means they don't apply to my avatar.  Essentially then the absolute physical law (c.f. the code of the simulation) applies to God as well, just in a different way in which they apply to us (giving more freedom).
Answer: Giving god an inexhaustible supply of aces up his sleeve in the form of his being able to break the fundamental laws of nature any time he requires a miracle is a convenient but witless way to explain miracles and/or god's supposed omnipotence.
This sort of unreasoning might bolster belief in Nielsen's First Law of Statistics (anything can be proven with a small enough sample size) but if you turn the "argument" around and search for miracles as proof of the existence of god, you run into trouble rather quickly, because miracles do not exist except in ancient texts written by people who believed you could cure disease by burning a piece of meat on a mountaintop.
Answer: Laws in physics are not unbreakable.  See this discussion: https://www.pnas.org/action/oidcCallback?idpCode=connect&error=login_required&error_description=Login+required&state=ywFvQQYneg-BzlJMigPaE1BUoozBVbZq647eHy_L_QE That science laws are not unbreakable, but instead are regularities, is true of all of the rest of science as well.  therefore the conflict you presuppose: "unbreakable physics vs. omnipotent God" is no contest, as there is no "unbreakable physics".
Also relevant is the postulate of God as creator.  A creator God SETS the laws of physics (however breakable they might be)!  So once more there is no contest.
More interesting is -- can such a God be judged good or bad?  How?  Would morality pre-exist creation, such that an absolute morality constrains God (IE God not omnipotent vs. morality)?  Or is morality created by God, in which case "moral" becomes meaningless relative to God? This is called the Euthyphro Dilemma in Greek philosophy.
Even more interesting is "coherent".  Did God create logic?  If so, God can violate logic too, and logic cannot be used to evaluate a God.


Why does Google say MVP is recommended for GWT?

Question: What is the reason Google says MVP is recommended for building GWT apps? I really like MVC approach when View layer is directly aware of what the Model is - why do they think that's bad idea?
Answer: As Google explains: "this model allows us to minimize our use of GWTTestCase, which relies on the presence of a browser, and, for the bulk of our code, write lightweight (and fast) JRE tests (which don't require a browser)".
Also:
What is the advantage of the MVP pattern (GWT)
MVC or MVP? Which design pattern makes the most sense?
Answer: Well, the issue is: MVC is a nice way to structure you application, but it does have negative impact on testing. MVP is nothing new, it is also known as Lazy View Pattern and it leverages the mocking of a view for testing or even for different views on different plattforms.
Newer MVC approaches/ framework did push a lot of functionality into the view markup (renderers, validation frameworks, binding frameworks) which in fact lead to fewer functionality on the controller, less testability and duplicate code (ok, duplicate "intelligent" markup).
Everyone who did a bit more JSF than a HelloWorld and started duplicating markup knows what I am talking about.


Howto: clone and restore complete macbook hard drive

Question: I need to make a complete copy of the mac HD.
Due to a school policy the mac has to be formatted this monday, before the summer. However, I don't want to lose my programmes and files. The programmes are the most important. If I don't let them format the mac they'll keep it and send me a ~1000usd bill, + the value of the mac if they don't get it back.
It's a 2009 macbook pro running 10.6. After the format it will be running 10.8. I want to make a copy of the current 10.6 system, format and install 10.8, make a copy of 10.8, format and install 10.6 and restore the old system. I'm running bootcamp with a windows 7 install on it and though it would be nice to keep that one as well, it's not a must.
I haven't got a firewire cable or another mac with the needed 160GB available. I do however have a windows 7 machine with plenty of space.
Would a plain cp / /volumes/other-computer-name/folder/path in terminal work? Would it restore the files correctly?
How can I get the mac back to the way it was before the format?
Comment: If you have to return the computer and you only have a Windows machine what good will an image of the system be? You won't be able to use it. If you are running Windows 7 on the machine you can simply network two Windows machines together and create the system image on the Windows 7 machine.  Just be sure you create an image of the entire hdd.
Comment: I'll get the mac back after it's been formatted.
Answer: You can boot from a liveCD or pen drive and and then use dd and netcat to copy the whole drive to another computer. Then after the system has been formatted you can reverse this.
There are quite a few posts on how to do this on Stack exchange. The OS in question is often something else than OS X, but the actual contents of the drive you are backing up do not matter. It is all raw data to dd.
However there is a not quite so minor legal matter.
A common reason why schools wipe leased student computers is because of licensing issues. Usually the school will install a lot of school related programs which you are only allowed to use as long as you are a student. When you graduate you stop being a student of that school and the license is no longer valid. The school must make an attempt to remove these programs.
It can do so by logging into your computer with an admin account, uninstalling the programs one by one, or by simply reformatting or reinstalling the computer. The latter is much quicker and if a school has to do this for all students then this is the preferred option.
It is also quite likely that you agreed to this before you got the computer (check the the small print in the agreement).
If all this is correct in your case then you can try the following:

Check which programs are installed.
Check which programs are legal to keep.
Uninstall all programs for which you have no legal license after this summer.
Go to to the IT/helpdesk/servicedesk which would normally format your drive and tell them that there is no longer any school software on the laptop. Depending on the person which helps you you may get to keep the current set-up.

I have done such work in my student time when we still handled out pentium-1 laptops with 16 MB RAM and windows 95. When a student stopped studying we were required to do such wipes. However if a student already had installed Linux and no trace was left of the original windows installation and accompanying software we did not reinstall the factory image. The goal was already accomplished. No need to bother the student by forcing yet another reinstallation.
Your mileage may vary with the expertise of the helpdesk. Some will just try to follow the rules. Other will see the intent and will try to be helpful. I was lucky enough to work in a place with relative skilled people who could think and who followed the intend of the procedures.
Comment: I'm getting DVD's with the school software such as iLife, as well as the licenses. We also used free software like vbox, debian, ubuntu and so on. I have no idea why we need to format the computers, but I think every mac has to be "sold" with the latest version of os x (according to the agreement), and a format is their preferred way of doing so. I have asked the IT-guy, but he cannot ignore his orders from the head master without risking his job. Also, I'm the only admin on my mac. Only my account and the root account (that I chose the password for) are active.
Comment: In that case one of the backup methods I liked to as `dd and netcat` might help. It is a very raw way of making a backup, but it works, it only uses free software and you can restore it on an identical machine (read: the same mac you get back).  Alternative are something with timemachine (no personal experience, so no detailed help from me) or swapping the harddrive. School then reformats the swapped drive, you go home and swap back for the old disk.
Answer: This is roughly how I solved it:
http://lifehacker.com/5685547/how-to-set-up-time-machine-to-back-up-to-a-networked-windows-or-linux-machine


How do I diagonalize a Matrix with orthogonal eigenvectors?

Question: I want to diagonalize the Matrix $A$, so that $A = V*\Lambda*V^{-1}$. Where $V$ is the Matrix of Eigenvectors of $A$ and $\Lambda$ is the diagonal Matrix of Eigenvalues of $A$. However inverting $V$ can be a pain, so I thought it would be easier to use the Gram-Schmidt process to make my eigenvectors orthogonal, so that I can just transpose $V$ to invert it, but that gives me the wrong solution. Why? What would be an easier way to diagonalize $A$ without having to invert Matrices manually?
Comment: if A is symmetric there exists an orthogonal basis (and you can use Graham -Schmidt)  But if A is not symmetric, there is no guarantee of an orthogonal basis.
Answer: Not all diagonalizable matrices can be put in diagonal form in a orthonormal basis, however, this can be achieved for symmetric ones.
If $\{e_1,\ldots,e_n\}$ is a basis of eigenvectors of $A$, then if $\{v_1,\ldots,v_n\}$ is the basis obtained by Gram-Schmidt orthonormalization, then $v_i$ needs not to be an eigenvector of $A$, all one has is the following:

For all $1\leqslant k\leqslant n$, $\textrm{Span}(e_1,\ldots,e_k)=\textrm{Span}(v_1,\ldots,v_k)$.
For all $1\leqslant k\leqslant n$, $\langle e_k,v_k\rangle>0$.

In all generality, a linear combination of eigenvectors is not an eigenvector.
Comment: Thanks! Why the emphasis on orthonormal and not just orthogonal?
Comment: One can always choose unitary eigenvectors, so the emphasis is really on orthogonal as you notice.
Answer: Not all matrices are orthogonally diagonalizable. If you just throw all of the eigenvectors into the Gram-Schmidt machine, you will end up with outputs that aren't eigenvectors. The best you can do in general is to find an orthogonal basis for each eigenspace, but unless the eigenspaces are mutually orthogonal, there's no orthonormal eigenbasis for the entire space.


Character limit on process name?

Question: I notice I can't get much info on processes associated with the chromium browser, whether I am looking at gnome-system-monitor, top, or the like. Any process associated with chromium reads as chromium-browse. Obviously it would be helpful to know which tab or sub-process might be responsible for laggy behavior. Is there a character limit on process names, or was chromium designed to list processes like this?
Comment: [Could not reproduce.](http://i.stack.imgur.com/bvmvd.png)
Answer: Why not just use the built-in chrome's task manager? It can display easily which extension, which app, which tab is using how much memory.
Menu -> More Tools -> Task Manager or Shift+Esc
Comment: Fair enough. I was hoping I'd be able to do at-a-glance diagnostics with `conky`, but this should work.
Answer: You can use htop instead of top. First, install htop:
sudo apt-get update
sudo apt-get install htop

Then, start htop with sudo:
sudo htop

There are many options. Press F3 to search for a process. Press the S key to run strace on a selected process.
Comment: Thx. This may be prove useful in the future. For a quick look at memory-hogging tabs, the built-in task manager is what I'm looking for. Any chance you can give me a tl;dr on what to learn from a strace?

Character limit on process name?


Cant Uninstall SP3 from SQL Server 2008r2

Question: I installed SP3 for sql server 2008r2 RTM release on windows server 2008r2. After testing i found some unknown issues in my application. Now i want to downgrade this database engine again into RTM release. I try control panel add/remove option but its remove all database instance. Please suggest
Comment: I think it's quite unlikely that the service pack caused issues in your application. Have you considered troubleshooting instead?
Comment: Actually, this application is very big & doing lot of bulk operations. We suggest them to tune but they said "our application recommended db version is max upto SP2 and we are testing for SP3 and would launch after 3 months". We are also using same instance for some other in-house applications and didn't find any issues. But now downgrade into SP2. Anyhow whatever it is !!! Thankful for your efforts & thoughts !!! Cheers !!!
Answer:
I try control panel add/remove option but its remove all database instance. Please suggest

That is not exactly the place from where you can uninstall SP, you have to go to add remove programs and then on top left you would see installed updates

Click on view installed updates and you would see all updates for your computer and programs installed on it. Locate SQL Server 2008 R2 Sp3, I have SQL Server 2014 SP2 and it shows like.
Right click on the Service pack and select uninstall.
Comment: thanks Shanky. Actually I was thinking this tab only for windows securities updates !!!


How to get distinct records in the quickviewer?

Question: I would like to get distinct record values as a result in the quickviewer.  Is there any way to do that?
Answer: Unfortunatelly you cant. Since any Quickviewer SQVI Query can be converted into an SE11 Query and even therein no DISTINCT selects are allowed, Quickviewer is not allowed to neither.
In pure ABAP you can do a SELECT DISTINCT (OpenSQL), but unfortunatelly not in QuickViewer.
Comment: Not the answer I hoped for, but since I asume it's correct, tx.
Answer: This is not an answer (I would comment, but i can't, yet).
Do you mean distinct records from a single db table?
Since queries query a db table, which presumably has unique keys, the only thing to do is enforcing as input to the query all the required keys.
Or do you mean fields of different records having different (distinct) values? I haven't tried that, but what about injecting some extra code, from transaction SQ02, and deleting/collecting rows based on your criteria, thus ensuring distinct non-key fields in your records.


Is home distillation of beer or wine on-topic?

Question: Are questions about home distillation of home brewed beer and/or wine to be considered as on-topic?
Answer: Informally, it is not on-topic, looking at other distillation questions and their closing by moderators. Apart from the fact that it's very broadly illegal world-wide (with a couple of notable exceptions), it also is a set of techniques, equipment and skills that are outside the normal wort-production and fermentation process.
Answer: Given that there is a distillation tag with 22 questions, perhaps this question should be reanswered?


Inserting number as well as text in a field in ArcGIS

Question: I am trying to buffer polygons based on the value of a attribute table, though I need it in centimeter level. There is no option to the buffer tool which uses field to set the centimeter.
Thus, I am trying to to populate the field with value, which is specific buffer distant for each polygon and text "Centimeter" in it, as with this way it seems to work to buffer polygons at centimeter level.
Can anyone share the knowledge how to put number and text in one field?
Comment: A quick workaround would be to convert your centimeter values to meters.
Comment: You need to use floating-point columns to store real data.
Comment: Yeah, that may work, but I need buffer distance which are in between a meter, such as 0.88, 0.46, 0.48 and so on, which seems not to work if I convert values to meter as buffer simply rounds the number so I will get, either 1, or 0 as a buffer distance.
Answer: Seems simple concatenation as both combining fields are being strings with "Field Calculator" worked out. !field name! + " " + !field name! is the running it.
Answer: You can add new text field in your feature class and then populate it with Field Calculator (right click on column header in attribute table -> Field Calculator):
<code>[name_of_the_field_with_cm_values] & " Centimeter"
</code>
Make sure you use VB Script as parser.


How to anchor aquarium plants?

Question: I have a number of live plants in my aquarium. One of them - an oxygen weed - frequently works its way loose from the gravel in which I've planted it. I find myself often having to retrieve bits of the weed from all over the aquarium, gather the stems together, and then replant the weed in the gravel.
Are there any tips for securing such a plant?
Answer: There are numerous ways. Best way I know of is use very fine sand. Plant substrate which I assume isn't fine, and then pour some very fine sand on top. This should keep your weed down until it roots itself.
However it is also possible that you have trumpet snail infestation. Check if you do, and if it is the case then I suggest you make your substrate deeper. Trumpet snails and worms like to dig up earth, and having deep substrate allows for more digging space and leaves plants in peace.
Answer: There's various ways.  A lot depends on the type of plant and whether or not they put down roots or want to float free.

Pack some heavier rocks around the plant's base.  You probably already tried this, but it works for most rootable plants.
Tie the plant to something, like a large rock or driftwood.
Use some string to tie the base of the plant to something that sinks until roots take hold, or the plant attaches itself to the rock.
Wrap the plant around driftwood.
For some plants which are meant to float and not put down roots, you can string the entire plant under an extruding piece of driftwood, so the wood holds the center down and the rest floats free.
Keep them in their pots.
If the plant came with a small plastic pot, plant the whole thing in the substrate.  Or buy a small clay pot to use.  The main problem with this is you end up with a plastic pot permanently in your tank.  But it will keep them in place.
Use plant anchors.
I've never used them, but available for purchase are soft, bendable lead strips that you wrap around the plant to hold them down.
Nylon Mesh.
For mosses and small carpeting plants, you can cover them with a mesh that will hold them down and give them something to attach to.
Answer: The best way I've found at planting plants that don't root is with Cyanoacrylate gel - super glue gel. This is safe for fish and cures in water. I superglue java fern and anubias to driftwood, rocks, everything.
Tying plants to items is dangerous if you have fish that like to cram into small spaces, or look for food in the substrate. They can get caught in the string and will die if not freed, or may injure themselves trying to break free.
Other things you can do for non-rooting plants is:

Put plant weights on them, like iron bands, wrap around the rhizome and they will sink.
Jam them into crevices where they will eventually root to the item (driftwood, rocks, decor)
Pack them into the substrate and place a heavy object on top of the substrate
Get some sewing board, attach the plants to it, and bury it in the substrate
Plant them into a terracotta pot that sinks

You should also make sure you keep them planted in a location that is not hit by a lot of current, either at the base or eventually at the top when the plant grows upward. This can cause the plant to dislodge.
Answer: If you mean hornwort (Ceratophyllum), it won't stay down long. It grows so fast under good conditions that it will soon be near the surface, and it never grows roots. (Java Fern is about the only other plant that will never grow roots). Most others can be weighted and pushed into sand. I use a small band of lead; heavy, soft and ductile. I got the idea many decades ago when Anacharis bunches came with lead bands (I know, it is not politically correct today, but it worked so well for so long I still do it). In the right situation I use aluminum wire and rubber bands; I see rubber bands used often to hold coral frags.
Answer:
Do not choose too many plants for your tank that there will be not much room for your fish.  Otherwise, your tank friends will feel stress than relaxed in their environment.
Make sure to layer the bottom of the tank with up to eight centimeters of gravel or one and a half pounds per gallon of water. You can also use other substrates.

Based on the instructions of the fertilizer manufacturer, add the fertilizers before filling the tank with water halfway.
Add your plants and bury them into the substrate or gravel up to their stems' bases.  But then, you should cover the tuber/bulb with gravel up to their growing tip if choosing this kind of plants.
Add your equipment including thermometers, furniture and rocks, along with other accessories, into the tank. Complete filling the tank with water.

Source: https://www.paintafish.org/best-silk-aquarium-plants/
Comment: This is fully plagiarized from the site you've sourced; you should either contain it all within a quote block to make it clear that you have directly copied it, or summarize the information in your own words. It also seems to be more general, rather than specifically addressing the issue of a plant coming loose; it would be a better answer if you selected and summarized points related to keeping a rogue plant rooted instead of just copying a general section.
Answer: why don't you tie the plant to a small but considerably heavy stone ?
it will keep the plant grounded
Answer: Use small nylon zip ties. You can tie any plant to something in the tank. I tied my fresh plants to plastic ones and voila! no issues with keeping them in place.
Comment: Do you have any references to make this a better answer?

How to anchor aquarium plants?


I think I broke my elytra

Question: I am making a race between me and my brother, and one part is from getting to one place to another by elytra and a rocket. His works like it should, but I just fall, even when spamming them in creative mode. My brother is an eye witness to this and we were both shocked, since our favorite way to travel is by elytra. We're both in version 1.13.1 of Minecraft and I'm hosting a LAN world for him to join. Can anyone help me, or am I just going to have to take the rockets out of our race?
Comment: Is there any way we can duplicate the issue on our end?
Answer: This is likely either this bug (first world you join after starting the game has issues) or this bug (after teleporting a long distance, you get issues) or any of the related ones. Exiting and re-joining the world should fix it.
Answer: This might be a normal thing where the elytra runs out of durability. You can repair it with another damged elytra, or you can get another one. If the elytra looks tattered, then that means it has 1 durability left (they never break, but you can't use it when it has 1 durability left)

I think I broke my elytra


Are stretch marks normal?

Question: I'm an 18 year old athlete, 210 lbs. I work out a lot, working on gaining strength and muscle. After a really intense workout I'll get stretch marks along some of the areas that I worked such as biceps. Is this normal? Should I be worried or are these common for anyone who does intense weight training? Thanks in advance.
Comment: You won't get stretch marks from a single weightlifting session. Your skin is elastic enough to handle that. Stretch marks are from long term, rapid gain in weight/height (Such as a pregnancy, growth spurt, etc) and are a result of tearing in the skin. You can get them over time, and you may be noticing them after a session, but a single session doesn't create them.
Comment: Oh, yes, they can definitely become more noticeable as there is more blood in the vessels near the skin. That is != to causing them, though. :)
Comment: You should put moisturiser on them regularly. You don't want to be left with big scars(like me). The earlier you start the better.
Comment: But its valid to say that after a single session some become more pronounced?  @JohnP
Comment: Stretch marks seem quite common to me. I see quite a few bodybuilder a have stretch marks on their upper biceps and ass.
Answer: Is this normal?
Yes, it is normal.
Should I be worried or are these common for anyone who does intense weight training?
No, you do not need to worry about it. Good news is that these stretch mark will disappear after some time.
Here are some article regarding the causes of stretch marks :-
Mayoclinic

Stretch marks sometimes occur during substantial weight gain. Weightlifters can develop stretch marks, particularly on the arms.

NHS Choices

You may get stretch marks if you put on a lot of weight over a short period of time. The stretch marks sometimes remain even after losing weight, but should eventually fade.Bodybuilders and athletes can also get stretch marks as their muscles increase in size.

Here are some methods on how to reduce them (if you are too concern about it) :-
Reducing stretch mark
With that said, I have a stretch mark on both of my biceps, where the right side is almost gone whereas the left side has slowly started to fade. And some on my left shoulder.
Comment: Would you mind writing up the important parts of the links? It's usually the way to go because links die with time, which would render this answer very empty later.
Answer: Stretch marks are common and completely harmless. It happens when the skin extends due to the fast growth of the skin's underlying tissues. Stretch marks gradually decline and turn white as they recover.
Gaining a lot of weight in a short period puts strain on your skin, which has to stretch to accommodate the extra body mass. Depending on where you gain excess weight, stretch marks might appear on the body.
To prevent putting unnecessary strain on your skin, it is advisable to lose or gain weight gradually.
Rapid muscle mass growth during weight training and bodybuilding can stretch your skin and generate stretch marks.
You may not be able to eliminate your stretch marks 100%, but some home treatments can help fade stretch marks significantly.
Though there is no magical diet that will instantly remove your stretch marks, certain nutrients can enhance skin health and lessen the appearance of stretch marks. Protein, Vitamins A, C, and D, and Zinc are a few examples.
If home remedies do not significantly improve the appearance of your stretch marks, consult a physician for therapy.
They may advocate for adequate hydration, diet, and skincare.
Comment: Eliza - Welcome to the site! I believe that because your answer links to (presumably) your own site, it is being flagged as spam. I invite you to read the about page and the help pages, with attention to [self promotion](https://fitness.stackexchange.com/help/behavior). You have a decent answer here, but it's getting flagged by other users as spam for the link inclusion. I hope this helps!

Are stretch marks normal?


Is there a reason not to use Strict mode in JavaScript?

Question: I have been wondering, without any specific context to this question, is there a reason not to use strict mode in JavaScript? I have hardly ever been working without it in JS and from all the reading I've done on the subject it seems purely beneficial as unsupported browsers just ignore the statement,  but if that is the case, why don't browsers always use strict mode in the first place?
Comment: No, there is no reason not to use it. You gave yourself the answer :) - note that you should use it not in global scope, just in your scope, otherwise you could break features from imported code!
Comment: when both of them can coexist why do you want to do that
Comment: @Arun Killu : to my understanding, strict mode exists to remove issues associated with how relaxed JavaScript standards were so always requiring it would lead to generally cleaner code. My understanding might be wrong tho, thus the question.
Answer:
I have been wondering, without any specific context to this question, is there a reason not to use strict mode in JavaScript?

That is rather subjective.

I have hardly ever been working without it in JS and from all the reading I've done on the subject it seems purely beneficial as unsupported browsers just ignore the statement, but if that is the case, why don't browsers always use strict mode in the first place?

Because if a page uses JavaScript that depends on features of non-strict mode, that code will break.
Strict mode is not 100% backwards compatible. That is why it is has to be turned on by the person writing the JS.
Comment: Code written before strict mode existed would probably not work.
Comment: That is precisesly what's confusing me: Strict mode seems to resolve a lot of genuine issues that JavaScript has, at least from my perspective and from what I have red (after all, most articles about strict mode are written by people enthusiastic about the feature, and thus are quite positive in their view of this issue.) Is that not the case? Can it end up being too limiting, or removing essential features of the language?


What macros should be used as 'scratch space'?

Question: The LaTeX kernel provides the 'scratch' macros \@tempa, etc., and \reserved@a, etc. These are used for a variety of purposes. Which should be used as temporary space by general users/programmers?
Comment: I have to admit I have been using the plain TeX conventions here, using `\0`, `\1`, etc. But I never dared let any code that I don't have *complete* control over run between defining and using these macros. Havn't been burned by it yet.
Comment: I happened to stumble across this similar question: https://tex.stackexchange.com/questions/88252/tempdima-reserveda-tempcnta-what-else
Answer: LaTeX2.09 used \@tempa, ... as scratch macros, but by the time LaTeX2e was being designed so many style files (packages) were using the same "scratch" macros they were not really "safe" any more so we used \reserved@a,... in the format code, documented as not to be used by other packages. So \@tempa and friends have no special status now, although they are commonly used because many common packages have a history that goes back to latex2.09 (ie before 1994).
But really for any package being written now there is no need to use these generic scratch macros at all. If your package is called wibble.sty use \wibble@a, \wibble@b,... etc.
In 1994, on a 640K PC running emtex there were only about 50 command names left after loading latex2e+amsmath, and so it made sense for as much code as possible to re-use the same command names. With a modern texlive or miktex installation there are typically several hundred thousand command names available in the string pool and obfuscating the code and running the risk of clashes with other packages by re-using some generic command names is probably taking a risk with no actual potential gain.
Comment: @JosephWright yes but one person's ad hoc code ends up being someone else's go-to package 20 years later:-)
Comment: The 'throw away' temporaries are handy for _ad hoc_ code, mainly: that was the context in which the initial query arose.
Comment: I just got bitten by `\@tempdima` being used both by `\rule` and by `\l@section`: I was hacking into `\l@section` and trying to use the `\@tempdima` configured by it in the parameters of an extra `\rule`, but to no avail of course as `\rule` itselfs resets `\@tempdima`.
Answer: The \reserved@... macros are reserved for use by the LaTeX team only: they should not be used by others. On the other hand, the macros \@temp... are available for general scratch use.
This is because low-level parts of the kernel need to have reliable storage for internal use. The \reserved@... series provide this, and using them may cause unexpected issues in apparently unrelated code. No such reliance takes place with the \@temp... series.

If you are patching a kernel macro and using the reserved names exactly as the kernel does, you might of course need to use one. This is however an extremely limited set of circumstances.
Answer: When writing code from scratch that might be used by people other than me, then I tend to write everything within an own namespace where each macro-name has its own prefix formed by the name of the project/package, trailed by an @ and an acronym denoting the person who wrote that code. E.g., for project foobar I don't use \@tempa but I  use \foobar@UD@tempa. If I could easily use digits within names of control sequences, I would in many places include version number / date of submission into the namespace-prefix also.
Exception: Macro-names for macros for the user-level.
Besides this I tend to redefine whatsoever "scratch" macros not introduced by me within local scopes only, where at the moment of finishing producing whatsoever boxes, these local scopes are already closed again so that my temporary redefinitions don't interfere during moments where the output-routine is in action. (One can have fun in situations where \globaldefs might have a positive value.  ;-)  )
Another issue are macros where hooks like \everypar or \everyeof get modified. Modifying somebody else's macros, e.g., scratch-macros from the kernel, might probably affect the way in which things triggered by those hooks are done. This in turn might cause problems.
E.g., recently there was a thread macros - inaccurate hyperlink to customly defined theorems where changing the kernel's box-register \@labels happened even without the user being aware of that:
The labels of the text of a theorem-like environment were to be nested into another itemize-like environment. First the material for typesetting both the theorem-like environment's label and for placing an anchor for hyperlinks was placed into the box-register \@labels. Theorem-like environments rely on \everypar for typesetting the content of that box-register. But the content of that box-register was replaced due to the itemize-like-environment before the \everypar-hook was carried out. This time with material where no anchor for hyperlinks was placed. Thus hyperref-functionality was broken.
So, problems with changing things belonging to the kernel can even happen without users knowing/intending that.


Outlet problem please help. Pesky wires

Question: If wires won't stay in holes after tightening screws can I just wrap around screws instead
Comment: How about a picture of your outlets and the wires.
Comment: @jsotola  That would depend on if  the OP is referring to the backstabs or back wired/back clamp outlets.
Comment: This may imply a) incorrect fitting or b) the wire is too thin for purpose. Photos would be helpful.
Comment: that's what the screws are for ... they are not for tightening the holes
Answer: It sounds like you are using a higher quality outlet that has "screw-and-clamp", where you insert the wires into holes in the back and screw down the screw to clamp the wires.
Like a lot of people, you are wildly underestimating how much screw torque these require to clamp the wires.
In fact, you're probably wildly under-torquing all your screw terminals.
One thing that science discovered in the last 20 years is that screw torque really matters on small connections. Failing to tighten enough (or too much) results in arcing and sparking at those terminals, with outlets heating up and even starting fires.  Because of this problem (and other science that showed pro electricians couldn't set correct torques any more accurately than their spouses), NEC 2014 now requires you use a torque screwdriver to tighten the screws to the spec on the device labeling.
So it sounds like you're normally tightening screws rather limp-wristed, and you're leaving a trail of time bombs behind you.  You should get a torque screwdriver and use it, and if you won't listen to that advice, at least get a Robertson screwdriver (they hold better than Philips) and tighten them Really Super Hard.
You will find that will solve your clamping problem, and you should make a point to revisit your past work and re-torque.  Otherwise you'll have problems later.
Answer: Yes you can.
If the screws are suppose to tighten/hold the wire in a hole, but doesn't, I would be concerned.
Some outlets just have basic spring tighten holes, these are usually known to give problems, and the screws are the recommended choice.
With outlets being quite inexpensive, if one is not working right it is a lot better just to get a new one, a bad outlet can burn down a house.
Answer: The holes are colloquially referred to here as "back stabs". They are convenient but only work under a very limited set of circumstances:

Correct wire size - typically 14 AWG. But many circuits (even, legitimately, with 15A receptacles) will be 20A circuits with 12 AWG wire.
Solid wire (as opposed to stranded)
First use - If you pull the wires out to fix something and put the wires back in, they will not hold properly.

As a result, using the screws is the recommended method. With basic receptacles (and switches) you have to make a hook in the wire, loop it around the screw and tighten it. With better quality receptacles you get screw to clamp. With this, you put the wire in straight and tighten the screw down. And you get two locations on each screw, so if you need two wires you have more options (with the basic receptacles you have to do one in a screw and the other in the back stab - if you can use the back stab at all - or go to pigtails and wire nuts.
Comment: Usually, backstabs aren't tightened by screw. However, if one isn't sure how an outlet works, one could easily push the wire into the backstab then tighten the screw not knowing that the screw won't have any effect on the clamping of the backstab. If they're clamp-and-screw, then Harper's answer applies.

Outlet problem please help. Pesky wires


How can you sell stocks if you do not have any?

Question: How can you sell stocks if you do not have any? This is from a lecture of financial market class. The professor discussed the following: you do not have any stocks. But you sell 200 stocks to someone and you get the money, say $200. then if the stocks price goes up, you lose money. I didn't quite understand this part. Please help me, thank you.
Comment: you borrow the stock and immediately sell it for cash. If the price goes down you buy it back at a lower price (and give the shares back to the rightful owner), you keep the cash that was leftover from buying it at a lower price. On the other hand, if the prices goes, you eventually buy the stock (and give the shares back to the rightful owner), but now you lost money because you have no cash leftover from the initial sell. Instead you had to use more cash to get buy those more expensive shares.
Comment: The FAQ Specifically addresses homework questions (http://money.stackexchange.com/help/on-topic) They are generally allowed and don't need a homework tag.
Comment: It's fine to ask homework questions. It's customary to explicitly state that it's a homework question because that will affect how people may format their answer.
Answer: "Shorting" is the term used when someone borrows a stock and sells it at the current price to then buy it back later at hopefully a lower price. There are rules about this as noted in the link that begins this answer as there are risks to selling a stock you don't own of course.
If you look up various large companies you may find that there are millions of shares sold short throughout the market as someone does have the shares and they will need to be put back eventually.
Comment: Yes and they usually pay a fee in order to borrow the stock before short selling them. If you are in a country that allows CFD trading (eg UK or Australia) you can use CFDs to short stocks without paying any fees - in fact if interest rates were sufficiently high you might even get some interest when you hold a short position open overnight. CFDs are not allowed in the USA.
Comment: @Victor Man, all the good stuff isn't allowed in the USA... :-(
Comment: 。Then how about North Korean....
Comment: @kun - if you live in Nth Korea you would know better than me if they allow CFDs !!!
Comment: @Michael - yes I know I love trading CFDs. Started a new strategy at the start of September and am up about 20% since then. The commission on the are very low as well.
Comment: Well,, they do not even have internet.. they only have in-country internet for the people.


Add custom menus to magento

Question: I need to add menus like here http://www.pickormiss.com as given here like Vegetables, Meatshops, Restaurant, Gift shops etc.  How can I add such pages so, that it can be customized from the dashboard?
Comment: You are talking about the menu sub descriptions here, right? ie the normal menu link would be 'Vegetables', you want to be able to add the 'perfectly fresh!' to the main menu as well and style that text differently?
Comment: Yes, now only the existing category list are listed as menu. But I want to add few links as per my choice and also it must be customized from  the dashboard.
Answer: To add static pages to the menu you first need to create a statick block with the content, then create a category and on the Display Settings tab you change the Display mode to Static Block only and for CMS Block you select the created static block for that page.
Answer: I suggest looking at the TsDesign Menubuilder extension. It does a great job in making all sorts of menus manageable.

Add custom menus to magento


Scaling Up applications

Question: What should I consider when taking an application (web) from a few users to hundreds or thousands? Basically, what should I be considering when thinking about escalating?
Comment: What technologies are you using? What is your bottleneck at the moment? Is it amount of RAM or slow database?
Comment: I'm trying to find out for both Java and PHP using Postgre and MySQL
Answer: In general, when we talk about scalability, it's more about going from few thousands to few millions or billions of requests. In such case, scalability requires an application to work on several servers, which has some very specific issues which scalability tends to solve.
In your case on the other hand, it seems that you just has to face the increase of users, without being forced to use several servers instead of one (unless the current server is pretty slow, in which case the upgrade must be considered, or the website has an impact on the resources of the server, in which case the bottlenecks have to be found and removed).
There are several points to consider in your case:

Do you use cache enough? Don't forget that cache can be implemented on several levels, from caching database results to avoid doing the same queries again and again, to output caching to avoid using more CPU than needed, to client caching, to reduce the number of requests (for example avoiding the client to request the same CSS file again and again every time just to receive again and again the 304 response).
Do you use SQL profiler? If not, it is a good idea to start using one to be sure that there are no repetitive queries, and to find what queries must be optimized.
Do you use a profiler? Profiling your application may show where does it use too much memory or too much CPU. Working on those bottlenecks can strongly reduce the load.
What is the weakest part of your server? If you see that RAM is used up to 20% while the CPU is used up to 95-99% all the time, you should probably upgrade your CPU, but don't need to buy more RAM.
Do you use your server to the full extent? If you see that RAM is used up to 20%, why not implement more caching and use it up to 75 - 85%? If your application spends lots of time querying data from hard disk, why not buying a second hard disk and use it in RAID1 (if in your case, given your hardware and your disk usage, RAID1 can provide faster access)?
How the server is used outside your web application? In other words, are there other processes which may use the resources, and if yes, do you need them and do you know what they're doing? It also applies to the scheduled processes. Running a backup at 3 A.M. when there are at most two-three users on your website is fine. Running the same backup at 6 P.M. when you observe a peak of visits on your website is clearly not a good idea.
Answer: You can decrease the load of your database if you denormalize it, but you should benchmark it.
For Java you can decrease the stacksize using parameters to the JVM, because the amout of available memory may be a bottleneck if you have many concurrent users. It can also be interesting to change to an event-driven server e.g. Netty if your server uses much memory for servlets. Play Framework is an interesting Java web framework for Netty.
When using PHP you should use APC or Memcached for speedup.
You should also consider using Varnish for caching your requests.
Answer: The most important piece of your infrastructure to consider when scaling up (assuming you have a decently functioning software stack) is the physical layout.  That is do you have multiple web servers, sitting behind load balancers?  Do you have clustered app and db servers? Are you sitting on a dedicated network isolated from dev and qa?  These are some of the things to focus on.

Scaling Up applications


How to set default value for form field in Symfony2?

Question: Is there an easy way to set a default value for text form field?
Comment: yes, but the answers given in this question are not satisfying/do not work ... I will add an "Edit" to explain why :-)
Comment: @Crone this question was asked 2 years earlier
Comment: @OndrejSlinták I didn't vote to close either as dupe, but FYI: it doesn't matter which one came first, *"[If the new question is a better question or has better answers, then vote to close the old one as a duplicate of the new one.](http://meta.stackexchange.com/a/147651/321521)"*
Comment: It seems that the 'perfect' solution you are after is for a field to have a 'default_value' option. Thing is, [currently it does not](http://symfony.com/doc/current/reference/forms/types/form.html), so I don't think the perfect solution you are looking for currently exists. The only thing symfony provides (see the link) _is_ the data option. So the if-then is the only approach that I can see atm. Even if there was a 'default_value' option on the field itself, I imagine it would essentially do the same thing internally anyway.
Comment: Also, I have made a correction to my answer in approach 2 as per my comments below it. If that fixes the syntax issue you mentioned in point 2, you might want to edit that comment out. Or let me know what the issue is, and I'll fix my answer.
Comment: possible duplicate of [Set default values using form classes in Symfony 2](http://stackoverflow.com/questions/17986481/set-default-values-using-form-classes-in-symfony-2)
Comment: People seem not be satisfied with the answers. It might be due to the vague question. What do you mean by default value? A value that is always used? A value that is used, if no other value is bound on submission? An initial value used in the view, when the form hasn't been submitted yet? I downvoted... I cannot understand how this has that many votes
Answer: you can set the default value with empty_data
$builder->add('myField', 'number', ['empty_data' => 'Default value'])

Comment: Setting data is not setting the default. This answer is the correct one.
Comment: This appears to only set the field to 1 when it is submitted with no value. What about when you want the form to default to displaying 1 in the input when no value is present?
Comment: This doesn't address the question; 'empty_data' only saves the specified value after form submit if the field had an empty value. It doesn't set a default value for text form field... it doesn't touch the form field at all, that'll just show as empty.
Comment: In my testing empty_data doesn't allow me to override the default value from a field submitted empty, e.g. if you want to save to the database as 0 instead of NULL. This bug is still outstanding as far as I can tell: https://github.com/symfony/symfony/issues/5906
Answer: Can be use during the creation easily with :
->add('myfield', 'text', array(
     'label' => 'Field',
     'empty_data' => 'Default value'
))

Comment: This does not only set a default value, it will also always force the value under any context. Not what I would call a "default value"...
Comment: This is the initial value, the default value is `empty_data`
Comment: For Symfony 2.1 I needed to change the `'data'` key to `'value'`
Comment: I downvoted this solution as it is not a solution for the problem (as Hubert Perron mentioned above). I am trying to get a better solution in this post http://stackoverflow.com/questions/17986481/set-default-values-using-form-classes-in-symfony-2
Comment: `data` is useless - it overwrites the saved value. `empty_data` doesn't show the value, it uses it on empty value submit and makes it impossible to save unchecked choices.
Comment: @Edd are you sure? Just tried to put in `value` in Symfony 2.1.5-DEV- didn't work. But `data` worked just fine.
Comment: I asked the question again and got a remarkable answer: http://stackoverflow.com/questions/17986481/set-default-values-using-form-classes-in-symfony-2
Comment: This is the same bad answer as rkmax's, as it answers a different question than what's asked. The question asks how to "set a default value for text form field", not how to "save a default value if the form text field is submitted as empty". 'empty_data' will address the latter (form submit), not the former (form load; it won't populate the empty field with a default value).
Answer: I've contemplated this a few times in the past so thought I'd jot down the different ideas I've had / used. Something might be of use, but none are "perfect" Symfony2 solutions.
Constructor
In the Entity you can do $this->setBar('default value'); but this is called every time you load the entity (db or not) and is a bit messy. It does however work for every field type as you can create dates or whatever else you need.
If statements within get's
I wouldn't, but you could.
return ( ! $this->hasFoo() ) ? 'default' : $this->foo;

Factory / instance.
Call a static function / secondary class which provides you a default Entity pre-populated with data. E.g.
function getFactory() {
    $obj = new static();
    $obj->setBar('foo');
    $obj->setFoo('bar');

   return $obj;
}

Not really ideal given you'll have to maintain this function if you add extra fields, but it does mean you're separating the data setters / default and that which is generated from the db. Similarly you can have multiple getFactories should you want different defaulted data.
Extended / Reflection entities
Create a extending Entity (e.g. FooCreate extends Foo) which gives you the defaulted data at create time (through the constructor). Similar to the Factory / instance idea just a different approach - I prefer static methods personally.
Set Data before build form
In the constructors / service, you know if you have a new entity or if it was populated from the db. It's plausible therefore to call set data on the different fields when you grab a new entity. E.g.
if( ! $entity->isFromDB() ) {
     $entity->setBar('default');
     $entity->setDate( date('Y-m-d');
     ...
}
$form = $this->createForm(...)

Form Events
When you create the form you set default data when creating the fields. You override this use PreSetData event listener. The problem with this is that you're duplicating the form workload / duplicating code and making it harder to maintain / understand.
Extended forms
Similar to Form events, but you call the different type depending on if it's a db / new entity. By this I mean you have FooType which defines your edit form, BarType extends FooType this and sets all the data to the fields. In your controller you then simply choose which form type to instigate. This sucks if you have a custom theme though and like events, creates too much maintenance for my liking.
Twig
You can create your own theme and default the data using the value option too when you do it on a per-field basis. There is nothing stopping you wrapping this into a form theme either should you wish to keep your templates clean and the form reusable. e.g.
form_widget(form.foo, {attr: { value : default } });

JS
It'd be trivial to populate the form with a JS function if the fields are empty. You could do something with placeholders for example. This is a bad, bad idea though.
Forms as a service
For one of the big form based projects I did, I created a service which generated all the forms, did all the processing etc. This was because the forms were to be used across multiple controllers in multiple environments and whilst the forms were generated / handled in the same way, they were displayed / interacted with differently (e.g. error handling, redirections etc). The beauty of this approach was that you can default data, do everything you need, handle errors generically etc and it's all encapsulated in one place.
Conclusion
As I see it, you'll run into the same issue time and time again - where is the defaulted data to live?

If you store it at db/doctrine level what happens if you don't want to store the default every time?
If you store it at Entity level what happens if you want to re-use that entity elsewhere without any data in it?
If you store it at Entity Level and add a new field, do you want the previous versions to have that default value upon editing? Same goes for the default in the DB...
If you store it at the form level, is that obvious when you come to maintain the code later?
If it's in the constructor what happens if you use the form in multiple places?
If you push it to JS level then you've gone too far - the data shouldn't be in the view never mind JS (and we're ignoring compatibility, rendering errors etc)
The service is great if like me you're using it in multiple places, but it's overkill for a simple add / edit form on one site...

To that end, I've approached the problem differently each time. For example, a signup form "newsletter" option is easily (and logically) set in the constructor just before creating the form. When I was building forms collections which were linked together (e.g. which radio buttons in different form types linked together) then I've used Event Listeners. When I've built a more complicated entity (e.g. one which required children or lots of defaulted data) I've used a function (e.g. 'getFactory') to create it element as I need it.
I don't think there is one "right" approach as every time I've had this requirement it's been slightly different.
Good luck! I hope I've given you some food for thought at any rate and didn't ramble too much ;)
Comment: when using doctrine, constructors are not called when an entity is loaded from the db.
Comment: could you give a little more detail on what you meant about 'a service which generated all the forms'?I'm also working on a really form centered project right now and it would be great to have different perspectives on it.
Comment: Your references are great but now I have to Google search them and hope I find what you're talking about... I request that you add the links citing the documentation or whatever source that you're getting the suggestion from, like with Form Events or Extended Forms.
Answer: If you need to set default value and your form relates to the entity, then you should use following approach:
// buildForm() method
public function buildForm(FormBuilderInterface $builder, array $options) {
    $builder
    ...
    ->add(
        'myField',
        'text',
        array(
            'data' => isset($options['data']) ? $options['data']->getMyField() : 'my default value'
        )
    );
}

Otherwise, myField always will be set to default value, instead of getting value from entity.
Comment: This is the right way for both add/update, I think. But I hate Symfony make it too much complex.
Comment: This is the only good answer. I don't understand other answers when I look at the doc. `empty_data` : This option determines what value the field will return when the submitted value is empty. It does not set an initial value
Comment: In case of arrays instead of entities, just replace `$options['data']->getMyField()` with `$option['data']['myField']`
Comment: The code I'm looking at builds the form through Sonata FormMapper, and there's no $options var passed anywhere, so I don't know how to get what you're talking about here.
Answer: You can set the default for related field in your model class (in mapping definition or set the value yourself).
Furthermore, FormBuilder gives you a chance to set initial values with setData() method. Form builder is passed to the createForm() method of your form class.
Also, check this link: http://symfony.com/doc/current/book/forms.html#using-a-form-without-a-class
Answer: If your form is bound to an entity, just set the default value on the entity itself using the construct method:
public function __construct()
{
    $this->field = 'default value';
}

Comment: Even so, your form can have additional fields not be mapped to your entity (`'mapped' => false`). Use `setData(...)` for these.
Comment: This only works when creating a new record, not when editing an existing one. The default property value is just completely ignored or not even checked when pulling up an Edit form.
Answer: Approach 1 (from http://www.cranespud.com/blog/dead-simple-default-values-on-symfony2-forms/)
Simply set the default value in your entity, either in the variable declaration or the constructor:
class Entity {
    private $color = '#0000FF';
    ...
}

or
class Entity {
    private $color;

    public function __construct(){
         $this->color = '#0000FF';
         ...
    }
    ...
}

Approach 2 from a comment in the above link, and also Dmitriy's answer (not the accepted one) from How to set default value for form field in Symfony2?
Add the default value to the data attribute when adding the field with the FormBuilder, adapted from Dmitriy's answer.
Note that this assumes that the property will and will only have the value null when it's a new, and not an existing, entity.
public function buildForm(FormBuilderInterface $builder, array $options) {
    $builder->add('color', 'text', array(
            'label' => 'Color:',
            'data' => (isset($options['data']) && $options['data']->getColor() !== null) ? $options['data']->getColor() : '#0000FF'
        )
    );
}

Comment: Actually there does seem to be occasions when the data entry isn't set. Safer to test for both i.e. isset($options['data']) && $options['data']->getColor() !== null ? ...
Comment: The first one works (thanks!), the second one does not (for me): $options["data] is always set, so the default value will never be used. I am still wondering if solution number 1 is the intended way to do it...
Comment: You're right about $options['data'] always being set. If you don't initialise the entity field, you could test for null on the field instead, eg. 'data' => $options['data']->getColor() !== null ? etc... That assumes that null is not a valid value for the color field, so existing entities would never have a null value for that field.
Comment: ah, stupid me: I tried it with 'isset($ $options['data']->getColor())', I got an error message about "using it in writing contexts is not allowed" and forgot that I have to check it differently :-)
Answer: Don't use:
'data' => 'Default value'

Read here: https://symfony.com/doc/current/reference/forms/types/form.html#data
"The data option always overrides the value taken from the domain data (object) when rendering. This means the object value is also overriden when the form edits an already persisted object, causing it to lose its persisted value when the form is submitted."

Use the following:
Lets say, for this example, you have an Entity Foo, and there is a field "active" (in this example is CheckBoxType, but process is the same to every other type), which you want to be checked by default
In your FooFormType class add:
...
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
...
public function buildForm( FormBuilderInterface $builder, array $options )
{
    ...

    $builder->add('active', CheckboxType::class, array(
        'label' => 'Active',
    ));

    $builder->addEventListener(
        FormEvents::PRE_SET_DATA,
        function(FormEvent $event){
            $foo = $event->getData();
            // Set Active to true (checked) if form is "create new" ($foo->active = null)
            if(is_null($foo->getActive())) $foo->setActive(true);
        }
   );
}
public function configureOptions( OptionsResolver $resolver )
{
    $resolver->setDefaults(array(
        'data_class' => 'AppBundle:Foo',
    ));
}

Comment: This here is money!!  Use the form event listener to check your values prior to defaulting them.  This should be the accepted answer for defaulting values in your forms because it works for both New actions and Edit actions.
Comment: This is the correct way to handle this and this should be the accepted answer.
Comment: What you mention at the beginning is not true if you use a conditional / ternary. Like this: ```'data' => $data['myfield'] ?? 'Default value'```
Answer: A general solution for any case/approach, mainly by using a form without a class or when we need access to any services to set the default value:
// src/Form/Extension/DefaultFormTypeExtension.php

class DefaultFormTypeExtension extends AbstractTypeExtension
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if (null !== $options['default']) {
            $builder->addEventListener(
                FormEvents::PRE_SET_DATA,
                function (FormEvent $event) use ($options) {
                    if (null === $event->getData()) {
                        $event->setData($options['default']);
                    }
                }
            );
        }
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefault('default', null);
    }

    public function getExtendedType()
    {
        return FormType::class;
    }
}

and register the form extension:
app.form_type_extension:
    class: App\Form\Extension\DefaultFormTypeExtension
    tags:
        - { name: form.type_extension, extended_type: Symfony\Component\Form\Extension\Core\Type\FormType }

After that, we can use default option in any form field:
$formBuilder->add('user', null, array('default' => $this->getUser()));
$formBuilder->add('foo', null, array('default' => 'bar'));

Comment: This should have been accepted as the best answer (up-to-date)
Answer: You can set a default value, e.g. for the form message, like this:
$defaultData = array('message' => 'Type your message here');
$form = $this->createFormBuilder($defaultData)
    ->add('name', 'text')
    ->add('email', 'email')
    ->add('message', 'textarea')
    ->add('send', 'submit')
    ->getForm();

In case your form is mapped to an Entity, you can go like this (e.g. default username):
$user = new User();
$user->setUsername('John Doe');

$form = $this->createFormBuilder($user)
    ->add('username')
    ->getForm();

Comment: I prefer this method, especially since in most applications you are creating a form and passing in an entity that the form deals with.
Answer: ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
     $form = $event->getForm();
     $data = $event->getData();

     if ($data == null) {
         $form->add('position', IntegerType::class, array('data' => 0));
     }

});

Comment: this is a nice solution. Calling `$event->setData()` instead of readding the field might make it even better.
Answer: My solution:
$defaultvalue = $options['data']->getMyField();
$builder->add('myField', 'number', array(
            'data' => !empty($defaultvalue) ? $options['data']->getMyField() : 0
        )) ;

Answer: Just so I understand the problem.
You want to adjust the way the form is built based on data in your entity.  If the entity is being created then use some default value.  If the entity is existing use the database value.
Personally, I think @MolecularMans's solution is the way to go.  I would actually set the default values in the constructor or in the property statement.  But you don't seem to like that approach.
Instead you can follow this: http://symfony.com/doc/current/cookbook/form/dynamic_form_modification.html
You hang a listener on your form type and you can then examine your entity and adjust the builder->add statements accordingly based on havine a new or existing entity.  You still need to specify your default values somewhere though you could just code them in your listener.  Or pass them into the form type.
Seems like a lot of work though.  Better to just pass the entity to the form with it's default values already set.
Answer: If you're using a FormBuilder in symfony 2.7 to generate the form, you can also pass the initial data to the createFormBuilder method of the Controler
$values = array(
    'name' => "Bob"
);

$formBuilder = $this->createFormBuilder($values);
$formBuilder->add('name', 'text');

Answer: If you set 'data' in your creation form, this value will be not modified when edit your entity.
My solution is :
public function buildForm(FormBuilderInterface $builder, array $options) {
    // In my example, data is an associated array
    $data = $builder->getData();

    $builder->add('myfield', 'text', array(
     'label' => 'Field',
     'data' => array_key_exits('myfield', $data) ? $data['myfield'] : 'Default value',
    ));
}

Bye.
Comment: Much more helpful, than an accepted answer!
If you use PHP7+ you can make it even neater with:
`'data' => $data['myfield'] ?? 'Default value',`
Comment: You have a typo in array_key_exists() function
Answer: Often, for init default values of form i use fixtures. Of cause this way is not easiest, but very comfortable.
Example:
class LoadSurgeonPlanData implements FixtureInterface
{
    public function load(ObjectManager $manager)
    {
        $surgeonPlan = new SurgeonPlan();

        $surgeonPlan->setName('Free trial');
        $surgeonPlan->setPrice(0);
        $surgeonPlan->setDelayWorkHours(0);
        $surgeonPlan->setSlug('free');

        $manager->persist($surgeonPlan);
        $manager->flush();
    }
}

Yet, symfony type field have the option data.
Example
$builder->add('token', 'hidden', array(
    'data' => 'abcdef',
));

Answer: There is a very simple way, you can set defaults as here :
$defaults = array('sortby' => $sortby,'category' => $category,'page' => 1);

$form = $this->formfactory->createBuilder('form', $defaults)
->add('sortby','choice')
->add('category','choice')
->add('page','hidden')
->getForm();

Answer: Default values are set by configuring corresponding entity. Before binding the entity to form set its color field to "#0000FF":
// controller action
$project = new Project();
$project->setColor('#0000FF');
$form = $this->createForm(new ProjectType(), $project);

Comment: this approach works, but has the disadvantage that you have to do it every time you use the form class & it is very verbose (lots of set statements). As the form component is very elegant, there must be something else. But thanks anyway :-)
Comment: @jamie0726 In my opinion is the controller responsibility to set the values of the object whenever it's new or fetched. That way you can have the form being used in different situations with different behaviors, for instance, the new color might change because of the user has a manager or a supermanager role, and since this is a business logic, that should be controlled by the controller or a service, not the form. So as Cerad stated, I also prefer this solution. You could always create a service to set those default values and in the controller use that service keeping it DRY.
Comment: This is the solution I chose, because it fits the logic I think. The generated controllers have different methods for creating EDIT and CREATE forms, and those are where I set the default/initial data for new entity.
Answer: If that field is bound to an entity (is a property of that entity) you can just set a default value for it.
An example:
public function getMyField() {
    if (is_null($this->MyField)) {
        $this->setMyField('my default value');
    }
    return $this->MyField;
}

Answer: I usually just set the default value for specific field in my entity:
/**
 * @var int
 * @ORM\Column(type="integer", nullable=true)
 */
protected $development_time = 0;

This will work for new records or if just updating existing ones.
Comment: This doesn't seem to work when `'empty_data'` is a callback is used to allow constructor params on the entity.
Answer: As Brian asked:

empty_data appears to only set the field to 1 when it is submitted with no value.
  What about when you want the form to default to displaying 1 in the
  input when no value is present?

you can set the default value with empty_value
$builder->add('myField', 'number', ['empty_value' => 'Default value'])

Answer: I solved this problem, by adding value in attr:
->add('projectDeliveringInDays', null, [
    'attr' => [
          'min'=>'1',
          'value'=>'1'
          ]
     ])


python to sharepoint without credentials

Question: I am working on a project that wants me to connect to corporate's SharePoint and download files using scripts. But they don't want to put username and password in the scripts or giving out credentials. How can I get access to sharepoint from the corporate's computer? I guess I can assume everything is logged in, so I don't need to enter passwords.
Answer: One thing that you can try using Power Shell is configure the Generic credentials from the Control Panel using a service account like this .

Then schedule your script to be run from this server and read the credentials like this .

Install-Module -Name CredentialManager
$managedCred = Get-StoredCredential

Let me know if any doubts with this one.
Comment: That can work. But I found out the sharepoint site uses kerberos and ntlm for auth. and both requests packages are not available. I can use win32HTTP to connect to the website


Why is torque defined as $\vec{r} \times F$?

Question: Here I cannot convince myself myself that it is units because the torque is defined to be in units of Newton meter is a reiteration of the law stated above. Why was it not $r^2 \times F$ or $r^3 \times F$ or $r^2 \times F^2$ etc. The argument "in our experience how much something rotates depends on the lever length and the force applied" is really insufficient. Can someone outline a more rigorous proof or motivation?
Comment: But all of physics comes from what we see in experiments. "Rigorous proof" deals with mathematical objects, which are products of human imagination and often have non-physical properties.
Comment: Does [Why do we use cross products in physics?](https://physics.stackexchange.com/a/518467/268448)
 or [Why is torque a cross product?](https://physics.stackexchange.com/a/516069/268448) answer your question?
Answer: It's not like someone said "Ah ha, torque! What should the definition of torque be?" That doesn't make sense; you don't think up a term and then try to assign a definition.
Instead, it was found that this thing $\mathbf r\times\mathbf F$ turned out to be really useful in explaining physical phenomena. Particularly rotational dynamics of systems. So it got its own special definition.
If you want to define $r^2F$ or $r^2F^2$ as something, you can go right ahead. No one will stop you. The goal would then be to show that your new definition has physical significance.
P.S. I think the answers that have "Define torque as the time-derivative of angular momentum" or something like it is showing the physical significance of $\mathbf r\times\mathbf F$ by linking it to other things with physical significance (assuming you think angular momentum and its rate of change is significant). But I think they miss the point of showing that you can't derive or prove definitions and that questions like "why is insert physics term here not equal to insert modified definition here instead?" misunderstand why something would be defined in physics in the first place.
What you are doing here is not actually asking why is torque defined as $\mathbf r\times\mathbf F$, but rather (possibly unaware to yourself) you have some other notion of what torque is/should be, and you want to know why we can go from what you are thinking of to $\mathbf r\times\mathbf F$. Of course, we would need to know what your actual starting point is that you desire in order to get there. Other answers assume rate of change of angular momentum, or use virtual work and equilibrium, but that isn't necessarily what you might be thinking of. The fact that there are a variety of other answers here shows how flawed the question (not the post though) is.
Comment: So you are saying that it is like that because it is useful? But why and how is it exactly useful? I don't understand your answer.
Comment: You wrote in your answer that the other answers you are referring to are missing the point so that was why I was confused. I still don't think the other answers really provide anything else then a derivation.
Comment: @bananenheld At the time I was writing my answer, two other answers had already covered why it is useful. I figured I wouldn't put the same information down a third time.
Comment: @bananenheld You left off the rest. I said *miss the point of showing that you can't derive or prove definitions*. They start from a different view of torque the OP did not specify, and get to $\mathbf r\times\mathbf F$. This is probably why it is unsatisfying; it's just a bunch of circular reasoning. My answer tries to break that by showing how the question is flawed in the first place. I added an addition to my answer to try and help
Comment: You can't prove definitions 'by definition'. However the question is why torque is defined the way that it is, why it is useful. You say that the question is flawed, however I don't think that the question is flawed but you are missing the point. I believe that the reason torque is useful must have to do with conservation of angular momentum which comes from noethers theorem/isotropy of space. Your answer seems to be 'because it is useful, and your question is flawed' which seems to me not appropriate and dismissing the question.
Comment: @bananenheld It's a flawed question, but I'm in no way dismissing it. I typed up an answer explaining how definitions work. The OP did not provide us with what they think "torque" is in order to question in the first place why we can express it as $r\times F$. You can show its relation to angular momentum, that's fine. Other answers have done other things. I'm trying to be more general and get to the core of the issue. Questions like these are asked occasionally here on PSE, and they all come from a misunderstanding of definitions. It's not a dismissal, but rather a more complete reply.
Answer: I personally prefer a derivation using the principle of virtual work where the formula of torque directly comes out. While angular momentum is a natural property to consider for a spherically symmetrical problem, this alternative approach shows its relevance for statics of rigid bodies even when this symmetry is not present.
Take a set of points indexed by $i$ at position $\vec r_i$, on which are applied respectively the forces $\vec F_i$. This gives first formula of vitual work for a general displacement:
$$
\delta W = \sum \vec F_i \cdot \delta\vec r_i
$$
Furthermore, lets assume the points are rigidly constrained and can only rotate around the origin. Any allowed differential displacement can thus be written as $\delta\vec r_i =\delta\vec \phi \times \vec r_i$ where $\vec \phi$ is the differential angular displacement. Injecting in the work you get:
$$
\begin{align}
\delta W &= \sum \vec F_i \cdot \left(\delta\vec \phi \times \vec r_i\right)\\
&= \left(\sum \vec r_i \times\vec F_i \right) \cdot \delta\vec \phi
\end{align}
$$
So static equilibrium is equivalent to a vanishing virtual work for any relevant virtual displacement, hence $\sum \vec r_i \times\vec F_i $, the torque naturally pops out. It also explains also the useful power formula for rotation (with angular velocity $\vec \omega$):
$$
P = \left(\sum \vec r_i \times\vec F_i \right) \cdot \vec \omega
$$
Hope this helps and tell me if you find some mistakes.
Comment: Best explanation, I wish I had written it!
Comment: why is $\partial \vec{r_i} = \partial\vec{\phi} \times \vec{r_i}$?
Comment: It's because these transformations generate all the rotations. Abstractly, the antisymmetric matrices are the Lie algebra of $SO(3)$ which can be identified to $\mathbb R^3$ via the cross product. Check out this as a starter https://en.m.wikipedia.org/wiki/Euler%27s_rotation_theorem
Comment: @real answers Or simply recall that the direction of $d\vec {\phi}$ is defined as that in which a right-handed screw would translate when turned in the sense of the angle  $\phi$, and then draw a diagram if needed.
Answer: Torque is change of angular momentum: $$ \vec{\tau} = \frac{d\vec{L}}{dt}$$
Angular momentum is defined as $$ \vec{L} = \vec{r} \times\vec{p} $$
Using the chain rule:
$$ \vec{\tau} = \frac{d\vec{L}}{dt} = \frac{d}{dt}(\vec{r} \times\vec{p})$$
$$\frac{d}{dt}(\vec{r} \times\vec{p}) = \frac{d \vec{r}}{dt}\times \vec{p}+ \vec{r} \times\frac{d \vec{p}}{dt} = \vec{0} + \vec{r} \times\frac{d \vec{p}}{dt} \tag{1}$$
Remembering that $|\vec{a} \times \vec{b} |= |\vec{a}||\vec{b}| \sin \theta$ and that the velocity vector is parallel to the linear momentum vector we get:$$ \frac{d \vec{r}}{dt}\times \vec{p} =   \vec{v} \times \vec{p} =   \vec{v} \times m\vec{v} = m|\vec{v}| |\vec{v}| \sin \theta \ \hat r=m|\vec{v}| |\vec{v}| \sin 0 \ \hat r = \vec{0}$$
$\theta$ is the angle between two vectors, which is $0$ for any vector with itself.
So we get for torque, using the result in $\text{(1)}$:
$$ \vec{\tau} = \frac{d\vec{L}}{dt} = \vec{r} \times\frac{d \vec{p}}{dt} = \boxed{\vec{r} \times\vec{F}}, \text{ since } \vec{F}=\frac{d \vec{p}}{dt} $$
But the question then reduces to why angular momentum is defined as $ \vec{L} = \vec{r} \times\vec{p} $. I think this has to do with Noether's theorem, that this quantity is conserved when a system stays the same under a change of angle.
Answer: Consider a point particle of mass $m$ with velocity $\vec v$. The particle is located at some position $\vec r$ with respect to the origin $O$.
I will start with the angular momentum calculated about $O$.  The angular momentum is $\vec L = I\vec \omega$, where $I=mr^2$.
Since we know $v=\omega r$, you can work out that $\vec \omega = \dfrac{\vec r\times \vec v}{r^2}$.
Next, we can substitute that into our angular momentum to get $$\vec L = m \vec r\times \vec v.$$
Define torque as the time-derivative of angular momentum, and we have that $$\vec \tau \equiv \dfrac {d\vec L}{dt}=m\vec r\times \dfrac{d\vec v}{dt}.$$
Since $\vec F=m\vec a$, we then have $$\boxed{\vec \tau =\vec r \times \vec F}$$
Answer: If we consider a small arc of length dl (almost 0) in a circle of radius R which subtends a small angle du
As arc is almost 0 thus angle subtended will also be approximately 0
As dl is very small thus dl length can be assumed as straight line (as we can assume circle is made of very small straight line kept at some angle)
So it forms a triangle with 2 sides as radius and one as dl
And considering one angle as 0 the other 2 angle will be 90°
Using sin rule: [sin(du)/dl] = [sin(90)/R]
As we know sin(y)=y if y is very small
So sin(du) =du
Thus dl = R(du)
Now differentiating with respect to time we get
(angular-velocity)=(linear-velocity)(Radius)
Differentiating with respect to time again
(angular-acceleration)=(linear-acceleration)(Radius)
Multiplying by mass
We get (angular acc)(mass)=torque
And (linear acc)(mass)=force
Torque=(Force)(Radius)
Now the cross product is due to force being vector and in circular motion we take resultant as vector obtained by right hand thumb rule due to convention.


Sharpening a bound on $\zeta'(s)$

Question: I want to find an upper bound for $\zeta'(s)$ along a vertical line  $\Re(s)=b$, where $-1<b<0$.
One way to do this is using $$\frac{\zeta'(b+iT)}{\zeta(b+iT)}=O_b(\log T)$$ and $$\zeta(b+iT)=O_{b,\varepsilon}(T^{1/2-b+\varepsilon})$$ for each $\varepsilon>0$.
Multiplying them gives us $$\zeta'(b+iT)=O_{b,\varepsilon}(T^{1/2-b+\varepsilon}\log T)$$ as $T\rightarrow\infty$.  I want to know if there is a bound, for fixed $b$, that is sharper.
Comment: Use the functional equation connecting $\zeta(b+iT)$ to $\zeta(1-b-iT)$ and differentiate.  Then use Stirling's formula.  This gives the bound $|\zeta^{\prime}(b+it)|= O_b(T^{1/2-b}\log T)$ (your expression seems to have a typo).  This is also best possible since $|\zeta(1-b-iT)|$ is bounded away from zero.
Comment: The functional equation expresses $\zeta'(b+iT)$
in terms of $\zeta(1-b-iT)$, $\zeta'(1-b-iT)$, and the complex Gamma function
and its derivative on the lines of real part $b$ and $1-b$.  If $-1<b<0$
then $1 < 1-b < 2$ so $\zeta(1-b-iT)$ and $\zeta'(1-b-iT)$ are bounded
and it's just a matter of the estimating the relevant Gamma and $\Gamma'$
factors.
Comment: Yes, you are correct about the typo, so I fixed that. Thanks for letting me know that this is the best possible estimate.
Comment: Here you can find some bounds http://math.univ-lille1.fr/~ramare/TME-EMT/Articles/Art06.html
Answer: I'm not sure if you need me to go further, but if I were you I'd start out with the functional equation.  Take the derivative of both sides of the functional equation and you can derive:
$\frac{\zeta'(1-s)}{\zeta(1-s)} = log(2\pi)+\frac{\pi}{2}\tan(\frac{\pi s}{2}) - \psi(s)-\frac{\zeta'(s)}{\zeta(s)}$.
Letting $s = 1-b-iT$, the left hand side will be exactly what you're looking at.
I am some what confused.  You say the vertical line where $Re(s)=b$ where $0<b<1$.  If it's a vertical line, then wouldn't $T$ vary and $b$ be held fixed?
If $T$ is allowed to vary (i.e. a vertical line), then wouldn't the answer depend on whether the line crosses the real axis?  I believe $\tan(\frac{\pi}{2}s)$ blows up in magnitude when $b$ is really small in absolute value.
If $T$ is held fixed, and you allowed $b$ to vary, then believe the $\tan$ term is bounded since you'd be a fixed distance away from the problem point $b=0$.  If this is the case, Lucia is correct I believe.
Perhaps I'm wrong...it is awful late and my mind is worn out from all day of flying across the country.  I apologize if I made a mistake somewhere in my logic.
If I am wrong in my logic, could someone explain?  I'm very interested as well.

Sharpening a bound on $\zeta'(s)$


TERM ANSI escape sequences compatibility between xterm and screen although infocmp does not say so

Question: I am making an script in zsh on mac that uses tmux and after the amazing https://unix.stackexchange.com/users/22565/st%c3%a9phane-chazelas answer, I found out that when I use tmux, it uses a different interpreter that that of my host machine.
Therefore, as I am outputing the same literals to both tty and tmux pane from my script tput commands, I wanted to know whether there was some incompatibility on the ANSI escape sequences I am producing.
I found that $TERM is xterm-256color in my mac and screen-256color within a tmux pane, therefore I issued
%> infocmp xterm-256color screen-256color

I am using code that uses tput clear, civis, sgr0, cnorm, rc, sc, home, cd, cr, el, cub1, cud, cuf. The code is working, the ouput is produced in the xterm context with tput and is well rendered on both tty and tmux when tee'ed.
But according to infocmp, clear for instance has difference escape sequences on both terms:
comparing xterm-256color to screen-256color.
        clear: '\E[H\E[2J', '\E[H\E[J'

so how can it work?
As a side-question, msot of my commands don't show up in the comparison, does thi mean they are not theoretically supported or that they are common in both terms?
Answer: It works because in a (ECMA-48) standard terminal, there is no difference in the effect of the two strings.  Both send the cursor to the upper left corner of the screen.  Then one (\E[J) clears the remainder of the screen while the other (\E[2J) clears the whole screen:
CSI Ps J  Erase in Display (ED), VT100.
            Ps = 0  ⇒  Erase Below (default).
            Ps = 1  ⇒  Erase Above.
            Ps = 2  ⇒  Erase All.
            Ps = 3  ⇒  Erase Saved Lines, xterm.

(from XTerm Control Sequences)
Comment: Interesting thanks! I looked deep into it and could not find such low-level details


Does a first generation iPod touch have the ability to download apps and use emojis?

Question: I am getting a 1st gen iPod touch for a friend and I was wondering if you can download like apps and games on it and if it has emojis? It would help to get an answer before I buy it!
Answer: Yes, the App Store exists as that was introduced with iPhone OS 2.0, however most apps on the store do not support iPhone OS 3.1.3 (the last version available for the 1st generation iPod touch).
Emojis can be activated through 'emoji hack' apps on the App Store.
Comment: Thank you. I asked someone and they said that on all iPod's you can go to the settings and get the emojis. She said she wanted emojis so I wanted to make sure!
Comment: @camohope47 Only newer versions of iOS have the emoji keyboard available in Settings by default.
Comment: I have another question. Sorry. But does the first generation have an alarm?
Answer: You can download apps for it, but it is now so old that it will only run iOS 3.1.3 so many newer apps & games will be unlikely to be supported.
Emoji I think was added to the built-in font around iOS 5, so they will be unavailable.
See http://www.everymac.com/systems/apple/ipod/specs/ipod-touch-specs.html for more details
Comment: Okay thank you. I was wondering because my friend said her kid wanted an iPod for her birthday and she is only like 10.


What do I do with my dead fish?

Question: I came home earlier to find that my fish had died. I wasn't expecting this to happen as he was supposed to live for a really long time. So this is a situation that wasn't thought about much. I do not want to bury him, flush him down the toilet, cremate him or give him to animals to eat. Are there any other options? At the moment he is still floating in my tank so please help.
Is there even a way of keeping him in a hygienic way?
Thanks
Answer: I am sorry you lost your fishy.
He is still with you in your memories of him… You do not need to keep his body.
However since you asked about hygienic options you could have him cremated and keep his ashes. Another option (which is rather gruesome to me at least) would be to seal him in a jar with formaldehyde.
I would still advise it would be best for you, him and everyone to return him to the earth or water somehow so his death can perpetuate other life.

What do I do with my dead fish?


How do I exit the window manager on the current X display?

Question: Let's say I have the window manager Blackbox running on two different X displays, e.g. :0.0 and :1.0 launched from tty1 and tty2 respectively. From a terminal (emulator), how do I exit (kill) the Blackbox process that uses the current X display? The command killall blackbox does not fit since it terminates both sessions.
Comment: you can use `ps ux` to find the process. Then `kill` to kill.
Comment: @richard , i've expanded your comment into an answer . and your `ps` usage seems different than mine . i want environment variables as well as commandline arguments . what flavour of unix system are you working on ?
Comment: @richard This will give me the tty (seventh column) for each Blackbox process but in the general case I don't know which one is running on the current display.
Answer: ps e lists processes with their commandline along with ( initial ? ) environment variables . filter processes matching either a -display :0 commandline or a DISPLAY=:0 environment . i believe this find the wm in question whether started manually or by some session script . then we can simply kill it .

i hear there are different ps implementations , the above ( bsd ? ) commandline style works on my machine with debian procps-ng . refer to the manual if necessary .

based on the observation that wm is owner of the root window , this arch wiki page has a minisection with an approach of xprop -root _NET_WM_PID to find the pid , . but this don't work for me , seemingly because it is only voluntary for x windows to provide this property , and my wm happens to not follow that fashion .
regarding other nonworking ideas , xkill can detach clients except the root window , so don't fill our need here .
Comment: Thanks for the input, I wasn't familiar with the `e` option. One strange thing about the output from `ps e` is that there is no space between the command and the environment variable following it, for instance `blackboxMAIL=/var/mail...`.
Comment: @AugustKarlstrom , you are right about "cannot xkill root window" , let me delete that answer and put some small information regarding xwininfo and xprop into this answer .
Answer: If you have identified the tty where you lauched the blackbox from, ps -t tty1 will list the processes launched from that terminal (assuming tty1 is the one from where you launched the openbox you want to kill), then you can identify and kill the one you want.
Comment: That's correct but in the general case I don't know. In my solution posted here I instead start from the `DISPLAY` variable.
Answer: Here is a solution inspired by soubunmei's answer:
#!/bin/sh

ActiveWindowManagerPID()
{
    local windowManager="$1"

    local windowManagerPIDs="$(pidof "$windowManager")"

    local displayNumber="$(echo $DISPLAY \
        | awk 'BEGIN { FS = "[:.]" } { print $2 }')"

    ps e -p "$windowManagerPIDs" \
        | awk -v n="$displayNumber" \
            '$0 ~ " DISPLAY=:" n "[\n .]" { print $1 }'
}

kill "$(ActiveWindowManagerPID blackbox)"


how to handle different durations of audio data?

Question: I am new to signal preprocessing, I read about mel_spectrograms, MFCC's. Now I want to apply it and use the CNN model, But the data which I have for practice is having audio of different durations, now because of this, the mel_spectrograms will be of different shapes. for using them as inputs, the model requires inputs to have a fixed shape. So, what should I do to make them have a specific shape??
Comment: Could you address the problem on the model side instead?
Comment: The model which I want to use is CNN, so in the end, we use dense layers that required fixed input shape, for images we resize with cropping or padding. for audio data what we have to do to make the input to have a fixed shape?
Answer: In this case, usually, Normalization is done.
For example in your training and testing data, you need the same shape, so that you should try something like,
mean = np.mean(X_train_features, axis=0)
std = np.std(X_train_features, axis=0)
X_train_features = (X_train_features - mean)/std

Here X_train_features can be a data frame of spectrogram or mfcc features.
The same thing you can apply for testing features. One thing to remember is the number of columns in shape of training and testing should be the same.
You can also check some Kaggle kernels which are related to Audio processing.
Comment: I believe the question is not about the dynamic range of the features but about the length of the feature vectors. I think the question is how to handle different feature vector lengths and not how to normalise their values. In this case, I believe it is more appropriate to either zero-pad the shorter vectors (could also do some phase preservation zero-padding), cut the long ones to the duration of the shortest or resample the audio or the feature vectors (for example with an interpolation function).


How can one know if one has a Majorana fermion?

Question: If the Majorana fermion is a fermion that is it's own antiparticle and exactly the same as its fermion counterpart, then how do they know that it's not just a fermion?
Answer: A Majorana fermion would be a fermion that is it's own anti-particle.  This is a common trait for bosons - the photon, gluon, and Z bosons are all their own anti-particles.  Obviously, a Majorana fermion must not interact through the electromagnetic force, that is, it must have zero charge.
More technically, the wave equation that governs Majorana particles is a real wave equation.  You can change a particle into its anti-particle by using complex conjugation (reversing the sign of complex numbers).  Therefore, since it's a real wave equation, Majorana fermions would be their own anti-particles.
So, I think you are misunderstanding something - a Majorana fermion is a label applied to a fermion that is its own anti-particle.  It's not that fermions have a Majorana fermion that they are related to, it's just a name for particles that are equivalent to their anti-particles.
For example, the neutrino may be a Majorana fermion.  The way this can be tested is to see if double beta decay can occur without neutrinos.  In double-beta decay, two neutrons in the nucleus are converted to protons, and two electrons and two electron antineutrinos are emitted.  In neutrinoless double beta decay, the two neutrinos annihilate each other to produce two electrons, which is obviously only possible is the neutrino is a Majorana particle.  This is a Feynman diagram of neutrinoless double beta decay.
Some more information on the Wiki page:
http://en.wikipedia.org/wiki/Majorana_fermion
Comment: Oh yes, it would seem that there was a misunderstanding there, as stated in paragraph 3. So, would a Majorana fermion not have an antiparticle counterpart then? e.g. if the electron was a Majorana fermion (which I know it isn't), there would be no antielectron/positron? Or am I getting confused?
Comment: Right, what we call an electron/positron pair would just be two electrons (or two positrons, since they would be the same thing!)