How to measure the maximum power of a solar panel

Question: What is the best way to measure the maximum power generated by a solar panel?
Answer: Assuming the current/voltage relationship is linear (it's not, but this gives you a crude lower bound), you could measure the short-circuit current and the open-cell voltage and do 1/4 * I * V to obtain the maximum theoretical power given a worst-case 0.25 fill factor.  However a more reasonable value might be obtained by using a different factor

Typical fill factors range from 0.5 to 0.82. (source)

Because the I-V curve is non-linear you either need to find the parameters of your cell and apply equations (such as found here), or simply do it numerically by taking measurements at various I/V and finding the largest I*V coordinate.
Answer: The Solar Cell is just another diode which generates free electrons when light falls on it. You've got to have a light source whose light intensity (irradiance) can be varied. Direct the light on the cell, vary the intensity and start measuring the voltage and current at that voltage. Plot them on a graph paper.You are bound to get the I-V characteristics of the cell. At a certain point Imp and Vmp co-inside, this point is the max Power (Pmp).
Since I'm new here I'm not able post pics. You can just Google you will get the I-V curve of solar cell.
If you are too lazy to do this then buy a flasher (will cost you few thousand dollars) :) and you will get all parameters of the solar cell on a single sheet of paper.
Comment: It's not very clear if you'r saying to vary the light or the voltage...you should make that clear
Comment: yeah actually the voltage which in the end would result in variation of the light intensity.
Comment: Okay, now I understand even less..
Answer: First: the solar panel has a V/I curve which is shaped like this:

As you can see, for low currents the voltage varies slightly, and for low voltages the current is almost constant. So you will have the maximum current when the panel is short-circuited, and the maximum voltage when the panel is open-circuited. But, since the power is V*I, you have to find the point in which their product is maximum.
As you can see in the second picture, the power has a peak at abour the 80% of the open circuit voltage, and some Max Power Point Tracking (MPPT) systems will just bias the panel at that voltage. But smarter ones, will use tricks like measuring the slope of the power curve, which is zero when the MPP is reached.

The picture shows also another interesting fact: changing the light, the curve scales vertically, which means that the current will be proportional to light, but the voltage will remain about the same (with rough approximation).
Increasing the temperature, instead, will lower the open circuit voltage, shifting the curve leftwards and thus reducing the total amount of power that it's possible to obtain. That's why it's important to keep the panel cool.
So, to find the maximum power point, you can do this way:

First, fix the light level to a stable (and possibly known) value;
Then, connect the panel to a voltage source capable of sinking current and measuring both voltage and current accurately;
Starting from 0 V, increase the voltage at which you bias the panel until you reach the open circuit voltage Voc, while measuring the current for each point.

To find the MPP, you have several ways:

measuring the open circuit voltage Voc or the short circuit current Isc. The MPP is usually an almost constant fraction of these parameters. This is the roughest method, because it's not accurate and will need adjustments when the light changes.
derivative: when the panel is biased to a point, introduce a small change in the voltage of the panel, and measure the change in the current. Depending on this ratio (dI/dV) it's possible to adjust again until reaching the MPP. There are several different implementations of this technique, which is the most common.
other solutions may use an external light meter, and derive from it the right biasing voltage for the panel.
Comment: Those are some pretty impressive panels!  2.5A at 18 V is tremendous.  I just did this recently with some 1" home-made organic cells and got a few hundred mV and a couple mA; the presentation is [here on Google Docs](https://docs.google.com/presentation/d/1hG4ru_9oYFibf3LsvP_0z2h5uaJdID4vK2g3Wh8hCZ8/edit). One thing I'd add about light levels is that the 'stable' value should be a light source calibrated to the Air Mass 1.5 spectrum which puts out 1kW/m^2; that's what the entire solar industry calibrates against. Otherwise, the varied input powers would make the numbers unable to be compared.
Comment: @KevinVermeer oh, it's not mine, just sourced the pictures from google :) I'm also working with scavenging panels, but the methodology is the same. And I didn't use standard light sources, but as long as they're stable you can do an approximate tracking as well. But I still don't know why they use that reference, as it is quite unrealistic in the real world; I'd rather use half of it or les, to be more in the average.
Comment: @clabbachio - Fixed the link!


distribution VS average

Question: Can anyone give me more details why is it always better to work with the distribution of a variable than with its average?
I know that by taking the average we take into account the outliers but is it that bad? I mean it's quite easier to work with the mean...
Can someone give me some examples why is it REALLY better to work with distributions.
Comment: Why is this tagged clustering? Is this about something more specific than any use of distributions/means (which would be too broad)?
Comment: Consider the data set 0,0,0,0,0,0,10,10,10,10,10,10. Do you think '5' is a good summary of this data?
Answer: It isn't "always" better to work with the full distribution. It's a matter of judgment as to what point it is reasonable to talk about the "average" value. The average is one particular characterization of the distribution, and how relevant it is depends on the situation. If you're running a casino, the average payout of your slot machines is highly relevant. On the other hand, if you're building a levee, building it as high as the average river height is a really bad idea.
One thing to keep in mind is that functions do not generally commute with averaging. That is, average$(f(x))$ is not in general the same as $f($average$(x))$. For instance, if you have a bunch of spheres, the formula $V=4\pi r^3/3$ doesn't work if you plug in the average radius; the average volume is not $4\pi/3$ times the average radius cubed.  So often one needs to do analysis on the whole distribution, and then possibly take the average or some other summary statistic at the very end.
Comment: I am just copied in because I edited this answer but I can reply to the comment. The median versus the whole distribution is a puzzling question just like the original question. The median is only the whole of the information when values are identical and the median is the single value. The two good examples here, wanting to know the average payout and extreme river heights, are both examples in which the median would help very little.
Answer: The average (mean) $\mu_1$ is the first moment of the distribution $f(x)$:
$$\mu_1=\int xf(x)dx$$
There's an infinite number of moments $\mu_k$:
$$\mu_k=\int x^kf(x)dx$$
Knowing the distribution includes knowing the average. Since the argument is that it's better to know more than less, we're told to better know the whole distribution than just its mean (average)
Answer: It isn't always better, it depends what you are trying to do.  But taking just the average can lead you seriously astray.
However, here is a quote from Sir Francis Galton that make some points:

It is difficult to understand why statisticians commonly limit their
  inquiries to Averages, and do not revel in more comprehensive views.
  Their souls seem as dull to the charm of variety as that of the native
  of one of our flat English counties, whose retrospect of Switzerland
  was that, if its mountains could be thrown into its lakes, two
  nuisances would be got rid of at once. An Average is but a solitary
  fact, whereas if a single other fact be added to it, an entire Normal
  Scheme, which nearly corresponds to the observed one, starts
  potentially into existence. Some people hate the very name of
  statistics, but I find them full of beauty and interest. Whenever they
  are not brutalised, but delicately handled by the higher methods, and
  are warily interpreted, their power of dealing with complicated
  phenomena is extraordinary. They are the only tools by which an
  opening can be cut through the formidable thicket of difficulties that
  bars the path of those who pursue the Science of man.
Comment: That has nothing to do with what I wrote.
Comment: No references are really needed.  One is a single number, the other is an entire distribution.  One is a summary. The other is not.
Comment: The median has this same problem.
Comment: In some cases, it's still better than the mean (when we have outiliers for example)

distribution VS average


How does fasting affect violent situations not under my control?

Question: I read an article yesterday about Pope Francis announcing a day of fasting on Sept. 7th for the situation in Syria. According to Catholic/Orthodox/Anglican doctrine, exactly how does my fasting affect violent situations in the middle East?
Comment: Some demons can only be driven out by prayer and fasting!
Answer: Our own wickedness is the cause of the wickedness around the world. Personal fasting is a sign of personal repentance that, it is hoped, will lead God to mitigate similar evils in the world.

Pope Francis said this:

"We will gather in prayer and in a spirit of penance, invoking God's great gift of peace upon the beloved nation of Syria and upon each situation of conflict and violence around the world. Humanity needs to see these gestures of peace and to hear words of hope and peace."

The full text of his September 1st Angelus Address can be found here.
In making this proclamataion, he joins thousands of others in explicitly seeing the fallen condition of the world not merely a result of some generic sin, but our sin.  In calling us to fast, he is calling us to repent of our part in making this world a fallen place.
During the American Civil War, Abraham Lincoln called us to a similar fast.  He asked the nation to "fast and humble" itself as an outward manifestation of our repentance.  The full text can be seen here.  Within that, he wrote a justification as follows:

And, insomuch as we know that, by His divine law, nations like individuals are subjected to punishments and chastisements in this world, may we not justly fear that the awful calamity of civil war, which now desolates the land, may be but a punishment, inflicted upon us, for our presumptuous sins, to the needful end of our national reformation as a whole People? We have been the recipients of the choicest bounties of Heaven. We have been preserved, these many years, in peace and prosperity. We have grown in numbers, wealth and power, as no other nation has ever grown. But we have forgotten God. We have forgotten the gracious hand which preserved us in peace, and multiplied and enriched and strengthened us; and we have vainly imagined, in the deceitfulness of our hearts, that all these blessings were produced by some superior wisdom and virtue of our own. Intoxicated with unbroken success, we have become too self-sufficient to feel the necessity of redeeming and preserving grace, too proud to pray to the God that made us!
It behooves us then, to humble ourselves before the offended Power, to confess our national sins, and to pray for clemency and forgiveness.

In a nutshell - God is punishing us by bringing these events to come to pass.  Maybe if we show our contrition for what we have done, God will relent.
The idea is both simple and has a long basis in history.
Indeed, Paul, in Romans acknowledges the link, in Romans 1:

28 Furthermore, just as they did not think it worthwhile to retain the knowledge of God, so God gave them over to a depraved mind, so that they do what ought not to be done. 29 They have become filled with every kind of wickedness, evil, greed and depravity. They are full of envy, murder, strife, deceit and malice.

The people of Nineveh, when confronted by Jonah (in Chapter 3), made almost the exact same leap:

6 When Jonah's warning reached the king of Nineveh, he rose from his throne, took off his royal robes, covered himself with sackcloth and sat down in the dust. 7 This is the proclamation he issued in Nineveh:
"By the decree of the king and his nobles:
Do not let people or animals, herds or flocks, taste anything; do not let them eat or drink. 8 But let people and animals be covered with sackcloth. Let everyone call urgently on God. Let them give up their evil ways and their violence. 9 Who knows? God may yet relent and with compassion turn from his fierce anger so that we will not perish."
10 When God saw what they did and how they turned from their evil ways, he relented and did not bring on them the destruction he had threatened.

The logic is simple:

Violence is a result of our wickedness
We are sorry for this
Perhaps if God sees our sorrow, he will relent, and change the situation.
Comment: +1 But I am a little bit surprised that you did not include the classic verse 2 Chronicles 7:14 ("if my people, who are called by my name, will humble themselves and pray and seek my face and turn from their wicked ways, then will I hear from heaven and will forgive their sin and will heal their land." [NIV]). Admittedly, explaining how that applies (and does not apply) would add significant length without adding much content.
Comment: Lincoln truly was a moral hero of his day!
Answer: It's not the fasting that affects violent situations in the Middle East, it's what God leads you to do next.
Fasting is a spiritual discipline that helps you focus on God. It's a sacrifice that underscores the seriousness of your prayers. Hunger reminds you to pray and meditate. God responds to prayer by guiding you to actions that you can take to help. You can also choose to donate the money you'd be spending on food to a relevant organization.
If you choose to fast on Sept. 7, you will be a part of a large group of people who are asking God for peace in Syria. God responds by guiding people to their part in the solution. Peace happens when we all do our part.
Comment: Partially true.  It helps us in our response to God. But fasting and praying will not restore peace to Syria. Only people preaching and responding to the Gospel could do that.  Why? because if they truly believed they would start loving.  Begging God to bring peace to the world will not do anything.
Comment: A call to prayer and fasting is an important beginning to a great many things. Some of those people "begging" God for peace might find that the answer is to get up and start preaching the gospel in places like Syria.
Answer: I would add by giving this premise
in Matt 18:18 - "Truly I tell you, whatever you bind on earth will be bound in heaven, and whatever you loose on earth will be loosed in heaven."
Our prayers affect the spiritual realm which in turn affect the physical realm. For example I imagine that SOME denomination's prayer on Sept 7 would go something along the lines of "We bind the works of the enemy and release the spirit of hope and love..."
In Daniel 10:12-14 - tells how an Angel was on his way to answer Daniel's prayer but was delayed the prince of persia (not a real prince but a spiritual power over persia) again the principle holds true.
We pray in the physical
the words are reflected in the spiritual realm
the spiritual realm resolves it (God does what he needs to do)
it is manifested in the physical in the form of miracles and answered prayer
While this applies to prayer in general, keep in mind that fasting IS prayer + abstinence so this principle should also apply. The logical next question would be what would fasting do that regular prayer can't?
From what I've read of scripture, fasting is almost a forsaking of your personal well being for the supplication of another or situation or circumstance. If prayer is potent, fasting is even more so. It is clear with many examples in the Old testament and today (just ask for testimonies of many Christians who fast) that fasting is almost like a more potent version of prayer. (this is just by observation so I can't give you any imperical evidence im afraid).
The greater the need the greater the supplication just like in Mark 9. The disciples could not cast out the demon (even though they could in previous instances) what's different in Mark 9 was the boy was possessed over a long period of time. in verse 23 Jesus famously says "this kind can only be cast out by prayer and fasting".


smoke simulation from different frame rather than from 1 to 250

Question: (I am a beginner in simulations) When i tried to simulate the smoke simulation from 100th start frame rather than 1, the smoke simulation behaves weird. When the animation reaches the 100th frame instead of forming slowly it suddenly creating the smoke around the emission object like a cube.
how to changing this from happening?
Answer: many of the physics simulations should include all frames; for example a fluid simulation that doesn't include frame 1 will render a solid, obscuring volume within the domain for frame 1.   Generally, try to include all frames, and just animate "Use Flow" when inflows are enabled; set a disabled frame 1 (and click the white dot to the right), and then enable and animate that frame when you want it to contribute.  Liquid animation is even more arcane: has to provide at least one active source for each frame to avoid obscuring the volume!


How to have front end and back end use different language?

Question: I am making a Japanese magento store.  The front end should be Japanese locale.
The back end (admin area) should be in English, at least for my admin user.
It looks like this is not possible to do?  The locale setting seems to affect both front and back end.
(Ideally, I think each admin user should be able to set which language the admin interface appears in to them, as part of their user account settings.)
Comment: http://stackoverflow.com/questions/7088830/is-it-possible-to-change-magento-backend-language-for-one-user-only
Answer: Look at the bottom left of your Admin page.


When should class diagrams, data flow diagrams, and flow charts be made?

Question: When should class diagrams, data flow diagrams, and flow charts be made? After making classes or before making classes?
Should data flow diagrams and flow charts be made all the time in all the projects or it depends on some factors? Which factors would they be?
If the developers are short of time, what out of data flow diagrams and flow charts be preferred?
Comment: When you need them.
Answer: This depends a lot on the project methodology your are using (e.g. the Rational Unified Process versus Scrum), and how much you value process documentation in comparison to code.
In some contexts it is important that all requirements and design decisions are traceable: why did we choose this alternative, who decided it, where is it implemented? Usually, this means that a feature is designed separately before it is implemented, and the design is captured with textual descriptions, diagrams, etc.. These documents are deliverables of a design phase. If you have such requirements, then of course the diagrams should be created before writing your classes.
On the other hand, most projects do not need to document each step of their process. In fact, the Agile movement explicitly favours "working software over comprehensive documentation". The code already contains the design, so it is not necessary to create extra diagrams at all. Whenever changes are made to the code (new features added, bugs fixed), the design changes and the old diagrams would be out of date. Updating all documents to reflect the changes takes a lot of effort that could otherwise be spent on adding value. It slows development down.
There is probably a middle ground between these two extremes that is right for your circumstances. For example, I find that a sketch of a diagram can be a very efficient way to communicate a design idea to other people, and that diagrams and overviews are invaluable for introducing new people to a system they are supposed to work on. The code itself contains too many implementation details that detract from the overall design, so "read the code" is not a good response to "do you have some diagram describing your architecture?". This does not mean I have to create detailed diagrams for every class.
Answer: I use Petri's net elements and annotations to create JavaScript programs that use the Acrobat/JavaScript API for PDF form applications. The method begins with creating a diagram to establish the input-output relations of net elements (plus a few annotations), continues with specifying other annotations in two forms and culminates with writing the code – based on coding rules, programming is a direct mapping from the annotations in the diagram and entries in the forms to JavaScript codes.
If you begin with requirements for the logical process of your application then you should consider starting with a diagram (with a Petri Net diagram, you can systematically "generate" codes based on the logical annotations and add other types of annotations as part of your documentation/presentation/etc).
If you are pressed for time then I think it is very important to begin with a diagram (such as a Petri Net diagram) that can be mapped directly to codes. With practice I spend less time debugging codes when I apply Petri's net elements and annotations to computer programming. And the diagram helps me debug the application logic.
Mapping from the diagram and forms to code is systematic. This is why I don't mind making changes to the diagram and regenerating the codes again. However it is very tedious. It is possible to make changes to the diagram and incrementally change the related code. However incremental changes to code may take longer and may be more challenging compared with complete regeneration of code in certain situations.


Why are the higher level elemental spells in Final Fantasy named Fira, Firaga, etc

Question: In some English versions of Final Fantasy elemental spells are named Fire, Fire2, Fire3 while in others they're named Fire, Fira, Firaga (or Thunder, Thundra, Thundaga).
At first I thought it was due to bad English translation, but the English translation is flawless. What does "Firaga" stands for?
Comment: and some have Firaja as the fourth
Comment: In the original FF for the NES, there wasn't enough space to spell out FIRE each time, so it became FIRE, FIR2, FIR3.
Answer: Based on information in this link, the -a, -ga, -ja, etc. endings for spells appear to be a naming convention Square decided on that is rooted in a Japanese grammar structure similar to the english -er, -est (e.g. something described as greater is not as good as something described as greatest).
Comment: And sometimes you also have firaja etc, fieriestest.
Comment: So they're actually called fire, fierier and fieriest. Neat.
Answer: The suffixes (Fire, Fira, Firaga) have been used in Japan since the very beginning. Several other Japanese RPG series have done similar things, like Phantasy Star (Foi, Gifoi, and Nafoi) or the Persona series (Agi, Agilao, and Agidyne). They all refer to levels of a fire-based attack spell, but they follow their own pseudo-grammatical structures.
The early English translations of these games didn't allow enough space in spell names to translate straight across. FF1 only allowed four characters, and FF4 (which we called FF2 at the time) only allowed 5: neither one is enough. FF6 allowed for 6 characters, which would have been enough for Fire and Cure but not Blizzard or Thunder, so they kept the English convention to keep things consistent. When they started being able to use more free-form spell names, they used the Japanese convention everywhere.
Comment: FFVII had room for long-form names but still used numbers...I think VIII was the first to stop doing that.
Comment: don't forget Maragi/Maragion/Maragidyne in Shin Megami Tensei (not just Persona)! (multi-target versions of the tiered spells) I did always wonder about Agilao vs Maragion though. Why not Maragilao?
Comment: @sevenseacat I left out SMT's "Ma-" prefix because it doesn't map to anything in the other series: both FF and PS allow Fire spells to be single-target or group-target, while SMT uses separate spells for each targeting type. You're right that SMT's grammar goes a bit further, but I wanted to keep to the theme of "basic fire spells". As for why I kept the scope as narrow as Persona: as you point out, SMT can get strange with the way its fire spells are named.


How do I add extra cost with cash on delivery?

Question: I have implemented and eshop with commerce module in drupal 8. How can I add extra cost in case the customer chooses the cash on delivery method? I use payment module. Is there any solution or some other alternative? I tried rules also, but there is not any event that is triggered on payment method selection.
Comment: The question would be how will Drupal know when delivery is completed... At some point I think you'd need a second human interaction with your commerce forms. And I think that's the answer. Forms. Either you submit second form, containing the "incomplete purchase form, or something like amazon, let your delivery agent present the purchaser with a mobile form, let that complete your order. Is there more info you could provide? Just looking for a hook maybe?
Comment: @Prestosaurus thanks for the help! What I need basically, is a fixed cost to be added in case a client chooses the cash on delivery method. Ofcourse this cost should be visible and be added in the cart summary total price. I found this [link](https://www.drupal.org/project/commerce/issues/1347160) as well as a module but they are for drupal 7 only..
Comment: Presenting a product with a different price to the user is what `product types`, `product attributes`, and `product variations` are for. But there could be 100 ways to alter a commerce product price. The "fixed" cost could even be"dynamic" based on distance from the shipping address, but, I think having a more concise question will help get a better response... https://docs.drupalcommerce.org/commerce2/user-guide/products/configure-product-attributes, is there a more particular issue?
Comment: @Prestosaurus in my case the cash on delivery extra cost is not related to product or its type but it is universal for all products no matter distance etc. It is an extra fee for a particular payment method. So the question is whether it is possible an extra fee to be added and be displayed in cart summary in any order in case a customer chooses the COD as payment gateway.
Answer: It's been a long time since this has been asked, but I'm adding my input here since I bumped into this while looking for the exact same thing for one of my projects. The way I found as the cleanest and most straight forward, while reading through the documentation, is the use of an order processor class that would check the current order for the use of the payment method in question and add an adjustment accordingly. You can have a look here on information as to how to setup an order processor https://docs.drupalcommerce.org/commerce2/developer-guide/orders/order-refresh-and-process.
The class has to implement the \Drupal\commerce_order\OrderProcessorInterface and it has to provide an implementation of the process method.
<code>class MyCustomProcessor implements OrderProcessorInterface {

    public function process(OrderInterface $order) {
        $payment = $order->get('payment_method')->first()->entity;
//   or
        $payment = $order->get('payment_gateway')->first()->entity;

//... your logic here depending on what you'd like to do

        $order->addAdjustment(new Adjustment([
            'type' => 'fee',
            'label' => 'Payment method fee',
            'amount' => new Price($fee, 'EUR')
        ]));

    }
}
</code>
Based on the instructions above have created this example module https://github.com/GiorgosK/commerce_custom_fees


Could the idiom 'belt and suspenders' be used to refer to a woman?

Question: For example referring to an extremely cautious woman as a belt-and-suspenders kind of woman. Is it correct English (Am. English)?
Comment: It suggests something quite different to me.
Comment: 'Cautious' is not the first image that springs to mind, so maybe the metaphor isn't really working.
Comment: @BarrieEngland  Yes, it manages to appeal to fetishists on both sides of the Atlantic.
Answer: I believe that suspenders when worn by men are what are called braces in British English. Hence we have the expression belt and braces, applied to a course of action in which the participants wish to be doubly sure. Maybe this is what you have heard. It is not necesssarily applied to either a man or a woman.
Comment: In AE usage, however, *a belt-and-suspenders kind of guy* would be immediately understood and entirely idiomatic.
Comment: Oh...so the idea is that one is so cautious that one wears both a belt -and- suspenders (two different methods) to make sure one's pants do not fall down.
Comment: Barrie, while that is some nifty knowledge, this doesn't do anything towards OP's question. And OP had stated this was for American English, which StoneyB has kindly and correctly nudged that _belt-and-suspenders_ was correct for AmE. (I've only edited to supply the tag to make this even more clear.)
Comment: @Mitch: That's certainly the case with the British version.
Answer: In days when suspenders (BE:braces) were standard attire for men, wearing both a belt and suspenders was a common expression for excessive caution: making assurance doubly sure, so to speak.
But women (except the young-and-hip, especially in the late 1970s, when Annie Hall* was popular) have rarely worn suspenders. And as the comments to the question tell you (and as you probably realized), the phrase suggests garterbelt/suspender belt when applied to a woman—only mildly salacious, perhaps, but Not Suitable For Work, as it may contribute to creating an actionably hostile work environment.
So what can you use instead? I don't know of an established catchphrase, but I offer this analogy as a stopgap:
Belt and suspenders suggests not "getting caught with your pants down". Once upon a time the feminine equivalent would have been "getting caught with your slip showing", but that's pretty obsolete by now. A more contemporary indiscretion is jocularly labeled a wardrobe malfunction.
So one who takes redundant measures to avoid such embarrassing exposure might be described as a tape-and-safety-pin kind of woman.
Comment: I've never heard the expression before either. I have a hard time conjuring a NSFW image that has to do with applying this phrase to a woman.  Also, I would have no idea what a tape-and-safety-pin kind of woman would be.  And "getting caught with your pants down" is not anywhere close to a "wardrobe malfunction" unless you interpret it literally.
Comment: I don't get the suggestion. I've never heard the phrase before, and it is somewhat self-contradictory (it's strange to wear both a a belt and suspenders). Also, what does this have to do with 'suspicious'? Can you elaborate the connection and give any 'in the wild' examples that show your expected usage?
Comment: @StoneyB, I guess I could ask my husband or daughter...;)
Comment: @JAM Caught with my pants down! ... I was just trying to make up an alternative expression applicable to female attire, and I couldn't think of a doublet for hem weights.
Comment: Not only have I too not heard "belt and suspenders" (though I like it), I don't think "tape and safety pin" is an idiom at all. OP would have to make it one, and I don't think too-large strapless prom dresses resonate with enough people that it could be trusted to be understood by most people.
Comment: @Mitch  Gosh—am I that old? Wearing both a belt and suspenders used to be a very common expression to describe excessive caution: making assurance doubly sure, so to speak. As far as I know, it has nothing to with 'suspicious'.
Comment: @KitFox  Once upon a time garter belts or suspender belts had a distinct erotic significance. Of course I wouldn't know if that's still the case. As for t&sp, follow the link. One figurative wardrobe malfunction deserves another.
Comment: @JAM  It's not about just prom dresses, you know. Ask your wife or girlfriend. Last time I looked there were more women around than men, so I think it will resonate with 'most' people.
Comment: @StoneyB: your given answer is far from the situation (there is no NSFW concerns about belt/suspenders for anybody, male or female. Your comment however -is- the answer. You should amend you answer to give it. (I don't know where I got 'suspicious' from; please ignore; I probably meant 'salacious').
Comment: @StoneyB: oh...so you made up the tape/safety pin thing? You should probably be more explicit about that so that ESL students won't think that people actually use it currently.


What is the difference between もとづいて and もとづき

Question: What is the difference between both of them? I could not find any explanations so I came here.
Comment: Do you have examples in which you found these?  Mostly this is a literary difference, but not entirely.  Examples of where you found these usages will help us better answer you.
Answer: The reason you could not find any explanation specifically about them is because the difference can be explained as a generic difference between a te-form and a masu-stem:

なく vs. なくて and stem form vs. てform as conjunctions
Connecting phrases with the stem of masu-form
Stem of ます-form as conjuction
て versus combining-form for joining clauses
Is there a term for using conjugating verbs such that the sentence continues with another clause?

Since もとづく is already a stiff verb, the difference between もとづいて and もとづき is small, and they are interchangeable. Still, もとづき sounds relatively a little stiffer or more academic.
Comment: Thanks for the short and helpful answer.


How to tell the polarization (horizontal or vertical) of a microstrip linear array antenna just by inspection

Question: I know that a linear array of microstrip patches can be either horizontal or vertical depending on its orientation.
Does the feed (input port of the array) determine the direction of polarization?
Answer: The short answer is yes, the position of the feed of a single patch determines the horizontal vs. vertical polarization of that patch.
Since all the patches in the linear array are fed in the same way, this determines also the polarization of the array.
See this article, which covers the working of single-patch antennas:

The Basics of Patch Antennas, Updated; By D. Orban and G.J.K. Moernaut; Orban Microwave Products

Some excerpts:

Topics include principles of operation, impedance matching, radiation patterns, circular polarization, bandwidth, efficiency, alternative feed types, stacked patches and higher mode behavior.

[...]
The relevant section for your question is the following:

Polarization
The plane in which the electric field varies is also
  known as the polarization plane. The basic patch covered  so far is
  linearly polarized since the electric field varies in only one
  direction. This polarization can be  anything between vertical and
  horizontal depending on the orientation of the patch. The polarization
  plane  is the xz-plane in Figure 1. For optimum system performance,
  transmit and receive antennas must have  the same polarization. The
  patch described above yields horizontal polarization and when rotated
  by 90°,  the current flows in the vertical plane and the antenna is
  now vertically polarized.

[...]

The previous image, which in the article is used to illustrate how to obtain a circular polarization, explains why the feed position determines the polarization: feed1 and feed2 excite different linearly polarized modes (TM10 and TM01), which combine to give circular polarization. From that it is clear (read the text in the article) that if only one feed is present, it excites just one linearly polarized mode.


Can stars be born giants?

Question: My understanding is that giant stars are formed when they leave the main sequence and begin to burn elements heavier than hydrogen. Can some stars, however, be born as giants or do all stars start off as main sequence dwarfs?
Answer: It depends what you mean by "born". If by "born" you mean commence nuclear fusion of hydrogen, then all stars are "born" on the main sequence as hydrogen burning stars and there aren't any exceptions, but massive main sequence stars can be as large as evolved red giants. However, if by "born" you mean the earliest stages of star formation then yes, stars that are contracting towards the main sequence and are yet to fuse hydrogen in their cores are big and red and have similar radii, temperatures and luminosities to red giants.
Details
Not all giant stars have evolved from the main sequence.
Some main sequence stars are small (G, K and M dwarf stars), but more massive main sequence stars are much bigger and can approach the size of cooler "red giants" that have evolved off the core hydrogen burning main sequence.
The reason for this is that main sequence stellar luminosity depends strongly on mass as something like $L \propto M^{4}$, while the surface temperature goes as something like $T_{\rm eff} \propto M^{1/2}$, but the luminosity of a star is controlled by both its radius and its effective surface temperature as
$L \propto R^2 T_{\rm eff}^4$. Thus the radius of a main sequence star varies as something like $R \propto M$. Plotting lines of constant radius on a Hertzsprung-Russell diagram makes this clearer (see below).

The diagram shows that the hottest main sequence stars (with masses $>30M_\odot$) have radii that are comparable with red giants like Arcturus or Aldebaran. Such massive stars are extremely short-lived (and hence rare) and have a very short (few million years or less) main sequence phase. An example would be Theta Orionis C in the Orion Nebula cluster, which is an extremely young O-type main sequence star.
What is not shown on this diagram though is stars that are in the pre main-sequence phase. These stars are not yet burning hydrogen in their cores but occupy the same region in the Hertzsprung-Russell diagram as red giants and hence have similar radii to red giants. They are contracting towards the main sequence on timescales of millions of years and can be found in star forming regions - see the schematic below, showing of the track of a pre-main sequence star as it evolves towards the main sequence.
Comment: For anyone else curious about the S-shaped kink near the end of the pre-main sequence evolution, it's apparently the [Henyey track](https://en.wikipedia.org/wiki/Henyey_track).
Answer: You seem to be mixing up red giants, a late stage in the life cycle of most stars, and giant stars in general, which are any stars with particularly large radius and luminosity.
Stars larger than about a quarter of the sun's mass will greatly expand and cool toward the end of their life, forming red giants with a small, dense core and fusion occurring in shells around the core. Not all red giants have this origin, and not all giants are red giants. Rigel, for example, is a blue supergiant, Betelgeuse is a red supergiant, and neither was ever a main sequence dwarf.
Comment: This seems rather wrong to me. Both Rigel and Betelgeuse started as main sequence stars, which means they were dwarfs, by definition. (Are you suggesting neither star ever fused hydrogen in their cores?)
Answer: The answer literally depends on which direction you look. Some "dwarfs" born on the main sequence could be as big as "giants" that have evolved off it.
Wikipedia reports that the main sequence, into which all stars are born, is called "dwarfs", but these "dwarfs" merge with the evolved "giants" in their position on the Hertsprung-Russel Diagram and their physical characteristics:

Main-sequence stars are called dwarf stars,[1][2] but this terminology is partly historical and can be somewhat confusing. For the cooler stars, dwarfs such as red dwarfs, orange dwarfs, and yellow dwarfs are indeed much smaller and dimmer than other stars of those colors. However, for hotter blue and white stars, the difference in size and brightness between so-called "dwarf" stars that are on the main sequence and so-called "giant" stars that are not, becomes smaller. For the hottest stars the difference is not directly observable and for these stars, the terms "dwarf" and "giant" refer to differences in spectral lines which indicate whether a star is on or off the main sequence. Nevertheless, very hot main-sequence stars are still sometimes called dwarfs, even though they have roughly the same size and brightness as the "giant" stars of that temperature.[3]

We see this merging in the H-R diagram reproduced below from the article. The white and bluish stars at the upper end of the S-shaped main sequence curve are actually brighter as well as hotter than the collection of "giant" stars seen to the right. Astrophysicists use spectroscopic information, not size or brightness, to distinguish such main-sequence "dwarfs" from evolved "giants".

Source
Cited References

Harding E. Smith (21 April 1999). "The Hertzsprung-Russell Diagram". Gene Smith's Astronomy Tutorial. Center for Astrophysics & Space Sciences, University of California, San Diego. Retrieved 2009-10-29.

Richard Powell (2006). "The Hertzsprung Russell Diagram". An Atlas of the Universe. Retrieved 2009-10-29.

Moore, Patrick (2006). The Amateur Astronomer. Springer. ISBN 978-1-85233-878-7.
Comment: Having read about the possibility of some Gen 1 stars being > 10,000M⊙ I'm wondering if they will ever be added to this diagram...
Comment: A close look reveals that the upper left end on the main sequence curve reveals a few points marked with >10000 sun luminosities (masses are not plotted on this diagram). They would already be pretty big.

Can stars be born giants?


4 lb Shoulder Pork Roast

Question: I took out a Pork Roast that was completely frozen solid (double wrapped) and set on counter. Forgot about it until 6 hours later but it was still frozen. Just started feeling a bit soft on top but not deep - just barely - just surface. Is it still safe to eat? I put it in fridge overnight to complete the thawing process.
Answer: Yes, it is still safe to eat. If the meat itself has been at room temperature for two hours, it is generally unsafe to eat. Your meat never reached room temp, even the meat on the outside.
It may take 24-48 hours for your roast to pork roast to thaw in the refrigerator. Another option you have to speed up that process is place the roast (still wrapped) in a bowl and fill with warm water. Once the water turns cold, change it for more warm water. Do this as many times as necessary until thawed, or do it 5-10 times and refrigerate overnight.

4 lb Shoulder Pork Roast


Why variable object was changed to lexical environment in ES5?

Question: ES5 changed variable object(VO) to lexical environment. What's the motivation of such change since VO is already very obvious as perception?
Comment: @MadaraUchiha Interesting, the ES3 spec actually did use the term `variable object`: http://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%203rd%20edition,%20December%201999.pdf (Section 10.1.3)
Comment: I don't understand the question? What do you mean with `variable object`? Can you give a reference to the specification change that you're talking about?
Comment: I think this would be a great question to ask either Brendan Eich or Allen Wirfs-Brock on twitter, and write the answer here afterwards.
Comment: @nils added a link.
Comment: See also [What really is a declarative environment record and how does it differ from an activation object?](https://stackoverflow.com/q/20139050/1048572)
Answer: I think variable objects are more analogous to environment records.

An Environment Record records the identifier bindings that are created
  within the scope of its associated Lexical Environment.

In ES5 there are two different kinds of environment records:

Declarative environment records are used to define the effect of
  ECMAScript language syntactic elements such as FunctionDeclarations,
  VariableDeclarations, and Catch clauses that directly associate identifier bindings with ECMAScript language values. Object
  environment records are used to define the effect of ECMAScript
  elements such as Program and WithStatement that associate
  identifier bindings with the properties of some object.

So the question would be why declarative environment records were introduced instead of only using object environment records just like ES3 variable objects. The difference is that declarative environment records can have immutable bindings:

In addition to the mutable bindings supported by all Environment
  Records, declarative environment records also provide for immutable
  bindings. An immutable binding is one where the association between an
  identifier and a value may not be modified once it has been
  established.

Immutable bindings don't have a direct equivalent in objects. A property can be defined as both non-configurable and non-writable, becoming immutable. However,

Creation and initialisation of immutable binding are distinct steps so
  it is possible for such bindings to exist in either an initialised or
  uninitialised state.

But you can't have an uninitialized property. If you define a non-configurable non-writable property with value undefined, then you won't be able to initialize it to the desired value.
I don't think it's possible to have uninitialized immutable bindings in ES5. CreateImmutableBinding is only used in Declaration Binding Instantiation and Function Definition, and in both cases it's immediately initialized with InitializeImmutableBinding.
But possibly this was done to allow uninitialized immutable bindings as extensions of the language, like the JavaScript 1.5 const. Or maybe they already had in mind ES6 const.
Answer: The same author whose ES3 article you linked wrote also about ES5 (and even linked that section there). I'll quote Mr. Soshnikov from his "Declarative environment record" section in ECMA-262-5 in detail. Chapter 3.2. Lexical environments: ECMAScript implementation:

In general case the bindings of declarative records are assumed to be stored directly at low level of the implementation (for example, in registers of a virtual machine, thus providing fast access). This is the main difference from the old activation object concept used in ES3.
That is, the specification doesn't require (and even indirectly doesn't recommend) to implement declarative records as simple objects which are inefficient in this case. The consequence from this fact is that declarative environment records are not assumed to be exposed directly to the user-level, which means we cannot access these bindings as e.g. properties of the record. Actually, we couldn't also before, even in ES3 — there activation object also was inaccessible directly to a user (except though Rhino implementation which nevertheless exposed it via __parent__ property).
Potentially, declarative records allow to use complete lexical addressing technique, that is to get the direct access to needed variables without any scope chain lookup — regardless the depth of the nested scope (if the storage is fixed and unchangeable, all variable addresses can be known even at compile time). However, ES5 spec doesn't mention this fact directly.
So once again, the main thing which we should understand why it was needed to replace old activation object concept with the declarative environment record is first of all the efficiency of the implementation.
Thus, as Brendan Eich also mentioned (the last paragraph) — the activation object implementation in ES3 was just "a bug": "I will note that there are some real improvements in ES5, in particular to Chapter 10 which now uses declarative binding environments. ES1-3's abuse of objects for scopes (again I'm to blame for doing so in JS in 1995, economizing on objects needed to implement the language in a big hurry) was a bug, not a feature".

I don't think I could express this any better.
Comment: I also thought something like this. But even if the spec used objects, implementations would be allowed to use whatever underlying data structures they want if the observable behavior is the same, wouldn't they?
Comment: @Oriol Yeah, I guess they could, but it doesn't really fit, as records have a static shape (that's imo the most important difference). Then there's the creation vs. initialisation that you mention in your answer, and also lookup/assignment works quite different (prototype vs scope chains).


Download file from vbscript?

Question: I need a script that can be run on freshly installed windows xp+ and download specified files from internet, like http://www.python.org/ftp/python/2.6.2/python-2.6.2.msi
Is it any easy way to do it without hand-crafting HTTP/FTP requests or using third-party programs like wget? I can suggest that WScript.CreateObject("internetexplorer.application") will do the magic, but documentation on it is extremely huge and Google is silent, as always :).
Answer: Just found this one pasted below. You can run it with cscript and have it scheduled.

   'Set your settings
    strFileURL = "http://www.domain.com/file.zip"
    strHDLocation = "D:\file.zip"

   ' Fetch the file

    Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")

    objXMLHTTP.open "GET", strFileURL, false
    objXMLHTTP.send()

    If objXMLHTTP.Status = 200 Then
      Set objADOStream = CreateObject("ADODB.Stream")
      objADOStream.Open
      objADOStream.Type = 1 'adTypeBinary

      objADOStream.Write objXMLHTTP.ResponseBody
      objADOStream.Position = 0    'Set the stream position to the start

      Set objFSO = Createobject("Scripting.FileSystemObject")
        If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
      Set objFSO = Nothing

      objADOStream.SaveToFile strHDLocation
      objADOStream.Close
      Set objADOStream = Nothing
    End if

    Set objXMLHTTP = Nothing
Comment: +1 for streamline code. This looks much more efficient than using WScript.CreateObject("internetexplorer.application").
Answer: VBScript is annoying unco-operative when it comes to doing things like this. This sort of thing always requires COM servers that aren't formally part of the scripting engine.
Maxwell's suggestion of using MSXML2.XMLHTTP seems a cool way round this. I must admit I hadn't come across that trick before. There are also various commercial COM servers that will do file downoads.
This type of problem is one of the reasons I'm looking at shifting much of my VBScript to Powershell. Because Powershell can seamless use .Net objects, doing such things is a lot easier.
JR
Comment: I second migrating to PowerShell if at all possible. While it isn't a direct answer to the original question - in most cases it would be the right path forward.
Answer: The method using
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")

is more elegant, unfortunately is not very portable since the version of the object changes a lot throughout the versions and updates of Windows.
Using
WScript.CreateObject("internetexplorer.application")

is probably better but less elegant.
Answer: MSXML2.XMLHTTP is built around the old WinInet. There's a newer interface called Msxml2.ServerXMLHTTP, which is more reliable. It is built on a newer MS WinHTTP stack. I suggest calling WinHTTP directly.
Just use CreateObject("WinHttp.WinHttpRequest.5.1") instead of creating an MSXML2.XMLHTTP object. The rest of the code stays the same.

Download file from vbscript?


What does this bra-ket equation mean?

Question: I was reading Griffiths Introduction to Quantum Mechanics and I came across this equation:
$$\langle \psi_a |z|\psi_b\rangle$$
Where z is direction. I don't understand why there are those subscripts a and b and what do we get from this bra-ket. I know that without subscripts it would be expected value of z, but with this notation I have no idea.
Comment: Could you indicate the name of the chapter? (edition and page would also help).
Comment: @Mauricio 11.2.1 3rd edition, page 411
Comment: Instead of being an expected value, this is more of a general inner product or transition amplitude. If you know how to look at the overlap between two states, like the inner product between $|\Psi\rangle$ and $|\Phi\rangle$ being $\langle \Phi|\Psi\rangle$, then you'll be able to compute this: first determine the action of $z$ on $|\psi_b\rangle$ and then compute the overlap between the new "state" $z|\psi_b\rangle$ and $|\psi_a\rangle$.
Comment: The point is that the two subscripts make them two different states. These calculations crop up all over the place in QM even if they don't directly have physical meaning (specifically, they tell could you how to express the elements of the operator $z$ in an orthonormal basis of which two elements are $|\psi_a\rangle$ and $|\psi_b\rangle$).
Comment: Have you encountered the alternative notation $\langle a|\hat{z}|b\rangle$?
Answer: I do not have the 3rd edition but looking at the index I can see it corresponds to time-dependent perturbation theory. In general, $|\psi_a\rangle$ and $|\psi_b\rangle$ are two states. Imagine that you have some interaction that can take your initial state $|\psi_a\rangle$ into $|\psi_b\rangle$ and you wish to know the probability of that happening. Fermi's golden rule is an advanced formula that allows you to calculate the transition rate (the probability of that happening).
What you need to apply Fermi's golden rule is called an amplitude $\langle \psi_b|H_{\rm I}|\psi_a\rangle$ where $H_{\rm I}$ is the interaction Hamiltonian. For electromagnetic waves, this interaction Hamiltonian is associated to the electric dipole which is proportional to the distance in one direction of space (in the coordinates chosen in the book is $z$). So
$$\langle \psi_b|z|\psi_a\rangle$$
is a probability amplitude that measures the projection of $|\psi_b\rangle$ onto $|\psi_a\rangle$ (the overlap) after a given modification (interaction proportional to $z$) . More importantly,
$$|\langle \psi_b|z|\psi_a\rangle|^2$$
is proportional to the transition rate. This kind of amplitudes are very important in particle physics when calculating the results from scattering experiments.

What does this bra-ket equation mean?


Does the Sun orbit a much larger nearby star?

Question: EDIT: I got thumbed down, so I removed the details. The question is already crystal clear, IMO.
Comment: Can you rephrase your question? As such, it is incomprehensible
Comment: How is it now? It's bad english but hardly not understandable. Don't be too pedantic.
Comment: A "much larger star" would be very, very bright. It's not like we could miss it in our sky.
Comment: I thought visibilty/brightness has nothing to do with size and mass but age
Answer: To find out if two objects form a gravitationally bound system we compare their kinetic and potential energies. If the kinetic energy is less than the potential energy the system is bound, while if the kinetic energy is higher than the potential energy the system is not bound.
The nearest big star is Alpha Centauri at 4.35 light years, so let's do the calculation for the Sun and Alpha Centauri. The potential energy is:
$$ U = \frac{G M_1 M_2}{d} $$
where $d$ is the distance between the stars and $M_1$ and $M_2$ are the masses of the Sun and Alpha Centauri respectively. Alpha Centauri is about 1.1 solar masses. For a rough calculation (we should really work in the centre of mass frame) let's take the Sun as fixed, and work out what velocity for Alpha Centauri gives a matching kinetic energy:
$$ \frac{1}{2} M_2 v^2 = \frac{G M_1 M_2}{d} $$
so:
$$ v = \sqrt{\frac{2 G M_1}{d}} $$
Feed in the mass of the Sun and the distance and we get:
$$ v \approx 80 ms^{-1} $$
So the Sun could only be bound in orbit round Alpha Centauri if it's relative velocity is less than about 80 m/s. However the radial relative velocity is 21,600 m/s. So the Sun and Alpha Centauri are not in orbit round each other. You could, with enough patience, repeat this calculation for all nearby stars and convince yourself the Sun isn't gravitationally bound to any of them.
The Sun is of course in orbit round the combined mass of all the stars in the Milky Way, but then the total mass of the Milky Way is about $10^{12}$ solar masses. This means a star is bound to the Milky Way if its velocity is less than about 700-800 m/s, and the Sun's velocity relative to the Milky Way is about 210 m/s.
Comment: I know about Alpha Centauri, that's why I use "much larger" wording and in my original question I wondered if such large star exist at relatively nearby. Alternately is it possible to prove inversely (without knowing other star's force/mass) if the Sun "certainly" doesn't orbit any star?
Comment: Let's pretend we missed out a big star out there, just like we missed russian meteor recently ;)
Comment: @user29931 *"Let's pretend we missed out a big star out there"* You haven't understood the situation. We have a very complete theory of how stars work. Very massive stars are monstrously bright objects at all stages of their life where the word "star" applies to them. We haven't missed one in the stellar neighborhood. There is no comparison to a small, non-luminous object like a meteor.


Sound and image are shifted after importing them into Adobe Premiere

Question: Even if it isn't the case on the IPhone and when reading it on my Windows 10, my .MOV file has its sound and image shifted on Adobe Premiere. I can manipulate the sound regardless of the video but do you have any better idea than faire du bricolage ?
Answer: If you recorded using the IPhone, it could be due to the fact that the camera records in a variable frame-rate or VFR. This means that if the camera can't record a frame, it will skip it and so that second will have 59 instead of 60, and sometimes this can be very bad for longer footage and older phones. After time it those skipped frames will add up.
Adobe programs don't like variable frame-rates, I believe this is because they are "Professional" and don't think they need to support this feature because it's only a problem with low level cameras and recording software. They intend all footage to be Constant Frame Rate or CFR, meaning there is no skipped frames at all. When it comes into contact with VFR they essentially stretch out the footage and frames to fit the entire footage time, while keeping it at a CFR.
I personally don't know any amazing way of fixing this, other than re-compressing it using a program like Handbrake. Using handbrake you can change the footage frame-rate to a CFR. Handbrake is my solution, however it only supports H.264 and H.265, etc so it can be limiting. If you want to make sure you don't lose quality, try finding a different program and rendering it with a lossless codec.
Comment: Thank you for this well documented answer
Unfortunately it seems that Handbrake doesn't recognize .MOV videos


Triangle inequality with complex analysis

Question:
Hi guys, I've calculated the first part, but I don't understand how it is related with triangle inequality. Can someone help?Thanks!
Comment: In this context, the triangle inequality says that the modulus of the first integral is less than or equal to the second integral.
Answer: First, parametrize the $\{|z| = 1\}$ by $z = e^{i\theta}$. Then the first integral becomes
\begin{align}
\int_{|z|=1} (z-1)\ dz = \int^{2\pi}_0 (e^{i\theta}-1)ie^{i\theta}\ d\theta = 0.
\end{align}
For the second integral, we have
\begin{align}
\int_{|z|=1} |z-1||dz| = \int^{2\pi}_0 |e^{i\theta}-1| dt = \int^{2\pi}_0 |\cos\theta-1 + i\sin\theta|\ dt = \int^{2\pi}_0 \sqrt{(1-\cos\theta)^2+\sin^2\theta}\ d\theta  = \int^{2\pi}_0\sqrt{2-2\cos\theta}\ d\theta = 2\int^{2\pi}_0 |\sin(\theta/2)|\ d\theta = 8.
\end{align}
Indeed, we have the triangle inequality
\begin{align}
\left|\int_{|z|=1}(z-1)\ dz\right| \leq \int_{|z|=1} |z-1||dz|.
\end{align}


What do you do if you log in to roblox and then it just kicks you out?

Question: Since probably 1 month ago I have not been able to get into roblox. I log in and then 1 second later it kicks me out right back to where I started logging in and at this point in time I will pay robux to have this fixed. I have just tried loging in to my account that's it. Does anybody know what has happened if this occures or how to fix it please tell me.
Comment: Can you log into the Roblox website or another place outside the game that uses that account?
Answer: That is the kind of thing only Roblox support may fix.
If the game does crash (you are suddenly on your desktop and the game is not on) you might want to uninstall/reinstall the game. Something is corrupted in your install.
I don't know Roblox, but since its an online game we can assume your progression is not saved on your PC. So you will lose nothing.
If the game doesn't crash outright (sends you back to desktop) you might be banned. Then your only option is Roblox support.
Answer: Try uninstalling Roblox and after that login using the website instead of the app, once you've done that reinstall Roblox and see if it works.
:]
Comment: Are you speaking from experience or just making something up that sounds plausible? Not to be rude or anything, but you cite no sources nor indicate _why_ the OP should try this workflow.
Answer: Delete Roblox, go on to the website and log in. It will tell you if you are banned or not.
This just happened to me, and it was the result of a 7 day ban.
Comment: This sounds like a good response to the answer. I dont play Roblox, but I have a lot of familiarity with the systems employed in what you describe. It sounds odd that you would not be given this feedback (account banned) without deleting the game - are you sure you cant just log in to the website without deleting the game to find out this information? It might be that you followed the other answer, first, so you naturally had the game deleted. *Its bad form to need the player to delete the game before telling them the have been banned*.
Answer: I tried logging into my account but I couldn't. After that day, I got into my account. I just had to wait 1 day to get to my account, so maybe that might work for you.


All combinations and number of permutions of each combination with three kinds of items

Question: I have three kinds of items (infinite supply): $a$, $b$ and $c$. I want to choose freely from the infinite large collection of items and put them in $n$ number of boxes. However: Only one item is allowed in each box and I am not allowed to put item a in the first box. Neither am I allowed to let neither $a$:s nor $c$:s be in adjacent boxes. What are all the possible combinations I can get and how many permutations are there for each combination if there are $n$ number of boxes?
Comment: What did you try? Do you have any thoughts.  If yes then please share because asking a question without showing your work might attract downvote.
Comment: My comment was too long to be posted here. ...
Answer: Well... I made a series of matrices and tried to figure out the patterns. Since b is allowed to be placed anywhere, let us let the exponent of b be equal to the total number of variables minus the sum of exponents of the other two variables. I found, that if one of the variables a and c are non-present the coeffcient can be derived from Pascal's triangel. All 1:s have coefficents 1,2,3,4,5... all 2:s 1,3,6,10,15 ... all 3:s  1,4,10,20... etc. If a and c are 1, then the coeffeficient is a perfect square. If there are 2 c:s and 1 a they seem to be 1*2, 3*3, 6*4, 10*5... and 1*3, 3*4, 6*5, 10*6 ... for 3 a:s. If there are 2 c:s and 1 a they are 1 , 5, 15 ... As for a^2c^2, I beleive they are 1, 7, 28 ...
So ... There are clearly patterns here, but it is hard to work it out without running a simulation. This is actually part of a larger probability problem I am working with. I really should learn programming! The online calculators are very good, but you can't make algorithms for solvning problems and making many simultanious calculations. Online calculators also collaps when the expressions you put in get too massive.


Android application to keep track of how much time I spent on each application

Question: I am looking for an Android application that can keep track of how much time I spent on each application (i.e. counts when the application has the main focus and the phone is being used). If possible, free and also record the number of clicks and keystroke in each application.
Answer: I would recommend you check out App Usage Tracker. It does a lot  of things that you are looking for:

Tracks how much time is spent on apps
It's free
Data can be exported for viewing later
Only tracks main window in focus

Right now, it only tracks how much time is spent on a window when it is in focus, but they are working on tracking multi-windows in their next release. You can also customize it to be more accurate and consume more battery or less accurate and consume less battery.
Answer: Used Frequency App to solve this problem. Pretty nice app. But not all features are available in free version
Comment: This post does not contain enough information to be considered an answer. Please [read our discussion on what makes an answer high quality](//softwarerecs.meta.stackexchange.com/q/356/185) to see if you can incorporate some of these improvements into your answer, otherwise it might be removed. Especially, answers must show how each requirement is met.


How to use dissolve a subset of a PostGIS table based on a value in a column

Question: I have a spatial table in PostGIS that has millions of land parcels. The parcels have ownership information and also a column that specifies whether the parcel is private or public. I would like to merge/dissolve only the private parcels that have the same owner name and share a boundary (adjacent parcels owned by same owner) but also keep the private parcels that were not dissolved.Below is a sample table. Based on this table I would like to dissolve parcels with id 2,3, and 4 into a single parcel (assuming they are adjacent) but also keep parcel with id 1. I tired using ST_Union but when I specify the union on column owner_name, all the parcels (including parcel id =1) just have one column owner_name in the final table. I would like to keep all the columns for the parcels that did not merge/dissolve and keep only owner_name for the merged/dissolved parcel. So parcel with id 1 should have all the columns and the merged parcel from 2,3,4 should have only owner_name. How can I achieve this? Ideally I will like to keep all the resultant data in one table.
Answer: One way to do this is to cluster the owner polygon groups using ST_ClusterDBSCAN (as suggested here).
By clustering with a very small distance value, each cluster should contain only adjacent polygons, or a single disjoint polygon.  Then the clusters can be merged using ST_Union.
Counting the number of records forming each merged polygon allows distinguishing between single and multiple parentage.  Other column values can be preserved by using the MAX aggregate (in absence of the more appropriate FIRST aggregate function).
Here's a synthetic example showing the approach:
WITH parcels AS (
SELECT
  i id,
  'Name ' || i AS owner,
  CASE j
  WHEN 0 THEN ST_MakeEnvelope(0,i, 1,i+1)
  WHEN 1 THEN ST_MakeEnvelope(1,i+0.5, 2,i+1.5)
  WHEN 2 THEN ST_MakeEnvelope(3,i, 4,i+1)
  WHEN 3 THEN ST_MakeEnvelope(5,i, 6,i+1)
  END geom
FROM generate_series(0, 5) t(i)
  CROSS JOIN generate_series(0, 3) s(j)
),
cluster AS (
  SELECT *, ST_ClusterDBSCAN(geom::geometry, 1e-10, 1)
    OVER (PARTITION BY owner) AS cluster_id,
  FROM parcels
)
SELECT MAX(id) id, owner, COUNT(*) size, ST_Union(geom) geom
FROM cluster GROUP BY owner, cluster_id;

Comment: One issue with this approach is that polygons which touch in only a single point will still be merged.  This is data-dependent, so may not be a problem.  But it would be nice to find a solution which does not have this limitation.
Answer: As I am new to spatial SQLs, I was not able to use the above mentioned method. I ended up using a longer approach but that definitely worked. If there is someone like me who is not very well versed with spatial SQLs they can try this approach. Here is how I tackled this problem:
First I created a table from the existing table where for_symbol = 'PRIVATE PROPERTY'
CREATE TABLE b AS
SELECT *
FROM original table name
WHERE for_symbol = 'PRIVATE PROPERTY'

Next I added a field for updating the count of owner_name. This gave me the number of times an owner was repeated
ALTER TABLE b
ADD column count_number int;

and updated with the following SQL
with counted as (
   select owner_name, count(*) as name_count
   from b
   group by owner_name
)
update b
  set "count_number" = c.name_count
from counted c
where c.owner_name = b.owner_name;

Next I created two tables from table b, one where count_number >1 (call this table c) and other where count_number = 1 (call this table d). I merged the parcels using ST_Union for table c (because owners are repeating in this table). I also used ST_Dump to convert multi-part parcels to single part. Here are the SQLs for that
CREATE TABLE c AS
 SELECT owner_name, ST_Union(geom)
 FROM b
 WHERE count_number > 1
 GROUP BY owner_name;

For table d I used the following SQL
CREATE TABLE d AS
 SELECT *
 FROM b
 WHERE count_number = 1;

Next, I used ST_Dump to convert polygons in table c to single part form multi-part. I had to create a new table for that (let's call this table as e)
CREATE TABLE e AS
 SELECT c.owner_name,
 (ST_Dump(c.st_union)).geom AS geom
FROM c;

Next step was to combine/merge the two tables (d and e) into a single table. Make sure the columns of both the tables is same and the order of the columns is also same. So you will need to add the columns in table e that match columns in table d. Otherwise the two tables will not merge if the columns and their order is not same. If your order is not same, you can specify the order in the SQL and it should work. Here are the SQLs
For adding columns in table e
ALTER TABLE e
ADD gid int
ADD apn varchar,
ADD owner_zip_code varchar,
ADD city varchar,
ADD state varchar,
ADD county varchar,
ADD for_symbol varchar;

For merging the two tables into a single table
CREATE TABLE parcel_final AS
(SELECT gid,owner_name,apn, owner_zip_code, city, state, county, for_symbol
FROM d
UNION
SELECT gid,owner_name,apn, owner_zip_code, city, state, county, for_symbol
FROM e);

I am aware that this is not an ideal approach, however I just posted this solution here so that it might help someone like me who is almost a beginner level SQL expert.


What is a good technique to remove a glued-in mirror without access to its edges?

Question:
http://imgur.com/MKkZfSZ
I'm trying to get this mirror out without making a total mess of the surrounding drywall. Any best practices?
Comment: Been a few years since I completed this project, but BE SURE TO WEAR A RESPIRATOR AND EYE PROTECTION.  Mirror adhesives, especially in older homes often contain asbestos.
Answer: 3 possibilities that I can see.

Tape every square inch of it and just start smashing. Wear serious eye protection and a face shield, gauntlet gloves, heavy clothing, head covering, ... in short, don't have any exposed skin.
Tape, protect yourself (as above), and try to get a pry bar under the edges. You'll need to do a bit of drywall repair, but you might get lucky and not have a pile of shards.
Buy (rent?) a specialty suction cup slide puller. (This is scary at the best of times and probably unavailable at normal rental...) Edit to add youtube link: https://www.youtube.com/watch?v=dQne8Caw1LI
Comment: Went great with a combination of your first two suggestions- was too tight to get my pry bar in with any effect so I gave the top right corner a love tap to get things moving. With it all taped I gradually peeled it down piece by piece, prying off at the adhesion points. Thanks again!
Comment: I might score a few lines to encourage it breaking into manageable rectangles as much as possible (then proceeed as in **1.**). You could also *try* something cute with a standard puller, and something glued to the face of the mirror for it to pull on, rather than the hard-to-obtain suction cup puller. I'd do that on a center section after "tic-tac-toe" scoring in the hopes of popping that section out and having lots of edges to work with/from.


Mechanical Relationship between two variables

Question: Recently I attended a conference in which one of the authors was talking about the mechanical relationship between variables "X" and "Y" (I don't remember exactly the variables) and possible sources of endogeneity. I searched a lot on the net for the meaning of the mechanical relationship between two variables, but I found nothing. Can anybody help me out in this regard? It is much appreciated.
Answer: This is an interesting question.
I am not sure about the meaning of the "mechanical relationship". But, it seems that it is a sort of "mathematical" relationship. You can read more about this phrase and
its relation to the endogeneity problem in the article below, for example (paragraph 2 below Table 2), if you are interested in Finance.
Ornelas, J. R. H., Da Silva, M. S., & Van Doornik, B. F. N. (2022). Informational switching costs, bank competition, and the cost of finance. Journal of Banking & Finance, 138, 106408.
Personally, I am looking for the opposite phrase of the "mechanical relationship"! Any comments?


Statistic for requests in deployed VPS servers

Question: I was thinking about different scalability features, and suddenly understand that I don't really know how much can handle one server (VPS). The question for them who have loaded projects.
Imagine server with:

1 Gb Ram
1 Xeon CPU
CentOS
LAMP with FastCGI
PostgreSQL on the same machine

And we need to calculate count of request, so I decided to take middle parameters for app:

80% of requests using one call to db with indexes
40-50 Kb of html
Cache in 60% of cases

Add some other parameters, and lets calculate, or tell your story about your loads?
Answer: I would look at cacti - it can give you plenty of stats to choose from.


Need help with 你们不是向着我的吗?

Question: I found the phrase discussed in the title of this question on the 海贼王 manga (One Piece).  I have not found this phrase anywhere else, and have put this on other forums without much success.
Answer: Actually, it can be a real sentence in oral Chinese.
向 can become a verb. It has 2 possible meanings based on the situation.
First one mean "face to ..". The sentence can become "are you all facing to me?".
The other meaning "are you on my side"/"don't you support me".
For your case, I think it probably be the second meaning.
Answer: I am pretty sure that it's a translation typo. There is no verb in this sentence. It probably should be:
你们不是想着我吗? Meaning: Don't you miss me? or maybe: Hyahyahya, didn't you all miss me after this long time?? Depends a bit on the context.
What's the context of the story? Is it when some bad guy gives a surprising visit or something like that? Then my answer is probably correct.
Answer: It is certain that this sentence means 'why don't your guys stand by me as you did before?'

Need help with 你们不是向着我的吗？


I created this circle with geometry nodes but its not filling faces, I connected Fill curve node but still not working

Question: I Just want to create a pie chart animation, so i created a circle with goemetry nodes but its not filling faces of up side
Comment: @Akshay2005 Just putting in something in the _Fill Curve_ node will not produce any output either with the original setup. Although it is technically possible to connect multiple geometries to different outputs on the _Group Output_ node, only a geometry output in the top position will create any kind of mesh, curve or volume output. If the _Curve_ was on top, the curve geometry would be the output. This is one of the reasons why the _Join Geometry_ node exists. And if there was anything else at the top, like a float or vector outpur, you won't see any of your geometry
Comment: @GordonBrinkmann I know, In fact I was going to answr the same thing that has been answered. But I thought let this person figure out the rest. Saw the comments on the answer, came to know that this is an absolute beginner. But then at that time the answer was already provided.
Comment: Place the fill curve node between the arc node and the curve to mesh node. Right now the fill curve node does not have an input so obviously it cannot output anything.
Comment: I already did that but when i do that the circle height go away means its make that a flat circle
Comment: Look at the answer provided by Laserlars
Answer: Nodes are Functions. You should pass the Curve geometry to the fill node. In your Setup, the Fill Node has no Input (and the Result is not used by any geometry) and so nothing is passed into nowhere.

Next, you could try to extrude it (since the Fill Curve creates a Mesh):

This extruded Mesh has no bottom Side (here you can see the N-gons option of the Fill Curve - it is better in this case as it will not create unwanted inner edges):

This can be fixed by joining the original filled arc and the extruded one together. (And while you're at it: Since you disconnected the Group Input, you will need to Set Material for the new-born mesh...)

ATTENTION!
Thanks to Markus von Broady and Akshay2005 for pointing this out: For an optimal mesh geometry, the Face Orientation needs to be corrected and the overlapping vertices, caused by the Join Geometry node, should get a Merge by Distance afterwards, to avoid Non-Manifold Geometry:
Wrong face orientation in the bottom geometry (blue = outward facing, red = inward):

With this Setup, the mesh should be clean:
Comment: Flip the old faces or flip the offset of extrusion, because you don't want the base to face inwards.
Comment: @LaserLars Don't forget the merge by distance node. Although most probably not required in this setup you should add that. So that if someone else uses this answer, and does require to deform or something this mesh later, they will have issues.
Comment: The thing in the original node setup is also that the _Fill Curve_ node is connected to a separate geometry output on the _Group Output_. Only a geometry output in the top position will create any visible output, everything else is ignored.
Comment: okay so now how i add the extrude effect in that in Z axis?
Comment: I added it to the answer.
Comment: Thanks you, it worked!
Comment: .. and until GN solves the quite tricky problem of a usable  _Bevel_ .. the merge will play well with a _Bevel_ modifier below the GN
Comment: Thank you Markus and Akshay, I added your suggestions in the answer.


Export/Import folders and files from one Sharepoint site to another

Question: I have seen a few threads/posts that touch on this question, but the answers seem to be aimed at SharePoint developers.  I am not a developer, programmer or coder -- I am a technical writer that needs a (hopefully) reasonably easy way to have the folders, sub-folders and files on my company's SharePoint site exactly mirror those on a government SharePoint site. Keep in mind that I am fairly new to SharePoint. I have no problems with the action of uploading files, it's just the issue of simplifying site-to-site copying/mirroring.
At the moment, the only way I see to do this in an organized way is to
1.) Create the same folders and sub-folders on my government laptop
2.) Download the files from my company's SP site to the proper folders on the laptop, and then
3.) From my company's SP site, go to each folder/sub-folder and browse the folders on my laptop to upload files.
Please let me know if there is an easier/simpler way -- thanks in advance.

David G.
Answer: Using GUI, you can open Explorer View and make simple drag and drop.


How do the Amazons of Themyscira know English?

Question: It would seem that they cut themselves off from civilization and it's considered a Greek island. How would they even know what English is?
Comment: I think her transparent aeroplane translates every language in the mind... just like TARDIS.
Comment: The Amazons may have chosen to isolate themselves but they were in possession of advanced technologies such as the Purple Healing Ray. It is easy enough to imagine they had both the intellectual capacity and the ability to listen to radio broadcasts from around the world. Using magic or technology as well as virtual immortality, it seems reasonable they would likely know the languages of the most warlike and dangerous nations in the "Man's World."
Comment: They all went to Plot College.
Answer: Wonder Woman:
It's been a while since I read any Wonder Woman, but I believe she has a magical ability (built into her armor, tiara, or other gear) that allows her to speak/understand all Earth languages.
It may also be that her gifts from the Greek Gods included this ability (along with strength, speed, etc).
Themyscara:
The treatment of Themyscara, however, has been inconsistent and frequently gone unexplained.  The best explanation I can recall (though I do not have a reference) is that part of the magic which hides it from 'Man's World' allows the Amazons to speak/understand anyone on the island, or possibly just speak/understand anyone.  Given all the reboots, continuity changes, etc, it's difficult to say for sure where any particular minor ability comes from.
Beyond that, the Amazons have been shown to rescue people from shipwrecks.  They have possibly learned different languages from them.
Comment: Diana's ability to speak all languages was a part of her gift of wisodm from Athena.
Comment: @Monty129: Yup.  In at least one continuity.
Answer: There doesn't seem to be an explanation for this in either the 1970s TV show, or the DCEU movies. This has been addressed in the comics though...
In the original Pre-Crisis / Earth-Two continuity, the Amazons were able to observe the outside world using a Magic Sphere, given to them by the goddess, Athena.

HIPPOLYTE: Come, let me show you the Magic Sphere you've heard me talk about. It was given to me by Athena, the Goddess of Wisdom, just after we conquered the Herculeans and set sail for Paradise Island! It is through this Magic Sphere that I have been able to know what has gone on and is going on in the other world, and even, at times, forecast the future!
That is why we Amazons have been able to far surpass the inventions of the so-called man-made civilization! We are not only stronger and wiser than men -- but our weapons are better -- our flying machines are further advanced! And it is through the knowledge that I have gained from this Magic Sphere that I have taught you, my daughter, all the arts and sciences and languages of modern as well as ancient times!

All-Star Comics Vol 1 #8

In the Post-Crisis / New Earth continuity though, the Amazons apparently didn't have the Magic Sphere, and didn't start learning English until after Diana's first visit to the outside world.
Despite being granted wisdom by Athena as part of her origin, the Post-Crisis version of Diana didn't understand English upon her initial arrival in the US. However, Hermes led her to Professor Julia Kapatelis, who was proficient enough at Greek to communicate with Diana in her own tongue. Diana was then able to learn English quite quickly, by simply hearing enough of it.

Wonder Woman Vol 2 #3

Wonder Woman Vol 2 #5

Much the same applies in the current Rebirth / Prime Earth continuity. Diana again spoke no English upon her initial visit to the outside world, but was able to pick up the language quite quickly, thanks in part to the empathic power of her lasso.

Wonder Woman Vol 5 #6

Wonder Woman Vol 5 #10

Wonder Woman Vol 5 #12
Answer: It would depend on the continuity.  I agree with the apologetics already provided, but in Young Justice, many of the alien cultures and "lost" civilizations would speak other tongues unless and until the audience received the benefit of a translation spell or universal translator technology.  It was my understanding from someone working on production that they had plans- far out- to explore the Amazons and produce yet another audible language for them.  Unfortunately we never got that far.
To elaborate on some of the above apologetics, the Amazons see Diana as an ambassador to Man's World, thus attempts at knowing the foreign language and culture are often seen as the bare minimum requirement for being an effective ambassador.  In most renditions, the Amazons have their finger on the pulse to Man's World, sufficient to know it is time for them to send Wonder Woman into it... so through the course of those observations, it may have been Diana's opportunity to learn English, etc.


Is this a power cable coming from utility line?

Question: Slightly confused as to what this wire is. Is this power? This house was built in the 1950s and I believe had knob and tube wiring. However I noticed that I do have a service drop for electrical on my roof.
Answer: Generally power poles have a tier system.
(optional) Top top top = lightning arrestor cable (grounded) placed so lighting will hit it instead of the power lines
(optional) Top top = high voltage (note fat or stacked insulators) and often 2-wire, but can be 3-wire, and on a cross-bar.    You will often see them go to weird fixtures, such as the cutout switches on the 2nd pole.
Upper = 120/240V AC power distribution (3 wires) on short insulators usually on a crossbar.  All the triplex service drops to houses will come off this.
Middle = Telephone
Bottom = cable TV
On your photo, the standard telephone splice boxes can be seen on the middle tier.
Yours is going to the bottom tier, so it's cable TV.
Comment: As a former CATV technician, I can confirm this answer. It's a poor installation, however. The self-supporting wire molded into the coaxial cable is secured to the house, but bending the coax over on itself and securing it in the manner displayed is less than optimum. The cable tie should be removed.
Comment: How do I remove this? Do I call cable company?
Answer: That is a cable line so it would be your internet, phone and or TV or any combination of them.
The main power coming in to your house is the triplex (3 wires twisted together) that in the 3rd photo posted run up to the lower cross bar on the utility pole
Answer: The twisted wires that are around the bolt are steel to support the electric cables . They are/should not be tied into any electric. Your house was built about 50 years too late for knob and tube ( in US).


Best practice for fetching ERC20 token balances for a given address

Question: Are there any best practices to fetching all ERC20 token balances for a given address? I am open to using external APIs.
Answer: One approach is identifying the ERC20 contract first, you can do this by different heuristics. Once you have the list of ERC20 contract addresses you use JSON RPC to do a eth_call for each ERC20 using the ERC20 ABI to obtain the balance of the address you want.
To identify the ERC20 contracts in a blockchain you can:

Download the code of each contract and search for the function signatures (32 bits) of the ERC20 methods. The bytecode of all the ERC20 contracts will include those 32 bits for each method. You can have false positives.
You can do this after step 1, you check the events emitted for each address to identify the standard ERC20 events, this will eliminate false positives.
You can just do a few eth_call to the candidates from step 1, to check the result is successful for functions such as totalSupply, decimals, symbol

You could do 3 without without doing 1 first but that would be more time consuming.
If you will do this often then you need to create an indexed DB. Once you have the ERC20 identified you create a service to monitor events from those contracts using JSON RPC. That server will extract the source and destination address from events such as Transfer and update the balance for those addresses in the DB.
If you use a third party service you will be trusting a third party and that is not a good decentralized system practice.
Comment: I don't have a particular contract in mind, I'd like to fetch *all* ERC20 tokens for a given address (kind of like what Etherscan does).
Comment: You can use a third party API, what I described is how those API work. There isn't an index in the blockchain where you can ask all the ERC20 tokens owned by a given address. You can search events but you don't know if they are from ERC20 tokens, you need to get the list of ERC20 tokens contracts first.
Answer: Developer advocate at Chainstack here.
This is one of the common tasks that should have a simple way but don't, unfortunately. Getting this kind of data from the chain is certainly possible but not as straightforward as it should be; I'll give you two options here.
Using Subgraphs
The first and best option if you want to index the data yourself is to use a Subgraph, which allows you to index data coming from smart contracts; since smart contracts manage ERC-20 tokens, this is a good solution.
Here, you can find a guide from the Chainstack dev portal showing you how to index ERC-20 tokens with Subgraphs, which include balances. You can essentially make an API from this.
You can then query the data using Python if you want to.
Indexing ERC-20 token balance using Subgraphs
Chainstack offers Subgraphs for various chains, so you can do this for multiple networks if needed.
Use third party APIs
A good solution for a quick way with close to zero setup is using an API like Covalent. You can also find an integration with Chainstack, which allows you to access their APIs.
You can use this endpoint, or this SDK I made.
Full disclosure: I am a dev advocate at Chainstack, and feel free to reach out!


Trying to take two timestamps, subtract them, convert the difference to seconds and store in an int variable

Question: I'm having trouble understanding getting timestamps, subtracting them, and being able to assign and use the difference in future calculations. I am using Java in Android Studio.
When I use SimpleDateFormat and Calendar, I'm able to get the current time in HH:mm:ss but I'm not sure how to subtract two of those timestamps from each other and convert the difference into seconds. My end goal is to take the difference, convert it into seconds, assign it to an int, and later compare the value to other, predetermined values. This is a project in Android Studio so I have buttons already set up to fetch the timestamps.
Example:
 - Get a current timestamp, say 16:50:32
 - Get a second timestamp in the near future, say 16:53:29 (roughly three minutes later)
 - Subtract those two timestamps and store the value in seconds, so the final value would be 177 (seconds)
 - have this value of 177 in a variable so that I can do more things with it.
I'm able to use the following code to get the timestamps
Calendar calendar = Calendar.getInstance();
SimpleDateFormat startTime = new SimpleDateFormat("HH:mm:ss");
timeTest = startTime.format(calendar.getTime());

SimpleDateFormat endTime = new SimpleDateFormat("HH:mm:ss");
timeTest2 = endTime.format(calendar.getTime());

But after getting two timestamps I do not know how to subtract them, convert them to seconds and store them in an int value.
Comment: Maybe you could use `System.currentTimeMillis()` at the start, end and then subtract them. Then convert to seconds.
Comment: As an aside consider throwing away the long outmoded and notoriously troublesome `SimpleDateFormat` and friends, and adding [ThreeTenABP](https://github.com/JakeWharton/ThreeTenABP) to your Android project in order to use java.time, the modern Java date and time API. It is so much nicer to work with.
Comment: Please take a look into our help center for tips on increasing your chances of good answers. The first thing it says is: *Search, and research and keep track of what you find. Even if you don't find a useful answer elsewhere on the site, including links to related questions that* haven't *helped can help others in understanding how your question is different from the rest.* ([How do I ask a good question?](https://stackoverflow.com/help/how-to-ask))
Comment: Does this answer your question? [In Java, how do I get the difference in seconds between 2 dates?](https://stackoverflow.com/questions/1970239/in-java-how-do-i-get-the-difference-in-seconds-between-2-dates) Please search for many more similar questions and answers.
Answer: Are you using Java 8?
If so you could convert to Instants and get the Duration between them:
    Calendar cal = ...
    Calendar cal2 = ...
    Instant instantOne = cal.toInstant();
    Instant instanceTwo = cal2.toInstant();
    Duration between = Duration.between(instantOne, instanceTwo);
    long seconds = between.getSeconds();

I assumed there was a reason you're using Calendar to begin with (it passed to you without your control?) ... If not then you can just use Instant.now() from the get go and cut out pre Java 8 date/time classes
Answer: Here's one way you can easily do it using LocalDateTime.
LocalDateTime instance1 = LocalDateTime.now();
//Do stuff
LocalDateTime instance2 = LocalDateTime.now();
long elapsedTimeInSeconds = instance1.until(instance2, ChronoUnit.SECONDS);
System.out.println(elapsedTimeInSeconds);

Since you already have a timestamp, assuming it's in the form of a String you can convert it to a LocalDateTime like so:
String timestamp = "2012-08-15T22:56:02.038Z";
LocalDateTime instance = LocalDateTime.ofInstant(Instant.parse(timestamp), ZoneId.systemDefault());

Edit: Changed LocalTime to LocalDateTime to fix rollover issues with previous solution.
Comment: While `LocalTime` is good for representing a time of day just like the strings in the question are supposed to (much better, indeed), they are not so good for difference calculation. You never know whether midnight is passed in between. It will also work incorrectly when summer time (DST) begins or ends. Allow me to suggest `ZonedDateTime` instead.
Comment: @OleV.V. Fair enough, mate.
Comment: @OleV.V. Thinking about it, `LocalDateTime` should work identically without the day rollover issues so I will just edit that in.
Answer: The good answer by tomgeraghty3 may be all that you need. I am contributing a supplement.
java.time and ThreeTenABP
If I understood correctly, you really had two requirements:

You need to be able to represent the start and end times in HH:mm:ss format.
You need the elapsed time between start and end in seconds.

Don't represent your times as strings, though. Doing calculations on those is pretty hopeless. Represent your times by proper date-time objects. Only format into strings when you need to give string output.
    DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss");

    ZonedDateTime start = ZonedDateTime.now(ZoneId.systemDefault());
    TimeUnit.SECONDS.sleep(175); // Simulate that time passes
    ZonedDateTime end = ZonedDateTime.now(ZoneId.systemDefault());

    long diffSeconds = ChronoUnit.SECONDS.between(start, end);

    System.out.printf("From %s until %s was %d seconds",
            start.format(timeFormatter), end.format(timeFormatter), diffSeconds);

Example run:

From 05:49:41 until 05:52:36 was 175 seconds

Of course to see it run, stick in a smaller number like 3 or 6 instead of 175 first.
If printing HH:mm:ss format was not a requirement, you may use Instant instead of ZonedDateTime as in the answer by tomgeraghty3. Since in Instant is independent of time zone you would then leave out the argument to the now method:
    Instant start = Instant.now();

Similarly for end.
Depending on the work you need to do on the value you may want to consider the Duration class to represent the difference rather then a simple count of seconds. This too is demonstrated in the answer by tomgeraghty3.
Question: Doesn't java.time require Android API level 26?
java.time works nicely on both older and newer Android devices. It just requires at least Java 6.

In Java 8 and later and on newer Android devices (from API level 26) the modern API comes built-in.
In non-Android Java 6 and 7 get the ThreeTen Backport, the backport of the modern classes (ThreeTen for JSR 310; see the links at the bottom).
On (older) Android use the Android edition of ThreeTen Backport. It's called ThreeTenABP. And make sure you import the date and time classes from org.threeten.bp with subpackages.

Links

Documentation of the Duration class
Oracle tutorial: Date Time explaining how to use java.time.
Java Specification Request (JSR) 310, where java.time was first described.
ThreeTen Backport project, the backport of java.time to Java 6 and 7 (ThreeTen for JSR-310).
ThreeTenABP, Android edition of ThreeTen Backport
Question: How to use ThreeTenABP in Android Project, with a very thorough explanation.


cell phone make screechy noises while on call

Question: I'm using Sony Xperia J , Why does my cell phone make screechy noises while on call? sounds like a dial up modem
also , my cellphone is not rooted
Answer: There are three reasonable possibilities:

Your phone has a problem, most likely hardware.
Your service provider is having problems.
Your phone is not fully compatible with your service provider.

Possibility #1 is the most likely.
To check for #2, call your service provider and see if they are having issues.  To check for #3, ask your provider if your phone is compatible with their network.