What's a simple way to find connected components in a mesh?

Question: As stated I have a triangle mesh I want to separate into connected components. One way I would assume would be to do a depth first search on a vertex and remove vertices, then repeat until the set is empty, but I wonder if there is a simpler (friendlier for the human) way to go about it.
Comment: Not sure if it would be friendlier, but if this is about manipulating the mesh through an interface, you can do a depth first traversal of vertices as you said during the loading and save as much information as possible for later use, such as, spanning tree, components, etc in a single pass and provide the user the required information later on
Comment: here is a link to a repository that does a such pass: https://github.com/Viva-Lambda/graphical-models/blob/master/pygmodels/graph/graphops/graphsearcher.py
Answer: No matter how you do it, there's going to be some kind of graph traversal (e.g. BFS or DFS) involved as that's pretty inherent to the problem.
I'd first build a face neighbor array: for each face (assuming triangles), store the indices of the three neighboring faces. This can be done with a half-edge structure if you have it. If not, a simple way to do this is to create a hash table that maps edges, represented as ordered pairs of vertex indices, to face indices. Then, for each face you can look up the opposing edge and its face by swapping the two vertex indices. (This assumes the mesh is manifold.)
Then, I'd allocate an array of ints to store the component index for each face, initially all set to -1 meaning unassigned.
Start at the first face, assign it to component 0, then perform a BFS using the face neighbors array and assign everything it finds to component 0 (the component index here doubles as the "marked" flag for the BFS). Then find the first unassigned face, assign to component 1, and repeat.
Then, if need be, you can build up arrays of face indices for each component by scanning through the component index array, or build new vertex/index buffers for each component, or whatever you need.
This produces edge-connected components (two faces need to share an edge to be in the same component). An alternative is to do vertex-connected components (two faces are in the same component if they share a vertex, even if they have no shared edges), which is a little more general. For this, you would need to do similar logic but work on vertices instead of faces, which is a little trickier since each vertex can have an arbitrary number of neighbors. There's probably a clever way to build a vertex neighbor table efficiently, but it's not something I've thought about too much.


Constructing half-edges table from triangle list without hash

Question: Motivation
I am trying to refine a mesh such that each triangle gets subdivided into 4 triangles, but I want the vertices to be shared. For that purpose I need a half-edge data structure so I can count and address the vertices on the edges properly. The problem below is formulated a bit more generally - it just assumes a given index list, and doesn't even provide the vertices coordinates. The problem is in 3D, so sorting based on angles for DCEL construction will not work.
Problem Statement
I am given an index list $T = [i_{0}, i_{1}, i_{2}, \ldots, i_{3(n-1)}, t_{3(n-1)+1}, t_{3(n-1)+2}]$ of triplets of vertex indices corresponding to a specific triangle. Here $i_{3k+j}$ is the index of the $j$-th vertex in the $k$-th triangle (I have $n$ triangles in the above). I define $n(j) = 3\cdot\lfloor j/3\rfloor + \bigl(((j \text{ mod } 3)+1)\text{ mod }3\bigr)$. This cyclically gives me the next index belonging to the same triangle. For example:
$$n(0) = 1, \,n(1) = 2,\, n(2) = 0,\, n(3) = 4, \, n(4) = 5,\, n(5) = 3, \ldots$$
I want to build a half-edge table: a table such that $(h(j) = k)\land (h(k) = j) \iff (i_j = i_{n(k)})\land (i_{n(j)}=i_k)$. Given a half-edge index $j$ it returns the index corresponding to the half-edge in the opposite triangle. I am trying to avoid using a hash table since I don't have a nice implementation in C and I don't plan to implement my own (though if you have any good suggestions for hash table code I'll gladly have a look, but that's outside the scope of the question really - I will still be curious about suggestions not using a hash table even if I have one).
My Algorithm
What I came up with is to iterate over all triangles and count the number of triangles per vertex (meaning I have an array $nt(i) = \text{# adjacent triangles to vertex $i$}$, for $0\leq i \leq m-1$, where $m$ is the number of vertices). Once I have the count I can allocate a compressed row storage matrix with $nt(i)$ elements per vertex ($row(i) = nt(i-1) + row(i-1)$), and fill a triangle adjacency matrix $A$ with the indices of the adjacent triangles. Then for each vertex in the matrix I can go over pairs of its triangles ($C^{nt(i)}_{2}$ such pairs) and link those that share an edge (in a closed mesh I can even sort them). As long as $n(i)$ is not too large this is not very problematic. For simplicity one may assume that the mesh is manifold (an edge has no more than two adjacent faces) and that it is orientable (no funny Mobius strip stories), although I think the latter is not as important as I don't care about the orientation of the halfedges, I just need face adjacency.
Question
My question is whether someone has any better ideas for an algorithm, or suggestions for improvements of the above (or pointing out a mistake)?
Answer: I worked some more on this, and the comparisons complexity can be reduced at the expense of memory. To make this work I made arrays of the indices of the outgoing and incident half-edges for each vertex. Then the array with outgoing half-edges can be sorted according to the indices of the vertices at situated at the heads of the outgoing half-edges, and the array with the incident half-edges can be sorted according to the indices of the vertices at the tails of the incident half-edges. Then for an oriented closed manifold triangulation, the elements with the same index in the two sorted arrays will be twin half-edges. For a non-closed manifold the comparison can be done in linear time.
It seems like a hash is entirely unnecessary.


Borders appear when reducing the global opacity of multiple raster images in QGIS 3.2.3

Question:
I want to reduce the opacity of multiple raster images and when I use the global opacity slider to do so, black borders appear between my images. I would want to eliminate these borders.
Comment: Thank you for the answers. The first solution worked just fine for me as the raster is indeed a base layer.
Answer: Explanation
It looks like your rasters overlap slightly. When you make overlapping rasters transparent, the overlapped area will appear darker than the surrounding area. With an array of rasters, this creates the appearance of a dark border around the each raster.

Easy Solution - only works if the rasters are your base layer
You can achieve a similar visual effect without the borders by putting a transparent mask over the rasters instead of making the rasters transparent. This method only works if you were using the rasters as a base layer, because any layers under the raster will be completely hidden.
Create a new vector polygon layer and manually draw a polygon that covers all the rasters. Set the style to simple fill with no border, make the polygon fill white, and set transparency. 80% transparency for the mask layer creates a similar appearance to the raster layer transparency of 20%.

More complicated solution - if the rasters are not your base layer
If you need to overlay the transparent rasters on top of other data, you'll have to remove the overlap. You can do this manually with one of the GDAL Clip tools:

Since you have so many rasters, removing the overlap manually will take a long time. Using the batch processing mode of the GDAL clip tool will speed it up. Even faster ways may exist, such as automating the clipping with Python, or building a virtual raster.
Answer: Try boulding raster mosaic using Saga or GDAL: Combining multiple overlapping rasters.
You can solve overlaping issue and its much easier to manipulate with one catalog than with many rasters.


How to make explorer in Vista remember a folder's view?

Question: For no apparent rhyme or reason Vista will decide to show a folder that was previously in details view to start showing thumbnails. I go to the folder and right-click, Customize, and set it the template to "All Items", and "Also apply this template to all sub-folders", but it some point it will again decide to display it as thumbnails. Is there a way to force this setting to stay, or is it that possibly something is changing it that I am not aware of?
Comment: I also love when a random "group by" gets applied for no apparent reason.  I'm going with "bug" (because it has yet to happen to me in Windows 7), but we will see.
Comment: Oh, I will follow this one. For some reason Vista has decided that nearly every folder in my computer contains images and videos. They don't.
Comment: This has happened to me with both XP and Vista.
Comment: All I could think off is your own suggestion...
Answer: There seems to be multiple things that might cause this as an issue, and multiple resolutions as well, hopefully solving or making this "bug" appear less frequently.

Manually resetting the folder view cache/settings

Start regedit. (Win+R, enter regedit, press Enter or click OK. )
Browse to HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell.
Delete the keys Bags and BagMRU.
Browse to HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell, repeat step 3.
Browse to HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam, repeat step 3.

Trying some of these additional tweaks might help, mix it with it and see what you get.

Disabling automatic folder type discovery

Browse to HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell in regedit.
Create a new key under Shell, called Bags.
Create a new key under Bags, called AllFolders.
Create a new key under AllFolders, called Shell.
Create a new string value under Shell, called FolderType.
Set the string value of FolderType to NotSpecified.

You can increase the size of the folder view cache as well.

Increasing the size of the folder view cache

Browse to HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell.
Set the DWORD value of BagMRU size to something higher than 5000.

Note: If it's not there, create it.

After resetting the cache/settings + apply tweaks

Log off/on or reboot.
Open a Windows Explorer window and go to the Folder Options window.

Select the View tab.
Check Remember each folder's view settings.
Uncheck Restore previous folder windows at logon.
Hit the OK!

This should do it, or rather, perhaps improve the experience. Nevertheless, using an application as CCleaner with the wrong settings can disrupt and delete your settings, so be aware and checking before you use applications focused on "cleaning up".
Answer: I had this issue until I disabled UAC. It seemed it took administrator privileges to save the view setting.
I admit I tried no other solutions, so perhaps there's a better (more secure?) remedy.
Answer: You can make a batch file from @Thor helpful answer:
@echo off
for %%a in ("HKCR\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell" "HKCR\Software\Microsoft\Windows\Shell" "HKCR\Software\Microsoft\Windows\ShellNoRoom") do (
  for %%b in (Bags BagMRU) do (
    reg delete "%%~a\%%~b" /f
  )
)
:: Additional tweaks
reg add "HKCR\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell" /v FolderType /t REG_SZ /d NotSpecified /f
reg add "HKCR\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell" /v "BagMRU Size" /t REG_DWORD /d 10000 /f
rundll32 user32.dll,UpdatePerUserSystemParameters
taskkill /f /im explorer.exe & explorer
exit /b 0


Is there any chance to return ability to make question or should i open a new account

Question: My account is blocked  , so I can't make any question anymore.
Is there any chance to be unblocked or I just should open a new account ?
Answer: Rather than trying to evade the block, you should consider why you're blocked. The automated post bans start after you create too many poorly-received questions, i.e. questions that are off-topic or not fit for the Q&A format. Deleted questions count, and count heavily against you.
I noticed that you don't have the Informed badge, so I will direct you to the tour. Please also look at How do I ask a good question? and What topics can I ask about here?, both from the help center, which would be good to look through.
You can save yourself by editing your existing questions into shape, polishing up their presentiation (formatting and grammar). If you can find your now-deleted questions - there should be a link somewhere in your profile, visible only to you and moderators - undelete them if possible (doable only if you deleted them yourself) and improve them.
Opening a new account will not help. The system is smart enough to know when someone's trying to avoid a post ban.
Comment: @alex Extended comment exchanges look really messy, so I can understand why people like to clean them up. In this case, I think it would have been better to move them to chat so there's a record; some useful things were said.
Comment: @alex - The only reason our comments would have been deleted is because I flagged them for removal, because they were not constructive, their removal has NOTHING to do with trying to censure you.  Comments are subject to be removed for any reason, at any time, they are not meant for extended discussions.
Comment: @alex Note that neither I nor Ramhound currently have the ability to unilaterally remove comments. A moderator agreed with the flag, and so removed the comments. If you would like some input on how to improve your content, you could also go to one of the two major chatrooms here (*Root Access*, or *Ask a Super User Moderator*); chat works better for these sort of exchanges than do comment chains.
Comment: "polishing up their presentiation" - e.g. spelling :-p
Comment: This site is becoming very censured. A lot's of comments that are presenting true things about how this site works, are deleted because a group of moderators and other VIP users don't like them. And to hide the real reason for deletion ,  these comments  are called " off topic ".
Comment: @Ramhound   No my friend , the reason that you've removed them , is because with my last comments I've asked to you to show me if 2 phrases were duplicate or not , and of course you didn't know how to respond. These comments are not off topic because we were talking about how most of my questions were wrongly marked as duplicate from you . My questions are duplicate ?? , are you so smart discovering duplicates ? Ok, please tell me if these 2 phrases are duplicate : 1) I'm saying today , you will come with me. 2) I'm saying , today you will come with me .


Instructions for installing libdvdcss on ubuntu 15.10

Question: I am running Ubuntu 15.10 and trying to get VLC to work. I installed VLC, and libdvd-pkg from terminal. Then I downloaded libdvdcss, I need instructions on how to get it to terminal to make it work.
Answer: Installing libdvdcss

Legal warning: Check with your local laws to make sure usage of
  libdvdcss2 would be legal in your area.

From Ubuntu 15.10 onwards, libdvd-pkg is available to ease the installation of libdvdcss.
Install the libdvd-pkg package (no need to add third party repositories) via Synaptic or command line:
sudo apt-get install libdvd-pkg

Then run the following commands to complete the libdvdcss installation:
sudo apt-get update
sudo apt-get upgrade

Source
Comment: Try unscrambling with `sudo dpkg-reconfigure libdvd-pkg`
Comment: Already installed libdvd-pkg. It still seems to be scrambled
Comment: "Follow libdvd-pkg's instructions to let it download, compile, and install libdvdcss." Would be worth mentioning what instructions those are.
Answer: Step 1 - open terminal.
Step 2: - copy/paste into terminal:

sudo apt-get install libdvd-pkg

Step 3 - copy/paste into terminal:

sudo /usr/lib/libdvd-pkg/b-i_libdvdcss.sh

Step 4 - Hit Enter
Step 5 - Enter password
Step 6 - When installation is complete: close terminal.
Tested successfully on Ubuntu Mate 16.04.
Comment: Worked with Xenial with unity desktop as well.


technique for side handles on cutting board

Question: Ive seen cutting boards with metal handles installed  from the side faces that don't appear to have any outside facing screw holes.. how the heck are they doing this?
Comment: Without photos, all we cannot do is guess. I could suggest hanger bolts, but I have no evidence.
Comment: Welcome to the Woodworking.SE! It would be very helpful if you can add some photos of examples, as keshlam mentioned.
Comment: If they just disappear into a slot cut in the wood they could be glued in place. Alternatively if you have never seen the underside they could be held by screws driven in from the bottom..
Comment: thanks guys, here is a link to something similar. I can't get a photo of the actual board I saw however this is the closest thing i've found. I inspected the bottom and nothing to suggest it had been screwed from the underside. Glue seemed like the only viable option if so what would be the best method if the handle was designed to be screwed from the back. Not sure about this example but at least you can see what I mean. http://www.houzz.com/photos/27764776/Farmhouse-Cutting-Board-with-Side-Handles-industrial-cutting-boards - thanks for the welcome guys.
Answer: I see two possible methods for mounting these handles.  The first is to use a cross dowel nut and threaded rods mounted from a hole on the underside of the cutting board.
The second is to use hanger bolts set into the cutting board in oversized drilled openings using epoxy.
Comment: I agree, I think epoxy is probably the only solution I can see being effective here without additional mortising or holes.
I do think it is worth addressing the overall effectiveness of handles of this type on a cutting board over some sort of mortised in finger hold.
Answer: Based on the board linked to in the Comments above I'd say that style of handle is almost certainly glued in place.
You could pin then, with a piece of steel or brass rod (similar to how some knife handles are held in place), but with the right adhesive that sort of mechanical fixing is not at all necessary on anything that doesn't have to take much strain.
Best glues to use here I think would be epoxy (especially useful if the fit of the metal in the holes is a little sloppy) and polyurethane adhesive, like the original Gorilla Glue. Note that despite polyurethane adhesive foaming up and appearing to fill gaps it is not a gap-filling glue, and is only suitable here if the rods are a tight fit in the holes.
If you wanted the handles to be removable for some reason (I can't think why) you can fix something like this in place with what are called grub screws, but they would be plainly visible on the underside if they were used and if made from steel there would be the potential for them to rust, even if zinc plated.


Does having a basement level increase overall earthquake resistance of a high rise building?

Question: Does having a basement level increase overall earthquake resistance of a high rise building? Does it also lessen the burden on pile foundations?
Answer: Not necessarily, conventional earthquake-resistant high risers are designed considering the height of the structure the total height from the foundation to the roof, basically considering any underground stories as part of the structure unless for some special cases such as marine structures or high subterainean water level the lower part of the structure is contained in a big subterainean box.
In theory, it could be studied if designing the structure as a flag pole to take advantage of the subterranean part of the structure as a deep foundation that helps absorb some of the forces of the earthquake, albeit with an eye on the accentuated shear forces at the ground level floor, provisions for designing the first-floor connection to surrounding grade, and also additional stiffness of the building possibly absorbing high-intensity stresses during an earthquake. I am not aware of any building designed as such.
Modern active tall building seismic design is a different paradigm that is outside of the scope of this answer.
As for the underground floor helping to reduce the load on the foundation, again, it would make sense to think the void is lighter than the earth it replaces, although it adds the weight of a new floor, however in practice this is not considered unless specifically rocommended by approved soil and geology report.


What is replay debugging?

Question: I've read some info here but looks like the site concerned itself only with vmware and moreover it has abandoned the idea. How can this concept be used with existing debugging environments like IDA and gdb.If it has already been implemented, I would like links about the same.
Comment: The link you have provided clearly explains what replay debugging is. Please clarify your question?
Comment: Great questions! You should edit your original question to include all that. Otherwise, it sounds to broad. Plus, you answered the original question with your link.
Comment: I want to know how it can be used as an aid in debugging. For example can it be integrated in existing debugging environment and to what benefit? If it was such popular idea then why the site dropped it ?can we ,for example make replay files and then share it with fellow analysts?
Comment: The site provided a lot of info. The reason I asked it here was to create new knowledge. Moreover, the product is merely for vmware. What about integration with gdb and ida and how.Information from a single source cannot help me progress further.
Comment: GDB includes [a form of this](http://sourceware.org/gdb/current/onlinedocs/gdb/Process-Record-and-Replay.html) since version 7 and allows also "reverse debugging". VMware on the other hand has abandoned it (despite complaints) with the move from version 7.x to 8.x. I'm not aware that IDA has such capabilities built-in. Perhaps with the GDB stub it could work?
Answer: Please excuse the shameless plug, but do check out UndoDB - http://undo-software.com/
It's functionally pretty similar to gdb 7's reversible debugging, but with radically improved performance. Recording slow-down is typically in the 2x-5x range, with memory usage typically around 10MB per second of recording.
Answer: Mozilla rr
In addition to the closed source Undo mentioned at https://reverseengineering.stackexchange.com/a/2503/12321 , we now also have an amazing open source working implementation: https://github.com/mozilla/rr
I have given a minimal runnable example of it at: https://stackoverflow.com/questions/1206872/how-to-go-to-the-previous-line-in-gdb/46996380#46996380
As seen in that example, you first record, and then replay, and the replay makes every non-deterministic event (e.g. thread switch timings, random number generation) deterministic to match the previous run.
One huge advantage of that is that it allows you to step back in time, which is extremely often what you want to do when debugging applications, to go from crash back to the real cause that happened in the past.
QEMU reverse debugging
Besides the userland reverse debugging which uses hardware and Linux kernel features, simulators can also implement a reverse debugging of course since they control everything.
In particular, QEMU has had a reverse debugging mode which allows for this: It is not necessarily "replay based", but it achieves the same thing: you can step back in time. The cool thing about doing it in an emulator, is that you can also reverse step debug the Linux kernel itself if you are developing it on QEMU.
See also: https://stackoverflow.com/questions/29153178/is-it-possible-to-do-reverse-debugging-with-qemu/46499855#46499855

What is replay debugging?


How can I update Minecraft for PS3?

Question: I can't figure out how to update minecraft for PS3. I just bought the game and I would expect it to ask for a update but it hasn't. So how can I update Minecraft? Also would it take internet to update?
Answer: PS3 has been discontinued for years now, and the last update was here and that wasn't even a feature update, just bug fixes and removing features.
Legacy console has been discontinued and while maybe you'll get occasional fixes or something like that, don't expect updates. Feature updates will never come.
Comment: To build on what you said, If you were to buy Minecraft on PS4 (and I think PS5 since they both use the PS4 version), you can transfer all worlds from the PS3 version to the Legacy Console version of the PS4, then move those into the Bedrock version. By doing that, you would then receive all new updates when they release, and even use those old worlds to experience new features.

How can I update Minecraft for PS3?


Is there a way to reconstruct the rust types from the runtime metadata?

Question: It's possible to get the metadata information using the state_getMetadata RPC method.  Then I want to reconstruct the corresponding rust types described in the metadata json type registry and decode the runtime state content based on the parsed type. Since the type registry has implemented JsonSchema, I tried to reconstruct using quicktype, but no luck. Any other ideas?
Answer: In Rust, it is not possible to create a struct at runtime due to the absence of a reflection system.
Currently, the most convenient approach is employed in subxt. It involves fetching the metadata first and constructing those types statically before embedding them into the compiling code.
For further reading on this topic, you may refer to:

https://stackoverflow.com/questions/47159418/is-it-possible-to-define-structs-at-runtime-or-otherwise-achieve-a-similar-effec
https://www.reddit.com/r/rust/comments/9wr5wi/crazy_idea_is_possible_to_build_structs/
https://github.com/paritytech/subxt?tab=readme-ov-file#downloading-metadata-from-a-substrate-node
Comment: I'd also just add that if you do want to be able to decode SCALE bytes (with a known type ID + metadata) at runtime, then https://github.com/paritytech/scale-value is useful; it's sortof the SCALE equivalent of `serde_json::Value` :)


Does iCloud backup only backup non-deleted pictures?

Question: I have deleted some photos on my iPad (both from camera roll and photo stream) and I never want them to be found. I heard that you can use "iCloud backup" to restore your stuff in case your iPad crashes or whatever. If at some point I were to backup my iPad, would those    pictures still be found even though I have deleted them? If so, how can they be gotten  rid of forever? I know this probably sounds very strange, but it would be nice to know just in case of emergency.
Answer: The pictures won't return as long as you did a backup after you deleted them from your device.


Convenient solution for using Symfony + SASS/Jade

Question: Setup: PHP 5.4.8 + Symfony 2 dev + SASS + Jade.
How do you use it together?
I found a number of ways, but none of them seems good and clean. E.g. we have a jade.php project which has not been updated in over two years.
If it turns out that it is necessary to fall back to HAML and LESS, which is a good solution for them?
I already googled these things, but I want to know your personal experience with this issue, something about real production.
Answer: You can take a look at Assetic.
Comment: Ass there is no Jade Filter right now, this might not help much!


Installing ElastiCache Cluster Client on PHP AWS Elastic Beanstalk (without creating resource)

Question: Elastic Beanstalk does not, by default, install the ElastiCache Cluster Client PHP module. This is needed to connect to an ElastiCache node cluster. Reading around, most of the instructions relate to creating an ElastiCache resource (which I assume will also install the PHP module on the Elastic Beanstalk). I want to install the PHP module without creating the resource as I want to use an existing cluster.
(64bit Linux PHP5.5)
Answer: You will need to download the AWS ElastiCache client for PHP which is available from the AWS ElastiCache Console. The client also supports Auto-Discovery of the ElastiCache nodes you will just need to configure the client with the proper endpoint for your ElastiCache cluster.


MMBT2222 (SMD) transistor over 2N2222 (Non SMD) transistor

Question: I am using a 2N2222 transistor circuit to drive 2 Relays which are parallel to each other. Can I use MMBT2222 (SMD) transistor instead of 2N2222 (Non SMD) transistor? What will be the disadvantages?
Comment: Probably. But if you want a real answer, provide more information (add a schematic and specifications for the relay and a link to the transistor data sheet).
Comment: Compare the datasheets.
Comment: Calculate power dissipated in transistor (max Vcesat x current)  and temperature rise by datasheet RthJA.
Comment: Thank You @peufeu for the suggestion. I will consider this.
Answer: Assuming (and you shouldn't, and should read the datasheets carefully) the same die is in each package the differences will be mostly thermal (there might be some small differences in parasitic inductance and capacitance, but that's not very important with a sluggish old transistor like the xx2222 (ft = 250MHz).
Thermally the SMT transistor behavior changes a lot more with the PCB design (the amount of copper connected to the lead frame and so on) so when you are doing your calculations you need to pay attention to the exact test conditions under which the power dissipation is specified. If it's got a square inch of 1 oz (sorry for the non-metric units) copper connected to the collector tab and you have a thin single layer board with 0.5oz copper you will get more temperature rise.
The "real" 2N2222 is packaged in a hermetic TO-18 metal can and has the best thermal capability. However there are no JEDEC police, as far as I know and most parts that are called 2N2222 are more like PN2222 (TO-92 packaged), with less thermal performance and not hermetic. The MMBTxxx are SOT-23 and generally capable of even less power dissipation. It's possible someone makes SC-70 transistors called 2N2222 as well, and they would likely be even smaller and less capable of dissipating power.
Comment: Very good point on datasheets, particularly for a 'standard' part like the xx2222 which is made by numerous vendors, and all the datasheets have subtle (sometimes not so subtle) differences.
Comment: @PeterSmith Yes, even including pinouts on TO-92 sometimes.


How can WCF client detect that server requires security certificate?

Question: How can WCF client detect that server requires security certificate? The detection should happen at runtime.
Answer: The first thing that I have in mind to resolve such issue it will be to connect to that server and call a method or something like that. Put the server call in a try-catch block and read the message at runtime.
For example, I tried this in a application of mine which connected with a server with security certificates, deleting the part for certificates in my clients. I had an error like this:
The client certificate is not provided. Specify a client certificate in ClientCredentials.
So if this Exception is caught, you can detect at runtime that the server requires security certificate.
There may be more Exception messages for this problem. Also, I don't know if it is the best way. But it should work.
Answer: You need to know that up front (design time). There is no foolproof way to know this at runtime (you could guess from an error message but this is not a good idea.)
If it is required to decide this only at runtime then client and server must agree on their own protocol to communicate this (e.g. an operation IsCertRequired).


Where is the "slice" button in Cura?

Question: I'm relatively new to Cura, having just installed it a few weeks ago.  I have 3.0.3 and I'm running on Windows 7 64 bit.  I noticed the auto slicing setting while poking around the settings.  Auto slice almost always works.
A couple times now, Cura won't auto slice. I can't seem to find the slice button.  How do I manually slice?  I found an article on how to disable auto slicing, but it doesn't show how to manually slice.
Where the button "save to file" is is greyed out and just says "Print with Octoprint".
Closing Cura and re-opening it will fix the issue.
Comment: Probably an example of this bug. https://github.com/Ultimaker/Cura/issues/2693 Can you reliably reproduce it?
Comment: Maybe do a reinstall? I dont know if you messed with the settings?
Answer: If auto-slicing is disabled, the button in the bottom-right corner of the window toggles between "Prepare" and "Save to File" depending on whether the model needs to be re-sliced or not. While slicing is in progress, it changes to "Cancel".
If auto-slicing is enabled, the button always reads "Save to File", and is greyed-out when slicing is being performed (it does not change to "Cancel").
Comment: Does that button show up when auto slicing is enabled?
Comment: Yes, Answer edited.

Where is the "slice" button in Cura?


Is it fine to update my phone to 9.3.2 iOS if I'm using iPhone 4s

Question: Is it fine if i go and update my phone to iOS 9.3.2? I am using iPhone 4s. I don't know if it's fine to update it or not. Cause I see lots of people not updating there's
Answer: You didn't indicate if your iPhone is jailbroken or not so I'm going on the assumption that it's not.
My recommendation to all questions like this is to say 'yes, you should always upgrade to the most recent iOS version'.  However, only you can decide if it's worth the upgrade or not.  If you do decide to upgrade, be sure to do a backup first.  If you don't like it, you can go back to what you have.
There are not many general user enhancements in this version (here is the list of changes), but there are many security and bug fixes that you should have (as documented here).  Most of the issues being reported in this version reference the iPad Pro.  If you have an iPad Pro, I recommend not upgrading right now.


Did Harry ever make use of his Occlumency lessons

Question: In any events after Harry had his first lesson with Snape, was there any record of him using anything he'd learnt in one of the lessons successfully?
Answer:
Harry was able to close his mind off from Voldemort when he experienced grief (e.g. after Dobby died) but it's unclear whether that counts as a real Occlumency.

His scar burned, but he was master of the pain, he felt it, yet was apart from it. He had learned control at last, learned to shut his mind to Voldemort, the very thing Dumbledore had wanted him to learn from Snape. Just as Voldemort had not been able to possess Harry while Harry was consumed with grief for Sirius, so his thoughts could not penetrate Harry now while he mourned Dobby. Grief, it seemed, drove Voldemort out... though Dumbledore, of course, would have said that it was love. (Deathly Hallows, Chapter 24: The Wandmaker)

There were no cases when he successfully used Occlumency other than grief-influenced immunity, either with Snape during practice or Voldemort.
Nobody tried to Legilimency on Harry aside from those two in the books (discounting Sorting Hat in books 1/2).
Comment: Can you give a quote for the first one?
Comment: @ike - indubitably. See the edit
Answer: No, because he has the dreams and visions throughout 5 and there's never a line like 'he tried to not see what he was seeing and it worked' or anything to that extent.
He manages to stop Snape from seeing more of his memories at one moment in their lessons but it's implied that he was too emotional. Page 534, chapter Occlumency. Snape says:

'Did you mean to produce a stinging hex?' (There's an 'angry weal' like a 'scorch mark' on his wrist.)
  'No,' said Harry bitterly, getting up from the floor.
  'I thought not,' said Snape, watching him closely. 'You let me get in too far. You lost control.'

Then page 636 he tries to practice during classes:

'but it was no good, hermione kept asking him what was wrong whenever he fell silent trying to rid himself of all thought and emotion and, after all, the best moment to empty his brain was not while teachers were firing review questions at the class.'

(This is their OWL year so there is a lot of review.)
But, there is a moment during one of there lessons where he uses a shield charm that protects himself from having memories revealed, but then he starts to see shape's memories. Snape says something like

'I don't remember telling you to use a shield charm but there is no doubt that it was effective.'

page 592.


Mechanical heart in Latin

Question: What would be the correct translation of "mechanical heart" as in sense of a core, something thanks to what a system runs? I was told "cor mechanicum", but I'd like to double-check it. Thanks for any help!
Answer: This reminds me of the introduction to Hobbes' Leviathan. Though Leviathan was originally published in English in 1651, he produced a revised Latin edition in 1668. Here are the first lines of the intro:

NATURAM, id est, illam qua mundum Deus condidit et gubernat, divinam artem, eatenus imitatur ars humana, ut possit inter alia producere artificiale animal. Cum enim vita nihil aliud sit quam artuum motus, cujus principium est internum in parte aliqua corporis principali, quid obstat quo minus dicamus automata omnia, sive machinas omnes quae ab elastris rotulisque intus dispositis motum habent, ut horologia, in seipsis, habere etiam artificialem vitam? Quid est cor nisi elastrum, quid nervi nisi chordae, quid articuli nisi totidem rotulae motum, qualem voluit artifex, toti corpori impertientes?

Here's the original English version of the same intro:

Nature (the art whereby God hath made and governes the world) is by the
art of man, as in many other things, so in this also imitated, that it
can make an Artificial Animal. For seeing life is but a motion of Limbs,
the begining whereof is in some principall part within; why may we not
say, that all Automata (Engines that move themselves by springs and
wheeles as doth a watch) have an artificiall life? For what is the
Heart, but a Spring; and the Nerves, but so many Strings; and the
Joynts, but so many Wheeles, giving motion to the whole Body, such as
was intended by the Artificer?

My suggestion, based on this, is cor artificiale, though the passage gives many other possible words to explore, e.g. automaton, machina, etc.
In this context, "artificial" is contrasted with "natural."

Mechanical heart in Latin


Trying to replicate the threads on a jar for the company i work for. How to extend length of the wrap

Question:
This is our jar. Im trying to replicate those threads exactly. I did a screw modifier as a separate object.
Here is my model in blender
heres the file
Answer: You should create the thread within the same mesh as the rest, but if we keep it as a separate mesh:

Put your 3D cursor at the center of this object. Set the 3D cursor as the Pivot Point. Select a part of the mesh.

Duplicate the selection with a ShiftD then Enter. Make the duplication rotate around the Z axis and with the 3D cursor as center.

Delete the former thread extremity.

Join the parts with W > LoopTools > Bridge.

You've got your shape.


Significance of interactions

Question: It was suggested to me recently that the significance of an interaction term in a glm has to be higher than a main effect. For example, p<0.05 is commonly thought of as significant for a main effect but a two-way interaction has to be higher (p<0.025 or something) and a three-way even higher. However, I can't find any literature on this so I am unsure. Are they getting confused with multiple comparisons I wonder? Or am I confused and the two things are linked?
Comment: I can conceive that someone *might choose* to apply a more stringent significance level on interactions. Since the number of interactions and higher order interactions grow at a rapid rate (if there are enough factors), I can see some argument for it, such as if one were trying to make a similar number of type I errors at each order. I don't see how that somewhat plausible argument leads to an 'ought', though.
Answer: I've never heard that and, to me, it makes little sense.
First there are all the usual problems with p values and cutoffs. But, if anything, I think the p value cutoff for interactions ought to be more lenient than that for main effects, since they can be harder to find if either or both main effects are measured less than perfectly reliably.
Comment: Thanks, I thought so, but it was suggested by a superior so I thought it would be good to triple check things.
Comment: If anything, I've also seen interactions tested at a more lenient significance level (usually p<0.1 in biomedical research). @Peter, do you have a reference for why interactions should be tested more leniently, or is it simply common practice?
Comment: I haven't got a reference and I'm not sure how common it is, but it seems to make sense.
Comment: Thanks again, but I've just thought of something else.... If the interaction is between categorical variables with multiple levels and I am using contrasts (essentially multiple comparisons) to determine the significance of each level - should I be careful of the p values in that situation?
Comment: I am not sure why that situation would be different from others with multiple comparisons

Significance of interactions


Difference between binary malware and script-based malware?

Question: I'm well aware in the concept of binary malware but I don't fully understand the idea of a script-based (or shell script) malware. I am more interested in the difference especially in how script-based malwares are multi-platform and can work across architectures, as opposed to normal binary malwares.
Comment: This is ridiculously simple, but script-based would be something *like* this: `svdo rm -rf /` -- it's a script command that does something bad (deletes your root folder, recursively). Obviously there's worse (like searching for passwords, joining botnet, etc.)
Answer: In an interpreted programming language the interpreter is compiled for each architecture but the scripts they interpret can generally be interpreted on any platform. Generally functions which might be operating system dependent (such as various system calls) are abstracted so the functions available in the interpreted language work the same regardless of OS.
Also relevant:
Can a .sh file be malware?
http://en.wikipedia.org/wiki/Interpreted_language
Comment: In *interpreted* language, the script is not *compiled*, but *interpreted*! But the interpreter is compiled for each architecture. See also: [Interpreted languages](http://en.wikipedia.org/wiki/Interpreted_language)
Comment: @F.Hauri that's exactly what I said "the interpreter is compiled for each architecture".


How to find boundary data for cities in Utah

Question: I'm working on a brand new project where I need boundary data for various cities in Utah. Salt Lake City was easy since their data is available for public download. The other cities? Not so much. Apparently this information is available as US Census data but I'm having a hard time parsing out the boundary data within. I'm more of a web developer so, I've never been in the position of tracking down the data itself. Annoyingly, a lot of cities in Utah have this information available as pdf download but I need the lat long city boundaries to build polygons in a web map. Can any of you more experienced cartographers help me?
Comment: The Census Bureau shapefile you'd want is the one for "Places". In CB terminology, this includes incorporated towns and cities, as well as some unincorporated population centers: http://www.census.gov/geo/reference/gtc/gtc_place.html. For states that have minor civil divisions (Utah's not one of them), you could also look at the County Subdivisions file: http://www.census.gov/geo/reference/gtc/gtc_cousub.html
Comment: Yeah, I wanted the data itself.....I hate working with raster shapefiles....
Answer: The Provo GIS Office was very helpful! Turns out the state of Utah keeps all this info for easy download on their website!
http://gis.utah.gov/data/boundaries/citycountystate/


How to Change the Order of taxonomy in term store SharePoint

Question: How do i rearrange taxonomy term store from the top to bottom ? I just did delete and add again, but its the same issue happened. Still at the top of the global nav under technical
Answer: I'm not sure if the TermStore is different on SP-Online vs On-Prem, but on the assumption they're functionally the same...
Click on the Term Set that you want (1). In the ribbon to the top of the term set interface, select Custom Sort (2). Then select Use Custom Sort Order (3). From there you can select the order you want the term sets in, rather than an alpha-numeric order.
Then click save, and refresh the page. The terms should be in your specified order.


Change the splash screen on moto e4 plus owens

Question: I was rooting my device and I screwed it up but I got twrp to runs and I installed Lineage OS. But after I restarted my device, there is a tiny n/a in the corner until the Lineage's logo appears. I searched for a while but came up dry. It's not that bad but I would like something else to be shown instead of n/a. Thanks for any help.
Comment: So I downloaded the zip file and in the menu selected moto e1/2 and I added an image and I transferred the zip to the phone and then tried to flash it and it spit up error code 6
Answer: There are two ways of doing it, but both methods will require some files.
Method 1: fastboot

Aquire a splashscreen file in the format of '.bin'. You can either search for
splashscreen .bin files made for your device, or find a tool that allows you to convert and image to a splashscreen .bin.
Put your phone in bootloader mode manually or with adb:

adb reboot bootloader

Flash the new logo to the device:

fastboot flash logo filename.bin

Method 2: TWRP

Install TWRP as your bootloader (in your case you already have)
Aquire a zip file specifically crafted for your device to flash a splashscreen logo*
Copy the zip to your phone via OTG or SD-card and flash it with TWRP

*Note: as far as I've seen the zip file only needs to contain three files:

META-INF/com/google/android/update-binary
META-INF/com/google/android/updater-script
logo.bin OR splash.bin OR logo.img

But they have to be specifically crafted for your device, and in order to do that you will need a tool. See this XDA thread to find a guide with tools for your device.
Edit: I checked the thread for your phones product line, it looks like the E4 Plus is unsupported, at least nobody has added support for it here. You might need to look elsewhere for a tool that can make images for your phone.


EV3 gyroscope drifts when brick is still - what can be done?

Question: The gyroscope value continuously increases/decreases, even when the brick is not rotating! What could be done in order to avoid, mitigate or at least reduce the impact of this behaviour?
Comment: *I know that this has been answered a few other times, but it's such a common problem I thought it best to have a dedicated question/answer for it.
Answer: This is a pretty common issue called "gyro drift". If the gyroscope is rotating when plugged in and/or when the brick starts up, that constant rotation will be seen as "resting", and when the gyroscope is still, it believes it is rotating.
There are two main fixes to this

Hardware fix
In this, you simply unplug the gyroscope, then plug it back in while holding the robot very still. Any rotation can drift the gyroscope, however, it is pretty simple for most robots.
Alternatively, completely restart the robot while keeping it still. Most of the time this is easier to do, though it takes quite a while.

Software fix
In the software, you can account for the gyroscope drift. Instead of measuring the gyroscope directly, create a variable called gyro. At the start of the program, measure the gyroscope speed multiple times (about 10 should be good for most applications), waiting a small amount of time (try 0.05 seconds) between each, and take the average of the measurements. Then, every second, change the gyro variable by the gyro speed MINUS the averaged gyroscope drift. My preferred method for doing this is to broadcast a message, and have a forever loop in the broadcast receiver, updating gyro and waiting one second in the loop. This keeps your main forever loop free to run quickly.


Origin of "Great acts are made up of small deeds"

Question: It is easy to find the author - Lao Tzu. But I lost hope trying to find the context, e.g. the book of the quote's origin. Hoping Stack Exchange philosophers can provide the answer.
Answer: Tao Te Ching, Chapter 63.
See e.g. Wordsworth Edition with A.Waley translation,1997, page 66.
From a different translation: Lao Tzu, Te-Tao Ching: A New Translation Based on the Recently Discovered Ma-wang-tui Texts (Robert Henricks editor, 1992, Ballantine Books):

The most difficult things in the world begin as things that are easy;

The largest things in the world arise from the minute.
Answer: 天下難事必作於易,天下大事必作於細
Tianxia  nanshi bi zuo yu yi
Tianxia dashi bi zuo yu xi
I would translate this: difficult things in the world must be done with ease, and great things in the world must be done done with care/(pay attention  to details)...
In the context of ch. 63 (:when) "difficult...with care" then the derails make the difficult task easy."
For example: when sages are well versed in the canons, it is easy for them to explain a difficult text to a layman.


Mechanic says rear differential is shot

Question: Mechanic is saying rear differential is shot and needs replacing.  Car hasn't been making any noises, actually only took it in to look at a leak in coolant reservoir.  Wouldn't there be lots of grinding noise if my differential was bad?
Comment: Welcome to Motor Vehicle Maintenance & Repair! How did the mechanic know the differential is bad? What were the indicators to him? If no straight answer, take it to another mechanic for a second opinion. You could look to see if it's leaking, but as you said, if it's going bad, I'd expect noise. Usually starts out as a whine which is speed dependent and gets worse. Would change pitch if accelerating or decelerating. Also, what kind of vehicle are we talking about? Year/make/model/engine?
Comment: "rear differential" on a front wheel drive car?
Comment: Car is a 2014 Ford Escape, FWD, 1.4liter Ecoboost, drive is as quiet as new, no whining or grinding.  The only reason I took it to this mechanic is because my car is under warranty, the dealerships service dept is down for now and this is the mechanic they sent me to.
Comment: Additionally how would he be able to identify a bad differential when all he was asked to look at was a leak in my coolant reservoir?
Comment: Mechanic is smoking weed.
Answer: TL DR: Yes, noise would most likely be present if the differential is going/gone bad.
There are two main factors (I can think of) which would indicate a differential issue. First, if there is noise (as you stated). You'd hear a whine, usually on acceleration or deceleration. Mind you, some differentials are noisy in the deceleration portion and will live that way happily for many years. When they are going bad, you'll hear a change in noise level, where they will start getting louder over time (in either or both directions). The second way is if there is a leak. However, a leak in and of itself is not indicative of the need for complete replacement, but could be an indicator of bad things coming ... or could just mean it needs a new seal or gasket. The last thing you want to do is run the differential dry, as that will lead to imminent destruction.
In some shops, if a mechanic spots something which needs to be fixed and the customer buys off on it, the mechanic will get a higher percentage of pay on the repair. So, if the mechanic normally gets 25% of the per hour rate to fix an issue which comes to them, they might get 40% if they find the issue. It's lucrative for them to do so, so they are on the lookout for other issues. The problem is, I don't see how the mechanic could tell there's a problem with the differential either. In your case, it is buried within the transmission (as a transaxle). While a mechanic will look for other things while doing their assigned task(s), they aren't going to spend all day looking for stuff which doesn't exist, either. If they aren't working, they aren't making money ... looking for non-existent problems won't get them anywhere.
All-in-all, if it were me who were in your situation, I'd either not worry about it (due to the lack of noise) or if it's bothering you, take it to a different shop. To me, your description makes this sounds like a "Pink Tax" situation. I hope that isn't the case, but it sure sounds like it.

Mechanic says rear differential is shot


How hard was it to produce German zeppelin pilots in World War One?

Question: I would like to know how much time it took to train new zeppelin pilots, the cost to train them, if the airship pilots were normal airplane pilots, and the demand for them.
Any help will be appreciated and if you could tell me where you got the answer to any of the questions that would be great.
Comment: Welcome to History:SE. What has your research shown you so far? Where have you already searched? What did you find? Please help us to help you. You might find it helpful to review the [site tour](https://history.stackexchange.com/tour) and [Help Centre](https://history.stackexchange.com/help) and, in particular, [ask].
Comment: Can you clarify what it is you are asking exactly? As Mark has pointed out in his answer, Zeppelins didn't have pilots.
Comment: i would mention that training for pilots and submmariners, both very new forms of machines, was very ad hoc, maybe even until ww2 but especially ww1. automobile racers became sometimes fighter pilots and people who could train others to become fighter pilots specifically were rare indeed -- Roald Dahl, in ww2 entered combat with just a few hours of training and he was told he would probably die. For submariners, they looked for miners because of being used to closed spaces. For zeps I am guessing they looked for sailors, not airplane pilots whose skills would be better suited to planes.
Comment: If you don't have answers here, you could try [aviation.SE](https://aviation.stackexchange.com/questions/tagged/airship), but there is a chance the only answers you can get there are related to newest airship (such as the Zeppelin NT)
Answer: Zeppelins didn't have pilots.
Flying a Zeppelin was a team effort.  A typical R-class Zeppelin would have a cockpit crew of four: the elevator man, rudder man, navigator, and officer of the watch; additionally, each engine gondola would have a mechanic to operate the engines.  All this was necessary because of the limited degree of automation available: increasing speed, for example, meant signaling the mechanics to open the throttles on the engines.
A Zeppelin operated much like a ship, and the process of training a crew was similar.
Comment: Zeppelin's, in 1914 when they were taken over, had Commanders (Army) and in the Navy sometimes called  Captains  which coordinated the activities of the crew.
Comment: also, I think the analogous skills of a pilot were not required in zep because of the much, much slower maneuvering speed as well as limitations of maneuvering itself -- airplane pilots could turn sharply and even roll their aircraft whereas, almost exactly like a submarine, a zep pretty much only rose, descended and turned very slowly. i would argue that the control of a zep's movement would not have required nearly the skill of a skilled pilot even though the overal operation might have been more complex.
Comment: @releseabe: Think "*pilot*" in terms of a "*harbour pilot*" rather than an "*airplane pilot*".
Comment: @PieterGeerkens: I think the OP meant "pilot" as in the guy who flies the plane. A harbor pilot-like position would almost certainly not have existed aboard zeps. A navigator (who maybe also was sort of a weatherman since zeps were more subject to winds and perhaps thermals) would have been very important for zeps as a separate member of the crew from the guy doing the steering or perhaps he did both. But my point throughout is that maneuevering a zep did not require the same skill-level as piloting plane.
Comment: @releseabe, "rudder man" is a full-time job.  An airship is, at best, neutrally stable in yaw, so someone needs to be making constant adjustments to keep it flying in the correct direction.  Similarly, "navigator" is a full-time job if you're doing more than test flights over Lake Constance: you need to keep track of where the airship is, which way the winds are blowing it, and so on.  You can't combine the two positions.
Comment: @Mark: that makes sense but still nothing like the skills/reaction time of a biplane pilot.


USB ubuntu - how to retrieve saved data after reboot

Question: I saved couple of important files from my windows computer to USB Ubuntu while Ubuntu was running. But on restarting the USB Ubuntu I am unable to locate those files. is it normal that it  is erased? or is there any way i have get it back? I created a .New folder within documents and placed the files in that folder. but once i shut down Ubuntu and opened again those files are nowhere.. please help
Answer: Any changes made after booting with an Ubuntu live USB (including files/folders created) are usually erased when you shutdown, unless you made the live USB persistent when you created it.  That means that a file is created on the USB where the changes are stored.  Persistence is usually not done by default - only if you request it when you create the USB.
If you want to make the USB persistent then you'll need to create it again from scratch and make a persistent file.  I believe PenDriveLinux's program and Ubuntu's own live USB creator can make it persistent.
(technically, I don't think the files are actually wiped when you shut down - I believe they only exist in RAM and aren't copied to the USB)
Comment: The smallest USB drive to make a Ubuntu Live USB is 1GB. The persistent live USB needs a bigger USB drive.


Why did all the Ringbearers leave Middle-earth in the end?

Question: At the end of The Return of the King, Frodo, Bilbo, Gandalf, Elrond, and Galadriel left Middle-earth on a ship, along with other elves. I named those five because they were all ringbearers and it seems to be a common trait. Frodo and Bilbo bore the One Ring and the three others bore the three elven Rings.
Why did they have to do that? Why didn't they stay and have a peaceful life now that the Dark Lord was gone?
Comment: @xantec actually, he did eventually.
Comment: @MikeScott The movie isn't canon where it conflicts with the book (and arguably at all), and if you want to argue that, Sam wouldn't have needed to go as he hadn't put the Ring on, in the movie.
Comment: @MikeScott The question doesn't say that it's specifically about the movie canon. If not specified, people usually default to the books. And quite reasonably so, since they're a *lot* more detailed in information (especially counting in the other canon books), have been around for a lot longer, and are also the original version of the story.
Comment: Technically Sam was a ring bearer for a time and he didn't leave.
Comment: @Kevin He left in the book, but there's no evidence in the movie version to suggest that he eventually left, and since in the movie the ship that Frodo and Bilbo took was the *last* ship to leave for the Undying Lands, it's hard to see how he could have done so.
Comment: @Kevin Ah, my bad. Admittedly it has been a very long time since I read the books.
Comment: @Xantec To be fair, it wasn't in the main story.  It was in the addendum in the end, Appendix B.
Answer: Gandalf was Istari and did not properly belong to the mortal lands of Middle-earth anyhow.
Elrond (by his choice) and Galadriel (by her blood) were Elvenkind and destined to grow weary of Middle-earth. They long to take the Straight Road1 to the Blessed Realm as time goes on; they do not pass their days forever in Middle-earth.
The Hobbits Frodo and Bilbo (and later Samwise), although of Mortal kind, by virtue of having borne the One Ring also bore a weariness in their bones. But in Middle-earth they could find no relief from this. Although the Gift of Men (halflings being of Mankind) might bring them relief upon their death, they were granted a boon to travel to the West and pass their long days in peace until the Gift was granted them.2
1Since the Bending of the World, the only way to travel to Aman was by Elven ships following the Straight Road.
2It is also told in the Red Book of Westmarch that Gimli son of Glóin travelled to the Undying Lands in the company of his steadfast Elven companion Legolas, and for his love of Galadriel.
Comment: @Secko Istari are actaully Maiar, and come to Middle Earth from the outside. Unlike a lot of fantasy literature, they're *not* just individual men (or some other race) who just happen to possess ability to use magic, but rather could be compared to demigods or avatars of some sort.
Comment: Istar is wizard, istari are wizards of ME. What do you mean by - "Gandalf was Istari and did not belong to Middle-Earth anyhow."
Comment: I have clarified my statement and provided what I hope are helpful references.
Comment: @IlariKajaste Yes, I know. I was confused by the istari reference.
Answer: They each had different reasons, which Tolkien discusses in his Letters.
Gandalf
As he himself notes in Return of the King, with Sauron defeated his role in the world is at an end:

Do you not yet understand? My time is over: it is no longer my task to set things to rights, nor to help folk to do so.
Return of the King Book VI Chapter 7: "Homeward Bound"

And as Tolkien writes in Letter 181 that he was simply returning home after his long labours:

Gandalf was returning, his labour and errand finished, to his home, the land of the Valar.
The Letters of J.R.R. Tolkien 181: To Michael Straights (draft). 1956

Elrond and Galadriel
In Letter 181, Tolkien writes that, with the diminishment of the Three and the undoing of their preservatory works, they had nothing left for them in Middle-earth:

[W]ith the downfall of 'Power' their little efforts at preserving the past fell to bits. There was nothing more in Middle-earth for them, but weariness. So Elrond and Galadriel depart.
The Letters of J.R.R. Tolkien 181: To Michael Straights (draft). 1956

Galadriel, specifically
It's worth noting that Galadriel wasn't staying in Middle-earth for her health; according to Letter 297, she was actually forbidden from going over the Sea (emphasis his):

The Valar listened to the pleading of Eärendil on behalf of Elves and Men (both his kin), and sent a great host to their aid. Morgoth was overthrown and extruded from the World (the physical universe). The Exiles were allowed to return — save for a few chief actors in the rebellion of whom at the time of the L[ord of the ] R[ings] only Galadriel remained.
The Letters of J.R.R. Tolkien 297: To Mr. Rang (Draft). August 1967

In a footnote to this letter, Tolkien mentions that this ban was lifted by the Valar, as a reward for her aid against Sauron (emphasis his):

At the time of [Galadriel's] lament in Lórien she believed [her ban] to be perennial, as long as Earth endured. Hence she concludes her lament with a wish or prayer that Frodo may as a special grace be granted a purgatorial (but not penal) sojourn in Eressea, the Solitary Isle in sight of Aman, though for her the way is closed. (The Land of Aman after the downfall of Númenor, was no longer in physical existence 'within the circles of the world'.) Her prayer was granted – but also her personal ban was lifted, in reward for her services against Sauron, and above all for her rejection of the temptation to take the Ring when offered to her. So at the end we see her taking ship.
The Letters of J.R.R. Tolkien 297: To Mr. Rang (Draft). August 1967

This is echoed in broad strokes in Letter 320, though with the added detail that Galadriel refused forgiveness at the end of the First Age:

Galadriel was a penitent: in her youth a leader in the rebellion against the Valar (the angelic guardians). At the end of the First Age she proudly refused forgiveness or permission to return. She was pardoned because of her resistance to the final and overwhelming temptation to take the Ring for herself.
The Letters of J.R.R. Tolkien 320: To Mrs. Ruth Austin (excerpt). January 1971

Frodo
Arwen interceded on his behalf; she argued that because his suffering and her decision to become mortal were part of the same Divine Plan, he should be eligible to go to the Undying Lands in her place:

It is not made explicit how she could arrange this. She could not of course just transfer her ticket on the boat like that! For any except those of Elvish race 'sailing West' was not permitted, and any exception required 'authority', and she was not in direct communication with the Valar, especially not since her choice to become 'mortal'. What is meant is that it was Arwen who first thought of sending Frodo into the West, and put in a plea for him to Gandalf (direct or through Galadriel, or both), and she used her own renunciation of the right to go West as an argument. Her renunciation and suffering were related to and enmeshed with Frodo's: both were parts of a plan for the regeneration of the state of Men. Her prayer might therefore be specially effective, and her plan have a certain equity of exchange. No doubt it was Gandalf who was the authority that accepted her plea.
The Letters of J.R.R. Tolkien 246: To Eileen Elgar (drafts). September 1963

Bilbo
Gandalf gave him permission, and did so for two reasons:

He liked Bilbo
Frodo needed a hobbit companion in the Undying Lands, to help stave off madness:

Bilbo went too. No doubt as a completion of the plan due to Gandalf himself. Gandalf had a very great affection for Bilbo, from the hobbit's childhood onwards. His companionship was really necessary for Frodo's sake – it is difficult to imagine a hobbit, even one who had been through Frodo's experiences, being really happy even in an earthly paradise without a companion of his own kind, and Bilbo was the person that Frodo most loved.
The Letters of J.R.R. Tolkien 246: To Eileen Elgar (drafts). September 1963

Sam
We're never actually told why; we just know that he did.
One plausible reason is that, Bilbo presumably being dead by this point, Frodo was in need of a new companion. Since he was still a Ringbearer, however briefly, Sam, in his advancing years, may have found himself in need of some of the healing Frodo went in seek of. But that's all speculation.
Answer: With the destruction of the One Ring all that was wrought with the Three came to naught. For bearers of the Three, that made Middle-earth a much bleaker place. All that was preserved by the Three was undone. They could no longer resist the call of the land beyond the Sea, preserved from the very beginning.
The bearers of the One Ring had suffered greatly. For them the Straight Road was a reward and a chance for healing. For example, for Frodo there was no healing in Middle-earth:

One evening Sam came into the study and found his master looking very strange. He was very pale and his eyes seemed to see things far away.
'What's the matter, Mr. Frodo?' said Sam.
'I am wounded,' he answered, 'wounded; it will never really heal.'
But then he got up, and the turn seemed to pass, and he was quite himself the next day. It was not until afterwards that Sam recalled that the date was October the sixth. Two years before on that day it was dark in the dell under Weathertop.

But in Aman, there might be.
Answer: The reason the 3 Ring-bearer elves left is because the time of the elves was over, and the time of men had come, so the Ring-bearers no longer were needed for guidance. The reason that Bilbo and Frodo left is because in Middle-earth they could not escape the burdens the Ring had placed on them, such as Frodo being stabbed. Gandalf left because he had fulfilled his task as Gandalf the White. The only reason he came back in the first place was to see to it that the armies of Mordor were defeated and the Ring destroyed.
Comment: I'd say the time of the elves was over and the time of men had come *because* the elves left.  The remaining few elves didn't see any point in being the only ones left in Middle Earth. You might be putting the cart before the horse a bit.


How can I override a x86 instruction in c++?

Question: I am trying to replace a jmp instruction with a ret in c++. How can I do that?
Comment: If you have the source code then you can change that instruction to a return directly.  If you have only the binary, then you'll need a hex editor, search for the instruction sequence, and change it there.  However, the snippet is insufficient to know what kind of return is needed here.  You might have more luck by changing the jump target to the functions true epilogue, so that the stack is cleared correctly.
Answer: It seems you are looking for one of the menu items underneath Patch program from the Edit item (on the main menu).

Personally before I start patching around I enable the "Number of opcode bytes" option and give it a generous value of 7 or so:

In your case you seem already to be set on a specific course of action and have made up your mind about which opcode to patch to what, so you can go right ahead and patch the EB ?? to C3 90, I reckon. The Change byte option could be exactly what you're looking for, but you need to know the hex representation of your opcodes to find the old one and replace it by the same number of bytes. Also, this seems to be limited to 16 bytes at a time, if I remember correctly.
Alternatively pick the Assemble... option and enter ret. Any trailing bytes (your jmp should be at least two bytes) will simply appear as non-code.
One point that may matter: this only applies to the IDB itself, not to the binary from which it got loaded. Use the last option in the popup menu for that.
Comment: not in IDA. I know how to do it in IDA. I'm asking how can I do it in a c++ dll.
Comment: @Mlemix That's not even a reverse engineering question then.
Comment: do I ask that on regular stack overflow then? It kind of is a reverse engineering question, not sure.
Comment: @Mlemix Hmm, how to implement something in C++ would definitely be for StackOverflow, yes. Regarding the part where you take something like the `ret` mnemonic and try to get to `C3`, I think you want something like [xed](https://github.com/intelxed/xed). Probably other libraries exist. But that part would also be "forward" engineering, as in _assembling_ to the binary form. Also see recommendations [in **this** Q&A](https://reverseengineering.stackexchange.com/q/4664).


Prove that $-1 \cdot x=-x$

Question: While working on a proof for class, I came to a point where I couldn't go any further without knowing that $-1 \cdot x=-x$.  Is there a way to prove this using the axioms of a field?
Answer: Of course.
First prove that $0\cdot x = 0$ using the distributive property.

 $0\cdot x = (0+0) \cdot x = 0\cdot x + 0\cdot x \Longrightarrow 0\cdot x = 0$

Then try to prove $(-1)\cdot x = -x$ using the distributive property again, but in a different form.

 $0 = 0\cdot x = (1+(-1))\cdot x = 1\cdot x + (-1)\cdot x = x + (-1)\cdot x \Longrightarrow (-1)\cdot x = -x$
Answer: Assume we already know that $0\cdot x=0$. Then
$$0=0\cdot x=(1+(-1))\cdot x=1\cdot x + (-1)\cdot x=x+(-1)\cdot x$$
But that means, that $(-1)\cdot x$ is the additive inverse of $x$, i.e.
$$(-1)\cdot x=-x$$

Prove that $-1 \cdot x=-x$


Using an unsupervised Isolation Forest, how does one identify the optimal number of outliers from the anomaly scores?

Question: I am using an unsupervised isolation forest algorithm and computing anomaly scores to detect outliers from a 2 dimensional toy dataset. From a scatter plot, I am able to detect/visualize the data points with the highest anomaly scores (example: top 10 or top 15 outliers from the data)as my outliers. Is the number of outliers subjective to user decision (for example:Anomaly score of 0.5>S>1 is an outlier and everything less than 0.5 is not) or is there a way to detect the optimal number of outliers based on the anomaly scores?
Comment: Hello! Welcome to our community! Would you mind posting your plot, just to illustrate? Maybe we can identify a certain kind of distribution. For example in a Gaussian distribution we consider a sample to be outlier if it differs from the mean by $2\sigma$
Answer: The way Isolation Forests seem to be used in most of the cases involve having some kind of prior "guess" about what proportion of outliers you expect (if you want to be on the safe side, you might be encline to increase it for instance). Based on the proportion you set (it is the contamination parameter in scikit-learn), the observations are labeled according to their anomaly score.
That being said, nothing prevents you from coming up with your own rules after you ran the Isolation Forest. You can plot the anomaly scores and then see for yourself if another threshold could make sense based on the distribution of the scores. This would be a more empirical rule.
Answer: This would be an empirical rule. you can come up with some logic to label outlier(if something 2-std away from the mean, label as an outlier then use this percentage to set contamination level).
Answer: There is an attribute called as score you can use it as model.predict_score(X)
which returns anomaly score based on this you can classify it as inlier or outlier.


Is there any version of Ubuntu not in Simplified Chinese, but in Traditional Chinese?

Question: I am from Hong Kong and we use only Traditional Chinese.  In Hong Kong SAR, people do not usually use Simplified Chinese. Is there a version of Ubuntu that provides Traditional Chinese?
Answer: Ubuntu has Traditional Chinese version.
Going through System Setting -> Language Support

Download Traditional Chinese language support.  You can do this in the "Install / Remove Languages" section.  Your computer should be able to display Chinese Characters now (maybe after reboot).  You may also want to install language support of other languages.
(Optional) Drag your language, 漢語 (香港), to the top, so that your applications would use Traditional Chinese if it's available.


On Sharepoint 2013 how do you show the last modified date on a page layout

Question: Currently have a page layout were I would like to be able to display the last modified date of an article. However I can't see how this can be done as there's no snippet in the snippet gallery were you can add modified or created dates. There is an article date option but this needs to be populated by the user. I just want the last modified date to show in display mode so user can see the last time the article was updated. Seems to be a simple thing to achieve but I can't see how to do this.
Answer: I think this still holds true, http://blog.brianfarnhill.com/2008/10/showing-the-date-modified-date-on-a-page-layout
<PublishingWebControls:LastModifiedIndicator runat="server" />

or
<SharePoint:FieldValue FieldName="Modified" runat="server" id="modified" ControlMode="display" />

Comment: For SP13 I've used the Custom ASP.NET Markup option in the snippet gallery and pasted in  which results in

 I've added this to my page layout and it has worked cheers for your help.
Comment: thanks, I got it to work on my 2013 SP Site with the second solution. However, on some WebApp, the date won't be shown, resulting in a JS crash in the page (no more js working). I've noticed that happens mostly on the list WebApps. How can I secure the date value if null ?
Comment: if it's dectected as null by your JS code, then just construct a new date object and use that
Answer: We had a similar question, but we were restricted from modifying any sitewide files.  The administrator would not permit changes to the master page.
Workaround: the REST API for Sharepoint 2013 lets you pull any metadata from any list or library.  A few lines of JavaScript pulled in the Modified Date and the name/userid of the user.
var relativePageURL = _spPageContextInfo.serverRequestPath;
var siteURL = _spPageContextInfo.webAbsoluteUrl;
var query = siteURL + "/_api/web/getfilebyserverrelativeurl('/"+ relativePageURL +"')?    $select=TimeLastModified,ModifiedBy/Title,ModifiedBy/LoginName&$expand=ModifiedBy";

Working sample is at this location:
https://github.com/kpereyra/SharepointWikiFreshIndicator


I cannot kill my reflection, what am I doing wrong?

Question: In the water temple, you are forced to fight a reflection of yourself. However, I can't seem to land a hit. Does anybody have advice on a good method of self-murder?
Comment: You just asked 2 back to back questions about killing yourself in two different games. Is there something wrong with living sir?
Comment: This question should be added to the archive of "bizarre without context" ones :D
Comment: I think this question has a misleading title.  While Dark Link may look and act similarly to your character on OoT, he is *NOT* you.  When you talk about killing yourself, that means ways of inflicting self-damage, like environmental hazards / fall damage.  What you are really asking about is ways to kill dark link.
Comment: Title [How do I kill myself](http://gaming.stackexchange.com/questions/127170/how-do-i-kill-myself) was already taken :(
Answer: I have discovered in my 7+ times fighting Dark Link AKA Shadow Link there are two main ways to go about defeating him:
1) You can use the Megaton Hammer as you sole weapon. The reason this works is because Dark Link copied all of the items and weaponry that you had when you fought Phantom Ganon (which if you had been going along with the game chronologically, you should have fought by now) he copied your items and weaponry, and you had received the Megaton Hammer since that encounter. The reason not to use your Biggoron's Sword will be covered in reason #2.
2) You can use sword and shield. This only recommended if you want to spend the longest time fighting him, because if you use this method he will immediately start using what ever weapon you choose to fight him with. If you use the Biggoron's Sword he will count it as a sword not the Biggoron's Sword.
One final warning: If you are playing Ocarina of Time 3D, Dark Link will progressively gain weapon usage the longer it takes you to defeat him.
Comment: I didn't know about Phantom Gannondorf, if i get every item from every temple but not defeat the bosses then defeat Phantom Gannondorf then go and fight Dark Link will he be at his strongest
Comment: Technically I doesn't matter if you fight Phantom Gannondorf or not, that fight was just the explanation of where Dark Link got his powers.
Answer: The Reflection (Dark Link) will get stronger the longer the battle is drawn out; to the point where at times he'll jump on your sword and cut you. So you want to end the battle quickly. Some things I do:

Use the hammer. No idea why, but when I first fought him it always worked.
Use Din's Fire to get some space. It seems that he'll either get hurt and drop back into the water or defend and get pushed back which gives you a reprieve.
Don't thrust. If you're Z Targeting and moving forward when you attack you'll thrust; this is when he jumps on your sword. At the start of the battle it's not a big problem since he just stands there before back-flipping, however afterwords he'll slash you before back-flipping.
Carry nothing but fairies. Unless I need a bottle for something else I always have a full stock of them.

As I said, the first time I used the hammer and it seemed to always be effective. However after I got more confident in my skills I ditched that method and had a straight up brawl with Dark Link with just swords and shields.
Comment: You can also use the biggorn sword. It does more damage than the hammer and Dark Link cannot block it.
Comment: Alright, good answer. I have heard that there are certain ways to attack him without being hit in kind, maybe finding a walk through like Zelda dungeon? (Yes, I use walk throughs. Problem? :P )
Comment: Commentary from an uninformed: I know in The Wind Waker you can press the control stick towards Link's left or right while targetting to control the direction of your horizontal slice. Maybe you need to do this to hit the side that Dark Link's shield isn't on.
Comment: I don't remember where I heard this (may have been from Navi) but shadow link can read your moves while z-targeting and will block all of your sword swings while doing so. That's why most people use the hammer.
Comment: @Toomai you can't do that in OoT, 3DS version or N64
Answer: If you talk to Medigoron in Goron City as an adult, he'll sell you the Giant's Knife. If you use it too much, it'll break. Why am I telling you this? Well, one of Dark Link's favorite tricks is to stand on your sword when you jab him. But the broken Giant's Knife is too short to stand on! So you get a free hit and he can't touch you. Just note that if you have the Biggoron's Sword you won't be able to get the Giant's Knife anymore.


Heating a stock water tank

Question: I am building an insulated cover to go around a plastic stock watering tank for the winter. I have no electricity in the pasture and don't want to axe ice in the tank all winter. I am building 3 sides and the top with 3/4" plywood that has 1" insulation board attached. The top will have an 18" diameter hole for access. I want one side to absorb heat from a southern exposure. I have a choice of a clear polycarbonite material or a black polycarbonite material. I have been told that the black surface will absorb heat better or at least allow a better rate of heat transfer. Anyone know which is the most efficient way to heat up the water?
Comment: Hi and welcome to Physics Stack Exchange. However, I think this question might this question be better-suited for Engineering SE: https://engineering.stackexchange.com/
Answer: I would use the clear polycarbonite material, and then paint the side of the tank underneath it black. This lets the light get through to the inside of the insulating box, where it is then directly absorbed by the tank. If the clear polycarbonite is fairly good at blocking IR radiation, then it should absorb most of the energy radiated by the black surface.
Answer: Material which is a good absorber is also a good reflector of heat. Insulation depends more on thickness of insulating material rather than surface characteristics.   Better way to absorb external heat is to have black plated metal.  But during night /cold temperature it throws out all heat.  So you cannot use same material for both absorbing heat and insulating to prevent heat dissipation.
Best solution is to have thick insulation and separate solar panel separately and pass heated tubes surround the rank inside layer of insulation.

Heating a stock water tank


Power supply for raspberry pi model b+

Question: I have a 5V/1.5 A power supply lying around. Will this be sufficient for the pi b+ model?
Answer: Normally, the specification for the power supply is 5V DC and 700 mA.
In addition, if the external USB peripherals or WiFi Dongle are used along with the Pi, then there is requirement of power supply with specification 5V and 1.5A or 2A.
It should be noted that don't use cheap power supplies, which may not capable of providing reliable 5V.
One can also use smartphone chargers (terminated in the micro USB plug), which mostly possess same specifications i.e. 5V and 700mA. But, check it out before starting the project.
Answer: Maybe - it depends.
If it's a modern switching type supply it should be fine.
If it's some old thing you have lying around it might be "nominally" 5V and have poor regulation and maybe as much as 7 or 8 volts when lightly loaded.
I can't tell which you have from here
Answer: Follow reasonable engineering practices, do not skimp on the power supply it will keep costing you. The cost of Raspberry pi is much more then a good charger. Start with a good 2.5A - 3A supply. Not all smart phone chargers deliver a stable voltage they are designed for battery charging.

Power supply for raspberry pi model b+


regarding evolution of ears and sense organs

Question: How could we(or any other organism) have developed ears through evolution when before having ears we did not know that sound waves existed or there was anything such as hearing? How did the first hearing organ develop? The same can be asked for the other sense organs as well.
Comment: I think this is, in principle, a duplicate of a question that is quite commonly asked here, but I can't find a prototype - I suspect that most of these questions get closed as "Too broad". The real problem is of course that the question is based on a profound but common misunderstanding of evolution, the notion that there's some plan or direction to it. Remi.b's answer here addresses this, but perhaps there should be a more detailed, canonical answer to point newcomers to.
Comment: Possible duplicate of [How does the creative process of Biological Evolution work?](https://biology.stackexchange.com/questions/16106/how-does-the-creative-process-of-biological-evolution-work)
Comment: I tried to answer below. Your question is very broad currently - if my answer is not targeting your main concern, or is opaque, please comment on the answer, and try to sharpen your question so i (and other users) can try to better fit your question.
Answer: When you are asking about the evolution of organs, you are already five steps ahead of yourself. To have sensory organs, you need cells that react to some stimulus:

Hearing, Touch: Mechanical stimulus
Smell, some pain: Chemical stimulus
Sight: Optic stimulus
Other (non-human) organisms can also sense electric fields, magnetic fields, ...

As soon as you have those, having 'organs' that house a lot of those cells surrounded by tissues that aid in the reception of these stimuli, is relatively trivial.
But isn't a sensory cell totally complicated? It is. But: A simple neuron already is a sensory cell of sorts: It reacts to electrical and chemical imbalances.
But isn't then a neuron totally comlicated? It is. But: A simple non-neuronal cell already has a lot of the intricate machinery that a neuron does - a neuron mostly has some special parts and structures that make it a neuron. A simple cell also does react to chemical and other stimuli (this is why hormones work, and how little one-celled animals can orient themselves towards the light or food, or away from dangerous chemicals)
But isn't a run-of-the-mill cell totally complicated? It is. But it actually is just the workings of several archaic cells crammed into one (one of the more popular theories on Eukaryote evolution has them result from a very intense partnership of several more basic cells). And those archaic cells can also react to stimuli (they manage their metabolism according to the available food, for instance)
But isn't a basic cell totally complicated? It is. But is actually is just the interaction of several molecules that have some very interesting properties - DNA/RNA can function as an information storage, but are at the same time tools that can cowork with other DNA/RNA, and also interfaces/interferes with proteins in interesting ways.
But aren't big molecules totally complicated? They are. We still need supercomputers to reliably model all of the intricacies of any given Protein-Protein or Protein-RNA interaction. Many proteins behave differently in different environments (electromagnetic field strengths, chemical environment, temperature and mechanical factors (e.g. ultrasound)) - they could be said to 'react' to certain triggers. But they are actually just chains of repetitive elements (so called polymers of so called monomers).
But aren't those monomers totally complicated? Some are, but here we slowly get into the realm of 'mostly modellable on a hefty home computer'.
So we have systems of systems of systems... All of them very complicated.
But evolution is not a process that involves understanding ot planning. It is simply the result of coincidences and inheritance. You can see colors that many animals cannnot. You have the requisite molecules in your sensory cells in your eyes. Some people can see more colors than you, an inheritable trait. Some people can see less colors. Currently those people have no evolutionary profit from this - they reproduce and die with the same probability as the rest of us. Likewise there are a million (possibly billion?) such traits in every human. Traits that are different from the rest. Little things. Ineffective things (= having no net effect). But there might come a time where seeing one color or not seeing it (= not being distracted by it) will give a continuous net positive or net negative effect on the reproduction of those people carrying that trait. That is the time when that trait will start to  be present in a larger piece of the population (over many generations). The people carrying that trait will also be different from one another. And the ones carrying the traits with the most positive net effect will multiply the most, etc. Humans in some distant future then can eye-sense some X-factor we cannot even describe currently (try describing different colors to a blind person) and thus have, say, Xeyes.
Answer: Organism don't have any intention to evolve a certain. As soon as a mutation creates a protein that can change conformation in response to a given sound frequency, then the organism carrying this information has opportunity for making use of this new signal. If this new mutation is beneficial, then it can be selected for and will increase in frequency in the population.


Why $v_i=(X_i-\mu _X)u_i$ is i.i.d?

Question: I don't understand. Ok, we have $\beta_1-\hat{\beta }_1=\frac{\frac{1}{n}\sum_{i=1}^{n}v_i}{(\frac{n-1}{n}){s_{X}}^{2}}$. So, for the first OLS assumption results that $E(v_i)=E((X_i-\bar{X})u_i\overset{p}{\rightarrow}E((X_i-\mu_X)u_i)=E(X_i-\mu_X)E(u_i)=0$ (since $E(u_i|X=x_i)=0$). Then Stock and Watson says that for the second OLS assumption $v_i$ is i.i.d. and $Var(v_i)<\infty$. Surely this is for the casual sampling of variables but i can't prove it clearly.
After this, we have $E(v_i)=0$ and $Var(v_i)={{\sigma _{v}}^{2}}<\infty$ so we can apply CLT and saying that for $n\rightarrow \infty$ $v_i\sim N(0,{{\sigma _{v}}^{2}}/n)$ since $\frac{1}{n}\sum_{i=1}^{n}v_i=\bar{v}$.
Comment: Please make your post more clear. What is the "second OLS assumption": for example? Also formulate your actual question more clearly. For example the i.i.d. assumption has exactly to do with the way we sample the observations, it is unrelated to the assumptions pertaining to  the regressors and the error term "inside" each observation.
Comment: The OLS second assumption is related to the sample extraction mode of the variables: if a sample of $n$ units is extracted from the population through simple random sampling, then the pairs of values $(X_i, Y_i)$, $\forall i$ are i.i.d. Quoting Stock and Watson: "$(X_i,Y_i), i=1,...,n$" are extracted independently and identically distributed (i.i.d.) for their joint distribution".
Comment: @Alecos Papadopoulos However all this is needed to explain the asintotic distribution of $\hat{\beta_1}$: i can't explain this knowing $\beta_1-\hat{\beta_1}=\frac{\frac{1}{n}\sum_{i=1}^{n}v_i}{(\frac{n-1}{n}){s_{X}}^{2}}$.
Answer: Even after the comments exchange I am not totally sure what is the problem of the OP, but I will answer the question in the title.
Assume that we have a model
$$Y_i = \beta X_i + u_i,\;\;\; i=1,...,n$$
Assume that we obtain a "random sample" of observations from $\{Y_i, X_i\}$. This makes each observation $i$ identically and independently distributed from all other observations.
Now consider the random variable
$$v_i=(X_i-\mu _X)u_i = (X_i-\mu _X)(Y_i - \beta X_i) = X_iY_i - \beta X_i^2 - \mu_XY_i+\mu_x\beta X_i$$
while also
$$j\neq i : v_j=(X_j-\mu _X)u_j = (X_j-\mu _X)(Y_j - \beta X_j)=X_jY_j - \beta X_j^2 - \mu_XY_j+\mu_x\beta X_j$$
$v_i$ is a function of random variables $\{Y_i, X_i\}$ only, while $v_j$ is a function of random variables $\{Y_j, X_j\}$ only which are independent from  $\{Y_i, X_i\}$. So  $v_i$ is independent from $v_j$.
More over, since $X_i$ follows the same distribution as $X_j$, and $X_j$ follows the same distribution as $Y_j$, we have that $X_iY_i$ follows the same distribution as $X_jY_j$.Etc. So we also conclude that $v_i$ will have the same distribution as $v_j$.
Comment: Thanks a lot for the correction. I understood the concept now.
Comment: @FrancescoTotti. Glad to hear. Since this answer appears useful to you, please check the green mark so that your post leaves the queue of unanswered questions

Why $v_i=(X_i-\mu _X)u_i$ is i.i.d?


Factory reset Android x86

Question: I have installed the Android x86 in VirtualBox, but how to perform a factory reset?
Comment: What is MAKE and Model Version of your device?
Comment: It depends what version of android it is, but it'll be in the settings somewhere.
Comment: @ChintanRaghwani, I am using android-x86-2.3-RC1-eeepc.iso
Answer: Boot in debug mode. in first console enter exit command. (now the data partition will be mounted)
Then you will get another console with higher resultion. run this commands:
cd data
rm -R *
exit

and you have wiped data partition including internal storage.
Comment: This worked essentially the way I wanted, which was to **wipe data** like the recovery menu.
Answer: Go to the homescreen, press the menu button then navigate through:
Settings->Privacy->Factory data reset
Comment: When it reboot, it enter the grub and boot as normal, nothing happended.
Comment: That's because Android x86 doesn't ship with a recovery partition to reboot into.
Answer: How about booting your "device" into recovery mode, where you can wipe data?
I assume that the following commands can be used:
adb shell reboot recovery

Also see this.
Comment: The grub prevent from booting into recovery mode
Comment: How can it prevent it? Are you not able to edit the options used for booting?
Comment: I can edit the grud menu, but how to make it boot into recovery mode?
Comment: That is (IMHO) a question you should ask the people who made android-x86. I see they have an IRC channel..

Factory reset Android x86


Should I lift my hand from the frets?

Question: I'm new, working on learning hey there delilah, I was wondering if it's bad to slide my finger down and up the string since it's fast or if I should pick it up? Possibly a silly question, but I'm new haha
Comment: I noticed that if I slide too much my nails get a small groove like they were filed down. So that might be a factor to weigh in...
Comment: How bout both? When you have a fork in the road the best option is to take both, this way you are always right. Makes sense? It should, if not, try both and see.
Answer: The big issue is that you can get noise when you drag a finger up and down a wound string.
If that's okay for the song, if that's okay for you, that's okay. If you find it annoying, and putting lotion on your callouses doesn't stop it, then pick up your fingers.
Comment: It's also worth adding that as soon as you start adding any sort of effects to the music, this drag noise will get amplified. If you've got any sort of metal-style distortion, it will become *extremely* obvious. Which is fine if you want it, but you don't want to learn to play in a fashion where you can't play without making it IMHO
Comment: Some people don't seem to mind that noise. But I find it _really_ off-putting — sometimes to the point where it's unlistenable.
Answer: Sounds to me like there's no reason to slide up or down for this guitar part anyhow.
There's no sliding sounds on the recording, and the notes don't call for sliding up or down any string.
However, if you're determined that's what you'll do, either way will work, it's just tidier to release the string rather than have that scratchy sound - although it could be a feature of the song itself if you like. To me, often it sounds amateur though, as if it's happened through self-learning and can't be rectified.
Answer: There's a complete lesson about "Hey There Delilah" on GuitarNoise.com (not affiliated), and good tips from David Hodge for playing the many bars of D5 & F#m (emphasis mine):

Speaking of fingering, this simple progression might prove to be one
of the more challenging parts of this song for some of you. And if you
don't mind a suggestion, try laying your index finger flat in a
"mini-barre," covering the first three strings at the second fret.
This way you won't have to move very much to make the change between
these two chords. I usually use my ring finger to get the D note
(third fret of the B string) on the D5 chord and then my pinky to get
the F# note (fourth fret, D string) on the F#m. Those of you with
larger hands may prefer to employ your middle and ring fingers,
respectively, for those tasks, but since this progression lasts a
while, I find it helps to have my middle finger help support the index
finger in the barre by lying on top of it!

I find it much easier to play this song this way.

Should I lift my hand from the frets?