Enable a flag automatically for specific users using Rules

Question:
I have a content type called testimonials, and in that I have a user reference field with multiple selection option.
I have a flag called 'Request to review' enabled on nodes of 'testimonials' content type.
I wrote a rule for sending mail to the author of the node if any user clicked on that flag.

What I need to do here is, I want to enable that flag automatically when a new node is saved only for the users who are selected in the form field user reference. And for remaining users the flag should not be enabled automatically i.e., they have to enable it manually by clicking the flag link.
Thanks
Answer: I achieved it by writing a new rule, in that i wrote a loop for getting all the selected users.
thanks


What does rolling mean in describing blackout?

Question: I watch news video and notice they use "rolling" to describe a blackout at current snow disaster. I googled, it has many meanings. I am not sure which one fits. Common usage of rolling is rotating, but it doesn't fit. Does it mean repeated? Or endless in a metaphoric way?
Comment: The way I imagine it is like the motion of a rolling wave which moves across a city or region.  Some areas that are in/on/under the wave are going to lose power, and as the wave moves on, the power will come back while others in the path of the wave will lose power.
Comment: What @Rayner said. Note that one of the definitions of [***roller***](https://www.lexico.com/definition/roller) is *A long swelling wave that appears to roll steadily towards the shore.* The implications of ***rolling blackouts*** is that they're ***cyclical*** and they move from place to place - so any given location will sometimes be experiencing blackouts, but there will be other times when they ***do*** have power. That's to say, the "lack of power" will be shared equally between all areas on a "time-slicing" basis.
Comment: The [definition of rolling](https://www.thefreedictionary.com/rolling) that applies is : *2. progressing or spreading by stages or by occurrences in different places in succession, with continued or increasing effectiveness: three weeks of rolling strikes disrupted schools.*
Answer: A rolling blackout is one that starts in one area, and then over time it moves to a different (nearby) area, and then continues moving over time.
The most common reason for a blackout to be "rolling" is that it was intentional - they simply ran out of electricity and had to intentionally cut off the power. They distribute the shortage across different areas so that no one area suffers more than others.
However, blackouts caused by storms could also be described as rolling, partly because storms themselves travel from area to area, and partly because there are not enough repair crews available, which means that some areas get fixed while others have to wait.
Answer: If you put up a drone to film the area you would see the blacked-out area apparently rolling across the area. I imagine it in fact jumps from one area to the next rather than rolling smoothly but the usual term is rolling.


SQL Server - VSS

Question: There is a great tool from RedGate called SQL Server Source Control. I liked it very much as it has seemless integration with the Source Control.
However, the pricing modal of this RedGate tool does not suit my purpose because it goes based on number of developers. I was looking for a one time buy without worrying about # of number of developers.
CodePlex, CodeProject are not of any help to find me such free product. Can anyone of you help me to find this kind of tool?
Again the purpose is seemless/tight integration with source control.
I am sure there is someout out there who will help LOL
Answer: You could try this:
http://www.codeproject.com/KB/architecture/Database_CI.aspx

SQL Server - VSS


Spotting Cause of Excessive Battery Drain

Question: I have a Nexus 6 phone and it has always been amazing with battery power, I can usually go 2-3 days before absolutely needing to charge it and that's with heavy news reading, game playing, phone calls, texting, using the camera, and updating apps. It does all this while having this configuration:

It IS rooted, wouldn't have it any other way.
It has a STOCK Google provided image from Google Developers (currently running LYZ28M)
It is connected to an AC 5.0 ghz Wireless channel.
Bluetooth is OFF by default, use very infrequently to connect to a headphone to listen to things for about 10-30 mins.
All animations are disabled in developer mode.
By default the auto-rotate is disabled.
Location is set to power-save mode (wifi only).
Display lighting is set to auto with ambient enabled.
Camera is to HDR+ (no flash).
Most background services are disabled (except Play Services, UI, etc which are required).
SMS auto-retrieve is off (even though I don't have the original Stagefright issue anymore, can't speak to the Stagefright 2.0)
Power history puts the distributions as follow (no shockers there):

Cell Standby (46%)
Screen (23%)
Android OS (11%)
WiFi (5%)
Google Play Services (4%)
Android System (3%)
Phone Idle (3%)
Voice Calls (1%)

Now that all being said, the set of apps installed on it have always been the same between each re-image that I have done since 5.0 to 5.1.1 now.
However, starting about 1-2 weeks after the latest update, it is draining BADLY, when I said badly I mean within a max of 6 hours (minimum usage) to less than 2 hours (heavy/normal usage) it will drain. To add to the mystery, I have Battery Saver Mode enabled to kick in at 15%, when that happens, if I click on turn off battery saver, it will IMMEDIATELY begin shutting down, which makes NO SENSE, I have turned it off in the past with no issues.
Does anyone have any idea what's going? or can suggest a tool that allows me to snoop with a greater degree of granular control to see what is causing it to actually drain so badly? I have read all the other similar "battery drain" questions and none of them seem to really apply to me (at least I don't think) but resulted in why I included so much detail about the device, so it will save the trouble of having to ask about details of the system.
Much appreciated, thank you in advance.
Comment: You want granular control, try [BetterBatteryStats](https://play.google.com/store/apps/details?id=com.asksven.betterbatterystats&hl=en). Let it run and monitor the device. Come back after sometime and you would know what's going on. It requires Xposed Framework.
Comment: @Firelord thank you very much, I will look into that right away. I have played with coding on the Xposed framework, in fact there was a patch for the radio bug that floated for it, so I will look into it, thank you. Gotta love XDA ;)
Answer: GSam Battery Monitor is an excellent program that will give you an extremely detailed report of what is using your battery and to what extent.
However, what I believe this may be is the Mobile Radio Active bug. It is one of the most starred Android bugs in existence. Essentially, when apps that use data are turned on (such as Facebook or Skype), the Android system forgets to turn off the radio until the app that asked for the radio in the first place is force stopped. Google has acclaimed that the issue is fixed in Android M, but I do not believe they have plans to fix it for Lollipop. (I am looking for a source of proof and will edit this when I find it)
In the meantime, Greenify will automate the process of force stopping apps when you don't need them, however, you may stop receiving notifications from these apps.
Comment: Thank you for the recommendation. Aha, I knew about the bug but hadn't considered it because it was supposed to have been fixed in the image BEFORE this one that I have active (part of the WiFi calling protocols specifically for T-Mobile), perhaps it got reintroduced somehow or still playing a role, I'll look into that. Thankfully I don't use Facebook or Skype (by choice) and the ones that I have running mostly if not all have a WiFi over Data priority but will do some snooping to be sure. My "data" usage is so minuscule its obscene. Thank you for your recommendations, appreciate it +1


Issues with backslash operator in matlab

Question: I have this huge matrix A of dimension 900000x900000. And I have to solve this linear equation
Ax=b where b is a column matrix of size 900000x1.
I used matlab's backslash operator like A\b to try to get x. However, it freezes and I couldn't get x. Mostly I get out of memory issue. Even though I ran it in a computer with higher memory it makes the system very slow and I have to wait to get the answer.
How can I solve this equation. My matrix is pretty sparse. However, it's band is wider but most of the elements are zero. b is a full matrix. Any suggestions?
Comment: Full storage of a 900000x900000 real double precision matrix requires about 6 TiB of memory, so I assume you are already using sparse storage. Can you provide the output of `whos A` ? Maybe this question is better asked on http://scicomp.stackexchange.com providing more detail on matrix `A` (symmetric? hermitian? positive definite?) along with a brief description of the application area.
Comment: Have you tried these approaches: http://www.mathworks.com/help/techdoc/matlab_prog/brh72ex-49.html If you are running 32 bit Matlab on 32 bit Windows then the 3 GB ini switch could help?
Comment: It never matters how much capability you give someone, there will always be someone wanting to do something beyond that capability, while having absolutely no idea of what they are doing, or why what they are trying is insane.
Answer: I did a project, where we also operated with such large but fortunately very sparse matrices.
Using such large matrices, you are pretty lost with direct methods: You can never compute the inverse because it will be a dense matrix, which you can never store. Also methods such as LU or Cholesky factorization are quite expensive because they again create a significant fill-in, i.e. they destroy zeros.
A viable alternative is to use iterative methods. If you know that your matrix is symmetric and positive-definite, try the Conjugate gradient method:
x = pcg(A, b);  %# Computes a solution to Ax = b, with A symm. pos-def.

I would just give it a try and have a look, if the method converges. Proofing the assumption of positive-definiteness is not easy, I'm afraid.
If you do not get a solution, there are many more iterative methods. For example:
bicg     - BiConjugate Gradient Method
bicgstab - BiConjugate Gradient Method (stabilized)
lsqr     - Least Squares QR Method
gmres    - Generalized Minimum Residual Method (I like this a lot)


When to do calculations

Question: Which way is better to store sales information in a database:

Store cost for an item and sales price per item
Store cost * qty and sales price * qty - so you are storing the totals in the db
Comment: "Better"?  What does "Better" mean in this context?  There are specific tradeoffs.  What's most important to you?
Answer: Store all single details for each item, as you will usually need them later (for statistical/information purposes or any other reasons). You have to make sure that you always follow the same calculation logic to get the total sales price. So you maybe have to store currencies, discount, price unit, etc. along with these. Here some more points to consider:

If you want to output the single item price later, you need the single item data.
Don't save total price along with single item data, as you will have to always hold both in sync. You'll get puzzled some month/years later, about which of both to use for your calculations.
Aggregate your data if you are using it in a data warehouse and don't need the details.
Answer: This is the 3rd Normal Form problem.
Option 1 is in 3rd Normal Form.  There is no derived data.  Calculation must be done for every query.  Because of this, updates can be done on any field without breaking anything.
Option 2 breaks 3rd Normal Form.  It saves derived data.  Calculations are not done at query time, making them much faster.  However, an update that doesn't also redo the calculation will lead to inconsistent data.  This is called an "update anomaly".  An update cause the derived data field to be inconsistent.
Further -- depending on the calculation -- it may be impossible to reason out what fields should change when the derived data needs to be changed.
Comment: Oh but if you designed it correctly an update will fix the the aggregated data. In fact you shouldn't do this unless you make sure it updates.
Comment: @HLGEM: "designed it correctly"?  What doe that mean?  With a trigger or something?
Comment: Depends on what you are doing, it might mean with a trigger or it might mean with a caluated field
Answer: It depends on what you are going to do with the data.
For a great many purposes, it's worthwhile to store, under each item, the unit price of that item, the quantity purchased, and the extended price.  The extended price is quantity times unit price.  Is this redundant?  well, yes. Does it violate some normal form?  Well, yes.  But it works quite well.
Why store the price in the item row  (record) and not just rely on the same price data stored in the master product table?  Because if you change the price after this sale, you don't want to change the price that this customer incurred on this purchase.  Why store the extended price, since this can be recomputed on the fly?  Because it makes it one step simpler to aggregate  (sum or average) over some set of items later.
If you store the extended price, you can use those point and click, drill down analysis tools  (see OLAP) for later analysis, with no further programming. If you count on recomputing the extended price when you need it, you may find that the drill down tool isn't smart enough to do the multiplying for you.
"items" will normally be children of some larger unit of work.  In an invoicing system, an item is part of an invoice.  In a general ledger system, an item is part of a transaction.  The items aren't balanced, but the transaction is.  In a lot of commerce systems these days,  the invoicing function and the accounting function are driven off of the same database, but that goes beyond your question.
Normally, I try to keep my data normalized.  This is one place where many experts intentionally deviate from the requirements of pure normalization.
Answer: I would say you always store cost and price as seperate columns AND store the total.  There will be a time when you need those broken out (reporting, invoicing) that you will regret.
The question will really become should you store the calculated values as well.  that will really depend on the circumstances of the application (how many rows, how many transactions, etc.).  If its a small - medium application, it probably will not matter for performance so it's just a matter of other factors.
If the formula for the total may become more complicated (ex. taxes, discounts, etc..), you may want to store the total.  otherwise, having to replicate that logic in other areas may prove to be extremely difficult.
I personally always store the total amount as well.  I just find the cost of the extra database column is always outweighed by having that total in other places.
Comment: In continuition of your idea, @Cody C, not to mention that stored calculated values might improve performance upon loading and/or reporting when the time comes. As a matter of fact, it is easier to do reporting with stored calculated fields. It always depends on what kind of calculations you need to be performed.
Comment: One might also wish to have those calculated fields accessible through some read-only properties where only the getter is required, as the software should put values into them, since they are calculated. These setters would be used only by the persistance layer.
Answer: I'd go with storing the cost for an item and the sales price per item. If you're only storing the totals, you'll have a hard time recalculating your values if the prices change. Imagine giving a seasonal discount on some of your items, applying different taxes to some items (maybe even different ones depending on the customer's country of origin) or granting lower prices for registered customers - you'll have to calculate those prices based on the sales price of an item, the totals are of no use in this case.
And if you really need the totals, you can easily calculate them any time using simple DB-queries, taking into account all discounts, etc. etc.
Answer: IMHO store cost and sales per item. If you want the results to come like totals, either perform them inside the Query or create a temporally table or a stored procedure with the calculations. However, I usually perform those calculations in the code (PHP or JAVA in my case).
If it is only for report purposes, sometimes is fine to store the totals as speed-up the calculations (and prevents some miss-calculations in your code).
Answer: I would only store the totals if I have a serious reporting problem where many queries require the total value of a large set of records (if you are only getting the total for a small set, calcuating it onthe fly when requested is OK).
If you store the totals, you need triggers to ensure that updates, deletes and inserts all correctly update the totals. Otherwise the data will be out of synch and useless.

When to do calculations


Looking for a word that implies another person's presumed experience

Question: When there is a decision that needs to be made between you and another person. It would be good if it has connotations of a presumed expertise. For example, if you and another person were looking for an answer to a complex problem, either party could make the decision but you believe their decision would be best. Something like "I defer to you for this decision", or "I concede the decision to you". Neither of the words are what I believe I'm looking for.
Comment: The specific context for which I need the word is exactly what I described in the question's two examples. Defer and concede don't work because they don't convey any purpose for deferring or conceding the decision. @JohnFeltz 's comment seems to fit nicely. Rather than simply deferring to someone else, I am also offering a reason why. I had hoped to find a single word for this, but "I defer to your expertise on the matter" will certainly suffice.
Comment: Can you give a context relevant sentence with a blank for the word you want? Also why don't defer or concede work?
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/80828/discussion-on-question-by-jack-looking-for-a-word-that-implies-another-persons).
Answer: You can use "entrust"
"I entrust this decision to you."
Both meaning you trust the other person to make the decision* (see note below), and also are placing the responsibility for making the decision in the hands of that person.

To give over (something) to another for care, protection, or performance American Heritage Dictionary

*Actually I may have been wrong about the first point. The proposition that you trust the other person is implied, not necessary, when entrusting a task to another.
This is clarified by this usage note in Collins English Dictionary:

Usage: It is usually considered incorrect to talk about entrusting
  someone to do something: the army cannot be trusted (not entrusted) to
  carry out orders Collins English Dictionary


Can the crank be removed from a 1999 beetle without engine removal

Question: Spun the rod bearing. I dropped the oil pan and found the affected rod. I disconnected the rod. If I can remove it and have the journal turned or replace it, it would be more work but less money than to replace the engine. I don't have access to a lift. I was thinking of disassembling the engine in the car to get to the block. Any ideas?
Answer: You could possibly get it out, but putting it back in would be nearly impossible. To do it correctly, you should put new bearings throughout (rods & mains). Putting new main bearings in requires checking clearances. You would not be able to do this by having the crank hang on the bearing caps.
Since you spun a bearing, the engine block should be thoroughly cleaned as well. When the bearing spun, metal from the journal side and from the rod side was strewn all over the engine.
I'm still not sure how you would disconnect the crank from the flywheel (or flex plate if an auto).
One other thing to think about is if you are unsure what caused the spun bearing in the first place, it could easily happen again. If it was over revving the engine, which caused a rod bolt to stretch, thus causing the spun bearing, that's one thing. If it was a lack of lubrication, that's another.
While I have never tried this myself, this seems like about a 1:1,000,000 shot to make it happen and have the fix work for any length of time.


Ftting a mixture of two Gaussians

Question: I want to fit a mixture of two gaussian densities to my financial data. The data can be found here: http://uploadeasy.net/upload/2a7mw.rar the variable is called dat.
The probability density of a mixture is given by:
\begin{align}
f(l)=\pi \phi(l;\mu_1,\sigma^2_1)+(1-\pi)\phi(l;\mu_2,\sigma^2_2)
\end{align}
The quantile can be computed by using a numerical algorithm to solve the following:
\begin{align}
\alpha=P(L \leq VaR_\alpha) = \pi F_1(Quantile_\alpha;\mu_1,\sigma^2_1)+(1-\pi) F_2(Quantile_\alpha;\mu_2,\sigma^2_2)
\end{align}
I use mixtools in R:
install.packages("mixtools")
library(mixtools)
mixture<-normalmixEM(dat,k=2,fast=TRUE)

This uses the EM algorithm.
I now want to calculate the 0,95 quantile of the mixture distribution. I do a loop, a kind of a grid search, I assume, that the quantile (due to the characteristics of my data) will be below 0.3. So the loop ends at 0.3
pi<-mixture$lambda[1]
mu1<-mixture$mu[1]
mu2<-mixture$mu[2]
sigma1<-mixture$sigma[1]
sigma2<-mixture$sigma[2]

quantile<-0
probabilitylevel<-0.95
dummy1<-0

# the loop lasts for about 20-40 seconds
for (i in 1:100000){
quantile[i]<-i/(1000000/3)
}
dummy1<- probabilitylevel - ( pi * pnorm(quantile,mean=mu1,sd=sigma1) + (1-pi) * pnorm(quantile,mean=mu2,sd=sigma2))

min(abs(dummy1))
which.min(abs(dummy1))
quantileresult<-which.min(abs(dummy1))/(1000000/3)

the result
quantileresult

is 0.025371
which seems to be correct, if control it with:
pi * pnorm(quantileresult,mean=mu1,sd=sigma1) + (1-pi) * pnorm(quantileresult,mean=mu2,sd=sigma2)

I look at the plot:
plot(density(dat),col="red")
curve(expr=pi*dnorm(x,mu1,sigma1)+(1-pi)*dnorm(x,mu2,sigma2),lwd=2,col="black",add=TRUE)
curve(dnorm(x,mean(dat),sd(dat)),add=TRUE,lty=3,col="orange",lwd=2)

which gives

It looks like, that the mixture normal (black) is fitting the data way better. The dashed orange line is the univariate normal distribution fitted to the data set. It is fitting the data not as good as the mixture density, is this correct interpreted?
Finally, we look at the single densities and compare it to the mixture:
plot(density(dat),col="red")
curve(dnorm(x,mu1,sigma1),add=TRUE,lty=2,col="darkgreen")
curve(dnorm(x,mu2,sigma2),add=TRUE,lty=2,col="blue")
curve(expr=pi*dnorm(x,mu1,sigma1)+(1-pi)*dnorm(x,mu2,sigma2),lwd=2,col="black",add=TRUE)

which gives the following plot:

The first density has a higher peak, the second density is shifted to the left and has a lower peak, higher variance.
Are my calculations and interpretations correct?
Comment: The interpretations look okay to me.
Comment: You could speed up the calculation of the quantile by about a thousand fold by using a root-finding routine.
Comment: "* the second density is shifted to the left*"... I'm pretty sure that being shifted that way $\rightarrow$ is 'to the right'
Comment: @Glen_b yes, you are right. Any other comments are welcome, also: Is this correct what I am doing? Can I do this? I think yes?
Answer: Just so this thread gets an answer (since we can't access your data any more, I don't think much more answering will be happening): what you are doing seems to be perfectly fine.
You could change your search for a quantile of a mixture to use KScorrect::qmixnorm(), as per Compute quantile function from a mixture of Normal distribution.

Ftting a mixture of two Gaussians


If the current moves from negative to positive, are we placing the diode the wrong way?

Question: I recently discoverd that the current moves from the negative to postivie, but if I placed a diode from postivive to negative it will work, but if I placed it the wrong way (from negative to positive, like how the current moves) it won't work.
Comment: Please read the answers from the [previous question](http://electronics.stackexchange.com/questions/31825/) asking about the same thing.
Comment: Because of convention, early they were looking ions in electrolyte and they thought that's all about electrical current, but now we mostly use electron current which indeed flows from negative to positive, but never mind all the labels indicate current flow from positive to negative by convention.
Comment: Another related question: [Does electricity go from negative to positive or vice versa?](http://electronics.stackexchange.com/questions/26072/)
Answer: All of the symbols and all of the math in electrical engineering are based on conventional current. You're talking about 'electron current' and truthfully you can completely ignore it unless you get into device physics.
It got set that way before the discovery of the electron, but because the math works out, it doesn't really matter.
Answer: Charge flows from positive to negative.  When the charge-carrying particles have negative charge (such as electrons) then the particles are moving in the opposite direction from the current, hence your confusion.  If the charge-carrying particles were positive, then they would flow in the same direction as the current.  The marking on your diode is correct.


Chocolate molds in shapes of kitchen supplies

Question: I am going to be making a gag gift for some friends. I want to make chocolates in the shape of pots, pans, and cooking utensils as they are in the process of closing on a new house. I have no issues finding spoon, fork, or knife molds. Where I am having issues is the pots, pans, turners (like for flipping burgers) and spatulas. Does anyone know where I can find something like I am looking for? I know they will be smaller than the cutlery, and that is fine.
Comment: You may actually want to migrate this question to Arts & Crafts! While your end goal is to make a food item, the equipment (a specific mold shape) may not be on-topic for Seasoned Advice (as we rarely mold our own equipment) ... especially if you'll need to end up making or modifying a candy mold to get the shapes you want. Just a thought :)
Comment: I tried asking there earlier today but the question was closed as they only help with questions about issues during the actual process of making things.
Answer: You can try placing your post, pans, turners and spatulas upside-down on some parchment paper, and spraying with non-stick cooking spray. Then, carefully pipe not too runny (and not too dense) melted chocolate over them, making sure to keep the part closer to the bottom of the pan thicker than the parts closer to the edges, as the chocolate will slide down to the edges eventually.
That will be all if the handles are conveniently flat and metal, otherwise you'll need mold the handles separately and attach them to the main part when both parts are cooled.
Comment: That only works if you want full size items, which would end up having to be thick to be strong enough. As the OP wants a selection of items, that ends up being a huge amount of chocolate
Comment: Use toy items. (I have just seen the pans we used to play with as kids.)
Comment: @ChrisH Just trying to lift up the giftee's day :)


electromagnet over heating

Question: I am building a PEMF style device using a number of electromagnet coils. They are  ZYE1-P20/15 12v 0.25A units from china capable of lifting 2.5kg. I took a chance on the strengh but that is not the issue. I am controlling 1 at the moment using an 8 channel relay board and raspberry pi. The boards relays can take 30v 10A dc so I assumed there would be no problem. I am using the relay as a switch with a 12v 200mA transformer to switch the coils on and off. It is just the supply, coil and relay in series. I set a program to switch it on for 5 seconds and off for 1 second, I couldn't find a duty cycle so don't know if this is inappropriate but the coils were sold as being able to be used in machines for packing and they are switch on and off frequently. The problem I have is after about 5 minutes the coil was very hot and the raspberry pi was being affected. Is this feedback and will a 1N5349B diode in the circuit stop it getting hot?
Comment: Show your circuit. This isn't a telepathy site.
Comment: that sounds like "backlash" and if that is the case yes a freewheeling diode will help.
Comment: no. that doesn't explain the overheatng.  the electromagnet has internal resistance, the most heat will be generated with a constant supply. any reduction in supply duation or power will reduce the power input and necessarily reduce heating.
Comment: "12v 200mA transformer" - the transformer is only rated at 200mA but the electromagnet draws 250mA??? Does the transformer put out AC or DC? Show us a photo of your setup.
Answer: First, you haven't actually told us what your problem is. You say that the Raspberry is being affected. Why? Do you have both in closed box and the Raspberry is getting hot? Well, there's an old joke about a guy who goes to a doctor and says, "Doctor, it hurts when I do this". The doctor responds, "Well, don't do it." If the coil heating the Raspberry isn't your problem, what is? What, exactly, does "being affected" mean? If the coil is heating the Raspberry, move the coil or move the Raspberry.
That said, you actually know the answer, but you're not willing to face it.
"I couldn't find a duty cycle so don't know if this is inappropriate but the coils were sold as being able to be used in machines for packing and they are switch on and off frequently."
So you got a unit off the internet and you don't know if it will do the job. So instead of figuring out whether or not the duty cycle is giving you problems, you have fixed on a flyback diode as your savior. This simply isn't going to work.
So what you need to do is this:
1) Get yourself a tin can. Place it on a flat, fireproof surface - a cinderblock will do nicely.
2) Take one of your coils and put it in the can.
3) Hook up 12 volts to the solenoid.
4) Let it run overnight.
5) If it hasn't caught fire, find the coil temperature. You can touch it with a thermometer, or pour enough water in the can to cover the coil and let it run for another hour, then measure water temperature. As a very rough indicator, 60 C is the "Ouch!" point, where most folk can't hold a hot object.
6) Check to see that the coil is still working.
If the coil has not caught fire and is still working properly, you know how hot it gets and that it can survive this temperature and still work, so you don't need to do anything.
A flyback diode is always a good idea to limit switching transients and extend the lifetime of your relay contacts, but it will do nothing to solve your temperature problem.
Comment: 12V at 0.25A says the coil will dissipate 3W.  On such a small magnet, it *will* get hot.  Presumably the manufacturer has allowed for that in the materials used.  A 5 on/1 off duty cycle will only reduce that to 2.5W.
Answer: (1) You have "12v 0.25A" adapter. You are using "12v 200mA" transformer.
Your transformer is not rated even for a single relay. Most likely it overheats as well.
(2) Is this feedback and will a 1N5349B diode in the circuit stop it getting hot.
You have a relay board, right? Then it is not feedback. Diode is needed to protect raspberry pi side of things, and looks like your problem is on relay side.
(2) the raspberry pi was being affected.
This is strange -- relays should be good at isolating parts from each other. Is raspberry pi close to your coil? Could it be pi overheating?

electromagnet over heating


Why are VHF radios so much cheaper than HF ones?

Question: Why do VHF-UHF radios tend to be cheaper than HF ones? There are expensive VHF radios and relatively cheap HF ones, but finding a cheap VHF radio is much easier than finding a cheap HF radio. Why? Aren't HF radios simpler?
Answer: I think the premise of the question is actually incorrect.
The things that make a radio expensive are receive sensitivity, output power, frequency agility, and modulation/demodulation circuit complexity.  VHF and higher frequency generation use to be a big cost in the radio, but there are now integrated circuits that can do this cheaply, and the cost of an off the shelf VHF vfo is now lower than a hand built HF vfo.
HF radios can be found or built for under \$150 easily.
The catch is that they are simple, single band, low power, and have low sensitivity, just like the cheap VHF radios of the same price range.  The super cheap VHF ham radios (under $50) cut a lot of corners and have dramatically lower sensitivity as well as corresponding spectrum impurities and splattering.
Additionally, expensive VHF radios exist that are multi-band, multi-mode, higher power, and have higher sensitivity designed for use in weak signal receiption.
And just to add a bit of economics to this, cheap HF radios are not in high demand, and so typically end up as kits.  Cheap VHF radios are mass produced with a high level of industrial design and surface mount components, which dramatically decreases per unit production cost.
Also, to some extent, frequency agility and mod/demod can now be done cheaply in SDR, so this is now less of an issue than it use to be.  Sensitivity can also be increased with SDR, but this is not yet cheap.  (It's cheaper than doing it with analog components, but still more expensive than leaving it out.)
So, to summarize, expensive HF and VHF radios with feature parity will have a similar price.  Cheap VHF radios might beat cheap HF radios purely due to mass production economy of scale.  The final irony in this is that some modern cheap HF designs upconvert the signal to take advantage of cheap mass produced VHF components.
As an extreme example of this, you can get a complete broadcast AM/FM receiver in a single chip for under $2.  Catch is, it is receive only, and it doesn't need any sensitivity because it is receiving a 20KW+ broadcast station 50 miles away instead of a 100W HF ham station 1000 miles away.  (And broadcast AM is between ham HF bands and ham LF bands anyway, so HF/VHF not a factor in this.)
Comment: I'd argue price if a function of supply and demand, and the production (and design, and distribution) cost of a device just sets a lower bound on the price someone will offer a device at, but for the HF radios that OP wonders about, we're quite a bit away from that lower bound.
Comment: Totally agree with you, except that the same holds true for high end VHF/UHF radios as it does for HF radios.
Comment: Actually, high end UHF/VHF radios frequently _are_ HF radios too, so it's hard to separate those.
Comment: Which is why the high end radios also are expensive
Answer:
Why do VHF-UHF radios tend to be cheaper than HF ones?

That's an economic question, not a radio technology one. How many radios of either type are sold per year? For which of the two types will hence cheap mass-produced devices exist?
Who is more likely to spend more than a device is worth: Someone who needs a handheld radio, or someone with space for a HF antenna system?

Aren't HF radios simpler?

No. (Why should they?)
Comment: Re. why should HF radios be simpler — "simpler" isn't the word I would use but I have sort of wondered similar. Often in DIY ham circuit writeups I'll see things like "audio construction is good enough for such-and-such", and HF strikes me as somewhat the same way, not nearly so "picky". But perhaps with HF the circuit impedances/parasitics/etc. that aren't nearly so critical are easy to get right up through VHF/UHF *anyway* in commercial circuit design and manufacturing, whereas the components (esp. inductors?) have to be **bigger** and harder to produce?
Comment: @natevw-AF7TB ah! So, hm, multiple aspects in here that one might want to consider in separate questions: DIY ham circuits are pretty far from what you'd go with when you design an industrially produced radio – for many reasons! Then: The things that are "hard" in DIY circuits are the things that take many components or very well-matched components, or such. In the age of electronics integration (so, 1960 to now), that's not a problematic circuit. The things that are "hard" for integrated circuits are often quite different (filters for low, for example, are harder than for higher frequencies)
Comment: There's a solid chance that someone building a lower-cost, but still nicely selective HF receiver in 2022 would got and mix basically the whole HF band up to a higher frequency, to benefit from available filters. After you have a band-limited IF signal, it doesn't matter which band your signal originated from. The question is whether the application "HF reception" would then not call for a higher dynamic range, which would require a nice LNA *before* the mixer, which is problematic at frequencies that are so low. If you can live, noise-wise, with amplification after the mixer, things become
Comment: cheaper. Either way, you'd need to look at what the requirements in terms of dynamic range and noise figure are, and that decides how much effort you need to put into your circuitry. For sub-microwave frequencies, and for the diminutive bandwidths that you find in analog modes on HF, VHF and UHF, the frequency and bandwidth aren't cost factors. The cheapest ADCs you could buy for the IF would do sufficient sample rate. The question is whether your amplifier chain and the ADC bitdepth suffice (hint: bitdepth usually suffices).
Answer: Most VHF radios are relatively low power. They need to reach the closest repeater or just a few miles to another radio in simplex. They are not used or long distance. They typically are only VHF or VHF/UHF. Most are restricted to FM modulation. Also many VHF HAM radios are variations of commercial VHF radio which are produced in relatively large quantities.
HF radio tend to be higher power, cover many different bands, have several different types of modulation (FM, SSB, AM, CW, and so on). They are also produced in far smaller quantities as they are only used by HAMs.
Answer: HF is rarely if ever used for commercial 2-way communications. Cheap radios such as the Baofeng/Wouxun UV-5r evolved from cheap commercial radios for the public safety and commercial bands. 10-meter radios also run relatively cheap for a similar reason: The CB bands just a few hundred kHz away. FM is also cheap to generate and cheap to receive, and Walkie-Talkies and base station radios in other services such as FRS/GMRS and Marine VHF also use it. Plus: The IC-9700 and the 905 and other high-end VHF+ rigs are as expensive or more than their corresponding HF rigs (IE 7300 and 705)


Can he see the websites I visited?

Question: I live with someone in the same house so we both use the same wifi. He knows the wep password because he set it up in the first place. He's not a hacker but he can set the wifi system at home. He has some computer knowledge from college.
Can he actually see the websites I visited? The URLs? What else can he see?
You mean he can actually see these things without having to hack? So this kind of information is not only available to hackers?
Answer:
He knows the wep password because he set it up in the first place.

Firstly, WEP? If you are using WEP, anyone who knows how to download some tools and owns a laptop will be able to  see your network traffic. WEP is terrible.

Can he actually see the websites I visited? The URLs? What else can he see?

Basically, if the guy is on the same network as you, he can see everything you do. If the websites you are visiting is being served through HTTPS, he will not be able to see the exact data you are sending but he will still be able to tell where and when you visit the site.
Comment: @Lavin So change the password...
Comment: I don't understand. How does he see what websites I've been visiting on his own computer?
Comment: If he does MITM, this is hacking, right? Can anybody do this, not just hackers? What if he's not a hacker and has no  malicious intent? It's more like I'm just paranoid.
Comment: He does have to set up something in order to know which websites I visited, right? Knowing the password alone is not enough, right? Is this something tedious to set-up for a non-hacker?
Comment: He doesn't live here anymore.
Comment: He will be able to do that with MITM attack which is acting like the gateway for you so any traffic meant for internet will go through him.
Comment: @Lavin Frankly, if he can connect to the network, it's a trivial thing that a 10yo with access to Google can pull off.
Comment: If he can no longer connect to the network but he has the wifi password, will he still be able to see which websites I visited?
Comment: @Lavin He has the wifi password... so why is he unable to connect to the network...?
Answer: Terry has already answered your question, but I'd like to provide more information.
The type of WiFi security is only a side issue. The main issue is that you are using a network that he controls. Presumably he controls the router, switches, and access points.
Therefore, even if the WiFi network used WPA2, your network traffic would still be vulnerable to intercept at the network level. One way of doing it would be to configure a transparent proxy with verbose logging enabled. Another way is to configure a span port on the router.
In summary, if you can't trust the person running the network, you can't be certain that your traffic is not being intercepted, regardless of the WiFi security protocol being used.
Comment: The risk of packet sniffing can be reduced to a single room, if [infrared/free-space optical communication](http://en.wikipedia.org/wiki/Infrared_Data_Association) is used. Secure facilities use this sort of thing if they use wireless at all. But then this isn't strictly [pure WiFi](http://www.roomieremote.com/store/infrared-adapters/itach-wi-fi-to-infrared-adapter.html) any more.
Answer: The short answer is yes. Anyone on the same network as you can usually view your traffic by carrying out a very basic Man in The Middle (MiTM) attack like ARP Cache Poisoning. I cover ARP Cache Poisoning in a lot of detail in one of my blogs about Session Hijacking, which is another form attack that you're susceptible to here.
Also, as pointed out by others, WEP is a terrible security protocol and I give a demonstration of how you can bypass WEP security in 3-4 minutes in another blog here.
In terms of what he can see, he can always see the sites you're visiting. If the site uses HTTPS then he can't see the data you're exchanging, but if it's HTTP then he could see everything.
You also become vulnerable to a lot of other attacks like SSL strpping, DNS spoofing, code injection and others. Your network is a trusted zone and should be restricted to only clients that you trust. Not only that but if he uses your Internet connection to conduct illegal activity you could find yourself in some hot water. I suggest you upgrade to a stronger security protocol like WPA2 and change the key to something only you know.
I've written another blog showing how WPA2 is near impossible to break if you use a proper PSK here. If your router has WPS I would also disable that for additional protection as it present a weak point in WPA2 security as detailed here.

Can he see the websites I visited?


What factors have led to selection for intelligence in crows and rooks?

Question: The Corvidae family could include some of the smartest species after primates. What could be the factors that differentiate them from other species of birds that have determined their potential for intelligence? The only explanation I found mentions their "juvenile gangs" but many other birds are more social and less intelligent.
Comment: @John Comments should not be used for partial answers.
Comment: @com.prehensible Comments should not be used for partial answers.
Answer: This article posits that a lot of the reasons for primates to have evolved to be more intelligent (i.e. a costly and unpredictable environment, which requires complex thinking and problem-solving skills) could also apply to corvids.  So environmental complexity might be a potential reason for these birds to have become so smart.
As far as why other birds aren't as smart, I think it's hard to say. From an anatomical stand point, smarter birds have more densely packed neurons. It's unclear based on this article why some birds would evolve more complex brains than others, but one can assume it's out of necessity based on the environment and other factors. If a species can get by with a less complex brain, it most likely will. I hope this helps somewhat.


hashcat - is there a way to set minimum password length?

Question: Let's say I have a couple of hashes that I need to bruteforce as dictionary attack didn't work. Is there a way I can tell hashcat to start from a specific password length so it won't waste resources on looking for results that won't work?
Comment: You mean `--pw-min`? If so, you will find this option in the command line help, in the manual, and in various places online.
Comment: `--pw-min` and `--pw-max` were replaced some time ago with `--increment-min` and `--increment-max`. But this information is indeed readily available.
Answer: Sounds like you're looking for --increment-min. This will start a bruteforce/mask attack at a minimum length.
For example, this will try digits-only candidates, starting with length 7:
hashcat -a 3 -m [hashtype] -i --increment-min=7 targethashes.list ?d?d?d?d?d?d?d?d?d?d

You didn't directly ask this, but the deeper intent of your question appears to be "what can I do beyond a dictionary attack?"
There are many other options to try before you go full bruteforce - combinator, hybrid, masks. See hashcat's core attack modes for some introductory materials.
Comment: I know that there are more, however none of them work - apparently a random password generator has been used.
Comment: You'd have to do a *lot* of work to rule out many other methods before you can even tentatively start to conclude that. The more methods you try, the more likely you are to be right, though. :)


Midi Input to Finale on Wine

Question: I am using Finale 2012 with Wine on Ubuntu 13.04 and I am trying to connect my keyboard through a Yamaha UX16 midi to USB cable to my computer so I can use it with Finale.  When I list the usb devices in the Terminal, it picks it up, but Finale wont see it.  Is there some sort of driver I'm supposed to install?
Answer: The problem is that Wine's USB support is still being developed, and for now you can't use USB devices with software running with Wine. However, if you want to go through the trouble of compiling Wine from source, you can feel free to do so. More information can be found here.
Answer: Wine should work with native MIDI so long as it's properly set up on your system. The instructions are here: https://wiki.winehq.org/MIDI.

Midi Input to Finale on Wine


Is there an application that moves menulets from the menu bar, and shows them in a little window?

Question: Is there a utility that shows the menulets in a window in the style of the old Control Strip (which means a window that automatically shows and hides)?
Answer: It's not exactly the style used by the old Control Strip, but Bartender hides the menu extra icons, and show them in a little window that appears when clicking on its menu extra icon.

Lets you tidy your menu bar apps how you want.
See your menu bar apps when you want.
Hide the apps you need to run, but do not need to see.
Have the clean looking menu bar you want.
Rearrange your menu bar items as you wish.

For each icon shown in the Menu Bar, it let you decide where the icon should be shown (Bartender Bar versus Manu Bar), and how long the item should be shown when it is updated.
Answer: Short answer is no.
The menulets are controlled by SystemUIServer, a system application in charge of a number of things one of them being the right side of the menu bar. Unfortunately SystemUIServer is not replaceable, and its behavior cannot be changed.
Note that there are multiple kinds of 'menulets':

System provided menus (the clock, airport signal, time machine...). These do use a private API as they run code inside SystemUIServer and Apple doesn't like people loading code in this sensitive piece of software. Those are present on disk with a '.menu' extension. Those are sitting on the right of the menu bar.
Third party menus using the private API without Apple blessing. Those usually use a hack to bypass Apple protection (most common hack is MenuCracker, code is on SourceForge). Some of those menus are good and respectful of their environment, some of them are not. Those menulets are freely mixable with the system ones, you can ⌘-drag and drop them to reorder them.
Applications deciding to provide a quick access menu on the menubar. Those do run in their own process and use a public API to place themselves on the menubar. You cannot reorder them and they always sit on the left of the system menus. SystemUIServer control those icons placement.

It could be possible to write an application capable of loading menulets by emulating the private API, but a number of things will not work as expected (toggle in preferences will not toggle in this app, I'm not sure that some menulets do not use some of SystemUIServer internals...). And anyway, no matter what you do there is no way to control the application positions.
Comment: Since SystemUIServer uses a private API, every time Apple changes that API the utility should be updated too. This would result in an utility that, despite the time took to develop it, could stop to work every time Apple develop a new Mac OS X version. Thank you, @eric.
Answer: A quick Google search landed me on this: Return of Control Strip [macworld.com]
I am not really sure whether this will help you because I have never used Mac OS Classic.
Comment: I apologize; I was not clear on what I meant with _in the style of the old Control Strip_. MenuStrip doesn't move the menulets (aka, the menu extras) from where the Mac OS X normally shows them.
Answer: Although I do not know of any utility that shows the menulets in a little window, I do know how to move the menulets.
Holding command while pressing down on any of the menulets will allow you to move them.
You can try it on any Apple-made menulet products except Spotlight.


Judge OF the [county name] Court of Common Pleas or Judge ON the [county name] Court of Common Pleas?

Question: I see this used both ways in advertising materials, but am not sure which is correct. I could not find any reference to this when searching the internet.
Comment: Can you provide an example of where you have seen each of these used ? What did you search for?
Comment: I have seen both versions used in advertising material. I searched for "Judge of the court or Judge on the court."
Comment: You should [edit] your question to include that information.
Answer: Both of and on are used when speaking of such courts.  of casts its object as something to which one can belong as a member belongs.  on casts is object as something which affords a position.

He is a member of the committee.
He has a position on the committee.
He is a member of the court.
He has a seat on the court.
He has been a judge on the Court of Common Pleas for ten years now.
He has been a judge of the Court of Common Pleas for ten years now.

Here are some examples in the wild:

Lycoming county is within the eighth judicial district; and thus, it appears that the affidavit was sworn before a judge of the court of common pleas of Lycoming county.
And later, after Judge Onion became a Judge on the Court of Criminal Appeals, his twin brother, James, was also elected to serve as judge on the same district district court where their father had served.
Comment: I'd recommend swapping the last two example sentences in the first quote block. The word sequence is currently: *of*, *on*, *of*, *on*, *on*, *of*. Which feels out of place.


How is it that the Earth's atmosphere is not "blown away"?

Question: The Earth moves at a high rate of speed around the Sun, and the solar system is moving quickly around the Milky Way. How is it that the Earth's atmosphere is not "blown away"?
Comment: Related to http://physics.stackexchange.com/q/1193/11062
Answer: Your intuition about objects facing a head-wind when traveling quickly only works near the surface of the Earth in Earth's atmosphere.  In the atmosphere air molecules must be pushed out of the way.
In space though, there isn't anything to do the blowing.  There is no interstellar medium / fluid that could drag / push or otherwise effect the Earth's atmosphere simply because we're moving quickly.
The Earth does lose atmosphere due to several reasons though.  First, there is a "solar wind" from the Sun which are high energy charged particles (protons mostly) that strike the upper atmosphere and impart so much energy to molecules in the atmosphere that they're able to escape.  There are other means too which are listed in the Wikipedia article on atmospheric escape.
Comment: I think that your second paragraph is a bit misleading. There are [interstellar clouds](http://en.wikipedia.org/wiki/Interstellar_cloud), solar wind (as you point in the third paragraph). Earth atmosphere interacts with solar wind, and solar wind [interacts](http://en.wikipedia.org/wiki/Heliopause_(astronomy)#Heliopause) with interstellar gas.
Comment: Yes I considered interstellar medium but there is just too little of it to matter unless we're being extremely pedantic.  Also, there is no reason why as we sweep though the interstellar medium it doesn't add to the atmosphere instead.  Since the Earth doesn't travel through a region of dense gas like a nebula the effect can be completely ignored either for adding to or for sweeping away the atmosphere.
Comment: Ok, I just thought that some people could interpret your passage as if there were nothing interstellar at all.
Comment: @Peter Kravchuk, Brandon Enright: the principal reason to ignore interstellar medium *today* is not there is too little of it. But it is **non-existent inside the heliosphere** and, moreover, it even can't dynamically influence inner Solar System because the solar wind here is supersonic. Though, possibility of intrusion events of very dense, or very energetic interstellar matter may not be dismissed at geological timescales.
Answer: Though I support to some extent @BrandonEnright reply, it also says that your intuition is not completely wrong. But you were not considering the relevant motion. The effect of speed is due to the interacting surrounding medium, and it is the speed relative to that medium that must be considered, rather than some "absolute speed" which I would not care to define.
In this case, the major interacting medium (though not the only cause of atmospheric loss) is the solar wind of charged particles, going from the sun outward, and you have to consider the motion of earth with respect to that wind, or if you prefer the apparent solar wind (but the speed of earth is negligeable: about 30 km/s earth mean orbital speed against between 300 km/s and 800 km/s for the solar wind speed, in nearly orthogonal directions, hence less than 0.5% effect according to Pythagoras). It is very much like the relative wind seen by a sail boat.
Side-note: Though the solar wind refers to the charged particles emitted by the sun, there is also the flux of photons that may be seen as another kind of wind that has indeed been considered for interplanetary sailing (though the problem differs much from sea sailing in other respects; for example sea sailing takes place in two media, water and air, in relative motion, and that is necessary for controling direction of motion). However, this comparison also breaks because relative speed of photons is a constant, independent of the motion of earth or interplanetary sailships. Energy may be impacted, but not at the relevant speeds.
The relative wind on a sailboat can indeed fly light objects off the deck, as the solar wind can fly atmospheric molecules off the planet. However, in the case of Earth, the magnetic field of the planet diverts the solar wind and protects the atmosphere from it to some extent. It acts like a screen on the deck of a ship that would protect from the wind (but would not help efficient sailing).
The loss of its magnetic field (they are fossile remnants of this field) is thought to be one of the possible causes of Mars very thin atmosphere.
Comment: babou, welcome to Physics SE. Unfortunately what you have written about solar wind and interplanetary sailing is not entirely correct.
Comment: @DeerHunter - thank you for taking the time to point this out. I got so interested in getting a positive vision of the question that I forgot that solar sailing is photon based, while solar wind is composed of charged particles. And photons have a much different behaviour.
Answer: I dont think @Brendon is right. Best exemple of an object moving trougth space and being blown away is a comet (blown away part is the tail).
Best answer I think si that the Earth's atmosphere IS blown away but to a lesser level due to its gravitationnal force (Keeping the Earth in one pieces).
Comment: A comet's atmosphere *vaporizes* as it nears the sun, because it's mostly made of ice. I believe Earth isn't like that. BTW, You shouldn't judge yourself and *you alone* can't judge others..!
Comment: The tail *is* blown away, yes, but by solar wind, *not* by a headwind as the OP seems to be considering.

How is it that the Earth's atmosphere is not “blown away”?


To understand spaces

Question: This is a one-line bash script by Ishmael Smyrnow to clear macOS icon cache:
sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder

source
I try to understand how to change it back to its multiple-line version. Here is what I have now:
sudo rm -rfv /Library/Caches/com.apple.iconservices.store
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm -rfv {} \;
sudo find /private/var/folders/ -name com.apple.iconservices -exec rm -rfv {} \;
sleep 3
sudo touch /Applications/*
killall Dock
killall Finder

I do understand in Ishmael's version semicolons are used for newlines and \; for literal semicolons. But what is the purpose to have a space between the two semicolons and after the asterisk? Is it safe to remove them?
 -exec rm -rfv {} \; ;

/Applications/* ;

Comment: most likely it's just for visual separation. `\;;` might look like it's a single thingy, when it's not. Not that readability seems to have been a main concern when they've crammed a seven command 250-character scriptlet onto one line...
Comment: The `\;` at the end of find(1) is there [on purpose](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html). The backslash is there so the shell doesn't interpret (and thus remove) the semicolon `;`. The semicolon is part of the syntax of the `-exec` argument to find(1).
Answer: When to and not to use spaces in shell language syntax is not trivial.
It's also important to note there different kinds of spaces:

space and tab are used to separate tokens in the syntax

newline separates tokens but also separates commands. For instance:
array=(
  foo bar
  baz
)

(a syntax from zsh now supported by several other shells) or ksh's (from C):
(( 1
+ 2
))

Or POSIX sh (but also from ksh):
var=$((
  a +
  b
))

above space, tab or newline can separate the elements.
But:
cmd a
cmd b

runs two separate commands.
Where newline can be used in place of space is not always clear and can vary between shells.

in some shells (including bash) some other characters classified as blank in the locale can be used as token delimiters in the syntax and that can include characters such as U+00A0 the non-breaking space (only in locales where it's classified as blank and encoded on one byte in the case of bash).

Then there are quoting operators ("...", '...', $'...', $"...", \) which can be used to remove whatever special meaning a character otherwise has in the shell syntax.
And there are a number of special characters (mainly ();<>&| and to some extent `$) which either alone or possibly combined with others form tokens in the syntax that can also delimit words and so don't need spaces around them.
For instance, in ksh, you can write:
[[(a == b||d>c)&&0<1 ]]&&(echo yes)|cat

Instead of:
[[ ( a == b || d > c ) && 0 < 1 ]] && ( echo yes ) | cat

As ||, (, &&, <, &&... are individual tokens that can delimit.
In bash (5.1 at least), you'll find that  you need:
[[(a == b||d>c)&&0 <1 ]]&&(echo yes)|cat

Or otherwise you seem to be hitting a sort of bug:
$ bash -c '[[(a == b||d>c)&&0<1 ]]&&(echo yes)|cat'
bash: -c: line 1: unexpected token 284 in conditional command
bash: -c: line 1: syntax error near `&0<'
bash: -c: line 1: `[[(a == b||d>c)&&0<1 ]]&&(echo yes)|cat'

(possibly because outside of [[...]], in cmd 0<file, 0< in itself is an operator so likely treated as a separate token).
In:
foo \;;bar

There's no ambiguity, that's a foo word, space treated as separator, a quoted ; (\; being the same as ';' or ";" here) and the ; token and then bar. So it is treated the same as:
foo ';' ; bar

Adding spaces doesn't harm and helps with legibility.
That code could also be written (and improved to):
sudo zsh -c '
  rm -rfv /Library/Caches/com.apple.iconservices.store
  find /private/var/folders/ \
    "("
       -name com.apple.dock.iconcache -o \
       -name com.apple.iconservices \
    ")" -prune -exec rm -rfv {} +
  sleep 3
  touch /Applications/*'
killall Dock
killall Finder

Where you'll notice:

sudo is run only once with a multiline quoted string passed as an argument to a separate zsh invocation inside which all the characters lose their special meaning to the outer shell.
\ followed by newline is another special case not mentioned above. That makes the newline disappear (for the inner shell; for the outer shell the backslash and newline are inside single quotes so remain literal).
we call only one find
we use + instead of ; to delimit (for find, not for the shell) the list of arguments that to make up the command that -exec executes, so rm is called once with all the directories to remove instead of once for each.
we use -prune so find doesn't attempt to descend into the directories that rm is going to remove anyway.
I use "(" instead of \( as I find it more legible. Usually I would use '(' be here the whole thing is inside '...' so we can't use that.
we use zsh -c instead of sh -c because sh has that misfeature whereby when globs don't match they are passed literally, so in sh, touch /Applications/* would create a file called * in /Applications if there was no non-hidden file there. In zsh, if there's no match, you get an error instead.

To understand spaces


Using 5V arduino with 12v solenoid lock

Question: I wish to use an arduino like this with a 12v solenoid lock like this. How can I do this. I am told that using this might work, but I am also thinking I can use a transistor's amlification to do that. Can you tell which one is better and if transistor, how to do that?
Comment: you can definitely use a somewhat small transistor (600mA) for that. search the web for "arduino relay interface", choose a circuit, subsitute the relay with your solenoid, and you're done.
Comment: That ebay solenoid does not distinguish in its "datasheet" between its pull and hold power consumption; not does it list real and apparent/total power. Good luck sizing a transistor for that. Also if I multiply their stated current and voltage (presumably to get total power), I get less than their stated real power.
Comment: @RespawnedFluff: Since it's a DC solenoid there'll be no difference between its pull an hold power consumption except for the moment when it's first connected to the 12 volt supply.  Also, since it's DC,  it'll have a power factor of 1 and there won't be any "apparent power" associated with it. Finally, 12volts, DC, times 0.6 amperes is 7.2 watts, precisely what they state.
Comment: @EM Fields: They state 7.5W. Also look up some real solenoid datasheets and see that the activation voltage is a few volts below the nominal one, which makes their calculation even more dubious. And no, even for a DC solenoid you have different pull and hold currents. http://electronicdesign.com/analog/what-s-all-solenoid-driver-stuff-anyhow
Comment: @RespawnedFluff: Agreed on the 7.5 watt number. However, since there'll never be anything pulling on the plunger, the hold power will be irrelevant and all that'll matter will be the 7.2 watt pull-in power required to get it moving against the spring.
Comment: @EMFields: Are you saying the hold power is zero? What makes the lock return when the solenoid coil is deenergized? Some spring maybe? Doesn't the Hooke force of that need to be defeated by the solenoid in its hold position?
Answer: By sheer luck your lock solenoid looks very similar to this one (similar spec too "Draws 650mA at 12V") and they have a working circuit for it over here so look at that and see what they used to drive it. Apparently it's a TIP120, so the peak/draw current is probably higher than that ballpark figure, which I suspect is for the hold.

Overengineering the transistor by an order of magnitude or so (for a poorly spec'd solenoid part) ensures it doesn't go pop so easily. Also, a Darlington like TIP120 is very easy to drive from the arduino or some other microcontroller.
A similar project using the same solenoid lock used an IRLB8721 (power MOSFET) instead, which is even more beefy in terms of load current it can handle.

Using 5V arduino with 12v solenoid lock


React native: is it recommended to use PNG or SVG images?

Question: I'm working on a react-native project and I have over 30 icons of SVG format. I want to know if it is recommended to convert those images to PNG or it's better to use as SVG files.
If it's better to use images as SVG what is the best way to show SVG file on react native?
Answer: Prefer PNG over SVG for react-native mobile apps because its rendering is less CPU intensive, and comparing to web apps user don't need to load all images on each app launch but only on installation, so the size doesn't matter that much.
Just make sure you provide three (or at least the last two) sizes:
image.png
firstname.lastname@example.com
email@example.com

However, if you are developing also for the web platform (react-native-web), then it makes sense to use SVG, as they reduce loading time, support any screen size and are more accessible, e.g. better scaled for people with poor vision (e.g. 200% zoom scale in the browser).
Answer: SVG is not always the best solution. If your SVG is not optimized and has lots of Paths / Lines or if you need to use it many times over, it can generate a lot of views and slow down your app.
Best answer is it depends.
Comment: Generally if you don't need a variable resolution/zooming in, rasterised images will work better.
Answer: You can always prefer svgs over pngs as the latter are heavy to render.
To render svg assets you can use react-native-svg.It's the best i found for react-native.But it is not fully complete.You can't show filters and shadows using this package.For that use the pngs instead.
Comment: Rendering an SVG is more CPU intensive than a PNG
Comment: This answer provides no evidence or explanation. Personally, I think that in native mobile apps (this is about react-native) pngs are preferable. Please re-consider if this should be the accepted answer.
Comment: @ThomasEbert I have to agree with you that I do not have any strong evidence that svg perform better thatn png. Only thing I remember working with react native is that svgs were slightly lower in size compared to png. How much that is beneficial I will leave up to the users. I am more than happy to upvote any answer that provides better stats regarding the comparison.


How to retain table data in wordpress phpunit tests

Question: I was wondering is there a way that phpunit for woprdress do not delete any data which i created during test?
Answer: Usually, you don't want to do this, as it might inadvertently affect tests that run after the test that creates the data.
If there is some data that you need to be available to several of your tests in a single testcase, you can create it with wpSetUpBeforeClass(), and then remove it again in wpTearDownAfterClass().
For example, the REST API category controller test from core:
class WP_Test_REST_Categories_Controller extends WP_Test_REST_Controller_Testcase {
    protected static $administrator;
    protected static $subscriber;

    public static function wpSetUpBeforeClass( $factory ) {
        self::$administrator = $factory->user->create( array(
            'role' => 'administrator',
        ) );
        self::$subscriber = $factory->user->create( array(
            'role' => 'subscriber',
        ) );
    }

    public static function wpTearDownAfterClass() {
        self::delete_user( self::$administrator );
        self::delete_user( self::$subscriber );
    }

    // [snip]
}

Otherwise, if you just want to keep some database changes from a test, perhaps for debugging purposes, you can use commit_transaction().
    public function test_something() {

        do_something();

        $this->commit_transaction();
    }

Comment: Actually i am trying to insert some complex test data in posts and postmeta table that needs carefull validation that test data is infact valid and i want to check it manually by inspecting the tables. Now if the one of the test data generation function out of several function (which run one after one) is not inserting the correct data then i have to run the test again and again and it wastes lots of time as every execution of phpunit takes time  ,So i f i can continue from where i left in last test i can save some time, I wonder if there is some flag which i can use or some function
Comment: @chown You could do like in my second example and commit the transaction after each data generation function runs. Then you could use xdebug and set a breakpoint after your first data generation function, and you'd essentially pause the tests while you inspected the database manually. Or, if you don't have xdebug set up, you could commit the transaction and then exit. But I don't think there is a way to retain the data between runs of phpunit, because WP recreates its db tables each time.


How should I respond to a prospective postdoc PI that postpones his decision about my application?

Question: All of the items on my application for a postdoc position was completed around 2 weeks ago. The prospective PI told me he will take a look over everything and gets back to me in a day or two, he did not get back to me and I sent a follow up email, he replied very quickly with a nice message and said he could not take a look and I should remind him again on the weekend. I reminded him over the weekend and he got back to the Monday afterwards, he again sent a nice message and apologized and said he still could not take a look but he will do it today or tomorrow, but it did not happen. I again send a follow up email on Thursday and he replied to me quickly and said he is just left behind and he needs to take a look over everything just one more time and that he will do it the same day, however he did not get back to me. How should I navigate this situation? Is this good sign or a bad sign? Any tips on how to follow up? Thank you!
Comment: It's a bad sign in the sense that it's not unreasonable to expect that if you do get the job, he'll behave in the same way for any paperwork you need him to do. That will quickly become very frustrating when writing papers, submitting the next job application etc...
Comment: That sounds like a bad sign.
Comment: Repaired obvious and distracting typo in title...
Answer: My guess is that he is just incredibly busy. I'd suggest you be patient for a bit. Don't give up on other opportunities and he should respond in time.
However, also take a look at what this might mean for the long run. Being very busy can be good or bad. Sometimes it implies productivity which can benefit you.
But unless you have a reason to need to know quickly, let it go for a bit.
Comment: At some point the emails become a nuisance. It seems like a lot of email for a two week period. Give it a week at least. Try to relax.
Comment: He is a famous researcher, 17K+ citations and I believe he is very busy! How long do you think I should wait before following up? Is it possible that I sabotage my application by doing that? thanks!
Answer: In certain points in the academic calendar, my own respinsibilities and priorities are this heavy. I have every intention of reviewing an application, but other things get in the way. Sometimes, I don't even have time to write an email, eat a meal or even sleep!
Trying to read signs in situations like this is no better than reading tea leaves -- you will see what you see. Until you receive a final answer, I suggest taking the PI's message at face value and send a follow-up email. It doesn't have to be long or circuitous:

Hello, Dr X. I contacted you yesterday about my application. You
responded by asking me to check in today. I was wondering whether
there was any progress.

That the PI didn't respond to your last email might be due to several factors, not all of which are related to your application. In that case, I would write something like

Hello, Dr X. I didn't receive a reply from you and wanted to check
that you received my email about reviewing my application for position
yyyyy. I'm still interested in the position and will wait patiently
for your reply.

Good luck.
Answer:
and I should remind him again on the weekend.

Huge red flag, potential PI is a person that think he will do whatever unrealistic goal of the week by Friday noon, then understands they will not manage, so why not extend the working days to the weekend (just for this one time, of course ... which translates to "hey, sometimes I work on the weekend, but I care for my personal wellbeing and I do so only once per week!").
Potential PI is putting his/her own free-time below your anxiety for getting considered for a Postdoc position ... 3 months working with they and they would unconsciounsly expect the same from you.
Do not follow up, let the process go on its own, my reccomendation is to consider any submitted application to job/academic position/research grants as rejected unless proven contrary ... I know that statistically I am right, plus it will leave you constantly thinking for a realistic plan B/C/D/.../Z which is the only sane thing to do in an high-risk (in terms of opportunities and satisfaction) working environment as the academia.


Why did Ada in the Resident Evil series come back after dying in Resident Evil 2?

Question: The deaths just don't make any sense. Are there any explanations for the bizarre events? (Ada died in two different cutscenes, both different ends, and returned in RE6!) (Steve died in Code Veronica but returned in The Darkside Chronicles!)
Answer: Steve died in RE Code Veronica X for sure, but The dark side chronicles is more like a remake or a spin-off of the game; same bosses, same places, etc.
Ada did not die in RE2, as far as I remember after she gets hit I think from William Birkin in that trolley, Leon helps her to rest and goes out to kill one of the most irritating RE bosses ever
P.S.: In Resident Evil Code Veronica X ending, Wesker said "Maybe he'll come back alive just as I did, and to see your sister again". I really wish this become true!


Need a very low power, low force motor/actuator

Question: What are some alternative types of motors/actuators that can be used instead of servos?  I need some way of inducing a slight bit of motion/movement but with very little force and power consumption.  Even the tiniest sub-micro servos use quite a bit of current and may have quite a bit more torque than is necessary.  I thought about using muscle wire, but I need something that doesn't take up much space, and they don't appear to have shorter lengths of wire available.  Not only that, but I would prefer to have a rotary rather than a linear actuator.  What would be some options for such an actuator running at say 3v and requiring somewhere in the range of 20-40 mA of current?
Comment: What about hacking a battery operated clock mechanism? Low power, low voltage, cheap, available and rotary.
Comment: Can you put some numbers to the torque, speed and distance values you need?
Comment: Does the device have to retain its' position after power is removed from the actuator?  For example, could you use a voice coil or galvanometer type actuator?  For example, galvo actuators are used in laser visual effects machines to move the mirrors that steer the laser beam.
Comment: I was thinking a piezo, for rotary motion something like the squiggle drive/?  New focus has a piezo rotary drive.. none of those are cheap.
Comment: Pager motors. And search ebay for "small motor" etc. There are a vast number there.
Comment: Not sure how much torque needed.  The point is to touch a touchscreen tablet.  So I need just enough force in order to simulate a finger press without damaging the delicate screen.  I previously looked at a sub-micro servo with 11 ounces/inch torque, but don't know how to convert that into linear force at the end of the servo arm.  I have no idea if even this tiny servo is too powerful.
Answer: Here is the drive mechanism from my beloved Butterfly Livingroom Flyer...

It is a pager motor connected to a reduction gear. By picking the size of the gears (or possibly adding additional gear stages), you can have pretty much any viable torque/power combination you want, down to single digits of mA.
If you need even a smaller actuator, Plantranco also sells the MicroAct Magnetic Actuator - 0.4g...

You could also make something similar to this yourself with some very high gauge enameled wire and a small super-magnet. This would give you lots of control of the power/torque/range-of-motion trade offs.
(Note that I have no connection to Plantranco other than I have bought more of their flyers than I'd care to admit!)
I also love Jim's suggestion of hacking a clock motor if that could work for your application. These things use impossibly small amounts of current.
Here is a product that is basically a clock motor, but good for hacking because it comes with lots of possible gear combinations, and also provides continuous rotation (the yellow metal disk acts a a flywheel), whereas clock drives usually have unneeded timing circuits and often move in a a once-per-second jerk ...

They cost about $30 on Amazon, much cheaper if you need more than about a dozen.


pin in twitter4j

Question: How can I get the pin for the twitter 4j ?
 accessToken = twitter.getOAuthAccessToken(requestToken, pin);

please help..!
Answer: If you take a look to the twitter4J Code Examples, you see that the user is suppose to write the pin that he gets from the Twitter website where he will be redirected. If you want to take the pin from the URL without the user having to introduce it manually, I think the pin comes in the URL as "oauth_verifier". I did all the login with signpost because I didn't want the user having to write anything and I wasn't able to do it using only Twitter4J. Once I have the access token, I create the Twitter object from twitter4j with twitter = twitterfact.getOAuthAuthorizedInstance(consumerKey, consumerSecret,accessToken);and it works fine. This way it was much easier for me.
Answer: You need to redirect the user with a request token (that you can get from Twitter) to the twitter site, where the user enters the username/password and gets the pin back.
See e.g. https://github.com/pilhuhn/ZwitscherA/blob/master/src/de/bsd/zwitscher/account/LoginActivity.java#L69 on how to direct to Twitter
and then https://github.com/pilhuhn/ZwitscherA/blob/master/src/de/bsd/zwitscher/account/LoginActivity.java#L91 when the user has the pin and needs to proceed
Answer: You should be able to get away without using the PIN.
Twiiter4j DOC
Blog Post stating it is not required by Twitter

pin in twitter4j


consequences of rejected/accepted hypothesis

Question: A and B are some statements such that A implies B. I test the null hypothesis that A is true. If my test fails to reject A, does that result say anything about B? Analogously, if instead I test the null hypothesis that B is true, and my test rejects B, can I conclude that A is rejected as well?
Answer: A implies B, understood as logical implication, means that if A is true, then B is true. However if A is false, this says nothing about B, and if B is true, this says nothing about A.
According to that definition, concluding that B is true will shed no light over A. Also, concluding that A is false will give you no information about B.
Finally, if you conclude that A is true, then you are safe say that B is true, though this conclusion should not be reached from failing to reject the null, since this doesn't mean that the null is true (see this for more information).
Comment: I think that "knowing whether B is true or false says nothing about A" is not correct, see my answer: if $A \implies B$ and B is false, then A must be false.
Answer: I refer to my answer to What follows if we fail to reject the null hypothesis?, because it is also a matter of power of the test.
In logic, if $A \implies B$, then the being true of B does not lead to anly conclusion on A, however, if B is false, then A can not be true (because if A would be true, then, by modus ponens, B would be true but as B is false this can not be). So $(A \implies B) \iff (not(B) \implies not(A))$.
As said these are rules in logic, where A is either true or false, in statistical hypothesis testing we have no certainty (else we do not do statistics) so it is different (except in the unrealistic case where tests have a power of 100pct).
Answer: Applying straightforward logic, A => B can be translated to ¬A or B, which in the end means that if B is rejected, so is A.
As f coppens's answer says, we can never be 100% sure because in statistics we are always working with probabilities. I would say these logic rules follow, but they are modified by the degree of certainty you are working with. If B is rejected, then there is a similar level of certainty about rejecting A. Also, failing to reject A does not enable you to accept it, nor to say anything about B.
Nonetheless, I would point out this: when A and B are real statements about your field of study, you should be very careful about how sure you are that A => B. This is a very strong assumption that could lead you to wrong conclusions if this assessment is not entirely true.
Answer: At least in the frequentist school of statistical inference, failing to reject a hypothesis is not sufficient to prove it -- that would typically require rejecting all other plausible hypotheses.
In your counterexample, if you are certain that A implies B, then a rejection of B could be interpreted as a rejection of A. However, that would depend entirely on the strength of that relationship.
Comment: I agree, but I guess I was hoping for an example of a test failing to reject A but rejecting B where A implies B. But maybe my question is incoherent since in the last sentence I'm describing tests corresponding to different hypotheses.


empty log files created automatically

Question: For 5 or 6 months I have been experiencing a strange activity on my android 4.1.2 device. It is samsung galaxy tab 2. The problem is somehow every day a few log files will appear in the root of my SD card and I could not figure out why and what application does it. It is very annoying as I need to clean them. I will attach a screenshot. If anyone came across the same issue, please let me know. We could try to find the solution together. If more information is needed, feel free to ask. Thank you. Vitaly.
Comment: My first guess would be an app whose initials are FW, as in the file names. Do you have such an app installed?
Comment: @DanHulme,i went through all the apps i have, and there was no with such initials. i have uninstalled some of the apps to see if this log thing continues. need to wait till next day
Answer: Dan Hulme was correct. I did indeed have an application called "Foreca Weather" and it created the logs. It's been several days since I'd uninstalled the app, and the problem haven't showed up again. Previously I had this application for a year and didn't see any such issue till the recent update they had.

empty log files created automatically


Why do we use informal language when the user encounters an error or issue?

Question: Why do we use informal words like "Oops!" with users when something goes wrong? What's the reason behind using this type of language during a user's interaction with a website?
Comment: Since when is copy not part of UX?
Comment: Copy(content) is part of UX. The etymology of a particular word, however, is perhaps much better asked over at english.se
Comment: You don't need to for sure? I think it's just trying to be casual etc. You can also say "Ouch. Something went wrong.", I guess.
Comment: i think you'd get better answers on English SE (no disrespect meant to current answers though lol)
Comment: See also: http://ux.stackexchange.com/questions/37314/humor-on-the-deathbed
Answer: As noted on the Android Design Principles Writing Style page:
Friendly

Use contractions.
Talk directly to the reader. Use "you" to refer to the reader.
Keep your tone casual and conversational, but avoid slang.

By saying 'Oops' - in English, a commonly accepted way of acknowledging that an unexpected event has happened, in a non-frightening way - we are acknowledging a problem, but not scaring the end-user.
Compare these two error messages:

Oops!  Some information wasn't complete.
Error: Please enter valid information in all required fields

Which one comes off as more friendly?  Which one is less scary?  Which one is more familiar?  In this case, message #1.  The second message is very technical (terms like 'Error', 'valid', and 'required') and very impersonal.
Additionally, it has been observed that users like language that mirrors what is used in more real-world situations.  The second example is less-than-ideal because of how stilted and unnatural it is for day-to-day conversation (I'm a programmer, and even I never speak like that to other people!)
I highly recommend starting with the Android Writing Style principles, and then going and performing research against the Windows and iOS design principle documents.  Surely you can gain better insight about your writing style and how it interacts with the end user.
Comment: http://voiceandtone.com/ is a good resource for considering what coloration your application's copy should have.
Comment: Also, "Oops" is a rare example of something that acknowledges a mistake *without assigning any blame*. As well as being impersonal, 'Error', 'invalid' etc often sound like they are criticising the user - and terms like "Sorry!" go too far the other way, there may be nothing to apologise for. "Oops" is a rare word that is friendly and appropriate regardless of whether the user, system, or random chance caused the error.
Comment: "Oops" is too mild an apology. A cute apology when the *computer is to blame* is annoying.
Comment: @georgeawg - When _the computer_ is to blame, I agree that you shouldn't say 'Oops'.  You should still use non-scary language.  To be fair, in my (five year old!) answer, I did change context to a different situation, validation errors, to make the point that more casual language is more helpful.  I can see how that could be confusing.
Answer: Using informal language makes the error message more human and less intimidating. It also makes the blockage for the user less frustrating if it's language they can find humor or familiarity with. It's very much like adding a quirky illustration such as the Twitter 'fail whale' to lighten the situation. Like using "Error" or "Invalid" it is wise to add a reason for the error, and I'd suggest that language style should be consistent.
Answer: As others have said, it's an attempt to not scare the users. For example, I know someone who works at a company that writes software for devices that are used in the emergency room. One of the hospitals that uses this company's product has gotten very agitated about the application crashing. Why? In part because the application sometimes shows a message box that says Fatal error.
Imagine you're the programmer who wrote the application. You know what a fatal error is, and you don't find it alarming. It's unfortunate; it means you have to restart the application; it probably means you have a bug to fix; but it is hardly something to become agitated over.
Now imagine you are a surgeon in the operating room. You look over at one of the devices, and it is displaying Fatal error on the screen. Now, even if you are tech-savvy enough to know what this means, fatal is just not a word with good connotations. The word fatal is not well chosen for an operating room.
Rather, it would be good to have an failure message that encourages calmness. Something like "Sorry, the application has hit a glitch and needs to restart," would be less likely to alarm people who are working in a high-intensity situation.
Answer: In addition to being less intimidating, the language used in interfaces is part of a 1-on-1 conversation where you can afford to be casual, whereas language intended for a group tends to be more formal.
Answer: As per this this article it is a derivative of the word "up a daisy". To quote this article

The Oxford English Dictionary mentions that oops is "perhaps a natural
  exclamation," but some of its first appearances suggest that, along
  with whoops, it might derive from the phrase up-a-daisy. Up-a-daisy
  has been used as an utterance of nonsensical encouragement for
  children since the 18th century, especially upon lifting them into the
  air or coaxing them back on their feet after a tumble. Its first known
  appearance in print comes in the letters of Jonathan Swift, as
  "up-a-dazy," in 1711. Over the course of the 19th century, it evolved
  into upsidaisy. Many of the earliest appearances of oops! and whoops!
  show up in the context of accidental slips and falls, suggesting that
  they may be related to up-a-daisy

It could also have been derived from other languages as other languages have similar words. To quote this article

Many other languages have similar expressions. An Italian found in
  error might say, "ops!" while a Frenchman who's made a faux pas might
  say, "oups!" In Spanish, one can say opa, but just as common are huy
  and ¡ay! A Russian who's made a goof might exclaim, "ой" (pronounced
  oj), while a German blunderer might blurt out, "hoppla!"

As per the Oxford dictionary its an natural exclamation-  the sort of noises that a human being naturally makes when they might make a mistake. To quote the online Oxford dictionary site

Origin
natural exclamation: first recorded in English in the 1930s.
Comment: While this explains the origins of the word "Oops" it doesn't answer "why we using the word OOPS if something went to wrong in the sentence or communication with others?"
Comment: I have to agree with @hynes this is a GREAT answer for english.SE but really doesn't address the UX aspect why it's good (or bad) to use a 'casual voice' when messaging the user.
Comment: I highly doubt that Ooops is representative of a noise that a human being actually makes when they make a mistake. Maybe in 1940, but not now.


How many Dutch lived in Indonesia during the colonial era vs native population?

Question: In Indonesian education, it is often emphasized that the Dutch took advantage of "divide and conquer" tactics (and superior technology) to keep ruling Indonesia (then the Dutch East Indies) despite being very outnumbered. At its peak, how many Dutch people lived in Indonesia during the colonial period? And how outnumbered was this compared to the native population?
Answer: This Wikipedia article shows the results of the 1930 Dutch East Indies census (in the Social History section), listing 240,417 Europeans out of a total population of over 60.7MM.
Calculating this as 0.4% European (with an additional 2.2%, or 1.35MM, Chinese and other foreign orientals), the European population was outnumbered 250-1 and the non-indigenous population was out-numbered 39-1.
While the absolute numbers would have increased between 1930 and 1941, it seems unlikely that any substantial change in ratio occurred in that 11 years, as there was no event to precipitate such a change until the Japanese invasion.
Comment: But what about pre-1930? I am not sure the same ratio can be extrapolated backwards.
Comment: @FelixGoldberg: IMHO, the 1930 figures represent a good "first pass." The earlier figures may have differed, but the takeaway is that the number of Europeans were very small.
Comment: This reminds me of a childhood friend who believed that the Americans would win the Vietnam War because "one American soldier is worth 1,000 Vietnamese soldiers." He was wrong, of course, but may have been thinking in terms of ratios like this one.
Comment: Also from Wikipedia, 'In the 1890s, there were 62,000 civilian 'Europeans' in the Dutch East Indies, most of them Eurasians, making up less than half of one per cent of the population." So it seems safe to say the peak, whenever it was, fell well below 1%, especially if we mean Dutch-born.
Answer: In my experience of Indonesian historical education, which could often be described as 'propaganda', there is an emphasis on describing the Dutch as controlling Indonesia for 350 years. This is of course false, because the Dutch controlled Indonesia for just a few decades, and the modern day Indonesia is the continuation of the state that the Dutch created, whose form was by no means certain at the time they first arrived.
For example if one reads the 1823 book, Mission to the East Coast of Sumatra (the area now called North Sumatra), then it is quite evident that there was no Dutch control or influence at all. The book describes the fact that there were many feuding sultans such that one upstream would have their produce taxed by the one downstream.
These Sultans in the area were Malay, and controlled the area of a modern day regency or less.
Besides them there were various Batak tribes whose various 'kings' influence stretched no more than a village or so.
When the Dutch plantation law was passed in the mid-19th century the Dutch worked to eliminate conflict between the Sultans, elevating certain Sultans to control an area, and plantation leases were granted to foreign capital startups with rent paid to the Sultan.
The mini kings of the Batak were placed under control of the Malay Sultans and princes, presumably because it was simply more efficacious to do so given the inherently larger existing areas of influence of the Sultan - there were separate hierarchies of entirely native government and European, so the European Residency was for European, while there was a parallel Kejuruan for native administration.
Therefore the question has a number of incorrect presumptions, in my view:

That there was inevitably a shared consciousness among the entire native population that they were being colonized by foreigners
That in fact the entire modern-day nation of Indonesia was governed as a country for any significant period of time by the Dutch
That for example the relatively homogenous ethnic groups, each with their own religion, culture, homogenous settlements, etc. would necessarily instinctively reject colonization from Europeans as being any different, to say, being taxed by a neighbouring sultanate on their exports.
That in fact raw numbers of Europeans are particularly relevant - in this sense for example it's clear from history that Europeans setup for example plantations, but equally there were Chinese entrepreneurs who were disproportionately likely to be merchants and traders. However many people would have lived in rural areas where they had no contact with Europeans at all, so it's not particularly clear why these people should be expected to rebel against colonizers whom they had no contact with.

Clearly in cities where the colonial power structures were most evident, native Indonesians could and eventually did organize into independence movements, because there was a clear structure to rebel against. But prior to that it's not particularly clear how the Dutch employing native soldiers from specific tribes is significantly different from, say, the Malay Sultans employing soldiers from other tribes. Insofar as they were paid, there doesn't seem a particularly stronger reason why they should turn on their Dutch employers than they did on the previous native employers .
Comment: This would benefit from the inclusion of some additional sources.
Comment: That's true, although my main objection is to the ? itself, which starts under the burden of a legacy of teaching towards an end in Indonesian education. I had a discussion recently with an Indonesian on their claim that Borneo in its entirety formed a part of Indonesia. They would not yield on what they had been taught, which was that this 'was always part of Indonesia'. Which Indonesia would that be? I do not know, but the cognitive dissonance between Dutch colonizing an 'Indonesia' of disparate cultures and yet the borders of Indonesia necessarily including certain bits of land is obvious.
Comment: There are some sources for specific parts of this, e.g. the 1930 census is available on Delpher.nl https://www.delpher.nl/nl/boeken/view?identifier=MMKIT03:000135211:00059 but there are several volumes. One can see the native, European and 'other Asiatic' populations listed for each area and there is quite a bit of difference depending on e.g. whether there were plantation companies there. And of course the plantation entrepreneurs were often German, American, etc. so a coolie in the Goodyear plantation was 'ruled' by Americans, not really Dutch at all - the plantations were self-sustaining