Is it unprofessional to ask a manager about the salaries of their employees

Question: I have a couple of friends in managing positions from an industry that I plan to work in the future. Is it appropriate to ask them about the salaries of the position that I am interested in? Keeping in mind that I may work in their company. I'll make it clear for them that it's ok for me to take no for an answer.
Comment: What is your location? How close are they as friends?
Comment: Does this answer your question? [Why is discussing pay such a taboo? How can I get people to talk about concrete figures?](https://workplace.stackexchange.com/questions/15397/why-is-discussing-pay-such-a-taboo-how-can-i-get-people-to-talk-about-concrete)
Answer: Before making any decision (on anything significant) it is sensible to find out all you can about the matter using a number of disparate sources. Assuming you ask politely, it's not unprofessional - it's market research.
That said, instead of asking "how much does a ... on your team earn" (which could put them in an awkward position from a GDPR/Data Protection perspective) ask a more generic question like "what range salary could a ... with 10 years experience expect to earn in your industry" or "what would be the starting salary for a ...".
However, asking your friends would result in a very small sample size. Recruitment agencies regularly carry out market surveys to benchmark salaries for all types of roles. This helps them guide both candidates and employers on what salaries are realistic for the role in question. They are often quite detailed too and will break down the package into base salary, commission, bonus etc.
Get in touch with a recruitment agency that works in that industry and ask them or google something like "auctioneer salary atlanta"
Answer:
Is it unprofessional to ask a manager about the salaries of their employees?

Yes

Is it appropriate to ask them about the salaries of the position that I am interested in?

Yes
But note these are two very different questions!
When you're interested in a job starting the conversation on the topic of salary is common, expected even, and it's absolutely fine to discuss this directly. What are your expectations, what are theirs? Do they align?
The thing you must not ask about or discuss is specifics about salaries of anyone other than you.
That you're friends with the people you're asking has no bearing here: the above is true whether you've known them for years or just met.
Comment: I'm saying he should ask about the salary of his possible position :-) Just not about the specific salaries of other people with similar positions
Comment: Why shouldn't he ask for the salary of his possible position?
Answer:
Is it unprofessional to ask a manager about the salaries of their employees?

It's not only unprofessional, it's illegal for a manager to disclose their employees' salaries depending on your locale. I recommend you use salary websites (such as Payscale, Paysa or Glassdoor) to do your research instead.
Comment: Thanks for your answer. I live in a country where these websites aren't used that much so I can't get a solid estimate.
Comment: Or, with other words: it's legal for a manager to disclose their employees' salaries depending on your locale;)
Comment: In most companies, the company doesn't allow the manager to disclose employee's salaries. In many countries, it would be illegal (violation of the employee's privacy rights). In most countries, employees would be up in arms if they found out (violation of the employee's privacy rights), which is also bad for the manager.
Comment: @gnasher729's got it right on the nose.
Answer: "You are a Buyer.  You want to make a Deal.  It's none of your business to ask about any other Deals that the same Seller might have made to any other Buyer."
"The Seller, if he is willing, will make you an Offer."  This Offer is a Binding Business Proposition.  For the most part, you must either Take It or Leave It.  Do not look a gift horse in the mouth.


Questions on ending of Thor: The Dark World

Question: Sorry, not quite sure how to format spoilers so I tried to keep the title vague.
Here's for the new Thor movie (just watched it last night):

 How did Loki fake dying (and managed to fool Thor, the reinforcements who found his body and possibly Odin since he would have wanted to see the body after it was brought back)?

And follow-up:

 Also, in the end, he's shown to have pretended to be Odin on the throne while talking to Thor about Thor's decision to stay on Earth. Where is Odin and how did Loki manage to do this? Did he do something to Odin?
Answer: Loki was the soldier that told Odin about his own death. We saw him shift. It was the same face he had used when he shapeshifted into a guard in front of Thor earlier in the film. Since every other illusion was cancelled when touched, I'd say he was really in Thor's arms, and the illusion was him dying, not the body. He must have done something slightly different afterwards to create a convincing corpse. Perhaps he found another corpse and disguised it? I'm sure there were plenty around.
I'm interested to see what happened to Odin. Loki probably caught him off-guard while in disguise. I think the events of the film, particularly Frigga's death, really took a toll on Odin, so he wasn't really up to his usual game. Loki no doubt took advantage of that.
Comment: @SachinShekhar: I think we can assume that Loki happened to him.
Comment: I am skeptical of the ending of Thor 2, because at the best, it is simply a plot hole; Loki (as Odin) says to Thor "you once told me there would never a wiser king", but when Thor said that, Loki was already gone from Asgard, so how would he know? Further, as Loki has always wanted the throne, I find it incredibly unlikely that he would offer the kingship to Thor so readily, since there's not really any way for him to know that Thor would turn it down ahead of time. Talk about a major gaffe. I hope there is a solid explanation to come, or I will remain severely disappointed in this scene.
Comment: @misceleniious You may want to add Kevin Feige's answer about Odin's fate from this interview: http://io9.com/all-your-questions-about-thor-2s-multiple-endings-1462563061
Comment: Makes sense, thanks! I didn't see the flash of him shifting into the soldier, so I guess it's my bad. Now it's just a question of what happened to Odin :) I read a theory somewhere else that Odin probably went back into Odinsleep since he woke up halfway through it in the first movie to save Thor and Loki (reinforced by his "moment of weakness" when Odin was arguing with Thor in front of the downed ship after the attack).
Comment: Then, what happened to the real soldier Odin sent to Dark World?
Comment: Also, where was the story arc where Lady Sif was jealous of Jane Foster and competing against her for Thor's affection? It seems like they kind of just skipped over that entirely.
Comment: There are like... thousands of fanfiction about how this progressed. I suggest you people check a3o Some of them are quite hilarious.
Comment: @TylerH I never doubted that Loki knew exactly how Thor would react to that offer. As for Odin's fate I saw a speculation that he is at a secret meeting of the Sky Fathers.
Answer: The soldier turns up and says to Odin "...we found a body". Then Odin responds "Loki". Two interpretations: 1) Odin thinks it was Loki's body that was found OR 2) Odin recognizes that the soldier was actually Loki disguised as a soldier, and thus voices out his recognition of Loki.
I like to think that Odin did actually recognize Loki from the first instance and knowing that Loki intended to take over the throne, Odin managed to alert Sif and Volstagg to do something about the Aether before Loki gets hold of it himself.
Answer: I don't have anything to add to the first part of misceleniious's answer, but there are two interviews of note about Odin's fate.
In an interview with io9, Kevin Feige (President of Production at Marvel) said:

Is it safe to say that Odin is dead now?
I would not say that it's safe to say, no. I don't know what Loki did to him.

This seems like a piece of misdirection, although it's a line that Anthony Hopkins (the actor who played Odin) agrees with. In an interview with The Los Angeles Times:

Odin's fate is left rather ambiguous at the end of the new film. What's ahead for the Allfather?
I'm not sure. He hasn't physically died on screen, but I played him as a man who's on his way out. I think they would have to explain in "Thor 3," if there is one, what happens to Odin. Or maybe it'll just be a story line, maybe he went to Tahiti or something for a holiday. I don't know.

This is quite an interesting answer. (Spoilers for "Agents of SHIELD")

 At the beginning of AoS, Coulson makes many pointed references to his recovery being in Tahiti. He's also apparently unable to say the word "Tahiti" without adding the phrase "it's a magical place", and it's been heavily implied throughout the show that something else is going on that he doesn't know about.

 It's unlikely that Anthony Hopkins mentioned Tahiti by coincidence. Whether he's seen AoS or not, I'll guess that Tahiti is significant in the MCU. Perhaps his comments will make more sense once its meaning in AoS has been explained.
Comment: +1 for the AoS link. It does seem like they're using that show to set up a lot of things
Comment: I'll note that knowing what Coulson's "Tahiti" refers to doesn't help one whit in the "what happened to Odin" department. So it may just have been a random reference, after all.
Answer: In the scene where Loki is struck by the Kurse, we don't see him activate the void-grenade on the curse. It's not unreasonable to assume that Loki was the one who activated the grenade, whilst the illusion of himself was the one that got stabbed.
Later we see a guard on the dead dark elf world and a flash of green indicating that Loki is using his illusion magic. Clearly we know that Loki survives from this. What isn't clear is what happened to the guard that went searching on that planet, or how he arrived there (Bifrost vs. Short Cut).
The guard returns to Odin, and says they found a dead body, and Odin says 'Loki.' Not a question though, but sudden realisation. I can only speculate if he is recognising the Guard as Loki, or if he is hopeful that it's not Thor they found, who is admittedly his favourite.
What happens between then and the final scene where Loki!Odin is anyone's guess but I'm sure it will be explained in the next set of films. What's possible is that Odin is the Odin-sleep or in the prison, but that's just speculation.
Answer: As you see in the other scene, Loki cuts off Thor's Hand, but it is only an illusion, it might be that he uses the same spell when he is Stabbed by Kurse :D
Answer: There was a flash of green as we saw the reinforcement so it's possible that Loki was the reinforcement that told Odin about Loki's death.
Answer: According to the director, Alan Taylor, Odin is dead.

"That was a big twist. It took us a while to realize that we were actually going to kill him. And then it took us a while to realize that we were going to do that at the end."
Answer: My opinion: Odin is still alive, and when Loki pretended to be Odin, the real Odin went to the Dark Planet to search for Loki's corpse.


Is it a pattern day trade if you close position in after hours?

Question: Say I am buying stock XYZ, is it possible to close my position, in this case sell, as soon as open market hours close and not have it count as a day trade or do I have to wait until the next market open?
Comment: Your title refers to being flagged as a pattern day trader, but your question makes no reference to this.
Comment: @ChrisInEdmonton fixed it.. and only 9 years later
Answer: If you bought stock XYZ during the day, and then you sold XYZ in after hours (after 4pm ET) that same day, then it still counts as a day trade in terms of the pattern day trader rules.  If you don't want it to be a day trade, then you will have to wait until the next morning to sell it.
Comment: From what I have found the exact actions that define pattern day trading is left to the judgment of each brokerage firm. Some make the cutoff at the end of evening extended hours (20:00 eastern), other make the cutoff at midnight eastern and others at the open of morning extended hours. This applies to time of trade execution not placement of the order. Even more gray area with some brokers offering 24 hour extended-overnight trading on select ETFs.
Answer: I know that corporate actions, such as splits or dividends, are considered next day as of 20:00 eastern time. 20:00 is also the change from the PM session to "extended overnight" EXTO session.07:00 is the start of the AM session. This is info is for stocks only, other securities have their own thing. Even options exchanges have different extended hours.(which is odd considering that they are treated similar to the underlying stocks in most regulations, tax code, and the generic regular-hours examples of day trading.)
Seems to be a rather elusive topic, possibly the volumes are so low that the situation is rare, the official rules may also have sloppy semantics that just don't define the specific cutoff times.


QGIS 2.8 Convert a vector to a raster layer

Question: When I change a vector layer to raster using raster button->converse->Vector rasterization in QGIS2.8. I get only a black picture.
Why is that so and how can I convert a vector layer to a raster layer.
Comment: It sounds like at some point you're off your spatial reference which means the raster doesn't line-up with your vector (or the other way around). Are you trying to rasterize into an existing raster or create a new one?
Answer: Rasterization depends of the field that you select. For example, in the following case I selected (in vector layer point_2) the 'field' field whose values are all 0. The result, point_2_raster.tif, is the same that you are obtaining (a black picture):

However, if the 'id' field is selected, whose values are between 1 and 5, the result (point_raster.tif) is totally different:

It could be your problem.


How to import PCB 3D model (step file) designed in MCAD software in Altium and place PCB footprints, and route it?

Question: I have my PCB board from Mechanical Design software as a Step file. Now, I want to import it into Altium Designer and place PCB footprints, and do the routing etc. I am looking for some guidelines or Tutorials. Any and all help is appreciated.
Comment: Does it have to be a 3D shape? Or is the outline enough?
Answer: Defining the Board Shape from a 3D Body (https://www.altium.com/documentation/18.0/display/ADES/((Defining+the+Board+Shape))_AD)
This feature redefines the board shape based on a surface (face) of an imported 3D STEP model. It can be used to quickly create a complex board shape and helps integration between electronic and mechanical design areas. This is a two-stage process: first the STEP model is imported, then the required shape is selected from the STEP model.
To do this:

Switch to View » 3D Layout Mode.
To import the STEP model (.step or .stp) place a 3D body (Place » 3D Body), then in the 3D Body mode of the Properties panel, select Generic in the 3D Model Type region. Select Embed Model or Link to Models in the Source region to import the required STEP model. Note that this STEP model can be deleted once the board shape has been redefined.
Select Design » Board Shape » Define from 3D body.
The Status bar will prompt you to Pick a 3D body. Click the imported 3D body to select it.
The cursor will change to a crosshair and the Status bar will prompt you to Choose Face. As you hover the cursor over each face, it will be outlined. Click to select the correct face.
The Board Outline Creation Successful dialog will appear, displaying options on how you want the imported 3D model positioned in relation to the newly-defined board shape. These can be ignored if you are planning on deleting the STEP model, otherwise configure the options as required.
Comment: I edited my answer, according to your additional inputs
Comment: the board comes from a very space constrained mechanical body. So, the shape and physical dimensions of the board are important otherwise, it won't fit in its position.
Answer: I just looked around and I found something on the Altium website. Maybe this can help you. Here you can also find more information about PCB design.
To place a 3D Body and populate its contents in the PCB Editor, select Place » 3D Body from the main menu, create its object shape and choose the Generic option as the 3D Model Type in the Properties panel. The Souce section in the panel will then offer three alternative source options for importing a STEP files:

Vault – Browse to a connected Altium managed content server and select a 3D model file revision. Altium Designer detects if this file is updated.
Embed Model – Browse and load a suitable file from disk. The model data is stored (embedded) in the PCB file.
Link to Model – Select a Model file from a folder registered in the Choose Model dialog – typically, the file might be shared with an MCAD designer. This file will be linked to the 3D Body, so any file updates made in the MCAD domain will be detected by Altium Designer when the file is opened.


How to pass a command line switch to XCode when I start 'Build and Debug'

Question: I have a XCode project and I can 'build and debug' with it.
But how can I pass a 'command line switch' so that XCode to invoke with that command line switch when I 'build and debug'?
Thank you.
Answer: In the executables group, you can get info for the executable and set arguments and environment variables in the Arguments tab.
Answer: If you want to pass extra compiler flags to the compiler, open up your Project Settings, find the setting named Other C Flags, and add your desired compiler switches.


About a multiple integral

Question: In my current research, I'm confronted with the justification of some facts, and I don't know how to proceed in proving them, so I need to know if there exist some theorems (precisely three theorems) which allow me to do so.
The problem I am investigating is the following: I have an explicit real valued function $f$, DEFINED and CONTINUOUS on each point of $D=]0,1[^4 $. As it is customary to do, let $f(u,v,w,t)$ be the value that this function takes at point of $(u,v,w,t)\in D$: $f$ cannot be defined at the boundary of $D$ and I can't extend its domain of definition $D$ in order to define it on the whole $\overline{D}=[0,1]^4 $, the closure of $D$. I know that
$$
f(u,v,w,t)=\sum_{n=0}^{+\infty} f_n(u,v,w,t)\quad\forall (u,v,w,t)\in D
$$
where $\{f_n\}_{n\in\Bbb N}$ is a sequence of functions defined and continuous over $D$ which can be extended as continuous function on $\overline{D}$. This makes me think that, for all integers $n$,
$$
\displaystyle \int_{0}^1 \int_{0}^1 \int_{0}^1 \int_{0}^1 | f_n(u,v,w,t)| \mathrm{d}u \mathrm{d}v \mathrm{d}w \mathrm{d}t\quad \text{ exists.}
$$
And now the questions.

What theorem (be it a necessary and sufficient or only a sufficient condition) would allow me to prove the following formula?
$$
\begin{split}
\int_{0}^1 \int_{0}^1 \int_{0}^1 \int_{0}^1 & f(u,v,w,t)\mathrm{d}u \mathrm{d}v \mathrm{d}w \mathrm{d}t \\
=&\sum_{n=0}^{+\infty} \int_{0}^1 \int_{0}^1 \int_{0}^1 \int_{0}^1 f_n(u,v,w,t)\mathrm{d}u \mathrm{d}v \mathrm{d}w \mathrm{d}t
\end{split}
$$
What theorem (be it a necessary and sufficient or only a sufficient condition) would allow me to perform any change of the order of integration respect to any of the variables involved, in order to have for example that
$$
\begin{split}
\int_{0}^1 \int_{0}^1 \int_{0}^1 \int_{0}^1 &f(u,v,w,t)\mathrm{d}u \mathrm{d}v \mathrm{d}w \mathrm{d}t\\
= & \int_{0}^1 \int_{0}^1 \int_{0}^1 \int_{0}^1 f(u,v,w,t) \mathrm{d}w \mathrm{d}t \mathrm{d}u \mathrm{d}v  \\
= & \int_{0}^1 \int_{0}^1 \int_{0}^1 \int_{0}^1 f(u,v,w,t) \mathrm{d}v \mathrm{d}u \mathrm{d}t \mathrm{d}w \quad ?
\end{split}
$$
Finally, suppose that one further hypothesis is made over $f$:  $f$ depend on a parameter $ a \geq 0$, call it $f_a$ and suppose that $\forall (u,v,w,t) \in ]0,1[^4$  the mapping $a \mapsto f_a(u,v,w,t)$ is $C^{\infty}$ over $ \mathbb{R}_+$: what theorem (again be it a necessary and sufficient or only a sufficient condition) allow me to say that
$$
g:a \mapsto \displaystyle \int_{0}^1 \int_{0}^1 \int_{0}^1 \int_{0}^1  f_a(u,v,w,t) \mathrm{d}u \mathrm{d}v \mathrm{d}w \mathrm{d}t \in C^{2}(\Bbb R^+)
$$
and
$$ g''(a)=\displaystyle \int_{0}^1 \int_{0}^1 \int_{0}^1 \int_{0}^1  \displaystyle \frac{\mathrm{d}^2}{\mathrm{d}a^2} f_a(u,v,w,t) \mathrm{d}u \mathrm{d}v \mathrm{d}w \mathrm{d}t
$$
i.e. would allow me to differentiate twice under the integral symbol?

I know what theorem allowing me to have 1) 2) and 3) in case that $f$ is defined over an interval of $\Bbb{R}$ and so in case a simple integral
Could anybody help me please? Does there exist a freely accessible reference over the internet where I can find such theorems?
Answer: The condition
$$
\sum_{n=1}^\infty
\displaystyle \int_{0}^1 \int_{0}^1 \int_{0}^1 \int_{0}^1 | f_n(u,v,w,t)| \mathrm{d}u \mathrm{d}v \mathrm{d}w \mathrm{d}t < +\infty
$$
will let you do 1,2.  Alternatively, $f_n(u,v,w,t)\ge 0$ will also let you do 1,2 wit the proviso that you have to allow value $+\infty$ for both sides.
Comment: thanks mister Gerarld for your help.  for having  1) and 2),  do i need , further more the condtion you wrote , $ \displaystyle \sum_{n \geq 0} \displaystyle \int_{0}^1 \int_{0}^1 \int_{0}^1 \int_{0}^1 | f_n(u,v,w,t)| \mathrm{d}u \mathrm{d}v \mathrm{d}w \mathrm{d}t $ converge? thanks
Comment: @mamiladi ... you are right, I forgot the $\sum$ in there.  I added it.

About a multiple integral


Ubuntu doesnt use the FGRLX graphics driver?

Question: I have got the Ubuntu 12.04 64 Bit LTS Version and I want to play games with Steam. I tried out TF2 and it runs and has decent (not good) performance. I believe that my drivers are still running on the standard driver and not the AMD proprietary one.
I installed AMD drivers with gui and restarted the pc, but after that it just said the graphic driver is activated but not in use. If I type AMD in dash, I can access the control center and can change brightness with it.
In System Option -> About , it says that I'm using Graphics: VESA: 01, but I'm actually using a HD 7870.
How can I find out what graphic card I'm actually using or how can I install this one correctly?
Comment: how is it not in use? Did you install through "Additional drivers" or from AMD site? Do you mean that in System Settings > Details it says "Driver: unknown"?
Comment: You have your GUI working good? You can see the desktop but you have graphical issues?
Comment: edited my question
Answer: Be sure first to install "Additional Drivers", usually you find it in the menu, or it can show in your panel as an update warning.
If you are a bit more brave you can also try to install the propietary driver from the AMD site.
Once you are sure the correct driver is intalled and running properly, it can fix your performance problems.
Give a try to the instructions here:
AMD Catalyst Ubuntu Precise Installation Guide
After installing it you can test it with the commands
~$ fglrxinfo

~$ fgl_glxgears

Comment: thanks for ur reply, i tried it out with my current options, the console says: "simon@simon-pc:~$ fglrxinfo
display: :0  screen: 0
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon HD 7800 Series
OpenGL version string: 4.2.11978 Compatibility Profile Context

simon@simon-pc:~$ fgl_glxgears
Using GLX_SGIX_pbuffer
" the gears where displayed correctly and very fast, why is display0 and screen 0 or is this nothing to be worried about
Comment: @FroZenViper It's nothing, short and simple: It's how Linux designates devices if you were to have another card it would be device1 or attach another display, display 1.


Why Some Simulation Scenarios Don't Look Real?

Question: I have been using Monte Carlo simulation to evaluate A/B testing algorithms for quite a while. I noticed some simulation cases produced by simulation are never seen in real data. For example, the attached graph is p-value chart for testing if version 1 is better than version 0. You can notice p-value reaches above 95% at around sample 25,000 and then quickly drops below 5% around sample 50,000. I never saw this kind of pattern in real data. If this is a valid observation, how to explain it? Is it because real data is somehow auto-correlated while simulation is conducted under the assumption that observations are generated independently(i.i.d)?
Comment: You need to tell us more on what is your real data and how did you conduct the Monte Carlo simulation, otherwise this is unanswerable. Obviously: if you ran MC simulation that makes wrong assumptions, than it would not give results that are aligned with the data.
Answer: There may be an issue on the cycle length of the random number generator, which could be an issue for large n!
Apparently, cycles repeat at some point.
Try adding a random choice to which of two (or more) possible new random #s you will select. If a repeating cycle issue, this will add randomization.
See if you can detect any improvement.
Comment: Wit repeating cycles, you are assuming in here that they had generated more than $2^{19937} - 1$ samples? My best guess is that this was not the case.
Comment: Not sure I understand your answer. Can you elaborate on cycle repeat or offer links to articles/papers talking about this phenomena?


Why can't I keep water out of my nose and throat while swimming?

Question: I recently learned to do the front crawl.  I am following the advice I've read online about exhaling the entire time my face is under water, and relaxing.  Regardless, pool water is choking me, coming up through my nose, and running down my throat.  Also, though I am trying to relax and not rush things, once in awhile my heart is beating very fast and I am very out of breath after swimming just a small distance.  What might I be doing wrong?  For perspective, I am a long distance runner and I don't think I have any fitness issues that would cause me to be so tired after such a small swim.  I mention both the being out of breath, and the water in my nose and throat, because I think they may be related.
Comment: Make sure you are breathing out through both nose and mouth, even if barely, all the time you are not actually inhaling.
Answer: It is difficult to say without seeing your swim stroke, but I suspect that when you are breathing, you are over rotating, with your head pulled back rather than being in a neutral position. That would allow water to enter in your nose.
When swimming freestyle, you don't really move your head much. The top of the head should be in the water, which will create a little bit of a "bow wave" effect, and you breathe in the trough that is created. There is almost always a little bit of water that can enter into the mouth, but you generally exhale it out with the breath.
And while you may be in good running shape, swimming involves many more muscles (especially upper body) that aren't used to the effort. Also, it's very technique driven, so if your technique is poor, you will fatigue faster as you "fight" the water. I would recommend an adult beginner swim program, it will help immensely. If that is not feasible, look at programs online such as swimsmooth and Total Immersion.
Answer: You should try a technique involving moving your soft palate into the right place by saying the letter 'T'. Try mouthing the letter and you will see that you cannot breath through your nose, so water will not get in to choke you. Here is a more detailed explanation: http://blog.swimator.com/2011/04/getting-water-up-my-nose-while-swimming.html
Answer: Exhale through your nose, too, in addition to the other advice. Even if you're swimming fast (or, rather, particularly then) you can exhale both through the mouth and nose. Benefits are at least twofold: you get the air out quicker, getting ready to inhale properly, and the air going out of the nose keeps you nose nice and comfortably not waterlogged.


Converting from 240v to 117v

Question: I want to convert this device from 240v to american 110v
I noticed on the bottom of the photo i have a blue wire going to 240v input.
Can i simply move the blue to 117 to make it work in US?
or do I have to change the transformer as well? (41305H0000 / TB-60)
Comment: It appears that the Gray plug that contains the Blue wire, may be plugged in reverse. In Europe the Blue wire is Neutral, Brown is Hot, Green/yellow is Ground. In the USA, White is Neutral. DO NOT fuse the Neutral or Ground lines, and you may need to add a polarized plug to the US cord to eliminate any possible connection errors. Verify which line the Fuse is in, and move the Hot line to the 117 location. (The Blue wire may not be from the power cord, the photo does not give that information, so the Blue wire may just be used internally in the device.)
Answer: Eh, you might.  Can you take the board out and post a picture of the back?  Generally those sort of line voltage selection jumpers change the transformer tap configration.  However, it looks like that they may have cheaped out on this one as there are unconnected pins on the header going to the transformer.  Looks like there should be a yellow and an orange wire there that are not present.  Not surprising as it's made in china - a transformer with no taps will be a little bit cheaper than one with taps.
Alternately, if you can't take the board out, can you unplug the transformer and line voltage selector and use a multimeter to figure out which line voltage select pins are connected to the transformer header?  If the 117 volt pin is connected to one of the unconnected pins going to the transformer (which I suspect) then you're going to have to swap out the transformer, unfortunately.
Comment: I tried swapping the blue to 117 input but nothign happens. probably is correct what you said. I can buy another transformer, they are cheap... the output voltage seems to be  around 9v (still AC.. is it possible?)
Comment: i don't know much about electronics...if i buy a transformer 117 > 12v is that ok or do i burn anything?
Comment: You can probably get away with that.  However, I would like to see a picture of the back of the board first to make sure that nothing else is connected on the AC side.
Comment: I'll try to remove it...it's just a pain in the butt to unscrew everything ;) Doe the code on the transformer mean anything? I'm trying to find some on Jameco but with no results...

Converting from 240v to 117v


How to boot M2 Pci express Card HP Gen8 Dl360P

Question: I recently purchased the HP GEN8 DL360P server. I wanted to install an operating system to use M2 with a pci express card on this server. However, the server does not start boot with the pci card. What can I do?
Answer: You probably need to adjust the BIOS/UEFI settings for the system to make sure the system sees the drive on the PCIe card, and that it is at the top of the boot order or just after removable media such as an attached USB memory stick and any internal DVD-ROM drives.


Can we modify the highlighted questions color?

Question: I found pretty difficult to distinguish between an highlighted and a non-highlighted question on the Arduino site. Is it just me?
Answer: Unfortunately we can't change that. All Stack Exchange sites use the same design during their beta phase. If/when we graduate to a full site, we'll get a custom design.
With that said, the difference between highlighted and non-highlighted seems reasonably clear to me. Perhaps you need to adjust some display settings on your system?
Alternatively, you could use a browser add-on which lets you write a script to modify the design automatically on-the-fly (e.g. GreaseMonkey).
Comment: I don't know, maybe I'm too used to the Stack Overflow bright orange. Thank you for the info btw.


Linux image (.img) file compatibility between dd,partclone,partimage and clonezilla

Question: In Linux , is the image (.img) file compatible between dd ,partclone ,partimage and clonezilla.Actually i want use the partclone to create a image from a partition,and restore it to another partition using dd or dcfldd.Is it possible , because partclone mentioned as it is a special image format. Thanks.
Comment: Under linux, a dot and some subsequent characters in the name of a file has no defined meaning.  If `partclone` makes an image and calls it `foo.img` or `bar.exe` or `baz.wtf` it is irrelevant to what the file actually contains.
Answer: I would venture to say no even without looking through their documentation and source code. At least not directly.
I do know that Clonezilla uses compression on their images, which I think they just pipe the output of dd through gzip.
Answer: ".img" is not standardized. dd copies each bit exactly as it is to the file you create. according to their website partclone doesn't do that:

Partclone provides utilities to back up and restore used-blocks of a partition ...

i'm not 100% sure but i doubt that this works.
Answer: From the partclone dev repository's Trac page:

Partclone provides utilities to back up and restore used-blocks of a partition and it is designed for higher compatibility of the file system by using existing library, e.g. e2fslibs is used to read and write the ext2 partition.

I added an emphasis to the important part.  It appears that partclone reads the files on the filesystem as files, and then adds them to an image.
In contrast, dd works by reading the disk or partition as a block device, bit by bit, and makes an exact copy of exactly what each bit is on the entire disk or partition.  This means that dd picks up filesystem bits, the contents of unused sectors, and so on.
As such, it appears that dd would expect far more information than is provided in a partclone image file.
As such, it appears that writing an image using dd would require in the image the presence of far more information than is provided in a partclone image file.
In conclusion: dd cannot be used to write images made by partclone no matter what.
Comment: technically, `dd` doesn't expect any info at all -- it's just copying bits from place to place...


Is it true that if the structure damaged or corroded, the stress will be lower?

Question: I  am comparing the stress results between original or non-corroded model to corroded model.
I found that the stress value in non corroded model is lot more bigger than the corroded model,
is it correct?
Comment: If the load stays constant and material is removed then what do you think will happen...
Comment: Stress applied?
Comment: See https://engineering.stackexchange.com/a/22924/10902
Comment: How did you compute the stress? Maybe the stress could be lower if you only looked at the maximum local stress, since corrosion could smoothen sharp edges and reduce stress concentrations.
Comment: Without any additional information, like the materials, degree and soort of corrosion, the way it undergoes the stress, duration of experiment and the distribution of data, it is very difficult to say. I throw you a hint, if the material capable is of relaxation, then it is quite natural to predict decrease in stress.
Answer: Maybe it is correct, maybe it isn't.
Suppose you "corrode away" a small radius that was causing a stress concentration, and it becomes a bigger radius. Quite likely the maximum stress in the  structure (at that concentration) will decrease because of the corrosion. For example an "average" stress of 1.0 and a stress concentration of 10.0 might become an "average" stress of 1.1 and a stress concentration of 9.0. Whether you count that as a "decrease from 10 to 9" or an "increase from 1.0 to 1.1" is your choice.
On the other hand if you reduce the cross section of a structural member like a beam, or the thickness of a plate, the stress will probably increase - i.e. stress = load/area, and you decreased the area.


Using project management tools like MS Project or Primavera in an agile team

Question: Do project management tools like MS Project and Primavera make sense in a software team and for a software product, assuming that the team is following agile practices and uses, e.g., Scrum. Are things like product backlog, sprint backlog, etc. replacements for, e.g., work breakdown structures, Gantt charts, etc. or, ideally they should be used together for a successful project management?
Comment: We use Trello (essentially a scrum board), and it has enough functionality to meet most of our project management needs.  But we are a very small team (of 4), and we don't have a project manager, just stakeholders.
Answer: MS-Project and similar project planning tools mainly focus on on the scheduling of tasks. They excel at managing scheduling dependencies between task, resources assignment, workload and duration of tasks.
In an agile context, these features are not very useful: the tasks are very dynamic,  driven by the backlog, and self-organized by the team during the iteration. Working together on backlog items cannot be predicted months in advance and documenting it on the flow would be a huge overhead. The duration of iteration sets the pace and not the duration of individual tasks/activities/responsibilities. Lastly, the dependencies between tasks is fuzzy and rarely hard-sequential.
So, project schedulers are not very useful and risk to be an overhead. At best, they can be used to give some visibility on a high level product roadmap and report progress in a corporate way (if required). For larger teams they can also visualize different components in the scope (parallel and overlapping project activities in the scheduler, scheduled by hand: don't expect a CPM here due to the fuzzy dependencies).
In an agile context, the time dimension of the project is rather straightforward: you define iterations (very often time-boxed), and the team self-organizes. No need for MS project for documenting this. The key feature that you need is to manage backlogs items. This is more efficiently done with Jira, Trello and similar tools. And these also cope better with story points, which would be very challenging to do with project schedulers ;-)
Comment: @Shayan I have worked enough with this approach to confidently tell that it works ;-) About the estimation, an approach that works well for me is analogous estimating (of the project or its main sagas, comparing to experience on similar projects). Radically different because at the start, all the details are not known: if you'd estimate bottom-up there would be too many unknowns.And it would lock you in a plan making everybody change-averse, the contrary of agile.Pragmatically, there's a high level estimate, and then there er the short-term near future estimates when planning current iteration
Comment: @Shayan if you're interested in the topic, I'd recommend a book because it's too complex for Q&A here. E.g. Mike Cohn's "Agile estimating & planning" ? He also has a blog about the fundamentals (https://www.mountaingoatsoftware.com/presentations/agile-estimating)
Comment: Thank you. Good answer. You said: "At best, they can be used to give some visibility on a high level product roadmap". What tools/practices are used in agile development that help realizing that? Maybe one reason I thought about tools like Primavera or MS Project is to be able to devise a roadmap and have an estimation of when things will probably be done. Having such a roadmap I may be able to better decide about, e.g., how many new developers we should hire. How do other agile teams handle these things?
Comment: @Shayan There are a couple of tools with roadmap features/plugins on the market, e.g [Jira](https://www.atlassian.com/agile/product-management/product-roadmaps). For larger programs, with partially overlapping (in time) and interdependent project, an MS-project tool could be useful for managing the roadmaps at a high level (the "tasks" being projects, or project releases). In an agile context you would never ever make size a team based on a bottom-up estimate of task workload in MS-project!  The whole estimating / workload forecast is done radically differently.
Comment: Do you know any real example of what you mentioned about high-level roadmaps? Any report on using such approach? Also, you mentioned " In an agile context you would never ever make size a team based on a bottom-up estimate of task workload in MS-project! The whole estimating / workload forecast is done radically differently." Can you give me any clues about that?
Comment: Thank you! Just, is there any document (e.g., Medium page) that shows how to use such an approach (using, e.g., MS Project for high-level roadmaps) in a software context?
Comment: @Shayan You're welcome. Asking for resources is out of scope on this website. I do not have such examples at hand (see above). But I suppose that googling for MS project in combination with roadmap will find some ;-)
Answer: I've never used Primavera, but it appears to be similar to Microsoft Project in that it is geared toward more traditional project management approaches, rather than agile and adaptive techniques. Traditional project management techniques may be fine for projects that have fixed constraints, clear cause-and-effect relationships between changes, and have low amounts of uncertainty and ambiguity. However, agile project management techniques and their associated practices are useful in projects that have more flexibility and have more uncertainty or ambiguity that is reduced as the effort goes on.
I don't think that backlogs and roadmaps are drop-in replacements for work breakdown structures and Gantt charts. They solve similar problems in that they help to visualize the current and upcoming work, but they do so in very different ways and are best suited to different contexts. You'd choose the appropriate set of tools based on your project management methodologies, which would be based on the environment in which the project is happening.
If you have an agile software development team, I'd probably choose a more suitable tool than Project or Primavera. That doesn't mean that you can't make them work, either alone or in conjunction with other tools, but it's usually more effective to choose tools that support the process rather than forcing a tool to be used in a way that it wasn't designed for.
Answer: Microsoft Project is a powerful tool, however, it was not built for Agile teams. Thus, if you are looking to embrace this method, choosing an Agle tool might be a better solution. There are various options on the market allowing each team to find something for their needs.
For a fully Agile process, you will most likely benefit from a tool that carries specific functionality and reports. While those looking to merge Agile and traditional project management should keep their eye on hybrid project management solutions. Here is an article on the best Microsoft Project alternatives with a comparison table of main features.


Honing Steel Forward or Backward

Question: I'm really confused before I thought when you hone a knife you bring the edge towards you however the other day I was watching gordon ramsay bringing the edge away when honing. I tried searching on this topic however couldn't find anything. Could someone explain to me if this is a different technique or what? Thanks appreicate it.
The video of him doing it is linked below https://www.youtube.com/watch?v=SBn1i9YqN1k
Comment: Does your honing steel have a cross-guard?
Comment: Think of this type of "Sharpening Steel" as a file. I brings up a raspy edge that when cutting could resemble a finely honed/stropped  edge (although it is not). If you have a quality blade, why would anyone want to quickly file/grind it away.
Answer: I have a very simple reason for taking the edge away:
It's less dangerous - for you, don't do this before someone.
I don't know if it makes for better or worse honing (should be the same as long as the angle is the same I'd say).
Answer: Think of how metal gets an edge; you can get an edge on metal either forwards or backwards. My personal belief is when you sharpen a knife the traditional way you are honing the metal and thin edge back into the knife; when Gordon Ramsay hones in reverse, he's going forward, not folding backwards, so I believe you get a sharper edge because the metal is now pointing towards the part of the blade you cut with and has a sharper hone.
I have asked at least six chefs about what their training said; they could actually see the point of folding the blade towards the cutting edge. Obviously, you're supposed to use a stone afterward, but it works for a quick solution in the kitchen. The first time I saw Gordon Ramsay sharpen the knife that way I was surprised. After considering and asking questions it seemed quite logical. To each their own, but it is pretty hard to get away from what you have been taught. You never know, in a few years everyone may be honing the knives the other way; after all, everything evolves.
Comment: I apologize for the length of that post but with failing eyes it is the easiest way for me to communicate but I forget a text stands up being a paragraph my apologies again

Honing Steel Forward or Backward


With a firmware password set on a Retina MacBook Pro, what are recovery options?

Question: I am considering setting a firmware password on my Retina MacBook Pro for security reasons. If I do this and later lose the password (or other such extenuating circumstances), how can the data be recovered? Is it even possible?
Answer: It is possible for the lost firmware password to be reset, but not by a normal user.  As an Apple Certified Macintosh Technician working for a third-party service centre, if someone brings in a machine that has RAM soldered to the Logic Board and they have forgotten their firmware password, I can upload the serial number and request a firmware password reset.  We're then provided with a disk image that can reset the firmware on the machine with that specific serial number.  I believe, but can't confirm at this stage, that the utility on the disk image may expire after a certain length of time.
For all those concerned about privacy, any technician that requests a firmware password reset will have their details logged on Apple's end — so if it's reset for nefarious purposes, the details about which technician performed the reset can be tracked down quickly.  The reset also requires direct, physical access to the machine - the password cannot be reset remotely.
Comment: Thanks for the great answer. If someone brings in the machine, do you make any attempt to verify that they're the original purchaser (or a relative thereof)?
Comment: If the machine was bought from us we can check their name against the invoice name, otherwise there's not much we can do to verify.  Due to (overly) strict privacy laws in Australia, there's no way for us to verify the registration name (when you first set up the computer) with the current owner.
Comment: When you mention *serial number*, are you referring to the serial number listed on the bottom side of the machine? Or the 33 digit printable character sequence which displays at the firmware dialog when ⇧+⌃+⌘+⌥+S is pressed? I've heard elsewhere that this sequence is used as part of the procedure to reset the firmware password.


How do I equip companion customizations?

Question: So each of my three current characters has they're starting companion has a skin reward from their own respective missions. I already have said companion. However, the second requirement asks for something called "Crew Member Authorization". What is that and how do I obtain this?
Answer: The ability to use different skins for your companions is restricted to paying customers -- either by subscribing to the game or purchasing the "Crew Member Authorization" unlock from the Cartel Coin store.
Comment: That is kinda poor business. I mean not even team fortress 2 isn't that bad with free to plays.
Comment: @AndrewEckert There are indeed a few things that are quite annoying for F2P, but BW has to limit them somehow. The F2P model was created after a year so they either had to add a lot for subs or take away things from F2P. And companion customization is just an aesthetic in the end, it does not reduce performance for the player.


Would a call option with one strike price be worth more than a call option with two different strike prices?

Question: For example, say there is a call option with a strike price of $50 for a stock. Now, say there is another call option for the same stock with a strike price of $50 if the stock price is below $60, but the strike price becomes $55 if the stock price goes above $60. Which of these options would be worth more, directionally speaking?
Comment: Is this option American- or European-style?
Comment: I strongly suggest that you ask this interesting question on https://quant.stackexchange.com instead.
Comment: I'd suggest that you indicate what the underlying is as well as what options you are looking at (strike price and expiration) because for traditional exchange traded options in the US, your question makes no sense.  If this is some sort of exotic option where the exercise price does indeed change when the underlying's price changes (which I have never heard of) then you should heed @Flux and post over on Quantitative Finance.
Comment: Are you saying that if the stock price ever goes above $60, then the strike price immediately and permanently becomes $55, or does the strike price become $50 again if the stock price goes back below $60?
Answer: Jonathon, you seem to be asking about a totally hypothetical contract, where, the strike price magically changes, indeed "GOES UP".
In answer to your hypothetical, in very general terms if a call's strike price is higher then it is "harder to get there" and hence there is "more risk" and hence the "price will be lower".
So very simply, in general terms, the "bid goes down" as the "strike goes up". (Makes no difference if in or out of the money.)  You can instantly see this on any option chain, example click https://finance.yahoo.com/quote/AAPL/options/ .

Your phrase "worth more" is meaningless.
(Nothing is "worth" anything in this universe. There's bids and asks and last prices in life's database, and that's it.)
So we now know that (real) 55s would have lower bids than (real) 50s.
Regarding your "magic" "50-becomes-55" contracts.
I would say that, surely, they would be a bit cheaper than real-50s.  Because, simply, they might (magically) become 55s, which are, simply cheaper.
As everyone has said, really you could ask this on Mathematics or such.
Maybe you are asking this to increase your general understanding of the basics of options, which is a fine idea. Since I only understand the basics of options, I'm happy to try to explain it clearly :)


HighCharts: Enable/Disable tootip based on mouse click event

Question: I need to enable/disable tooltip based on mouse click event. I surfed the net but somehow the suggestions are not working.
Inside the click event I tried chart.tooltip.hide(); but it didnt work. Even if it were to work I need to find the opposite of this function. chart.tooltip.unhide(); and chart.tooltip.show(); are not recognized.
I had read somewhere that  chart.container.tooltip.enabled = true; should work, but even this is not a working solution.
Will appreciate if anyone can help me dynamically hide/unhide the tooltip.
Thanks
Answer: You have to use chart.tooltip.refresh(point), for example chart.tooltip.refresh(chart.series[0].data[2]);


DB Design - Assigning users to multiple sites with different roles

Question: I am working on a DB design that lets me manage roles and permissions for each user per site. These are my business rules:

A user can manage multiple sites
A user can only have one role per site
A site can have multiple users

I already have two designs that I came up with, I just need validation which one would work better against my business rules.
First is using a ternary table site_user_role that consists of a relationship between site, user and role table. But this already breaks the rule of a user having only one role per site because those 3 primary keys would be unique and I can create a combination of two roles for a user within 1 site. Any complications with this design?

The second idea is having two binary tables. The site_user and site_user_role table. This arrangement I am quite sure I will not duplicate a role for a user on a site. But Is it weird to have a primary key aside from the Foreign keys on the site_user binary table? Any complications with this design?

Answer: For the simplicity of maintaining it in the future (especially if it's not you) I would go with your first design. It contains a table with information on the user (login, name,etc), a table for the site (location, category) and then a table linking a person to a site (Steve is the account admin at Site 3) The second design would make things more complicated than they really needed to be


How to Rank Field in ArcGIS 10.1?

Question: I have a table of crimes by precinct. There is a field with the precinct number (I.E. 1, 2, 3, 4...) I also have a field each for Burglaries, Assault, Arsons with a count of how many in each precinct. Is there a way to summarize the precinct field so that each of the three crime type fields are ranked from highest count value to lowest (I.E. 1,2,3,4... instead of the current count 45,35,43...)
Answer: While sorting won't immediately give a numerical ranking, it will arrange the file so you can easily calculate it. If you need the actual numerical rank, you can add a field for each type of rank, sort on that basis, and then us CalculateField_management to set the rank.
Sort_management will allow you to sort on multiple fields, specifying ascending/descending for each.
Answer: In ArcMap, open the attribute table.
Right click on one of the column headers and click Advanced Sorting.

How to Rank Field in ArcGIS 10.1?


how to auto populate lookup field value based on record type?

Question: How to populate lookup field value based on record type without using code. i have tired with lookup field filter but there is no record type functionality.
Answer: Lookup field filters do not populate data. They only filter available values for a user populating the lookup field or apply constraints to the values that can be added there.
You can easily achieve this objective using Process Builder. Simply set the criteria on your action node to filter based upon the record type. Then add an "Update Records" immediate action and choose the record that started your process. Add a record update entry for the lookup field and populate the appropriate value.
This works for cases where the lookup field should be populated with a constant, an entry stored in custom settings (Process Builder formulas can reference Custom Settings), or a reference to an object that's already related to the source object. If you need to perform a query to locate the record you want to lookup to, you'll have to have your Process call an autolaunched Flow to perform that query.


Serial Upvoting reversed

Question: I just had 110 rep removed from me today, for "Serial Upvoting Reversed". I assume a spammer was upvoting just to make me upset tonight? My meta rep is still higher then my site rep, but I'm sure that will change soon... Can a mod weigh in on this?
Answer: Not sure what kind of "weigh in" are you looking for, Mods don't have access to voting data, we don't know who voted for whom on what post.
Serial upvotes can come from anyone, not just spammers - perhaps a particular user found your answer very good, and went ahead and upvoted all other posts. That would seem to be your case - though as mentioned, without specific details, we can only guess
Comment: @Luke serial vote reversal is an automatic process
Comment: @Luke yeah, that's the thing. Just think of it as you having fan :p
Comment: So is it an automatic process, or is that just not allowed?
Comment: Ahhhh, OK. I guess there's no way to tell if it was truly a good vote or not, eh?

Serial Upvoting reversed


UV Projection of 3D shape onto 2D images

Question: Given a 2D image of a human face and the corresponding 3D shape, how do I project the shape onto the images to extract texture patches from them to form a partial UV map?
Answer: I've accomplished this by positioning the mesh in a known position (such as the origin), placing the image in front of it so that from the camera's point of view they align as desired. Then it's simply a matter of shooting a ray from each polygon's vertices through the image towards the camera. Wherever the ray intersects the image, that's your <code>(u, v)</code> point for that vertex.
Comment: have you used some algorithm to position the mesh and the place the image or have you done it manually?
Comment: In my cases, users of my program would do it manually. If you're dealing with faces, there are various libraries that will give you key points on the face, like eyes, mouth, etc. I would check OpenCV to see if there's something like that, for example. If you're on iOS, I believe they have a library that can give you such info.
Comment: I know how to find the keypoints on the image of the face but how do i do the same on the mesh? if i can get that as well, then its simply a matter of shooting a ray from a keypoint in the mesh to the corresponding key point in the image to obtain the UV. Any ideas?
Comment: I've not done it before, but I wonder if you could render the mesh with a harsh directional light coming from above, slightly in front, and to one side, so that the eye brows and nose cast distinct shadows, and then use the same method as used for the image?
Comment: Using shadows may not be a good idea as all the feature points in a face may not captured. For instance, the eyes, parts of mouth,etc. Instead, using the landmarks provided in [https://github.com/anilbas/BFMLandmarks
] for the Basel Face model can be used to find the correspondence.


Cointegration between two stationary processes

Question: I have two stationary time series. I would like to check for cointegration between them. Does this make sense, and can I just use Engle-Granger Test (two step) for Cointegration for this?
Comment: I come to think of it that just plain correlation or (adjusted) R^2 are the same for stationary processes?
Answer: No, it does not make sense to look for cointegration among stationary time series. Cointegration can only take place if the individual time series are integrated (thus non-stationary).
The basic idea can be found in Wikipedia: If two or more series are individually integrated ... but some linear combination of them has a lower order of integration, then the series are said to be cointegrated.
Comment: already got the answer, one could use just correlation
Answer: Yes that is absolutely true, if the series are already stationary at levels , running a cointegration does not make sense ( It requires data to be I(1) or integrated of the same order). If the data are already stationary then it makes sense to proceed with VAR.


Role of the fly-wheel in a fatigue test of a damper

Question: I would like to build a system to carry out a fatigue test of a damper. I am not able to understand the role of the fly-wheel in such a system. The base idea is a crank-shaft mechanism which has a constant angular velocity and moves the damper along a sinusoidal. The required torque is sinusoidal as well, it oscillates between 0 and a maximum value. When I try to imagine the process, I think the fly-wheel can't help since we just need more work to keep the energy of the fly-wheel constant.
The parameters:
$$
Force: F_{max}=13000N\\
Angular\ velocity:\omega=10\ s^{-1}\\
Amplitude:A=0.01\ m\\
fly-wheel\ moment\ of\ inertia: Θ=2
$$
From the force and the velocity I calculated a damping constant: $b=130000\frac{Ns}{m}$.The next idea was to check how does the system work without any input, after a certain starting angular velocity.  I made the following equation, and checked how the system slows down in time.
$$\frac{d\omega (t)}{dt}=\frac{-b\ A^2\ \omega (t)\ sin^2(\omega (t) t)}{Θ}$$
I can see, a bigger fly-wheel can store more energy, and let the system work longer without any input torque. But when I would like to maintain the angular velocity (or the energy) of the constant, I do not see, how can a fly-wheel help the work of the motor which inputs the required torque into the system. Can you give me an intuition to understand the role of the fly-wheel in such a system?
Answer: The flywheel is used to help the crank turn when the angle is either 0 or 180 degrees ie the force is applied in line with the crank.
Once there is an offset then the force is applied at an angle ie a lever.
Comment: Now, I think I should focous on the case, when my motor can produce constant torque. Since the required torque is sinusoidal, the output angular velocity is not going to be constant. This fluctuation can be made smaller with the help of the fly-wheel. But to maintain the required angular velocity, I do still need near the maximum of the required torque. If I start the motor from 0, the size of the fly-wheel affects the time I need to obtain the required angular velocity, and the value of the angular velocity fluctuation. Is it correct thought?
Answer: As you said, the torque required to turn the crank is sinusoidal. If you add a flywheel, then lets say and peak torque (90deg) the motor would slow down somewhat. The flywheel would fight this and reduce the reduction. Likewise, the motor may want to speed up at 0 and 180deg, where the torque required is 0. The flywheel will reduce this increase in speed.
I think your confusion comes from the assumption "the angular velocity is constant". If that's actually true, the motor will not "feel" the flywheel at all, except during startup and shutdown (which you noted).
In reality, the motor probably does not have a square torque curve. In that case the flywheel would have some effect.


org cycle visibility of drawers

Question: I use drawers extensively. As a result, They tend to get long.I would like a mechanism to fold them like headlines. I found outline-show-all command which makes drawers visible. I would like a global, headline specific and headline recursive mechanisms for toggling the visibility of drawers.
Comment: I don't use a current version of org-mode, but back in the day (a few years ago), I wrote up an answer describing how to completely hide the `:PROPERTIES:` drawer *including* the aforementioned line.  Towards the end of the answer, I wrote-up a snippet that modifies the behavior of cycling so as to *add* an additional level of toggling visibility/hiding.  To do that, I modified `org-cycle-internal-local` with a few lies of code mentioned in the answer:  https://stackoverflow.com/a/17492723/2112489  Perhaps something of that nature will still work, but I haven't tested it recently.
Answer: For now I figured out that running org-mode on file automatically folds everything including drawers. Doesn't have the granularity that I am looking for but a great counter part for outline-show-all.
Comment: See also `org-hide-drawer-all`.
Comment: @jagrg it doesn't seem to me that `org-hid-drawer-all` function exists.
Comment: You're right. Not in the version that ships with Emacs. Anyhow, it's in the master branch.
Comment: @jagrg I see. I will try it out.
Comment: N.B. The default has changed so initially the file is *NOT* folded any longer: everything is shown, the rationale being that that is less surprising to Org mode beginners, who might otherwise wonder where all the text went. If you want to keep the old behavior, then you can customize `org-startup-folded` to have the value `fold` instead of `showeverything`.

org cycle visibility of drawers


Quarks are now considered to be fundamentals, but so were atoms some time ago. So the way we see is only limited by our technological advances?

Question: After watching this FuseSchool - Global Education episode, I cannot stop thinking how can something not have a substructure, how it cannot be split?
http://www.youtube.com/watch?v=nlv06lSAC7c
Comment: have a read through http://en.wikipedia.org/wiki/Preon. As it stands your question is a bit too broad to be usefully answered here, but if you have any specific questions arising from reading the preon article please ask them.
Comment: Related: http://physics.stackexchange.com/q/41676/2451 , http://physics.stackexchange.com/q/66779/2451 , and links therein.
Answer: You have to realize that all the history related in the video you linked is a short story for the long story of experiments and theories trying to fit experiments, been rejected, new theories explored until the final standard model was solidified into a physics theory. This is a very consistent model that has not been falsified by any experiments to date.
This model is based on a set of elementary point particles that can not be further split non trivially  and still retain the model's validity. By non trivially I mean to make a prediction for an exerimental result that would be different from the simple standard model and if found, falsify it. If this ever happens then to be sure, the standard model will be called "an emergent theory" and the inner levels explored and new theoretical models will be developed.
There exist non mainstream physicists occupied with postulating that the electron or the quarks are composite and experimentalists are looking at all possibilities.

Detectors at the LHC allow scientists to peer even further into the makeup of the smallest bits of matter. It will take many years of data collection and careful analysis to determine if compositeness exists. If it does, its discovery could open up a new world of subatomic particles. The unprecedented energy of proton collisions at the LHC could be what scientists need to find it.
Answer: Betrand Russell, in fact had mentioned this problem. Of how we would know if we have in fact reached the most fundamental level. The answer is no.  We can never tell for sure. Due in part to the fact of a indivisble object has no unique characteristics or even remotely close to a special property that tells us humans im no longer divisible.  Are inability to know with certainty if we have truly reached the "bottom level" or indivisible particles is for only those with hopes and dreams. therefore there shall allways remain a mystery since fundamental particles have no specialising property to differentiate itself to tell us this in fact is thee "bottom".
Leonardo Bisignaro.


Is the electric field zero inside an ideal conductor carrying a current?

Question: By an ideal conductor, I mean one with zero resistance. Inside an ideal conductor with no current, the electric field is zero, but is the electric field still zero with the ideal conductor carrying a current?
Answer: If the conductor has zero resistance, then the force required in order to sustain the current is zero, (the electrons keep moving by themselves) so yes, the electric field is zero.
As real example of that, an electric current flowing through a loop of superconducting wire can persist indefinitely with no power source !!!
Answer: NOTE: This answer relates to original question, where ideal conductor was not specified to be the one with zero resistance.
No.  The electric field is the requirement for the electrical current.  This can be seen from the Ohm's law in th vector version
$$\vec{j} = \sigma \vec{E},$$
where $\vec{j}$ is current density and $\sigma$ is conductivity.  Hence, no electric field, no current.
Comment: I said an ideal conductor - meaning zero resistance
Comment: @Physikslover Fair enough, but "ideal conductor" usually means that the conductor conforms to Ohm's law.  There are other conductors e.g. semiconductors, which are not "ideal".
Answer:
but "ideal conductor" usually means that the conductor conforms to Ohm's law.
I am surprised. I always heard " ideal " as " zero resistance when constant current flows ", hence zero potential drop along the wire. Hence the answer to the original question is yes, by definition.
Conductor that conforms to Ohm's law is called " ohmic ".
Answer: Yes, it is zero.
In short
Ideal conductor, means no change in electric potential along it, which means no electric field inside.
In details
1) Assume there is a non-ideal conductor of length L.
2) Assume there is some non-zero current flowing through it causing potential drop across the ends of the conductor.
3) Electric field inside a conductor is uniform and parallel to the surface of the conductor.
$$\Delta V = \int {\vec Edl = EL} $$
$$\Delta V = IR$$
Now if one assumes conductivity tends to infinity (resistance tends to zero), electric field tends to zero.
$$E = {{IR} \over L} \to 0,{\rm{ if \: }}R  \: \to 0$$
Comment: See a follow-up for magnetic field inside ideal conductor [Is the magnetic field zero inside an ideal conductor carrying a current?](http://physics.stackexchange.com/q/270220/124496)


Character counter for textarea in webform

Question: I am relatively new to drupal. I have webform module and webform validation module installed. I was able to limit the number of characters in webform textarea using webform validation. However, this module does not support character counter for the fields. I have looked at this solution http://drupal.org/node/1459650#comment-5699952 which using maxlength module, but it is very unclear . I am planning to write a module implement hook_webform_component_info_alter(&$components) to add jquery or javascript on to the webform textarea field. Is this a correct way. If so or If not how would i do that?
Answer: For webforms use the Webform Countdown module instead of maxlength. Here is a quote about it (from the module's project page):

Provides a textarea component for Drupal webforms with a configurable, twitter-style dynamic word or character count.


cancelAllOperations doesn't work for [NSOperationQueue mainQueue]

Question: cancelAllOperations() doesn't work on the mainQueue (the cancel() method is not called on the NSOperation object). Am I missing something?
I have to iterate through all operations and call the cancel() method to get it work.
Comment: Pretty sure I've seen `-cancelAllOperations` work just fine. Maybe you need to provide more context.
Comment: failing for me in just the way described, today
Comment: I know this is an old question, but you say that you're using the `mainQueue` for `NSURLConnection`. You probably want to use a custom queue for `NSURLConnection`-based operations, not `mainQueue`, anyway (you can use `maxConcurrentOperationCount` to enjoy concurrency while controlling the degree of concurrency). If using delegate-based `NSURLConnection`, you can still schedule the connection on the main queue (or create your own `NSThread` with its own runloop, like AFNetworking does). But you probably want to use custom queue for the operations, themselves.
Answer: I can also confirm that cancelAllOperations does not work on [NSOperationQueue mainQueue] (at least on my iOS 5.0 Simulator). Might be intentionally designed like that since it is a shared instance.
My simple workaround is just to subclass NSOperation or NSBlockOperation without overriding anything and then do something like this:
-(void)cancelMyOperationsInMainQueue {
    for (NSOperation* o in [[NSOperationQueue mainQueue] operations]) {
        if ([o isKindOfClass:[MyOperation class]]) {
            [o cancel];
        }
    }
 }

Answer: Yeah can also confirm it doesn't call cancel method on the operations, it just sets isCancelled = YES
My solution: [[[NSOperationQueue mainQueue] operations] makeObjectsPerformSelector:@selector(cancel)];


Need help understanding oscillator circuit

Question:

simulate this circuit – Schematic created using CircuitLab
Does anyone know what type of oscillator is this and how this works?
Comment: What equipment houses this circuit?
Comment: Phase Shift circuit.
Answer: The circuit as shown is an attempt to make an amplitide stabilised Colpitts Oscillator.
The oscillator, Q1, operates in common base mode at an operating frequency of just over 200kHz.
OA1 is simply an amplifier with a gain of about 101, i.e. about 40dB but with a lowpass filter (10k in parallel with 680pF in the feedback) with a cutoff of about 23.4kHz so at 200kHz it will have a gain of roughly 20dB due to the lowpass rolloff of 20dB/decade.
At a gain of 20dB this amplifier has a bandwidth of about 900kHz but if the low pass filter cutoff frequency were to be raised to try to extend the low frequency gain of 40dB to 200kHz, then bandwidth of the amplifier becomes limited to only about 90kHz. Hence a 200kHz bandwidth at a gain of 40dB is not possible with this amplifer anyway.
OA2 is an inverting amplifer with a gain of 5.6 (22k/3.9k) but is has a high pass filter with a cutoff of approximaterly 186kHz at the input due to the 220pF in series with 3.9k.
This stage also has an approximately 220kHz low pass filter due to the 33pF in parallel with 22k in the feedback.
This stage appears to be an attempt to create a 200kHz bandpass filter for some reason. The problem is that if the oscillator frequency were to drift away from 200kHz then the output amplitude from this stage would drop due to the bandpass filtering so the amplitude stabilisation circuit would see a reduction in signal level and would therefore boost the signal amplitude. Unless this is a behaviour required by the original application, this of course defeats the purpose of the amplitude stabilisation.
OA3 is a fairly conventional precision negative peak detector with a signal dependent bleed resistor (R5). R5 stops the opamp output hitting the negative supply rail when the input is below the voltage on C4 but also creates a leakage path to discharge C4 under the same conditions. How much charge is bled out of C4 varies with the signal level because the voltage at OA3 inverting input follows the non-inverting input. However, it is possible that with R5=100k that the bandwidth of the amplifer may be reduced so much that it cannot perform this follower action fast enough so it may not work as intended. This would have to be carefully modelled and simulated using the vendors own or a well crafted alternative model for the OP275 to see what really happens.
It is not clear what the purpose of D2 is.
OA4 is just a DC amplifer and level shifter with an overall gain of about 13. It has a very long time constant due to the 1.5uF in parallel with 432k.
The idea is that the oscillator output is buffered, amplified and then AM detected by the precision peak detector. The smoothed DC output of the AM detector then forces the voltage at the OA4 end of R13 up to reduce the current through Q1 as the oscillation amplitude increases so reducing the gain of Q1 to reduce the amplitude again. If the amplitude falls, the AM detector output rises towards the mid rail voltage (half vcc), moving the voltage at the OA4 end of R13 towards ground and so increasing the emitter current of Q1 to increase the amplitude.
The circuit should reach equilibrium and so stabilise the amplitude. Stabilisation should be largely independent of temperature because the precison rectifier removes the temperature dependent drop of D1.
However given all the "features" of the design, it is not clear that it will actually work as intended.
In fact, Micek reports that the circuit does not seem to work.
It is not clear why the amplitude stabilisation or AGC path has so much gain. Amplitude stabilisation can be achieved with unity gain in this path. The oscillator is very sensitive to the emitter current which in fact provides enough gain for the AGC loop to provide highly effective amplitude stabilisation.
The original can be modified to simplify it and to correct the shortcomings described above.
A modified version has been fully simulated and shown to give reasonable amplitude stabilisation over a -20degC to +70degC temperature range.
The modifications are largely to reduce the whole of the AGC path to unity gain and to maintain a flat frequency response to well above 200kHz.
Note that the modifications are implemented in such a way as to preserve the basic original circuit (to avoid a PCB redesign etc.). Comparable performance can in fact be achieved with a far simpler circuit.
A copy of the original circuit (not attempted in simulation) and a working simulation of the simplified circuit can be found on the free, online EasyEDA.com tool suite here:
Amplitude stabilised Colpitts Oscillator


How can one cook corn on an open grill?

Question: I'll be camping with limited access to water. I have a grill in the outside kitchen, however this grill doesn't have a cover. Is it possible to grill corn on the cob on a cooking surface without a cover? If so, how?
Comment: I knew I had answered this question before: https://cooking.stackexchange.com/a/1542/67
Answer: Is the corn still in the husk ?
Do you have aluminium foil ?
Keep the corn in the husk and roast until cooked; it's better to remove some of the leaves and dip them in water to add some moisture to the corn before putting on the grill.
If you have aluminium foil, you can either keep the corn as is and wrap in foil, or remove the husk and wrap in foil and put on grill until cooked.
If your grill is really hot, you can finish the corn to add some color.
Comment: I disagree with the removal of leaves and adding water.  There is plenty of water in the leaves of fresh corn and more leaves are better.  The outer leaves will dry and burn but protect the inner leaves and kernels from the same.  This is my favorite way to cook corn on the cob.  It's perfect every time.
Comment: I even cook corn like this in the oven.  And to me is seems the removal of the silk is easier after it has been cooked.
Comment: @JGinSD Yes and no.  The silk comes off easily but the main challenge with this approach is that husking hot corn can be a little painful.  I use a pair of cheap welding gloves but you can do it with bare hands, if you are quick.
Comment: @JimmyJames you just have to be careful
Answer: Even husked corn can be nicely roasted on an open grill.  Use gentle heat, turning frequently until the kernels are golden.  Some kernels will be darker, even charred a bit, but I find that enjoyable.
Comment: That's how I do it.  I husk it, but I try to leave the stem part intact, as I can leave that part sticking off the edge as a handle.  Every so often, I give it maybe 1/5 of a turn.  If you start to hear popping, turn it, and try to give it a little less time before the next turn
Comment: @Joe I prefer tongs :-)....but I do enjoy a grilled ear or two!
Answer: While keeping it wrapped (foil or husk) is preferable, you certainly can throw pre-prepared corn on the cob straight onto your grill. Just be aware it may cook extremely quickly so needs rotation.
It is also likely to get quite a char but some people like that.

How can one cook corn on an open grill?


Why are continuum fluid mechanics accurate when constituents are discrete objects of finite size?

Question: Suppose we view fluids classically, i.e., as a collection of molecules (with some finite size) interacting via e&m and gravitational forces. Presumably we model fluids as continuous objects that satisfy some differential equation. What mathematical result says that modeling fluids as continuous objects can accurately predict the discrete behavior of the particles? I don't know anything about fluid mechanics, so my initial assumption may in itself be wrong.
Answer: There are many physical intuitions often presented in various texts on fluid dynamics. I won't mention those here. I will, however, mention that mathematically the passage from a particle point of view to a continuum point of view is still a largely un-resolved problem. (With suitable interpretation, this problem was already posed by Hilbert as his 6th of 23 problems.)
We can interpret the problem as one of starting from "a Newtonian description of particles interacting through collisions" and try to end up with "an approximation of the physical system by a continuum obeying certain laws of fluid dynamics (Euler, Navier-Stokes, etc.)"
Most work up through now takes an intermediate step through the Boltzmann equation: in this kinetic theory model, instead of individual particles we consider distributions of particles, where the "density" of particles is given based on both position and velocity. So it makes one level of continuum approximation. But it still keeps the facet of Newtonian theory where particles interact through direct collisions. Under an assumption known as molecular chaos (more on this later), that Boltzmann's equation follows from Newtonian laws of motion have been demonstrated, to various degrees of rigour, by Boltzmann himself, as well as Grad, Cercignani, and Lanford, building on the work of Bogoliubov, Born, Green, Kirkwood, and Yvon. For a mathematically sophisticated, but more or less self-contained description one can refer to Uchiyama's write-up. There are a few issues with this derivation.

The problem of potentials. The derivations listed above made assumption that the particles are hard spheres: that the only interaction between two particles is when they actually collide (so no inter-molecular forces mediated by electromagnetism, like hydrogen bonds and such), and that the particles are spherical. This is satisfactory for monatomic gases, but less so for diatomic molecules or ones with even stranger shapes. Most people don't think of this as a big problem though.
The derivation is only valid under the so-called Grad limit assumption. To take the continuum limit, generally the assumption is made that the particle diameter decreases to zero, while the number of particles (per unit volume) increases to infinity. Exactly how these two limits balance out affects what the physical laws look like in the continuum limit. The Grad limit assumes that the square of the particle diameter scales like the inverse of the number density. This means that the actual volume occupied by the particles themselves (as opposed to the free space between the particles) decreases to zero in this limit. So in the Grad limit one actually obtains an infinitely dilute gas. This is somewhat of a problem.
The derivation also makes use of what is called molecular chaos: it assumes that, basically speaking, the only type of collision that matters is that between two particles, and that the particle, after its collision, "forgets" about its previous zig-zag among its cousins in the dilute gas. In particular, we completely ignore the case of three or more particles colliding simultaneously, and sort of ignore the billiards-trick-shot like multiple bounces. While both of this can be somewhat justified based on physical intuition (the first by the fact that if you have a lot of small particles spaced far apart, the chances that three of them hit at the same time is much much much smaller than two of them colliding; the second by the fact that you assume some sort of local thermodynamic equilibrium [hence the name molecular chaos]), one should be aware that they are taken as assumptions in the Boltzmann picture.

Starting from the Boltzmann equation, one can arrive at the Euler and Navier-Stokes equations with quite a lot of work. There has been a lot of recent mathematical literature devoted to this problem, and under different assumptions (basically how the Reynolds and Knudsen numbers behave in the limit) one gets different versions of the fluid equations. A decent survey of the literature was written by F. Golse, while a heavily mathematical discussion of the state-of-the-art can be found in Laure Saint-Raymond's Hydrodynamic limits of the Boltzmann equation.
It is perhaps important to note that there are still regimes in which the connection between Boltzmann equation and the fluid limits are not completely understood. And more important is to note that even were the connections between the kinetic (Boltzmann) picture and the fluid limits, there is still the various assumptions made during the derivation of the Boltzmann equation. Thus we are still quite far from being able to rigorously justify the continuum picture of fluids from the particle picture of Newtonian dynamics.
Comment: Do similar problems occur when applying the lagrangian to ropes, slinkies, or other continuous objects?
Comment: @JamesMarshallX: for solid objects the theory is different. In fluids the particles are free to move around and bump into each other. For solids, the accepted description for the mechanical (as opposed to quantum mechanical or thermodynamic) properties for most of them assumes the atoms to be more or less fixed (relative to other atoms). This assumption vastly changes the nature of the problem: you are no longer trying to derive the continuum limit from Newton's laws since what governs bulk motion is interatomic/particle forces, and not "billiard dynamics".
Comment: Consider transverse wave propagation on a piece of string. The original derivation of the wave equation by D'Alembert assumes a chain of particles each joined to the next by springs governed by Hooke's law. The derivation from there on is plenty fine; the question one should make then is whether that particular assumption of the structure of a piece of string and the assumption on the form of the intermolecular forces are valid. In other words: in fluids we have three levels of models: molecular, kinetic, and continuum. For a rope, I don't know if there is a widely accepted molecular model.
Answer: The theory of fluids introduces material parameters in the stress tensor, which help model the substance. "The viscosity coefficient is the proportionality constant relating a velocity gradient in a fluid to the force required to maintain that gradient. The thermal conductivity is the proportionality constant relating the temperature gradient across a fluid to the flux of energy, that is, Fourier's law of heat conduction. Finally, the diffusion coefficient is the proportionality constant relating the gradient in species concentration of the mass flux." Of course it only works if it works.
There is the self consistent derivation of the Navier–Stokes equations, w.r.t. several conservation laws. But relevant for you are the considerations involving Boltzmann equation, a formalism for gases in the microscopic regime. Here, for many systems, you can find macroscopic expectation values, which  validate fluid dynamics and give microscopic explanations for the viscosities, etc. The results are then usually said to "also hold for liquid systems".
For the limit, one might assume a pertubation of the Maxwell-Boltzmann distribution $f(t,\vec x)$, which weakly depends on space and time. This is the relaxation time approximation, or the $0.5^{th}$ order in Chapman–Enskog theory. From this one can compute average (particle) densities, mean velocities and average kinetic energies (temperatures). For example
$$\vec V:=\langle \vec v\rangle$$
$$T(t,\vec x):=\frac{1}{3}\left\langle m\left(\vec v-\vec V\right)^2 \right\rangle,$$
where $\langle\dots\rangle$ is the mean w.r.t. the particle distribton given by $f(t,\vec x)$. This procedure gives a macroscopic/net velocity and a local temperature distribution. It eventually fulfulls an equation of state, like $P=\frac{N}{V}k_B T$, or rather
$$P(t,\vec x)=n(t,\vec x)\ T(t,\vec x),$$
which relate macroscopic quantities like temperature to pressure, which is also given as mean and which is part of the stress tensor I mentioned above. The differential equations, which governs the dynamics of the fluids ultimately stem from momentum conservation in both cases. See Kerson Huang: Statistical Mechanics, 2nd Edition for a derivation.
Comment: @JamesMarshallX: I see what you did there.


Access Photo Album from iPhone Code

Question: iPhone Apps like "Picture Map" access all the photos in my iPhone's camera album and display them without ever showing an Image Picker Control.
Does anyone know how this is done?
Thanks
G
Answer: This is an old thread but I will answer as I'm the one who wrote and published Picture Map !
Thomas is right, I was accessing the DCIM folder to parse each file (to get its location from the EXIF structure and to access thumbnails too).
As an application has no right to access files outside of its sandbox, Apple asked me to remove the application from the AppStore ... And anyway, since iOS 4.0, application are not able to access DCIM folder anymore !
I did rewrite the application to use ALAsset class and published it again under the name of "Picture-Map" ! The source code is also available here : https://github.com/sylverb/Picture-Map
Answer: I believe I know what's going on:
There are two separate photo collections on an iPhone:

The iPhoto album, which is synched from the iPhoto app on the Mac.
The pictures taken with the iPhone camera.

The iPhoto album is not accessible by normal apps (provided we're not talking about jailbroken devices here) - an app can only request that the user picks picture by picture by hand.
The pictures taken by the camera, however, end up in a "DCIM" folder which is shared between all applications, along with other data. You can see all that if you use the Mac application "iPhone Explorer" (I am sure there are similar apps for Windows as well).
Hence, while never having tried out "Picture Map" myself, I suspect that it simply accesses this DCIM folder.
...
Oh, now wait...
I just used iPhone Explorer to look at my iPad's shared folder (/var/mobile/Media) and see that there's not only the DCIM folder there but also a Photos folder, which contains a "Photo Database", just like on the Mac.
Wow, this is interesting...
This could mean that "Picture Map" actually reads this DB file directly. It's been done on the Mac, and I suspect that the file format on the iPhone OS isn't much different, either.
Does that answer your question?

Access Photo Album from iPhone Code


Method always returns zero

Question: I'm pretty new to java and I'm trying to create a program that quizzes users on the difference between 2 random frequencies. Everything works except that when I try to get the difference of 2 frequencies the answer is always 0. How do I get it to display the actual difference? Here is the class I wrote to create the tones ans compute the difference:
public class Quiz{

    private PitchPlay one = new PitchPlay();
    private PitchPlay two = new PitchPlay();

    private int frequencyOne;
    private int frequencyTwo;

    private int dif = new Integer(Math.abs(frequencyTwo - frequencyOne));

public int run(){
    frequencyOne = new Integer((int)(Math.random() * 5000 + 50));
    frequencyTwo = new Integer((int)(Math.random() * 5000 + 50));
    return this.dif;
}

public int freqDif(){
    return this.dif;
}

public void playQuiz(){
    one.play(one.note(frequencyOne, 2, 15));//note(frequency, duration, volume)
    two.play(two.note(frequencyTwo, 2, 15));
}
}

And here is the class where the quiz class is used:
public class Action implements ActionListener{
Quiz one = new Quiz();

public void actionPerformed (ActionEvent e){
        if(e.getSource() == playSoundButton)
        {
            if(answerResponse.getText().compareTo("Correct!")  == 0 || answerResponse.getText().compareTo("Play and Listen...") == 0)
            {
                one.run();
                one.playQuiz();
            }
            else
            {
                one.playQuiz();
            }
        }
        if(e.getSource() == submitButton)
        {
            String responseText = new String(responseField.getText());
            if(responseText !=null && !"".equals(responseText)){
                try{
                    Integer responseNumber = Integer.parseInt(responseText);

            if(responseNumber == one.freqDif())
            {
                    answerResponse.setText("Correct!");
                    answerResponse.setVisible(true);
            }
            else
            {
                answerResponse.setText("Wrong Answer. The difference is " + one.freqDif() + " hertz.");
                answerResponse.setVisible(true);
            }
                }catch(NumberFormatException f){
                    f.printStackTrace(System.out);
                }
            }

        }

    }
}

Answer: private int dif = new Integer(Math.abs(frequencyTwo - frequencyOne));

This is calculated when the variable is created, not when you use the variable.  You need to do the calculation after assigning the variables.
Answer: There are several issues with your code:

As others have mentioned, the line
private int dif = new Integer(Math.abs(frequencyTwo - frequencyOne));

creates a variable and assigns a value calculated from two other variables. The values of the other variables at the time of creation are used. You need to recalculate every time the values of those two variables changes. This does not happen automatically for you.
new Integer(...) creates an Integer object. When you subsequently assign this object to an int variable, the value is taken out of the object. This adds some unnecessary memory and run-time over head to your code. Instead, you should assign directly to your variables. For example,
frequencyOne = (int)(Math.random() * 5000 + 50);

Method always returns zero


How can I simulate michelson's interferometer circular fringes?

Question: I wanto to simulate the circular fringes on a screen for the michelson interferometer. I know how to identify if there will be a destructive or constructive interference, but what about the radius of the circles? how is the intensity of the fringes when optical path diffference is not an $\lambda/2$ or  $\lambda / 4$ and is like $0.35 \lambda $ I want to do something like this. https://demonstrations.wolfram.com/MichelsonInterferometerAndHaidingerFringes/
And also i'm getting confused about the focal distance parameter.
Answer: Consider two parallel rays reflected
from the two mirrors (separated by distance $d$),
both with angle $\theta$ deviating from the optical axis.

(image from University of Tennessee - Modern Optics - Michelson Interferometer)
They have a path difference
$$\Delta s = 2d\cos\theta \tag{1}$$
and hence a phase difference of
$$\Delta\phi = \frac{2\pi}{\lambda}\Delta  \tag{2}s$$
So you have two parallel rays with the same amplitude, but different phases
$$\begin{align}
A_1(\theta,t)&=A_0\sin(\omega t) \\
A_2(\theta,t)&=A_0\sin(\omega t + \Delta\phi)
\end{align} \tag{3}$$
Superposing these two parallel rays with the lens
on the same spot of the screen, you get
$$\begin{align}
A(\theta,t) &= A_1(\theta,t)+A_2(\theta,t) \\
 &= A_0\sin(\omega t) + A_0\sin(\omega t+\Delta\phi) \\
 &= 2A_0 \sin\left(\omega t+\frac 12 \Delta\phi\right)
    \cos\left(\frac 12 \Delta\phi \right)
\end{align} \tag{4}$$
Calculating the intensity (by $I=A^2$),
taking the average over time $t$,
and inserting (2) and (1) you get
$$\begin{align}
I(\theta) &= \overline{I(\theta,t)}
 = \overline{A(\theta,t)^2}
 = 2A_0^2\cos^2\left(\frac 12\Delta\phi \right) \\
&= 2A_0^2\cos^2\left(\frac{\pi}{\lambda}\Delta s\right)
 = 2A_0^2\cos^2\left(\frac{2\pi d}{\lambda}\cos\theta\right)
\end{align} \tag{5}$$
When you now draw this $I(\theta)$ versus $\theta$ (for a fixed
$d$ and $\lambda$), then you get images like those generated with
Wolfram Demonstrations Project - Michelson Interferometer and Haidinger Fringes:
Answer: In simulations, I feel that the aim should be to try if we can to make the phenomenon we want to simulate emerge indirectly from simpler mechanisms... If we simulate the wave inteference equations directly, putting numbers into the equation will of course give us a wave interference pattern...
Answer: Today I was looking exactly to accomplish what you want to do.
After some time struggling to try and make the simple output plot with Fourier optics to become the bidimensional Haidinger fringes, I gave up.
Then I found this wonderful library by Ian Cooper which contains MATLAB scripts for this, the one you are looking for is 'opMichC.m'. I am definitely going to do some digging in these other scripts later.
Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).