Low memory crash with 500,000 particles

Question: On blender im trying to create a 500000 particle simulation.  Before that I made a 15000 particle simulation and it worked but when I leave my computer on and come back itll say blender is using too much memory and ill have to close it.  I also use all eight of my cpu cores, I changed it to six and it stilled crashed.  This is the third time it crashed.  Ive seen videos on youtube of more than a million particles so I dont know why I cant get 500000 particles with my pc.  I use a Alienware Aurora R5 so it should be able to do this probably.  I also close all other programs when I leave the blender to calculate physics.  I also use my gpu as my rendering device. So I have no other idea than to ask here, hopefully someone here knows the answer.
Comment: So what is the question? This reads like a rant.
Comment: @DuarteFarrajotaRamos "I dont know why I cant get 500000 particles with my pc" - That is their question.
Answer: This error occurs when you do not have enough RAM for your scene. This could be cause by the particles, but it also may be something else in your scene. Try a blank scene with a particle system of 500,000 and see if you get the same error. If you don't, you'll need to optimize the other objects in your scene. Either way, a RAM upgrade is generally a good idea when getting into intense 3D arts.
Also, are you rendering on GPU? If so, try switching to CPU. GPU rendering uses VRAM, whereas CPU uses your computer's RAM.
Comment: Well I do have 16 GB RAM so when I get home I'll try CPU and tell you if it works.

Low memory crash with 500,000 particles


linking object files and linking static libraries containing these files

Question: Hello Stack Overflow Community,
i am working on a c project to interleave multiple c programs into one binary, which can run the interleaved programs as treads or forks for benchmarking purposes.
Therefore i run make in each program folder of the desired programs and prelink all .o files with "ld -r" to one new .o file. After that i add a specific named function to each of these "big" .o files, which does nothing but run the main() of each program and providing the argc and argv. Then i use objcopy to localize every global Symbol except the unknown ones and the one of my specific function which shall run the main(). At last i link these manipulated .o files together with my program which runs the specific named functions as threads, or forks or after another.
Now to my Question/Problem:
I ran into a problem with static libs. I was using ffmpeg for testing, and it builds static libs such as libavcodc and libavutil and so on. Unfortunately, "ld -r" does not link .a files. So i tried to extract these libs with ar -x and then link the extracted .o files in the way mentioned above to the "big" new .o file. But i did not work because libavcodec and libavutil both include the file ff_inverse.o. That is obviously not a problem when i just build ffmpeg, which will link these static libraries. But still, both libraries include it, so there must be a machanism which makes the choice, which ff_inverse.o to use and to link. So my Question: How does this work? Where is the difference?
Answer: The way ld does it with normal linking is to prioritize the libraries.  Libraries listed first in the command line are linked in first, and only if symbols still are unresolved does it move on to the next library.  When linking static libraries, it ignores the name of each .o file, because the name is unnecessary, only the exported symbols are necessary.  You may want to emulate that behavior, by extracting libraries in a sorted order.


sizeof(a)/sizeof(a[0]) vs sizeof(a)/sizeof(t) where t is type in C from K.N.King

Question: I'm trying to understand why sizeof(a)/sizeof(t) is inferior for getting the length of an array to sizeof(a)/sizeof(a[0]) if just as it's possible to have different types, my elements could also be of different lengths. so what makes dividing by the element size uniform?
Comment: To help people understand your question, please explain where `a` and `t` come from. Give multiple examples. In particular, explain what `a` and `t` would be, if someone passes in: (1) an array typedef, (2) an array instance, (3) a pointer. Please remember that most people do not have the same "K.N.King" book as yours. If your question depends on something from that book, be sure to explain it here.
Comment: If it is a C macro, give the definition of the macro, and give examples of how the macro is used.
Comment: An array contains elements of a single type. The size of a type is a constant.
Comment: I'm disappointed with the communities reception of this question. This is not asking us to write or explain code.
Comment: @candied_orange: nevertheless it is badly written and lacks any sign of improvement by the OP, though the question got some helpful comments.
Comment: @DocBrown can't disagree there but if that's your close reason use the "other" option. Confusing the newbies doesn't build the community.
Comment: @candied_orange: fully agree to you. Disclaimer:I did not mistake this for a coding question, and did not vote so. I voted for closing with the "needs details or clarity" reason, but retracted my close vote since it seems the question is clear enough to generate at least one good answer. But I still left my downvote in place. Gnat, do you hear me: this is not a coding question (at least not one for which the default close reason applies)!
Answer: The difference between sizeof(a)/sizeof(t) and sizeof(a)/sizeof(a[0]) is that for the first one you need to supply two pieces of information (the array name and the type of its elements) while the second one needs only a single piece of information (the array name).
The more pieces of information you need to provide, the more chance there is that a mistake is made. To make matters worse, if a mistake is made in the element type of the array, there is no safety net to catch that mistake. You will just get incorrect results.
And a mistake does not mean only when the code initially gets written, but also when later on changes are mode to it.
Suppose you start out with
int arr[N];
…
array_length = sizeof(arr)/sizeof(int);

later on you find that int isn't the right type, because you also need to store fractional numbers, so you change it to double, but you forget the sizeof expression:
double arr[N];
…
array_length = sizeof(arr)/sizeof(int);

Now suddenly, the value of array_length is no longer correct. If you had written it as array_length = sizeof(arr)/sizeof(arr[0]);, then that mistake could not have happened.
Comment: It could be argued that a name change is far more likely than a type change. But a name change is an automated refactoring. Even if done by hand, a mistake would produce a compiler error. So I'm strongly in the `a[0]` camp. Code should welcome refactoring.
Comment: @candied_orange I personally prefer trimming it down to `sizeof a / sizeof *a` as I dislike senseless verbosity, not that it changes anything much.
Comment: @Deduplicator I've heard that debased as well. Some like it short. Some think the long one makes it clearer that you're looking at the size of an element. Personally I wish the whole thing was hidden behind a good abstraction.
Answer: Also consider the pros/cons from a reviewer point of view.
size_t a_size1 = sizeof(a)/sizeof(int);
size_t a_size2 = sizeof(a)/sizeof(a[0]);

The type definition of a may not be near these lines of code, perhaps in a .h file.
To check either line of code, we need to know if a is in fact an array and not a pointer.  This is a binary consideration that is usually understood in review - not much cost.
Yet sizeof(int) obliges another check: does the type match?  For the original coder, this is not much of issue and so may appear inconsequential.  Yet for a reviewer who has cursory knowledge of the code, it is a tedious check.
This is a similar concern of @Bart van Ingen Schenau good answer, yet I wanted to emphasize the increased negative impact on reviewers.


How does Crusader Kings 2 calculate levy percentages?

Question: I'm trying to decipher CK2, and how I can amass an army.  One of my vassals has a town, and in this town are 132/158 levy troops, and it says I can raise the top 20.8% of the levy.  At the top, it says "we can currently raise 6 soldiers".  How is 20.8% of 132 = 6?  What am I missing?
Comment: Welcome to Arqade, and thanks for your first question here. If you have figured it out yourself (and can corroborate it with other examples), it's totally okay to answer your own question! This will allow you to amass reputation and start becoming a more contributing member of Arqade. :)
Answer: (copied From Nick's question)
I figured it out:
20.8% of the total 158 is 32. You can only take the top troops off the levy, meaning since there are 26 troops missing (158-132), I can only take 6 (32-26) troops.


What does SDMA's space actually mean?

Question: What does SDMA's space mean?
I mean,T for TDMA is time,and unity of time is second. F for FDMA is frequency,and unity of frequency is Hz.Now i know the S for SDMA is space or spatial,but i don't actually understand what does this space mean?is it mean the area,so S's unity is $m^2$ ?
Answer: It means that in a multipath fading environment, the signal will have several dominant spatial paths from transmitter to receiver.
From the perspective of a receiver, this means that the received signal will have components from several angles of arrival (AoA).
MIMO techniques exploit this, and use joint beamforming between arrays at both the transmitter and receiver to send different data streams along these spatial paths.  To get the full multiplexing gain, however, these signal paths must be statistically independent.
If the environment does not have any multipath characteristics (i.e. free space), then it is not possible to provide spatial multiplexing, and the best you can do with multiple antennas is conventional beamforming (CBF).

What does SDMA's space actually mean?


The "sum" of prediction intervals

Question: Suppose I have a regression model which yields a couple of predicted values with their respective prediction intervals and the random quantity that I am interested in is the sum of (some subset) of those predicted values. How do I go about building a new prediction interval for this sum? Is it as easy as summing up the limits of the respective prediction intervals?
Comment: Good question. I've run into a similar puzzle (for me) recently: I use a DLM to calculate a trend for a time series, and then I use that trend as a part of a linear (lmer) model.
Comment: :wayne How many trends did you het ? How long was each trend ? Were there level shifts as well ?
Comment: Q & A on Stack Overflow with R implementation: [linear model with `lm`: how to get prediction variance of sum of predicted values](https://stackoverflow.com/q/39337862/4891738) and [Linear regression with `lm()`: prediction interval for aggregated predicted values](https://stackoverflow.com/q/51856369/4891738).
Answer: In short, no, you don't just add the limits. Maybe if the predictions were perfectly correlated, but that's not usually the case at all.
Typically (if the model assumes independence) and you want an interval for a sum of predicted values, you might then think that you can treat the predictions as independent, but they generally aren't independent even when the observations are, because the predictions generally share parameter estimates.
In ordinary regression it's fairly straightforward; you can work out the mean and standard deviation of the sum and construct a t interval similar to the way you would for a single prediction.
If the model is the multiple regression model $y = X \beta + e$ with $e$ ~ $ N(0, \sigma^2 I)$,  and you're predicting a vector of future values, $y_f$, where you have a set of predictors for those predictions, $X_f$.
then you want an interval for $a' y_f$  (where in your case, $a$ is a vector of $1$s)
Then $R = a' (y_f - \hat{y}_f)$ ~ $N(0, \sigma^2 m)$
where $m = a' (I + X_f (X'X)^{-1} X_f') a$
so $Q = R/(\sqrt{m}.s)$ is distributed as (standard) Student t with d.f. the d.f. in the estimate of the variance, $\sigma^2$, which for regression is normally $n-p$, where $p$ is the number of predictors including the constant. From the interval for Q, you can then back out an interval for R and then a prediction interval for $a'y_f$.
Assuming I didn't screw up along the way.
Comment: Q & A on Stack Overflow with R implementation: [linear model with `lm`: how to get prediction variance of sum of predicted values](https://stackoverflow.com/q/39337862/4891738) and [Linear regression with `lm()`: prediction interval for aggregated predicted values](https://stackoverflow.com/q/51856369/4891738).
Comment: Sorry, I don't have one that I can think of that does it directly (though doubtless some books do).
Comment: Glen_b: Have you got a reference for the calculation you proposed (book, article, ...) to dive deeper into that matter?
Comment: In a now-deleted answer [Marla](https://stats.stackexchange.com/users/177186/marla) suggested this reference for deriving the formula for a summed prediction interval: https://apps.dtic.mil/dtic/tr/fulltext/u2/678505.pdf
Comment: Also Thiel, H. 1971. Principles of Econometrics. John Wiley & Sons, New York.
Answer: In order to compute the variance of a sum of forecasts you need to incorporate the covariance between these forecasts. Thus compute the varriance and covariance of the observed series for as many lags as the length of your forecast. Compute the sum of these variances and covariances in a standard manner and the use this to talk about uncertainty in the sum of your forecasts. WE use this routinely to take daily predictions and convert them to probabilities of making month-end numbers.

The "sum" of prediction intervals


Perfect matchings in infinite graphs

Question: Let $G=(V,E)$ be an infinite graph such that $|V| = \kappa$ for some infinite cardinal $\kappa$, and every $v\in V$ has degree $\kappa$. Does $G$ have a perfect matching?
Comment: @FedorPetrov After thinking some more about it I agree that you can simply write a matching down. That poses the question if there are such graphs where you can't. :)
Comment: try Aharoni, Nash-Williams and Shelah.
Comment: Do you allow Zorns lemma to show the existence of such a matching? If the graph gets complicated enough (e.g. complete graph on $\mathbb{R}$), you might not be able to get a matching any more concrete, even if it exists.
Comment: @DirkLiebhold for complete graph on $\mathbb{R}$, you may easily avoid AC:)
Comment: Doesn't well ordering of $V$ + transfinite induction do the job?
Answer: Well, it seems like the following should work:
Let us well order $V$ such that for every $v\in V$ set of $u$ such that $u < v$ has cardinality less then $|V|$. Now we are using transfinite induction to produce matching:
at each step if we are looking at vertex $v$ than if it is already in some pair with one of the previous vertices then just skip it and, otherwise, match it with smallest (under $<$) vertex which is connected with $v$ and not yet chosen. This vertex obviously exists(we already used less then $|V|$ vertices) and so we got our matching.
Comment: You will get into trouble with the "at each step". This will only work if $V$ is countable, otherwise there is no way to look at elements of $V$ "step by step". Furthermore, how do you make sure that this is indeed a matching (so no vertex gets matched to more than one other vertex) and why can you assume that a well ordering of the above form exists such that the cardinality condition is fulfilled (I could give you a well ordering of the natural numbers, for example, where it is not fulfilled...)?
Comment: @DirkLiebhold Fact that such well ordering exists is well known: just take any well ordering and if any bad $v$ exists then let $v_0$ be smallest of them and then $\{ u \mid u < v_0 \}$ is well ordering we were seeking for. For what we constructed to be matching I added part " match it with smallest (under $<$) vertex which is connected with $v$ and not yet chosen." to assure that at any step there won't be any vertex connected with more than one other vertex.
Comment: And about "steps": there of course should be usual frase of the form:

"Let us proof by induction that for any vertex $v_0$ there exists unique partial matching on $V$ such that it contains all vertices $u$ which are smaller of equal then $v_0$, every edge in that matching must contain at least one vertex which is not greater than $v_0$ and for each edge $(u, v)$ with $u < v$ then $v$ should be the smallest of vertices that are connected with $u$ and not in matching with any $w < u$".

Perfect matchings in infinite graphs


How to unsolder a flow soldered board with a large ground plane

Question: Hi I have a flow soldered board with some very big capacitors on it. I was hoping to get them off but when I looked it has a very large ground plane. I was unable to get these capacitors off because it heated up the surrounding board. When I attempted to pull them off even after the solder looked like it was melted and I sucked it off. Once i did this and pulled on the cap it pulled the leads out of the cap. Do you guys have any ideas thanks
Comment: "flow soldered"? Do you mean *wave* soldered?
Comment: yes sorry it was a mistake
Answer: Large ground planes, or any large mass of copper make soldering/desoldering more difficult. You may want to look at getting a better soldering iron that can automatically sense load and adjust power to keep the tip at set temperature (e.g. Metcal, Weller, etc)
However desoldering with "standard" irons is usually possible, you just need more time/care taken. Good solder wick and some liquid flux is invaluable, get some of both if you have none already. Flux generously, use the solder wick to remove as much solder as you can (often with care enough can be removed to free the lead with no further heating, but almost always a little remains however you remove it) from both pads, then if any remains, heat the pad until solder is melted, then wiggle component gently and lift that side slightly, do the same with the other side to bring level, and repeat till you gradually work the component out.
One "trick" if solder will not melt due to too much copper is if you have another iron, you can try using two irons on the same joint (may need someone else to hold the other iron) but this is rarely necessary, and certainly not an alternative to getting a decent iron.
As SubZero says, if the leads come out you are certainly pulling too hard - with some components this happens more easily when they are hot, so a heatsink clamp on leads (e.g. pliers, which can be used to pull lead gently and avoid stress on body, or a dedicated clamp can be bought) is sometimes a good idea if possible. With patience pretty much anything can be removed. If you are planning on doing this a lot follow his advice about the hotplate and heat gun (soldering type, not paint removal type)
Comment: Thanks guys but I have a stain glass Lead iron I will try that I guess.
Comment: I have alredy tried keeping the soldering iron on it for about 10 minutes and it didnt help
Answer: If your breaking anything your probably doing it wrong.
What I would suggest is getting a pre-heater, you can even build one yourself. You didn't provide enough information as to why/what you need to remove or if you need the PCB Intact or are just getting used parts for other projects.
If your just gutting components get a hot air gun and be quick, or cut the board into multiple pieces thus allowing the heat to heat up a smaller area. It really depends on how much work your willing to put into it. Such as when I have a gigantic monitor PCB I sometimes cut the PCB up into smaller pieces so it will fit in my holder to desolder.
As for the pre-heater you want something like this: http://mightyohm.com/blog/2009/01/diy-pid-controlled-soldering-hotplate/
It's a PID (Proportional Integral Derivative) hotplate, You can use it to heat up the entire board to a temperature below solder melting and then use a heat gun/desoldering tool to remove the components.
And as I said if your pulling the leads out your either pulling too hard (Most likely), your iron isn't high power enough, or possible internal damage which you would not want to use in future projects anyway.
Comment: +1 for pre-heater. You won't believe this distance it makes for large ground planes.
Answer: You need an iron that can dump a lot of heat into the joint quickly without overshooting - Metcal MX irons, with a large tip like SMTC-117 are perfect for this and can easily handle large groundplanes in a couple of seconds.
If it was originally soldered with leadfree, flooding with leaded solder will also help.
Answer: http://www.msed.nist.gov/solder/NIST_LeadfreeSolder_v4.pdf
This has some great info if you can understand it. So you have huge ground planes, you want to add a solder that is lower in thermal conductivity to the top of your joints, just makes sure it is melted and the joint has been wel
Liquidus   -temperature -Contactangle-  Wetting rate  -Surface
 Solder tension
Alloy -(ºC) -(deg) -(dyne/
 sec)
-(dyne/
 cm)
1Sn-58Bi 138 43 350 300
1Sn-2.8Ag-20In 114 (low-temp. peak);
178 (primary peak) 44 650 390
theres also this one to try with similar to lead based Low melt P but also
high density slver
Answer: If the bottom of the PCB doesn't have a lot of components, you can try using a hot plate to heat up the large copper area. If you don't have a hot plate, use a baking pan and some sand. Yeah, that's right, sand. It's commonly available and conducts heat extremely well.
Answer: For a long time now, I have successfully used a big cheap 100W hardware store soldering iron, to desolder large components. I have not yet meet a component or a ground plane so large this iron can not handle. Also with a big iron the heating time is much shorter and the component suffers less damage (for example connectors with temperature sensitive plastic on it).
Comment: By big you mean 'high wattage'? The bigger the tip the longer it takes to heat up
Comment: Both big 1cm width tip and high wattage, 100W. The more mass the tip has, the faster it can release it to melt all tin. Bigger tip melts large ground plane tin faster than small. More heat transfer.
Answer: You can also try an 858D hot-air rework tool. Ebay for lots of links. Put the large nozzle on it, crank up the air, and go in circles around the whole area to be desoldered, working the heat towards the cap in question. Once hot enough and with lead-based low-temp solder in the joints to "contaminate" them, the cap should just pull right out (gloves might be an idea, it'll be hot!) The 858D is about 700W - far more heat power than even a large iron can provide. I've done this with very stubborn terminal strips in multi-layer PCB's. Invaluable tool for today's repairs.


What is the best Rear Derailleur for single speed to 3 speed conversion

Question: I am converting my Sonders eBike from a single speed to a three speed and I need some help finding the best Derailleur. I would like to use a Shimano Altus as I understand that they are a step up from the Tourney line. My rear freewheel cogset is 16,19,22t and my front chainwheel is a 48t. This gives me the same speed ratio as my original when I'm using the 19t rear cog. The original chain is 1/8" and I believe that my new chainwheel is also 1/8". My derailleur uses a SunRace Shimano Compatible Index Hanger Plate. The question is, do I use a short, medium or long cage and what is the model number? Thanks for your help, I am converting 2 of these bikes and would like to only buy the parts once.
Comment: Yes, it's completely legitimate to answer your own question -- it's even encouraged! But please do so by posting an answer, rather than by editing your answer into the question. Thanks!
Comment: I'm having a hard enough time looking for 6 and 7 speed derailleur setups for my mountain bike, let along a 3 speed setup.  Have you looked into a internal gear hub and why did you reject it?  I have one on a 50 year old bike and it still works great.
Comment: I agree with David - theres no way for any mod or CM to do this for you - please put the last three paragraphs into an answer.  If you can add photos that would be even better, thank you.
Answer: Yes - Altus are a step up from the Tourney lineup, but is considered a very entry level MTB product. I would encourage you to consider a higher spec model if you can afford it - I suspect the price difference will be small if you shop around.
Derailleurs are rated by the capacity and maximum tooth size. As you are run a x1 setup, you capacity requirement is 22-16 = 6, and the maximum tooth size of 22 is smaller than a typical road cluster, so any derailleur will do the job. As such, using a short cage will give better performance.
You don't say what spacing the three cogs are - If you are using an indexed shifter make sure it matches the cog spacing of your cluster. As always Sheldon Brown has all the info you need
Answer: I ran across my old question after 3 years and found that there were over 700 looks so I thought I would share the outcome of my project.
I have 2 yellow Sondors originals and I participated in the 3-speed conversion blog on the Sondors user site.
https://sondorsforum.com/topic/20-3-speed-conversion/
This site has more information, pictures and how to's about Sondors 3 speed conversion than anyplace on the net. As for derailleurs, I used a bit higher model than most because I got a great deal on two of them. I used a Shimano 105 SS short cage model RD-5701-SS with a 52 tooth chain wheel. The Shimano 105 is considered a touring model and is very robust, falling at the top of the mid-priced models. The slightly larger 52 tooth front sprocket gives me the original ratio on the lowest 16T cog instead of the middle 19 tooth, but the original cog was too low, to begin with greatly limiting my top speed. Now I have two taller gears, more important to me so I can go faster and keep up with light traffic.
The biggest problem I had was finding a shifter that would shift the odd spacing that the Chinese cogs have. Most of the other converters on the blog used a Shimano friction shifter or a click shift. The click shift usually had to be shifted up or down one extra notch then back shifted to make a smooth chain ride. I solved this problem by building an electric shifter powered by a small stepper motor and an Arduino tiny and selected by 3 switches on the handlebars. Details can be found on the Sondors user's blog or search youtube for DIY electronic bike derailleur.
Answer: This question is old but I just cannot resist adding my advice concerning the shifter. This kind of setup would work great with the friction shifter. With only 3 speeds, the highest and lowest gears would be a cinch to shift in and out from. It would take a bit of skill to reliably hit the middle gear but it would get easier with practice. Just for future reference for anyone doing such a conversion that wants to keep it simple.


Texture Distortions

Question: I have a strange problem with a self-created texture.
The output image is a * .jpg 330x890 pixels. In the 3D view "Material"
everything still looks like it should, but the material preview already shows
distortions. After rendering with the Blender engine (F12)
come out very strange geometric figures. Whats going on here?
Comment: There are many ways in which you can map a texture on to an object. You need to learn about **texture coordinates**. Watch this: https://youtu.be/kAUmLcXhUj0?t=265
Answer: sorry, that was my own mistake. I have changed the value of "distortion" in 3D-View, "properties" panel, "influence". Problem solved.

Texture Distortions


Integrating ratio of normal distributions

Question: I have a ratio of two Gaussians, $$l(z) = \frac{p[z|+]}{p[z|-]}$$, where $$p[z|+]\sim N(\mu^+, \sigma)$$ and $$p[z|-]\sim N(\mu^-, \sigma)$$. I want to find the integral $$\int_{-\infty}^{\infty}l(z)dz$$. As far as I know, the ratio of normal distributions follows a Cauchy distribution. However, the textbook I'm reading claims that the integral can be expressed as $$\frac{1}{2}erfc(\frac{\mu^- - \mu^+}{2\sigma})$$, where $$erfc(x)=\frac{2}{\sqrt{\pi}}\int_{x}^{\infty}exp(-y^2)dy$$. I'm not sure how the z can be integrated out from the original integral, what kind of trick should I be using here?
Answer: The ratio of two Gaussian random variable is Cauchy,
https://en.wikipedia.org/wiki/Ratio_distribution
but you are dealing with likelihood ratio (the ratio of two probability distribution function). If you substitute Gaussian pdf expressions in the ratio, you'll figure out that $l(z)$ will be another Gaussian as well and that's why you have $erf(.)$ as the integral.
Comment: Right, that is my initial ideal as well. However, after substituting the Gaussian PDF, I get $$I(z)=\int_{-\infty}^{\infty}exp(\frac{(z-\mu_-)^2-(z-\mu_+)^2}{2\sigma^2})dz$$. The numerator in the exponent can be reduced to $$(\mu_-^2-\mu_+^2)-2z(\mu_- - \mu_+)$$, I suppose some kind of completing the square is needed? But I couldn't think of a proper way to get that numerator into a square..
Comment: This integral is not bounded! Which means that those pdfs were not Gaussian! You should probably need to make sure what kind of pdf you are dealing with. More over, we write $z|+ \sim \mathcal{N}(\cdot)$ in contrast with $p(z|+) = \mathcal{N}(\cdot)$.


How To Change Device Name Used By Google Chrome Browser For History Tracking

Question: As seen in the image below, this is what Google Chrome thinks the hostname of the Windows 10 machine is. However this is not the case and the hostname is something completely different. How can this be changed?
Answer: I found a way to reset the Synced Name under %localappdata%\Google\Chrome\User Data\Default\Sync Data
Deleted both the LevelDB folder and Nigori.bin and then turned off Sync in Google Chrome's settings and turn it on again.
Make a backup and check https://chrome.google.com/sync before you do this if you're unsure, this method only contain sync information and would not delete any data like history, bookmarks or settings.
Comment: This worked for me. It appears to me that with a fresh Windows install, if I change the host name *and reboot* before installing Chrome, the host name is applied; if I'm too impatient and get Chrome first, the sync name will be whatever is randomly generated by Windows.
Answer: If I'm not mistaken, you can edit the device names here and it should reflect globally across all your Google services as long as you have sync settings enabled.
For other devices such as non-Android mobile devices — e.g., iOS — you should be able to edit the device name under Settings > General > About.
For desktop — e.g., Windows PC — the device name should match your PC name, which is set in System Properties.  NOTE: refer to @Pie's answer regarding order of significance .
EDIT: Based upon several of the other updated answers, it stands to reason you should be able to navigate to chrome://sync-internals and either invoke Trigger GetUpdates or — if necessary — toggle Disable Sync then re-enable.
Comment: Yes I agree for the Windows PC it should match the hostname of the PC, however it shows as the generic random generated hostname as shown above. This should be editable somewhere.
Comment: `Trigger GetUpdates` did it for me!
Answer: If you are using a Windows PC:

You must uninstall Chrome
Change the hostname of the PC
Reinstall Chrome

Chrome saves whatever hostname you had when you first installed it, changing the hostname after installing Chrome will not update the hostname in Chrome.
Answer: On MacOS 12.5.1 and Google Chrome 104.0.5112.101 (arm64), there is no need to uninstall Chrome or manually delete any files.
After disabling and re-enabling sync in Chrome, the new hostname is shown correctly in Chrome History - Tabs from other devices.
Answer: You can edit the host name of devices here: https://remotedesktop.google.com/access
Comment: This will only change the computer name shown in the Google remote access service.  I installed Google remote access on my computer and tried then renaming the computer using the specified page but the computer name shown in the browser-sync hasn't changed.


If $|a_{n_j} - b_j| < 1/j$ and $b_j \rightarrow b$ then $a_{n_j}\rightarrow b$

Question: I have some sequence $(a_n)$ with a subsequence $(a_{n_j})$ and another sequence $(b_j)$. How do I formally justify the fact that if $|a_{n_j} - b_j| < 1/j$ and $b_j \rightarrow b$ as $j$ approaches infinity then $a_{n_j}$'s limit as $j$ approaches infinity is also $b$?
Comment: It seems like the sequence $A_n$ doesn't matter, only the subsequence $\{a_{n_j} : j \in \mathbb{N}\}$.  Am I reading the question correctly?
Answer: $0\leq |a_{n_j}-b_j|<\frac{1}{j}\to 0$, so $|a_{n_j}-b_j|\to 0$ by squeezing.
$0\leq |a_{n_j}-b|\leq |a_{n_j}-b_j|+|b_j-b|\to 0+0=0$, so $|a_{n_j}-b|\to 0$ by squeezing again.
Answer: This is simply an application of the triangle inquality. Let $\epsilon>0$. Let $J$ be large enough such that $j\geq J$ implies that $1/j<\epsilon/2$ and such that $j\geq J$ implies that $|b_j-b|<\epsilon/2$. Then we let $j\geq J$. We have that $|a_{n_j}-b|=|(a_{n_j}-b_j)-(b_j-b)|\leq |a_{n_j}-b_j|+|b_j-b|<\epsilon/2+\epsilon/2=\epsilon$. This implies that $a_{n_j}\rightarrow b$.


How do I zoom in on a planet from space to ground level?

Question: I have made a pretty decent planet earth but would like to know if there's a decent tutorial or way of getting from space and going through the atmosphere to ground level. I am not sure of the best approach. I was thinking either make a really detailed section of the planet that I plan to see up close, make a second mesh more detailed at the point of ground level or pause the animation point, delete the less detailed earth and then only recreate the section visible to the camera. All 3 of these could be wrong I don't know. Would one of these methods be the best way or are there other ways to achieve what I am trying to do?
Comment: You are generally correct, make models with the required resolution for the framing. Wide shot Earth texture resolution could be kilometers per pixel, while at ground level the resolution could be centimeters per pixel or less. The same goes for geometry.
Comment: Cheers for that. Helps allot
Answer: I would make it into few scenes that I would then merge in post-production.
Scene 1 - from space, getting close to planet, you could have sunflare, satellite or whatever cover view for a moment, so you could load Scene 2 then.
Scene 2 - Scene 2 starts exactly where Scene 1 ended, with more detailed planet done. It would be going from planet to some upper atmosphere clouds, at point in time cloud would cover view, that is the moment when you start scene 3
Scene 3 - starts exactly where Scene 2 ended, with same cloud covering the scene, but with much more detailed ground and you getting even closer.
And basically that would be it - each time you'd want to increase your details you would have to find a way to cover view for a fraction of a second to switch scenes seamlessly. This way you could do it all the way to the ground and beyond :)
Comment: Thanks for that. This would also lessen the workload on the GPU instead of trying to render it all as one scene.


How to validate a new form of poetry?

Question: I know a writer, who claims to have developed his own style of poetry, called  Mirror Alphoppbet poetry. This new style looks a bit odd to me but he seems to spread it all over and encourages others to use it in their poems.
How do I validate that this new form of poetry actually makes sense? Are there any parameters to judge?
Comment: That is vague. You know someone who thinks they invented a new kind of poetry and is insisting others use it but you can't tell us what it is. It might be something very well established that your friend thinks he created. If you can edit it so we can possibly give useful answers, that could be beneficial
Comment: This is a bit vague. Are you asking whether there is a formula to assess the poetic nature of a given text?What do you mean by validate?
Comment: Well, I should mention the exact new form created by him but I can't do that. Its called Mirror Alphoppbet poetry
Comment: I am sorry if this question sounds too vague. Obviously, I am not asking you to give me a formula.
Comment: What do you mean by "new" and "validate?"  (I'm a tentative leave-open vote for now -- there's something interesting here, but it just may not be phrased quite right.)
Answer: A poet writes with the full artifice of language.
Academics and critics seek connections and dice poems into categories.
At birth, a poem in an unfamiliar style is a poem.  A collection of these becomes a voice.  If copied by others, a genre.
Answer: There is no global poetry board that certifies new poetry forms, nor is there any set criteria for the "validity" of a form.  If your friend enjoys his new form, and if other people do too, I'm not sure why he would need your approval or validation (or what he would do with it if he got it).

How to validate a new form of poetry?


Can "the cleaning" mean "clothes that have been washed"?

Question: If one says
"pick up the cleaning", does this mean "go to the laundry and pick up the clothes that have already been washed and dried"? I didn't find such a meaning of "the cleaning" in online dictionaries.
Comment: would you add more detail or the context?
Comment: Yes, probably shortened from "pick up the dry cleaning" (dry cleaning is a type of chemical cleaning only done by professionals for high-end garments)
Answer:
If one says "pick up the cleaning", does this mean "go to the laundry and pick up the clothes that have already been washed and dried"?

The phrase itself, is not unheard of - and is comparable in popularity (in literature) to similar phrases. google n-gram
However, the most appropriate use of "pick up the cleaning" is as a short-form of "pick up the dry-cleaning". Rather than regular machine-washed laundry.
That said, especially if you are going to collect your clothes from a laundrette (rather than your own washing machine) - it would be extremely unlikely to cause anybody much confusion over what you mean.
As such, I see no realistic reason that using this phrase could cause you any trouble or misunderstanding in a real-life situation.

That said, while it works as a specific phrase - because you are going to another location to collect "cleaning" (which forces it to be a collectable/holdable item) - relying on this phrasing may cause you to make mistakes when extending it to other situations.
For example:

I need to do the cleaning

Would give the idea you were going to do house cleaning (sweeping, dusting, tidying etc.) and not anything relating to laundry.

With that in mind, I'd recommend you use one of these common ways to refer to your personal (not dry-cleaned) laundry:

I need to pick up the washing.

or

I need to pick up the laundry.

Which will avoid any ambiguity, and can be correctly extended to other forms ("I need to do the laundry", "I wish I didn't have so much laundry" etc.)
Answer: You could call it "the washing" (https://dictionary.cambridge.org/dictionary/english/washing) or "the dry cleaning" (https://dictionary.cambridge.org/dictionary/english/dry-cleaning) but not just "the cleaning."


Raspberry PI - Apache Web server - 403 forbidden access only on some computers

Question: Yes, I read through a lot of the related questions, but I can't seem to make sense of my problem. So, I successfully installed the latest Apache server along with PHP5 on a Pi. It works as it should, including PHP. I was able to view the default index.html page and also my test.php file from another Raspberry Pi and a Linux PC. Then, I took the MicroSD card from the Pi and inserted it on another Raspberry Pi. Now, I can't seem to access the default index.html or my test.php from any machine or Pi and it always says 403 error. I don't understand it. I thought anything and everything that you install on Pi is contained within the MicroSD card. So, switching from one Pi to another Pi shouldn't make any changes as far as any system settings go. Even the user on both RPi is "pi." So, why am I seeing this 403 Error?
Comment: If you put the SD card back in the original Pi, does it still work there?
Comment: @Brick Yes, it does.
Comment: I've read about cases where SD cards are not fully transferable because some piece of software configures with the MAC address of specific hardware on a specific Pi. It's not clear to me what about Apache or PHP would have done that in your case though.  To be clear, when this happens it's not because the SD card is not transferable per se, but because some piece of software on the card by the software's design is checking the hardware configuration of its host.
Answer: I suspect you may have an IP address issue. The default configuration for Raspberry Pis (and most computers and laptops as well) is to have a dynamic IP, meaning the device will get assigned an IP by the DHCP server (likely your home router). In order to avoid devices jumping form IP to IP every time they reboot, routers tend to "lease" an IP for a specific MAC address for 24 hours at a time.
Although both Pis are using the exact same SD card, they will have different MAC addresses, therefore, they will be assigned different IP addresses by the DHCP server. A simple and quick fix is to change your IP configuration from "dynamic" to "static" and manually assign an IP address to your Pi. This is done on the SD card directly, just pick an IP address that is in the same subnet as the rest of your network, but outside your DHCP range.
Instructions on how to do this will vary depending on which specific version of Raspbian you are using.


Commutation between integrating and taking the minimal eigenvalue

Question: Let $S = (f_{ij})_{ij}$ be a $n \times n$ real symmetric matrix, with functions $f_{ij} \in L^1(\mathbb{R}^d,\mathbb{R})$ in it. We define $\left(\int u S \right)_{ij} = \int u S_{ij}$ as the elementwise matrix of integrals. What is a necessary and equivalent condition to
\begin{align*}
      \min \sigma \left( \int u S \right)\leq 0 \text{     for any $u \in L^{\infty}(\mathbb{R}^d,\mathbb{R})$}
 \end{align*}
in terms of $S$ only (without talking about $u$'s) ? Actually it implies
\begin{align*}
\min \sigma(S(x)) \leq 0 \leq \max \sigma(S(x)) \text{ a.e on } \mathbb{R}^d
 \end{align*}
by taking sequences $u_n$ converging to $\delta_x$, but the converse is not true thanks to Frederico's counterexample. This is a question raised in a quantum mechanics problem.
Comment: If the converse includes $\max \sigma(S(x)) \geq 0$, I don't think that holds, e.g., for $S = -I$.
Comment: The matrix $S = - I$ is not possible since it does not respect the condition $\min \sigma \left( \int u S \right)\leq 0$ for all $u$
Comment: I thought $u$ was a non-negative weight vector; so do you confirm that it can have arbitrary signs? The counterexample in my answer should still work anyway, if I am not mistaken.
Comment: $u$ can have any sign, so in your case the condition is $\int u \geq 0$, which is not valid ;) but yes your counterexample works
Comment: Thus I'm trying to find an equivalent relation for $\min \sigma \left( \int u S \right)\leq 0$, just in terms of $S$ and without needing $u$'s, if one has an idea...
Answer: [This is an answer to the first version of the question, which asked if $\min \sigma(S(x)) \leq 0 \leq \max \sigma(S(x)) \text{ a.e on } \mathbb{R}^d$ implies $\min \sigma \left( \int u S \right)\leq 0 \text{     for any $u \in L^{\infty}(\mathbb{R}^d,\mathbb{R})$}$]
I think the answer is no. A counterexample is simpler to construct if you first suppose that the domain is $[0,1]$ rather than $\mathbb{R}^d$; then you can take $S(x) \in \mathbb{R}^{n\times n}$ diagonal, with
$$
S(x)_{ii} = \begin{cases}
-1 & x\in [\frac{i-1}n, \frac{i}n),\\
1 & \text{otherwise}.
\end{cases}
$$
Then, integrating with weight $u(x) \equiv 1$ gives $\int_{[0,1]} S(x)_{ii} = \frac{n-2}n \geq 0$, but each $S(x)$ has an eigenvalue $-1$.
Now one can make a change of variable to transform the domain into $\mathbb{R}$, introducing a weight $u(x)$ in the process. Similarly, one can extend the function to $[0,1]^d$ by making it constant on the last $d-1$ dimensions, and then transform the domain into $\mathbb{R}^d$ with a change of variable.


Can I force a password change?

Question: When I create a new user, I would like to force that user to change their password on first log in, can this be done?
Answer: Not out of the box, but you could implement it by:
Adding a user meta on user create.
Dropping that meta on user password update.
Redirecting the user to his profile page, from anywhere else, if the user meta is around.
Comment: what methods could help me here?
Answer: I've been searching for this as well. My theme presently sends out an auto password. Would like to find a way to force a password change upon first time login
Comment: This is very simple to do. 1. remember the user's account email address in the Users panel of the site and change their password to something random and save it. 2. Log yourself out of the WP Dashboard. 3. Now at the login window look for the "Lost your Password?" link, click it. 4. Enter the user's email address that you would like to reset. 5. They will receive an email telling them that a password reset has been performed on their account and if they attempt to login with their old password, they can't and will have to choose a new one.

Can I force a password change?


PDF Metadata Editor Freeware that can change the default magnification

Question: I am looking for a PDF Metadata Editor Freeware that can change the Magnification of a PDF document so that, by default, it is set to "Fit to one full page". This can be achieved with Adobe Acrobat via the "Initial View" tab in the "Document Properties" window, and while I have found plenty of free alternatives for editing the PDF metadata, somehow this option is not available on them.
Comment: Most options set by Adobe PDF software are recognised only by other Adobe PDF software - every other app does what the heck it likes.
Comment: The **OpenAction** is an _optional_ part of the specification. And, like others have pointed out, changing the setting **Initial View → Magnification** setting in Acrobat has ZERO effect when opening the PDF with macOS Preview and Google Chrome.
Answer: One option could be to use a Python programming language, specifically PyPDF2 library, that can be used also for writing PDF file's metadata.
Inspired by this topic on Stack Overflow, I was googling for correct metadata option. Later I found from here, that these may be the right ones:

Navigation: Page Only
Page layout: Default
Magnification: Default
Open to page: 1

So I constructed a basic script, that can persist 'Magnification' set to specific value in a copy of original PDF file (PyPDF2 can not write directly the file as you can read in above SO topic):
<code># after installed module with for example: python -m pip install PyPDF2
from PyPDF2 import PdfFileReader, PdfFileMerger
file_in = open('temp.pdf', 'rb')
pdf = PdfFileReader(file_in)
pdf.documentInfo
</code>
Prints out these values for my testing PDF file:

{'/CreationDate': 'D:19960725144744', '/Producer': 'Acrobat Distiller
2.1 for Power Macintosh', '/Creator': 'FrameMaker 5.1', '/Title': 'Acrobat Reader 3.0 Online Guide', '/Subject': 'HELP', '/Author':
'Adobe User Education', '/Keywords': 'Reader, Acrobat, help, online
guide', '/ModDate': 'D:19960725150342'}

<code>metadata = pdf.getDocumentInfo()
pdf_final = PdfFileMerger()
pdf_final.append(file_in)
pdf_final.addMetadata(metadata)
pdf_final.addMetadata({'/Magnification': '100%'})
file_out = open('new.pdf', 'wb')
pdf_final.write(file_out)
file_in.close()
file_out.close()

# now check out metadata of the pdf copy
result = PdfFileReader(str('new.pdf'))
result.documentInfo
</code>
which results to:

{'/Producer': 'Acrobat Distiller 2.1 for Power Macintosh',
'/NeedAppearances': <PyPDF2.generic.BooleanObject object at
0x0000017C704034C0>, '/CreationDate': 'D:19960725144744', '/Creator':
'FrameMaker 5.1', '/Title': 'Acrobat Reader 3.0 Online Guide',
'/Subject': 'HELP', '/Author': 'Adobe User Education', '/Keywords':
'Reader, Acrobat, help, online guide', '/ModDate': 'D:19960725150342',
'/Magnification': '100%'}

That means that the parameter for magnification is preserved in the copy of that PDF file, but I cannot test it since the free version of Adobe Reader does not provide the 'Initial View' tab in the document properties. Furthermore if you run through this topic about opening PDF at specific zoom level, you may not be sure, that your PDF browser is respecting this setting (if you are using other than Adobe Acrobat PRO).
Can you try this on your own and let me know if worked?


Inverted commas used around a letter or single word

Question: In a sentence we find a word in inverted commas or a single letter. Why?
Example 1: My 'first' experience of ...
Example 2: The letter 'g' in the word gnaw is silent
Comment: In this example the author wants to emphasize on the word *first*. He could have used double quotes instead, but he might have had them reserved for some other things.
Comment: related: http://english.stackexchange.com/questions/72307/who-coined-the-term-scare-quotes-and-why-is-the-word-scare-used and http://english.stackexchange.com/questions/3470/whats-the-difference-between-using-single-and-double-quotation-marks-inverted-c?rq=1
Comment: @Mari-LouA I disagree that this is a duplicate of the 3rd ref you quote: that Q. does not address Ex.2 in this Q.. Nor does either of the other 2 refs. Voting to leave open for that reason.
Comment: @TrevorD agreed the two questions are not identical but they are very similar. Could we at least agree that any future questions on why inverted commas or quotes are used to highlight words, should be closed. Moreover, there should be a way for the system to recognize "quotation marks"/"quotes"/"inverted commas"/"speech marks"/"double quotes" as being related to each other, otherwise we will continue to see similar questions.
Comment: @Mari-LouA I don't disagree with anything you've said. I just thought that Ex.2 deserved an answer - which it's now had anyway.
Answer: They have different meanings

Scare quotes

They are placed around a word or phrase to indicate that it is not used in the fashion that the writer would personally use it. In contrast to the nominal typographic purpose of quotation marks, the enclosed words are not necessarily quoted from another source. When read aloud, various techniques are used to convey the sense, such as prepending the addition of "so-called" or a similar word or phrase of disdain, using a sarcastic or mocking tone, or using air quotes, or any combination of the above

Inverted commas

to mark off a word or phrase that's being discussed
Answer: Words are often written within quotes to indicate that someone has already used it earlier.
Letters are written within quotes since writing just a letter (apart from I) isn't grammatically  correct. A letter by itself has no meaning. So, to use them in sentences, quotes are required.
Comment: Simply that quotes should never be used for emphasis. They quote.
Comment: I think it's necessary to make clear that your first sentence indicates incorrect usage (however often encountered).
Comment: Could you please point out the mistake?


MultiTouch TouchPad versus Mouse - which is more powerful?

Question: There are old questions here from the 2012 era before MultiTouch became popular in both TouchScreens and TouchPads.  Users tend to forget that using more than one finger is where the power comes in.  One finger is mouse-like, using two or more fingers opens up many more gestures.  Forgetting about TouchSreens for a moment and focusing on which provides more efficiency and empowers the user more, what wins, the mouse or a multiTouch TouchPad?  Are their studies?
Comment: The criteria in my case are mobile users performing otherwise normal Windows functions.  The context in my case are mobile users demanding a wireless mouse to use their $2700 ThinkPad TabletPC already natively equipped with touchScreen, stylus, touchPad, and trackPoint.  Seems to me a multiTouch TouchPad increases efficiency much more than any mouse.
Comment: Mice vary in their design - so likely some mice are 'better' than others.
Comment: "users demanding a wireless mouse" – What's stopping them from buying one themselves?
Answer: What is the criteria to decide more powerful? Touchpads with three-finger taps can perform the same functions as two-button mice with scroll wheels, which three-button trackballs can emulate. What "wins" is what's available. Desktops rarely have touchpads. Laptops usually don't come with mice. Only the faithful go out of their way to purchase trackballs and touchsticks.


Concatenate the docID in SharePiont

Question: Can the document ID column be concatenated and used in a calculated column to numbre items in sharepoint library? If yes, how is that done?
Answer: As a short answer: NO

The ID column is not a supported field in the calculated column.

For more details, check The supported and unsupported columns in SharePoint calculated column formula
As workaround solution

Create a SharePoint Workflow using SharePoint Designer as mentioned at Using ID field in a calculated column in Sharepoint

Concatenate the docID in SharePiont


64 Bit Windows Server Clones are not pinging to each other

Question: I have 2 clones of 64 bit windows server hosted upon windows 7 64 bit using VMWare Workstation 7.0, i am struggling to ping virtual machines but it is not pinging. i have checked all network settings, firewall is off. if i use 32 bit virtual machine then i don't have any problem only this issue is with 64 bit clones... please suggest. thanks in advance.
Comment: So if its not pinging, what is it doing instead? It should give you an error message.
Comment: Is the windows firewall turned on?
Answer: Do they have different MAC addresses?  If not then they will be unable to communicate.
Answer: Are you using bridge, NAT or host-only network? Make sure the machines are on the same network segment and are using the same network adapter.


Git Branching - Trusted on large projects?

Question: I'm pleasantly surprised how easy it is to perform branching with Git. What worries me is, for all the hundreds of files that I may have in my directory structure, can I really trust Git to make sure all the files are put in to the right state when I checkout another branch? It seems too quick to be true.
Has anyone experienced a time where they checkout a different branch, and some files were skipped, or just not changed when you know they should have?
Comment: It's a pity that people are so used to the bad performance of other version systems that they don't trust a version system with high performance on first look. Instead you should have asked why the others need so much more time...
Answer: Because Git manages pointers to files based on the hashing of the contents of the files, it will not need to rewrite a nearly identical directory, no matter how many files are in there. If you look at the structure of commits and the concept of a tree, you will see that Git will walk these structures quite efficiently and only change the parts of your working directory that need to be changed. It's power lays in the simplicity.
I've never had any issues with Git and large projects. The linux kernel and other large projects are versioned with Git with no problems and fast and reliable performance.
Answer: Yes, you can trust it. However, when really something gets wrong, any other clone of the repository (beside the main repository itself) is a backup ;)
It's so fast, because

Every operation is local in first place, which means: No slow network operations required
It only pushes the changes into the workspace: It takes the first common ancestor between the current branch and the branch-to-checkout, revert the changes from the current checkout to this ancestor and then applies the changes from the ancestor to other branch. This only happens in the background, but this highly reduces the amount of files, or changes to push into the workspace at the end.

Maybe (possibly, probably ;)) there are other optimizations. I don't know.
Answer: I've been using Git for several years and have found it to be highly reliable in this area. I have used it with projects of thousands of files.


Switching quickly between users in Windows 8

Question: I use an Administrator account and a user account and keep switching between the two often. Is there any keyboard / mouse shortcut to switch quickly between the two users? Much better if it doesn't prompt for password everytime!
Comment: Well, FWIW, you can switch quickly by using the [user drop-down menu  on the start screen](http://superuser.com/a/491480/20088). But there's no way to disable asking for the password to switch users, unless you don't have a password on the account.
Comment: If it didn't prompt you for the password, wouldn't that rather defeat the point of having separate accounts?
Comment: Not if it's being used for test purposes
Answer: Why don't you just login to your regular account and whenever you need to do admin stuff, just use runas command line. This should give you the best of both world.
Comment: you dont need to use the command line you can just right click on the exe.
Comment: @TaylorGibb, correct but `runas` with `savecred` option saves your credential to use for next time. over time, that'll save you time.
Comment: i would hate to have to open a runbox/cmd prompt everytime i want to run a program. The only way i could see this working is by using batch files, maybe.
Answer: You can switch user (ie. Lock) by using the shortcut Windows+L.
If it does not prompt you for the password, it means there is no password (ie. it is disabled). Based on How to remove login password from windows 8 logon and login automatically without entering it, you should:

Run (Windows+R) netplwiz

Un-check the requirement to enter username and password.

Remove any passwords set.

Alternatively, you can run as another user:
runas /savecred /user:domain\user "notepad"

If you do not know what domain and user is correct, you can ask whoami:
> whoami
domain\user

Answer: That kind of defeats the point, why dont you just run your programs as administrator from the other account.
This is a best practice anyway and is the sole purpose of UAC.
If you want to launch Metro apps as another user there is a Group Policy setting you can enable.


what is the maximum size of a block?

Question: Just for some analysis purpose i need to know what can be the maximum size limit of a block can have like 2MB or 5MB and is there any doc how we can customise it as per our need if its possible?
Comment: for parachains it appears to be 5MB as mentioned here https://substrate.stackexchange.com/a/5239/83
Answer: The block size is controlled in different ways. From the runtime you can set the maximum block size by setting the BlockLength. The block builder is also tracking the block size and by default aborts at around 4.5MiB, this can be changed by this function. The upper maximum is controlled by the maximum network package size, which is 16MiB.
When you are writing a parachain, the maximum block size is depending on the maximum PoV size. The maximum PoV size is controlled by the relay chain governance and thus, it is dynamic.
Comment: What is meant by the "maximum network package size"?
Comment: There is a maximum size one network message can be, that is what I wrongly named "maximum network package size"
Comment: Is that a libp2p limit? Given the numbers 16 MiB I doubt you're talking about a limit of the underlying protocols (http/tcp/ip)
Comment: That is the limit for the block response protocol and is set in Substrate.

what is the maximum size of a block?


What is the framerate of the macbook pro mid 2012 non retina facetime hd camera?

Question: I have a macbook pro mid 2012 non retina facetime hd camera. It is advertised as having a facetime hd camera however the frame rate seems to be very low (14.5 fps). Is this normal?
Comment: where do you get the 14.5 fps from ?
Comment: quicktime player recording (movie info)
Answer: The hardware is capable of 30fps, I have this model (MacBookPro9,1, i7 2.3 GHz) on my desk in front of me and just shot a movie that lists as 29.81fps at 720p.
However, Apple will, in software, reduce the frame rate if your HDD/SSD/other storage and/or processor and memory are not capable of handling the maximum frame rate at the time of capture. The do this to ensure you can still use the camera even in non-optimal conditions.
How much free space (percentage) do you have on your storage? Are you running any processor intensive applications. How much RAM do you have? These factors can have a serious impact on capture rates.
It is also entirely possible that the frame rate is being affected by other factors if you are using a 3rd party application such as Skype.
Hope this helps?
Comment: how did you record this? Did you use quicktime? I have the same model as you.
Comment: Never mind. For some reason if the room is brightly lit, it records at a higher fps.


Creating a specific sized LVM logical volume at the end of a physical volume

Question: I have a physical volume that is 49.8GB and I want to have a 2GB logical volume which is at the end of the physical volume and the rest of the physical volume being another logical volume. I read through the man pages for LVM and I didn't find a distinct way to add logical volumes to the end of a physical volume.
Comment: I don't think LVM lets you decide where to put a logical volume inside a physical volume. Why don't you split the PV?
Answer: If this is your objective, you can create the logical volume and specify the extents for its placement:
lvcreate -l 100 -n lvol1 vg01 /dev/sdb1:900-999

In this example, you would be creating a 100-extend logical volume named 'lvol1' on 'vg01', using the physical volume 'sdb1', extents 900 through 999.
In the case of existing logical volumes, if you have free extents within the volume group, you can use pvmove to shuffle extents within a physical volume or among physical volumes of the volume group.
Answer: How to calculate LV size in extents:

pvdisplay -m and see max extent number for required PV (in my case /dev/sda).

caclulate size in extents = [size in you need GB] * 1024 * 1024 / 4kb
e.g. 800GB = 800 * 1024 * 1024 / 4096 = 204800

calculate starting extend number: max extent - size in extents + 1

execute command:
lvcreate -n MyLV1 -l204800 vg-raid5 /dev/sda:start_extent-max_extent

e.g.:
lvcreate -n INSTALL -l204800 vg-megaraid /dev/sda:1224995-1429794


What are you doing if you notice a MITM attack against a Linux server?

Question: I got this question at a job interview, but I did not know the answer. I think they expected some shell command or packages, which can help react to the attack.
Assume that, you are a system admin and you work for the Nokia Networks. This server store customers details and communicate with them when a customer want to report a problem or bug through the global and 2 internal networks. The attackers are using DNS-poison and they can also start the attack from the internal network, but these details were not specified.
I know it could be a linux question, but actually it is connecting to the IT security too.
Comment: It depends who you are, who you are working for, what is on the server and maybe other parameters as well (company policy, regulation, ...). To me this is an open question.
Comment: You can [edit] your question to be more specific: what is the function of the system being attacked? what is the potential harm of attacking this system (to customers, employees, etc.)? what are the requirements of this system (e.g. uptime)? what kinds of network resources does this server need to communicate with that are being attacked by the MITM (e.g., internal corporate resources, customer interaction)? how is the MITM attack being implemented (DNS poisoning, ARP poisoning, control of a hub), or if that's unknown, how did you detect it?
Answer: If you notice that someone is actively man-in-the-middling a server the first thing you should do is inform your incident response/security team.
They should decide on mitigating controls, that's their task. It's highly dependable on what technology is being MiTM and in  what way. It also depends largely on where the MiTM is occuring. Aside from re-adjusting routes to go across another network, there's not much you can do.
Answer: Keep in mind the context here - since it's an interview question, the goal is to assess your understanding of the terminology and concepts.  They were probably not interested in some specific tool, or an exact command you would be running (although you might get kudos for knowing something like that).
As mentioned in comments, there are MANY specifics that could influence the answer, so don't bother with those.  The point is to demonstrate you understand what a MITM attack is, potential ways it could be detected, and how relates to the job you were interviewing for.
For example, your answer could have been:
"Well, a MITM attack involves a malicious user redirecting legitimate traffic through a machine they control. If I noticed this while working on a server, I was probably monitoring network traffic and saw something odd in the traffic patterns or in the ARP table.  It's also possible I was reviewing the logs for a web server/application and I noticed abnormal activity from a single machine."
Comment: You're definitely right, but it was a Linux system admin test and I had to answer with commands the first questions. Anyway, you guys are right, because they didn't specify this question, thus hard to determine the right answer.
Comment: How would you detect arp patterns if you just got access to the machine? A lot of it will be a best guess situation.
Comment: @munchkin The stated assumption is that you are a sysadmin working for the company. By extension, it would be assumed that a sysadmin would know the correct gateway for the subnet, and if you saw an incorrect gateway in ARP tables (i.e. for a DHCP client) you could assume something weird was happening.


How does a distant observer see matters that "form" an initial black hole?

Question: I did see Can black holes form in a finite amount of time? but it does not seem to discuss how a distant observer would see evolution of collapsing matters that form a black hole. Does it view these matters as disappearing under the horizon, or does it see being radiated back by Hawking radiations, with a distant observer unable to actually see matters falling into the horizon?
Comment: Possible duplicates: https://physics.stackexchange.com/q/47669/2451 , https://physics.stackexchange.com/q/34816/2451 , https://physics.stackexchange.com/q/325320/2451 , https://physics.stackexchange.com/q/309990/2451 and links therein.
Answer: Strictly speaking the far away observer never seen the black hole forming, and after a while it will start receiving Hawking radiation, until nothing is left.
The evaporation process can be thought as starting slightly outside the horizon (at a Stretched horizon). This is pictured in the image on the left, a Penrose diagram of an evaporating black hole (remember that light travel at $45°$ degrees here)

Have a look also at:
From where (in space-time) does Hawking radiation originate?


tense of "would be" (when used as a synonym for "was")

Question: In a school paper, my son wrote the sentence, "In 1763, the stalemate would be broken." His teacher told him to avoid the "past progressive tense." The phrase "would be" is clearly not an example of the past progressive tense--but I can't quite figure out what tense it is. Can anyone help?
Answer: In your sentence, would is a modal verb that doesn't have a tense per se.
From the Cambridge dictionary:

Modal verbs do not change in form to make different tenses.
All of the modal verbs can refer to present and future time. Only some of them can refer to past time.

In the case of your sentence, would is referring to a past event.
Comment: This tense is often called 'future in the past'.  It isn't necessary here because a time reference is given, so it can simply be 'past'.
Answer: First, the sentence of your son is

In 1763, the stalemate would be broken.

so the verb is would be broken, and not just would be. It's a passive construction. The active counterpart would be:

In 1763, [something] would break the stalemate.

The use of would indicates a conditional mood. In this specific example, the tense is simple conditional (I would do smth).
N.B: Of course, here conditional doesn't imply there is a condition. It refers to a "future in the past" (i.e. future happenings with the past as a time reference).


eosio claimrewards action - got error: unable to find key

Question: I've votef for proxy on Eos chain and when want to claim proxy rewards I get this error: unable to find keys.
Answer: The claimrewards action on the EOSIO contract is for active block producers to claim rewards and is not used for anything else. It's a system contract, where as these rewards proxies are not part of the native system and are user run. That's why you're receiving this error message.
For rewards from a proxy, they are either going to be automatic or based on that rewards proxy's specific smart contract. I'd probably recommend contacting the proxy directly and asking them about their rewards system.


Rails eager loading and conditions

Question: I have the following associations set up
class bookinghdr
  belongs_to :agent
end

class bookingitem
  belongs_to :bookinghdr, :include => agent
end

So I was expecting to be able to do the following:
named_scope :prepay, :include=>["bookinghdr"], :conditions => ["bookinghdr.agent.agenttype = 'PP'"]

and in my controller do:
b = Bookingitem.prepay

But that gives me a ActiveRecord::StatementInvalid: Mysql::Error: Unknown column 'bookinghdr.agent.agenttype'
However if I don't include the conditions clause then I get a recordset on which I can do:
b = Bookingitem.prepay
b[0].bookinghdr.agent.agenttype

without any error!
I don't want to have to get all the records and then iterate over them to find the ones whose agent has a 'PP@ flag.  I was hoping that AR would do that for me.
Anybody got any ideas on how to achieve this?
Answer: Your question shows that you have not yet fully understood how associations and named scopes work. Since I cannot tell from your question what parts aren't clear, I suggest you read the Association Basics guide at http://guides.rubyonrails.org/v2.3.11/association_basics.html. This should bring you up to speed regarding the concepts you want to implement. After you have read the guide it should all make sense.

Rails eager loading and conditions


Convert $\frac{2x^3+4}{x^2-1}$ into partial fractions.

Question: I want to convert $$\frac{2x^3+4}{x^2-1}$$ into partial fractions but I've made a mistake somewhere. $$\frac{2x^3+4}{x^2-1}=\frac{A}{x-1}+\frac{B}{x+1}$$ and found that $A=3$ and $B=-1$ so the partial fraction should be $$\frac{2x^3+4}{x^2-1}=\frac{3}{x-1}-\frac{1}{x+1}$$ but the answer is $$\frac{2x^3+4}{x^2-1}=2x+\frac{3}{x-1}-\frac{1}{x+1}$$ and I don't get why.
Comment: You forgot to do long division - first reduce the degree of top
Answer: The degree of numerator must be less than degree of denominator.
So either do the long division, or do the following to do that.
$$\frac{2x^3+4}{x^2-1}=\frac{2x^3-2x+2x+4}{x^2-1}=2x+\frac{2x+4}{x^2-1}$$
Now let $$\frac{2x+4}{x^2-1}=\frac{A}{x-1}+\frac{B}{x+1}$$
to get
$$\frac{2x+4}{x^2-1}=\frac{3}{x-1}-\frac{1}{x+1}$$
Now finally;
$$\frac{2x^3+4}{x^2-1}=2x+\frac{2x+4}{x^2-1}=2x+\frac{3}{x-1}-\frac{1}{x+1}$$
Answer: Since the numerator's degree is higher than the denominator's, you must first divide the polynomials:
$$\frac{2x^3+4}{x^2-1}=2x+\frac{2x+4}{x^2-1}$$
and now you do partial fractions with the rightmost fraction (in which the denominator's degree is already higher than the numerator's), and you get the answer.
Answer: hint: at first you must divide $2x^3+4$ by $x^2-1$ the result should be $$2\,x+3\, \left( x-1 \right) ^{-1}- \left( x+1 \right) ^{-1}$$


Left hand fretting

Question: I used to play guitar well but due to an accident I now cannot play it due to my left hand not being able to fret it correctly. Is there another stringed instrument that would be easier to fret with the left hand? Someone mentioned the banjo?
Comment: Bass perhaps? And why is this tagged with "fretless-guitar"
Answer: Difficult to give a suggestion without knowing in detail exactly what your left hand can and cannot do, but I cannot help thinking about Django Reinhardt, and what he was able to do even after losing two fingers in a fire...if you haven't read his story yet, you might want to do so, maybe starting from his wikipedia page and some youtube videos:
Wikipedia link
Django playing without 2 fingers, Youtube
While there are quite a few recordings of his, videos that show him playing are very rare, so, just to give an idea of what it may have looked like when he was playing full out, here's a modern rendition of one of his most popular tunes:
A Django tune (hard even with all fingers!)
Answer: Hand trauma is always a tragedy for a pro musician.
You can play a slide guitar, set a lighter gauge strings  or quit instrumental music to sing or to do the other jobs. Ask surgeons for proper operations and rehabilitation. Do not despair.
Answer: What comes to mind for me right now is lap steel or dobro. Both are instruments that have much in common with regular 6 string guitar but don't require fretting in the traditional manner, instead open tuning makes possible chords using a bar, and you can also play scales and modes, but                                                                                will need to learn new scale note placement because of the open tuning. I may be assuming to much, but your mentioning learning to play banjo leads me to believe the music you are interested in playing may be bluegrass and both instruments fit nicely in that category. Perhaps further detail in your original post might inspire other ideas.
Answer: I don't really find banjo or bass guitar easier to fret than guitar. But that is just my opinion.
What I would attempt first in your case, is to put on lighter strings on your guitar.
If that isn't enough, you could try to tune it down a couple of half steps, since it will make the strings less tense. This is of course only a reasonable solution if you are playing alone. You have to readjust/rearrange the music you are playing when playing with others, which is not always something you wish to do.
A more extreme solution is of course to switch over to left handed guitar. If your left hand is up to play what your right hand normally did.

Left hand fretting


Brownian motion increments - are they random variables or random processes

Question: If $W_t$ is a Brownian motion process and $0 \le t_1 \le t_2$ then is the increment $W_{t2} - W_{t1}$ a random variable or a random process? My lectures say "random variable" but I believe it makes more sense to call this a random process because any segment of a Brownian motion process is still a Brownian motion process.
Answer: If $t_1$ and $t_2$ are fixed it is a random variable. If you consider it as a mapping from $\mathbb{R}^2$ $(t_1,t_2)\mapsto W_{t_2}-W_{t_1}$, so that $t_1$ and $t_2$ are variables, then you can see it as a process on $\mathbb{R}^2$.
In practice you can see a random process as a set of random variables which are labelled on some space (in your case by $(t_1,t_2)\in\mathbb{R}^2$). So even when you look at $W_t$ itself, if you consider it as a mapping $t\mapsto W_t$ it is a random process, if you consider it at a fixed time $t$ it is a random variable.
Answer: The increment is not only a random variable but it is a normally distributed random variable.
I think your confusion is on the difference between an increment between two points of the path and a subset of the path itself.  The increments are normally distributed random variables, and independent ones if the increments are disjoint, but if you take a subset of any part of the path that path itself is another Brownian motion.


What is this "Bigonium Atom"?

Question: Today I entered the magical graffiti word "Pakwagormaglioo" and I encountered a hovering box called the "Bigonium Atom", its seems to go in circles making big purple flashes, so far it did not hurt me but I'm worried, is it dangerous ? Can I do anything with it ? Is it a LHC joke I don't get ?
Answer: It is not dangerous (to you), you can't do anything with it (except lure enemies into it), and it's probably an LHC joke.
The Bigonium Atom itself is defined as a <customblocker> in expansion3/game/wizardRoomDB.xml, in the room definition "Thaumatron". As a customblocker, it's a piece of scenery that blocks movement but can't be otherwise interacted with and doesn't do anything on its own.
Also attached to the room is a set of

What is this "Bigonium Atom"?


Company computer use from home - how much can they see on the desktop?

Question: I have a company supplied computer that I use from home. I log into VPN (cisco AnyConnect) when i need to access company email or internal company sites.
In the past the company has been able to "take control" of my desktop to make software updates (after i handed power over to them). A co-worker -- also off-site -- received an email from the company saying that Mac her internal hard drive was over 90% full and advised her to delete files that were no longer needed to avoid a possible hard drive failure.
So my question is how much can they see? Obviously if i'm logged into VPN they can track the sites I'm on, but what about if i were to log into my bank to check on a balance or pay a bill?
Or even my browsing history when not logged into VPN? how about an area on the computer where I might keep passwords for various sites (everything from facebook login info to credit card accounts)?
Comment: Assume "everything" and don't use it for anything you wouldn't want your company to know about.
Comment: enough that they sent me an email with the directory and timeStamp and loginID of a virus!
Answer: The tools are out there for a company to collect a great deal of information about how you use your work-supplied computer. There is software available that can record every keystroke, complete browsing history, even periodically take pictures with the webcam or sound from the microphone. Your company may not have this sort of thing installed, but it is good advice to assume that anything you do on that computer, or even within sight or hearing distance of that computer may be recorded.
In many cases the law isn't particularly clear about what information companies can use, historically companies own and have the rights to anything you do on their equipment, even if you weren't clocked in. People have been fired from their jobs and students have been expelled because of information on systems when they weren't at work or school.
In other words don't use your work PC for anything that you wouldn't want your employer to see or hear.
Comment: There are serious privacy issues if the work computer can be brought home, with images taken periodically from the webcam.
Answer: If you have to ask the question, then don't do what your thinking about doing on company computers, networks, or equipment. Not only do you have to worry about the company, but if your company becomes part of a litigation or a regulatory compliance issue, whatever you have done on it will get gathered up and become public record.
So to my original statement... If you have to asked, or pause to think, "should I" - then don't.
Answer: The answer really is... it depends.
This question is impossible to answer without knowing exactly what sort of software your company has installed on your computer. However, to assuage your fears do take a look at the contract you signed. That should detail exactly what sort of data the company is allowed to collect from you.
Comment: Data collection contracts aside, storing any data that's not business-related on company resources is generally ill-advised.
Answer: From my answer to a related question:

If you're really concerned about your personal privacy, don't use
  corporate resources for personal purposes. Most companies have
  included in their Acceptable Use Policy or similar documentation, a
  clause that specifically says you may be subject to monitoring and
  have no expectation of privacy when using their systems. In many
  jurisdictions, this means that they can do whatever they want to
  observe and record your activities with or without your explicit
  consent (generally, your consent is given implicitly upon your
  agreement to the AUP) and/or knowledge - causing any retroactive
  attempts at personal privacy to be futile and ineffective.
Case in point: At one former workplace, I heard of a user who decided
  to do some, let's say, "very personal" web browsing on a company
  laptop while he was on his home network. Apparently he was under some
  delusion that whatever he did with the company's hardware was none of
  their concern if he did it on his own Internet connection. To be safe
  though, I'm sure he had some good history cleaning software in place
  and in use. He was also technically savvy enough that he probably did
  some manual cleaning of his own, periodically.
What he didn't know was that the company had monitoring software
  installed locally and running in the background. This software would
  record his Internet activities at all times, and relay the logs to the
  corporate servers whenever the laptop was connected to the intranet.
  You can imagine the resulting disciplinary actions when this occurred.

Long story short: If it's not business-related, don't do/keep it on a business computer.
Even regardless of what they are seeing or collecting in real-time, the fact remains that you will eventually have to turn the equipment back in - either for a hardware refresh, or as a part of your separation from their employment - and you may not necessarily have control over when and how that happens. At that point, they'll have access to anything you've stored unencrypted (or encrypted with company-provided tools) on the system. If they're using keyloggers or other monitoring software, they may even be able to break into things you encrypt yourself.
Bear also in mind that a malicious insider may still choose to do these things even if law or company policy prohibits this. If the company has the tools to monitor your activity, but is generally prevented by law or policy from doing so without cause, a malicious sysadmin may choose to ignore such restrictions and snoop on whatever it is you're doing on the system regardless. In an even more extreme scenario, it's always possible that a malicious sysadmin may do this with their own tools even if the company itself is not equipped to do so.
If it's not your system, don't trust it with your personal data.
Answer: Look at you employment contract and companies computer usage policy if it has one.
I have worked places where world of warcraft was installed on company desktops and people played during the lunch hours/after work as the computer usage policy did not say state that users could not install there own programs on the company devices.
Other places where everything you did, each webpage visited, email message and event log entry was saved, uploaded and analysed either in real time or when the device came back on the network.
As others have said, it's possible to monitor everything, it also highly unlikely outside of secure environment as it's time consuming and expensive. Most likely if your working from home via a company provided device it will have basic security controls and programs such as AV, maybe software asset management and some form of company update mechanism (SCCM, Alteris, etc.) that will communicate back to the home network.  It's also possible that while off the VPN your web traffic might be monitored via Cisco Umbrella or a similar system.
If in any doubt look for the company polices, depending on where you are in the world some local laws may also have precedence so you should also check those.
Answer: It depends on what software they install on the computer.
Many keyloggers can track keystrokes/passwords typed, websites visited, chat conversations and capture desktop screenshots. So all your activities might be tracking by the spy software.
Comment: You are right. Just to add a point, the user is almost under the  monitoring of the company so that the company makes sure that their computer is used only for the official purpose. But again it depends on the company policies.
Answer: The only way tracking could be done is by having a software loaded on the system, there's no way to do it only through a VPN connection.
If the system have been reinstalled with factory settings and all the programs were loaded by you, and they have not installed any tracking programs, they cannot track the usage.
Answer: While being at home. I went to a website and by mistake I downloaded a trojan. I got an email from the security department. Still not sure what is the extent of their monitoring. I guess they spotted it right away because In their email they mentioned: name of the file was OSX.Trojan.Gen and its in the directory of /users/username/downloads/... , timeStamp, my ID and display ID( I guess that's the name of my laptop). The only that wasn't there was my grandma's SSN, which they said they will send it soon if I don't scan the computer and send a screenshot of having the macBook cleaned

The email's attachment:


How lucene phrases works without position and offset index?

Question: Lucene allow you to index terms with position and offsets, but even without it is possible to use phrase search. So how lucene can calculate word order in index without this information?
Answer: Perhaps you are confusing termvectors positions/offsets with the inverted index.
Termvectors are not used for searching.
To exclude proximity information in the actual postings lists: use IndexOptions.DOCS_ONLY or IndexOptions.DOCS_AND_FREQS. If you do this, PhraseQueries won't work.
But if you are willing to accept some inaccuracies, these settings can be useful in combination with word-ngram (shinglefilters), for a fast phrase "approximation"..., and of course they are useful for fields where proximity just isn't applicable: such as numeric fields, unique ID fields, etc.


How does the function of one default gateway on a router communicate with two other routers?

Question: So given a theoretical scenario assuming there are three routers. There is no internet in this case, just a local network for the sake of understanding. One router (A) is connected to the next (B), and that next router is connected to the third router (C). In this case the router (B) would need a gateway for two interfaces. One gateway for router A and one gateway for router C. This way router B can communicate with router A and C. So if you can only set one default gateway on router B, lets say pointing to router C, then how is router B supposed to communicate with router A due to the fact that there is no default gateway for it? Is this a reason to have two routers on the same sub-net, for all intensive proposes?
Answer: A router usually doesn't use just a default gateway. It has multiple interfaces, representing multiple, local routes.
Additionally, it often 'knows' about remote routes. These can be manually set up using static routes or learned from another router through a routing protocol such as OSPF. If the routers in your example would exchange routes in this way, each would learn the remote networks that the others see.
The default gateway on a router is only used for the Internet or, in a larger network, for the next higher level router.
Answer:
how is router B supposed to communicate with router A?

Network 1 has A and B interface 1
Network 2 has B interface 2 and C
Router A will have an interface route to B interface 1
B will have interface routes to A and C
C will have an interface route to B interface 2

B's default route has no part to play in this.
If A is to communicate with anything on network 2, it will need a route for a network which includes network 2 (ie could be network 2, could a default route), passing to B interface 1.
Symmetrically, if C is to communicate with anything on network 1, it needs a route, perhaps a default route, pointed to B interface 2.

Is this a reason to have two routers on the same sub-net, for all
  intensive proposes?

You have two routers on both your networks.
Answer: Make sure route to destination adress is present of layer3 device pointing to next hop exist interfàce ip addresses
If network A ,B c wants to communicate each the ,ensure route entry for  destination network subnet ip address present on specific Layer3 pointing to next hop interfàce..


Clean install of android

Question: I am wondering is there a way to completly delete all data on the phone(including system, kernel...) and reinstalling clean system, something that would be equivalent to formating hard drive and reinstalling system on PC.
Answer: First, for reinstalling you'll need a ROM specifically matching your device (there's no such thing as a "generic installer" for Android, see e.g. Can I install a ROM made for a different device and Why are there not generic phone OS installers?)
Second, for a "clean start", it is possible to "wipe" all mentioned partitions – but usually not with the stock features of Android devices. You will need a custom recovery such as twrp or clockworkmod-recovery, where you can explicitly select which partitions to "wipe" (including /system).
Note: As therealjayvi correctly pointed out, those "wipes" wont really destroy all data (forensic experts will still be able to recover) – but I guess you won't need that anyway: as soon as you install the "fresh Android" (i.e. flash the ROM), most of the data will be overwritten anyway. And if you're really concerned about remaining data blocks being recoverable by experts: encrypt your device before wiping. That's safer than the dd approach (in terms of not accidentally destroying things).
Answer: Yes and no. I'll explain:
TL;DR Simple method at end of post
Using your example...
Formatting a hard drive on a desktop computer (depending on quick or full format) effectively writes 0s to all (or at least enough) memory addresses to where the drive will assume it's been wiped clean. Any data recovery specialist will claim otherwise though, since data can most always be recovered.
If your goal is complete eradication of all data on your phone (though I'd wonder why lol), then you absolutely have to have root permissions, and I'd recommend a full partition map for your device. Then just open up an ADB terminal on the device and issue the following command as root:
WARNING, DO NOT ATTEMPT THIS COMMAND UNLESS YOU KNOW ABSOLUTELY WHAT IT MEANS
dd if=/dev/null of=/dev/block/mmcblk0
This command will assuredly destroy all data on the phone and prevent all but the most technically savvy recovery specialist from being able to find any usable data.
TL;DR
But if all your looking to do is to start fresh with a clean OS and you're not concerned about data recovery then you can simply do a factory reset via settings menu (remove Google account first!), via recovery menu (remove Google account first!), or if you have/are able to have an unlocked bootloader then you can manually flash the stock firmware via fastboot.
Comment: A am not concerned about data recovery, i am concerned about system files. For example you rooted your phone and acidentaly ruined system files or malware embeded it self into the system. In these cases factory reset won't help. And also i readed somewhere that ROM is not complete system but just some part of system and that flashing a rom won't reinstall all system files but just overwrite files it needs to. Am i right about this? If yes, is there a way to reinstall system completly? If not, can you explain this to me? By the way, your answer was very informative.
Comment: System files are just exactly that, files located in the `/system` directory. This is why there is a difference between "system" apps and "user" apps:  difference being that a "system" app (located in `/system/app` & `/system/priv-app`) will persist through a factory reset whereas "user" apps (located in `/data/app`) generally do not. This only applies to what I guess you can call a "standard" factory reset - initiated via Settings. But if you manually flashed the firmware then malware wouldn't persist without root access, and if thats the case you'd have much bigger concerns lol.
Comment: I am assuming that malware has root access, what can you do in that case to make sure it won't persist?
Comment: I would advise you to root your phone, then run as root `adb logcat`, or on the device via terminal emulator `ps -A` and look for anything out of place. Though if you've never done this before the amount of data it returns will be highly confusing. Honestly I think your best option would be to flash an entirely stock firmware with fastboot, this is the most powerful wipe you can give your phone without the potential of irreversibly bricking your phone (which is what could happen if using the `dd` command I gave).
Comment: Luckily this is just theoretical question that was bothering me for long time. And about rooting, i have samsung phone and my android is up to date so no exploits to get root and no flashing because of knox fuse.

Clean install of android


Abusing meta for hats

Question: It seems that, right now, even as I'm writing this, somebody is abusing Meta for hats. My own feeling is that this should split the community in two, with half thinking it's just fine and half vehemently against this kind of silliness and monkeying around. People who answer should probably be treated in the same way. *cough*
Comment: I'm voting to close this question because it has outlived its purpose of drawing people to vote on meta.
Comment: Surely five of you think this is abusive enough to downvote? Sheesh. :-)
Comment: DR youve got my downvote. its a pity that humor/ frivolity only comes briefly once a year to SE and then quickly vanishes just like santa claus.
Comment: @vzn Thank you. Much appreciated. :-)
Comment: Thanks to the seven people who indulged me by voting.
Answer: Meta is serious business and abuse shall not be tolerated.
Are you seriously hoping that 10 different people will vote on a meta post? I wish that would happen more often!
P.S. Pro-skub!
Comment: Yeah, it seems rather optimistic, doesn't it? Especially now that you've made the anti-skub crowd feel unwelcome.

Abusing meta for hats


Magento new product widget overlap image and title

Question:
I use the new product widget in mangento 1.9.
but the title is overlap on image.
I don't know why.
Comment: Sounds like a CSS issue. Does it happen when you switch to `default/default` native theme and disable custom extensions ?
Answer: I was not able to fully recreate the issue you are having. From what you are showing in the picture, I can see two things for sure. You are using the default package and the modern theme for your site. You also have some custom styles in there that are changing around the layout and sizing of the products in small ways outside of the default styling. When I tried to replicate this, i got this result:

To get this, I just positioned the images of the product absolutely, as seen here:

So my guess is that you have some rouge styles on the page that is causing this overlap. Look at the image I posted and find the elements on the page that are not working right, and get back to us with that info. From there we can figure the right solution.


Probability of consecutive dice rolls

Question: This is probably quite a simple question but here I go..
Suppose you are going to roll a six-sided (fair) die N times, what is the probability that you will get at least one set of three consecutive numbers in a row?
Hopefully that's clear enough but as an example, in nine rolls you may get:
1, 4, 2, 6, 4, 4, 4, 4, 3
With the 4s making two sets of consecutive rolls.
Thanks!
Answer: Let $T$ denote the first time when this happens and, for every $|s|\leqslant1$ and $k$ in $\{0,1,2\}$, $u_k(s)=E_k[s^T]$ where $k$ is the number of identical results just produced. One is asking for $P_0[T\leqslant N]$. A one-step Markov conditioning yields the usual linear system $u_0=su_1$, $u_1=s\left(\frac16u_2+\frac56u_1\right)$ and $u_2=s\left(\frac16+\frac56u_1\right)$.
Solving this yields $u_0(s)=\frac{s^3}{36-30s-5s^2}$. There exists two positive real numbers $a$ and $b$ such that $36-30s-5s^2=36(1-as)(1+bs)$, thus $u_0(s)=\frac1{36}\frac1{a+b}s^3\left(\frac{a}{1-as}+\frac{b}{1+bs}\right)$ and, for every $n\geqslant1$, $P_0[T=n+2]=\frac1{36}\frac1{a+b}(a^{n}-(-1)^nb^{n})$. The value of $P_0[T\leqslant N]$ follows.
Numerically, $a=\frac1{12}(5+3\sqrt5)=0.97568$, $b=\frac1{12}(-5+3\sqrt5)=0.14235$, for every $n\geqslant1$, $P_0[T=n+2]=\frac1{18\sqrt{5}}(a^{n}-(-1)^nb^{n})$, and, when $n\to\infty$,
$$
P_0[T=n]\sim\frac{7-3\sqrt5}{5\sqrt5}a^n,\qquad P_0[T\geqslant n]\sim\frac{12}{5\sqrt5}a^n.
$$
Comment: You guys are just wonderful. Thank you.
Answer: The number of $N$-tuples over $\{1,2,3,4,5,6\}$ with no runs of 3 or more consecutive values the same is $$6\sum_{j}  5^{N-j-1}{N-j\choose j}.\tag1$$
The probability of no such "triple" runs is $(1)$ divided by $6^N,$
and subtracting this from $1$ gives you what you want.
Comment: This sums over the number $j$ of pairs of identical values, whose position can be chosen in $\binom{N-j}j$ ways in the $N-j$ runs ($j$ pairs and $N-2j$ singletons); the first run can have $6$ different values and each subsequent run $5$.

Probability of consecutive dice rolls