Geometry Nodes Align to Curve/Face Problem

Question: I am having a real problem figuring out how to fix this. I have instanced an object along a curve and applied the rotation of each point, but the corners average the angle of the segment before and after. I need these objects to aim directly at the next point in the curve so there are right angles and connected rather than these 45˚ oriented objects with open gaps, but I cannot figure out how to get that data into the geometry nodes. This same problem occurs if I use a mesh, so that's not a solution. I essentially need the normal of each segment along the curve, not the point's, which averages the normal from both adjacent segments.
Comment: would you mind sharing your blend file using https://pasteall.org/blend/ ?
Comment: One way would be to duplicate the path and feed it through the Curve Trim node, then adjusting the Fac to be between 0.001 and 0.999 so that the instance does not reach the end of the curve. Let me know if this works for you.
Comment: Perhaps the answere here: https://blender.stackexchange.com/questions/245282/how-to-bend-geometry-with-geometry-nodes Can help?
Comment: If your question was solved, please be so kind and mark the answer that contributed to the solution as "Accepted Answer". This will make it easier for others to see which way leads to the solution, and the question will no longer appear as unsolved. Thank you! Here you can find more information: [What should I do when someone answers my question?](https://blender.stackexchange.com/help/someone-answers). If you still didn't get a solution to your question, please be kind enough to address it.
Answer: First, I would put the pivot point of the wall panel on the Y-axis at its center so you don't have to instantiate it at the endpoints.
Then I would simply subdivide the curve once with the node Subdivide Curve.
If you then use Instance on Points, but only instantiate at every second point by applying the math node Modulo, you can directly use the normals of the points.
The node Align Euler to Vector makes a suitable rotation out of it.


Stop spacebar triggering quicklook when using Quicksilver

Question: If I invoke Quicksilver and type "activity", and then press spacebar in order to finish typing "activity monitor", instead of a space being included in my search string, it invokes quicklook on whatever the current target is.  Quicklook also steals focus, so no further keystrokes arrive at Quicksilver.  Is there any way to prevent this?  I don't seen anything in the preferences.
Answer: The default spacebar behavior was changed from "Normal" to "Smart" a couple of years ago. Users that had chosen a setting explicitly were unaffected, but if you had never picked anything, the new default took over.
You can change it back by going to Preferences → General → Command and looking at the Spacebar behavior setting.
Having said that… You should never need to type a space when searching and you should never need to type that many characters. The main feature of Quicksilver is that it lets you find things with an abbreviation that makes sense to you, and doesn't require typing full names of things.
To find Activity Monitor, a m should be enough.
I encourage you to try the Smart behavior. It's quite a time saver. This is what it will do:

If the object has children, show them (unless it's a text file)
Jump to the third pane if the current action requires it
Quick Look if the object supports it
If user is holding Shift, go to the parent (same as left arrow)
Switch to text mode
If in the second pane, select the first action that takes an argument in the third pane
Comment: Fantastic, thank you.  Don't know how I missed that preference (I did look, honest!).  Yeah, I know space isn't usually necessary, but I recently switched back to QS from searchlight, so I'm automatically more verbose than I need to be.  I'll get used to it again I'm sure, but the focus-stealing part of quicklook was really flow-breaking.  I'll leave it Smart to try and retrain myself.


E string won't play C

Question: I have a cheap violin I got a decade back and so far it has been holding on and playing well enough but for some reason now it won't let me play a C on the E string. I can play a B and a D but the in between it plays something close to a C sharp and I can slide my finger in between this 1" wide space with no change in tone it's the strangest thing. Should I get a new E string or is it something to do with the violin itself. All suggestions welcome
Comment: Can you post a video or audio recording of the problem?
Comment: Are there any other notes on that string that sound unusual?  What happens when you play a glissando?  Try both up and down glisses.  Do you hear any differences of pitch between very soft notes and very loud notes?  What happens if you play the same line, but shifted down by one string?  Is your soundpost still standing?  (Look in the f holes, maybe with a flashlight.)
Answer: Without seeing or hearing your instrument I would say the three most likely culprits to this issue are:

There may be a small foreign object stuck on the fingerboard which is acting like a fret right at your "close to a C#" note. It could be a small piece of rosin or anything that might stick to the fingerboard and get between it and the string.

There may be some uneven wear on your fingerboard causing a high spot close to your C# note which is also acting like a fret.

Another possible issue @Tim pointed out is the string itself might be damaged or deformed. See if there is a bulge or uneven winding in that area.

Examine your fingerboard and string in the problem are very carefully under good lighting. High and low spots on a fingerboard are usually easier to see if you sight down from the nut. If it's a foreign object knocking it off should do the trick. Try another string if yours looks off. If it's the fingerboard you might have to get a luthier to dress the fingerboard, which is planing and/or sanding it down so it's smooth again. Good luck!
Comment: Or something on the underside of the string itself.
Comment: I was going to say E is a plain string (it is on mine!) but wound and gut are also used. Could be a kink in a plain, damagaged windings in a wound, or who-knows-what in a gut.
Comment: @Tim Good point, I added a possible faulty string to my answer, thanks.
Comment: @Tim I can't speak for violin but from personal experience I've never had a deformity or kink in a string cause that drastic an effect in pitch on either fretless electric or upright bass. Violin tolerances are much smaller though. Who knows what in a gut indeed! :)
Comment: I've had it once, when a guitar fell against a chair or suchlike. It hit the strings on the fretboard, and produced a lovely kink in a string at that spot. Violins don't usually fall over like that though...

E string won’t play C


$\Phi: Hom_R(A,B) \to Hom_R(A,R)\otimes_R B$

Question: Let $R$ be a commutative ring and $A$ and $B$ two $R$-module. Suppose that $A$ is free of rank $n$ with basis $a_1,\dots,a_n$. Then there is an isomorphism $\Phi: Hom_R(A,B) \to Hom_R(A,R)\otimes_R B$ defined by $\Phi(\sigma)=\sum_{i=1}^n \psi_i\otimes \sigma_i$, where $\sigma_i=\sigma(a_i)$ and $\psi_i$ is the map such that $\psi_i(a_j)=\delta_{ij}$. Is there another way to describe $\Phi$?
Answer: By definition of freeness, $Hom_R(A,X)$ is naturally (with respect to $X$) isomorphic to the direct product of $n$ copies of $X$.  Apply this in both the domain and codomain of $\Phi$, and use the fact that $-\otimes B$ distributes over finite products (because they're the same as finite sums in abelian categories).  Is that "another" description?  The content is the same but the viewpoint seems a bit different.
Comment: What about "the inverse of the map $\nu\otimes b\mapsto \left(a\mapsto \nu\left(a\right)b\right)$ ? Because I don't think there is anything more explicit. If there was, it would work for any module, not necessarily free...
Comment: When I said another way, what I had in mind was something like the inverse map, i.e. not involving explicitely $a_1,\dots,a_n$. In fact $\Phi^{-1}(\nu\otimes b)=(a\mapsto \nu(a)b)$. Instead, if I'm not wrong, identifying $Hom(A,X)$ with $X^n$ require the basis of $A$.
Comment: I agree with darij. If the inverse of a naturally defined map doesn't always exist, there's no reason to expect that it has a more natural definition than "the inverse, when it exists."
Comment: I agree too. That what I was thinking but I was hoping to be wrong.Thank you.
Comment: At least the result also holds if $A$ is a finitely generated projective $R$-module.
Comment: The map $Hom_R(A,R)\otimes_R B\to Hom_R(A,B)$ given on elementary tensors by $\nu\otimes b\mapsto (a\mapsto \nu(a)b)$ always exists.  Do you want to know when it is an iso?  I believe that it is basically when $A$ is finitely generated as Ralph says.
Answer: As Benjamin Steinberg says in his comment, the inverse map always exists and moreover it is natural in $A$ and $B$,
$\Psi\colon Hom_R(A,R)\otimes_RB\longrightarrow Hom_R(A,B)$
but it's only an isomorphism for f.g. projective $A$. A definition of $\Psi$ in terms of functors and adjunctions is as follows. By the adjointness between $-\otimes_RB$ and $Hom_R(B,-)$, the natural homomorphism $\Psi$ is the same as a natural morphism
$\Psi'\colon Hom_R(A,R)\longrightarrow Hom_R(B,Hom_R(A,B))\cong Hom_R(B\otimes_RA,B)$
This $\Psi'$ is the same as
$Hom_R(A,R)\mathop{\longrightarrow}\limits^{{B\otimes_R-}} Hom_R(B\otimes_RA,B\otimes_RR)\cong Hom_R(B\otimes_RA,B)$
Answer: Such an isomorphism is worthless if it is written down with a choice of a basis, because then naturality is unclear (which is, of course, very important if you need this isomorphism not just as an isolated relation). There is a homomorphism of $R$-modules
$\alpha : A^* \otimes B \to \hom(A,B)$
defined by $\phi \otimes b \mapsto \phi(-)b$, which is natural in $A$ and in $B$, which are arbitrary $R$-modules. It is a natural question when this is an isomorphism for all $B$, when we fix $A$. Note that the inverse will be, restricted to these $A,B$, also natural due to general reasons, although perhaps we need to make choices to write down the inverse (without making reference to $\alpha$)! Also remember the slogan "You can work locally, if you are given something globally".
Now both $(-)^* \otimes B$ and $\hom(-,B)$ are functors which transform finite direct sums into finite products, and transform split cokernels into split kernels. In particular, the set of $A$s for $\alpha$ is an isomorphism is closed under these operations and since $R$ is an example, we see that every finitely generatd projective $R$-module is an example. Now, the converse is also true: If $A^* \otimes - \cong \hom(A,-)$, then the right hand side is preserving all colimits (since this is true for the left hand side). Restricting to coequalizers shows that $A$ is projective, and restricting to filtered colimits shows that $A$ is finitely presented (in the categorical sense, thus also in the algebraic sense).
You can view this also as a special case of the Theorem of Eilenberg-Watts: If $A$ is finitely generated projective, then $\hom(A,-) : \text{Mod}(R) \to \text{Mod}(R)$ is a cocontinuous functor, thus is given by tensoring with a $R$-module, namely $\hom(A,R) = A^*$.
Comment: I don't think that "naturality is unclear", if the iso "is written down with a choice of a basis". Given $A,A'$ with bases $\lbrace a_i \rbrace, \lbrace a'_j\rbrace$ and a hom  $\alpha: A \to A'$ of $R$-modules, then by writing $\alpha(a_i) = \sum_j r_{ij}a'_j$ it's a direct  computation to show that $\phi \circ \alpha^{\ast} = (\alpha^{\ast} \otimes \operatorname{id}_B) \circ \phi'$ (where $\phi$ is taken from the OP). Similarly nat. in $B$ can be shown. In the general case of $A$ being f.g. projective just replace the bases through projective bases.
Comment: I know that you can do a computation, but you cannot *see* naturality without this computation when you write the inverse map as above. Thus it is somewhat unclear.
Comment: I agree in this point of view. Thanks for your explication.


Do +1/+1 counters count for Fighting?

Question: I have a 3/2 with six +1/+1 counters on it, making it a 9/8. My friend used Prey Upon targeting it with his own 5/5. He said the +1/+1 counters didn't count while fighting, and that it was just considered a 3/2. Is that true?
Comment: @ikegami Check your math.
Comment: It's a 9/8, period. It's not "considered" anything else.
Answer: No, your friend is wrong. The creatures simply deal damage equal to their power:

701.11a A spell or ability may instruct a creature to fight another creature or it may instruct two creatures to fight each other. Each of those creatures deals damage equal to its power to the other creature.

A 9/8 has a power of 9, and it doesn't matter what its base power was. The whole point of power/toughness-changing effects (like +1/+1 counters) is that they change the power/toughness of the creature.
So your friend's 5/5 will die, and your 9/8 will survive.

Terminology: we say your creature has base power/toughness of 3/2, but its power/toughness is 9/8. Pretty much nothing in the game cares what base power/toughness is; the only time it's mentioned is when it's being set, like on Turn to Frog. Everything normal in the game just looks at the actual power/toughness.
Comment: It might be helpful to point out that the 3/2 is the 'base power and toughness' and things only care about that when they specifically say so (the only times I can think of is when it is getting set)
Answer: Your friend may have been confused because certain abilities that modify or care about combat damage do not apply to two creatures "fighting" because it is not considered combat damage as defined by the rules. For example, first strike and double strike don't "count" when creatures fight because those abilities modify the combat step. They deal damage at a different time during the combat step. If they fight via Prey Upon, they do not go through all the Combat steps, and there isn't a separate first strike combat damage step for those abilities to apply.
Comment: This is more of an assumption than an answer to the OP. It would be nice if the downvoters could give you constructive criticism on how this answer does not fit the question. From what I can read you mention the combat phase but the OP doesn't. This does not provide a definitive answer. Just thought I'd give you a heads up on why I think you have been downvoted here.

Do +1/+1 counters count for Fighting?


Why aren't we immune to the "cold"

Question: As far as I know, people suffer from the cold since ever. Why didn't and don't we evolve to resist it?
Comment: Not since ever, only since about 70 years is it considered normal to suffer from the cold a few or more times per year. This is because we spend so much of our times indoors in rooms with central heating and air conditioning where the signal from the newly emerging cold viruses  is drowned out by the microbes that live in the artificial tropical indoor climate. The first exposure to the cold virus is then when someone sneezes in your face; the cold can spread as wildfire with all these people with poor immunity against it.
Answer: The main reason is that there really isn't any one "cold," but rather the word is used to describe many different infections that simply have the same symptoms. The reason for these same symptoms is that almost all of the symptoms that one experiences in a cold are actually the immune response to said infection. For instance, a fever is used to make the body less hospitable for the infection causing agent and throwing up is used to ensure that harmful substances are removed from the digestive system before they can cause too much harm.
The reason that the body can't simply evolve resistance to all of these possible infections is both because the infections evolve too and because there are simply too many of them that all need a separate method to be defeated. Therefore, curing the common cold is effectivley curing the majority of known ailments.

Why aren't we immune to the "cold"


Equivalent functors

Question: Let $R$ be a commutative Noetherian ring, $M$ is a finitely generated $R$-module. If $F: Mod \to Mod$ is a left exact functor and $R^iF(E)=0$ where $E$ is injective module. Assume that $F(-) \cong Hom(M,-)$, can we infer the $i-th$ right devired functors $R^iF(-)\cong Ext^i(M,-)$?
Comment: You can define $Ext$ by taking derived functors of $Hom$ in either
variable. If you are using the second variable, it's tautologically true (see Andreas Blass' answer). So I suspect you might be
defining it via a projective  resolution of $M$ (or via Yoneda or...) Then there is something to prove, but this can be
found in many homological algebra texts. I'm sure someone can elaborate, but it would be good to clarify this.
Answer: Yes.  For example, if you compute right derived functors by injective resolutions, then naturality of the isomorphism between $F$ and $\text{Hom}(M,-)$ will ensure that you have an isomorphism between the two complexes whose cohomology groups give you the two derived functors.

Equivalent functors


Should I keep the expansion tank when replacing copper with pex?

Question: I plan on replacing all the copper in my house with a pex system. the hot and cold pex manifolds seem much more user friendly. the copper in my house seems crazy, spliced and diced running all around.
I am wondering if I can delete the expansion tank, I am thinking that pex tubing expands as it is. if not, should the tank be before the manifold?
Thanks
Comment: Can you add your location to the question? This may be a code issue. I think generally if you have a backflow prevention device, you should keep the expansion tank. Why risk damaging your pipes? You already own it, so it won't be a big deal to keep it.
Comment: I agree with Philipp you have it keep it in the system. The more stress on plumbing the faster it will fail at some point and Murphy's law says it will fail at the worst possible time.
Comment: Are you on a well system?
Answer: An expansion tank is only required when the water supply system has a backflow prevention device or check valve. The extra pressure caused by thermal expansion was apparently an issue in the home. I would strongly suggest that you include it in your new set up. Don't rely on the pex to expand and relieve the pressure. That could cause a pipe to rupture or a fitting to leak. Expansion tanks are typically installed in a "tee" at the cold water inlet for the water heater.
Answer: I would just leave the copper there if it is not giving you too many problems. I wouldn't say that pex is so much better than copper that making the switch is worth the time or expense even as a DIY. Steel or iron supply or drain lines are a different story but if they are functional I leave them alone too.


Why does the rotating agitator on an hours-old Kenmore canister vacuum only work when vac is in upright position. opposite of expected function?

Question: This is a brand spankin' new Kenmore 81214 200 canister vacuum (July 2021)
Since the agitator spins when the handle is in the upright position, the belt must be working.
Tried changing all the settings (bare floor to carpet a few times...the carpet position is required for activating the agitator)
(and tried all the carpet height settings: hi, med, low)
Removed the wand from the power head and then put it back on to make sure everything clicked into place.
Gently jiggled the wire harness at all connections between handle and power head.
Agitator turns freely,and is not bound by hair (vacuum is literally only a few hours old)
Pushed the Reset button (because it was there)
The problem is slightly intermittent in that sometimes the agitator will spin for a second or two when the handle is down.
I thought maybe the carpet was providing too much drag so I held the power head up off the floor with a toe while the handle was in the released position, that did not help.
The vacuum had worked perfectly for me for an hour, switching between carpet vacuuming and using only the wand for cleaning curtains, ceiling fans etc...but then Hubby wanted to take it out for a spin and within ten minutes it failed.  It happened after he had removed the power head to clean the edge with the crevice tool and then when he put the wand back into the power head, the agitator would no longer function correctly.  I had been using it in all the same ways.  We thought maybe it was just hot and needed to rest but a two-hour rest didn't help either.
It's almost as if the mechanism that tells the agitator what position the handle is in has reversed itself (it's as if the machine thinks the handle is up when it's down and it thinks the handle is down when it's up) but I can't imagine how that is possible so I'm totally baffled.
Comment: why are you not talking to Kenmore support? ... appliance usage questions are off topic here
Comment: If not working right, just return it.  You paid for a working vacuum.
Comment: jsotola, If my question is in the incorrect topic location perhaps a moderator will relocate it to your satisfaction. Being new, I followed the instructions afforded by the site algorithm and trusted that it was prompting me to do the right thing.  I tried to talk with Kenmore support but it was a holiday weekend so no joy.  I had hoped someone in the vast land of the internet might have some constructive ideas that could save me from repackaging and shipping (amazon purchase)...I was apparently wrong about that too.
Comment: cript659, since nobody has any other troubleshooting tips, returning it is my only alternative.  Thanks.
Answer: So many reasons, so little time but my guess is a limit switch that's not securely in place or a faulty, bad connection. This is something you shouldn't mess with or you might void the warranty so just take it, send it back and get a new one.


Are these in passives?

Question: I learned English autodidactically by reading books , watching movies , video games , etc.... But, there are some things in english that confused me , such as passive forms. What's the difference between 'x cannot be stolen' and 'x cannot be steal'? . Are both in passive forms and have the same meaning ?
Comment: Something can be _a steal_ (meaning it's so cheap it's almost like you stole it rather than buying it), but _*be steal_ is not grammatical.
Answer: Only the first one is grammatically correct. The second one has no meaning. When something is stolen, it means that someone has stolen it. So, to answer your question, the first one is in passive form.
Comment: Yes, no way. You cannot use it.
Comment: It's a mistaken hearing. It should be  ***a steal***, with an article. But _a_ is hard to hear and often missed in speech, giving the impression it's not there. As a verb, _steal_ is present tense and infinitive, never participle or past tense. But as a noun, _a steal_, meaning a bargain, is very common as a predicate noun and therefore can follow the auxiliary _be_. Passive uses the auxiliary _be_ followed by a past participle form. _Steal_ cannot be a past participle, so this cannot be passive.
Comment: @JohnLawler If it's a mistake in *hearing* (or interpretation), it could also be *x cannot be* ***steel***, as in made of that metal.
Comment: So you mean NO WAY the second is used to express passive ?
Comment: Could be, if it makes sense in context. But that's the listener's call, not the speaker's -- and certainly not the writer's.

Are these in passives?


Is there a log file for RDP connections?

Question: I connect to my work PC via VPN/RDP and I would like to find a log file on my work PC that would include some information on when I used it last, from where my connection originated and how long it lasted. Where in Windows 7 would I look to find that out?
Comment: Shouldn't this be on serverfault?
Answer: If you look at the event viewer as the administrator there are server logs but not for login/logout as far as I know.
Please check the Event Viewer tree on the left side under "Applications and Services Logs -> Windows -> TerminalServices-*" where * is all of the logs there. I think you are most interested in the TerminalService-LocalSessionManager Operational log. Event ID 21 will provide the IP address of the incoming connection.
There is also a "RemoteDesktopServices-RemoteDesktopSessionManager" node in the event viewer tree on the left side under "Applications and Services Logs -> Windows". Only the Administrator role is allowed to view the file I believe. Please confirm and let me know if this addresses your use case.
Maybe try this for logging login/logout as well:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/aptopnode.mspx?mfr=true
Comment: Actually either TerminalService-LocalSessionManager Operational or TerminalService-RemoteConnectionManager Operational work for me. I can see the username and the dhcp IP from there. Thanks.
Answer: Look under 'Application and Services Logs' > 'Microsoft' > 'Windows' > 'TerminalServices-ClientActiveXCore' > 'Microsoft-Windows-TerminalServices-RDPClient/Operation' ,
This log will have events which contain the server name which the end user attempted to connect RDP into.
Comment: and if that is empty, you may be lucky and have entries in TerminalServices-RemoteConnectionManager.
Answer: I can't tell you how to check from your work machine when you established a VPN as presumably it isn't the VPN server (?). However, if you're using Remote Desktop Connection to control that work PC you may be able to pull the logon / logoff times from the Event Viewer.
Look in the Security logs for those. RDP logons are an Event ID 4624 but just searching for 4624 won't work. Within the event you need the Logon Type value to be "10" and the SecurityID value to be yours. Not sure how to filter those...
Comment: This works as well but the log that I can get from Jarod's answer are easier to digest.
Comment: You can open the XML tab on the Filter dialog, check the Edit manually box and enter `

*[System[(EventID=4624)]] and *[EventData[Data[@Name='LogonType'] and Data=10]]

`.
Answer: I found the information in the Event Viewer under Windows Logs/Security you will see under task category logon and logoff events.
Comment: RDP can also reconnect to an existing session, in which case there won't be a logon event.
Comment: Not entirely sure where you were looking but that area does not provide the information I was asking for.
Comment: @BenVoigt, The logon logoff might also not be from RDP right?
Answer: In your case, you need to review TerminalServices-LocalSessionManager and TerminalServices-RemoteConnectionManager logs from your computer.
You can also check an excellent third party tool called SysKit, formerly Terminal Services Log. It will generate you all sort of reports from logs and will save you a bunch of time if you want to get all of the details about RDP connections and other stuff.
Please note: I am affiliated with Acceleratio, the makers of the tool mentioned above, so I might be a little bit biased here.
Comment: the syskit  price is a little steep :(
Comment: If you mentioned a tool that was open source as well in your answer I would like it even more :)
Answer: Use the command quser to show sessions.
Then you will see something like ID 1 or 2 or 4.  Then type Logoff 4 to log off that session.
You can also type query session or qwinsta (both are the same thing)  Show's who's on and what port is listening etc.


What technology does Google Drive use to get real-time updates?

Question: What technology does Google Drive use to do real-time?
When I type in a Google Drive document that is being accessed by multiple users, the Chrome Developer Tools Network tab shows that there are no WebSockets.
I see that the two most frequent types of AJAX call have either "bind?" or "save?" in the URL. "save?" POST requests are made every time I type, which makes sense- normal AJAX for sending updates to the server.
When another user types, the most recent "bind?" GET call stays open, and the amount of data transferred over that connection increases. Periodically, "bind?"s are closed and new ones open up, and the logic seems to be some function of duration and data size.
This isn't long-polling, since when the server sends updates it doesn't complete the response.
This doesn't seem to be server-sent events, since the content-type is "text/plain" instead of "text/stream".
Is there a name for what Google is doing? If so, how can I try implementing this?
Comment: Does same technology used in Google Calendar as well?
Answer: Is there a name for Google's solution for real-time updates in Drive (such as "long polling" or "sockets")?
It didn't have a name until now. I'll call it "no-polling," to contrast with polling and long-polling.
With polling, the client periodically sends queries for new data.
With long-polling, the client queries for data, and the server holds onto the request, ending the response with the updates when there are updates.
No-polling (what Google Drive does) takes advantage of how the browser can read data from the body of a request before the request is complete. So as collaborators do more typing and edits, the server appends more data to the current request. If certain limits are met (length of the content or duration of the request), the request completes, and the client initiates a new request with the server.
How can I try implementing this?
For the client to send updates to the server: this can be done with normal POSTs.
For the client to subscribe to updates from the server:

The client sends a GET for an update stream, then starts reading the body of the response before the response is complete.

XHR objects can emit progress events before the request is complete. The (partial) response is accessible using  xhr.responseText. ~~There's no simple way to watch for progress with fetch yet (as of May 2016).~~ When using fetch one can watch for progress by consuming the res.body ReadableStream.

The client should initiate a new request when the current request ends.

The server has to:

Keep track of which clients are subscribed to which update streams.
When a request comes in for a particular update stream, write data to the response, but don't complete the response until the amount of data gets large or a timeout is met.

No-polling seems superior to long-polling, in my opinion, though I haven't played with it much. Long-polling forces a trade-off between latency and message size (given a constant rate of updates), a trade-off no-polling doesn't have to make. Another disadvantage of long-polling is that it can lead to many HTTP requests, paying the overhead of HTTP each time.
No-polling's big advantage over WebSockets is that no-polling is supported by every browser, though WebSocket support is pretty good — IE10+.
Comment: Current `fetch` spec says that [`res.body` is a `ReadableStream`](https://fetch.spec.whatwg.org/#concept-body), enabling you to watch for progress with `fetch`.
Comment: I think Facebook also does something similar. Try engaging in a conversation with some: it maintains a persistent HTTP connection as it grabs more data over time.
Comment: This is very interesting... I had never heard of this method before.
Comment: As far as I can see, it looks like they switched to "standard" long polling strategy, when the request is closed everytime data is sent.
Comment: @enlitement nice! I see that, too. The `GETs` to `/pull?` last up to around 50 seconds and have a series of JSON payloads and heartbeat messages.
Comment: Is there any framework which already implement this? or any gist which implements this? @MaxHeiber
Comment: Not that I know of @MayankSingh, though I'd be curious to see one!
Answer: no-polling described here sounds like "server sent events - SSE" where client sends a http get request with "text/event-stream" as content type.
Server holds on to the request and sends a response to the client whenever it needs to.
It is persistent but differs from web-socket as web-socket it 2 way communication but SSE is one way(only server sends payload/message to client)
Comment: A client would normally send a request, and SSE keeps client updated in real-time


How can I help my cat with chronic congestion and sneezing?

Question: We got our cat as a kitten; she's now 12.  When we got her, she had a bad upper respiratory virus.  She was so congested at one point, we had to hold her upside-down to get the mucus to drain out of her so she could breathe.  She survived the virus, but ever since then she's had a bad problem with congestion.  I think the infection left scarring that blocked her tear duct on one side.
Her life is a constant cycle of: 1) Increasing "sinusy" congestion with runny eye and weak, nonproductive sneezing that doesn't clear anything.  2) Heavier congestion where we can see mucus in the nostril and she struggles hard to clear the blockage. 3) Eventual sneezing out of a very thick and greenish (sometimes hard, sometimes bloody) mucus plug. 4) About one day of amazing energy and playfulness; before back to 1) Increasing congestion.   Amazingly, this cat has developed some kind of muscle control over her upper lip, whereby she can pull it up to block the unaffected nostril and increase her sneeze pressure to expel the plug.
Vets over the years have said there's nothing that can be done for her.  The only thing that gives her any relief at stages 1 and 2 is if I rub a little Vicks onto my finger and hold it about 6 inches from her nose.  She seems to like that.
Is there any new treatment for this problem?  We hate to see her suffer this way, day after day.
Comment: It seems she is getting pretty old. If the vets say there's nothing to do, I feel it'll probably be best to free her of her suffering. If there were any treatment that could be done, the professionals would be the first to tell you. At this point in her life, I doubt you're gonna see any amazing recovery (12 is 70 in cat years). I'm very sorry to hear about her suffering; I tear up just thinking of this possibly happening to one of my cats /:
Comment: (Continuation of previous comment. Was too long for 1 comment): A humidifier in the room might help break up the mucus; although, I'm not sure if cats handle mucus the same way that humans do (possible suffication due to not being able to eject the mucus), so I'd talk to a professional before hand
Comment: You have described my kitten who is seven months to a tee! I can't imagine her enduring this for 12 years. We have tried antibiotics and anti fungal and about to trial steroids. If this doesn't work we are looking at euthanasia, we can't see her suffer anymore and cannot take anymore green snot on everything.!
Answer: The symptoms that you describe seem to describe feline herpes (also known as FHV-1).  The ASPCA lists symptoms of a feline herpes infection as

Sneezing "attacks"
Discharge from the nose and eyes
Conjunctivitis or pink eye (inflammation of the eyelid)
Lesions in and around the eyes
Eye ulcers
Congestion
Fever
Depression
Loss of appetite
Drooling
Squinting
Lethargy

While most cats can suppress the infection once their immune system learns it, a few cats are never able to fully rid themselves of the symptoms of feline herpes. One of my four has daily sneezing and nasal discharge from it. Otherwise he's fine and lives a normal life, we just sometimes wipe his nose (and our walls).
Even though I'm not a vet, feline herpes is extremely common in rescued cats, so it's a reasonable suspicion. Your vet probably sees this problem daily and didn't take the time to explain it. I don't have a particularly good feeling about a veterinarian that doesn't realize as common as it is to THEM, it's new to YOU.
I also check with my vet regularly (once a year or so) to see if there are any new treatments for feline herpes, so that's another thing you can do. There are a few treatments that are being researched, but there is not any evidence that they work yet.
Investigational Treatments
Probiotics. There isn't any evidence either way that this works, but it doesn't hurt and can be helpful if there are also gastrointestinal issues.
L-Lysine. Again, the evidence at this point is conflicting but it is made into treats and palatable pastes so you can try it without any harm to your cat.
Managing Symptoms
Most of the current treatments focus on managing symptoms.
My vet recommends saline nasal drops (example, commonly marketed for children/babies). Any drops you use should NOT contain any medications without the advice of your veterinarian.
You can keep your cat in a steamy area (like the bathroom while you take a shower, or a large carrier near a humidifier) to help break up the mucous.
If your cat develops a secondary infection, antibiotics can be helpful (talk to your vet).
Keeping your cat hydrated is important (the mucous will be thinner and easier to deal with). Consider switching to wet food if you feed dry.
Additionally, make sure that you monitor your cat's food intake. If your cat cannot smell her food, she may not want to eat it. You can heat wet food for a few seconds in the microwave or add smelly tuna juice to it to increase palatability. If she doesn't eat for a few days she can become seriously ill.
Sidenote: Corneal Ulceration
One of the most damaging affects from feline herpes is the development of eye ulcers. Cornell University gives the symptoms of a eye ulcer:

The clinical signs of corneal ulceration include inflammation of the tissue surrounding the cornea; seepage of discharge from the eye; clouding of the cornea; and apparent hypersensitivity to bright light. An affected cat may squint, rub its eyes, and behave as if it is having vision problems.

If you notice these signs in the future, you should take your cat back to the vet to be evaluated for an ulcer. While most ulcers will heal on their own, they can cause severe discomfort and in rare cases can permanently affect the cat's vision.
Comment: Hi - thanks for the information.  My cat is not having most of those symptoms (no fever, depression, eye problems other than clear discharge, or lesions) so I'm not sure she has feline herpes. We have put her on antibiotics a couple of times when her eye discharge started looking greenish.  Again thanks to everyone who responded.
Comment: @redpenner your cat doesn't have to have every symptom to have feline herpes (in fact most don't). My cat only has nasal congestion and sneezing.
Answer: None of my animals have had that problem, so the following ideas are based on my experience as a human with chronic nasal congestion.
Shut her in the bathroom with you when you take a shower. Make it a nice, hot, steamy shower. This should help loosen some of the mucus.
Get her to drink extra water. Pet stores sell water fountains designed for pets to drink from; cats tend to drink more when the water is fresh/running/aerated.
Since the Vicks seems to help, try putting a little on a (low-wattage) bulb in a table lamp. It should slowly release the vapour. Also, there are plug-in vapourisers for this purpose.
They make nasal aspirators for babies -- ask your vet if it would be safe to try one on your cat.
If it gets to the point where your cat's quality of life is threatened, you could ask your vet again if there's anything that would be worth trying, if only to give her another six months or a year. There might be a medication that your vet is reluctant to try because there are long-term risks associated with it (e.g. kidney disease), but at some point the short-term benefits may outweigh the long-term risks. There are so many different medications for humans with this problem; I'm surprised there isn't something available for cats.
See if different foods affect how much mucus she produces. Maybe a different food will help.
Answer: My older cat (a year older than yours) had an infection not long ago, and my vet suggested to instill a watered down injectable antibiotic (Lincomycin in our case, but it's individual) into her nose. I'm almost sure it can't be used long-term, but it should be fine if it's used in courses. Try talking to your vet about it? It can't be just mechanical blockage, otherwise there shouldn't be any pus (which makes the mucus green).
Answer: There are some very interesting anecdotal stories and testimonies here regarding Apple Cider Vinegar being effective for such conditions for cats with feline respiratory issues (Lysine is also mentioned).
Quote regarding Organic ACV (with the mother):

After purchasing a 32oz. bottle of OACV at my local grocery store, I came home and made a batch of OACV/Water ratio of about 1/4 cup OACV
  to 1cup purified drinking water from our home water system. I'm sure
  any normal faucet water would work fine but wasn't sure at that point
  if I was going to try adding some to their drinking water- turns out I
  didn't need to do that after all. I soaked cotton balls in the
  solution and applied to each cat on back of their necks down thru
  shoulder blades and to all 4 of their paw pads, especially the fronts
  because they will lick them throughout their day when cleaning
  themselves and Wallahh!! OACV ingested by default! Most of them didn't
  respond with licking their paws right away as I had hoped but made
  sure they all had a pretty good soaking to their neckline and also
  their front paws topsides as well as paw pads. Make sure it gets in
  between their toes/claws as well so the solution gets in there real
  good causing them to lick due to feeling wet and uncomfortable
  perhaps. I did this just 2 times in 24 hr period and once the
  following day and what a remarkable difference. ...


distance between mobiles system

Question: I'm developing something for my mobile and wanted to implement a feature that will show other mobile devices that are near you(changeable radius if it's possible) that have the same app by using wifi or gps, whatever is better.
How do I do something like that(reference to a great guide/site is great)? Is there a some sort of a ready plugin or something ^^?
thanks.
Answer: 1) The app reads the GPS Position of a user ID and send it to your server and store the most recent one
2) The App connect to server and reads the position of all users, or all users within aproximate distance from current device position GPS.
Fpr aproximate distance calculate the distance between two lat/lon coordinates. ios and android have built in functions. Otherwise the are easy to self implement.

distance between mobiles system


encrypted flash of DSP

Question: when programming the flash of DSP by accident i encrypt the flash content.
is there any way to decrypt flash of a DSP? the flash was encrypted.
Comment: I suspect it will depend on the DSP in question and how you program it. Do you have a JTAG interface?
Comment: Why can't you just erase it and try again?
Comment: because i do not have the source for code.
Answer: If you were programming the device then you must have source non-encrypted code. Why not re-flash again with non-encrypted code?
However if it is DSP allowing you to flash its code, and now you flashed with encrypted contents and DSP can not start properly (because it does not understand contents of the flash) then the only appropriate course of action is to refer to DSP's datasheet to learn how you can perform emergency flash content reload. You may need special tools (e.g. adapter) to perform it.

encrypted flash of DSP


Understanding the plm package - Why aren't my standard errors correct?

Question: For fun, I tried to replicate the results of Petersen (2009) who deals with the correct estimation of standard errors in finance panel data sets.
In a nutshell, he estimates the following standard regression for a panel data set:
$$
Y_{it} = X_{it} \beta + \epsilon_{it}
$$
where $\epsilon_{it} = \gamma_i + \eta_{it}$ and $x_{it} = \mu_{i} + \nu_{it}$. Hence, both the residual and the independent variable have a firm-specific component. Petersen goes on to show that this results in biased standard errors when applying the standard OLS. For example, he shows in table 1 of his paper that if both the residual volatility and the variable volatility are driven by 50% by a firm-specific component, the true standard errors are nearly twice as large as the ones given by OLS.
He shows that in a MCS and I reproduced those results in R, as you can see from the code below. Naturally, I asked myself how I would compute the correct standard errors in R and the package of choice seemed to be plm. However, I just don't get the correct results out of it and I don't know what I miss.
Here is my code:
library(plm)
runMCS <- function(runs, nrN, nrT, fracFirmX, fracFirmEps, sd_X, sd_eps, beta) {

  betas    <- numeric(runs)
  se_betas <- numeric(runs)
  panel_betas    <- numeric(runs)
  se_panel_betas <- numeric(runs)

  for (i in 1:runs) {

    #Model epsilon, X, and Y
    eps <- rep(rnorm(nrN,
                     mean=0,
                     sd = sd_eps * sqrt(fracFirmEps)),
               each=nrT) +
                 rnorm(nrN * nrT, mean=0, sd = sd_eps * sqrt(1-fracFirmEps))
    X   <- rep(rnorm(nrN,
                     mean=0,
                     sd = sd_X   * sqrt(fracFirmX)),
               each=nrT) +
                 rnorm(nrN * nrT, mean=0, sd = sd_X   * sqrt(1-fracFirmX))
    Y   <- beta * X + eps

    #Compute regression (OLS)
    reg <- summary(lm(Y ~ X))

    #Save results
    betas[i]    <- reg$coef[2, 1]
    se_betas[i] <- reg$coef[2, 2]

    #Try plm
    df <- data.frame(Firm = rep(1:nrN, each=nrT),
                     Time = rep(1:nrT, times=nrN),
                     Y = Y,
                     X = X)
    preg <- summary(plm(Y ~ X, data=df, index=c("Firm", "Time"), effect="individual", model="within")) #within is fixed effects
    panel_betas[i]    <- preg$coef[1, 1]
    se_panel_betas[i] <- preg$coef[1, 2]
  }

  return(c(avg_beta = mean(betas),
           true_se = sd(betas),
           avg_se = mean(se_betas),
           avg_clustered = mean(panel_betas),
           se_clustered = mean(se_panel_betas)))

}
MCS_50_50 <- runMCS(50, 500, 10, 0.5, 0.5, 1, 2, 1)
MCS_50_50
     avg_beta       true_se        avg_se avg_clustered  se_clustered
   1.00503955    0.06020203    0.02825567    1.00433092    0.02985546

Note that I only run the simulation 50 times here because the plm function slows it down considerably. So basically, it makes virtually no difference if I call lm or plm. I'm pretty confident that I set the index and model option correct after reading the vignette of the package. However, I must miss something here! Interestingly, the package also has the fixef function and if I call that on one run, I get something like  this:
summary(fixef(plm(Y ~ X, data=df, index=c("Firm", "Time"), effect="individual", model="within")))
1      13.60377     0.44112    30.8391 < 2.2e-16 ***
2    -830.74707     0.44136 -1882.2236 < 2.2e-16 ***
3    -326.96042     0.44137  -740.7840 < 2.2e-16 ***
4     169.16463     0.44246   382.3287 < 2.2e-16 ***
...

I'm not quite sure how to interpret those results, but here, I get considerably larger standard errors for each firm separately. If I would average those, I would end up with something above 0.44 which is considerably closer to the true standard errors, but still not right.
So, again a very long question from me, sorry for that ;-) Note that I did check answers before and I found this interesting link. The white paper that is referred to in the answer is interestingly the same person that implemented the solution on Petersen's webpage. So I'm pretty sure that I could get the correct standard errors by implementing Mahmood Arai's solution. But I'm looking for an already implemented and therefore safe option and I just wonder why that plm function does not work.
Comment: The manual states "If the argument vcov was specified, the standard errors (stored as attribute "se" in the return value) are the respective robust standard errors". I don't see that you used the ``vcov`` argument above: user11562's shows you one way to use the ``vcov`` argument.
Answer: Isn't it just
coeftest(xxx, vcov=function(x) vcovHC(x, cluster=c("group","time")))

where xxx is the outcome of the plm() function?
Comment: Sorry for the late delay; anyways, your approach doesn't really change my standard errors and your proposed solution is going again in the direction of the link I provided above.  That is, computing the standard errors yourself. I am just wondering why plm is not doing that automatically?


How secure is a server's .htaccess file?

Question: Would access need to be gained to the server in question or can an .htaccess file leak information in some way?
Answer:
Would access need to be gained to the server in question?

To read the .htaccess file, yes, assuming the server is properly configured everything else running on the server is secure. Most default apache installations have a rule that files starting with .ht will not be served statically. It could still be served by a buggy application on the server, like a PHP script that passes user input directly into file_get_contents .

Can an .htaccess file leak information in some way?

Yes, it can leak anything that is in it. Basic information like the path to your web root can be found in it. Perhaps an open redirect could be discovered. Some applications have a .htaccess file set environment variables containing database credentials. In reality though, if someone is able to get access to your .htaccess file, you probably have bigger problems.
Answer: This is configuration specific. By default, Apache is configured to prevent any files starting ".ht" from being served through the web server. This wouldn't protect any files being served, for example, by another web server, or found through FTP access. Other web server software don't always use .htaccess files, so may expose their contents, but in that case, the contents will not be in active use.
If .htaccess files are exposed, this can reveal details about logging locations, password files, environmental variables, and pretty much anything else that could be in a system wide Apache config file.
Comment: What about `.html` files?
Comment: If they start `.html`, they will be blocked by Apache in default config. Would be a fairly unusual file name though - `something.html` would be more normal, which doesn't start with `.ht`, so is fine.
Answer: It's not entirely clear what you mean here.
An .htaccess file is in essence, just a config file on the server. Assuming the server is reasonably well configured and hardened, so no unauthorized user can access the file itself, it should not leak any information, as it will only be used by the server itself, and internally and invisibly from the outside.
That said, there may be caveats: If for instance, you want to use the .htaccess file to limit access to a directory by setting a password, then that will be more open to a brute force attack than other login options containing more logic, e.g. to allow only a small number of attempts before either displaying a CAPTCHA, or locking the account, etc.


Can a time machine backup be restored to a single user on a new computer?

Question: I had a 2013 MBP Retina that I have been doing regular Time Machine backups to an external hard drive. A few months ago I also bought a Mac Mini which I just started from scratch with, and never transferred over any files from the MBP. I was using both, simultaneously for somewhat different purposes. Well, my MBP stopped working (probably logic board according to my "Genius") and I don't feel it is worth the price to fix it, and I am not able to afford a new laptop right now. So what I want to do is restore my MBP backup onto my Mini, without deleting what is already on it, OR merging the two. If I create a new user on my mini, can I restore my backup to that user profile only, leaving my original user information intact?
Answer: I don't have a categorical plan of action to manage this strategically from soup to nuts, but based on once when I accidentally migrated the same user onto an already fresh install, here are some ideas.
First. Ensure you have solid backups of both, in case things get out of hand.
Migrating onto an already set-up Mac will generate two separate accounts, even if they have the same name. Unpicking this by hand is not a simple job.
If you want to, for instance, merge the email databases, I don't see any method to achieve this, however, anything already synced over iCloud should already be merged.
If all you need to do is cherry-pick files from one to the other, I'd do it manually.


Is there a fantasy system that has a similar mechanical complexity to Ars Magica, but with a more robust melee system?

Question: I'm preparing for my next game. For a while, I've had an interest in the mechanics of Ars Magica's casting system, and I'm hoping to run a game with a similar texture. The problem is that my group isn't unanimous in wanting to play caster-types — and I don't think the companion aspect could really sustain interest. Is there an RPG that has a similar system of magic to Ars Magica, even if weaker, but with a more robust melee focus?
Comment: *are you sure?!* Just... as an ars magica gm, **Are You Sure?**
Comment: Hi ironproof, welcome to the site! I've retagged your question with [tag:game-recommendation] instead of [tag:house-rules], since my understanding is that you're looking for a game system that matches your requirements, rather than houserules for Ars Magica. Feel free to revert if I'm wrong, but if that's the case you may need to edit your question to make it clearer.
Comment: When you say robust, do you mean more complexity as the word implies?
Comment: Unfortunately, [game-recommendation questions have become off-topic](http://meta.rpg.stackexchange.com/q/5747/321) since this was asked.
Answer: Time to break out the pot still...
There is a very simple home brew solution to this, actually.  A few years back, White Wolf bribed/convinced/invited Monte Cook to write a D20 version of the World of Darkness.  The product, unoriginally, was called "Monte Cook's World of Darkness".  Why you should care about this, though, is in the history of the World of Darkness.
Long ago in a magazine far far away
Before Vampire the Masquerade, White Wolf was just a magazine.  It did not produce games.  At about the same time, pre-world of darkness, there was a company named Lion Rampart.  They produced the game Ars Magica.  Over time the two companies merged and created, important for this conversation, Mage - the Ascension using a slightly modified casting system from ARS.
Monte
About a decade ago, Monte Cook made his game, pretty much rewriting the World of Darkness into D20/D&D3.5 Modern.  In this rewrite, he created rules for ARS/Mage style casting for D20.
...Pitch the yeast into the wash, and let ferment for 3 weeks
I have successfully ripped the 30 or so pages from Monte Cook's world of darkness and used it with D&D3.5 to give D&D ARS style magic.  I do not have the document for how i had to tweak WoD Mages to work in D&D, but it was minor - under a page.  Basically, you need the Mage class description (2 pages if my memory serves) and the magic rules (which is a stand alone chapter).
I think it can easily be said that D&D has a martial combat focus.
Answer: GURPS
This is a perfect application for GURPS. You want:

A magic system similar to Ars Magica
A more robust combat system

GURPS delivers on both fronts.
Flexible Magic
GURPS has had options for flexible, improvisational magical systems since 2nd edition. I don't have my books with me at the moment, so I can't tell you if the Ars-like system is in the core Magic book or not. But I know that between Magic and Thaumatology, you'll have everything you need to keep your casters happy and engaged.
Tactical Combat
GURPS has had a tactical combat focus since its earliest incarnations. The advanced combat option is practically a tactical combat boardgame on its own. But it also supports abstract, theater-of-the-mind style combat. You can add complexities and options to your own taste anywhere in between.
Setting
GURPS has always been setting-agnostic. You can continue to use the Mythic Europe setting of Ars or the Yrth setting from GURPS Fantasy or neither or mix them up, or choose another entirely. GURPS was designed from the ground up to support your game and your setting, empowering the kind of play you want...as long as it's at least kinda simulationist.
Comment: The system I remembered is in the Thaumatology book under "semantic magic"
Answer: At the risk of this coming across as a sales pitch... The Contested Isle: The Hibernian Tribunal sourcebook includes a new set of virtues that are essentially combat-oriented feats based on old Irish legends.
They were designed to support a mythic hero archetype and they do a great job of giving companion characters some extraordinary capabilities.
Personally, I like the Ars combat system but I can see that at times it does feel like it needs support for actions other than just "take a swing". If you can spring for the Contested Isle, these "clesrada" (and the monstrous battle transformations you can also find there) can be taken across to any tribunal you want to play in.
Comment: Welcome to the site! Please take a moment to check out the [tour] and get a feel for how things work around here.


Are these three questions on gemstone size and value duplicates?

Question: How big is a 5,000gp diamond?
and
How big is a gemstone in the dmg gemstone table?
and
How big is a 50 gp diamond?
These three very related questions are potentially a triplet of duplicates. Rather than an open-close cycle, it seems a good idea to discuss here.
Answer: The questions about the (value) gp diamonds are duplicates of the more general question about gemstones.
First, let us examine the question, How big is a gemstone in the dmg gemstone table?
The question is given:

Is there indeed a standard gemstone size in the DMG's treasure tables, and if yes, what is it?

In the most literal sense, this is just asking if the tables say anything about sizes, which they do not. But this question is given with significant context, including the conclusion that no, the tables do not include size. The querent goes into more detail:

I do not require a strictly RAW answer to this question.  There does not seem to be guidance on this issue within the official rules, but I can think of three possible ways of answering this question, in order of authority:

Inference from official adventure modules that contain a
description of a gemstone's size and value.  To get at the pure
value of the gemstone as a material, such a reference should not be
to gemstones that are part of an art object
Inference from real world gemstone value, applied to the RAW.
This SE answer to a similar question has some helpful guidance.
If nothing else, a secondary source with more usable gemstone
tables would be helpful.  This includes previous editions,
thoughtfully written homebrews, and third party publications.

All I want is a number that is plausible, based on either real life or existing D&D materials.

It is quite clear from this that the question being asked is decisively not "do the gemstone tables give sizes?". Rather, it seems quite clear that the question being asked is something like: "What is a reasonable estimate for the size of the gemstones given at each price point in the DMG?"
Next, we will examine the questions How big is a 5000 gp diamond? and How big is a 50 gp diamond?, and see if they are actually asking the bolded question above.
Each question includes some context about spell components, and then asks nearly identical questions:

How big would a diamond worth 5000 gp be?

and,

How small would a diamond be that is only worth 50 gp?

Both of these questions are substantively identical to the question "What is the size of a (value) gp diamond?" And since nobody is asking for unreasonable answers, I claim that this is substantively identical to the question, What is a reasonable estimate for the size of a (value) gp diamond?
Finally, to tie it all together, we observe that 50 gp and 5000 gp diamonds appear in the gemstone tables in the Dungeon Master's Guide, so they are each answered completely by the question, How big is a gemstone in the dmg gemstone table?
The Duplicate Criteria
This faq question details how we should close questions as duplicates. There are three criteria, which we will examine in turn.
First criterion:

It's the same question, or Question A is already covered obviously as a subset of Question B. Obvious here means I can tell at a glance it's there.

This one seems to be satisfied, as I have demonstrated that the (value) gp questions are very obviously subsets of the general question.
Second criterion:

Question B has an obvious answer to Question A. Obvious here means I get a straightforward answer without hard searching — a couple of sentences buried in the middle of a post, or an answer which only sort of implies an answer to Question A, doesn't count as obvious.

The answers to the general question make exactly the same arguments as the value specific questions - all three questions have essentially the same answers given.
Third criterion:

There is not some strong compelling reason to covering Question A alone, separately from Question B. (If the above bullet points are met this rarely happens.)

I assert that there is no strong compelling reason, especially given that the first two criteria are met. A dissenting answer must give this reason, and it must be particularly compelling.
On timing and canonical quality.
The meta guidelines for duplicates also has a statement about timing and which question to leave open:

We prefer closing newer questions a dupe of older unless there's a major quality benefit the other way around. Some examples of when there's such a quality benefit:

The older one isn't answered (or has bad answers), and the new one has good answers.
The newer question is flat-out better written, easier to follow, and generally more useful for anyone interested in that line of inquiry. Answers to it are equal or better ("both have no answers" is equal).
This typically occurs when we establish a high-quality canonical question to handle a subject straightforwardly that's previously been handled messily in various earlier questions.

The question about the 50 gp diamond is the oldest of the lot, but the general question about gemstone values in the DMG is head-and-shoulders above the others in terms of quality. It gives detailed commentary on the querent's own investigation into the problem and outlines for us what makes a good answer to the question. Further, it is more general and has the potential to cover a wider range of future duplicates than the other questions. I will have an easier time convincing you that a question about 500 gp rubies is a duplicate of this general question about gemstones than I will to convince you that a question about 500 gp rubies is a duplicate of a question about 50 gp diamonds.
I propose we close the two questions about diamonds as dupes of the question about gems found in the DMG.
Comment: The original question's answer references  AD&D 1e, DMG. This is NOT a quality canonical answer to a question about dnd 5th edition. I understand that it is the best broadly applicable table to the entire selection of gemstones. However the new question regarding a 5000 gp Diamond has at least  2 distinct 5e references. And can be answered much more accurately. So pointing people from a question with EXACT examples of current rules answer to 4 editions prior generalized table is not helpful.
Answer: These are not duplicate questions.
How big is a gemstone in the DMG gemstone table?
Is asking for guidance in wide array of potential options, some of which have 5e answers and some do not. The accepted answer uses a table from ADnD 1e. While that is understandable because of the breadth of the question doesn't offer a precise answer in the current edition.
How big is a 5000 gp diamond?
However asks for 1 specific diamond value. Importantly a diamond used in a spell so that it could be important for a spellcaster to know the specifics of how easy it is to store or handle. Also importantly, there are at least two examples of it being described in DnD 5e in official sources. Meaning this question can be answered much more accurately than the previous one.
The comparison would be if someone asked "How big are cities in the Forgotten Realms?" vs "How big is Waterdeep in the Forgotten Realms?". The answer to the first is almost certainly going to be generalized to a point where it is unlikely to include an answer to the second, even though the second can be answered much more accurately (and could be much more important to have an exact description for a given campaign).
Comment: If you're asking "How big is this one gemstone in D&D 5e?", then a question of "How big are these gemstones (including that one) in D&D 5e?" is in fact preferred as the canonical entry unless there's something unique about that one gemstone (there isn't). If the answers aren't satisfactory you can bounty it requesting a canonical answer from D&D 5e material, but they nevertheless tackle the exact material of the 5000gp gemstone and others generally.


Restringing a pinless guitar

Question:
My little brother bought a charity shop guitar but I've never seen this before. It doesn't have the pins so I'm worried if I take the strings off I won't get them back on... are there any videos or tips on how to restring it.
Comment: restringing a priceless guitar
Comment: If the strings wrap around the tuners in a fashion similar to a windlass (I can't tell if the second string is steel or black nylon, but it looks like the latter) be sure to use nylon folk guitar strings rather than steel acoustic guitar strings.  Steel strings may exert too much tension on the guitar and destroy it.
Answer: You don't need to worry about pins. The ball ends of the strings go under the tailpiece and clip there. Loosen off all the strings, and you'll be able to lift up the tailpiece, revealing most likely slots where the strings attach. They may be holes, but it's unlikely. If there are holes - poke the strings through.
I have a similar guitar, a very old Eko. The slots under the tailpiece have broken away, on a couple, so as a temporary solution, I wrapped the string round the tailpiece, and threaded it through its ball end, then over the bridge. Not a perfect solution, but it makes the guitar usable.
Take the strings off one at a time, and for now, replace with the same gauge. Looks like around 010-048" ish. Make sure you wrap the other end of the strings the right way round the posts on the head. They may not even be correct as you got the guitar. The idea is the strings stay as straight as possible from fingerboard, over the nut, onto the post.
Answer: Make sure to buy ball end strings when you choose to replace the strings. It is a simple job to restring this type of setup. Remove the old string by cutting it at the twelfth fret and removing the string from the trapeze (that's what the type of string holder you have is called). Then remove the other part of the string (the second half) from the tuning post. Now you can feed the new string into the string hole on the trapeze, pull it through until the ball end is seated. Next attach the other end of the string to the tuning post with enough slack to allow three or four windings of string on the tuning post. Wind it up to pitch, making certain the string is properly seated in the string slots in the saddle and the nut. Another option is to take it into the guitar shop and ask the tech to show you what you need to know. Thanks for the question.
Comment: Does the second string look like nylon or steel to you?  To my eye, it looks like it might be black nylon.

Restringing a pinless guitar


iPod failed during update

Question: I have just bought an iPod Touch second hand. I tried to update it's firmware to the latest version using iTunes. The update failed and now I cannot access the iPod either directly or in iTunes. Turning the iPod ON the screen shows a 'connect to iTunes' looking icon and does nothing else. Connecting the USB does nothing and the iPod does not show up in the iTunes side bar. The iPod turns itself OFF after a minute or two. What now?
Comment: What error number are you getting when it fails?
Comment: @AndrewLarsson I got an error message when the update failed - stupid me didn't wright it down. Now I get no error messages, nothing.
Answer: You'll have to connect your iPod in recovery mode. Make sure the iPod is disconnected and turned OFF, so not on stand by, but completely off.
Then, while pressing and holding the Home button, reconnect the USB cable to the device. The device should turn on with the "Connect to iTunes" screen. When this screen appears you can release the Home button; your iPod should now be in recovery mode.

If not already open, open iTunes. iTunes should then display a warning that it has detected an iPod in recovery mode and will ask you to restore it.
Comment: I get the "Connect to iTunes" screen as shown above but nothing else. iTunes does not show it.
Comment: Have just tried to put it in DFM mode (instructions are to hald both power and home for ten seconds, then release power and continue holding home for another twenty seconds) but it just turns on and off a few times and stays off or comes up with the 'connect to iTunes' screen.
Answer: Finally got it working - it was the cable! Borrowed a cable from a friend, did the DFM steps as outlined above and it worked (3 attempts, but got there in the end).

iPod failed during update


Use of past perfect

Question: We're having a discussion here on whether or not to use the past perfect in following sentence:

The cargo was visible through the gap and was noted to have (had?) sustained damage.

Which is correct and why?
Answer: The version without had is correct.
The perfect aspect in English is formed by using the auxiliary verb have (or for some verbs be) in the appropriate tense or construction, followed by the past participle of the main verb, in this case sustain.
More or less all constructions of the auxiliary verb are allowed in perfect constructions (even ones that mix in another aspect: progressiveness)—but not perfect constructions themselves. You can make present perfects, past perfects, future perfects, past subjunctive perfects, present progressive perfects, infinitive perfects, past progressive perfects, etc. But you cannot make a perfect perfect or a past perfect perfect.
In your case, have had is the infinitive perfect of have, while have sustained is the infinitive perfect of sustain. But *have had sustained is an impossible perfect infinitive perfect.
Of course, if you intended "to have (had?)" to mean that you were considering "to had" a possibility, that is immediately rejected: this use of to marks an infinitive, and had is past tense. An infinitive marker on a past tense verb is always ungrammatical.
Answer: The correct form is have!
This is beacause you are refering to an action and specifically after a to.
Statements like this always have an infinitive to point to the main action described.
Ex:

Our English professor is said to be the oldest professor in the university.

Or:

The market as some experts believe was claimed to have the best products when it was four years old.
Comment: There is a _have_ in the example already; _to have had_ is also an infinitive, just not one that can form part of a perfect construction. (Also, please use proper blockquoting on ELU, rather than indenting. It looks nicer.)
Answer: And was noted to have sustained damage is correct. With the verb sustained, had is not necessary. Without the past tense verb sustained in the sentence, the auxiliary past tense verb had would be necessary to convey that the damage occurred in the past. In other words have sustained is already past perfect without had in the phrase.
Answer: Correct Sentence is:
"The cargo was visible through the gap and was noted to have sustained damage"
In addition to this sentence:
He was working hard to have won the match.
Comment: Please indicate why you think so.
Comment: Thanks, but why is 'to had sustained damage" wrong (use of past perfect to define one event happening before another)

Use of past perfect


Can't connect to PFSense webconfig (virtual machine)

Question: I've setup a new PFSense VM (version 2.2.2) in virtualbox, it's connected to three network interfaces, vboxnet6 and vboxnet7 (both host-only adapters) and eth0 (bridged).
In this case vboxnet6 is setup as the lan interface, vboxnet7 is opt1 and eth0 is the wan interface.
Configuring the network interfaces and assiging addresses worked as it should have, and I can ping to the lan interface. However I can't connect to the web interface.
As per usual I checked nmap to see if the required ports were open and I noticed port 80 was not showing up there.
I also did an arp-scan of vboxnet6, and well here it gets weird. There are 510 duplicates of the same pfsense virtual machine there.
Any help or advice on how to fix this situation?
Thanks in advance.
Answer: Have you tried the pfsense console in the virtualbox manager?
Go to shell, and use tools like netstat -r, arp, ping, ifconfig to see what's going on from the pfsense end.
Default for web configurator may be set to https://   (port 443)


I have a machine on 16.04 but need to update it before April 2021. Will 18.04 still be available on software updates up until April 2021?

Question: Like the title says, I have a very stable machine running 16.04 at the moment and I'm thinking of updating it to 18.04 (and then maybe 20.04 after). I will want to go the update route rather than a clean install so will I be able to choose 18.04 from Software Updater up until 16.04's EOL?
Comment: You should be, unless some unlikely dramatic change/issue occurs in future as 18.04, for being an LTS release, is also supported for 5 years. Does this answer your question? [Can I smoothly upgrade from one LTS to next LTS release?](https://askubuntu.com/questions/717827/can-i-smoothly-upgrade-from-one-lts-to-next-lts-release)
Comment: Yes, technically it'll still work after that awhile too.  For non-LTS releases that period can be rather short (17.04 was days), some releases repositories get moved in weeks, others months (timing says it occurs after the EOL, not how long after). Because 16.04 LTS has extended support (ie. ESM) the extra time is longer than months... (but you shouldn't wait for security reasons, unless you're choosing to use extended/ESM support.   See https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes for upgrading notes...
Comment: Seems like it should be okay. Thanks for your help!
Answer: Yes. Later LTS releases reach End of Standard Support after earlier LTS releases.1 If you have an LTS release that is currently supported, there should be no problems upgrading it at any time while it is still supported. (You can could even attempt to upgrade it after it is no longer supported, which usually succeeds but is sometimes more difficult. But I recommend against needlessly placing yourself in such a situation.)
Regarding the specific releases you mentioned, as shown on the releases wiki page, Ubuntu 18.04 LTS reaches End of Standard Support in April 2023, which is after April 2021. You should upgrade your 16.04 LTS system before it reaches End of Standard Support in April 2021, mainly because if you don't then, at least for a short time, you'll be running a release that doesn't receive security updates, which is undesirable. But there is no need to upgrade it before that unless you want the new features of a newer release sooner, or need a bugfix that is is provided for 18.04 LTS and not backported to 16.04 LTS.
Of course it is always possible, when upgrading from one release to another, that something could go wrong. But there's no reason to think this is more likely if you wait until the earlier release has almost, but not quite, reached End of Standard Support. For example, updates for security and other stability bugs could introduce a bug that complicates upgrading, but they could also fix a bug that complicates upgrading.
(Note that if you end up deciding you want to move from 16.04 LTS to 20.04 LTS, you should still upgrade to 18.04 LTS first and then to 20.04 LTS. Usually this is what happens automatically if you perform two release upgrades starting from an LTS release.)

1 There was a time when this was not fully true. 8.04 LTS and 10.04 LTS had unusual (and confusing) support periods, with a very small number of packages supported for a very long time. However, this is fully true for all releases that are currently supported or have been supported in the last few years, and it is likely to remain true many years into the future. Even if it does not, the specific releases you're talking about already exist and their support lifecycle has already been determined. It's unlikely that the support lifecycle of an existing release will be extended beyond what has been planned, though you can get limited support for an LTS release beyond its End of Standard Support through the Canonical Advantage program.
Answer: Yes, technically it'll still work after it's EOL (end-of-life) too.
For non-LTS releases that period can be rather short (17.04 was days having no meltdown patches), some release repositories get moved in weeks, others months. Officially it's only listed as occurring after the EOL, without detail of how how long after.
Because 16.04 LTS (long-term-support) has extended support (ie. ESM) the extra time is longer than months... (but you shouldn't wait for security reasons, unless you're choosing to use extended/ESM support. See https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes
Example.  I use a mirror (https://launchpad.net/ubuntu/+archivemirrors) provided by my ISP, it still provides packages for precise (12.04) & trusty (14.04) because those releases have extended support. Xenial (16.04) will fall into this category. You'll find this in the main archive too, however mirrors are free to not provide ESM support so it may have been dropped anytime after EOL.
Also be aware many official teams erase their PPA (3rd party software sources) after a release has gone EOL, so you cannot really make any assumptions (this is up to every team, it's often done when people think of it, occasionally forgotten, and some PPAs are never emptied).
If you need details on extended support, please see https://ubuntu.com/esm (and note a number of without-$cost options are available, 50 machines for Ubuntu members like myself)
It's best you don't make assumptions, Ubuntu Studio 18.04 was not a LTS or long-term-support release which was clear in it's release notes, and subsequent notices about getting extended support (that extended support to 3 years same as other Ubuntu LTS flavors). So read the release notes, which include details on upgrading from prior releases (I already provided the link for 18.04 LTS which contains instructions for "Upgrading from Ubuntu 16.04 LTS or 17.10"). Any problems detected, and rules the teams work by will be provided in those notes, and they can change over time so read the specific notes for your release (https://wiki.ubuntu.com/XenialXerus/ReleaseNotes for 16.04)
https://help.ubuntu.com/community/EOLUpgrades


How do I know which C Standard am I using?

Question: I am using Dev C++ for my C projects. I was asking few questions on Stackoverflow about my code and some answers suggests that I am using "old" function (in my case gets()) which is not supported anymore by C Standard. So my question is how do I know which C Standard am I using and on what it depends? If it is built in compiler ,what would be most practical compiler to use which is up to date?
Answer: There are multiple ways to do this and it depends on what compiler you're using. Let's assume you're on linux and using gcc. Run:
gcc -dM -E - < /dev/null

It will print out all compiler defined macros. Look for #define __STDC_VERSION__ 201112L


Is there a word or short phrase to describe a movie that wins many awards?

Question: Like "award reaper" or "award sweeper". I know they may not be correct so I need a right one.
Answer: Award-winning films
Google Books produces 1,130 results

Eighty prize-winning films of the 1930s are discussed in detail, with complete cast and technical credits, background notes, etc.
Howard has served as an executive producer as well on a number of award- winning films and television shows...
She is also an accomplished filmmaker who has made a series of award-winning films including Ellis Island (1981)

For award-winning movies, Google Books produces 896 results

These include such Broadway successes as Brigadoon (1947), Paint Your Wagon (1951), My Fair Lady (1956), and Camelot (1960), and the Academy-Award winning movies Gigi (1958) and My Fair Lady (1964)
Funny Girl and Meet the Packers; or by her genius as a composer in songs like the Academy Award-winning Evergreen; or by her screenwriting, directing and production skills in the multi-award winning movies, Yentl and Prince of Tides
Comment: To me, "award-winning" is the most idiomatic way to describe a movie that has actually won awards.  While "critically acclaimed" or "critically lauded" movies are certainly "good", those phrases mean something entirely different than "award-winning".  In fact, many times movies that critics love get snubbed by the authorities who are in charge of handing out the awards.
Answer: Critically Acclaimed

"That has received generally good reviews from a number of critics
  Although it was critically acclaimed, the album wasn't a commercial success."

Source
Comment: It's a useful phrase, but not really the same - if most critics have said universally positive things about a movie, it's "critically acclaimed" even if it never actually won a single award.
Answer: An award sweeper, though rare, isn't unheard-of. It should be understood.
You can refer to a movie as being critically lauded.
In a broader sense, the phrase critics' darling is used. But these may or may not imply awards.
Answer: The ugly construction multi-award winning (both with and without a second hyphen after "award") appears to be used quite widely. Google turns up many hits, such as this obituary of Harold Pinter or this press release from Qatar Airways.
Answer: The common phrase for a movie (or book or song or whatever) that has won one or more awards is "award-winning".
I can't think of any commonly-used phrase for a movie that has won many awards, as opposed to just one.
If a movie wins awards in many categories of a single competition, we say it "swept the awards". But I've never heard such a movie called an "award-sweeping movie" or using any other adjective phrase other than "award-winning".
Answer: Such a movie may be called a blockbuster.
https://en.wiktionary.org/wiki/blockbuster
Comment: Nah, this just means it made money.


Packaging a virtualenv

Question: I'd like to package a Python virtualenv with fpm, so that I can deploy it to my servers. I want to setup the virtualenv somewhere in my home directory without having to use root permissions, but deploy to e.g. /opt. virtualenv itself seems to have no destdir option. I know that there is a relocatable option, but it failed for some packages in the past and I don't trust it to work in all cases. Are there any other options, besides setting up a chroot for packaging or actually setting up the virtualenv in my local /opt directory?
Answer: Inspired by this build script I've been testing and using virtualenv-tools for serveral month now to relocate virtual environments and never had any problems. It is easily possible to relocate a virtualenv with e.g. virtualenv-tools --update-path /opt/my_project/virtualenv and package it with fpm afterwards.
Comment: virtualenv-tools seems not to be maintained anymore. If you are using python3 probably you'll need to use virtualenv-tools3
Answer: That is exactly what docker does.
fpm is good enough for packing the python instance and its third-party libraries. But if you want more customization like environment variables, it can't suit everything.
Comment: docker is absolutely great and you could surely ship a virtualenv with your dockerized application. In fact that would be best practice. But docker is not really a packaging system and it cannot be used in every case. So, this is not really answering my question.

Packaging a virtualenv


Jagged shadows with default settings

Question: This is what it looks like no matter the settings I use when I try to use shadows in Unity. Changing the Bias or the Normal Bias does effect the shadows, but I cannot get the shadows to be smooth with any settings. Making the model bigger does fix this, but I would optimally not scale the model up, as it is already at 10.
Comment: Do you want better shadow in realtime or baked?
Comment: Either would be good, but I think that realtime would be preferable.
Answer: So it seems like while changing the quality settings did increase the quality of the shadows it did not remove the artifacts, but when I was int he QualitySettings menu, I saw some settings that I had seen in other forums. Changing the shadow distance to a lower value increased the quality of the shadows and removed the artifacts. This also allows the use of soft shadows, but the bias then needs to be increased slightly to .005.
Comment: Thank you for this shadow distance remark. I was having the jagged edges problem, and it was indeed due to a very high shadow distance
Comment: Thanks , solves my problem.
Answer: Use hard shadow with very high shadow resolution. This will effect on editor as well as build.
Change quality settings levels for your intended platform. In shadow section hard shadow only and very high shadow resolution. May also increase anti aliasing in rendering section. These will effect on build quality.
Comment: This helped but did not solve the problem, thanks for the help though. I will post the answer below in a second.

Jagged shadows with default settings


Were the fabrials like soulcasters and regrowth casters made from hemalurgy by killing Radiants?

Question: Were the fabrials like soulcasters and regrowth casters made from hemalurgy by killing Radiants? I looked on the Coppermind and they say very little on the creation of the fabrials.
Comment: Could you please [edit] this to make it clear what the question here is?
Comment: -1  I think you should reread the books before trying to go deep into magic theory.
Answer: In Rhythm of War it is revealed that:

 Soulcasters and other ancient fabrials were actually Spren that have manifested themselves in the material realm, and that the new fabrials that Navani is making are unnatural and offensive to the Spren as she is trapping them against their will instead of asking for their help.
Comment: While this is correct, pretty sure this was actually covered in Oathbringer.
Comment: You might be right, I just remember Navani talking to The Sibling and his reluctance to help her in any way because of her work with Fabrials. I am just beginning another read through of Oathbringer, and will update this answer if I find it in there.
Answer: I don't think we have any real good reason to assume that fabrials were made by killing radiants, based on the books so far.
All the fabrials that we see being made involve enticing and then trapping a spren in a gem.  Metal is then typically used to activate and control the fabrial.
I don't see any reason to suspect that it's stolen from radiants with hemalurgy.
In particular, using hemalurgy on a Surgebinder is quite difficult according to Brandon.
(one example from the many in that search:)

Questioner
I was wondering if it is possible to steal Surgebinding with a Hemalurgic spike?
Brandon Sanderson
Yes, but if you're stealing it from a Radiant, you're going to be stealing the bond, which the spren has an influence over. So, it's maybe not going to work as well as you might hope.
source

It seems very unlikely that even the powerful ancient fabrials like soulcasters were made with this method, as stealing the powers from a Radiant is actually fairy hard to do with a hemalurgic spike.
One thing that we might not be able to rule out is that fabrial making involves hemalurgic spiking of spren in some way, to steal and use their powers.  That said, I don't think that really fits with what we've seen either.  Fabrials seem to utilize the power of a trapped spren, whereas hemalurgy typically involves killing to gain powers, instead of the trapping of a fabrial.  For that reason, I believe fabrials are more tied to the magic on Roshar than they are to any crossover with hemalurgy.
Comment: Not to say that fabrial makers like Navani never even heard about Scadrial, and Hemalurgy was a secret even there.
Comment: @Mithoron True, though to be fair Navani likely doesn't know much about the fabrials OP references anyways (like soulcasters); since those cannot be made by modern artifabrians AFAIK.  Even in the strange scenario where they are somehow connected, I wouldn't expect a conscious connection to hemalurgy.  At best I would think it would be more of a happy coincidence that they manage to take advantage of (assuming Intent could work like that, i.e. if they intend to use the sprens power without understanding hemalurgy it might still work).


Combining separate body and facial motion capture

Question: Hoping someone can help with this, i have a human generator rig which has a rigify - meta human rig for both body and face. I have a FBX Mocap file for the body and a TXT and WAV file for the face using Facecap.
I have been using Autorig Pro to retarget bones of the body rig and separately this works well, i also then have to create the shapekeys for the face in Faceit and this normally works on its own fine.
My issue is that the Human Generator comes in one piece so i have tried separating the head to do the duplicate workaround but it doesn't transfer over at the end and the duplicate leaves the body, plus when i add the body they don't work together.
we are new to animation and are struggling with this, we have even thought about iclone 7 but i want to know if there is a workaround in blender and what the process is.
Answer: I think it should work. You have to parent all the bones of the face rig to the head bone of the auto rig. That is if you want the face rig. But the shapekeys for the face should be animated separately because there are no bones involved there. Just copy/paste the keys to the body mesh in the timeline (be sure to keyframe on frame 1 at first so the f-curve is present).


Requesting references about recursive functions where the variables are continuous

Question: I have a recursive function that looks something like this. The variable x is a continuous variable. Do anyone have a reference that looks into a similar problem? $$f_i(y)=\min_{0\le x\le\overline{X_i}}\{f_{i-1}(y+B_i-x)+c_i(y+x)\}$$ The base case is $f_0(y)=0\quad\forall y\in[0,B]$.
Answer: If the intent is to optimize $f_N(y)$ for some fixed $N,$ it might be a form of dynamic programming.


Storing file content in DB

Question: I am making a model in which i have a FileField. I want to store the file content in a database column, instead of file path. Any suggestions?
Comment: Why do you want to do that? Files belong on the filesystem.
Comment: How much binary data do you expect to store in the database? There is a big difference between storing a few binary objects in the database when compared to storing thousands of large binary files.
Comment: Yes. What is the rationale of that decision? Why not store them on the FS?
Answer: Disregard the naysayers. If you want to have full control over your content, put the files in a blob field in the database.  I generally also keep the filename in a separate field, so I can reconstruct the file as necessary (that way you keep the extension, which ties it to a file type in most operating systems).
Be sure to store the actual blob data in a separate table, only connected to your filename / extra info table via an id ... that way you don't sacrifice any performance when dealing with any information related to the file other than the content itself.
What the naysayers fail to realize, is that databases are simply an extremely optimized form of file system.  Bytes are bytes and disc sectors are disc sectors.  Databases are simply much better at organizing and searching those bytes than file systems are.  Not to mention, databases implement much more stringent security than most file systems and are better maintained (with backups, support staff etc.).
Comment: i only want to store the filecontent in db column of a table ,not interested in wasting table for it.I can regain the file content again in same patern.
Comment: Thank you for a little reality check. I've always felt Django's default aversion to storing files in the database is overly simplistic. Even if you want to serve them from the database, you could always wrap your model with a caching layer, to have the best of both worlds.
Answer: I know this is an old question, but there's been some good code written since then to allow this option. Specially, see django-database-files, which will use Django's storage API to make all FileFields and ImageFields store their contents in the database. There's also a fork to cache the files locally on the filesystem, to overcome the biggest caveat of using the database, which is latency.
Answer: Well, how about simply storing it in a Binary column? You can then store collection of bytes. And if the filename is important to you as well, you can store that in an additional name column.
Answer: it is very easy
just overide save method in admin
filecontent=form.cleaned_data.get('upload_file')
data =filecontent.read()
from django.db import connection
cursor = connection.cursor()
cursor.execute("update filecontent set filecontent=(%s) where id=(%s)",[data,obj.id])
connection.connection.commit()
cursor.close()
connection.close()

this will store filecontent in db column filecontent of table filecontent
Comment: This won't work. The first binary file you try to save with non-ASCII characters will blow it up. You need to encode it first using base64, and then decode it when reading it out of the database.

Storing file content in DB