Getting locked items SPE

Question: I have a multisite Sitecore instance and I would like to get all locked items from all different sites and users and unlock them, is it possible to do this job using Sitecore Powershell Extensions?
Answer: Have a look here in the SPE book regarding the Unlock-Item command.
Example: The following will unlock the direct descendants of the home item.
Get-ChildItem -Path master:\content\home | Unlock-Item -PassThru

You should update the path to be specific to the tenant you wish to unlock. Add the -Recurse switch to the Get-ChildItem command to run through the whole tree. You may find Where-Object helpful when filtering for specific templates.
Example: The following recurses the tree, filters for a specific template, and then unlocks.
Get-ChildItem -Path master:\content\home -Recurse |
    Where-Object { $_.TemplateId -eq "{ENTER_YOUR_TEMPLATE_GUID}"} |
    Unlock-Item -PassThru

Comment: Glad I could help.
Answer: Sitecore PowerShell Extensions also has a built-in report to find these locked items. This is something very useful when you have not interest in writing a line of code.
Navigate to to Reporting Tools -> PowerShell Reports -> Content Audit

Immediately following you will be presented with a dialog for selecting where to begin the search, such as the desired tenant, and either all or a specific locked user.

You can customize the report to have an Unlock action. This would be handy if you want to provided delegated administration for users that you want to run the report but not be able to manage users.

Getting locked items SPE


How should I flag a question when two flags fit?

Question: This question. Should I flag it that it belongs on SO? Or should I flag it as simply off-topic? It will likely be closed there. How should I flag this sort of question?
Comment: Why do you want to flag for migration to SO when you know it'll be closed there?
Comment: @sammyg It's not even about making the answerer read between the lines. The gravest offense committed by that question is that it just pastes the entire problem that the OP is trying to solve into the question, then the OP just throws up their arms and asks the answerer to develop a *solution* for them. "Where do I start?" or "How do I approach this problem" might be better questions, but "give me the finished solution" is an extremely lazy, irresponsible, and offensive way of asking a question, and deserves to be handled as such.
Comment: @Sathya I don't **know** it will be closed there. I just think it MIGHT be. So is that the correct way to do things? Just flag as off-topic?
Comment: I'd have flagged it as Very Low Quality, irrespective of topicality.
Comment: @Sathya Maybe, just maybe, he expects the good folks at SO to fill in the gaps? :) Are you up for it? That's never a good idea. Users should really put some thought and effort into formulating their questions and describing their problems. I don't understand how some users expect others to answer their questions just by reading between the lines, by making assumptions about what they meant to ask.
Comment: Always remember the [golden rule of question migrations](http://meta.stackexchange.com/questions/91411/why-was-this-question-closed-as-off-topic-without-being-migrated/91446#91446)
Answer: If your feeling is that a question might be closed on Stack Overflow (because it's too low quality), then please just flag it as off topic.
There's no need to tentatively send it over if it's on the lower end of the quality scale.
Answer: I completely agree with slhck's answer, but I wanted to expound a bit more on a topic I feel is important.
This issue boils down to something called cross-community etiquette.
When you migrate a question to another site, you are asking volunteers to spend their time reading and then dealing with that question. If you feel that the question is not particularly high quality, it is poor cross-community etiquette to migrate the question to another site, because then, this low quality question is having "double" the amount of time invested in it, undeservingly: people on Super User are investing in it once, to read the question and determine how to flag/vote on it; and then people on the site that receives the migration will have to invest time into it again, to again determine that it's off-topic or low quality and then close or delete it.
Even worse, close votes and question deletions can only come from high rep users and/or diamond moderators, whose time and attention are at a premium. So, asking them to spend time on something that is not really worth anyone's time is a little rude.
It is important that we spend as little time as possible worrying about these questions which simply don't meet the quality criteria of any site on the StackExchange network. To ensure that, you should ask yourself, "is this a good question for ANY site?" before thinking about migration. In general, questions should be at least "slightly above average" in quality, before being considered for migration.
StackOverflow already has an existing problem where thousands of its user with some degree of moderation tools are not aware of this concept of cross-community etiquette, so they frequently migrate questions to other sites which are of very low quality, without realizing that they are taking up resources in other communities, instead of simply closing these questions and letting them rest. If other sites start migrating these bad questions from other sites to StackOverflow as well, this will only perpetuate the problem, and validate the perception that it's OK to migrate "crap" questions.
For the sake of the community, please never flag or vote to migrate questions which are low quality. You are only wasting peoples' time and detracting from the amount of volunteer time available to answer and comment on actually good questions.


How can I calculate the Ethash of a Block

Question: Given a particular block number, how can I calculate the Ethash used by this block?
Answer: For calculating the Ethash you need a lot more than just the block number (you need the entire header). The documentation about how this is calculated can be seen here.
You can copy paste the python code provided in the documentation in a file and pass the block header to the hashimoto_light function defined to calculate the Ethash. This needs no extra packages other than bare Python 3 so it should be easy to run and play with.
Hope this helps


Lightning : Show Stencil When Component Loads

Question: So I see in the docs for SLDS they talk about using "Stencils" while a page loads.  I can't find any examples of how they're implemented.  Can anyone point me to any docs or samples that use this?
Answer: Stencils abstractly represent what the resulting content layout will look like. Use stencils for full page refreshes, not asynchronous updates. Stencils offer a more visually appealing experience than dozens of spinners animating at the same time or a blank white page.
Stencils looks like below

Use stencils when data takes longer than 300 ms to retrieve. For less than 300 ms, just show the data. If the data takes 301 ms to load, the stencil fades-in promptly and then cross-fades to the data. Do not have a "white flash" between stencils and data.
Table Data Loading Stencil

Record Detail loading Stencil

Now i am surprised that there exists no code shown in the documentation .Here is a rough draft which i tested for spinners and infact same thing will apply for Stencils with necessary HTML markups .Preferably you can use SVG's
I use Spinners when load time is not much and have highlighted approach for spinners which can be tweaked with little effort to have stencils rather spinners .Since the approach is same ,I thought of sharing same so it gives an idea of how to approach
There are various spinners indicated in the SLDS guide
Without Branding

With Branding

Inside your component add markups needed to show spinners
<aura:handler event="aura:waiting" action="{!c.showSpinner}"/>
<aura:handler event="aura:doneWaiting" action="{!c.hideSpinner}"/>

The javascript controller component to hide or show
({

showSpinner : function (component, event, helper) {
     var toggleText = component.find("spinner");
    $A.util.removeClass(toggleText,'toggle');
},

 hideSpinner : function (component, event, helper) {
   var toggleText = component.find("spinner");
   $A.util.addClass(toggleText,'toggle');
  }
})

You need bit of CSS for styles inside your component
/*toggleCss.css*/
.THIS .toggle {
   display: none;
 }

Comment: Thanks @Mohith.  Spinners seem like they're great for an individual component loading/rerendering within a page.  For stencils, I'm wondering if there are any "out of the box" stencils?  I like the look of the ones they're using in the examples, however I can't find where to get them as resources.  Do we have to create our own stencil images for use?  The docs make it sound like there are some ready-made ones out there.
Comment: SLDS link in my answer takes you to SVG .Use those and depending on layout you can create one yourself as well or your designer can create you One


Need a new questline

Question: I am a level 40 Blood Elf. SO far I have been doing minor quests and dungeons since the long (and fun) forsaken quest-line. I am wondering if there are any nice, long quest lines that are full of interesting lore similar to the forsaken quest line near or at my lvl.
Comment: Whether a quest is 'fun' is completely subjective. It would probably serve you to look for quest info on http://www.wowwiki.com/List_of_quest_areas
Comment: @JamesJiao it may be subjective, but there is a fairly limited set of what you can do, so it's nearly trivial to just give an exhaustive answer and let whoever pick and choose.
Answer: The easiest way to find a new, level appropriate quest area is to check out the Hero's Call / Warchief's Command Board in your favorite major city.
These will always provide level appropriate "breadcrumb" quests that can lead you in to new zones with their own discrete storylines.
Answer: The Forsaken quest line is something special!
I would advise you to check out Eastern Plaguelands, level 40-45.  The Caravan quest chain is quite fantastic.  It starts near the bridge between the Western and Eastern Plaguelands.
As a second choice consider Thousand Needles, level 40-45.  You'll be collecting ingredients to resurrect a pirate troll and reunite him with his wife.  It ends with you confronting Magatha the hag, who poisoned Garrosh' weapon in his duel with Cairne Bloodhoof.  To top it off, Thousand Needles is a beautiful zone.

Need a new questline


Work experience

Question: I am doing a Ph.D. which is fully paid by the Government. I want to apply for Australian PR. Will my research experience be counted as work experience, or do I need to show post-study experience?
Comment: I highly doubt it--it counts as education, not work experience. I haven't been able to turn up a statement either way though.
Answer: Just as a guess, I'd say, yes it does. I base this on the fact that here, in Hungary, you need to give lectures and classes during your PhD studies. I don't know how this works in your country, but I guess this is universal in the Bolognean system.
Another reason is that most of the people who do PhD will end up doing researches and giving university lectures/classes to make their living, it is pretty much their occupation.
However, who could really answer this is your skills assessing authority. Try looking this information up on their website or contact them.

Work experience


In quantum process tomography, how does $\chi$ characterize a quantum process?

Question: I'm working through Nielsen and Chuang and I'm pretty confused by the discussion of quantum process tomography. I'm trying to work through an example of 1-qubit state tomography given by N&C (box 8.5), which provides an algorithm for determining $\chi$ in terms of block matrices and density matrices (determined by state tomography). The process seems pretty straight forward, but how does $\chi$ characterize a quantum process?
Comment: See also the answer to [How to perform Quantum Process Tomography for three qubit gates?](https://quantumcomputing.stackexchange.com/questions/11622/how-to-perform-quantum-process-tomography-for-three-qubit-gates). It describes in length the $\chi$ matrix; if you still have doubts, could you clarify what exactly you don't find clear about it?)
Comment: Thank you, I have read that Q&A previously, and the wikipedia page is references. I think my confusion is more fundamental. What I'm not clear on is this: given a chi matrix, what does it concretely tell me about a quantum process? For example, if I try to characterize a process on one qubit, how do I know my chi matrix is correct?
Comment: I'm afraid that I still don't fully understand the question. Are you familiar with Kraus operators? There is a very strong correlation between the eigen-values and -vectors of the $\chi$ matrix of a quantum channel, and a Kraus representation of the channel - and a particular nice representation. The eigenvectors are basically the coefficients of the Kraus operators decomposed into the basis used for the $\chi$ matrix. If this is something you are looking for in an answer, I can write one and elaborate a bit further?
Comment: I'm not familiar with Kraus operators unfortunately. Can the quantum operation itself be deduced from the chi matrix? I'm a beginner (clearly), so thanks for the patience with this!
Comment: Do you mean with _quantum operation_ a unitary (operation) that I perform on the qubit? The term _quantum operation_ is  somewhat more general in that it applies also to the more general quantum channels - of which unitary operations are a subset.
Comment: Yes, I am considering only unitary transformations. I am trying to get a grasp of QPT for simple unitary transformations on one qubit.
Comment: also related: https://quantumcomputing.stackexchange.com/a/11814/55
Answer: The linear map $\mathcal{E}$ is what characterizes a quantum process,
$$\rho \rightarrow \mathcal{E}(\rho),$$
but $\mathcal{E}$ can be determined by $\chi$. Using the operator-sum representation,
$$\mathcal{E}(\rho) = \sum_i A_i \rho A^\dagger_i = \sum_{i}\sum_{m}\sum_{n}a_{im}\tilde{A}_m \rho a^*_{in}\tilde{A}^\dagger_n,$$
where the $a_{ij}$ are some set of complex numbers that allow a fixed set of operators $\tilde{A}_{i}$ to form a basis for the unknown set of operators $A_i$ on the state space. Remember, if we can determine the operators $A_i$, then we can completely describe $\mathcal{E}$. Rearranging the above,
$$\mathcal{E}(\rho) = \sum_m \sum_n \tilde{A}_m \rho \tilde{A}^\dagger_n \sum_i a_{im} a^*_{in} = \sum_{mn} \tilde{A}_m \rho \tilde{A}^\dagger_n \chi_{mn},$$
where $\chi_{mn}$ is a "classical" error correlation matrix, which is positive Hermitian by definition. So, once the set of operators $\tilde{A}_i$ has been fixed, $\mathcal{E}$ can be determined completely by the complex number matrix $\chi$.$^{\text{[1]}}$
Note: The adjective "fixed" does not apply to any of the operators themselves, rather, it applies to the set of operators. The point is that the operators $A_i$ are unknown, so we are writing the $A_i$ in terms of a basis of known operators $\tilde{A}_i$ that we have chosen. The problem of determining the $A_i$ thus reduces to the problem of determining the coefficients $a_{ij}$ in this basis. This is not any different from determining an unknown vector by writing the vector as a linear combination of a fixed set of basis vectors, then finding the coefficients in this basis.
[1] Prescription for experimental determination of the dynamics of a quantum black box, Isaac L. Chuang, M. A. Nielson, 2008. https://arxiv.org/abs/quant-ph/9610001
Answer: TL;DR
Given a process matrix $\chi$ expressed in a normalized, ordered Pauli basis $\{P^{n}_{k}\}$, find its eigendecomposition $\{\lambda_{i},\mathbf{v_{i}}\}$, where $0 \leq \lambda_{i} \leq 1$ and $\mathbf{v_{i}} = (v^{i}_{P^{n}_{k}})$ is the eigenvector for eigenvalue $\lambda_{i}$ and contains 'coefficients' for every Pauli $P^{n}_{k}$. $\chi$ is Hermitian, so the $\lambda_{i}$'s are real and nonnegative, and the eigenvectors from different eigenvalues are orthogonal.
If the map represented by the process matrix is unitary there will be only one nonzero eigenvalue, let's call it $\lambda_{0}$ (then $\lambda_{0} = 1$). The corresponding eigenvector is then just the unitary $U$ expressed in the Pauli basis. We can readily compute $U$:
$$
U = \sum_{k} v^{0}_{P^{n}_{k}}P^{n}_{k}
$$
For a single qubit, the $\chi$ matrix is  $4 \times 4$ matrix. If again it represents a unitary channel, we get a single nonzero eigenvalue equal to one, and its corresponding eigenvector $\mathbf{v} = (v_{I},v_{X},v_{Y},v_{Z})$. Then, the single-qubit unitary represented by the map is:
$$
U = \sum_{P} v_{P}P = v_{I}I + v_{X}X + v_{Y}Y + v_{Z}Z.
$$
Note that the $v_{P}$ are in general complex numbers.
If the map is supposed to be unitary, but it has a bit of noise in it, this will be reflected by one eigenvalue being close to $1$, corresponding to the unitary operation, and some (or all) other eigenvalues being small but nonzero - these correspond to the noise operators.
Density matrices and maps?
In its most general form, a quantum state is described not by a single ket state (e.g. $|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$, but by a statistical mixture of kets (e.g. $\{p_{i},|\psi_{i}\rangle\}$ described the situation that we have state $|\psi_{i}\rangle$ with probability $p_{i}$). If there is just one nonzero $p_{i}$, we get a single ket state back, and we call this state a pure state. Any other state is also referred to as a mixed state.
It turns out that we can - and it is extremely useful - to write this as a sum of outer products $\sum_{i}p_{i} |\psi_{i}\rangle\langle \psi_{i}|$. We call this the density matrix $\rho$ and, as mentioned before, this is the most general description that we can have of a quantum system. As a general rule of thumb, in quantum computing we always want
For pure states, the operations that we perform on them are gates, represented by unitary matrices. We can also apply these to density matrices, but there are also different valid operations that we can apply to density matrices. Any such operation we call a quantum operation or quantum channel, which is a linear map $\rho_{in} \rightarrow \Lambda(\rho_{in}) = \rho_{out}$ which is subject to some constraints to make sure that $\rho_{out}$ is a valid density matrix - I won't go into them here.
To fully characterize this $\Lambda$, there are multiple different representations - one of which is the process matrix $\chi$. In QPT, it is the goal to characterize a unknown map $\Lambda$ by finding one if its representations, where often the $\chi$ matrix is used. These can also represent unitary channels, but they can represent more.


Converting Windows Movie Maker projects (.mswmm) to Sony Vegas (.veg)

Question: Since I don't want to redo the timings and edits of my existing project, but I want to upgrade to a better movie maker for more options (including editing existing parts, so I cannot simply render this first...), is there a good way to do this?
Answer: To be honest I don't think this would be possible. Your best bet would probably be to export the video and import it into Vegas. Just make sure you keep a record of the timings. Sony Vegas and Windows Movie Maker are two very different programs with very different editing tools. Unless there is a converter somewhere that I have not seen then I would just export as a video file.
Comment: That's what I'm wondering.  That is, if there is a converter...


Is it possible that black holes might devour all masses of the universe?

Question: I am only an interested layman in cosmology and GR. In recent years, we have learned that black holes indeed exist in the universe and that almost all galaxies contain massive black holes in their centers. Black holes, in essence only devour other (stellar) matter and they also swallow each other as has been demonstrated by the gravitational wave discoveries. Is it possible that black holes eventually will "eat" most or even all normal and dark matter of the universe? And could this, and a merging of black holes, lead to a situation where all the universe ends up being a few or even only one black hole?
Comment: -1 No research effort? Googling your title is a start.
Comment: @sammy gerbil - With your recommendation it would obviously suffice to google any question you can ask here on this site or engage in a study in the scientific literature.  I thought that an advantage of SE would be that you could get a qualified answer in a reasonable time, which would also be of interest to other SE participants.
Comment: Prior research is expected (as the voting button indicates), and an internet search is quicker than asking on SE. It does not prevent you from asking here, you can still ask for clarification or further information. Users here do not usually display their academic qualifications, whereas on Quora (the top google hit) they do.
Comment: @sammy gerbil - That's right. I have already found this Quora place following your suggestion of a Google search.They had a couple of knowledgable people there (with credentials) answering a similar question.I did some prior "research" on Wikipedia but there was nothing relevant. On the other hand I have bad experiences with Google searches because so much unreliable stuff appears whre one doesn't know if it is trustworthy.
Answer: I think black holes have been misrepresented in popular culture. They aren't giant cosmic vacuum cleaners devouring everything in their path, they are gravitational objects which exist and have their own stable orbits. Things do fall into them, but they aren't sucking everything towards them at some extreme rate.
Ultimately most cosmologists believe the universe will keep expanding until everything tends toward absolute 0 temperature and there is no energy in a sense, the black holes that are there will exist until pretty much the end of time, but even those will probably slowly radiate away due to Hawking radiation until there is literally nothing. Black holes generally are too far away from each other to feel the gravitational influence of even their closest black hole neighbor so the likelihood of them all consuming each other and merging is extremely narrow, especially as with cosmic expansion they are getting further apart at all times.
Comment: I understand your argumentation. But considering cosmic time scales, the chances of other stellar object and other black holes falling into an existing one (as we have recently witnessed) are probably not so small thus accumulating more and more mass in an existing black hole. Also, how did the extremely massive black holes form at the center of most galaxies? And I would not consider the orbits of black holes "stable". Not even the orbits of our planets are stable in the long run.
Comment: By having stable orbits what I mean is that things can form stable orbits around them. The supermassive black hole in the centre of our galaxy is massive but its not nearly on the order of magnitude of the mass of the whole galaxy and doesn't account for much at present. Without doing calculations it is hard to know whether the big freeze would happen before or after all matter became a black hole. Maybe there would be a point reached where the black holes radiate out more than they acrete and they would shrink. I don't really know the answer to this, but if someone did that would be nice.
Comment: So you think that it might be a justified question whether the massive black hole in the center of the galaxy could in the very long run absorb the mass of our galaxy before it evporates? And that  scientific calculation might give an answer to it?
Comment: @freecharlie. I have found some good treatments of a very old universe, Googling does help. Forget the details but something close to just too few things near each other to interact, very diffuse and low density, sure some particles with infinite lifetimes, and so on.  The BH don't eat each other up, too low a density because of the accelerated expansion, so they decay
Answer: No. There is a misconception that a lot of laypeople seem to be picking up recently from popularizations, which is that all the matter in the universe will first be sucked into black holes, and then recycled into photons in the distant future through Hawking radiation, so that the only thing left will be photons. This is wrong.
Black holes are not super-powerful cosmic vacuum cleaners that can suck in everything there is. When a black hole forms through gravitational collapse, such as the collapse of a dying star, its mass stays the same, and that means that at some fixed distance such as a billion kilometers, its gravity is no stronger than it used to be. A black hole is in fact a very small object, typically about the size of a city. This makes it a small target, and the space between the stars is vast, so a huge amount of luck is required if it is to swallow another astronomical object through a chance collision.
So if we look at the cosmic cereal box a gajillion years from now, what will be on the list of ingredients? It will contain stable, massive subatomic particles such as electrons.[Baez 2004] (The exact roster of particles depends on unknown particle physics such as dark matter and proton decay.) Any photons with ordinary energies, such as those originating from the present-day cosmic microwave background, will play a negligible role as their energy density becomes diluted faster than the mass-energy density of material particles. (This process has already been going on for billions of years. It's is the reason why the cosmic microwave background, which was dominant in the early universe, is now a negligible part of the universe's mass-energy.) However, the universe will contain photons with extremely low energies, which an observer (if one could be present and could detect them) would describe as Hawking radiation from the cosmological event horizon.[Hu 2011] These photons will have a temperature on the order of 10^-30 K, meaning a typical energy of 10^-34 eV and a wavelength of 10^28 m.
Adams and Laughlin, "A Dying Universe: The Long Term Fate and Evolution of Astrophysical Objects", Rev. Mod. Phys. 69 (1997) 337, http://arxiv.org/abs/astro-ph/9701131
Baez, "The End of the Universe," 2004, http://math.ucr.edu/home/baez/end.html
Penrose, Causality, quantum theory and cosmology. In On Space and Time, ed. Shahn Majid, Cambridge University Press, Cambridge, 2008, pp. 141-195. (ISBN 978-0-521-88926-1)
Hu, "Hawking radiation from the cosmological horizon in a FRW universe," Phys.Lett. B701 (2011) 269-274, http://arxiv.org/abs/1007.4044
Comment: Thank you for your interesting description of the end of the universe and the references. As you know, there are supermassive black holes at the centers of most galaxies. How did they become so large as compared to the common variety of those produced by stellar gravitational collapse? I suspect by accumulating mass from around them. Has anybody calculated the growth rate of these black holes?
Comment: On the other hand, what would happen  if you consider a universe only filled with black holes like the ones at the centers of the galaxies. This would be something like a "black hole gas". What is the probability in such a black hole gas of black holes encountering each other and merging? Do black holes have a scattering cross section for merging?
Comment: Thank you again for the very good references! I just read the article by John Baez. Delightful!


How to change vector into different colors (Adobe Illustrator)

Question: I don't know how to change the outline of my illustrations into different colors.
I draw by hand and then I scan the image and place it on Adobe Illustrator. I do the whole process of 'image trace,' 'expand,' 'live paint,' etc., and then I'm able to color it in. But I have been trying to change colors on the outline of my illustrations. For instance, if I'm drawing a person, I want to be able to have a different color outline for hair, skin color, clothing, etc.
Some people have suggested using scissors or knife tool. I just haven't been able to do it, though.
I'm no graphic designer, I just like to illustrate.
Comment: Please, include an example that we can see the how complex your case is, Simple one color solid line drawings would be a piece of cake, the others are more complex, even impossible without a manual intervention that is as difficult as making a copy by hand. Give the example in high resolution.
Comment: Just like you fill in the colour, right next to it you'll see the outline colour
Answer: Ma'am / Sir Try this if it can help to your project.
Im Using Illustrator CS6.
I have tried also "Rotoscope" before in illustrator. Its time consuming but visually rewarding when finished. In case you want to vectorize an object or a face for example. Knowing the differrence of fill and stroke will be helpful to you. It helps in choosing colors you want. Take time to see the embedded samples.
Note: You must identify first and for most your type of media where you want to display this [whether it is (RGB-TV,Monitor Screen, Wallpaper, Web Page) or   (CYMK-Print media e.g. Newspaper, Magazine, labels etc)]. There will be difference in colors.
Here is an image for example in CYMK / Print Media
tracing highlights of hair and give color to them according to your choice.

In Upper Right corner of the screen there is the Fill and Stroke button together.
The path that i draw for the hair (color blue on the screen) currently has No Fill and No Stroke as it shows red slash in the middle.

Now try to change the fill according to your chose just blend the CYMK or RGB values. You can also use swatches that you can save to save time.For this example I just roughly estimate the yellownes shading of the hair. See the Fill button is selected and changed in appearance. When you select the path it automatically display the color values in it.

Next for the Stroke.
Stroke is also very useful in rotoscoping. copyinng hairline together with other tools like pen or brush tool. You can adjust the thickness and appearance of just mix and match. Designers/Artist Perspective :-)


What are the opinions on carrying medicine/medical devices on Shabbat?

Question: Specifically, I'm curious about situations where it's not immediately apparent that it'll be necessary. For example: you don't know whether or not you'll need an epipen when you leave the house, but could you carry one with you anyway?
Comment: Why do you have to leave the house at all? Also, is the location a public domain Deoraita or Derabanan?
Comment: Arrange to have the epipen at your destination before Shabbos.
Comment: @AvrohomYitzchok While that would work for someone with a peanut allergy, I can't imagine it would be very useful for someone who's allergic to bee stings. There's also the question of people with asthma, who could need an inhaler at any moment.
Comment: related http://judaism.stackexchange.com/q/50524/759
Answer: My rabbi told me that I should carry candy with me everywhere I go on Shabbos, out of concern for hypoglycemia, which is a life-threatening condition. Hypoglycemia (also called "low blood sugar," or just a "low") is a function of type 1 diabetes. A low can come almost without warning, even with the best control (trust me, I know).
If I'm going long-distance, I'll also carry a blood glucose meter and some other stuff I might need.
Where there is no eiruv, I carry whatever I need with a shinuy; socks are useful, and should work for an Epipen also. As Avrohom Yitzchok already pointed out, arranging to have what you need wherever you go is a much better idea, provided you have enough medical devices to go around.
(I have, at times, placed up to four meters in different buildings around a city I visited on Shabbos that didn't have an eiruv)
It's certainly a good idea ask your own rabbi about your own particular situation, as to whether it will be necessary to carry stuff you need on Shabbos, and how that stuff should be carried.
Comment: While it may be obvious, it might be worth clarifying what disease puts you at risk for hypoglycemia and what the approximate risk of your getting it is.
Comment: @DoubleAA "approximate risk of your getting" ...T1D? Hypoglycemia?
Comment: risk of getting HG given that you have T1D. It could help indicate what level of risk justified the actions the rabbi took.
Comment: How's that, @DoubleAA?


Vector design software recommendation for logo design

Question: What programs under $100 are good for vector design?  I can't use subscriptions and illustrator is just way too expensive.  I have been looking at Affinity Designer and think it is the best option for what I want to do: Logo Design.  Also:  are drawing tablets good for logo design?
Answer: It depends on your style. I've been in the market for a good vector software for a while. Personally I find that neither Affinity Designer nor Inkscape do not work well for me. Inkscape is just net negative in productivity for me and Affinity Designer is too one-sided and missing things I need for precision work.
I never really liked CorelDraw for some reason, but it's got better as of late, and I am thinking of doing a full reevaluation on CorelDraw. For a long time I've been looking at Xara Designer, which is one feature short of me switching over. Both of these are out of your range tough.
Sketch is actually OK, for a subset of my work. But the Mac-only feature set is not my cup of tea.
Comment: I actually think that about Ilustrator. Corel has some features I am used to work that can not find on Ilustrator.
Comment: @Rafael Its not missing features its about feel of features. I literally choose illustrator because the grid snap feels better. I dont need features as such all i need is a API that allows me to make the features. Which is horrendous in Illustrator and nonexistent in Xara-
Comment: Multipage. (The artboards in ilustrator, in my opinion are a mess n_n) and the exactitude in the snaping actually. I have not tried lately but I found the snap in Ilustrator quite inacurate. But that would be a long discussion n_n. But yeap, probably it is amatter of "feel".
Comment: @Rafael grid snap can not be inaccurate! But adobe can not cannibalize itself.
Comment: Not on grid, on objects. (Shhhh. Some will come and scold at us for this discusion on the comment area) n_n
Comment: @Rafael We can move to chat
Comment: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/49060/discussion-between-rafael-and-joojaa).
Answer: For your computer, you can use Inkscape for free. For your touch screen device (iPhone, iPad, etc.), you can use Assembly (which is mostly free, but offers cheap in-app purchases).
Answer: The free option is Inkscape.
Affinity Designer is an interesting option. Affinity Photo has already a good reputation.
Another option is CorelDRAW. The last version is around USD$500.
There is a legacy option, CorelDRAW Graphics Suite X5, which is quite good, but I am not sure if that version has some kind of expiration date when installed, and I am not sure if it can be installed in English.
And regarding if a tablet is good for logo design. I guess it depends on the tablet, but I would say you need a mouse for logo design.
Answer: The CorelDraw Home & Student Suite is $99 but it only runs on Windows. I think that your best bet is Affinity Designer though.
Drawing tablets are good for freehand drawing, if you're going for a handdrawn look in your logo then yes, but I'd stick to a mouse, personally.


What is this bird?

Question: I have found this bird in my house, I live in Haedo, Buenos Aires, Argentina. I tried to take a closer photo but it escaped flying. I am not sure how to describe it, but it's very big compared to normal birds.
This are the photos:
Answer: That specimen in your photo seems to be the Southern Crested Caracara, Caracara plancus:

Also your location matches the range of C. plancus, which is from northern Brazil to Tierra del Fuego:

Answer: In the US , I would say it could be an osprey , especially if there is a body of water nearby. Or Caracas if in dry grasslands.

What is this bird?


Can a third-party candidate "donate" their votes to another candidate?

Question: Is there any provision in US constitution which allows one candidate, say Jo Jorgensen, to "donate" their votes in a given state to another candidate?
Answer: No, there is nothing in the Constitution that allows the transfer of votes from one candidate to another. However, this year Maine used Ranked-Choice Voting (RCV). Under RCV, voters for Jo Jorgensen or other candidates could have selected Trump or Biden as their second choice; thus transferring their votes. No other states allow RCV for president.
Court rules in favor of Sec. of State clearing way for RCV in presidential election, September 22, 2020.

Maine will become the first state in US history to use ranked-choice voting in a presidential election.
Comment: The constitution doesn't care about the voting system to that detail it is the induvial state laws that determine how the vote is run and how the electoral votes are decided.
Comment: Is there any data on second choices for Jorgensen voters?
Comment: @eyeballfrog - Not yet, that I am aware. I understand that it would take at least a week.
Answer: No.
First of all, the elections of the last tuesday only serve for each state to chose its electors for the Electoral College who will be ones to actually chose the President.
This means:

Electoral laws are mostly a matter of state laws, not the US Constitution. So any such provision would belong to each state electoral laws. AFAIK, none provides for this.

As most of the states follow a "winner gets all of the electoral votes", in any of those states Jo Jorgensen would have to be the most voted candidate to have any actual electoral vote at all. That is not going to happen.

Even if in an state electoral votes were distributed proportionally, those are few (one for each congressist the state has). That would mean that Jo Jorgenssen would need a sizeable fraction of the popular vote in that state to get an elector. Quite improbable.

Even is she gets some electoral vote there is the question if Jo Jorgenssen could order the states to design some elector for Trump instead of for her, or demand the electors chosen in her name to vote for someone else when the Electoral College convenes.
That is more arguable, since it could depend also on state laws.
Some states have laws against unfaithful electors that punish electors who do not vote as instructed by the state and some claim that votes cast against instructions by the state are invalid, but the legallity of these laws is still unclear, as it would be the fact that if those laws would apply if it was the candidate herself requesting such a vote.

In short, the US Constitution does not have anything to say about this and even if it is allowed it would affect most likely presidential electors, of which Jo Jorgensen will most likely get none at all.
Answer: No, a candidate cannot agree to "donate" votes to another candidate in any state.
The closest any state has to this is ranked-choice voting in Maine.  In Maine (or in either of its congressional districts), if no candidate gets to 50% of the first-choice vote, then the candidate with the fewest votes is eliminated, and the votes cast for that candidate in the first round will then count for the voter's second choice.  This is repeated until one candidate does get above 50%.
It could happen that Jorgensen's voters could put Trump on a higher preference than Biden, which would lead to many of Jorgensen's votes going to Trump in subsequent rounds.  But that would be up to the voters to decide, not the candidates.
Answer: No, votes in election are not transferable to another candidate and she won't get any electoral votes.
If she really wanted to give her votes to another candidate she shouldn't have run in the first place but supported that candidate directly. As a note there appears to be 4 races where the number of votes she received is more than the difference between Trump and Biden

Can a third-party candidate “donate” their votes to another candidate?


Input on GPIO at very Fast Speed

Question: I am getting a signal at 1 GPIO which i need to read at an interval of exactly 10^ (-6) seconds.
I am using wiringpi.h in C and the issue is that digitalRead() also takes some time thus i am not able to ensure exact timing.
Please Suggest a solution
Comment: You need to use something other than a Raspberry Pi for this.  You cannot ensure exact timing here due to the general purpose operating system running on the platform.
Answer: To "ensure exact timing" you will need to use a microprocessor.  Perhaps an Arduino would be suitable.  You should be able to find one which will "ensure exact timing" to any accuracy you need.
A multi-tasking multi-user operating system such as Linux is not suitable for this task.
Comment: The real problem is not the hardware that is being used - and I think you meant to suggest to use a **microcontroller** instead of a **microprocessor** -  but as you do point out, the operating system being used. For this task, you need to use a real time operating system, or even no operating system at all.
Comment: @GlenYates The problem is not just Linux.  There are things going on behind the scenes on the SoC which means you can't guarantee "ensure exact timing" for many meanings of "ensure exact timing".
Answer: My 2 cents:
Similar to the Arduino (8 bit AVR based uC) recommendation I would look at the far more capable STM32 series from ST microelectronics.

There are at least two good Arduino API ports here and here,
Great support forum
Inexpensive: ~$2 for the cheapest breakout boards - "Bluepill" and a reusable ST Link V2 clone programmer
Plethora of periperials like SPI, I2C, USART, USB, DMA and sophisticated Timers with a 32 bit ARM Cortex M0/M3/M4 CPU

With a bit of ramp up you could use a combination of DMA, Timers and CPU logic to acquire from GPIO pins, condition, compress and stream out the data via USB, possibly even to a Raspberry Pi.
Using PlatformIO with VSCode/Atom makes development much easier
Comment: How nice to read your recommendation on STM32.  I fully agree with you. Now I have updated my answer, in order not to mislead newbies.  It is now the age of system integration, low level things are getting less and less useful year after year, and can no longer earn you a living.
Answer: I think a simple sequential logic circuit can easily do the job in a couple of steps.

Get a 32 MHz clock.
Every 1 uS clock one bit data input to a D type flip flop and feed its output to a serial to 8 bit parallel register.
Every 8 uS clock the parallel register contents into a flash memory.

For an Electronics Enggr major undergrad, I think it is much easier to do the above 3 steps using sequential logic than debugging a messy mpu/mcu macro assembly program.
Using amtel/arm/stm mpu/mcu/ etc, you still need to read one bit every uS, and do the serial to parallel job before storing the 8 bit word to some flash memory.  In other words, just wasting time and money.
The advantage of using logic circuit is that Rpi can directly oversee and control everything, without losing one bit of data.  Once Rpi starts the bit D flip flop + flash memory reader, it can leave it standalone reading bit non stop into the flash memory, which Rpi can come back any time to read the flash, like it is a 1Gbit long FIFO or circular buffer.
My electronics skills are very rusty.  Perhaps we can pass the question to the Electronics and Arduino Stack Exchange and see what they think.
By the way, don't say that 1uS is fast, because those EE guys talking nS/pS  everyday would LOL!
Update 2019apr23hkt0858
After reading the answer from @Shreyas Murali, I think I need to point out that I don't encourage any electronic enggr beginners to learnt basic logic gates circuit design, for the same reason that newbies should not learn assembly language hoping to earn a living, because over these years hardware has become so fast that even "slow" C in mcu becomes fast enough for tasks in real life.  There is no need to use assembly language which might run fast but the much longer development time is not worth it.
IN short, life is too short to learn things that could not earn you a living.
Rpi Raspbian is not realtime OS and as such is very weak in real time IO.
My first Arduino is Decimilla and last Arduino Due (ARM Cortex-M3).
Now the ugly Arduino vendors are suing each other, and I don't want to hear the name XYZduino any more.
To do realtime tasks, I would start a fresh with something like STM32 Blue Pill, which I all the things I dream but Rpi will not give, even Rpi4, 5, 6 (USART x 3,
I2C x 2, SPI x 2, Can x 1, ...).
What I want is humble, only more UART/SPI/I2C channels.  I actually had them when I played with small guys like PyBoard, ...

Input on GPIO at very Fast Speed


Definition of Sonority for Flutists

Question: I have not been able to find a specific explanation of what "Sonorous" or "Sonority" means for a Flutist. I have a vague understanding that it refers to sound quality. Can anyone please help me to understand this musical term better? Thank you!
Comment: Does this help? (I think it means getting a clear note without breathing/blowing sounds):  http://music.stackexchange.com/questions/16540/flute-techniques-for-clear-sonorous-sound
Comment: I find Wheat's comment unhelpful. I am not familiar with how this site works yet even after reading the welcome message. I disagree with the comment of my question being a duplicate because I could not find an answer pertaining to the Flute on this subject that was simple and concise. Andy actually answered my question quickly and concisely, but only as comment rather than an answer. He also referenced a thread that did not answer my question, which is why I posted this one in the first place. I do not have enough points yet since I just found this site yesterday so a little help please!
Answer: A sound which resonates along the entire cavity of the flute.
Comment: I don't what this could possibly mean. Any sound produced by a flute resonates along the entire cavity, including banging it with a hammer.
Comment: @EJP every pitch has a different wavelength.  Not every pitch from 0Hz-22000Hz will end up resonating ... resonantly ? ... along the length of the flute.  If you have a flute that is 700 units long, then any note that divides that 700 units evenly will resonate along the entire length.  Hammers could do this, but resonating is not just one-directional motion, but back and forth and forth and back and so on.  Does that make any more sense?

Definition of Sonority for Flutists


Code compliance - how do I pass EMT conduit through an interior wall?

Question: I live in Fairfax, Virginia.  I need to know how to pass 1/2 inch EMT conduit through an interior wall while complying with code.  In more detail, I have a subpanel in an attached garage.  From that subpanel, I plan on adding three circuits -- two circuits for outlets inside the garage, and one circuit for an outdoor outlet.  All are being done with surface mounted outlets and surface mounted 1/2 inch EMT conduit, using THHN wire.  For the outdoor outlet, I plan on running the EMT conduit to the back wall of the garage, and then through the garage back wall into an adjoining storage closet.  After another about six feet of EMT conduit in the closet, I will transition the THHN wire to a short length (couple inches) of outdoor Romex in an interior junction box before penetrating the exterior wall to mount the exterior outlet.  The storage closet has doors that open only to outside of the house, it is not a closet inside the house.  What are my options to pass the conduit through that interior wall?
Comment: There's no magic to it, really. Office buildings all over the U.S. have EMT simply punched through both layers of drywall and fire-taped or caulked.
Comment: I agree a razor knife, hammer, drill or a sheetrock saw ,will all work check the area for power prior to cutting it you might find a hot wire. Many stud finders have a voltage detect function for under 20$.
Answer: There is no magic here
Conduits can simply go through drywall at will, as they're legal to use for both exposed and concealed applications.  If this were a penetration of the house-garage fire barrier, I would firestop it with an appropriate caulking product for the application, but since it's not, simply jabbing the conduit through a saw-cut hole in the drywall will do the trick.  Don't forget to double-check to make sure you aren't about to try to run the EMT through something other than drywall though!


I have just one working Wifi connection

Question: After configuring my Computer for PXE installation (as a Server). I have only one working internet connection via my home Wifi. The configuration was followed by PXE Install server Community help. Actually i can connect my computer to other routers too but i have no internet connection. How is it possible? Any ideas how can i remove the PXE stuff and recover the "Factory settings" for the network?
Answer: In all probability you had to shift your client from using DHCP to using a static IP when you installed the DHCP server.  While it's not technically not impossible to run a DHCP client and server on the same machine it's generally recommended to keep the machine static.
I would simply shift the machine back to using the DHCP client. It's pretty easy to go back; edit /etc/network/interfaces and go:
auto eth0
iface eth0 inet dhcp

...or whatever your wireless interface name is.

I have just one working Wifi connection


Use Windows 10 wifi hotspot with no internet connection

Question: I'm trying to play a video game with my friends that requires a local wifi network that allows UDP broadcasts. The dorm wifi doesn't allow UDP broadcasts, so I'm trying to set up my laptop as a hotspot. Windows 10 by default allows you to share an internet connection over wifi, but you must have an internet connection to do so. Sharing the wifi connection results in a lot of problems such as constant disconnects, and I don't have access to an ethernet connection to share. Is there some way I can set up a wifi network without actually sharing an internet connection?
Comment: It might be easiest to purchase an inexpensive wifi router and set up a basic network that way.
Comment: Nadellas Windows is so stupid, trying to make it comfortable by assuming you never want to have a local hotspot without internet. Same for most other things, like always and under all circumstances making new audio devices primary, and not option to disable that behavior. Software trying to make clever assumptions with no way out is the worst. Sorry for the rant, but don't, just don't! Ill buy a Mac if I want to change 80% by a click of a button for 20% impossible to archive.
Answer: Two resolutions. First being easier, second being overly complex that even I don't want to approach as it requires programming.
Resolution One: You use a hostednetwork if your wireless adapter is capable. (Usually they are capable.)
1.) Open an elevated command prompt. Win+X and choose CMD (Admin) OR type in "cmd" or "command prompt" into Windows Search by typing into Start Menu and then right click "Command Prompt" and select "Run As Administrator"
2.) Check if your system is capable run this command: netsh wlan show drivers. Scroll down to Hosted network supported. If it saysYes you are in luck; if No there is no easy alternative and don't continue.
3.)  Run the following command to allow and set up your hostednetwork but look below first.
netsh wlan set hostednetwork mode=allow ssid=%ssid% key=%pass% keyUsage=persistent

Replace %ssid% with your Wifi or "Hotspot" Name or SSID. E.g. ssid=MyGreatHotspot. Replace %pass% with your Wifi or "Hotspot" Password. It must be 8 characters long at a minimum. E.g. key=strongPasswordsAreWEAK.
4.) After that run the command, netsh wlan start hostednetwork, to start the "Hotspot" broadcast. Right now you can play without internet connection after all devices connect. Remember to check IP addresses of all your individual devices in order to connect to each other. The hotspot's IP Address usually is "192.168.137.1".
If you want to share your internet connection or for further reference, continue on:
5.) Open Run (Win + R) or by searching for Run and enter in ncpa.cpl, then press Enter. A new adapter has shown in the screen it should say something along the lines of "Microsoft Hosted Network Virtual Adapter". (Optional if you're OCD, rename that one if its says "L.A.N Connection* 15" or rather to like "Hotspot"). Right click the Internet Connect Source you want to share internet from and choose "Properties." Go to the "Sharing" Tab and checkmark or toggle on "Allow other network users to connect through this computer's Internet Connection." Apply, OK to save changes.
6.) You should be all set! :)
If you want to stop the hostednetwork, in an elevated command prompt you run the command: netsh wlan stop hostednetwork
Resolution Two: This is taken from this post from user Linard Arquit

In case writing your own application is a possibility, have
   a look at the WiFi Direct API, which offers a legacy mode. Enabling
  the legacy mode will create a SoftAP with the specified SSID and
  password. However, specifying no password doesn't seem to be
  supported.
Have a look at the IoTOnboarding sample to see the legacy mode in
  action (and to have a better 'documentation' than what Microsoft
  officially provides):
  IotOnboarding/IoTOnboardingService/OnboardingAccessPoint.cs
Comment: Works for Win 8.1 too, you just need to wait a little for the hotspot to actually provide even the internet connection. And it might not work for multiple devices in the beginning so it needs a little bit of tweaking until you find the sweet spot where each of them is connected **and** has the shared connection (to the outside network) available.
Comment: By the way, the elevation in only required for `mode=allow` and it needs to be done once, the rest are non-privileged commands, can even create shortcuts for them
Answer: If you are still using windows 10, then just open "Microsoft Store" from Start Menu. Find the app named as "Hotspot Lite" from there and just install it. Now open the app and configure the settings if you want or not. Done!!
Thinking about money? Don't worry. It's free for windows 10 users!!
Already Done? Ok then, now you are able to create a hotspot network without any net connection. Cheers!!
Comment: Works well for those using MS store. I deleted that piece of crap.
Comment: This app might have been OK back then, but now it displays ads over the form for entering hotspot name and password. After I "X" the ads, they come back in a couple of seconds. I don't like such a behavior.
Comment: Using windows 10 this works for me.
Comment: Doesn't work for me, still uses the hotspot function
Comment: same ad nonsense for me. it works only without internet connection, then the ads are not shown and the local IPs can still be reached
Answer: This workaround requires a smartphone with internet access for the first time.

From Smartphone, enable Mobile data and Wifi Tethering
Connect Laptop to Smartphone via wifi
Configure and enable Mobile Hotspot from Windows settings
Now disable mobile data and tethering from Smartphone
Done. Now you can connect anything using Laptop Mobile Hotspot, including the smartphone itself (smartphone acts as a client)

I came up with this, because:

Install Connectify, OSToto, or any third party software, don't work
Run NETSH doesn't work
I do not want to downgrade the Intel driver

My system is: Intel Wireless AC-9560, Windows 10 Home 1809.
Comment: It will disconnect after it detects not Internet Connection


Why aren't nuclear reactors designed to handle the loss of the heat sink?

Question: I always wonder why nuclear power plants aren't designed to handle a loss of the heat sink. At the point at which hydrogen is being made from the water, can't you just remove the water and catch the molten corium into a concrete container until it cools off?
Answer: This is a really good question and your question is answered directly here:
https://en.wikipedia.org/wiki/Corium_(nuclear_reactor)
Basically the corium is so hot that it will react with concrete producing water vapor and carbon dioxide which may further react into just hydrogen gas and carbon monoxide and that the corium can melt the concrete to about a depth of one meter in one hour.
Answer: They are. The heat sink is also the neutron moderator. If you take some of the water away, reactors are designed to slow down by more than the loss of coolant. This is what negative void coefficient means. The only reactors that didn't do this were the Chernobyl type designs (RBMKs). They were known to be a danger by 1955. A similar design was built near Arco, Idaho and cycled to destruction to prove the point.


Change half switched outlet

Question: In my house I have various rooms where the builder installed a light switch which only activates (1) half/switched outlet.  The problem is, the outlet they chose in most instances was stupid / non-ideal.  I've done some electrical work (installed dimmer switches, timers for porch lights, etc), but by no means do I know how things are wired off the top of my head.  Is it possible for me to change which outlets are turned on by the switch? Are all outlets potential or did they just run the circuit from the switch to that one outlet? What do I need to look for?
Answer: It would be easy to change the half switched outlet to always on (by replacing it), but not trivial to make the switch control a different outlet. There is a dedicated wire running from the switch to the top half of your outlet (see red wire below). To control a different outlet, you'd need to run that wire to it.
Comment: @2LeftThumbs Builders don't like to waste money, it's not likely they ran any extra wire.
Comment: I figured that's what it'd be. Do you think there's any chance that they somehow ran a line to the other outlets to be helpful, or is that just wishful thinking?
Comment: Check into wireless options (Insteon is one that comes to mind, and there are others). You could replace your current switch with one that does wireless send/receive. It would control the existing outlet, but you could add receivers on the other outlets to control as well.

Change half switched outlet


Accessing a remote Desktop on a Raspberry Pi

Question: I want to access a remote desktop on my raspberry pi 2. With xrdp I can get Pi GUI on desktop. But i want to see and access a desktop interface on my Raspberry Pi GUI. Its like reverse thing we do on xrdp.
Comment: I can't remember if it's installed by default, if not: `sudo apt-get install rdesktop`. Then, `rdesktop computer_name`.
Answer: Sure. I have got at least 3 ways to set up a remote desktop access to a Raspberry Pi device. They are: TeamViewer, VNC or SSH + X11. So, the description is quite long and boring. I am gonna split these ways inti three consequent posts. Todays one is for
TeamViewer Way
1. Obtain your ExaGear Desktop (find link via google). Unpack the downloaded archive and install ExaGear by running install-exagear.sh script in the directory with deb packages and one license key:
$ tar -xvzpf exagear-desktop-rpi2.tar.gz
$ sudo ./install-exagear.sh

Enter the guest x86 system using the following command:
$ exagear
Starting the shell in the guest image /opt/exagear/images/debian-8-wine2g
Download and install TeamViewer:
$ sudo apt-get update
$ sudo apt-get install wget
$ wget http://download.teamviewer.com/download/teamviewer_i386.deb
$ sudo dpkg -i teamviewer_i386.deb
$ sudo apt-get install -f
$ wget http://s3.amazonaws.com/wine1.6-2g-2g/wine1.6-2g-2g.tar.gz
$ tar -xzvf wine1.6-2g-2g.tar.gz
$ sudo ./teamviewer-fix-2g.sh
Now you can run TeamViewer from Raspberry Pi start menu:
Using TeamViewer for Remote Desktop on Raspberry Pi

Setup static password for remote connection in TeamViewer GUI:

Remember the personal ID and password for remote access to RPi using TeamViewer.
Windows PC setup
1. Download and install TeamViewer for Windows from www.teamviewer.com.

Run TeamViewer from the start menu, enter your personal ID in the "Partner ID" field and press "Connect to partner" button:

Enter your personal password in the new pop-up window and log on:

That's it! You connected to your Raspberry Pi
Telling the truth, it works only with emulator, which is ExaFear in my post. You are free either use your own, or simply search ExaGear via Google to get it and use as it's illustrated in this tutorial ;)
Answer: OK, so the second post will go for the second way of connecting your Raspberry Pi to a remote desktop.
VNC
Raspberry Pi setup
1. Install VNC server on Raspberry:
$ sudo apt-get install tightvncserver

Start VNC server:
$ vncserver

On the first run, you'll be asked to enter a password which will be used to access RPi remotely.

Check and keep in mind your Raspberry's IP address
$ sudo ifconfig
and find the string like inet addr: 192.168.0.109
The last two numbers might vary depending on your network but 192.168 is always there. So, this is your IP address.

That's it for RPi setup.
Windows PC setup
1. You will need to download and install a VNC client program. For example, you can use TightVNC (tightvnc.com).

Run the downloaded file to install TightVNC client and follow the installation instruction:

Choose "Custom" setup type:

Now VNC client is installed.
4. Run TightVNC Client from the start menu. In Remote Host field enter: IP address of Raspberry, colon, 1 (in my case it was 192.168.0.109:1 ) and press Connect:

That's it! You connected to your Raspberry Pi
P.S. Don't forget, that this hint works with an emulator only. So, don't forget to get it and set up beforehand (watch the previous post). I, personally, use ExaGear.
Answer: The Third way of running a remote desktop on Raspberry Pi is
SSH + X11 forwarding
This case doesn't require any additional package installation on your Raspberry Pi.
On Window PC do the following:
1. Install Xming X Server for Window
2. Run Xming Server
3. Run Putty, enter your RPi IP address, select X11 in the options menu and check the box labeled "Enable X11 forwarding":

Login to Raspberry Pi and run GUI of a program:

That's it!


How do animals think if they don't speak a language?

Question: The way we humans think and reason involves us using words to describe things. Even when thinking in our heads, we use words to think. This begs the question, how do animals who don't understand a language think?
Comment: Do you know how you sometimes cannot find a word to express a thought, feeling or idea? (or only in one language if you're multilingual) This implies you actually don't think in language. However, since we communicate in language, language does to some extent shape how we think.
Comment: I can't answer because I don't know enough about the subject but I'm very surprised no one talked about [deaf blind](https://en.wikipedia.org/wiki/Deafblindness) people. Some were born that way and explain that they would think in feelings (instead of thinking "I want ice cream" they would taste it). I suggest you read up on them.
Comment: When you are hungry, do you think, "I am hungry now, I should go to the fridge," or do you just get up and do it?
Comment: Not everyone uses words to think in their heads. If you could watch what is going on in my head, it would all be pictures and sounds. My thoughts are like dreams - immersive auditory and visual experiences that are "fuzzy around the edges". I remember seeing TV show where a character said "How could there be a thought without a word for that thought?" I didn't understand that at all. I think without words all the time.
Comment: Fair warning with the series of questions you're asking about thought: They're good questions.  That means you should expect many answers that just lead to more questions!  It's worth noting that epistemology, a *major* branch of philosophy, is dedicated to exploring the theory of knowledge, which is very closely woven with the concept of thinking.  The problem with asking good questions about a big subject is that a *lot* of people have spoken their mind on it, and they don't all agree =)
Comment: How do left handed people think? Thinking with words is a right brain phenomena..... The brain has a center for listening to language and another for listening to noise. Westerners listen to animals with the noise part of their brains. Japanese listen to animals with the language part of their brain...
Comment: You should try meditating. Some say when you meditate "you don't think". But when you meditate, you are thinking without using words. Like [Cort's answer](http://philosophy.stackexchange.com/questions/30449/how-do-animals-think-if-they-dont-speak-a-language#30452) says, you think in images, for example. But you also think in feelings and in sensory experiences.
Comment: @SwamiVishwananda That's interesting. Can you provide links for further reading?
Comment: How do you know the animals don't have their own language?
Comment: Most animals do "speak" a language - body language, as pointed by @CortAmmon in his answer. An example: By observing my cats as they communicate with me and with each other in that way, I can infer what they are "thinking".
Comment: @TommiBrander If I remember correctly I saw the reference to the Japanese thinking in "The Geography of Thought: How Asians and Westerners Think Differently" By Richard Nisbett. For the left hand/right hand hand there are numerous books out on this.
Comment: @the_lotus I was thinking about mentioning them! idk why I didn;'t
Answer: Do you only think in words?  Personally, I find I often think in images too.  And sometimes my thoughts take a shortcut and skip all words and images and just take me straight to the answer?  Michael Phelps is famous for thinking in terms of "the perfect race," a thought stream without words describing exactly how he would race from start to finish.
There are many features of words that are useful to us but not required for thought.  For example, reproducability.  I can think of "sad," pause for a moment, and then think of "sad" again and claim I am thinking of the same word.  This is useful for discourse (its hard to develop a "language" otherwise), but for thought purposes, all that matters is that the "thought" works well enough right now.  It doesn't matter if the thought has no meaning 15 seconds from now, the present is all that is needed for thought.
One may choose to take the issue down to the neural activity level, in which case there is clearly communication going on.  However, that communication may not meet our [human] definition of language.
Does that mean animals don't "think?"  Well that depends on your definition of thinking.  I think you could answer any number of ways, depending on your preferred definition of the word.  (Ironic that the thing that gets in the way of giving you a clear answer is that we have to use words to describe it, isn't it?)
One approach might be to attack the problem from a different perspective.  Instead of presuming "language" must mean exactly what you believe it means right now, start from behaviors of the animal.  Identify sets of behaviors which are connected in ways that are clear enough to warrant grouping them together.  Some of those behavior groups may start to pick up characteristics of what you thought "language" meant.  If so, you may elect to call them "behaviors caused by language."
A parting thought: body language.  Virtually every animal has it.  In fact, you could even make an argument that bacteria and fungii have it.  It has no words.
Comment: Very good answer, I almost forgot that I think with images too.  But because of the fact that animals don't have a spoken language to describe things how humans do, would that limit how they understand things?
Comment: @mdlp0716 I think it would be fair to say it limits how they understand things.  However, it may be very hard to pin down exactly where those limits arise.  Things that we perceive as "language only" may actually be expressible without language, there's simply no real reason for a human to do so (and thus, we anthropocentrically presume no one can think of them without language).  And there is the question of whether those limits actually matter for an animal or not (an easy question to ask... much harder to answer)
Comment: @mdlp0716 Well it limits them in at least the following way: When I have to find the answer/solution for a problem, I usually start forcing myself to thing about it, and I do it by repeating the words that remind me of the problem like a mantra (using my inner-voice of course), this way I can focus on the problem instead of my surroundings and it doesn't get overwritten in my short-term memory. I am _almost_ sure the lack of words make animals incapable to do so.
Comment: That would make animals incapable of repeating words in their thought.  This repeating-mantra thought process you've described sounds (to me at least) very strange.  I've never done anything of the sort personally...
Comment: I used to think it was odd that nobody thought like I did.  Later I realized that no two people approach thinking the same =)
Answer: I know someone who had a car accident and lost the ability to speak due to a head injury. She didn't lose the physical ability, but the part of her brain responsible for language was damaged. She had to learn to speak again just like a baby does, completely from the beginning. She is doing well now, but there are still plenty of words she doesn't know, but only the words, not the concepts (she is intelligent and can fluently insert a description for anything she doesn't remember the word for). What is very interesting is that her cognitive ability and intelligence didn't suffer in any observable way. A few months ago she couldn't even use conjugation or any pronouns, she used a grammar even worse than the Hulk from the comic books. However, no matter how hard it was for her to express her thoughts, it was evident that her cognitive ability was normal for her age of approximately 30 years.
This shows that language is not necessarily the same as thinking ability.
Comment: The details you've given don't prove the conclusion you've drawn. It's clear that something about the ability to *articulate* was lost for the woman, but it's not clear that her thinking is not linguistically formed even if the ability to articulate that was lost.
Comment: @virmaior : No, not the articulation. I wrote that the problem was not with the physical ability to move her tongue etc. but that she forgot the language itself. This was evident in the time when she couldn't use any grammar, but the few words she remembered / was taught, she could utter almost perfectly. And now, when a word doesn't come to her mind, she can quickly get around it by describing it, almost completely fluently. I know, this is just anecdotal evidence, but I posted it because it might point into an interesting direction, I'm sure this condition has some good medical literature.
Comment: @vsz, maybe try rephrasing your response to make your point more obvious? In this case, it seems like an interesting example: even just one example of someone who can think but struggle to use language shows that such a thing is possible.
Comment: @vsz I think you might be using articulate differently than I am in my comment. I don't mean vocalize. There's an extremely unclear feature repeated in your comment that makes it seem like she still has the concepts that used to have words with them, and that makes it very unclear whether it's fair to say her cognition is not linguistic even if the name of the word is now gone from her head.
Answer: One approach is to extend the computational theory of mind, as Cort Ammon points out, and consider any form of neural activity as a from of computation. The answer becomes trivial: Animals think because thy process information using neurons. But we can do better than that.
We could reverse engineer your problem: How did language evolve? Before there was writing, language was a series of sounds. High order animals that clearly display some level of thinking also tend to communicate with sounds (Dogs, apes, dolphins and whales, etc...). Chances are their thought processes involves a bunch of sounds in their head as well. Not as precise as humans, but still precise enough that scientists now consider Orcas to have distinct cultures.
Douglas Hofstadter, in his book "I am a strange loop", has a section (or chapter) I forget, called "On souls and their sizes". In it he posits that, there isn't a specific break between animals and humans, but that instead there is a gradual increase in complexity of their abilities of self perception. The complexity of thoughts possible also followed a similar gradient. Presumably the animals would perceive themselves using the same types of symbols they perceive the world with, so that is how their thoughts are structured. Animals with an advanced sense of smell might associate smells with their mental images instead of sounds for example.
On the opposite side of the spectrum, you have Thomas Nagel, who wrote an article called "What's it like to be a bat?". He starts from the fact that we have no way of figuring out what the thoughts and emotions of bats are, because they are just too darn different from us. Based on this, he concludes that consciousness is irreducibly subjective and cannot be brought to a materialist/physicalist explanation. Ultimately, he arrives at a dualist position, meaning that for him, thoughts and consciousness require some dualistic mental substance to exist, even in animals.
Comment: Although it is possible to recall images, sounds, smells and touches, they are not a major part of 'conscious' thought.  Most of our thoughts are sub-conscious.  Conscious thought is often for planning to speak with others, and we treat ourselves as another person.  It is easy for the idle language center to eavesdrop on the planning center and create sentences just short of talking aloud (sometimes our tongues even move around as though speaking).  An animal might internally hear itself 'yelp' or whatever it would plan to do, but it probably has no higher thoughts that 'it is aware of'.
Comment: @aml see the link I posted about Orcas.
Comment: Orcas have more language than 'yelp', so I agree that they have more awareness.  I think there is a spectrum of consciousness, and I still think that 'self-awareness' relates to language, which evolved to communicate with others, but is also used to 'communicate with oneself'.  I don't think any animal has an internal dialogue that is more complex than the language[s] it could share with other creatures.
Answer: It depends on what you do consider "thinking" - just now I am thinking about your question and I formulate those worlds directly in English in my head, even if English is not my born or more used language. But i think about answering the question in words, while my hands operates the keyboard independently.
I send command like "copy my thought in words on keyboard", "correct this typo" not "type letter A then type letter B then C", not in terms "move index finger little left, then push it down", not in forms "flex this muscle and release that one".
Does that mean, that writing on internet forum (with corrections) using standard keyboard and widespread text editing features of major browser does not need to "think"?
When I drive car, my body does a lot of work, like steering the wheel, shifting, braking, I look at other cars and avoid crashing to them, I look at traffic lights and signs and change my plans accordingly WITHOUT formulating it in words in my head - I can talk with friends on the way and use my language skills for totally different target. I could "remember back" what I did and formulate it in words (changed shift from 5 to 4, while braking and steering little left ...),but usually I do not do it. Does that mean, that driving from center of one city to the center of another, finding parking place there and park car does not involve "thinking"? Many really intelligent beginners would have problems even with the parking alone and would use a lot of words verbally (or just in head), many of which would be not publishable.
If you play with ball, you just "catch it", not solve ballistic equations in symbols and floating point arithmetic. You can describe it in such means later and get to better understanding what happened, or you can practice that and get better at that field. Your dog can "catch it" without special mathematics ability or "words" :)
So if you define "thinking" as "manipulating words", then animals probably cannot "think", but also driving in heavy traffic or using computers does not need "thinking"
If you change the definition to "solve problems in changing environment and with respect to previously learned things and with anticipating future development of situation" then you need not necessary "words" for such activity.
Comment: 'Does that mean, that writing on internet forum (with corrections) using standard keyboard and widespread text editing features of major browser does not need to "think"?' - certainly seems like it sometimes! :p
Answer: Cort Ammon has given a very good answer...and even better "fair warning."
You question is perfectly okay, but so exceedingly broad that is can reach into nearly all corners of philosophy, from definitions of consciousness and "life" to the role of language and "representation." To answer it one would have to usefully limit the definition of "word" and of "thought," which entails a huge chunk of modern philosophy.
Philosophers throughout the ages have attempted to define what distinguishes "animals" from "humans," usually settling on something called mind or soul or reason or language or symbolic systems, etc. For Descartes and his followers the line is quite distinct, and animals are far more like machines. Today, when we see machines simulating human "thinking" such boundaries blur. Moreover, research does show certain "language" skills in animals, so boundaries blur on the organic side as well.
Your question might be framed in many ways, but I think of two that could avoid an endless quest into the nature of human consciousness. First, what are the limits of nonhuman organic reactivity and generalization or "animal consciousness"? Second, what are "words"? What is the difference between a human saying "there is an eagle" and a monkey warning cry indicating "eagle!" Do both involve representation? Is it a matter of degree?
My own preferred framing is to look at all of these terms quite abstractly, as "communication." We can almost use this as a synonym for "society" or even "life." All lifeforms, even plants, must in some sense "communicate" between physical instantiations to continue and "re-present" themselves. This ghostly power of "communication" can be stored and transferred in various ways. All entail cells and membranes that must exclude some "communications" while remaining permeable to others. Human utterances appear to divide and redistribute experience in peculiar ways that slow and modify the physical continuum of "action" and "reaction" or "cause" and "effect." Animals do not appear to be so "loosely coupled."
But at this point in my late-night answer I am reminded that words induct us into an infinite regress from which healthy animals appear to be exempt.
Answer: Warning - this is not my area of professional expertise, but a lay observation.
When very young children learn a language for the first time, a concept ("book") and its corresponding sound are taught at the same time and are intricately linked, so they may not even recognize them as distinct. If they are exposed to a bi-lingual environment from the earliest age, they are forced to distinguish between the concept, and the representation. There may bs a single visual representation, but there are now multiple linguistic representations.
It is my belief that this leads to a more complex neuronal processing of language, and that this is fundamental in the ability to pick up additional languages (since it is only when you learn your second language that you have to start making this distinction). So a child that is bilingual from birth develops different wiring.
Animals that don't have an explicit language as we understand it can still have the conceptual processing layer, where concepts are associated with sounds, smells, tastes, emotions... Language is really just a cherry on top.
Answer: I wanted to provide some further reading; this thread was addressed rather explicitly in the 1970s with Jerry Fodor's Language of Thought Hypothesis...
http://plato.stanford.edu/entries/language-thought/
which fed into a discussion about the "systematicity" of language and thought (loosely, the ability for thoughts or propositions to be combined according to systematic rules), and the implications of this for philosophy of mind.
In particular, this sparked a debate between those who felt that we necessarily think in a systematic language (on Fodor and Pylyshyn's side) and "connectionists" who invoke ideas such as "sub-symbolic mental representations" to avoid such a necessity.
http://plato.stanford.edu/entries/connectionism/#SysDeb


How to install apache24 and php55 from macports?

Question: I need apache24 because of some features what introduced in 2.3. And (unfortunately) need php too.
So decided to install the next ports:

apache24-devel
php55
and php55-apache2handler

For some reason the php55-apache2handler builds apache22. Is it possible to have an apache24 variant?
What are the steps to installing apache24 with php? I need compile everything compiled manually from sources.
As an alternative should I migrate to "homebrew"? Is here some macports based solution?
ps: using 10.9
Answer: That's a bug in the php55-apache2handler port: http://trac.macports.org/ticket/41478


Backup in a external USB drive

Question: What's the best way to maintaing a incremental backup on a external USB Drive (HD 500 GB)?
There are any GUI tool for this? or a easy shell script to make a backup of my home folder (music, video, documents...)
Answer: I think best opensource tool backup will be "rsync". It has the feature to do incremental backups.You can use grsync as it's front end.
Answer: Personally for backup all my home file I use Back In Time, it's a great applications! You can find more info at http://backintime.le-web.org/

Backup in a external USB drive


Ground cable from battery to motor can not find stud to attach cable. Where is it located?

Question: 350 Oldsmobile Cutlass. There is terminal ring that should attach to stub on motor.  When I looked at battery / motor cable was dangling loose cable length about 2 feet.
Answer: I don't know what year of Cutlass you have, but these can be attached to the bolt which goes through the case of the alternator (the one the alternator pivots on). This allows for a good ground to the engine and to the alternator. You also want to ensure there's a good body ground in there somewhere. There's usually a smaller wire which is attached to the battery cable which acts as a ground strap.
Answer: On my 70 C20 with a 350, the ground wire goes to the A/C bracket.  Any place unpainted on the head or block should be fine.


Why do some people answer my question in comments?

Question: Sometimes I ask questions on Stack Overflow, and some people don't just comment on my questions. They literally answer them. Why don't they write full answers that are displayed under the question itself?
Comment: Because often it isn't worth the effort of creating an actual answer.
Comment: Not sure if that could be a duplicate, but highly related: [Answerers who only use comments](https://meta.stackoverflow.com/q/253045/6045800) (asking ***what to do*** about it and not ***why*** it happens)
Comment: Answers require a good amount of time and effort to write, comments don't. Time is usually in short supply, especially on a work day. I'm not going to pretend it is going to be any more intricate than that :)
Comment: @AleksandrNovik there are 9 downvotes, actually. You are indeed supposed to ask questions, but on meta too performing research first is very much appreciated. If you don't you end up asking a question that has been asked numerous times before; do you really expect people to upvote such a question? They won't. That impacts exactly nothing though, you will forever be free to ask more of such questions and they will even likely be answered happily.
Comment: @Tomerikoo Agreed, they're asking two different things
Comment: Does this answer your question? [Answerers who only use comments](https://meta.stackoverflow.com/questions/253045/answerers-who-only-use-comments)
Comment: @gnat nah, not really :)
Comment: In a way it actually does answer it... Some of the answers there explain the different motives to answer in comments
Comment: In my case it's because I don't often remember that I can answer.
Comment: Thanks for 6 downvotes, guys. I thought I was supposed to ask questions like these on stackoverflow    M  E  T  A
https://ibb.co/kS7yGQp
Comment: @AleksandrNovik It would help the question if you gave some examples. It's really hard to say why someone commented something on some question instead of giving some answer.
Answer: Not all questions deserve an answer.
Comment: @Makoto doesn't prevent the question from being roomba'd.
Comment: Everyone here is misconstruing the circumstance.  Irrespective of if the answer is in a comment block or in an actual answer, **you are still answering the question**.  If you're not keen on keeping the kinds of questions that are more debugging oriented, then let's have a constructive conversation about it and figure out what kinds of questions we actually enjoy answering.  But this misuse of the system we have doesn't do anything to fix the problem; it only perpetuates the notion that it's still OK to answer questions that we don't really want to answer as long as they're not answers.
Comment: So why bother commenting?
Comment: @Makoto it means we get questions that are not valuable for the repository of knowledge we want to build.
Comment: i mean, i've hoped for it to be fixed for 10 years, kinda given up on that hope at this point. circumventing it is a far more effective option.
Comment: But it actually does... The rule for questions older than one year with a score of <= 0 will not take effect if there's more than 1 comment...
Comment: @Makoto Maybe we should discuss *what* is an answer. I have high expectations of something that goes in the answer box. And by "high" I mean that it should help other people than the OP. "You missed a semicolon on line 3" does not seem to cover that. If that is the kind of answer we want to maintain, I think SO has failed at its mission.
Comment: @Makoto the real reason is you take time to read a bad question that show no effort, if you at least not answer in comment you completely loose your time and so to not loose all the time spend you shortcut to just comment it, simpler, faster. I didn't say it's was the good thing to do, but it's the thing we do as human.
Comment: @Makoto Have you considered, that maybe the question being answered isn't the problem we have with providing an answer to these kinds of posts? I personally would rather the user leave satisfied, while having the question deleted in the end than the user leave with nothing. Creating an actual answer prevents deletion and therefore isn't the right tool for the job.
Comment: So that means that the workaround to the Roomba being somewhat ineffective at removing older or poor questions is to...misuse the comment system.  Right.  Gotcha.
Comment: We also have the expectation of the OP to do some kind of research before asking their question.  *Clearly* that's going well.  May be worth spinning up some kind of Meta conversation about this in that the expectation of answers doesn't align with the reality of answering, and we should make that known to the company, even if we're skeptical that they'll do anything about it.  Phillipe's been here long enough now to start swimming with the sharks so this'd be a golden opportunity.
Answer: It's unfortunately due to the circumstance that comments are often conflated with answers in the sense that:

They can both be upvoted
They are visible to the OP

but with comments being a bit nicer in that:

They can't be downvoted
You can still comment on closed questions
If you get it wrong, nothing adverse happens

Ultimately this is an anti-pattern; answers belong in answers.  If you see others providing actual answers in comments, don't hesitate to create a Community Wiki answer with their comment (and reference the comment too) to extract the value of their comment into a medium that can actually be searched.
Comment: no need to reference comment in my opinion, a comment is not a good source. Also, I don't really like much someone quote me to backup its answer. people must assume their own answer. I think we should encourage people that think a comment should be an answer doesn't "steal" anything by making an answer. Do it. Answer. Don't wait for someone that just commented to make it. Nobody ever will say on SO "that my answer". The people will always think "Ah nice, I was lazy to make it, here take my upvote" if the answer suit them.
Comment: I'm a big fan of elevating useful answers from the comments to community wikis, and wish we'd see more of that. To me, this not only the an ideal use case for the community wiki, but also an underappreciated one. Critically, it allows answers to be marked as accepted, thus making it easier for people with the same question in the future to find useful threads—while simultaneously helping _answerers_ filter out questions that don't need further attention. I would like to spend more time doing that within my tags as a type of community maintenance, and especially for otherwise popular questions.


Does water-based paint expire?

Question: I have almost a whole gallon of Behr white semi-gloss that is 6 years old.  When I opened it, it looked good.  But is it expired?
Comment: How was the paint stored through the 6 years?  Did it experience high heat or freezing temperatures?  What are you planning to use it for?
Comment: it was in a shed so yes, high heat and low temps. painting some plywood shelves and possibly tin ceiling
Answer: I don't have a specific answer for you but all of the data sheets from Behr I've come across seem to suggest that they have a shelf life of two years (IF unopened).  For example: http://www.behrpro.com/cma/BehrPro/Marketing/Products/TDS/7050_27050.pdf
I'd say 6 years is pushing your luck and I wouldn't recommend using it for highly visible or large projects... or project where you need to blend the color with something else.  Maybe you can use it for some minor trivial touch-up projects?

Does water-based paint expire?


Uniform dots distribution in a sphere

Question: I'm trying to implement Barnes-Hut algorithm, with a binary tree. My initial conditions are a uniform mass distribution in a sphere with radius $R$. How can I create uniform dots distribution in a sphere?
Comment: Do you want to distribute a totally arbitrary number of points $N$, or do you want to just have a grid of evenly distributed points (with some more implicit control parameter)? Do you distribute points only on the surface of the sphere or throughout the volume?
Comment: _uniform mass distribution **in** a sphere_ ... sounds to me that the OP wants to generate points _inside_ a ball of radius $R$
Comment: Just to make sure (question is a bit ambiguous), do you need to generate points *on the sphere* or *in the ball* ?
Comment: It sounds a reasonable question to me, I do not understand the downvotes (but I agree the question could be more precise...).
Answer: To generate a specified number of random points in a 3D ball, one possibility is to use rejection sampling to have an initial point distribution, then improve the sampling with Lloyd relaxation.

Examples with 30, 300 and 10000 points
Rejection sampling:
Generate x,y,z coordinates using a uniform random number generator, ignore points that are outside the ball, and continue until you get the required number of points.
Lloyd relaxation
It is an iterative method that makes the distribution of points more regular. Each iteration works as follow: compute the Voronoi diagram of the points, then move each point to the barycenter of its Voronoi cell. See [1] for more detailed explanations.
There is an implementation in my Geogram software library [2]. With Geogram, you need to use a tetrahedralized version of the sphere.
In volume / on surface
There is also a version of the algorithm that works on a 3D surface (sphere or arbitrary surface), called Constrained Centroidal Voronoi Tesselation [3],
also implemented in Geogram [2].
You may also use my software Graphite [4] (graphic user interface around geogram). To sample a sphere in Graphite:
<code>Scene->Create object->OGF::MeshGrob
Surface->Shapes->Create sphere
Points->Sample volume or Points->Sample surface
</code>

minitutorial: sampling a ball in Graphite
[1] https://en.wikipedia.org/wiki/Lloyd%27s_algorithm
[2] http://alice.loria.fr/software/geogram/doc/html/index.html
[3] Constrained Centroidal Voronoi Tesselation, Du, Gunzburger and Ju, SIAM J. on computing, 2003
[4] http://alice.loria.fr/software/graphite/doc/html/
Answer: There is a nice document:

M. Deserno, "How to generate equidistributed points on the surface of a sphere"

which basically summarizes the two easiest methods to generate a distribution of points on a surface of a sphere:

Uniform random distribution (generate $N$ random $z$ and $\varphi$ in $[-R, R]$ and $[0,2\pi]$, respectively and calculate $(x,y)$ as $(\sqrt{r^2-z^2}\cos{\varphi},\sqrt{r^2-z^2}\sin{\varphi})$. However, with small enough $N$ the outpput does not look too uniform.
Generating circles of latitude with constant intervals with points at almost the same distance from each other (see the paper above). Does not generate EXACTLY the requested number of points, but tries to do it close enough.

A sample Python script I quickly wrote:
<code>#!/usr/bin/python
import numpy as np

n = 5000
r = 1
generateRandom = True
generateFixed = True

if (generateRandom):
    print("Generating randomly %d points on a sphere centered at the origin" % (n))
    theta = np.random.uniform(0.0,2*np.pi,n)
    z = np.random.uniform(-1.0,1.0,n)
    for i in range (0,n):
        zp = z[i]
        xp = np.sqrt(r*r - zp*zp)* np.cos(theta[i])
        yp = np.sqrt(r*r - zp*zp)* np.sin(theta[i])
if (generateFixed):
    print("Generating fixed %d points on a sphere centered at the origin" % (n))
    alpha = 4.0*np.pi*r*r/n
    d = np.sqrt(alpha)
    m_nu = int(np.round(np.pi/d))
    d_nu = np.pi/m_nu
    d_phi = alpha/d_nu
    count = 0
    for m in range (0,m_nu):
        nu = np.pi*(m+0.5)/m_nu
        m_phi = int(np.round(2*np.pi*np.sin(nu)/d_phi))
        for n in range (0,m_phi):
            phi = 2*np.pi*n/m_phi
            xp = r*np.sin(nu)*np.cos(phi)
            yp = r*np.sin(nu)*np.sin(phi)
            zp = r*np.cos(nu)
            count = count +1
</code>
Comment: I couldn't understand your code. I wrote another version ([here](https://gist.github.com/nicoguaro/1c5786716ace72fd3cfce814401e4472)), let me know if my interpretation is correct.
Comment: @nicoguaro I don't think the second version of the generation is correct. The logic is a bit more complicated to generate it uniformly: you cannot just have a fixed number of $\phi$ and $\theta$. Take a look at the reference I provided.
Comment: Well, I didn't check the reference. But in your code there is just a triplet (x,y,z) at the end.

Uniform dots distribution in a sphere


How to create matched "minimum phase" for a system of parallel FIRs?

Question: Problem statement
I have a collection of magnitude (only) responses I'd like to turn into FIR filter kernels that are

matched in phase
"minimal" in phase, with respect to the complete system
have little to no "pre-ring"
maintain the design magnitude to a high degree

In the ideal case, I'm hoping for a solution that is analytic rather than parametric.
Meeting the first requirement can be expressed as:
$$
\phi_s(f) = arg\{ H_0(f) \} = arg\{ H_1(f) \} = ... = arg\{ H_n(f) \}
$$
And, is very easy to meet in a linear phase case.
Accumulating phase
In attempting to meet the second condition, I've tried something akin to a "cascading" of phase given minimum phase versions of each filter. I've done this by

returning the "Hilbert" minimum phase for each magnitude response
accumulating these responses, and then defining this as the system phase
reassigning system phase to each response

Here's an expression for the accumulation I used to find the system phase:
$$
\phi_s(f) = \sum_{i=0}^n - \mathscr H \{ \ln( |H_n(f)| ) \}
$$
Unfortunately, for my responses, this results in a poor outcome, returning kernels with way too much smearing / lag at low frequencies in the time domain. All this smearing is far from "minimal" in any sense!
I'm suspicious this may be a result of the two definitions of minimum phase discussed earlier.
Minimum phase of L-2 norm of magnitudes
The most promising results I've had after a bit of hacking is to take the L-2 norm of my magnitude set and use this as a minimum phase target:
$$
|H_{L2}(f)| = \biggl(\sum_{i=0}^n |H_n(f)|^2 \biggr)^{1/2}
$$
$$
\phi_{L2}(f) = - \mathscr H \{ \ln (|H_{L2}(f)|) \}
$$
Setting $\phi_s(f) = \phi_{L2}(f)$ returns kernels with coefficients packed towards the beginning and end of the table. Rotating the table, a linear phase offset, by $\max\bigl(\phi_{L2}(f)\bigr)$, turns the end into a "pre-ring".
While not beautiful, this does get me closer to what I think I'm looking for.
Some more details on my magnitudes
$|H_0(f)|$ is allpass; the remaining are highpass with every increasing roll-off slopes and cut-off frequencies.
Questions
Is there a nice off the shelf know solution? In my mind, the problem is very similar to a matched phase cross-over.
Am I asking too much? In the ideal case I'd like to have no "pre-ring". Maybe that's not possible?
Am I asking the right question(s)? In other words, is "minimum phase" what I'm looking for. What I really want is for my kernels to be matched in phase, and respond "as soon as possible".
Answer: The Hilbert "transform" or relation define one phase response for a given magnitude response, so you can't get both matched and minimum phase in your case.
Regards.
Comment: No, and I think you're hitting physics there. You'll have to make compromise, and it strongly depend on your end application. What is the purpose of this filter?
Comment: So... do you know of a good way to meet the four listed conditions I'd like to meet?