Does a two-handed thrown weapon have to be thrown with two hands?

Question: In the new Path of the Giant Barbarian subclass for 5e, a weapon you're holding while raging gains the thrown property with a 20/60 range. If I give that to my greatsword, do I have to throw the weapon with one hand or two? As a light follow up, if I have to use two hands to throw it, then does that support being able to throw a spear with two hands to get the versatile damage there?
Answer: Yes to the first, no to the second
The rules for weapons states:

Two-Handed. This weapon requires two hands when you attack with it.

A ranged attack is still an attack so this rule is not overwritten.
The rules also state:

Versatile. This weapon can be used with one or two hands. A damage value in parentheses appears with the property--the damage when the weapon is used with two hands to make a melee attack.

The last sentence clearly states that the damage increase only applies when making a melee attack. It won't apply to a ranged attack.
Comment: It's worth noting for the sake of realism that "requires two hands" doesn't necessarily mean you actually throw it with two hands. Chances are that when you throw a greatsword, you only hold it with one hand but you still need the other hand (and in fact your whole body) to execute the throw.
Comment: @biziclop: While you are correct that the second hand (arm, really) is involved in a Javelin throw, I would argue it's irrelevant here. The two-handed requirement is about _exclusivity_: you need to hold the weapon with two hands, thus cannot hold anything else with those hands. This is not the case when throwing a Javelin. You can perfectly hold a dagger in your other hand, as that hand is only used for balancing.
Comment: @biziclop True, but it depends on what you are throwing and how you are throwing it. Think of it as javelin throw vs. hammer throw in the olympics. You could toss a greatsword using either method in theory (well, not exactly javelin style since it would be hard to grab the centre of mass).
Comment: @MatthieuM. I would definitely not want to hold a dagger while throwing a javelin, accidentally stabbing yourself is not a great look. :)
Comment: Grabbing the centre of mass of a sword, especially a big, two-handed sword is pretty easy, half-swording was a common technique with them. But what I'm saying is, even in an olympic javelin throw you have to involve both hands.
Comment: @biziclop, I have to agree with MatthieuM. Two-handed means you need both hands on the object, not "two hands have a job to do". Pretty much any weapon would require "the other hand" for balance. A swordsperson does not stand still while swinging just one arm. It's the whole body.
Comment: @MivaScott Balance is not the issue here, the other hand does take an active role in generating the power, you can't do anything else with it. Unlike when you throw a knife for example. But this isn't really an important issue as it makes no mechanical difference, it's just easier to justify from an RP perspective.
Answer: It still needs two hands
Per the list of weapon properties:

Two-Handed. This weapon requires two hands when you attack with it.

And for completeness, here is the thrown property:

Thrown. If a weapon has the thrown property, you can throw the weapon to make a ranged attack. If the weapon is a melee weapon, you use the same ability modifier for that attack roll and damage roll that you would use for a melee attack with the weapon. For example, if you throw a handaxe, you use your Strength, but if you throw a dagger, you can use either your Strength or your Dexterity, since the dagger has the finesse property.

Nothing in the thrown property changes how the weapon is handled. In fact, it makes it clear that, if the weapon normally uses your Strength modifier when performing a melee attack, you still use your Strength modifier when you throw it. So adding thrown as a property does not change any attack principles other than, well, it can be thrown so there is a range.
And as highlighted, the two-handed property states that the character must use two hands when attacking. Throwing is still attacking and therefore still needs two hands.
I do not have access to the new Giant's book, but based on what you've said, nothing would change the properties of the greatsword, as in, it would lose the requirement of attacking with two hands.
For your follow up

Versatile. This weapon can be used with one or two hands. A damage value in parentheses appears with the property--the damage when the weapon is used with two hands to make a melee attack.

The spear already has the thrown property, and the versatile property. So absolutely nothing changes with regards to a spear. You could always use two hands, and you could always throw it. However, per the last line, it must be a melee attack so throwing is not on the table.
Comment: @ThomasMarkovisonStrike As I said in my other comment, the way I'd imagine it is that you throw with one hand in both cases, but in a "one-handed" throw you generate the power from the shoulder and your arm muscles, while a "two-handed" throw is more like in Olympic javelin throwing, holding your off hand out in front of you and twisting your upper body to maximise the force of the throw.
Comment: It may be worth observing that from a simulationist roleplaying perspective, throwing a spear with two hands is probably way worse than one hand in real life.
Comment: It's probably also worth mentioning, any weapon has the thrown property (20/60) if treated as an improvised weapon, although you would not add your proficiency bonus to the attack roll. This feature allows you to retain that bonus.


Safari stuck in infinite loop whilst testing - any way out?

Question: I'm hoping someone can help me out here - I'm testing some javascript and put an alert in a while loop to show how some variables were changing, but... I put it in the wrong line and now Safari (on a Mac) is just looping the alert.  Is there any way to stop it without force quitting the app (which I don't want to do as I've got other windows open).
Answer: I was able to close the tab by clicking "OK" on the alert (or pressing enter) and then immediately pressing Command-W. Note: It took several tries to get the timing just right.
Then, in my case, a confirmation alert popped up asking if I was sure I wanted to navigate away from the page. Then, the looping alert popped up on top. So, I positioned the looping alert on top of the confirmation alert so that the "OK" button of the looping alert was directly over the "OK" button of the confirmation alert. Then, I double-clicked (very fast) on the "OK" button (You might also try double-pressing enter.) to close both alerts.
Answer: Sorry, but no.  The only way around this would be if you could close the particular tab in between alerts, but if they are popping up immediately after closing the box, then there's nothing you can do.
Comment: That's what I thought.  Oh well!  And yes, the only thing in the loop is the alert, so it's pretty immediate.
Comment: Ok, no more replies and it's almost time to leave... will have to close it.  Thanks anyway!
Answer: I just had this happen to me on Safari 5.1 in OS X Lion. After a lot of Googling I was unable to find the answer. I did some digging around and found the solution:

Force Quit Safari
Open the directory ~/Library/Safari/Extensions
Delete your extension
Open Safari

I know this question was asked a long time ago, but it is the first result on Google for "Safari extension stuck in infinite loop" so I figured it was worth the update.
Answer: BTW, FireFox would automatically prompt you about repeated popups, and you could just say "no".  Why doesn't Safari do this?
I have tried numerous ways to stop this in Safari. The problem you discuss here is also a really stupid exploit by web pages, who use the pageUnload event to trap users with the dialog box.
You will have to force-quit.  However, hold Shift down when you open Safari again to prevent loading the last pages.  Or, repost/re-save your code so that when Safari loads the page, you don't have this problem in the first place.
In the future, don't use alart() to see this kind of information, just write it out to an empty div on your page.
In jQuery, do this in your looping code:
$('#testDiv').html('myVarA = ' + myVarA + ' myVarB = ' + myVarB + '
');  //write variables to test div.

or
 $('#testDiv').append('myVarA = ' + myVarA + ' myVarB = ' + myVarB + '
');  //append variables to test div, with a line break.

and add this to your page:

Test Results Here

By writing your variables out to a DIV, you can not only observe the variables, you will avoid the pop-up loop, and you will be able to interact with your dynamic page normally. Use "html" or "append" as needed.
Comment: Safari will detect when you force quit while re-opening tabs, and will offer to open a clean browser. It doesn't let you cherry-pick tabs though, unfortunately.
Answer: I just had the same problem.
I edited a file with an editor and connection to ftp. Then I opened a tab in safari and tested the file -> I was stuck in an infinite alert loop. So, what I did (this solution will of cause only work if the regarding file is online and not local)

Force quitting safari (safari settings must be put to remembering
tabs)
Than turn off WLAN connection
Open browser, close the "infinite-loop causing" tab, and quit safari again
Turn on WLAN, open browser, fin.
Comment: I think this is the most clever solution. I hit a malware site that put me in an infinite alert loop, but Safari had cached it so even shutting off my network wasn't enough. I trashed `~/Library/Caches/com.apple.Safari` before re-opening Safari, and then I was able to close the offending tab.
Answer: To add to my previous comments here are the results of the request.servervariable variable HTTP_USER_AGENT:
Chrome:
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Safari:
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2
You may notice the difference in the AppleWebkit that is being used.  Like I said, either Google had this problem and solved it or Apple let this bug creep in on a later version of it's browser. Need I say more?
Answer: Try this on Google Chrome.  They have the same browser engine as Safari.  If they had this problem, they must have solved it early on.  Why isn't somebody at Apple not communicating with Google to fix this?
The request.servervariable you need to look at in both browsers is HTTP_USER_AGENT
Answer: HALELUYAH I FEEL LIKE AN IDIOT. This happened to me as well. Quick fix: right click the alert box, move it to the top right corner and align the (x) button with that of the browser window. double click. it'll pop up one more time but pres (x) again and it'll close safari. Worked on Windows.
Answer: I just got stuck in an infinite loop in Safari 8 (Yosemite). Killing Safari didn't help as the tab would reopen when Safari was launched again.
Closed Safari, deleted ~/Library/Safari/LastSession.plist and started Safari again. No previous tab reopen, problem solved!


Alt text overlap for Top Network Askers with broken avatar

Question: When a user's avatar is not available, and they're listed in the Top Network Askers in the right sidebar of https://stackexchange.com/, the alt text of the avatar overlaps the username or site name in some browsers:

(left: Chrome, right: Firefox, both on macOS Catalina)
Comment: Well, tried to dig into it, the current design force a very small image, can't see a simple way to make room for alt text which isn't very short. I'm afraid this can be fixed only as part of a bigger design change of the page, or at least the Top Network Askers part of the page.
Comment: Related: [Ugly scrollbar shown on HNQ when user image can't be shown](https://meta.stackexchange.com/q/325242/232439)
Answer: We're not supposed to have alt text on the avatars. It causes all sorts of issues in all sorts of browsing configurations, because that's not what alt text is for. Specifically, we should have alt="" set on them. See the Web Accessibility Initiative guidance:

Decorative images don't add information to the content of a page. For example, the information provided by the image might already be given using adjacent text, or the image might be included to make the website more visually attractive.
In these cases, a null (empty) alt text should be provided (alt="") so that they can be ignored by assistive technologies, such as screen readers.

User profile pages, and the hover cards, are a different case: people sometimes discuss profile pictures, so it would be nice to be able to provide alt text for that case. But that would be a feature-request.
"wizzwizz4's user avatar" is not acceptable in any case.


Guest Payment Support in Embedded Payment Flow for Preapprovals

Question: We are currently redirecting our users to PayPal in order to accept a Preapproval (Adaptive Payments). There, the user can log in to PayPal or just enter his Credit Card information.
If instead of redirecting the user we use the 'embedded flow' (lightbox or new window), the user can login or signup only.
How to let the user insert their Credit Card info in the embedded flow?
Answer: If you are using Preapprovals with Adaptive Payments you can't use guest checkout, i.e. your users will need either to log-in with their Paypal account or to create one.
I know it sucks, but as far as I know there is no workaround.


Find process that created a file on windows

Question: Is there anyway to find what process created a specific file on windows?
Comment: Files persist. Processes don't. So the process may be long since dead.
Answer: In general, no. Windows does not record the process that created a given file.
You might be able to use something like SysInternals Process Monitor, which hooks file (and registry I/O), to see if you can catch the file being created, but once it's created (and the last file handle is closed), Windows forgets which process it came from.
If the file is open in a process that's currently running, you can use Process Explorer (also from SysInternals) to find out which one.
If you recognise the file extension, that can sometimes help. Or, maybe you can look in the file to see if there's anything obvious in it.
Answer: All you can do is find a match between file type and associated application on mimetypes. But even then it will only be a guess because file types can be associated to several different applications.
Another not-so-successful method will be opening the file in question and searching the header for known application names. Sometimes the app name or token can be found here, but then you need to start with a list of name strings to search for.
Answer: Trying running File Activity Watch by NirSoft if you think it or a file like it might pop up again.


Can homomorphic operations on many different ciphertexts be multiplied by a same constant?

Question: Assume Alice encrypts messages $m_1$,...,$m_n$ using secret keys $k_1$,...,$k_n$ on a homomorphic encryption scheme (BHHO), so she would get $c_1=Enc_{k_1}(m_1)$,...,$c_n=Enc_{k_n}(m_n)$. Then Alice sends a constant a , some random numbers $a_1$,...,$a_n$ and these ciphertexts to Bob. Can Bob do the following homomorphic operations? (The homomorphic encryption scheme requires that the ciphertext is multiplied by a random number)
$$d_1=Enc_{k_1}(m_1)*{a_1}*a=Enc_{k_1}(m_1*{a_1}*a)$$
...
$$d_n=Enc_{k_n}(m_n)*{a_n}*a=Enc_{k_n}(m_n*{a_n}*a)$$
Comment: What kind of homomorphic cryptosystem are we talking? Something like Paillier?
Comment: Yes.  It likes Paillier.
Comment: BHHO (Crypto 2008)
Answer: Yes. Additive homomorphic encryption can also be used to obtain multiplication by a scalar. The way that this is done is by repeated addition, in exactly the same way as you do efficient exponentiation.
Recursively, define:

If $a$ equals 1 then $mult(a,Enc_k(m)) = Enc_k(m)$
If $a$ is even then $mult(a,Enc_k(m)) =
   mult\left(\frac{a}{2},Enc_k(m)\right)+mult\left(\frac{a}{2},Enc_k(m)\right)$
If $a$ is odd then $mult(a,Enc_k(m)) =
   mult\left(\frac{a-1}{2},Enc_k(m)\right)+mult\left(\frac{a-1}{2},Enc_k(m)\right)+Enc_k(m)$

Thus, you only need addition.
Comment: The ciphertext is multiplied by a random matrix(not a random number) on BHHO homomorphic encryption scheme(i.e. a additive homomorphic encryption).If we have a lot of ciphertexts, which need to be done homomorphic operations, can all the ciphertexts be multiplied by the same random matrix?
Comment: It's the same thing. To multiply by a matrix, you multiply by scalars and then add.


How to solve the pinching in this concave geometry?

Question: I have been trying to solve this type of geometry (a smooth "rounded" mesh with a concave edge at the top - as shown in the image). Any suggestions on resolving this, without getting the bulge at the side of the edge?
Comment: Experiment with Edge Crease (Shift+E) that controls how closely subsurf modified surfaces follow edge corners.
Comment: You can use guide mesh as described here: https://blender.stackexchange.com/questions/96342/how-to-save-curve-shape-of-cylinder-with-such-deform/96344#96344
Comment: This seems like something that should have been solved by now. It seems all the "solutions" still have drawbacks. There are literally hundreds of this same question all over the internet. I think the default behavior should be a nice curve that follows the rest of the topology. And if you want the "pinched" look, you should have to specify so. I can't think of many scenarios where anyone would want to have an out of place pinch bulging out of their nice curve.
Answer: As suggested in the comments, you can use a 'guide mesh' that the vertices of your object can snap to. The guide mesh is a simplified version of your object that describes the curvature that your original object should take. This works because some close-together edge loops not conforming to the curvature of the overall surface, creating a pinching effect. A guide mesh will force all vertices to perfectly match a surface.
I have created a guide mesh by adding a plane with a few subdivisions with a Simple Deform modifier set to 'bend' on it. You don't need to use a Simple Deform modifier, I just did this to get a perfect curved plane. It also has a Subsurf modifier before it to give the Simple Deform modifier more geometry to work with, meaning a smoother bend:

I then add a Shrinkwrap modifier to your original object and choose the simplified object I just made as the 'Target':

This does improve the result - the original object is now being clamped to the smooth, simplified object, however, we can improve the result by improving the topology of your original mesh.
Here we see some improved topology:

The further apart, or more evenly, your edge loops are placed the smoother your mesh will be, however, you obviously need some edge loops to be close together to create that sharp corner. The green markings in the image show that the edges near the bottom have been spread out whilst the red ones at the top have remained close. The orange markings show edges that have been partially spread out so that the change is more gradual. This gives us the best of both worlds, close edge loops where needed, but spread out where not.
I used the add-on 'LoopTools' add-on (which comes with Blender) as it has a 'Space' option (W> 'LoopTools'> 'Space') to evenly space out selected edges. On some edges I reduced the space 'Influence' in the 'Toolshelf' so they were only partially spread out.
This gives us this result:

You will notice some slight creasing still where that 'diamond' face is on the other sharpened corner, so you could use the same technique of spreading edge loops on this part of the mesh too instead of the 'diamond' technique.
Now, obviously, this was done on a flat mesh, whereas your mesh has some thickness to it. The solution to this is to either:

Add a Solidify modifier after the Subsurf modifier.
Use a second simplified object for the inside part of the mesh and use vertex groups to assign which modifier should effect which vertices.
Apply the Shrinkwrap modifier and extrude normally.
Comment: I was hoping for a "conventional" modeling way. (clever placement of proximity loops or something) Was hoping shrinkwrap was not needed. PS congrats on 20K rep.
Comment: @David Thanks. The re-positioning of the loops could be all that's needed if you want to spend a bit of time manually matching the loops to the curvature, the Shrinkwrap just automates that part. Personally, the *Shrinkwrap* modifer has *become* my conventional way of working because I don't think there's a better way.
Comment: @RayMairlot I've learned this method a while ago and I'm pretty sure it was from your blog, am I right? With Iron Man armor? I'm using it like crazy from that day :)
Comment: @LukeD Yes, that was my blog post. Glad to hear it was useful.


How to turn on and turn off double-right-click on Google Maps v3

Question: When you double-right-click, the map will zoom in.
How do I turn this off/on. Same goes for double-left-click.
Answer: To disable in v3, pass disableDoubleClickZoom : true in the MapOptions
refer to: https://developers.google.com/maps/documentation/javascript/reference#MapOptions
Answer: According to the API reference, there is no "right double click" event defined. There is a "rightclick", a standard (left) "click", and a (left) "dblclick". What is it you're trying to do?
Answer: Appears to have been removed from v3.. here it is mentioned in v2
http://code.google.com/apis/maps/documentation/javascript/v2/reference.html
singlerightclick(point:GPoint, src:Element, overlay?:GOverlay)
This event is fired when the DOM contextmenu event is fired on the map container. If the right click was on a marker or other clickable overlay, then the overlay is passed to the event handler in the overlay argument. The pixel coordinates (in the DOM element that holds the map) of the point that was right clicked and the source element of the DOM event are passed in the point and src arguments respectively. Note that if it is a double right click and double click to zoom is enabled, then the map zooms out and no singlerightclick event is fired. If, however, double click to zoom is disabled, two singlerightclick events will be fired.


Equation of a line

Question: I've been practising some past previous exam question and came across this:
How would you find the equation of the line with y-intercept? -$\frac{3}{4}$ and slope -$\frac{1}{2}$?
Comment: I love the tags
Answer: So long as the line isn't parallel with the $y$-axis, a general equation for a line is as follows:
$$y = mx + b$$
where $m$ is the slope and $b$ the $y$-intercept.
Answer: Draw the following lines: $2x+3, -\frac{1}{2}x+2,3x-5$
From their graphs find their y-intercepts, and slopes.
Try to notice a relationship between the slopes, intercept and the equation of the line
Try to explain this relationship (prove it)
If you find difficulties explaining/proving this relationship, please make another post about what you attempted to prove/explain and I will help.
Answer: If you're finding this problem tricky it might be easier to draw a small sketch. If you have no squared paper you can draw eight or ten squares onto blank paper yourself.
If the line crosses the y axis at -3/4 you already have the equation for x = 0, your first point, and if you use the squares to carefully draw a short section of slope with the angle that's indicated in the problem, you'll get a visual intuition and a better sense for the problem before diving straight into the general terms for a solution. Then mark yourself a second point somewhere helpful and simple like x = 1 or x = 2, and only then go back into the algebra to bring it together.
Answer: $$y=mx+b\text{ for a non-vertical straight line. Here,}\\
\text{$b$ is the $y$-intercept, and $m$ is the slope. Hence, the equation is:}\\
\boxed{y=-\dfrac{1}{2}x-\dfrac{3}{4}}$$

Equation of a line


Inexplicable change of email address

Question: I found an email in my sent mailbox which had gone to a completely different and unrelated address from the one I'd entered by tapping the reply button on the original email I was answering  I hadn't gone anywhere near my address book so the change of the intended address is absolutely inexplicable.  Is there a bug that does that?  I'm using the Apple Mail application on a new Macbook Pro with Yosemite.
Comment: Did you check the reply-to address on the incoming mail? It doesn't have to be the same as the sender's address
Answer: This is probably connected with a "reply to"-address provided with the email you received. For example, many companies use this when sending automatic generated e-mail from an address that doesn't receive e-mails. When you reply to such mail, your application checks if there is a "reply to"-address provided in the message's head, and if it is, it will choose that for your reply over the senders address. If your mail was not from a company but from a friend, this could be a bug or mistake in his mail application, maybe he provided such a reply-to-address to. Some applications do this when a feature to collect all mail in a single inbox is chosen. If none of these apply, you should check the authenticity of the sender's address, and maybe talk to him on the mail you received, as this could also be a sign of spam messages.

Inexplicable change of email address


Tensor operations on sheaves

Question: I am doing the exercise a) II.5.16 on the tensor operations on sheaves from Hartshorne. This exercise asks the reader to prove that, if $\mathscr{F}$ is locally free of rank n, then $T^r( \mathscr{F})$,$S^r(\mathscr{F})$, and $\bigwedge^r(\mathscr{F})$ are also locally free, of ranks $n^r$,$C^{n-1}_{n+r-1}$, and $C^n_r$ respectively. Here is my attempt trying to show that $T^r(\mathscr{F})$ is locally free of rank $n^r$. But I do not know how to proceed:
Since $T^r(\mathscr{F})$ is the sheafification of the presheaf $\mathscr{P}$ sending $U$ to
$$\mathscr{F}(U)\otimes_{\mathscr{O}_{X}(U)}\cdots\otimes_{\mathscr{O}_{X}(U)}\mathscr{F}(U)$$
They should share the same stalk at $x\in X$. And because $\mathscr{F}|_U\cong \mathscr{O}_U^{\oplus n}$ and, taking stalk is a left adjoint funcor hence commutes with colimits, we have
$$\mathscr{F}_x\cong \bigoplus_r \mathscr{O}_{X,x}$$
Hence, if we consider $\mathscr{P}_x$, as tensor commutes with taking stalks, we would have
$$\mathscr{P}_x\cong T^r(\mathscr{F})_x\cong\bigoplus_{n^r}\mathscr{O}_{X,x}$$
Now I wish to lift it as in exercise II.5.7. Even though in this exercise, $\mathscr{F}$ is locally free of finite rank, hence is coherent. However, in 5.7 $X$ is noetherian while we do not have that condition here. I think this approach is not really working and, unfortunately this exercise seems to be considered trivial in many places so I cannot find a proper proof.
Any help is appreciated! Thanks in advance.
Comment: The simplest approach here is using the internal logic of sheaves (though this requires some background knowledge). These statements are just internalisations of the corresponding statements for free modules of rank $n$, all of which can be proved purely constructively.
Comment: @Mizutsuki -- the most accessible reference is almost certainly [Ingo Blechschmidt's PhD thesis](https://rawgit.com/iblech/internal-methods/master/notes.pdf)
Comment: @MarkSaving This sounds interesting, but do you mind giving some references?
Answer: If $\mathscr{F} \cong \mathcal{O}_X^{\oplus n}$ is free, then the presheaf $\mathscr{P} \cong \mathcal{O}_X^{\oplus n^r}$ is also free, and hence is already a sheaf. For $U \subset X$ open, $$T^r(\mathscr{F})|_{U} = T^r(\mathscr{F}|_{U}),$$ so the result follows.
EDIT: I'll elaborate a bit on the isomorphism $\mathscr{P} \cong \mathcal{O}_X^{\oplus n^r}$. Let $e_1, \dots, e_n$ be a basis for $\mathscr{F}(X)$, so that $e_{i_1} \otimes \cdots \otimes e_{i_r}$ form a basis for $\mathscr{P}(X)$. These global sections define an isomorphism $\mathcal{O}_X^{\oplus n^r} \to \mathscr{P}$, because for $U \subset X$, $$e_{i_1}|_U \otimes \cdots \otimes e_{i_r}|_{U} = (e_{i_1} \otimes \cdots \otimes e_{i_r})|_{U}$$ form a basis for $\mathscr{P}(U)$. Indeed, $e_i|_{U}$ form a basis for $\mathscr{F}(U)$.
Comment: Waow, thanks for this detailed answer. This exercise does not really seem so trivial to me. I think here we are using many claims, for example restriction commutes with sheafification, tensor commutes with restriction. Again, thanks a lot!
Comment: @Mizutsuki No problem! I agree; I think you pointed out the main gaps. There may be an easier way to do this, as Mark Saving suggested, but I felt that this was more consistent with the material in Hartshorne.

Tensor operations on sheaves


one computer, multiple iphones, multiple apple IDs

Question: We have 2 iphones and 2 ipod touches and 3 separate apple logins.  We manage all accounts on one computer by using multiple computer user logins.  Note:  this is how apple told us to set it up in the beginning when we had 2 iphones because it was over-riding one set of iphone contacts and mirroring both iphones the same.  So, we've been purchasing everything twice (or 3 times in some cases).  We want to share music, apps, etc but how?  Home sharing is turned on...I even asked an apple "genius" and he had no idea how to share content with multiple apple logins but all managed on one computer.  Any help would be appreciated!
Answer: Sharing apps is actually pretty easy.
On your iDevice, just go to Settings > Store and sign into the account you want to download purchased apps from, and then when you go to install them, it will act like it's going to purchase them again, start to download, and then pop up a dialog saying you've already purchased this app, click OK to download again for Free.
I do this on a weekly basis with 2 other accounts and have been doing it for over a year so I know it works.  Even on iOS 5.0.
Just be careful to switch to the right accounts when you make your purchases.  Since it does not necessarily say that you have already purchased the app, you could look up the wrong app (a HD universal version instead of the normal version, for instance) and end up purchasing it by mistake.
Finally, note that you could sign into your alternate Store account, then go to App Store >  Updates > Purchased and see a list of what's available for download on that account, BUT NOTICE that this will LOCK your device to THAT account's past Purchases for the next 90 days!
See: http://support.apple.com/kb/HT4627
"When you turn on Automatic Downloads or download past purchases on an iOS device or computer, your device or computer will be associated with your Apple ID. Your Apple ID can have up to 10 devices and computers (combined) associated with it. Each computer must also be authorized using the same Apple ID. Once a device or computer is associated with your Apple ID, you cannot associate that device or computer with another Apple ID for 90 days."
Comment: I should add that you will encounter problems with iCloud (difficult to predict) if you mix some devices with iOS 5.x and some older devices that can only run iOS 4.2.1. I have encountered this myself. For instance, I can't use iCloud for contact and address book synchronization on my iOS 5.1 device because for some reason it prevents my iOS 4.2.1 device (which can't use iCloud) from syncing address book contacts with my Mac (both devices have the same Apple login account).


How can I promote software reuse in a large company?

Question: Take a large company, formed through many iterations of mergers and reorganizations. This company produces lots of different products that are all targeted to a specific industry. Most products share similar characteristics, such as communication standards and certification and safety requirements. But there is no unified development platform or model for the company. Each product has its own distinct hardware, and software is created in any number of languages. Most new products will be updates to older versions or target the same industry. What strategies would you use to promote software reuse?
Comment: I think you ought to read the TDWTF article: [Patterns of Failure](http://thedailywtf.com/Articles/Patterns-of-Failure.aspx) - it sounds like you _might_ be trying to take this company in the wrong direction. Right now it could be perfectly alright that it's like this.
Comment: I'm afraid you are confusing product strategy (or company strategy) with software development strategy. While it is true that both could be done wrong, and both have the potential to bring down a giant megacorp, each must be addressed at a different level.
Comment: To follow on what actually happened, a software repository was created. Teams were encouraged to add code and documentation for future reuse. There was not much adoption because 1) software not written in a reusable way, 2) no reward/motivation to put software in repository, and 3) software was not general enough to be reused in other projects.
Answer: Given your constraints, I'm not sure software reuse is even a good idea.  The teams for your individual products are already intimately familiar with the particular tools and platforms for each specific product, so reinventing them to promote code reuse may be a waste of time and money.
Any reworking of this kind would most certainly involve corporate strategy.  You would have to make a compelling case that the restructuring would save time and resources, improve efficiencies, and make the company more profitable.
A simpler approach: If you come out with any new products, you could try reusing pieces of your most successful platform.
Comment: The main lesson I learned from this exercise is that you have to plan and design for reuse from day 1. It's hard to retroactively reuse. I think your idea is a good one. Use a successful platform/project core as the building block. I wonder if an Arduino-type model (albeit on a much more complicated scale) might work.
Answer: I think you need to consider a large company to be for all practical purposes a wild software ecosystem; maybe not so heterogeneous as the entire world but still you'll have to expect that tool and software practices are pretty well diffused.
So the question of how to promote code re-use in the company is not different from promoting it with the world. I am advocating, an essentially open source approach to development of commonly useful components. Let us know if you ever get it to work.
Answer: A few years ago I actually was able to start a team that did this within the organization I was working for at the time. It was a great experience and I'd do it again in a heart-beat. The most difficult people to sell on the idea were the other developers, not the management. I had a good reputation with the different development groups so that was very helpful and we were very careful to keep that reputation as our team grew. By the time I left the company the project had been alive for two years and had around 8 full time developers.
Advise I could pass on:

Have a team that is responsible for nothing other than this
Get your requirements from representatives of each development group so that they have buy-in
Start with something that developers on a couple teams already want to share
Document you code as well as you would expect a language to be documented
Comment: some other points: choose architecture carefully; choose members who have the experience and "almost already know" the right patterns for the project; help the other teams do part of the integration (at least as a showcase, if not for production use); manage expectations; communicate the benefits and risks clearly; respond to defect reports as fast as possible. However, at the later stage of the project, where most teams have already bought-in or finished integration, a hard line has to be drawn to push the remaining teams for adoption.
Comment: @rwong great points.
Answer: The problem with code reuse is that code needs to evolve differently in different products.
Say that you have two products (1 and 2) that have some similar characteristics, and you then extract a library (L) out of them that contains those shared characteristics. Seems like a good idea: you now just improve the library, and the improvements go "automagically" to both products.
Then, over time, you build more products on top of that library. Eventually you have 10 products. You'll notice that changing the library has become an extremely stiff process. You have to consider all those 10 products when implementing a change, and after you've implemented it, you have to test it on all those products. What if some of the products now need to evolve differently, even though they were kind of similar in the start? You could either branch the library so that different products have their own versions of the library (no more sharing advantage), or start building all kind of switches, options, adapter layers and special cases to accommodate for all special needs in the single united codebase. The end resuld could be  a Big ball of mud.
It may be doable, but it's not as rosy as one might hope. At least it increases risk.
Comment: an alternative would be to go with reusable components instead of a monolithic library. But good point about the risk of monolithic "not-so-reusable" libraries :)
Answer: Don't look for the big revolution - look for small but cumulative evolutionary steps. Look for the opportunities where some positive change is relatively easy.
Don't push the idea so hard you're seen as a crank.
Answer: The best way to make software reusable is to make it visible and understandable.

If nobody knows it exists, nobody will use it.
If nobody can figure out how to use it, nobody will use it.

For developers this means making good documentation and usecases.  I'll discuss Java since that is what I know the best:
Use JavaDoc:  This allows for creating cross-referenced API documentation where the skeleton is created automatically and you have well-defined places for putting in HTML-snippets in your code which will then end up in the web documentation.  See the official Java documentation for a good example.  In my opinion this is some of the best code based documentation available today.
Put the JavaDoc in a searchable place:  For people to be able to find it you need to make it public.  Have an internal web server where all documentation go to, probably subclassed by project.  In a perfect world have a SINGLE web site incorporating ALL classes developed inhouse.
Make it easy to get:  Have a location link from which it is extremely simple to pull out the source code (or the library).  Eclipse has some mechanics for doing so.  Preferably the source from a source repository, as the source repository can TELL who has worked on a given piece of code, giving a good idea of who to talk to in case that you need assistance with that code.
Have good usage examples: The easiest way to show how to use it, is with good unit tests, as they demonstrate how to use the code, and what to expect back.  Being runnable they can verify that the code runs as described.
Answer:
become the CIO
promote software reuse
profit!
Comment: Such a simple solution!!
Comment: Simple but hardly helpful...
Comment: @Walter: Reality check. Changing the behavior of a large company must come from the top.
Comment: Understood.  The hardly helpful part is #1, become the CIO.
Comment: @Walter: (a) it's a joke, (b) step 1 emphasises the often nearly futile effort of trying to change the behavior of a large company from the bottom


Relation between reflection (coefficient) and bandwidth

Question: I am reading into single stage microwave amplifiers and how to design for a specific gain (source 1, source 2 warning PDFs!). In both sources the claim is made that the highest bandwidth is achieved with the smallest reflection magnitude. But why? What is the relation between the magnitude of the reflection coefficient and the bandwidth? I believe I have seen this claim before for matching networks in general, and not just limited to the context of microwave amplifier.
Answer: As your signal propagates through the transmission line, when it hits a discontinuity, it will reflect and start heading back. If you have multiple branches in your transmission line, each time you come to one of those intersection, you'll have part of the signal travelling in each of those branches and then back (if the branches are not terminated properly).
A signal travels at a finite speed, and if you have a fast frequency signal, it may change faster than the signal can propagate through the line. So now you have your signal interfering with its past self (reflections) which will then distort your signal.
By minimizing your reflections, you minimize the amount of interaction between the reflected signal and the incident. This then decreases your ISI (inter symbol interference), which allows for more data to pass through without issues and therefore a higher bandwidth.
Answer: Here's an intuitive way to look at it. Smaller reflection coefficient can mean less reactance, or lower Q. Less reactance means less frequency dependence and lower Q generally leads to higher bandwidth.
Keep in mind, this is not a hard rule. It is possible you might end up with more bandwidth by matching to a gain circle point further from the center of the smith chart. It really depends on your specific matching topology. Your lecture mentions this by saying, you need to test it to know for sure.


I am trying to get the 800.00 frequencies on a Baofeng UV-5R

Question: I am trying to use my Baofeng radio as a police scanner and all the frequencies are in the 800.000 frequencies. Example: I am putting 851.1500 into the "scanner", but the Baofeng radio is not accepting it.
Comment: What are *"the 800.000 frequencies"*? Frequencies in the range 800 kHz to 900 kHz? Or in the range 800 MHz to 900 MHz? Or something else?
Comment: @PeterMortensen MHz, certainly. That's how frequencies are entered on the UV-5R, and 800MHz is a public-safety band in the US (well, the parts of it that haven't been given over to cell phones).
Answer: It doesn't do that. Depending on the revision of UV-5R you have, the highest receive frequency is either 470 MHz or 520 MHz. Either way it doesn't go up to 800.


What is the most efficient way to mock a user flow in a RESTful application?

Question: How can I communicate in a very simple and effective way the path the user takes through my application?
I'm currently working in a Ruby and Rails environment, so I tend to visualize my application in terms of RESTful URIs. So for example, if I want my users to sign up, I could match a new route called /users/new. The thing is, I would like to see beyond that specific action, and visualize how many pages or forms does it take to create an account and some business logic associated with the process in general. In other words, I'd like to see a mix of a workflow diagram and some implementation details (at an interface level).
I was thinking in showing mockup pictures wrapped in boxes, and relate them through arrows with their corresponding GET, POST, PUT, DELETE methods and URIs attached to them. I think it is a good idea, but I haven't seen examples yet that inspire me.
In your experience, what helps you see the big picture? Balsamiq mockups allow to define links and navigate through the app, but it doesn't help to conceptualize.
Answer: Have you thought of using a mind-map?  You could try the free FreeMind
If you stick with UML, you could consider an Activity diagram.
Answer: I think you're on the right path. Showing different screens with possible combinations of users' transactions between them is a good technique. Basically you would be able to show user's flow through your application and stress out decisions a user will make on the way.
The good example for it was presented here http://vimeo.com/43869717
This technique called Storyboarding. You should be able to find some examples. But the one I mentioned above is one of the best Storyboarding techniques. I use it all the time to show the big picture and present application workflow from user perspective to my team.


Small derivative and the measure of a set.

Question: Suppose that $f:\mathbb{R}\to\mathbb{R}$ is a differentiable function, and that on some interval $(a,b)$, $|f'|\leq1$.  Is it true that for all measurable sets $E\subset(a,b)$, $\lambda(f(E))\leq\lambda(E)$?  (Here $\lambda$ denotes Lebesgue measure.)  The intuition is that a small derivative means that $f$ is "shrinking sets" in some sense.
Comment: Since $E\subset\mathbb{R}$ is measurable, we can suppose that for any given $\epsilon > 0$,  $E\subset U_\epsilon$ for some open set $U_\epsilon$ such that $\lambda(U_\epsilon \setminus E) < \epsilon$. While we can write $U_\epsilon$ as a disjoint union of open intervals,  $$U_\epsilon = \bigcup_{n=1}^\infty I_n$$
therefore,
$$\lambda\big( f(E) \big) \leq \lambda(U_\epsilon) \leq \sum_{n=1}^\infty \lambda\big( f(I_n) \big) \leq \sum_{n=1}^\infty \lambda (I_n) = \lambda(U_\epsilon) $$
(f is Lip-conti) Then $\lambda\big( f(E) \big)\leq \lambda(E) + \epsilon$. But $\epsilon > 0$ is arbitrary.
Comment: @Chival: It might be good to post your comment as answer.
Comment: The answer is yes, but I can't write a detailed explanation right now. You can probably find a writeup if you look up something like "Lipschitz functions are absolutely continuous", or perhaps "Lipschitz functions have the Lusin N property".
Comment: Thanks @Chival, A little too long since measure theory for me I guess.
Answer: I don't remember much about neasure theory. This is a proof when $E$ is a closed interval. It should be helpful, together with Chival's solution, that assumes this one proved.
So, let $E=[c,d]\subset(a,b)$. Since $f$ is differentiable, it is also continuous. Weierstrass' extreme value theroem says that $f$ obtains its maximum $M$ and its minimum $m$ on $[c,d]$. Say, $f(r)=M$ and $f(s)=m$, where $r$ and $s$ are in $[c,d]$. Continuity also guarantees that $f$ reaches every point in $[m,M]$.
Then, $\lambda(f(E))=M-m$ and mean value theroem says that there exists some $t\in[c,d]$ such that $f'(t)(r-s)=M-m$. Therefore
$$\lambda(f(E))=|f'(t)|\cdot|r-s|\le1\cdot|d-c|=\lambda(E)$$
Comment: Thanks for the special case of a closed interval, interesting to see the application of the MVT.  It looks like Chival's comment covers the general case.
Answer: Yes, the (absolute value/ norm) Jacobian , here the derivative gives you a measure of the scaling, or change of volume  of sets resulting from a transformation. Since ||J(f)||=|f'(x)|<1 , the sets are non-expanding.


Data preprocessing

Question: I just want to know how to determine whether to remove the missing values or to impute them with mean , median or mode. I usually remove the missing values but it decreases the size of the dataset by more than 50%. So can anyone guide me in this regard. I am new in this feild.
Answer:
Ignoring a tuple is effective when it contains several attributes (>50%) with missing value OR the value of target variable (class label) is missing.
In other cases, you can either impute them with mean, median or mode, OR you can fill them with most probable values (using interpolation or regression).
Answer: Target column:

If you have missing data in target column, then it's better to remove those rows.

Numeric column:

Usually it is good to impute missing data with the median data when the column is numeric.
If the data is numeric in nature and the data is missing, then try to plot the distplot and see if the data is normally distributed or not. Now, if your data is normally distributed then you can use either mean or median as they will most probably will have very close vale.

Categorical column:

Or you can impute the missing numeric values with the values like -999 and treat them like outliers and you either remove those outliers or use some transformation over it.
Lastly, if your data is categorical in nature, then you can replace the missing values with values like -999. And then based on your data (whether it's ordinal or not) you can choose to either use one hot encoding or labelencoder.
Also, for categorical data, you can impute the values with the mode value as well.
Answer: You should determine if the attribute is Missing at Random (MAR), Missing Completely at Random (MCAR), or Missing Not at Random.
For each of these categories there are recommendations when and how to impute.
But how to classify attributes in your dataset as MAR,MCAR,MNAR?
By doing EDA, e.g., studying the statistical distribution of the attribute values.
It is best to read modern academic literature about this topic (I cannot explain it properly and in full here).
You can also ask ChatGPT or any other LLM, e.g., with this prompt:how to determine if an attribute is Missing at random , Missing not at Random, Missing completely at random?

...It's important to note that determining whether missing data is MCAR, MAR, or MNAR is often difficult and requires careful consideration of the data and the research question. ...

Data preprocessing


Is it possible to move Steamwork Common Redistributables to external library?

Question: I have 2 computers that both of have Steam installed.
I am using an external HDD for a game library to make it easier.
Can I move Steamwork Common Redistributables like other games, so I don't need to update it twice every time there is new update?
Answer: Of course. This will only work if both require the same installers that support the same platform and bitness though, e.g. Windows 64-bit.
They are in Your Steam Library/steamapps/common/Steamworks\ Shared/_CommonRedist in folders by name (e.g. DirectX, DotNet, PhysX), but this includes Common Redistributables for all your installed apps, not just what you've downloaded recently.
If you want to look for the specific ones required for an app open the appinfo_#.acf, where # is the unique Steam appid for the given app, in the steamapps folder. Look inside for a SharedDepots list like the following from Payday 2:
        "228982"        "228980"
        "228985"        "228980"
        "228986"        "228980"
        "228990"        "228980"
        "229031"        "228980"

The number 228980 is the "appid" of Steamworks Common Redistributables, and the numbers on the left are the Depot IDs for specific common redistributable installers. Depots are "... a logical grouping of files which are all delivered to a customer as a single group." (from Steamworks documentation).
The depots attached to Steamworks Common Redist, and any other app, can be viewed on SteamDB by going to the depots page, and generally include a unique human-friendly name. In this example the SteamDB page says exactly which installer is downloaded for each depot, and they're all easily found in the local folder.


How to decode traffic on a LAN whose SSL certificates are expired

Question: We have a campus Wi-Fi at my university and we authenticate through a log in page which to me seems like we are using a RADIUS server.
Every time the page loads my browser warns me that the certificate(s) being used are expired/not valid.
Is there any way to capturer the authentication data (login and password) off the network and decode it since the SSL certificate(s) is expired?
Comment: If you're asking so you can have a go, just remember not to start bragging about it to others.
Comment: not at all...i just want to know how. so many other flaws i figured on the network but i cant tell fellow students they might use it for bad. @haneefmubarak
Answer: The expired certificate itself wouldn't really allow you to decrypt the data, but it does open up a major "vulnerability", albeit it's more of a social one - most users are now accustomed to ignoring certificate warnings from their browsers.  Thus, if you perform a man-in-the-middle attack most users will probably click straight through the certificate warning, allowing you to capture their data.  They probably won't notice that the warning is slightly different from previous ones or that the certificate is different.
Answer: An SSL certificate expiring does not by itself change anything about the security of the connection. The purpose of an SSL certificate is to give a client two things: some form of public key to verify that the owner of that certificate sent a certain message, and some information to prove that the owner of the certificate is a legitimate server for a particular domain. The only way to passively intercept SSL traffic is to compromise the first part by somehow obtaining the server's private key (and even that only works for some cases). If that's not compromised (or sometimes even if it is), you can't passively listen in; that's simply not how the cryptography works.
More likely is a man-in-the-middle attack, in which you impersonate the real server. This is harder to pull off in the first place because you need to be able to get the client to talk to you instead of the real server (but not impossible; for instance, you could run your own access point). Once you are pretending to be the real server, you need a certificate: either the real one, or a different one. Using the real one requires compromising the server's private key; using your own requires getting your own legitimate certificate (not gonna happen) or getting the client to ignore a security warning.
All the expiration date does is protect against the first option: it's hard to protect a private key for all eternity, so it shouldn't be trusted at some point; there has to be a defined (but somewhat arbitrary) cutoff between "good enough" and "not good enough"; the expiration is that cutoff. The certificate itself is mostly as secure the day after it expired as it was the day before, though; even though it expired, you're highly unlikely to compromise it (stealing the private key is no easier after expiration, and the certificate expires before people think governments will be able to recover the private key from the public key via massive computing power; you don't really have a chance for a fair bit after it expires). Really, the expiration date is just "there must be a line somewhere".
(edit: Matt Nordhoff notes in the comments that the system used to publicly declare that a certificate is compromised doesn't do anything for expired certificates; with an unexpired certificate the owner could revoke it on detection of a compromise, while that's not possible for expired certificates. Instead, the owner would have to replace the certificate and get everyone to pay attention to the "expired certificate" warning, after having previously told them to ignore it. This compromise still requires compromising the private key [which is still no easier than before], but it means the main tool to deal with a compromise won't deal with this compromise.)
That leaves the biggest threat being "client ignores security warning". This is sadly common anyway, and the biggest issue with the expired certificate (as @user54791 mentioned) is that it only encourages people to do that. Your best shot at stealing information would be to create a fake certificate, intercept attempts to connect to the authentication server (e.g. by making your own access point), and hope people will not notice the certificate error (in practice, probably a fair bet). That is a serious risk, but such an attack can be difficult to mount in practice.
Comment: Expired certificates *do* have one security disadvantage: It's impossible to tell whether they've been revoked. CRLs and OCSP servers only have to report the status of certificates that are in date.
Comment: @MattNordhoff Added to answer.
Comment: Past experiences with expired certificates does make users more likely to ignore certificate warnings in the future. But on top of that there has been examples of browsers that would only display the first problem they noticed about the certificate. If the user decides to ignore an expired certificate the browser might simply not check anything else about the certificate.
Answer: You can use MitM, like arp poisoning attack and considering the fact that everytime there is an warning shown, when doing your MitM the warning won't be anything new or different from the normal behaviour so everyone will ignore it giving you sensitive data.
Man in the middle
ARP spoofing
Answer: As others noted, an expired certificate is not by itself making you vulnerable to attacks. However, it may still hint at a certain vulnerability:
As others noted, there is a reason for certificates to expire. One was already mentioned: the older the certificate, the higher the probability that its private key has been compromised (just because attackers had so much more time to try). Another one was not mentioned yet: When creating a certificate, a trade-off must be chosen for the associated key length; short keys are easier to crack, longer keys may incur significant computational overhead to legitimate clients and servers. With increasing computational power over the years, this trade-off shifts towards longer keys. An outdated certificate hints that the certificate may be protected by a key that is too short, and may be vulnerable to attacks.
For example, a certificate created ten years ago may be based on a 512 bit RSA key. While RSA itself is still considered safe, a 512 bit key can be cracked today with some effort.


Why a double fuse is used in some applications?

Question: In some DC applications in an isolated system (i.e. no grounding), sometimes two fuses are used: one is positioned on the positive (Vcc) line while the other is located on the negative (return path or ground). What are the advantages of having two fuses (aside from redundancy)?
Comment: Check [Does it matter if a fuse is connected to the negative or positive terminal of a battery?](https://electronics.stackexchange.com/questions/445740/does-it-matter-if-a-fuse-is-connected-to-the-negative-or-positive-terminal-of-a/445835#445835)
Comment: Sometimes the fuses are not the same.  There may be a 10A fast blow fuse and a 5A slow blow fuse to supply a device that needs under 5A continuous but over 5A transient current but wires protected with the 10A fuse.
Answer: Where is the safety ground applied?  In some utility battery systems the earth connection is applied in the middle of the stack.  As such, if the positive bar develops a fault to ground the current will circulate only in the upper half of battery stack.  Likewise, if a ground fault develops on the negative bar the current will only circulate in the lower half of the battery stack.  As such, both positive and negative need fusing.
In this picture below the loads are connected between positive and negative buses (250V).  When you picture a ground fault occuring on either bus you will see the path and need for fuses in both.

If your supply is truly ungrounded, you have the potential to develop a ground somewhere in the supply. In that case, it would be equivalent to what I describe above.
Answer: If there are two fuses, then the potential for faulting current exists which could come from another source. The second fuse protects the device against a large faulting current.


Why are holes in p-type semiconductors considered positively charged?

Question: This makes no sense to me and i think it's more of a convention. Even though we prefer talking about holes that are the majority carriers in p-type semiconductors, they have no charge and are not particles to be electrically charged. When an electron moves from a Si atom to a B atom, for example, the latter will get a stable configuration with 10 electrons. (5 of its own, 4 from covalences with 4 other Si atoms and the last one, just 'received'). The donor particle, Si, lacks now an electron and it can be considered (at least partially) positive. And what makes an electron move again is the attraction to this positive charge the Si particle has now. Why is the hole considered positively charged?
And I have one more thing in mind. I have read that holes can be considered particles with a charge of +e (the electron's charge, but of opposite sign). I can understand it only this way: instead of speaking of an electron of charge -e moving from A to B, let's say, we choose to talk about a hypothetical particle of charge +e moving from B to A. All the associated notions give the same results when you try to determine them, in terms of numerical values.
Is it correct what I think?
Answer: Think if it like this:

You have a material consisting of neutral atoms. That means, they have equal amounts of electrons and protons.
A new atom is now added, which as you explain it steals an electron from one of the other atoms in order to become coherent with them to "fit in" in the lattice.

Therefor a neighbour atom now has one less electron. It therefor lost an amount of charge of $-q$. It is therefore not neutral anymore since it has one proton too many. It therefore has a net charge of $+q$ which is the proton and electron charge (they are equal).
Because of this net charge it might steel an electron from another neighbour in order to become neutral again. This neighbour therefore looses an electron and the same thing repeats itself through many atoms.

From outside it doesn't look like any electrons are moving. They just move one atom to their neighbour, which is not much. But the hole, which is just a missing electron, looks like it is moving from atom to atom to atom. It seems to be propagating. That's why it can be thought of as a particle in itself even though it actually only is a missing electron.
The hole works as a positive charge, because it will move towards a negative charge (if a negatively charged area is introduced, electrons will move away and filling up all holes ad far away as possible, which of course means that the holes are pushed back to that negatively charged area).
I hope this helps the intuitive understanding.
Comment: Thank you for this explanation. It was helpful
Answer: Holes are considered positively charged because of the relation between their velocity and the electric current: when they move right, the current points right.
It is theoretically possible to only work in terms of electrons: conduction band electrons and valence band electrons. However, electrons in the valence band behave in a strange way. Because of their interaction with the lattice, they don't respond to forces the way free electrons do. In fact, they accelerate in the opposite direction to the applied force. If you're only looking at electromagnetic forces, that looks remarkably like they had positive charge.
The other aspect is the current of a nearly-full band: the valence band in a semiconductor is almost completely occupied by electrons. Wikipedia can explain this better than me, but supose the band has place for electrons with speed -2, -1, 0, 1, 2.

Full band: all those states are occupied with electrons. Then the net current is 0: for each electron going one way there's one going the opposite way, contributing the opposite current.
1 missing electron: Look at the electron with speed 2. Its contribution to the current is (-1)*2 = -2, with the leading -1 because of its negative charge. This current is balanced by the electron with speed -2, whose current is (-1)*(-2) = 2. If you remove the electron with speed 2, there's nothing balancing the -2 electron so you get a total current of 2. Generally, removing an electron which contributes current j increases the net current by -j.

Rather than adding the currents of an almost full valence band
(with a lot of cancellation), it's easier to just look at the current due to the missing electrons and take the opposite sign.
Answer: Quantum mechanics is weird.  Phonons (crystal lattice vibrations), for example, are not real particles, but they have quantum mechanical properties like superposition and uncertainty.  Although we physically describe a hole as an unfilled electron energy state in the conduction band, we can just as well pretend that it's a real particle/wave with all of the usual weird behaviors.  In that case, the hole acts like a positively charged particle with a mass (or rather, inertia) somewhere around twice that of an electron.
Check out Why does a semiconductor hole have a mass?
Answer: I'm sorry, but to my understanding, they're not charged, because the netto charge is 0, there's no unbalance. A particle is charged if the amount of protons are not equal to electrons.
We're talking about holes or free electrons, because we doped Si with some atoms that have one missing electron in the outer shell (to make it a complete band)  or just a single electron in the outer shell. When 1 electron really moves to another atom and stays there, we than talk about an ion, which is negatively charged because protons are not equal to electrons anymore!
When we talk about negative charged particle, we talk about an electron. A positive charged particle is an atom (because of the proton in it). Finally, it's not important which is the - or +, that is once agreed for convention. Otherwise you have like in the UK you drive on the left side with your car and in Europe on the right side.


Does anyone know appropriate software to redesign the following figure?

Question: Does anyone know  appropriate software to redesign the following figure ?
Comment: There are dozens of applications capable of creating that or something similar. You'll need to perhaps be more specific.
Comment: I would show all related angles that are shown in the above figure. I need to redraw it with same concept. Do you have any recommended application ?
Comment: "Appropriate" is very broad. Do you have 3D knowledge? Would you prefer a 2D application? What do you normally use to draw? Can you [edit] your question to add some more details, otherwise it's a very broad question. Check also [ask].
Answer: I wrote at first a comment with the following belittling phrase "Any well armed vector drawing application is ok, for ex Illustrator or Inkscape + numerous others" To prove it to myself I tried to draw the main curves and lines in Illustrator.
I deleted the comment quite soon, because it became clear that the text was bullshit.  Altough it was technically true, drawing it for ex. in Illustrator needs plenty of not so trivial geometry knowledge. Coloring, angle markers, arrowheads and texts are quite easy, but the following isn't:

You need the bottom ellipse (magenta) and half ellipses. The blue (=actually a half circle) one is the border of the dome surface. The green ones are crossing curves of different planes and the dome. I found very difficult to draw the half ellipses so that

their diagonals meet at the centerpoint O of the bottom ellipse
they meet the bottom ellipse apparently perpendicularly
they meet in the top point of the dome (=B) which definitely isn't on the blue half circle
the green ellipses touch the blue half circle each in their own single touchpoint (A's)
the blue half circle meets the bottom ellipse at its main diagonal end points C1, C2

After tinkering a moment in Illustrator I noticed I cannot easily make the green curves to fit exactly without knowing some dimensions, they looked acceptable only in small size and with thick lines. I gave up and went into a 3D program to get everything right.
If you want an exact result without the knowledge of 3D descriptive geometry, you should do the same. Draw at least the basic shapes in 3D (= a sphere + some planes which split the sphere). You can continue in Illustrator, Inkscape or other vector drawing program after exporting the wireframe and opening it.
I drew this in DesignSpark Mechanical (=freeware) saved the wireframe scene as PDF and opened it in Illustrator. There I removed some extra lines and colored the rest. Inkscape fits the job as well because it opens well PDFs this simple.
Colorings and other extra drawings go in Inkscape and Illustrator, the latter has better arrows.
Comment: Yeah, so there is some benefit of knowing how to construct the geometry. A dying skill though.
Comment: I think i should teach you how to use SSR rotations or Effect -> 3d -> Rotate, if you have hard time drawing this perfectly without a 3d application. There is absolutely nothing here you need a 3d application for, in fact it only slows you down.
Comment: Illustrator's 3D is 3D except clunky to use.  In 2D one can do a construction drawing  or he can calculate the needed shearings, scalings and rotations but that needs the knowledge of it. I guess the questioner wants some shortcuts, other than what you have in several occasions called eyeballing and he's not going to learn descriptive geometry. Inkscape's 5pt to ellipse path effect is useful.
Comment: Depends on what you mean by 3d. Illustrator is never 3D. Anyway, you dont need to calculate anything you can just measure them against the geometry you are constructing.
Comment: That's the construction drawing
Comment: You can make this picures construction in illsutrator in about 5 minutes, How much does  your roundtrip time cost you?
Comment: about 10 min, only the lines and ellipses, no colors.
Answer: I think this is approachable in Illustrator, Inkscape or Affinity Designer - for myself at the moment I'd probably go with Affinity Designer for this, assuming the latest release (1.7+) because the recently-updated iso toolset would make some of this work relatively easy to complete.
I'm at a client's worksite ATM, working on a machine which doesn't have the latest version, so it may take a bit for me to post up <code>.gif</code>s or screencaps to illustrate my point.
In short:
You can set up either standard isometry grids or custom, you can interactively match the iso angles to your provided figure if that's preferred, or work with an easier-to-calculate if needed.
Iso Studio / palette out and working:

After you've set this up, you can draw your basic shapes, intersecting planes, angles etc straight on - and then Fit To Plane in the new Isometry Studio (palette) with a given plane chosen (top, side, front) and it will match the correct skews to get you there very nicely.
Using Iso Studio's Fit to Plane:

You can also initially draw in that plane; more crucially for this figure, once you've created your hemisphere with transparent fill and dashed linetype for the internal intersecting planes, you can copy the first and paste it, go back into your grid settings and rotate the cube, and Fit to Plane again and you're pretty much home free.
Using Iso Studio's Edit in Plane to draw out shape already in the correct iso plane:

You will want to construct the basic annotations and the sunpath with a standard grid or no snapping, but all-in-all, this workflow would make light work of this kind of sunpath / insolation incident angle diagram.

Still embedded at the client's site - I did a quick jump to a development laptop which does have the latest Affinity Designer, but is unfortunately a bit glitchy on the Screen2GIF version - so here's just the last most critical part of what I was trying to explain about fitting elements to the projected grid and then re-orienting the iso grid and fitting other elements as a way to determine appropriate transforms.

Hope this helps.
Answer: Illustrator can do some. Live trace functioonality is called. The finesse it's up to you, tho
Comment: Can you [edit] to expand what you meant? As it is your answer is quite short / generic, check [answer]. Also the question is about redesigning the figure, not just tracing over it.


A word beyond 'stating the obvious'

Question: Is there a word which describes a statement which is completely redundant, as its opposite would clearly be ridiculous?
For example

Our Party aims to reduce levels of crime.

I've considered: Tautology, truism, etc., but they don't really fit.
Comment: Not redundant.  This states that crime is a focus area for the party.  It could be that their focus is health care and have no specific plans to address crime.  It's true that they might have just said, "Our party aims to address crime."  without specifying the direction they want to take it.
Comment: Depending on your interpretation of *opposite*, there is nothing obvious about your example sentence.
Answer: a platitude TFD

a trite, dull, or obvious remark or statement; commonplace; a bromide
staleness or insipidity of thought or language; triteness

As in:

Our Party aims to reduce levels of crime.

is platitudinous, as they can't think of anything original to say. A close synonym would be to call it a bromide (a common saying or proverb that is obvious and not that helpful).
Comment: You can detect a platitude by inserting the negation ('Our party does NOT aim to reduce levels of crime') and then see whether the statement becomes ridiculous.   But even platitudes can be powerful: 'Yes, we can!' or 'Make America great again!' or 'Vote Conservative - you know it makes sense'.
Answer: boilerplate
This is somewhat of a wildcard term for "cookie-cutter" statements. It works for all of your examples above, whether it's rehashed cynicism or rehashed altruism or rehashed apathy or rehashed sympathy—boilerplate covers almost all of them, including "opposite would be obvious" since boilerplate is rarely non-obvious or original.
boilerplate (ordinary)

a way of writing or thinking that is not special and does not show any imagination

(Cambridge Dictionary)
Used this way, boilerplate can emphasize the uncreative, lazily-applied, one-size-fits-all, boring, generic, not-thought-through, same-old answer that is all around repulsive for its obviously rehashed obviousness.
This is a very boilerplate thing to say because every party says the same thing:

Our Party aims to reduce levels of crime.

...What party doesn't want to reduce crime? They're just reciting from the boilerplate stack!
Here is an article about how boilerplate is frowned upon in the professional world: Boilerplate PR Statements: Meaningless Words that Avoid the Facts. The author starts using the word boilerplate quite often about half way through.
Examples of use

The president gave a speech this afternoon. I didn't listen because he always says the same boilerplate.

or

If you want my respect, come up with something original rather than the same old boilerplate people have been reusing for centuries.

or

My student said his dog ate his homework—how boilerplate!

Background
Boilerplate gets its figurative, "ordinary" definition from its history with the printing press, similar to the Cambridge literal definition of the same entry as above:
boilerplate (standard)

text that can be copied and used in legal documents or in computer programs, with only very small changes

(Cambridge Dictionary)
Here's a great blog post on the history of boilerplate: Boiler Plate | Why Name It That?.
And, there is an entry on SE right here: Meaning of "boilerplate"

Boilerplate has a long history and writing boilerplate can be a useful and lucrative business. While there is much positive that could be said about boilerplate, this Answer addresses the use of the word that fits with the question.
Comment: The trouble is that boilerplate has nothing to do with whether or not it is obviously true.  Better would the the 'truism', which does have the sense of 'pointlessly true'.  Cliché.
Comment: But "truth" wasn't part of the question. It was about "stating obvious" with tautology and truism as examples. Boilerplate fits those. :-)
Comment: I don't think the following is true for *boilerplate*: "its opposite would clearly be ridiculous".
Comment: @Laurel, you have a point, but it depends. Rectangles and squares. Boilerplate often includes "opposite [opinion] would be ridiculous".

A word beyond 'stating the obvious'


Predict the probability that a customer buy today

Question: My company sells a single product that is a commodity. If you buy it, I can be sure that you will buy it again in the near future from me or from my competitors. The demand is affected by the weather. If we have high temperatures my product sales decrease, and vice-versa.
I have this data per sale:

Customer
Average temperature in the day of the sale
Amount of product bought in a transaction
Size of the customer warehouse
Price at the moment of the purchase
Timestamp of the sale

The problem:
I want, based on historic time series data, to get the Probability that a customer requires my product today. I would like to have a %. Customer X have a 70% of probability of require your product today based on the historic. With that I could get a list of all the customers that today have 80% or more probability of buying and take action with that.
The complexities I see:

I have a lot of data because I have a lot of customers but for a single customer I have an average of only 5 purchases.
If the customer is not loyal and gets the product from my competitors I have holes that make sales separated by a irregular time spans.

What would be a good algorithm to tackle this problem?
I thought about regressions using time series but I won't get a probability. Maybe transform the timestamp of re-purchase per customer in my training set and try to cluster based on days between purchases.
Answer: You could frame the problem as survival analysis - predict the probability of an event during a certain time period.
The data quality issues will affect the modeling. You have to decide whether you are fitting a model per customer or a model for groups of customers. Missing data will have to be ignored, explicitly modeling, dropped, or imputed.


Are "being 1" and "being 2" basic concepts of our mind?

Question: Everytime a mathematician uses the concept of function or relation he is dealing with the concept of "being 2": he's relating one object to another.
Everytime we use a logical conjuction we are indirectly making use of this basic concept so we cannot derive it from "being 1 and 1".
Now, it seems possible to me to derive every other cardinality from these.
"Being three" would mean "being 2 and being 1"; "being four" would mean "being three and being 1" and so on.
Comment: I don't understand what "being 2" and "being 1" means. Could you explain a bit?
Comment: See [Brouwer](https://plato.stanford.edu/entries/brouwer/)'s [Intuitionism](https://plato.stanford.edu/entries/intuitionism/#Int) for the ["intuition of two-oneness, the basal intuition of mathematics"](http://projecteuclid.org/euclid.bams/1183422499).
Answer: This question is quite vague (esoteric?), so the answer will not be very precise, too. First, I agree that "oneness" and "twoness" are fundamental because the former gives us the basic unit, the latter binary opposition and connection.
As you noticed, a relation r: X → Y is about "twoness". After all, it is formally defined as a subset of the Cartesian product X × Y = {(x, y): x ∈ X, y ∈ Y}.
A lot more complicated structures can be built from that, i.e. an arithmetic operation "⊙" on a set X (which may make it a group if certain requirements are met) could be defined by a function
g: M → X with M = X × X
and then setting
x₁ ⊙ x₂ := g(x₁, x₂).
At no point we need to bother with relating more than two sets or two elements with each other.
Now, seriously, we may have to sober up a bit... Perhaps this flight of thoughts got to our heads far too much?
If 1 and 2 are the basic concepts of mind, what difference is there between a child, that can count to two, and a great mathematician? That the great mathematician can juggle much better with 1s and 2s?
That seems preposterous.
And if we look at the natural numbers there is one important axiom, the axiom of mathematical induction:

If P is a proposition about natural numbers such that:

P is true for 0
for every natural number n, P being true for n implies that P is true for n + 1,

then P is true for every natural number.

we must remember that there are much simpler "toy" subsets of the usual axioms. They basically just define counting and calculating but can't express general facts about numbers at all.
So how would we get to an idea like mathematical induction? Do we really grasp the infinite structure of the natural numbers itself from the concepts of 1 and 2?
No, it obviously doesn't work that way. 1 and 2 do not beget infinity.
So intuitively and as this simple example shows, there really is more to math, something we fundamentally cannot get from the concepts of 1 and 2.
Answer: There are many concepts in mathematics other than creating relations in functions, for instance geometry, vector theory etc. which require their own set of laws and seem to consist of their own basic concepts.
So, to answer your question bluntly NO; "being 1" and "being 2" are not basic concepts of our mind.
Furthermore, your propositions can't be used to explain all the numbers itself for instance 0 or negative numbers or irrational numbers and/or complex numbers which seem to appear equally basic to human mind, just like the oneness you mentioned.
Comment: On what basis do we regard any number basic to human mind?

The thing is all the numbers including real numbers such as one, two, three are equally abstract as any other complex numbers or even super geometric numbers. But the thing is right from the childhood we are taught  the number systems and our mind has become comfortable to it. We think that these numbers really exist beyond our mind where as these are merely concepts which greatly help us understand process the information around us just like complex numbers does in other paradigms.
Comment: On what basis do you regard complex numbers as equally basic to the human mind as oneness and twoness?
Comment: I reject the existence of abstract mathematical objects, so I'd begin by pushing back there. Descartes explains in the Meditations how mathematical concepts can be derived from thought. But I need not get psychologistic; a mathematical fictionalist is what I am. The point is that imaginary numbers are not more basic to the mind than oneness and twoness. Having to come up with something to generate a value for the square root of all Reals, as imaginary and complex numbers have to do, is probably an indicator of how non-basic of a concept it is. I mean, it's even fictive.
Comment: agreed. And there ways would reflect (or moreso 'just' reflect, or be closer to the core of reflecting) more basic structures than would complex/imaginary numbers.
Comment: @Lothrop Stoddard Sorry for deleting the comment it was an accident.

It depends on what your definition of basic is. Real numbers are actually a subset of the complex numbers themselves. One could very well argue that complex numbers are the more basic concepts and we get real numbers when we square them. It just so happened that we grasped the concept of real numbers first. Later we realized that complex numbers are more fundamental and real numbers just happen to be a "special" case of the complex plane after we manipulate them in a special way instead of the other way round like you did.
Comment: I would say that the integers are patently more psychologically (and evolutionarily) basic than the Reals than the complex numbers.
Answer: The answer to your question is no, since malformed and ambiguous phrases cannot be unambiguous concepts, let alone those of our mind.


Magento 2 : Error 503 first byte timeout

Question: Getting this error when i'm update product from product grid using update attributes.

Error Page:
Comment: Were you able to solve your issue? Did my answer help?
Answer: It's caused by Varnish limits. Try to increase your memory_limit and max_execution_time in your php.ini and pub/.user.ini files.
If you use Fastly, navigate to admin -> stores -> configuration -> Advance -> System -> Full Page Cache, set Admin path timeout to 600, and click on "Upload VCL to Fastly", this will increase the first-byte timeout in Fastly (600 is the max).
Answer: Same error had happened to me , it is happening because of execution time out , you can increase it for magento by using ini_set() in app/bootstrap.php.
Update attributes also consumes a lot of memory depending on the number of products selected so you may also want to increase memory limit.
So, finally paste following code at the top of app/bootstrap.php
ini_set('memory_limit' , -1);
ini_set ( 'max_execution_time', 18000);


What is Transverse Energy?

Question: What is transverse energy? Why we use transverse total energy instead of energy and transverse momentum in place of Total momentum in the particle detectors?
Comment: The existing question [What is p_T? (transverse momentum?)](http://physics.stackexchange.com/questions/19361/what-is-p-t-transverse-momentum?rq=1) basically answers the "why" question and the "what" question as well by a simple extension.
Comment: Did you try to Google [transverse energy](http://www.google.com/search?q=%22transverse+energy%22)?
Comment: I tried both the existing question as well as google but not able to understand well.
Answer: Transverse momentum, $\vec{p}_T$, is the momentum of an object transverse to the beam. Transverse energy is defined as $E_T = \sqrt{m^2+p_T^2}$ for an object with mass $m$ and transverse momentum $p_T$.
The initial longitudinal momentum in a parton collision is unknown, because the partons that make up a proton share the momentum. We do know, however, that the initial transverse momentum was zero. So we look for missing transverse momentum, defined $E_T^\textrm{miss} = -\sum_i \left|\vec{p}_T(i)\right| \equiv -\sum_{i}p_{T}\left(i\right)$ for visible particles $i$. Finding missing transverse momentum would indicate that new, unaccounted for particle(s) had escaped the detector.
Confusingly, $E_T^\textrm{miss} = -\sum_i p_T(i)$ is commonly called missing transverse energy or MET. Missing transverse energy is equivalent to missing transverse momentum only if the missing particle(s) were massless.
Also, events in which the products have large transverse momentum are more likely to be genuine, interesting events.
Comment: i believe it's still incorrect: a perfectly fine collision with whole final state detected should have no missing energy, but if you have any transverse momentum and you sum the absolute value the sum will be non-zero. i would say that you want to take absolute value *after* taking the sum
Comment: I am afraid sth doesn't make sense: Clearly, $E_{\text{T}}^{\text{miss}}$ is a scalar, but the RH side of your equation is a vector.. Maybe it should read $E_{\text{T}}^{\text{miss}} = -\sum_{i}\left| p_{T}\left( i\right)\right| \equiv -\sum_{i}p_{T}\left( i\right)$?
Comment: indeed, should probably take norm of RHS of those expressions, will fix later

What is Transverse Energy?


How to insert points in Polygon in Qgis

Question: I want to insert hospital points inside district Polygon. District is divided into 9 polygon called WARD_NO and hospitals have locations according to polygon 1,2,3,4,5..... not according to x and y co-ordinate,so how can  I do so by using .csv file format which have column HOSPITAL_NAME and WARD_NO only. I want to locate those hospitals according to WARD_NO in the respective WARD_NO
Comment: Welcome to GIS.se! Do you want to __map__ (display) the hospitals at points that are in the centre of the polygons? Click 'edit' and explain a bit more about what you aim to achieve.
Answer: Is placing the hospital at the centroid of the WARD_NO acceptable? If so, add the .csv to your map and join the table to your polygon layer (tutorial on that here). Then create a point layer from the WARD_NO polygons (see the top answer of this question on how to do this).
Comment: Also please look for similar questions and/or read the manual. This is a pretty basic GIS concept, so must be tons of examples out there.

How to insert points in Polygon in Qgis


Tnt modifications

Question: I'm making an adventure mode map. I want tnt to be part of it to deal damage to mobs but I don't want it to destroy terrain. How do I do this?
Comment: Possible duplicate of [How to summon a TNT that doesn't destroy its surroundings?](https://gaming.stackexchange.com/questions/383267/how-to-summon-a-tnt-that-doesnt-destroy-its-surroundings)
Answer: it appears i'm a bumbling idiot, and didn't notice the Bedrock tag.
the information below pertains to Java, and will not work on Bedrock due to the inability to view or edit NBT data.
as far as i'm aware, this is borderline impossible to do on Bedrock since you can't test for TNT explosion time, nor summon a Creeper with set explosion time; however, i've decided to keep the information below for preservation's sake in the hopes it may still help people.

there's actually a rather simple way to do this involving some funky command usage.
first, make sure that gamerule mobGriefing is set to false. this will prevent mobs from destroying terrain.
next, in a repeating command block, we want to find any TNT that's about to explode, and summon a Creeper at the same spot;
execute as @e[type=tnt,nbt={Fuse:3s}] at @s run summon creeper ~ ~ ~ {ignited:1b,Fuse:2s}

execute as @e[type=tnt,nbt={Fuse:3s}] at @s will use whatever command is after run at the location of a TNT with 3 ticks (3/20ths of a second) left
summon creeper ~ ~ ~ {ignited:1b,Fuse:2s} will summon an ignited Creeper with 2 ticks before it explodes

then, in a second repeating, we want to run the command execute as @e[type=tnt,nbt={Fuse:1s}] at @s run kill @s, which will kill the nearly-about-to-explode TNT before it actually does, leaving the Creeper to do the exploding. because gamerule mobGriefing is set to false, you'll have all the damage without any of the terrain damage.
Comment: This looks like Java edition, or am I wrong?
Comment: i actually didn't notice the Bedrock tag! my answer is, in fact, for Java, and thus won't work since you can't view or edit NBT data on Bedrock. i'll look into it and see if i can find an answer that fits!
Comment: after looking some info up and trying to make some workarounds, i didn't find anything good. sorry i couldn't help after all! your best bet would be to use `execute` to detect for a change in blocks and `clone` the piece of terrain from a template area containing it; however, it will still likely drop items.

Tnt modifications


Difference between Reverse Proxy and Port Forwarding

Question: Well both reverse proxy and port forwarding looks for any incoming packets destined to a particular machine which is present in local network. How both of them are different ?
Comment: Port forwarding is really just a manual entry in in one of the NAPT tables, but proxy is an (off-topic) application-layer function/feature.
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
Answer: Port forwarding describes a layer-4 mechanism, operating on TCP connections or UDP packets without necessarily understanding the application data.
Reverse proxy suggests a higher-layer (this is where the OSI model doesn't map directly to TCP/IP) application-aware proxy.  In the old days, a proxy server was most commonly used between users and the Internet; so reverse indicates the other way around, used to proxy traffic from the Internet to server(s).
Comment: You should also mention that port forwarding is a NAT concept - destination NAT enables access from public to private address space.
Comment: Port forwarding can be done without NAT. I've had userland programs to do this longer than NAT has been a concept. (It's a demo of the UNIX socket API. In the 80's this was also possible with a string of telnet's -- inetd service that runs telnet...)
Answer: While both methods might look similar, they are entirely different technically.
A proxy accepts a socket connection and fulfills the client request in some way or other. Usually, it creates its own request to the indicated server.
The by far most common example is an HTTP proxy that accepts HTTP requests from clients, uses its own HTTP request to retrieve the page/object, and then forwards the data to the client. Proxies can even translate application layer protocols (e.g. FTP over HTTP proxy) but they are always application-specific which makes them application-aware as well. Proxies were widely used for private-to-public Internet access before NAT become common. They can also be used for caching or deeper insight into the application protocol (application-layer gateway, malware scan, content filtering, ...).
A reverse proxy is used the other way around: public access for servers within private LANs. Since a proxy understands the application protocol, it can be used as a single entry point for multiple exposed servers, especially with HTTP. A reverse proxy can have multiple functions, including

caching
load balance across a number of backing servers
port sharing (multiple web servers are accessed using the same public IP address and transport-layer port number, distinguished by host header)
offloading SSL to the proxy
application-layer gateway/filtering

Port forwarding is another term for destination NAT aka reverse NAT, sometimes also virtual IP: a router translates a packet's public destination address to the actual private address to enable access from the Internet to privately addressed servers. In contrast to a proxy, a NAT router is not aware of the application protocol that's currently used. It only translates IP addresses and possibly transport-layer (L4) port numbers.
That way, it isn't possible to enable public access to multiple private servers using a single public IP address and L4 port - you need to either have multiple public addresses or use multiple ports.
Answer: Reverse proxy
Reverse proxy help the client traffic from outside networks  towards servers deployed in internal networks to distribute load equally on backend servers . Basically reverse proxy is inducted behind firewall and more than one back  end servers are connected to reverse proxy .
Portforwarding
Portforwarding is a technical term used in networking . When the client wants to access server deployed behind firewall on specific service ports . As server is behind firewall client can't reach server beacuse of restriction  in firewall . To allow this connection port opening is required from client  IP address to server IP  address on specific ports this policy Configure in firewall is referred as port forwarding.


The residue of $9^{56}\pmod{100}$

Question: How can I complete the following problem using modular arithmetic?

Find the last two digits of $9^{56}$.

I get to the point where I have $729^{18} \times 9^2 \pmod{100}$.  What should I do from here?
Comment: I wouldn't do it quite like that. There are various better methods. Try the first few powers of $9$ - do you see a pattern?
Comment: @user31415 $729^{18} = (9^3)^{18} = 9^{54}$
Answer: Hint: use a binomial expansion of
$$
(10 - 1)^{56}
$$
Comment: Another hint: the last two terms.
Comment: Can you expand your hint into a proper answer?
Answer: If you don't insist on using a clever method, it actually isn't too hard to just do by hand. When you write out the first few powers of $9$ modulo $100$, you will find (just remember the last two digits in each step) that: $$9^6\equiv 41\mod 100$$
And:
$$9^{10}\equiv 1\mod 100$$
Now we see that:
$$9^{56}=(9^{10})^5\cdot 9^6\equiv 41\mod 100$$
Answer: Another way :
Let $[n]$ be the right-most two digits of $n$. Then, note that
$$[9^2]=81,[9^3]=29,[9^4]=61,[9^5]=49,[9^6]=41,$$$$[9^7]=69,[9^8]=21,[9^9]=89,[9^{10}]=\color{red}{01}.$$
Hence, $[9^{56}]=[9^{6}]=41$.
Answer: $\bmod 4\!:\ 9^{56}\equiv 1^{56}\equiv 1\,\Rightarrow\, 9^{56}=4m+1$.
$$\bmod 25\!:\ 9^{56}\stackrel{(1)}\equiv 9^{56\pmod{\phi(25)}}\equiv 9^{56\pmod {20}}\equiv 9^{-4}\equiv \left(\frac{1}{81}\right)^2$$
$$\equiv \left(\frac{1+5\cdot 25}{6+3\cdot 25}\right)^2\equiv \left(\frac{126}{6}\right)^2\equiv 21^2\equiv (-4)^2\equiv 16\equiv 4m+1$$
$$\iff 4m\equiv 15\equiv 40\iff m\equiv 10\iff m=25l+10$$
$9^{56}=4(25l+10)+1=100l+41$. In $(1)$ I used Euler's theorem.
Answer: By Carmichael's function, the order of any residue of $100$ divides, and is a maximum of, $20$ (the same as for $25$). We see that $9$ is a square, so the maximum order of $9 \bmod 100$ is $10$ (or divides $10$ if it is less). This gives
$$9^{56}\equiv 9^6 \bmod 100$$
Then we can simply multiply a few small powers:
$$9^2 \equiv 81,\quad 9^4 \equiv 61, \quad 9^6 \equiv  41 \equiv 9^{56}$$
(This result also shows - since $9^6 \not\equiv 9$ - that the order of $9 \bmod 100$, not being $2$ or $5$, must be $10$, as others have shown by direct calculation)

The residue of $9^{56}\pmod{100}$


ffMPEG "inttypes.h not found" error

Question: While using the ffMPEG builds in Windows with Visual Studio 2010, I encountered the inttypes.h not found error.
Since searching through the internet led me to wrong solutions, I thought I'd put up the right solution here so that people can find it easily. Will be answering my own question soon.
Answer: The solution is to download this file and place the inttypes.h file either where Visual Studio can find it, or in the folder where ffMPEG's common.h is located. If you choose the latter, you'll have to change the #include<inttypes.h> line to #include "inttypes.h".
Had got this solution from here.
Another solution which didn't work for me is to replace the #include<inttypes.h> with
typedef signed char  int8_t;
typedef signed short int16_t;
typedef signed int   int32_t;
typedef unsigned char  uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int   uint32_t;
typedef signed long long   int64_t;
typedef unsigned long long uint64_t;

This solution was obtained from here.
Hope this helped.
Comment: As a note in my version of ffMPEG I also had a include for this in pixdesc.h as well. Additionally if you are only have the outer include folder listed in included directories it will be `#include "libavutil/inttypes.d"` instead.
Answer: #ifndef HAS_INT_TYPES

#ifdef HAS_C99
  #include <stdint.h>
#endif

#endif

ffMPEG "inttypes.h not found" error