tikz rectangle with curved edges and inverted rounded corners

Question: I need to draw first a rectangle with curvy looking edges.
Then I need a rectangle with curvy looking edges and also rounded corners. But the corners need to be inverted (pointing inwards).
I have made a handmade drawing for illustration:
Comment: You should load your sketch into your question. And also show what you try so far. Your shapes can be drawn with bending lines.
Comment: I'm voting to close this question as off-topic because this is a just-do-it-for-me question (-1).
Comment: @Zarko I'm not sure new users can do this. They can upload it and post a link, but I don't think they can allow it to be displayed. (But I'm not certain about this.)
Comment: @cfr, new user can't do this, it had to earned some minimal reputation (15) for this. I'm also not certain about the limit ...
Answer: Note that I think I ought not answer 'do-it-all-for-me's such as this one. Also, be aware that I am much less likely to be responsive to follow-ups in such cases, unless your follow-up happens to appeal to me. If you want any adjustments, I therefore recommend that you desire the addition of one or more of the following:

one or more cats, sitting or lying;
one or more cauldrons;
one or more trams or single-decker buses.

<code>\documentclass[tikz,border=10pt]{standalone}
\begin{document}
\begin{tikzpicture}
  \draw (0,0) coordinate (a) [bend right=15] to +(2,0) coordinate (b) [bend right] to +(0,-1) coordinate (c) [bend right] to (a |- c) [bend right=15] to cycle ;
  \begin{scope}
    \clip (3,0) coordinate (A) +(.1,0) coordinate (A1) -- +(1.9,0) coordinate (B1) arc (180:270:.1) coordinate (B2) -- +(0,-.8) coordinate (C1) arc (90:190:.1) coordinate (C2) -- (C2 -| A1) arc (0:90:.1) -- (B2 -| A) arc (270:360:.1) ;
    \draw (A) coordinate (a') [bend right=15] to +(2,0) coordinate (b') [bend right] to +(0,-1) coordinate (c') [bend right] to (a' |- c') [bend right=15] to cycle ;
  \end{scope}
  \clip (a') [bend right=15] to (b') [bend right] to (c') [bend right] to (a' |- c') [bend right=15] to cycle ;
  \draw   (B1) arc (180:270:.1)  (C1) arc (90:190:.1)  (C2 -| A1) arc (0:90:.1)  (B2 -| A) arc (270:360:.1) ;
\end{tikzpicture}
\end{document}
</code>
Comment: you are good soul and hard worker bee (+1) /literally translated, i don't know the adequate English phrase/
Comment: @Zarko I was just slightly intrigued, for some reason. No good if you want them to be nodes, of course, but I liked the idea of a bitten-bendy-box.
Comment: @Zarko I don't know if there is an exact English phrase, but I think I get the idea. We shall have to ask Alan Munn.
Comment: Thank you cfr! There is no need for cats or buses. But thanks for the offer. ;-)
Answer: This is not a full answer unfortunately, but I needed a very similar shape: a rectangle with inverted corners, but not the convex edges. I made a shape (see here: myshape.tex) for it, in which the corners to invert can be selected:

The test script is rather small:
<code>\RequirePackage{luatex85}
\documentclass[tikz,convert=false]{standalone}
\tikzset{
  shape example/.style={
    color=black!30,
    draw,
    fill=yellow!30,
    line width=.5cm,
  },
}

\input{myshape}

\begin{document}

\begin{tikzpicture}\Huge
  \node[rectangle with inverted corners, rectangle with inverted corners radius=20pt,
        rectangle with inverted corners selected={north west, north east},
        shape example, minimum height=6cm, inner ysep=1cm, inner xsep=.75cm] (s)
    {Rectangle with inverted corners\vrule width1pt height2cm};
  \foreach \anchor/\placement in
    {text/below, center/above, 70/above,
     base/below, base east/below, base west/below,
     mid/above, mid east/above, mid west/above,
     north/below, south/above, east/above, west/above,
     before north east/above, north east/below, after north east/above,
     before north west/above, north west/below, after north west/above,
     before south west/above, south west/above, after south west/below,
     before south east/below, south east/above, after south east/above}
  \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
    node[\placement=0mm] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{document}

'''
</code>


Integral of $\frac{\sqrt{x^2+1}}{x}$

Question: So I have to do the integration of $\frac{\sqrt{x^2+1}}{x}$. Give me a hint. What should I replace? Should I do it with integration by parts?
Answer: Hint: substitute $x = \tan{y}$; $dx = \sec^2{y} dy$.  Then $x^2+1 = \sec^2{y}$.
Answer: You could use the substitution
$$
\begin{align}
&&u&=x+\sqrt{x^2+1},&x&=\frac{u^2-1}{2u} \\
&&\sqrt{x^2+1}&=\frac{u^2+1}{2u},&dx&=\frac{u^2+1}{2u^2}du
\end{align}
$$
to get (unless I did some mistake)
$$
\int\frac{\sqrt{x^2+1}}{x}dx=
\int\frac{\frac{u^2+1}{2u}}{\frac{u^2-1}{2u}}\frac{u^2+1}{2u^2}du=
\int\frac{(u^2+1)^2}{2u^2(u^2-1)}du=
\int\frac{(u^2-1)^2+4u^2}{2u^2(u^2-1)}du=
$$
$$
=\int\left(\frac{(u^2-1)^2}{2u^2(u^2-1)}+\frac{4u^2}{2u^2(u^2-1)}\right)\,du=
\int\left(\frac{u^2-1}{2u^2}+\frac{2}{u^2-1}\right)\,du=
$$
$$
=\frac{u}{2}+\frac{1}{2u}+\ln|u-1|-\ln|u+1|+C.
$$
Now just do the backsubstitution.
Comment: Interesting substitution! Though, how careful should we be with square root of squares?
Comment: @Mehdi: I believe it is a well-known substitution, so you should not give me credit for it. Where in this are you concerned about the square root of squares?
Comment: I just rechecked and see that this is all flawless. I am not sure what was I unhappy about :-)! (I upvoted it yesterday)
Answer: This problem is a lot uglier than it originally looked.  First, let's bring the denominator under the radical.
$$\int\sqrt{\frac{x^2+1}{x^2}}dx=\int\sqrt{1+\frac1{x^2}}dx$$.
Now let's make the substitution rlgordonna suggested.
$$x=\tan y,dx=\sec^2ydy$$
$$\int\sqrt{1+\frac1{\tan^2y}}\sec^2ydy=\int\sqrt{1+\cot^2y}\sec^2dy=\int\csc y\sec^2ydy$$
It will take a little work from here to get this to look like something recognizable.
$$\int\csc y(1+\tan^2y)dy=\int\csc ydy+\int\csc y\tan^2ydy$$
I assume you know how to do the first integral.  It's similar to the integral for $\sec y$.  As for the second half
$$\int\csc y\tan^2ydy=\int\frac1{\sin y}\times\frac{\sin y}{\cos y}\times\tan ydy=\int\sec y\tan ydy$$
which should now be in a form that looks familiar.
Comment: Yes, it was quite ugly, but I figured at this level we should avoid suggesting hyperbolics (no offense meant to @Chris'sSister).  It should be pointed out that it is urged that OP check his work by differentiating his result; it is actually nice to see the cancellations involved in getting the original function back.

Integral of $\frac{\sqrt{x^2+1}}{x}$


Angle to Inches Calculator

Question: Is there a calculator that can provide dimensions for a triangle that produce an angle that I specify?  There seems to be an abundance of calculators that tell you what angle you get from dimensions that you supply, but nothing to tell you what dimensions will produce an angle that you supply.
Answer: Here is a site for solving triangles.
The user interface doesn't show a right triangle by default (assuming that's what you're after), though the solved triangle does appear to be drawn to scale. Here is what you'll see to start:

Suppose you want a right triangle where, say, you know the bottom side is 96 inches and the angle of elevation is 24 degrees, then type those values into the relevant blanks (don't forget the 90 degree right angle) and click to "calculate":

This will produce the triangle with the missing values filled in:
Answer: I created a calculator that searches triangles in 1/8" increments to get as close to the target angle as possible.
As I see it, the advantage of this approach over others is that you can get extremely close to the desired angle while your measurements remain "tape-measure-friendly".
angle = asin(height / hypotenuse)
There is a working demo here
Comment: +1 for "fiddling" up the calculator.
Comment: @JB0x2D1 I also like the "radius finder" in the tool you linked. I remember wanting to build a duplicate of a friend's skateboard ramp, which had a partial circular arc cut out of plywood. I didn't have anything large enough to trace out the arc, so I took measurements and used the Pythagorean theorem (like in your linked tool) to find the radius so I could draw and cut the arc. Your tool would have been nice in that case.
Comment: Welcome to Woodworking. +1, but what situation(s) do you foresee this being useful in?
Comment: That's cool, but along with "when do you think this would be useful" is the usual suggestion that any link you provide is doomed to be dead in an internet minute. Which means this answer may not be as useful in the future.
Comment: I've used it when making sundials and a chair.  I like having a base and height measured in eighths instead of some arbitrary number of thousandths of an inch.  At last check, fiddles live forever.
Answer:
…nothing to tell you what dimensions will produce an angle that you supply.

Angles don't determine the lengths of the sides. You could supply all three angles and that would constrain the sides to a certain ratio, but you'd still need to supply the length of one of the sides to determine the lengths of the other two.
Answer: A scientific calculator or program that gives the Tangent of an angle. Remember, tangent equals opposite length divided by adjacent length. Once you have that ratio you plug in one of the lengths and you have the other length.

Angle to Inches Calculator


Can a FullTextSqlQuery in SharePoint use the "This Site" contextual scope?

Question: I want to limit my full text SQL query to a single site collection and I am calling the SharePoint search.asmx web service directly from Javascript.  Is there some way to limit this using something in the Query Schema?  This is on SharePoint 2010 Standard.  I realize that Foundation would limit the results on its own, so there must be a way.
Comment: Could you paste your code here?
Answer: You can add something like this to your query:
<code>AND site = 'http://blah/subsite/anothersite'
</code>
But in general I'd recommend that you move to KeywordQuery syntax instead of FullTextSqlQuery as the later isn't supported by FAST.
Comment: Thanks, I'll give this a shot.  This is custom work for a single client that does not use FAST.  I wanted to use a Keyword Query, but the requirements were such that I only query particular fields (not the entire record) so I set up Metadata properties for them.  I know keyword queries can handle this, but I had a few other restrictions which caused the keyword query to never return results.
Comment: Question: Are alternate access mappings handled properly?  If my site can be accessed as http://blah/sites/a or https://blah/sites/a or http://blah.com/sites/a would all work if there are AAMs defined?
Comment: You need to specify the url from the zone which you're crawling. `RebaseUriWithAlternateUri` from [SPAlternateUrlCollectionManager](http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spalternateurlcollectionmanager) may help you get that
Comment: I answered my own question.  AAMs are handled.  Thanks!
Comment: I missed your answer to the AAMs before I responded and we have different answers.  My observations indicate that that AAMs _do_ work.  In my case the site name had the servername in one test and a publicly available host header in the second.  Both worked and both returned 0 results if I put a character at the end of the URL (making it a different site).
Comment: Great just wasn't sure


Moving photo and music libraries to external disk to free up disk space on a Mac desktop

Question: I'm using a 2011 iMac using macOS Sierra 10.12.6. I'm running out of disk space and I want to find out how to transfer entire music and photo libraries to an external SSD, then delete everything on the Mac, start new libraries and still be able to view/listen to the old stuff.
Comment: Does this answer your question? [What's the easiest way to free up disk space on my iMac with a huge photo library?](https://apple.stackexchange.com/questions/48224/whats-the-easiest-way-to-free-up-disk-space-on-my-imac-with-a-huge-photo-librar)
Answer: For files not stored in Photos, iPhoto, Music, iTunes, you can simply drag and drop the files / folders in Finder.
For files stored in Photos or iPhoto, locate your photo library and drag it to your SSD. Close Photos/iPhoto before doing this. Typically, this is a file in the ~/Pictures (In Finder, Go > Home and open Pictures folder). After moving it, when you open Photos/iPhoto, you may be asked to select your library.
This process can be repeated in the same fashion for Music/iTunes, except that it will be located in ~/Music instead of ~/Pictures.
Two things to note:

If you use iCloud Photo Library, follow the same steps. After completing the steps, you can open Photos > Preferences and make sure that the library is marked as the System Library.
If, for any of these applications, not all of your media is located within the library, it will not transfer.

In Music, you can choose File > Library > Organize Library and indicate both options.
In Photos, you can create a Smart Library that matches "Photo is Referenced" to see if you have any photos of this nature.


How to disable start up programs for only one user

Question: The title says it all. I got 2 accounts. How do I disable some programs with msconfig on that particular account but not on the other account?
Answer: Download this free program https://technet.microsoft.com/en-us/sysinternals/bb963902.aspx from Microsoft Technet. (if link fails, google "autoruns for windows")
Download to Desktop; 2x-click on autoruns.exe, allow it to scan the registry (status on bottom-left of screen)
Click on the user tab - you will see numerous user accounts - choose one and then click on the "logon" tab - un-check the boxes for those items you wish that particular user not to have run at logon; repeat for others
I hope this helps.


What are offchain and onchain Transactions?

Question: What is meant by off-chain and on-chain transactions? I don't get the meaning of off-chain and on-chain in general.
Answer: Off-chain transactions are those that do not belong to the Ethereum network, and are not visible there.
On-chain transactions are the ones executed on the Ethereum network. That's why you can track them using tools such as etherscan.io.
Usually, off-chain transactions are somehow "connected" to on-chain transactions (for example: storing the tx-hash of an on-chain transaction in a database or vice versa). This is useful because not everything belongs to blockchain network, and yet we still want to "connect" data on blockchain to our data, stored in a relational database or something.
Answer: Offchain transactions are used for micro payment in which two parties create a channel and transact micro transaction just signing and not broadcasting to main net .. Once they decide that they need to claim the exchanged value then they can post the transaction to Mainnet for mining and the value will reflect into their balances..


Can you provide some pseudocode examples of what constitutes an AI?

Question: After years of learning, I still can't understand what is considered to be an AI. What are the requirements for an algorithm to constitute Artificial Intelligence? Can you provide pseudocode examples of what constitutes an AI?
Comment: Here's a very similar question [What are the minimum requirements to call something AI?](https://ai.stackexchange.com/q/1507/2444). I won't close it as a duplicate because here you are _also_ asking for pseudocode examples.
Answer: Philosophically, my own research has led me to understand AI as any artifact that makes a decision.  This is because the etymology of "intelligence" strongly implies "selecting between alternatives", and these meanings are baked in all the way back to the proto-Indo-European.
(Degree of intelligence, or "strength" is merely a measure of utility, typically versus other decision making mechanisms, or, "fitness in an environment", where an environment is any action space.)
Therefore, the most basic form of automated (artificial) intelligence is:
if [some condition]
then [some action]

It is worth noting that narrow AI which matches or exceeds human capability, in the popular sense, manifested only recently when we had sufficient processing and memory to derive sufficient utility from statistical decision making algorithms. But Nimatron constitutes perhaps the first functional strong-narrow AI in a modern computing context, and the first automated intelligence are simple traps and snares, which have been with us almost as long as we've used tools.
I will leave it to others to break down all the various forms of modern AI.
Comment: The expression strong-narrow AI is not a standard one and may be misleading or confusing. You're talking about narrow AIs that are really good, such as AlphaGo, but maybe you could use another adjective other than "strong". Btw, I think that "strong AI" is really a bad expression. AGI is definitely a better expression.
Comment: @nbro I noticed that certain scholars started using "strong narrow" after the advent of AlphaGo.  I think you're technically correct that "strong" is not strictly required, since it references degree of intelligence, as opposed to the nature of intelligence.  Here though, I am using it to connote intelligence that matches or exceeds human intelligence.  Perhaps I need to define that?  (PS—I agree fully that the traditional use of "strong AI" is archaic, and that AGI should be used, because it is more explicit—general intelligence is only implied in the former term.)
Answer: AI is not a simple term. There are different types, ranging from the most simplistic rule-based AI to black-box AI's so complicated it's unreasonable for a human to understand exactly what they're doing.
There's no pseudocode that if used in a program automatically constitutes it as an AI. It's not that black and white. But I can give examples:
Here's a rule-based chess AI that forfeits if it's too far behind, and plays aggressively if it's far enough ahead.
if player.score - my.score > 10:
    forfeit
elif my.score - player.score > 10:
    agressive = True

for each piece of my.pieces:
    for each square of board.squares:
        if noThreats(square) and agressive is True:
            move(piece, square)
            return

This is considered an "AI" because it feigns intelligence - appearing to have a true understanding of chess while simply following a set of rules, making it an "Artificial" Intelligence.
Here's another more complicated AI:
decisionNet = NeuralNetwork(64 inputs, 2 outputs)

choice = decisionNet(board.squares) // Returns a chess square with one of my pieces and desitnation
move(choice)

This uses a neural network to make the decision, which could have been trained on a bunch of example games or against itself. Due to this "training phase", humans can't understand precisely what the network is doing without extensive effort, so it's an even gives an even more convincing understanding of chess. But if we want, we could still understand the nuances of this network, and show it doesn't possess an intelligence, it again only feigns it.
I should mention that virtually any code that has an if statement can be considered AI. The examples I provided are just easier to pass off as understanding a very complicated concept (chess), as opposed to, say, verifying a user login. They both have the same fundamentals, it's just one appears more complicated on the surface than the other.
Comment: Do all AIs include the if statement or it depends on the type of AI?
Answer: Another question is:
"How to build intelligent behavior from natural (like) language pseudo code?"
I am layering very natural like language above Python code and modules.
This will generate and execute code from english NLL pseudo code.
But, pseudo code is just code if the BNF definition works.
You can see the basics below.
I'm adding this NLL to my Iceberg/Sagent intelligent agent AI.
Theoretically, that will be more like what you mean by "AI"
As the first answer says, "AI as any artifact that makes a decision"
I would elaborate by saying, "An AI performs an action by making a decision"
My Iceberg/Sagent AI uses a layer above python modules turning them into Sagents (or Intelligent agents).
Sagents process data using a type of decision tree methodology.
This will be programmed via instincts, basically built-in (bootstrap) NLLs.
Answer 1 said, "sufficient processing and memory to derive sufficient utility from statistical decision making"
By sufficient, I would agree there needs to be a large body of
instinctive or bootstrapped performance to get the AI to the point
where it can grow its knowledge in an unattended way.
But just as you should never leave a child unattended,
the same is true for an AI. I've had unattended experiments that have gone a bit bat shit. I'm worried about this aspect of AI, that someone will create a dangerous AI and turn it loose. "AI Robot" could be a real issue at some point in the next few years.
Anyway, below is a simplistic thought starter on NLL pseudo code:

Built-Ins
|"execute python", code|
|"python",    code|
|"execute c", code|

ai_def( "a human sentence" ):
    sentence = |"python","input("Enter a sentence: " |
    return( sentence)

ai_def( "remove stopwords from", tokens ):
    stopwords = |"python","nltk.corpus.stopwords.words('english')"|
    non_stops = |"python","tokens.difference(stopwords)"|
    return( non_stops )

ai_def( "keywords from", sentence ):
    tokens = |"python","nltk.word_tokenize( sentence)"|
    keys = |"remove stopwords from", tokens|
    return( keys )

ai_def( "add to sayings"):
     keys = |"keywords from",saying=|"a human sentence"||
     |"add to sayings dictionary using", keys, saying|

ai_def( "get saying for human" ):
   subject, verb = |"get subject verb of", saying=|"a human sentence"||
   match = |"find saying matched from", subject, verb|
   report( match)

Anybody interested?
Or, if something already exists, let me know.


Equivalent of forward/back buttons for unix shell (when navigating directories)?

Question: I'd like to be able to type in terminal commands of forward/back especially if I went from a directory with a super-long name to home (and want to return back to the directory with the super-long name).
Comment: Can you explain some more? is `cd -` what you want?
Answer: The command cd - will take you back to the previous directory.
Also look into the pushd and popd commands which can be used to basically save an ordered list of directories you were in and go back to them.
Answer: pushd and popd can be very useful.  For example try

$ pushd somedir

and when you are done, just do

$ popd

and you are back where you started.
The best part is you can do

$ pushd somedir

$ pushd anotherdir

$ pushd onemoredir

and then you can "step back" one at a time using popd.
Good luck!
Answer: As well as cd - and pushd and popd which others have mentioned, there is also cd $OLDPWD.   usually cd $OL<TAB> is enough, auto-completion at work.
When using pushd and popd, bash's dirs builtin can really help out, for example: dirs -v prints the directory stack with one entry per line, prefixed with its position number in the stack.  try help dirs for more.
Note that if you want change to a directory named -, should you have one, the above feature poses a problem.  you will need to do cd ./-.  better still, don't give your directories such names.
Answer: There is a script that,by typing cd --, allows one to switch to one of the ten last visited directories whilst being in a particular Bash shell. Here is an example of its use:
lotzmana@safe$ cd work
lotzmana@safe$ cd scripts
lotzmana@safe$ pwd
/home/petarma/work/scripts
lotzmana@safe$ cd --
 0  ~/work/scripts
 1  ~/work
 2  ~
lotzmana@safe$ cd -2
lotzmana@safe$ pwd
/home/petarma

The script was published by Petar Marinov in the Linux Gazette, Issue #109, December 2004 and also a month earlier on geocities.


Calculate time on power on delay

Question: I am trying to make a time delay circuit (see the image) in which when press a momentary button the relay will stay open for a specific time. I tried my circuit but I cannot calculate the time (I tried the T=RC formula and it did not work). Does anyone knows how I can achive something like that to stay open for a specific time?
Comment: The 1N4007 is a mistake - short it out.
Comment: You need a resistor in series with the cap.  With an ideal +12V source, your delay is zero with what you have shown.  And like Andy said, the diode serves no purpose.
Comment: The diode will tend to led the MOSFET turn on but prevent it from turning off as the MOSFET gate won't be able to discharge. "*... and it did not work*" is not useful in helping us to debug your circuit. How does it not work? Hit the edit link below your question ... Welcome to EE.SE.
Comment: @Transistor You are right, I should give more information about what went wrong. Saying it did not work I mean that the occured by the calculation was not the same as the time occured on the circuit. On the circuit the relay was on for much longer time
Comment: Thank you all for replying!!!
Comment: @SteveSh I put the diode there because I want to put 3 different combinations of R and C and 3 buttons in order to have 3 different time delays (30, 60, 90 seconds). So i thought that when i press a button, a specific capacitor discgarges and the other 2 will charge, so in order to prevent this I put the diode on the way to the gate (1 diode after each R-C combination)
Answer: I think this is more what you are looking for:

simulate this circuit – Schematic created using CircuitLab
R2 provides a path to discharge the gate charge of M1. R2 is effectively in parallel with R3 etc. so the time will be a bit less as a result.
R1 limits the charging current of the capacitors so it does not damage the switches or pull the power supply down.
D2 is a catch diode to deal with the inductance of the relay coil (as M1 turns off slowly anyway in normal operation, so it may not be an issue, but if the gate of M1 was shorted to ground the voltage at the drain would rise high enough to avalanche the MOSFET most likely, which isn't great).
Comment: Thank you so much mate. Both schematics are really close to what I am looking for. So in this case let's say on the c1 capacitor the power on time is T=2.2mF*(15kΩ+100kΩ)?
Comment: The resistance is 15K || 100K or 15K*100K/(15K+100K) = 13K. The time will be approximately some number K  T ~= K * R *C, but K may not be exactly 1, depends on the MOSFET, supply voltage and relay characteristics. This is not a very precise circuit.
Answer: From the comments:

I put the diode there because I want to put 3 different combinations of R and C and 3 buttons in order to have 3 different time delays (30, 60, 90 seconds). So i thought that when i press a button, a specific capacitor discgarges and the other 2 will charge, so in order to prevent this I put the diode on the way to the gate (1 diode after each R-C combination).

That was a nice try but the problem is that the MOSFET has an extremely high input impedance and a little bit of capacitance. It doesn't behave like a regular transistor whose charge will leak away through the base-emitter junction. The gate behaves more like a small capacitor so charging it up through the diode will work fine but you won't be able to discharge it. Your RC circuit will decay but the MOSFET will stay on.

simulate this circuit – Schematic created using CircuitLab
Figure 1. A three-input OR arrangement.
At the expense of two more MOSFETs you can solve the problem. You can also use the diode to act as a snubber to prevent the relay damaging the MOSFETs at switch off.
Comment: And how I will calculate the power on time? Also could you please explain what the snubber is?
Comment: Power-on time will be approximately given by the time constant, \$ \tau = RC \$.  Remove the diode from your first circuit and take some measurements. You'll find plenty of material on a web search for "snubber diode".
Comment: OK thank you very much for your time. I will check it out

Calculate time on power on delay


How to smooth shade an object while retaining hard edges?

Question: I frequently come to the problem of having a mesh with parts I would like to render smooth and "hard" edges connecting them.
How can I set the mesh to show the sharp edges but render everything else smooth?
In the example I would like the sides of the individual cylinders render smooth but the intersection between bottom and top to be sharp/flat
Comment: Thanks for the answers, I guess both are really good depending on the situation.
Answer: There are a few ways to do this but the quickest and most efficient (in your case here) is to just smooth it the same way, using Shade Smooth and then adding an Edge Split modifier to the mesh.
From the wiki

The EdgeSplit modifier splits edges within a mesh. The edges to split
  can be determined from the edge angle (i.e. angle between faces
  forming this edge), and/or edges marked as sharp.
Splitting an edge affects vertex normal generation at that edge,
  making the edge appear sharp. Hence, this modifier can be used to
  achieve the same effect as the Autosmooth button, making edges appear
  sharp when their angle is above a certain threshold. It can also be
  used for manual control of the smoothing process, where the user
  defines which edges should appear smooth or sharp

Here it is as you have it above..

With the modifier added

Additionally, you can see some more tips here for getting good quality on hard surface models. BlenderCookie has a tutorial (archived) on getting nice sharp edges.
Comment: I love you brah
Answer: While what iKlsR says is indeed the most efficient, it's often preferred to either add edge loops on both sides of the hard edge, or bevel it (Ctrl + B). When smooth shaded this produces a more realistic surface since there's seldom any truly sharp corners in reality, and also catches specular highlights nicely showing off the model better.

Note that the Edge Split modifier shouldn't be used when beveling or using edgeloops to sharpen corners. Edge Split physically cuts the model to fake a sharp corner, whereas beveling actually creates the corner.
Comment: It is perhaps useful to mention to the reader that the _EdgeSplit_ modifier and _Bevelling_ operations are not mutually exclusive techniques. Doing manual bevels helps guide the transition from smooth to flat  in those sections where _EdgeSplit_ produces unnaturally abrupt transitions.
Comment: For anyone really new to Blender -- Bevel is a modifier. Look for it there.
Answer: As of this commit (will be in blender 2.71), blender has support for split normals.
This is basically like the old Autosmooth, but it works in Cycles and the viewport in addition to BI.
If you don't know what Autosmooth is, it behaves like the edge split modifier, but without actually splitting edges:

There is no edge split modifier used in the above screenshot.
Comment: This is amazing. It fixed all my shading problems caused by subdiv / 1.0 creases at once.
Comment: This should actually be the top answer, or the accepted answer should be updated.
Comment: as of 2.80, does this work with Eevee too?
Comment: @Luciano yes, it should. The setting is in the same place as well iirc
Answer: Another thing that you can do is - In Edit mode hit W  and there you have Shade Flat and Shade Smooth You can just select the parts of your object that you want them to be smooth and press on Shade Smooth.

Under 2.8+ this is accessible through both Edit Mode and Object Mode Right Click context menu.
Answer: The following method is probably best for real-time (e.g. games) and low-poly work in particular.
Gandalf3 mentioned the new Autosmooth feature, but I'd like to add that with it enabled, you can manually select faces, edges and vertices that you would like to be hard - the Autosmooth 'Angle' setting merely creates a base smoothing to work from. If you then go into edit mode and look in Shading / UVs > Shading, there are options to mark vertices, edges and faces. With Autosmooth disabled, you can see the edges/vertices you have marked, but they will not be rendered flat, but when Autosmooth is enabled, they will be rendered correctly.

As Gandalf3 mentions, unlike the split edges modifier, Autosmooth does not physically split elements in order to get hard edge lighting, so is ideal for low-poly work, and seems to be designed for better compatibility with the FBX and OBJ formats, which are commonly used in games.
Answer: Another simple way to do this would be to select the faces that you want smooth (in this case the non-horizontal surfaces) and select Shading: Smooth in the tool panel. Then, select the faces that you want sharp (horizontal surfaces, in this case) and select Shading: Flat.
It probably won't give as nice results as Greg's method, but it might be quicker and simpler.
Comment: This is a useful method if you need a lowpoly mesh to import into i.e. Unity. Just make sure to import tangents.
Comment: @NoviceInDisguise It seems to work fine for me in 2.73: http://i.stack.imgur.com/4XqVR.png
Answer: Just to be complete:
The first and original method to achieve that is still there: Autosmooth.
It works like an Edge Split set to Edge Angle. The drawback is that the effect isn't visible in the viewport. The modifier is somwhat superior by now.
Comment: This answer is now [outdated](https://blender.stackexchange.com/a/8720/28015).


Testing the randomness of allocation of multivariate dataset

Question: Everyday we allocate mortgages between two investor platforms. Within each risk segment and term (length of mortgage in years), mortgages are allocated based on investor demand randomly. ie 70/30 split.
Mortgages/borrowers can have a number of attributes, fico, dti, loan amount, borrower income, number of revolving accounts, etc.
I want to validate that the random allocation is truly random across time and across various attributes.
I am thinking of using Welch's t-test and testing each attribute separately (unequal sample sizes and unequal variances). Is this approach valid or should I look at some type of multivariate test? ie Hotellings T-squared.
On some days, there are only a handful of loans per platform, so I think using a window size of couple days, a week or even month. What do think for the time dimension and monitoring the overall process on an ongoing basis?
Answer: You could do a Chi-Square test.  Search for Chi-Square test for fair dice.  It is pretty much the same problem.


new block for Customer Account - preferable inheritance

Question: I want to add custom block with custom logic to customer account. Is there any preferable inheritance in this case fro new block?
Answer: Do not use inheritance, if it is not necessary.
Moreover, blocks are private classes of modules, this class may be modified in next versions of module.
Should not use extending \Magento\Customer\Block\Account\Dashboard for using only one method. This class have many dependencies, which not needed in your block. Inheritance will increase coupling between objects, arguments count, stability in your class and your module will become non-reliable.
Use inheritance from \Magento\Framework\View\Element\Template and implement only the necessary methods for you
Answer: It depends on what you need.
For a simple text block \Magento\Framework\View\Element\Template should be enough.
If you add something in the dashboard you might want to use \Magento\Customer\Block\Account\Dashboard as a parent class. It already contains methods for retrieving the current customer, the account url, the address url.
Comment: I thought that there something maybe in sake of security and it is recommended to extend for.

I have to prepare additional block with recently visited product for customer and it should be visible inside customer account.
Comment: I think you can simply extend the template block and add a method in there that retrieves the current customer. The security part should be implemented in the controller. So if you use the block only in the customer account page you should be safe.


Tension in a wire

Question: I found this image on one of the answers I was going through. In this picture since the man balances himself in the middle of the rope, there's equal tension throughout it. However if he would have been standing at the end there must have been unequal magnitude of tension at both the ends of the rope, if the angles would have been of different magnitude. But since it is an ideal string it must have equal tension throughout so why there's different tension in its different parts?
Comment: Tension is only equal throughout if no force is exerted along the direction of the rope.  If the man's foot exerts a frictional force on the rope, the tension changes there.
Comment: The tension experienced by the rope doesn't have to be the same throughout the length of the rope. It can be different on either side of the man. What's required is that the three red force vectors add up to zero. If the man is at the exact middle of the rope, then symmetry requires that the rope tensions on either side of the man are the same. But if the man is closer to one pole than the other, the requirement that the three forces sum to zero will mean that the magnitudes of the tensions $T_L$ and $T_R$ are different.
Comment: But we are taught that an ideal string has constant tension throughout its length?
Comment: Hang a rope or string AB freely from one end A. Tie a weight W to its midpoint M. The tension in section AM is W. the tension in section MB is zero.
Answer:
since it is an ideal string it must have equal tension throughout

Why is that the case?  If we imagine a small segment of string (massless and inextensible), then for it to be stationary, the acceleration must be zero and the net forces must be zero.  In the middle of a string, the only forces are the tension from either side, and gravity.  Since we've declared the string to be massless, then we ignore gravity and declare the tension on both sides equal.
So for all parts of the string that are not impacted by some other force, this holds.  We can even add an ideal pulley, a device that can provide forces normal to the string, but will add no forces along the string.  In such a case, tension remains equal throughout.
But the walker here adds forces to a portion of the string, and some of those forces are parallel to the line of force from either end.  This modifies the forces felt by that segment, and the tension to keep the net force zero is no longer necessarily equal.
Comment: @RituKhanna - Well, even even if there are no external forces and you have a string with mass then in general the tension will not be constant throughout the string. For example, if you hold a string by one end then the portion of the string nearest to your hand will be under the most tension while the other end of the string which is free and dangling downward will have very little tension in it near its end. I think that "constant tension" must refer to a situation where there are no external forces and gravitational forces on the string are negligible.

Tension in a wire


Enforce screen break automatically every hour

Question: I am using Ubunte Mate 16.04. I would like to know if it is possible to lock the screen every hour automatically? I does not matter if the computer is idle or not. After working for an hour a screen break for at least 5 minutes should be enforced by locking the screen. After 5 minutes have elapsed the work may be continued.
Comment: Welcome to SuperUser! Your question is about Ubuntu. You would probably get better expertise, and therefore better answers on [Ask Ubuntu](http://askubuntu.com). Please flag your question to be migrated, or delete your question and re-ask it over there. Please do not cross-post (i.e. ask your question on Ask Ubuntu before you delete here or your question is migrated) You may ask your question there once you have deleted your question here.
Comment: @ubashu My question is generally about Linux. I happen to use Ubuntu currently but this might very well change in the future. If every question that involved Ubuntu were to be migrated then I really do not see any point in having the Ubuntu-tag here.
Answer: The wikipedia page on rsi software gives some links to Linux tools. pokoy seems to fit your requirements, with a configuration file of options like
enable_skip <true/false>:
 If set to true, user can press 's' to skip break.
enable_postpone <true/false>:
 If set to true, user can press 'p' to postpone break.
break <time_between_breaks> <break_duration> <postpone_time>:

You need to compile it, so may need to install libxcb-devel.
Comment: I use [Workrave](https://en.wikipedia.org/wiki/Workrave), available in the Ubuntu's repository.
Answer: with MATE as desktop environment you can easily achieve this with an onboard-tool:
open the Control Center and search for Keyboard; in the following window go to the Typing Break-tab and check the first checkbox... the settings should be self-explaining.


Is the canonical morphism of sheaves $f^{-1}f_*\mathcal F\to \mathcal F$ an isomorphism?

Question: Let $f:X\to Y$ be a closed immersion of topological spaces. Let $\mathcal F$ be  a sheaf of rings on $X$. Is the canonical morphism of sheaves $\varphi: f^{-1}f_*\mathcal F\to \mathcal F$ an isomorphism?
Comment: @GeorgesElencwajg Here $f$ is also a closed immersion.
Comment: @Born to be proud. You are right, I misread the question. I have deleted my comment and apologize to you and eloiPrime. Thanks for your vigilance.
Comment: @GeorgesElencwajg It doesn't matter.
Answer: Yes, $\varphi$ is an isomorphism: I showed it here
However if  $f$ is not assumed to be a closed immersion (=the inclusion of a closed subspace) , the result is no longer true in general.
Here is a counterexample:
Let $X$ be an arbitrary topological space space, take for $\mathcal F$  the sheaf of continuous functions $\mathcal C$ on $X$  and let $Y=\{y\}$ be a point.   Of course $f$ must be the constant map $X\to Y:x\mapsto y$.
Then $f_*\mathcal C= A_Y$, the constant sheaf on $Y$ with (unique!) stalk $A=\mathcal C(X)$.
Hence $f^{-1}f_*\mathcal F=A_X$, the constant sheaf on $X$ with fibre $A$.
Since obviously the sheaf $\mathcal C$ is not constant in general, the sheaf morphism $\varphi: f^{-1}f_*\mathcal C=A_X\to \mathcal C$ cannot be an isomorphism in general.
Answer: $\forall x\in X$, $(f^{-1}f_*\mathcal F)_x\simeq (f_*\mathcal F)_{f(x)}\simeq \mathcal F_x$, so $\varphi$ is an isomorphism. Is it correct?
Comment: Yes it is correct and proved in detail [here](https://math.stackexchange.com/a/228781/3217)


Why does House have an old TV in his office?

Question: I'm up to Season 3 of House, M.D. and it's been perplexing me for a while now as to why Dr. House has an old TV in his office. It's a small Cathode Ray Tube (CRT) TV and has been seen in the background of many episodes sitting on a cart with wheels. Is it ever revealed during the series or in any actor/director commentary why he still has it?
Comment: The question is more so why he has a CRT TV instead of a modern LCD TV.
Comment: Because he is addicted to watching porn?  In several episodes he is fighting with Cuddy to enable the pay-per-view channels.
Comment: She wouldn't buy him a new TV?  I believe there was an episode where he managed to talk her into getting a new HD TV.
Comment: Update: Zoredache was correct that House did eventually get a new HD TV. However he lost it somehow. I'm into the middle of Season 7 and he still has the CRT.
Answer: One of my coworkers was the Art Coordinator for House and helped create the original sets. This is what she said on the subject:

There is no particular significance to any item in his office or
  apartment, but the items were chosen to help develop the House
  character. Additional items accumulated over the seasons as his
  character grew, but old ones tended to stay. He is a doctor on the
  cutting edge of medicine and he is an audiophile. He is surrounded in
  both his office and home by older technologies and old stuff in
  general that he appreciates for their simplicity - he is a man who
  thinks you shouldn't replace things that work.
He is seen watching the television in early episodes. You will also
  notice a Sota turntable to his right, and in his apartment he has an
  old baby grand.

In a humorous aside, this coworker told me the story of the old baby grand, which the art department had an incredibly short time to get refinished and tuned (by Frank Sinatra's tuner, no less). So when the piano was delivered, my coworker was the only one on the sound stage. Once she got it in place she did what anyone would do who was alone on a sound stage with a freshly tuned piano - she sat down to play. To her horror, when she stood up, every stitch of her blue jeans could be seen etched into the freshly refinished piano bench! Alas, a panicked call to a scene painter resulted in the worst of it getting buffed out, and no one ever noticed.


What are some good Java web development tools (across the board)

Question: For web development what are some standard/good java tools.  That apply to all aspects of development.
For example, The IDE (Eclipse, RAD, Intellij) is important, but what else is there.
Ant is a good one.
Cygwin, Linux OS possibly.
Answer: Another good IDE for Java web development I use is Netbeans. Has many useful features version control, debugger, profiler, api access etc ...
You can edit, build, test, and run all inside of the IDE.
Answer: Before trying to write a piece of code check if it is implemented in some library. Great source of common programming task solutions can be found in Apache Commons libraries.
Answer: IDE is the tool where you will work 90% of your time. So the choice of the IDE is extremly important (yes, choose IntelliJ ;) )
Today, they integrate lots of plugins / features, such as Ant or Maven2 tools.
I use Oracle SQL developer (or eventually Toad) to browse my databases.
For web developments, you have Firebug for Firefox essentially to debug Javascript.
You can also test your web applications by using Selenium.
Others tools:
GlassFish for application server.
Sonar for quality control.
Hudson for continuous Integration.
Answer: Spring is a pretty powerful framework. We only use the controller and view aspects of it, but it has a lot of features.
Hibernate is always great to use. I believe Spring will also work with Hibernate and make some things easier.
I usually host the app on Tomcat.
The latest version of Netbeans has a lot of features and integrates very nicely with Tomcat and other app containers.
Aqua data studio is great for working with databases.
We use luntbuild for building the application.
DWR is great for AJAX.
Also consider topics like this:
https://stackoverflow.com/questions/913/what-javascript-library-would-you-choose-for-a-new-project-and-why
Answer: JUnit, Cobertura, Hudson
Answer: I recommend Oracle JDeveloper. It covers all aspects of Java and web development from the simple web sites to the highly complex using ADF and other frameworks.
Answer: The IDE is the most important tool, and the different IDE's have somewhat different focus:
IDEA and Eclipse are what I'd call code-centric IDE's, that do not focus extensively on wizards and designers - although they both have some designers. Netbeans is the direct equivalent of Visual Studio for java; focusing on visual designers wizards and more guided developer support.
Take your pick ;) (I'm a  IDEA user)
Answer: The single best tool you can have (IMHO) for Java web development is access to a remote debugger that is JPDA compliant. An example implementation can be found in the Eclipse Web Tool Platform plug-ins.
Why is this so good? Well, if you're having issues with your controller that you can't turn up in your unit tests and that you can only recreate on the live running system, you can attach your normal debugger (such as the eclipse debugger) to a live web page and treat it the same way you would any other piece of Java code. Breakpoint to your hearts content.
(I've assumed you're interested in actual tools, and not just libraries like Spring, Struts, Freemarker et al).
Answer: We are using TeamCity. This is very useful tool for building projects. Supporting not only Java but also .NET projects. And it is free.
And why no one mentioned about VSC? :) We are using Subversion, but Git is more convinient in more cases. It give more comfortable tools for working with branches.
Maven also good tool, but it's too complex. Especially if you are already using ant. In this situation i recommend you to look at Ivy. Ivy can manage dependencies for you, like Maven, and use Maven repositories.
VisualVM great tool for monitoring your JVM instances. It have plugins for mbeans exploring, thread dump analyzing, memory dump analyzing and more.
As unit testing framework i recommend TestNG combining with hamcrest. TestNG is more flexible than JUnit and have multiple advantages like support for parallel testing, for example. You can easily run your tests in parallel.
Answer: FindBugs is a good utility for improving your Java code in general, whether you're doing web development or something else:
http://findbugs.sourceforge.net/
Answer: I've been very happy with NetBeans for years. Used Eclipse too but I decided to stick with one and NetBeans was my favorite.
Don't know what the other guy was talking about when he said Netbeans was more visual. Except for Matisse, which is for Swing apps and I think there's a JavaFaces visual thing but I don't use faces.
I started programming java web apps in notepad (yeah i know) years ago and find it much faster to code in NetBeans. You download it and you're ready to start building websites right after you install it.
Answer: My infrastructure looks like this for the webapp I'm involved in:

IntelliJ Idea, I just use it for some time now, but I guess any halfway modern IDE will do it, just learn one and learn it well, so read NetBeans, JDeveloper, Eclipse but I never used one of them for longer time
Teamcity, Continous Integration (which I love for the delayed checkin and remote runs, never ever check in a broken branch anymore!)
Maven and Artifactory, Dependency Management for our software stack
Tomcat (or Glassfish)
SVN as SCM

On the lib side I use

Spring
Hibernate
JSF + Trinidad
Spring Webflow
JUnit
Fitness
EasyMock

I guess for development you should also consider something like HSQL or something, don't make yourself depend on big databases and you can't run/test your stuff on the road ;-).
The hard part in the beginning here is to set everything up properly in maven. This is not a task which just takes 5 minutes but I think it's worth it. I have not played around with Ivy yet maybe this might be a good solution too. I do not want to wade through ant scripts anymore, those are getting easily out of hand if your project grows.
Everything works in Windows/Linux/Mac as you would expect from Java and a modern IDE.


What is the meaning of this line at the beginning of the movie?

Question: In "The Men Who Stare at Goats (2009)", this line appears at the beginning:

The movie looks like fiction, with superpowers etc.
Why does it say that more of this is true?
Answer: They say that more of it is true than you would believe, and considering the farfetched material, you'd think that none of it is true... But amazingly, some of it is based in reality. The US military did experiment with the paranormal and it was funded by Congress. ABC News covered it extensively, and here are some choice bits:

Major Paul H. Smith calls it his "Men in Black" moment. It was 1983 and he was working as a Middle East analyst at Fort Meade, Md., when a fellow intelligence officer approached him with a highly-classified, so-called "black project." [...]
For seven years, Smith took part in a congressionally-funded program focused on training officers in "remote viewing," or a paranormal skill that supposedly allows a person to see a target despite the restrictions of space or time. [...]
Smith and others familiar with the actual events upon which the movie and book [it was based on] are based say they only loosely reflect reality. But they also say that in ways both formal and informal, the military did dabble in the paranormal. And, they claim, they had some success.

Even the goat-staring is loosely connected to real events. From the same article:

Col. John B. Alexander, a retired intelligence officer who is on the IRVA's executive board, didn't take part in the remote viewing program, but participated in other activities loosely described in "The Men Who Stare at Goats." [...] The story of the goat stared to death, he said, likely came from casual experiments with the martial technique, dim mak or "death touch." [...]
Though he didn't see someone use the technique on a goat, he said he saw the necropsy report for a goat that had apparently experienced the "death touch." He said across the goat's rib cage, he saw a path that looked just like that of a bullet, but there was no wound of entrance or wound of exit.
Answer: The army did research the paranormal for counter-intelligence and military applications. For example the Stargate Project. So, I'm guessing that's the real part, the part hard to believe. Military men, in military suits, did try to "stare goats to death".


Does my definition of double complex noncommutative numbers make any sense?

Question: I wanted to factorize $a^2+b^2+c^2$ into two factors in a similar way to $$a^2+b^2 = (a+ib)(a-ib)$$
This doesn't seem to be possible using real or complex numbers. However I came up with the following idea $$ (a + ib + jc) (a -ib -jc) = a^2+b^2+c^2$$ if we define $$i^2=j^2=-1$$ and $$ ij = -ji.$$ So instead of using complex numbers I had to define a kind of double complex number obeying a non-commutative multiplication rule to solve my factorization problem.
Does my definition of this numbers make sense or is it somehow inconsistent? Do these numbers already have a name in mathematics and are they used? Is there any literature about them?
Comment: Congratulations on rediscovering the quaternions!
Comment: Yes this works. but you are really working in quaternions, which has $3$ 'imaginary numbers,' $i,j,k$. http://en.wikipedia.org/wiki/Quaternion. Basically, $ij=k$.
Comment: I agree, you have had a very nice insight there. Hamilton searched for a long time -- it was a running joke among his kids every morning -- for a way to generalize complex numbers into 3D space. He "got it" while walking with his wife over a bridge, realizing that he needed _three_ $i$-like quantities, not just two, to make everything work. Despite quaternions falling out of favor later on, they were instrumental both the the development of vectors and concepts such as dot and cross products, all of which are quaternions subsets. Maxwell's original equations use quaternions, not vectors.
Comment: @QiaochuYuan Thank you. "One cannot invent useful things, one can only rediscover them." ;-)
Comment: I should add on @Terry's comment that the bridge mentioned has an inscription about this realization. One can still see this in Dublin (if one is not too hazy from drinking).
Answer: You have come across the quaternions. They are numbers of the form
$$a+bi+cj+dk$$
where $a,b,c,d\in\mathbb{R}$ and $i$, $j$, and $k$ are symbols satisfying
$$i^2=j^2=k^2=ijk=-1$$
$$ij=k,\quad jk=i,\quad ki=j$$
$$ji=-k,\quad kj=-i, \quad ik=-j$$
Multiplication of quaternions is non-commutative in general, but it is still associative.
The conjugate of a quaternion $q=a+bi+cj+dk$ is defined to be
$$q^*=a-bi-cj-dk,$$
and the norm of a quaternion is defined to be.
$$\|q\|=\sqrt{qq^*}.$$
After expanding everything out, one can see that
$$\|a+bi+cj+dk\|=\sqrt{a^2+b^2+c^2+d^2}.$$
So, to factor the expression $a^2+b^2+c^2$, you were just using quaternions for which the coefficient of $k$ is equal to $0$:
$$(a+bi+cj+0k)(a-bi-cj-0k)=a^2+b^2+c^2+0^2=a^2+b^2+c^2.$$
There are other extensions of the complex numbers that are possible: the other one usually mentioned are the octonions, which are $8$-dimensional over the real numbers.
Comment: Is there a special name for quaternions which have the coefficient of $k$ set to zero? And can't there also be quintions which could then factorize $a^2+b^2+c^2+d^2+e^2$ into two factors ?
Comment: No, there are no quintions.  The next number system is octonions, which are not associative.
Comment: @asmaier Quaternions with their $k$ component zero have no special name because they aren't closed under multiplication; I've added an answer that explains the details on this.
Answer: It's worth pointing out that you need to go up to the quaternions - a four-dimensional space - because a factorization of the sort you're describing doesn't 'work' in just three dimensions.  Suppose you had $z=a+bi+cj$ (and so $\bar{z}=a-bi-cj$) and $w=d+ei+fj$ (with $\bar{w}=d-ei-fj$).  Then $x=zw$ would be of the form $r+si+tj$, with $r$, $s$ and $t$ each expressions in $a\ldots f$, and $\bar{x}$ would be $r-si-tj$; taking the norms (or in other words looking at $|x|^2 = x\bar{x} = |z|^2|w|^2$) would give you an identity of the form $(a^2+b^2+c^2)\cdot(d^2+e^2+f^2) = r^2+s^2+t^2$.  But consider $(1^2+1^2+1^2)\cdot(4^2+2^2+1^2) = 3\cdot 21 = 63$; this number is of the form $8n+7$ and so by the Sum Of Three Squares theorem it can't be expressed as $r^2+s^2+t^2$ for any values of $r,s,t$.  This means the three-squares identity (or in other words, the three-dimensional product you're looking for) can't exist.
Answer: Going from complex numbers to the quaternions you lose commutativity. Going from quaternions to octonions you lose associativity. What's next? There is very nice and elegant mathematics around these hypercomplex numbers. Adolf Hurwitz proved it in 1898 that every normed division algebra with an identity is isomorphic to one of the following four algebras: $\mathbb{R}$, $\mathbb{C}$, $\mathbb{H}$ and $\mathbb{O}$, that is the real numbers, the complex numbers, the quaternions and the octonions. And that's it. No more, no less.


Would be the green card expires after the divorce?

Question: If someone with F-2 visa comes to the US with her F-1 spouse, then they apply for EB2-NIW green card(in fact the F-1 visa holder as the primary applicant and F-2 visa holder as his dependent), then could get accepted and get their green cards, and after that they get divorce, what will happen for the wife who was the dependent applicant throughout all the procedure?
Will her green card expires and she must leave the US?
Answer: Once a green card is granted it does not expire by operation of law upon a divorce. If immigration officials suspect that the marriage was fraudulent in the first place, they can seek to revoke the green card because it was obtained fraudulently if they can prove that in an appropriate court.
But, generally, divorce does not revoke a green card and the green card remains in force if it was issued before the divorce.
Comment: That being said... Depending on how soon after they get the green card a divorce happens. Said couple might be investigated for a fraudulent marriage which could lead to prison time and/or expulsion.


Django REST framework API: PrimaryKeyRelatedField

Question: I am fairly new to Django Rest Framework API.
My question is that can I declare a PrimaryKeyRelatedField in serializers.Serializer subclass? Or it has to be in serializers.ModelSerializer subclass?
For example, I used to have serializer as following:
class ExampleSerializer(serializers.ModelSerializer):
    author = serializers.PrimaryKeyRelatedField(required=False)
    ## and more general fields
    class Meta:
        model = Example

which works fine.
Then I changed it to:
class ExampleSerializer(serializers.Serializer):
    author = serializers.PrimaryKeyRelatedField(required=False)
    ## and more general fields

where I got a error:
AttributeError: 'SerializerOptions' object has no attribute 'model'

What I am sure is that this error is caused by 'author' field (error will be gone if you comment it out)
So does this indicate that I cannot use foreign key type field in general Serializer?
By the way, if you are curious why I change my serializer from ModelSerializer to Serializer is because that I want to include some additional fields (which doesn't exist in any models) in order to create an new Example instance. By default .restore_object() method simple call Example(**attrs) to create new instance, which will causes a field error.
Answer: You need a model, because you want to serialize a db relationship.
Here is the doc


How can I remove unwanted object from a video and see what's behind it?

Question: If for example I have a video and there is a person that moves but is always partially blocked by an object, can I remove it somehow to get a clear video footage? I tried Adobe content aware Filter, it did not help.
Comment: Hi - please could you add a screen shot to help explain what you need to do?
Answer: There is no easy way to do this. You obviously can't just "reveal" footage that is obstructed, you'll have to recreate it. It's hard to judge the shot since you provided no screenshot, but the easiest method would probably be to grab a frame and use photoshop to remove the object and reconstruct the person by re-using parts of the existing image. If you have to reconstruct a face, I would say that it's an impossible task. A shoulder however should be possible. This way. You only have to create a "patch" for every other, or every frame, depending on the movement, then overlay those patches to your footage and track the footage if needed, to attach the patch with the tracked movement to your footage.


Rails: embedding and retrieving array from form

Question: I'm getting tripped up in Ruby, Rails & HTML syntax. Hoping some Rails ninja can help me with what's likely a trivial problem....
Post has_many Photos
Photo has a string :image attribute
In Post's _form.html.haml I would like to embed (in a hidden_field) the contents of the image attribute for each Photo associated with a Post...and then get it back out when form is submitted. I could do this either by A) adding one hidden_field for each photo.image or B) create a single array containing all associated photo.images.
I'm tripped up by how best to embed this...(A) or (B) neither of which I've fully perfected.
# _form.html.haml:
  = form_for @post do |f|

    - if @post.photos.any?
      - @post.photos.each do |photo|        -# (A)
        = f.hidden_field :image_cache       -# (A)
      = f.hidden_field :images_cache        -# (B)
    = f.file_field :photos, :multiple => true

  .actions
    = f.submit 'Save'

#post.rb  (A)
  def image_cache
    self.photos.any? ? photos.first.image : nil   -# works with `first`
                                                  -# but not sure how to
                                                  -# pass id of others?!?
  end

#post.rb:  (B)
  def images_cache
    photos.map { |i| i.image }
  end

Problem with (A) is I don't know how to pass the photo back to the Post model to return the image_cache attribute off of it?!?  f.hidden_field :image_cache(photo) doesn't work
Problem with (B) is the images_cache returned by the Post model is an array but once embedded in the HTML page and returned by the following post request it has become a string representation of an array: [/uploads/tmp/20110729-1216-15902-2013/Before_Green_Flash.JPG, /uploads/tmp/20110729-1216-15902-5934/Before_Green_Flash2.JPG] and therefore does not respond to each.
Any help with either or both situations would be greatly appreciated!
Answer: For approach a, why not: = f.hidden_field photo.image


Ubuntu 14.04 Sound coming from both speaker and headphones

Question: Okay, I have an HP 15-F039WM Laptop running Ubuntu 14.04. The problem is, whenever I plug in my headphones, sound still comes out of the speakers. I've tried everything. Alsamixer, gnome-alsamixer and the auto mute won't stay checked for some reason. Really hope someone can help me fix this. Thanks.
Answer: Install PulseAudio Volume Control from Ubuntu Software Center. Then go to "Output Devices" tab and change to suitable port (usually where should be a choice between headphones and speakers). Another way is to choose suitable profile in "Configuration" tab.
Answer: I have a HP Envy, with touch screen, Nvidia discret card and beats audio system. I have had this common issue of the sound comming out from both the speakers and headphones. I've tryed every attempt of solution I've found in any forum but nothing worked for me. But my situation is this one:
I'm using the 16.04 LTS version which doesn't provide the latest stable kernel. As beats audio doesn't provide specific drivers for linux, there is a solution to make all the speakers (the 4 on the front and the subwofer) working with a graphical tool called HDAJackRetask. It is something you have to do (if you want to make the most of your hardware), as with the dedicated graphic card, for which you can install the proprietary drives after a fresh installation. Done so, everything works as it should. But...
I also installed a tool called ukuu which installs the latest stable kernel directly from the github respository (I think). It's like going to the web yourself and download the three packages and installing yourself through gdebi or dpkg. After that, you discover than the current Nvidia drive doesn't work anymore. And the only solution is to uninstall everything related to Nvidia and start the ubuntu tool does searches for proprietary drives again. As if it was an fresh installation once again. And I think the same issue was happening with the sound system. So I run HDAJackRetask and dissabled the retask changes to the original. Rebooted and restarted and I could see the sound was able to be taken out from only one source: speakers or headphones when plugging them.
And then I run HDAJackRetask again.
So, once more, after installing a new kernel manually (with the ukuu tool in this case), everything related to the graphic and the sound cards should be reconfigured or reinstalled again.
Everything works fine again.
Just in case this could be your problem ;)
Comment: Lol I'm sorry I didn't answer you! Wow this was almost 2 years ago, and since then, I've gotten a new laptop, and built a PC that I use Linux on. I've learned a LOT about Linux in general since then. I also run Arch, but thanks for the help!


Faculty interview: how to develop yourself into a national or international research leader

Question: I was recently interviewed for a TT position, and was asked a question "how to develop yourself into a national or international research leader". It looks quite a big question. I stumbled on it, and so want to seek some ideas or inspiring thoughts to answer this questions effectively.
Comment: If there was a recipe...
Answer: Both my wife and I (in different very fields) have both bumbled around doing our best to achieve this, as well as been guilty in posing the question during recruiting.
The question operates on 2 levels.
First, how do you actually do it. This involves multiple elements:

Tailoring your research area(s)/question(s) to have national/international interest. There are many ways to do this, and the goal is not to trade off your research independence for reputational accolades. However, you do need to be focused in the right areas at the right time, and adjust the messaging of your research (at least) for what are topics of live interest. You can cynically call this "fads in academia", but it is real.
Actively collaborating. Too many junior academics treat others as either immediate-term team members/collaborators, or otherwise as competitors. You need to form a looser circle of collaborative relationships with others who work in your and related fields, where you can spark ideas, not just co-write papers. These then become the people who invite you to give talks, to write chapters for their edited books, refer students to you, etc., and thus your national/international research reputation follows.
Publish and present tactically. Too many of us choose where to submit papers based only on prestige/impact factor (or likelihood of acceptance, hassle factor, and peer review delays...) and attractiveness of the conference location. While these are important, as you mature as an academic, you need to begin to have a portfolio of publications/presentations, which cover top-level research prestige, broader dissemination, outreach to related fields, and (in some fields) public engagement. There are many ways of doing this, but don't just stumble through one paper at a time.
Get grants. Enough said -- though worth mentioning that while the process to apply is often byzantine, random, and can be demoralizing, getting funding liberates your time to be able to do more of the above, and is a good litmus test/forcing device to keep on top of the above -- as enabler -- too. In particular, any time I've reframed my research (item 1 above), it's generally been under the pressure of having to submit a grant proposal!

Second, during recruiting, the posing of this question to you is a bit of a signal and litmus test. It's a signal that we the hiring committee want applicants who will do more than publish x papers per year and fulfill departmental teaching and service requirements. And it's a test not as much of are you there yet -- your CV and letters will indicate that -- but have you started thinking about these issues in a way in line or ahead of your academic cohort.
Therefore, when faced with the question, a good answer would include:
a) A positioning of your research within your field, nationally and globally. Can you articulate how this relates to topics of interest by others? (viz 1)
b) Some evidence of having a research plan for the future. What would you like to do and why? Why is it exciting to other people than just you?
c) Especially if you're too academically young to "have a lab" or equivalent, can you show how networked you are with national and international leaders in your field? Can you show any evidence of developing a followership of juniors (and/or peers)?
And, of course, artfully point to badges of excellence in your research, and of awards/achievements/leading publications you have scored. Not as boasting of your accomplishments, but as demonstrating that you have the platform/runway on which to build -- if you're hired.
Good luck!
Comment: Thanks for the vote of confidence @jingweimo, but a suggestion to *not* mark this as the accepted answer quite yet. I'm sure others can chime in with valuable commentary for all of us and they're more likely to do that if no answer is marked as accepted after <1 day.
Comment: Thanks for your answers. I really learned a lot!
Answer: It depends a bit on your field, of course.
But the general idea is to write a lot of good papers that attract a lot of interest. Produce a lot of good doctoral students. Do a lot of collaboration. Build a large and vibrant circle of such collaborators.
Depending on the field, it might mean attract a lot of grant money to support a lab and/or doctoral students. It might mean presenting at a lot of conferences. It might mean being on a lot of committees (conference, professional organizations, etc.) Contribute enough so that you get invited to contribute.
But the problem is the balkanization of academia. You might be the very top person in some small niche that your maximum circle of collaborators is less than a dozen people. This can be true in math, for example. So, you need to have a somewhat wide set of interests to which you can comment (and attract students, collaborators, money, etc).
Sleeping, not included. Sorry. But you don't have to do it all in one or two years, either.
Comment: @Houska: I actually did think about this, but outside of some very small countries (from an academic standpoint), this still seems to be a strange question to ask unless the search is specifically for someone who is eventually expected to be at least among the top of the university's researchers (i.e. not just one of the many rank-and-file faculty who are good enough to obtain tenure and contribute fairly positively to the department). It's almost as if they're saying "Although you may be better than many of us on the search committee, realize that we're looking for someone MUCH better . . ."
Comment: The OP's question seems a bit strange to me for a hiring committee to ask, as being a national/international research leader seems like the end result of a long climb (highly recognized Ph.D. and postdoc work, exceptional research prior to tenure, even more exceptional research the few years after tenure, etc.) that probably only a small percentage (if any) of the existing faculty have achieved (and anyone actually on track would be a shoo-in for the job), but maybe my interpretation of what "national/international research leader" means is a bit stronger than what the hiring committee means.
Comment: @DaveLRenfro, I notice you're from the U.S., so for better or worse, in many fields in your geography, "national leader"="global leader". In my country (Canada), the bar for "national" is much lower just due to size, and ditto "broader than our own country" in Europe, for instance. I've seen (and used...) similar questions in Canada and Europe as shorthand for "how will you be important outside the 4 walls of this university" where "global leader" would of course be ideal, but is not presumed as the goal.
Comment: @DaveLRenfro, I interpret the question as a round-a-bout way to get some sense of the candidates general sense about academia and the responsibilities of academics. It is a question, I think, about attitude.


pH for optimal kinetic for enzyme reaction

Question: If I am given the following enzyme reaction:

where K$_{EH,1}$=K$_1$ = $10^{-4}$ and K$_{EH,2}$=K$_2$ = $10^{-8.2}$. Iwant to calculate at which pH I have the optimal kinetics by calculating $\frac{v'_{max}}{v_{max}}$ at different pH levels (this is done in Matlab with the code pH=0:0.1:14; K1=10^-4; K2=10^-8.2; v=1./(1+K2./10.^-pH+10.^-pH./K1); [m,n]=max(v); pH(n))
But if the rate equation is:
$v= \frac{k_2 [E]_0 [S]}{K_M(1+ [H+]/K_1 + K_2/[H+])  + [S]}$   (1)
Then how do you get v'$_{max}$?
From a similar problem, the rate equation was:
$v= \frac{k_2 [E]_0 [S]}{[S](1+ [H+]/K_1 + K_2/[H+])  + K_M}$ (2)
So then knowing that v$_{max}$ = $k_2 [E]_0$ when [S]>>K$_M$, you get from eq. (2) that v'$_{max}$ is:
$v'_{max}= \frac{v_{max}}{1+ K_2/[H+] + [H+]/K_1}$
However in my case, by doing this to eq. (1) then I will only be left with $v= k_2[E]_0$ which I can't use in the same way as is done for eq. (2).
Is there another way to calculate the pH or how should I get v'$_{max}$? All help is appreciated!
Answer: I don't think the rate equation is

$v= \frac{k_2 [E]_0 [S]}{K_M(1+ [H+]/K_1 + K_2/[H+])  + [S]}$

I suspect it is rather:
$$v= \frac{k_2 [E]_0 [S]}{(K_M  + [S]) (1+ [\ce{H+}]/K_1 + K_2/[\ce{H+}])}$$
The term $(1+ [\ce{H+}]/K_1 + K_2/[\ce{H+}])^{-1}$ describes the fraction of the enzyme in the productive protonation state.
You don't have to plot this to figure out the optimal pH. The optimal pH is always at the midpoint between the two $\mathrm{p}K_\mathrm{a}$ values. That is because that is the pH value with the highest fraction of the once-protonated enzyme.


Disable/Enable widget in Magento 2 admin

Question: I need to enable and disable a widget from time to time in admin. I don't see a disable/enable switch please advise how it can be done.
Answer: Yes,Magento does not have feature for disabled/enabled for  Widget module.
So, the only solution is that delete those widgets which you have created if want to disable those widget.
Comment: Thanks for the tip. I guess I'm gonna have to settle for that :(
Answer: I had the same requirement. I achieved it by deleting the layout updates selections.

If the widget is not being instructed to show up anywhere then, even though you have it in Admin Panel, it wont show up in your site.
Comment: I think that it is better deleting widget for performance issues.


Lost hidden images

Question: I used an app to hide certain images on my phone and I transferred the image folders from the phone to an SD card. Now it's not showing and the folders are empty :( how can I restore them?
Answer: Apps I've seen usually hide the images by changing their format and saving them in hidden folders at some random locations.

You can check the default saving location used by the app in the preferences. Explore the location from a file explorer and backup the file.
Uninstall the app and reinstall it.
copy the backed up files into the default location again.
try unhiding the files again from the app

Lost hidden images


How to start a workflow from events within a custom webpart

Question: I would like to add workflow to my webpart. Whenever items added or removed from webparts my workflow needs to be started. I am not sure what my web part will have - it can have any items like list, asp.net controls, etc. Is this possible?
Comment: Your question doesn't make sense - web parts don't 'have' lists and asp.net controls don't have workflow. Are you talking about putting a workflow on a list?
Comment: My scenario is whenever particular user edits or create any item inside web part i need to call a workflow and that workflow should decide whether particular user has permission to create or edit..am i clear..
Comment: Clear? Not really. Is the web part a custom web part or the built in ones? What is it creating - is it items in a SharePoint list or something else?
Comment: Custom web part with any type of content..
Answer: if it is a webpart you have built you can manualy start and stop the workflow
here is a snippet
<code>   public void StartWorkflow(SPWorkflowManager manager,string eventData,SPListItem listItem,SPWorkflowAssociation workflow)
   {
       SPWorkflowCollection workflows = manager.GetItemActiveWorkflows(listItem);
       if (workflows.Count > 0)
       {
           return;
       }
       manager.StartWorkflow(listItem, workflow, string.Empty, true);
   }
</code>
WorkFlow Manager Refrence
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.workflow.spworkflowmanager_members.aspx
EDIT:
You will have to create the method that fires the workflow i usualy use an eventreciver of some sort. but as your question is very general i cannot give you a solution for that. but if for example you are displaying a list via a webpart. attatch an event reciver to the list and it will be kicked of if you edit it in the workflow
Comment: the issue is that your question is very general. but for every type of webpart you would have to code a different even reciver
Comment: my web part can have any type of content..also if my web part has more than one content then i have to write event receiver for each content..
Comment: ok then i have to use event receiver for every content that i use in my web part and from there i have to start my workflow..
Comment: no, its not realy about  the type of content its more about. how the content gets manipulated is it a list is their a form with a submit button etc. because depending on that you will either attach a event reciver or create a custom function. because if you look at the event reciver specs it can only attach to certin events
Comment: You shouldn't pass an empty string for the eventData parameter. You should pass an empty XML tag instead, like ``.


Use regulator when input voltage is above threshold other wise use direct input voltage

Question: I don't have much practical knowledge of electronics. I am trying to operate esp12e with single Li-ion battery with charging circuit. I am planning to use a good LDO regulator because Li-ion battery voltage can get high upto 4.2 volts while we need 3.2-3.6 Volt for esp.
My problem is when the battery voltage is dropped below the certain level (near 3.4 volts), the regulator will not be able to further drop the voltage and stop.At this point,I want to use the battery directly, without the regulator.
How can I achieve it? Please help.
Comment: LDO's don't just "stop" when the input voltage is too low. They continue to work, but drop a constant voltage. So with 3.1V input it will output around 3.0V (depending on the LDO used).
Comment: The term "low" started with Bipolar transistor LDO's in 70's, which can have more Vin-out drop than modern MOSFET LDO's.  Sort supplier lists for these with < 0,1V
Answer: You can do even better if you get a buck-boost regulator like the one below: -

Basically it produces 3.3 volts from an input voltage of 2.5 volts to 4.2 volts.
Note - irrespective of the regulator technique you still must use a Li-ion battery protection circuit to prevent over discharge of the cell.
Answer: Modern CMOS LDO regulators will more-or-less do what you describe. They need a certain voltage to start conducting, for voltages between that and a bit above the output regulated voltage they will pass the input voltage minus a (typically small) voltage drop.
For example, the Rohm BH33MA3WHFV-TR
in the BHxxMA3 series.

As you can see, above about 1.5V typically you get essentially the input voltage at the output until regulation kicks in (at 3V in this example plot).
The 1.5V is a typical figure however it's well below the minimum voltage you should allow the battery to discharge to (maybe 2.8 to 3.0V) in order to prevent permanent damage to the battery.
Avoid older bipolar designs- as well as some having high dropout voltage, some of them use low hFE lateral PNP pass transistors which means the regulator internal current draw increases drastically near drop-out.


Is it Ok to add heat sink on top of an RF chip?

Question: The chip that I want to attach a heat sink is a WiFi chip Ralink RT3070 and its separate RF amp chip YP243433 both have 85C Tjunc. The amp chip barely gets hot. The main chip gets hot but still can be touched (maybe 50-55C). Will the RF performance affected by heat sink? There's no RF can/lid/shield on both chip.
Comment: If you can leave your finger on it, what makes you think the heat is affecting performance or safety enough to warrant a heatsink? And I'm going to say yes you can place a heatsink without affecting rf performance.
Comment: @Passerby I'm using a higher TX power more than its default 20dBm, currently at 33dBm
Answer: The 60-page data sheet is available for download. See the link "Download PDF File" near the bottom of this web page: http://www.datasheet4u.com/datasheet/R/T/3/RT3070_Ralink.pdf.html
Interesting, on page 7 of the data file: while it mentions nothing about the use of a heatsink, it does clarify that the AMBIENT temperature in which the chip should be used is 85 degrees C.  However it states that the maximum case temperature for operation is 125 degrees C.  You could instantly burn your finger by touching it and it could still be working within thermal spec.  I know this doesn't answer your question, but perhaps it does, albeit obliquely.
Another interesting part of the data sheet, still page 7, says you must bake the chip if you unwrap it from its package and then do not install it within 168 hours.  The baking regime is 8 hours at 125 degrees C.
All this is highly suggestive that one does not need a heat sink for this obviously thermally rugged chip.
I did retire before I got into this general level of chip, but having learned over years of personal experience in reading - and trusting - data sheets, I would suggest using this chip without a heatsink if indeed you have found that you can rest your finger on it in use without burning your finger.
I hope this helps although I am aware I still have not directly answered your question.
Comment: Well yes, it is known that suppliers/designers of circuit boards have a range of copper thicknesses coated to the board to choose from at the concept/design stage.  It goes without saying that any chip which is desired to give a little heatsinking to via its leadout pins, will have a board provided with sufficient copper thickness to do its part to help dissipate internal heat carried out through each pin.  No, it's not much of a heatsink, I agree.  Yes, it's done because it is way better than not considering heat at all at the board design stage, so why wouldn't anyone do it?
Comment: Well, the board is fairly thick maybe that'll dissipate some heat + this module is inside an panel type antenna that can be installed on roofs. Anyway thanks, I got only basic understanding on datasheet values. Cheers
Comment: Standard CU foil thickness provides 70 degree Centigrade thermal resistance for heat flow, per square of copper. In a 3*3 grid, the heat injected into the middle square, the surrounding 8 squares provide 70/8 = 9 degree Centigrade thermal resistance. The next surrounding grid, of sise 3X bigger squares, adds another 9 degree thermal Resistance. Is 18 degree thermal resistance too large? Use thicker copper, use multiple planes, use the chassis of the system/


node.js spawnSync last line of stdin not taken

Question: Run this in the shell.
node -e "console.log(require('child_process').spawnSync('column', ['-t','-s',','], {input: 'a,b\nc,d', encoding:'utf8'}).stdout)"

I see different behavior on different environments.

6.5.0: prints one line (just a  b\n)
4.2.6: prints two lines (a  b\nc  d\n)

I do see that on the environments exhibiting unexpected behavior where the last line is dropped, appending a newline to the provided input to spawnSync will address the problem. As such, in the future when doing things like this I will be ensuring the input terminates with a newline to stay on the safe side.
However, I am not so sure if I'm being opinionated by expecting node to not simply lose my last line of output if I havent added a newline to flush the stream (which is what I am expecting this issue to be rooted in). So this seems like a bug.
I tried running the different versions of node provided on runkit.com, but they ALL somehow return the unexpected one line output (except for 0.10.x, which is missing the spawnSync API altogether). Now I'm scratching my head.
Answer: The problem with this was found to be the behavior of column.
It requires you to provide a newline with the last line.


How do we refine a big User Story in Jira?

Question: Let's suppose a Product Owner added a big User Story to Product Backlog in Jira. This User Story can't be done during a Sprint or even during several Sprints. How do we refine such a User Story in Jira? Do we delete it and create several smaller User Stories instead of this big one?
Answer: Although Product Backlog Refinement is the method by which the team ensures that the Product Backlog Item can be completed within one Sprint and has all of the necessary attributes (such as description, order, size, and/or value). However, since Scrum doesn't mandate the use of any particular tool, it doesn't tell you how to go about using any tool.
Jira gives you a few options.
First, you can make that big story an Epic. By doing so, you can get some visibility into the issues that are children of that Epic, including Stories. You can also use the roadmapping features that are now built into Jira or the planning features (formerly Jira Portfolio) if you have the Premium edition. However, Jira defines an Epic as a container for other work. This isn't the more traditional definition of an Epic, a User Story that has not yet been decomposed.
Another option would be to make more User Stories. Begin to split out work into new issues of the appropriate types. You can optionally link the issues with the right relationships. In fact, Jira even has link types for "is included by", "includes", "split from", and "split to" for this type of work. In the end, you may end up closing (or deleting) that too big Story or you may end up editing it to be a smaller piece of the work.
A third option would be to leave that User Story and use subtasks to represent the work that fits into a Sprint. In this model, the User Story may not be done in a single Sprint. However, you'll understand when all of the work is done by seeing all of the subtasks' status.
There are probably other options, too. Jira is highly customizable and configurable, and even more so if you have different plugins. There needs to be some level of melding between your process and the Jira configuration.
Answer: Consider having a meeting, called Backlog Refinement, that you run before Sprint Planning. Both a developer and the Product Owner must attend.
During the Refinement meeting, you go over the Stories and do a sanity test, ensuring they fit the INVEST method.
If you don't want to have a Refinement meeting, this can be done during Sprint Planning as well. However, make sure that both the Product Owner and developer(s) are involved.
Answer: If there is a need to provide one huge story in one sprint, there is only option to either fit it in one sprint, or to call it a Feature and then decompose it to smaller business stories, then to tasks.
Anyway, if 'one business story' in its entirety cannot be fully designed, developed and delivered in one sprint - it cannot be tested correctly, because it has to be verifiable and testable. The result of the sprint should bring a business value - a part of a business story does not bring a business value.


SharePoint Online AD Security Group Based Navigation Bar

Question: I am trying to have group-based navigation in my SharePoint Online intranet. This is because I want only specific links to be in the dropdown of some menus to be visible to certain AD Security groups because of confidentiality.
I have read online about security trimming or client-side scripting, but in my site settings I am missing numerous options people mention in their guides but are not present.
In essense, I am curious in SharePoint Online how I can "censor" certain links in the main navigation bar based upon a users AD Security Group. Thanks
]1
Answer: This feature isn't yet available in modern. See Feature ID 34251. Obviously the date is a bit off :-(
More information at Target navigation, news, and files to specific audiences.


How to measure distance between two moving objects?

Question: I wanted to ask if anyone knows a way to measure the distance between two moving objects (actually one is fixed and one moving)?
Can I place on one of them a transmitter and on the second one a receptor and know in real time the distance between the two? The range I'm looking in is about 0 - 0.5 meters and resolution of about 0.5 cm.
Can anyone recommend on a way of doing it?
Comment: How fast will the moving object be going?
Answer: Sound is a relatively easy phenomena to use to measure distances because it is quite slow.
There are many answers which you could find on this site, e.g Why sound wave is the best choice for many location detectors?
This explains some  of the issues around using electromagnetic radiation High precision trilateration in a small space and without ultrasound


What is the best strategy on playing Defensive Roman on Travian 4?

Question: there are many options to play on Travian, I like defensive, I believe defensive strategy cost less and is more effective in End Game Era, but I wonder how is the step by step manual?
Comment: IS your question about Travian, or Travian 4?
Comment: I tried that my question show what I mean
Comment: What exactly are you trying to ask? Can you please be a bit more specific? No one is going to write a step by step manual here on how to play from the first day till the end game.
Answer:
Sim fields/make enough praetorians/level wall to dissuade attack.
Sim more fields and make more praetorians.  Continue building new villages and making praetorians until the game ends.
Comment: I made account just to comment on your answer, which is entirely WRONG. You do need a large number of troops, but you need troops with 20 lv armory and 20 lv arena, since Praetorians are so slow. So 6-8 defensive villages around your capital or next to the capital of the attackers in the alliance is highly more efficient since you want to keep your troops production 24/7 in all of them and you reach your crop limit pretty fast anyway.
Answer: It depends of really many factors. Every tribe have good things and weaknesses.
If you choose Guals:

At the beginning traps. (no one will attack Gual because of that)
After that Phalanx and Druidrider.

Since you can train defence in all villages, just making new villages and train defence.
After some time, and you have good number of defence, you can start upgrading your troops. Troops defence will be upgraded no meter when they was trained, so after some time you will be an advantage because you have higher number of updated troops.


Current limiter of negative/positive pulse

Question: I have pulse with both negative and positive sides, say -4v to +4v. I want to limit the current for both sides to 1mA. I know how to limit the current of a 0 to 5v pulse using two transistors but I am not sure how to apply it to a -4- to 4v pulse. Any suggestion?
Comment: Resistance limits current according to ohms law.
Answer: Generic answer for the question- if your unipolar regulator circuit blocks reverse voltage, then put two complementary circuits in parallel. If it conducts in reverse then put two complementary circuits in series or two unipolar in series back-to-back.
For example, if you were to use current regulator diodes (which are basically a JFET and resistor) they conduct in the reverse direction so you could do this:

CLDs are fairly rare and relatively expensive these days, so it probably wouldn't be your preferred solution- just an example since you have a circuit in mind.
Comment: another option in a similar vein is put a unidirectional current limit circuit inside a bridge rectifier,
Comment: @Jasen Good one. Schottky diodes could be used to reduce the drop. One advantage of Jasen's approach is that it will be very symmetrical.
Comment: Thanks guys. I think this bridge thing can work for me. I am going to try it.


How can I retrieve the e-mails from my shared folders in Dropbox?

Question: I am using Dropbox to share lots of documents with my clients as I meet with them.  It's also a great way to grab their email address. So I have been doing this for about a month now and wanted to circle back with the clients in which I have shared documents. But, I can't find their email addresses on my Dropbox app for iPad. Are they on my mail server or are they on the Dropbox app?
Answer: Without using any kind of API, from where you'll probably able to get the e-mail of your shared folders, you can check the e-mail from the web interface.
Since there is no such thing as contact list here, you can do the following:

Login to Dropbox.com
Go to Sharing tab
Enter any folder and click on Shared folder options button
Once you're there click on the Members tab
Finally by clicking on the names there you can send them e-mail, and it's using your native client :)

Another way of checking your "list of shared e-mails" is to create a folder, again from the WebUI, then click on the Share a folder and when you start typing the autosuggestion kicks in. I don't know how many mails do you have, but you can test all the letters (they are not too many) and it really depends on how important this is for you, to go through all that hassle.
Comment: +1 This is the only way I could think of without using an API (kudos on mentioning the API as well).


Cannot access a disposed object

Question: Hi could you help me with this error?
Cannot access a disposed object.
Object name: 'DataContext accessed after Dispose.'.
in my GUI
 private void InitializePage()
    {
        cbCategory.DataSource = stock.StockCategory.Get();

    }

in Datamodel
 public IEnumerable<StockCategory> Get()
    {
        using (leDataContext db = new leDataContext())
        {
            try
            {
                var r = from s in db.StockCategories
                        select s;
                return r;
            }
            catch (Exception ex)
            {
                Logger.Error(typeof(StockCategory), ex.ToString());
                throw;
            }

        }

    }

Comment: it works if i (from s in db.StockCategories select s).Tolist(). But putting a Tolist() there but return as ienumerable() is it correct?
Comment: Can one access a disposed object once it's disposed?
Comment: This post is terrible. Pieces of code are missing, you didn't describe what you want to accomplish, so how are we suppose to help you? Please, correct those issues and then we will be able to give you some advice.
Comment: This code is a little strange... you haven't wrapped up the top method 'Get()' properly for a start...
Answer: You're disposing the DataContext but returning something that still depends on it.
Options:

Don't dispose the DataContext. I know this sounds weird, but guidance from the LINQ to SQL team (well, Matt Warren) has indicated that in most cases (i.e. if you're not doing anything out of the ordinary) disposal is not required
Call ToList() inside the Get() method's using block.

Note that using a query expression with just a degenerate query is reasonably pointless. (If this is within your own code, even the implicit Select(s => s) won't actually be useful.)
I would suggest changing your method to:
public IList<StockCategory> GetAllStockCategories()
{
    using (leDataContext db = new leDataContext())
    {
        return db.StockCategories.ToList();
    }
}

Comment: @D3v: I suggest you ask a new question with all the relevant details. (In particular, do any of the list entries contain other entities which might be lazily serialized? Have you experimented with not disposing the DataContext?)
Comment: I call to list() but it doesn't work. Though the list is not null when it is returned when I try to serialize it I still get the error. I want to understand why.
Answer: Because of lazy-loading there, the query isn't really executed on the linq statement line. It is executed when you loop over it, or in this case - when you run ToList on it.
When it is executed it must be inside the data context... which is not the case here. You can either return a List from the Get method or insert the setting of the cbCategory.DataSource value into the using (leDataContext...) scope.

Cannot access a disposed object