Fluorescent Light In Garage - Mounting Issues

Question: In our garage, I'm trying to mount a flourencent light fixture that is 4 foot long.  The problem is, I don't know how to mount it.  I'm assuming that I would want to drill the screws into the ceiling joists, however, that's posing to be an issue due to the ceiling joists running horizontal, which is the same way I'm trying to mount the light fixture.  Additionally, I can't exactly run it vertically as the only junction box in the garage is between the garage door opener and the attic door.  Is there another way to be able to mount this thing?
Comment: Why do you think that you can't mount it on that single joist that goes the same direction as the light?
Comment: Oh sorry, I forgot to mention - the junction box is RIGHT next to the joist, so it would have to be angled in order to connect to the ceiling joist.  For EX: you have the ceiling joist, and then right under it, is the junction box, both vertical.
Answer: Are you able in the garage attic?  If so you can use the existing junction box and run a wire from it to a new receptacle box where you need it.  Or two boxes for another receptacle and another light later.  If your garage is unfinished then it will be even easier.  If you cannot get to the attic you can use surface mount raceway.

The raceway comes in 5 foot sticks, and has an adhesive on it's back. You can also get clips to attach it to the ceiling and not worry about the adhesive. It's 2 pieces, front & back.  Boxes, flat elbows, tee's and many more accompanying part are available.
If your box is round you can use this extension box.  They do make these in 1 gang boxes also.  It does not have a back to it so you can put it over the box you have and run the wires through the raceway.

To terminate into the box you might use this if you have a 1/2 knockout.

For all the parts available from the company I picked, click here.
The pros on the raceway is it is not too expensive and easy to use.  The raceway is made by lots of companies so there will be different sizes available.  Different fittings and elbows and terminations should be available and some will interchange with other brands.  It should be easy to find at a big DIY box store.
The cons are that it is surface mount and it will be seen.
Comment: @drewrockshard - I work at an electrical wholesaler, and usually the electricians are told where the customer wants the lights and then the electrician makes it happen.  They buy a lot of toggle bolts for this, mostly 3/16 x 3".  Fixtures probably weigh 1/2(?) as much as they used to because now they use electronic ballast.  If you cant hit a stud, then use togglers.  Don't drill holes in the back of a surface mount fluorescent fixture.  They have 4 feet molded in the metal back to keep the air moving underneath the fixture.
Comment: Thanks for this answer.  Quick side question, what if I were to install some togglers?  Would this be a viable solution also?  I believe the ceiling is drywall.
Comment: Sweet! Just what I thought about doing (the cheap but efficient way).  I just wanted to make sure I would be able to use the togglers on the drywall ceilings.  Thanks for your confirmation.
Answer: I'm assuming your garage ceiling is drywall? Why not get some heavy-duty drywall anchors (toggle-type) and just mount it to ceiling?
A 4ft fluorescent light fixture isn't that heavy, the drywall can easily support it, you don't need to anchor into the ceiling joists.
Comment: Yup I know - that's what I'm doing - see the previous comments on the previous answer.


Allow selection of a subset of user records within a Flow

Question: I am working to build out a small project management type app for our org. We have a "Project__c" object with a "Project_team__c" object which has a child relationship to Project__c.
When a user is added as a project member, and entry is created in the Project_Team object and the Project_Team__c.Member field is set to the new Project Team members UserId. So far adding team members works fine.
We have a separate custom object named "Project_To_Dos__c" which also has a child relationship to Project__c. Within this object the intention is to list high level items which need to be addressed as a part of the project completion, and these individual todays may have tasks, etc. associated with them.
I would like to use a Flow to add Project To Do items to that object, and within that Flow I would like to be able to select a Project Member as the responsible party for a given To Do. However, I am having a hard time wrapping my head around how to best approach this as well as whether what I am trying to do is even possible.
I am finding that you cannot pass a record collection to be used a choice set and have seen some other users suggest Apex for this. However, returning the users via Apex if I'm not mistaken would pass that list back as a record collection which I believe leaves me with the same issue unless I am mistaken. Am I over thinking this? Is anyone able to recommend a better approach?
Answer: For anyone else who is looking for this type of functionality the "Unofficial Lookup Component" found at https://unofficialsf.com/lookup/ worked perfectly to achieve what I need to accomplish here.


Memory for SQL Server 2008 Web

Question: I am going to upgrade the shared hosting of my web site to a VPS mainly because my database is getting too big, > 200mb. The basic VPS plan on CrystalTech where I am hosting has 512mb ram, disk space shouldn't be an issue. If I install SQL Server 2008 Web Edition (which I have license) on here do you think it will slow the server down too much considering the amount of memory available? Has anyone experienced similar setup.
Answer: 512 Megs of RAM isn't a lot any more.  I'd recommend upgrading that to atleast 2 Gigs if you are going to run SQL Server on the server.  The general rule with SQL Server is more RAM is always better (as long as the SQL Server can use that much RAM).
SQL Server will very quickly take all the memory available in the machine, leaving nothing or next to nothing for the web server and the OS.  SQL Server will in order to improve performance cache as much information as possible in memory so that it has to go to the disk as little as possible (no matter what kind of database design you use).  With so little memory available (you'll probably only end up with 100 Megs of RAM if that available for the buffer cache) you won't be able to store much information in RAM, and you'll be hitting the disk all the time looking for data.
Comment: I don't really want to upgrade to 2gb ram yet. I am currently using a $15mth shared host, to upgrade to a $200mth dedicated server just to run a couple of small databases. What about using SQL Express edition?
Comment: SQL Express is the exact same engine as the SQL Server Web Edition.  The only difference is that it supports less RAM, and only a single CPU.  All database platforms will work the same way.  Do they have a shared database server that you can buy space on, and have the database hosted on another server?
Comment: I can get a shared database but there are limits and I would prefer to use the license I already have for SQL rather than pay again.
Comment: There's been a lot of blog posts in the past about putting extra ram in a hosted environment. Short answer is: It's expensive. In fact going to 8gb in a hosted environment is more expensive than building your own server and putting it in co-lo often.
Comment: Usually doing anything in a hosted environment gets pretty expensive quick, anything other than the initial move in anyway.  Once they have you locked in, moving is tough (trust me, I just did it).

You can use the Web Edition that you have now, for a while.  But just keep in mind that you'll need to move the database to another server, or put more RAM in the system pretty quickly.
Answer: The answer is ... It depends.
SQL Server performance is directly related to disk speed and memory.  If you are using SQL Server for a key->value database without complex joins -- 512mb will probably be ok for now (it is the minimum microsoft recommends however).  Its impossible to guess how heavily your database will be used, what your app does, how many users you have, etc.  The memory will almost certainly be a weak point as you try to scale out.
Make sure you have addiquate swap space, and monitor your memory usage.  Good monitoring will give you good metrics on how you need to scale your system, and where, EXACTLY the bottlenecks are as they develop.
Comment: The database design doesn't effect how much memory is used by SQL Server.  JOINs effect CPU usage more than they effect memory usage.
Answer: Best thing to do is try it with all the defaults & see how it goes.
Obviously this isn't recommended & you should be aware of the issues & risks you can run into, but it is possible.  Squeezing sql server into this much RAM isn't going to be fun and will affect performance.
You can tweak the following settings to reduce the memory footprint of sql server:

Restrict the max server memory
to stop sql server using all the
memory on the server for buffer
cache.  I'd start with something
like 200 MB & play from there.
Reduce the number of max worker
threads.  Assuming your running x32
your default is 256.  This will affect the number of threads sql server has available to service requests.

Memory for SQL Server 2008 Web


How to output $variables without loading everything?

Question: I'm trying to debug a drupal 7 site and print_r() the $variables variable, but its HUGE and crashes certain pages when there is alot of data in it. Is there a way to only output the first level of the array without outputting everything inside of it?
Answer: Devel is a great tool for debugging. It comes with krumo() function which works similar to print_r() but doesn't output everything, only up to certain depth (I think 3 or 4 levels).
Comment: i know about devel, but what if I didn't want to use that. how can I do it in pure php? is there a special function for it?
Answer: I faced a similar issue and found a raw solution, not very elegant nor easily usable in all cases, but it might help you:

First use print_r(array_keys($variables)).
Look at the result to locate which keys match your needs.
Then for each one, say $var_x, use print_r($variables[$var_x])
And if it's too heavy again, go to #1 replacing $variables by $variables[$var_x])... and so on!


How can I detect multiple logins into a Django web application from different locations?

Question: I want to only allow one authenticated session at a time for an individual login in my Django application.  So if a user is logged into the webpage on a given IP address, and those same user credentials are used to login from a different IP address I want to do something (either logout the first user or deny access to the second user.)
Answer: Not sure if this is still needed but thought I would share my solution:
1) Install django-tracking (thankyou for that tip Van Gale Google Maps + GeoIP is amazing!)
2) Add this middleware:
from django.contrib.sessions.models import Session
from tracking.models import Visitor
from datetime import datetime

class UserRestrictMiddleware(object):
    """
    Prevents more than one user logging in at once from two different IPs
    """
    def process_request(self, request):
        ip_address = request.META.get('REMOTE_ADDR','')
        try:
            last_login = request.user.last_login
        except:
            last_login = 0
        if unicode(last_login)==unicode(datetime.now())[:19]:
            previous_visitors = Visitor.objects.filter(user=request.user).exclude(ip_address=ip_address)
            for visitor in previous_visitors:
                Session.objects.filter(session_key=visitor.session_key).delete()
                visitor.user = None
                visitor.save()

3) Make sure it goes after the VisitorTrackingMiddleware and you should find previous logins are automatically bumped when someone new logs in :)
Comment: Can we trust django-tracking after all these years of inactivity?
Answer: If you're already using django-tracking as suggested here, there's a much easier way to implement this:
Define a signal handler:
# myapp/signals.py
def kick_my_other_sessions(sender, request=None, user=None, **kwargs):
    from tracking.models import Visitor
    from django.contrib.sessions.models import Session
    keys = [v.session_key for v in Visitor.objects.filter(user=request.user).exclude(session_key=request.session.session_key)]
    Session.objects.filter(session_key__in=keys).delete()

Create a listener for the user_logged_in signal:
# myapp/__init__.py
from myapp.signals import kick_my_other_sessions
from django.contrib.auth.signals import user_logged_in
user_logged_in.connect(kick_my_other_sessions, sender=User)

This will institute a sort of "last user to login wins" system.  If you want to allow multiple logins by the same user from the same ip, you can add an .exclude() to the Visitors lookup.
Comment: It is useful to also set `visitor.user = None` for each of the matched visitors otherwise this code will still find visitors for already deleted sessions on every login. (This matters if you decide to add a message to tell the newly logged in user 'you have just been logged out of another session').
Answer: Django's middleware will probably help you achieve this. The issue is that you will probably want to allow multiple anonymous sessions from the same IP address, even authenticated sessions for different users, but not authenticated sessions for the same user.
You'll want to:

Create a user profile model to store the IP address of a user's last login. See Django's Storing additional information about users documentation.
Implement a custom authentication backend. This backend, when triggered and successfully authenticating a user (just call super) would wipe out the user's last login IP in the profile model.
Implement a subclass of Django's django.contrib.sessions.SessionMiddleware class. Implement process_request. If the request.user object's profile model has no IP address, set it and allow the request. If it has an IP, and the IP is different from the current request's IP (request.META.REMOTE_ADDR), then do whatever you like to either log out the other user, or return an error to the requestor.
Update your settings.py file so that your custom auth backend is processed first, and so that your custom session middleware is also processed first. This involves updating settings.AUTHENTICATION_BACKENDS and settings.MIDDLEWARE_CLASSES.
Comment: If you only restrict by IP, then it's possible that a user would share his/her login within a company, and they'd come from the same source address due to IP masquerading. So for some use-cases this is not strict enough to prevent multi-usages
Answer: You'll need to do this with custom middleware.
In your middleware process_request() method you will have access to the request object so you can do something like the following:
session_key = request.session.session_key
ip_address = request.META.get('REMOTE_ADDR', '')

Now you know the IP address, so check a model you create that (roughly) would look like this:
class SessionIPS(models.Model):
    session = models.ForeignKey(Session)
    IP = models.CharField(max_length=20)

So when a session is created or deleted you will modifiy your session ip's table accordingly, and when a request comes in make sure the IP address isn't being used for another session.  If if is, then return a Http404 (or something like it) from the middleware.
A pluggable app that can show  you a lot more detail (and even includes IP address in its own model) is django-tracking.


Using plus signs in query strings with HTTParty

Question: I'm trying to get this url with HTTparty:
http://collections.museumvictoria.com.au/api/search?hasimages=yes&collectingarea=royal+exhibition+building&page=1
I'm using the query:
items = get("http://collections.museumvictoria.com.au/api/search", query: {has images: "yes", collecting area: "royal+exhibition+building", page: 1})
This returns 0 results however if I just copy and past the url into a browser it does return data. From my other tests it looks as though only collecting areas with plus signs in them fail to return results collectingarea: "arms" works).
Any idea how we should properly encode the plus signs to make this work in HTTParty?
Answer: Use HTTParty version >= v0.13.4 It's encode the query values internally.
However you can Override httparty's query strings normalizer.
Also you need to put underscore between words in query keys like has_images, collecting_area.
I tested this code and it works for me:
require 'httparty'

class Test
    include HTTParty
    def self.test
        puts self.get("http://collections.museumvictoria.com.au/api/search", query: {has_images: "yes", collecting_area: "royal+exhibition+building", page: 1})
    end
end

Test.test


Why adding polynomial terms make linear function non-linear?

Question: I would love to know why polynomial terms could make non-linear functions. From my understanding, it is just about using the current independent variables, so the relationship between $x$ and $y$ should be still linear?
Comment: Perhaps you might find my answer here useful: https://stats.stackexchange.com/questions/470625/what-is-the-difference-between-linear-equation-and-linear-regression/470627#470627
Answer: A function $f: \mathbb{R}^m \rightarrow \mathbb{R}$ is called a linear function if it possesses the following "linearity" properties:
$$\begin{matrix}
f(\mathbf{x}+\mathbf{y}) = f(\mathbf{x}) + f(\mathbf{y})
& & \text{for all } \mathbf{x}, \mathbf{y} \in \mathbb{R}^m, \\[6pt]
f(a\mathbf{x}) = a f(\mathbf{x}) \quad \
& & \quad \quad \quad \ \ \text{for all } \mathbf{x} \in \mathbb{R}^m \text{ and } a \in \mathbb{R}, \\[6pt]
\end{matrix}$$
Now, consider the following polynomial regression function:
$$u(x, \boldsymbol{\beta}) = \beta_0 + \beta_1 x + \beta_2 x^2 + \cdots + \beta_k x^k.$$
If you apply the above definitions you can easily show that $u$ is linear with respect to the parameter vector $\boldsymbol{\beta}$ but not with respect to the value $x$.  (As an exercise, see if you can show that the first linearity equation does not hold for this latter variable.)  Now, in the context of regression models we call the model "linear" if it is linear with respect to the parameters rather than the explanatory variables (see related question here), so we would still call this a linear model.  But this does not change the fact that the regression function is not a linear function of $x$.
Answer: If you are just sticking with your values of $X$ and consider these particular measurements to be your main point of interest, then I see how you can interpret the relationship between $X$ and $Y$ to be linear.
However, most of the times we are interested not in the measurements themselvels, but what they represent.
For example, consider a very simple case of predicting wage with age. We are interested in the relationship between these two variables, and if the relationship would be linear, then the older the person is, the more we would predict that they earn. But even intuitively this is not the case. We would expect the wage to be decreasing with age after some point (for example, after age = 60). That means that, in order to capture this relationship, we can introduce higher degrees of age to the model. Yes, we add more "independent variables" to the model, but the relationship that we are interested in is still between the age and the wage.


How would I calculate the diameter of an dish from antenna gain, or effective aperture?

Question: So far I've calculated the effective aperture using an equation. However I was wondering how to calculate dish diameter using the gain calculated earlier and if there's an equation for this?
Comment: Does this answer help: https://ham.stackexchange.com/a/11669/21417 There is an equation there that includes the diameter of a dish antenna. Though, my understanding is that feed point and shape of the reflector enters into it as well. But maybe [edit] this Question to tell us a little about what you want to do and what research you've done.
Comment: Welcome to Ham.SE! Make sure you take the [tour] if you haven't already to see how SE sites differ from threaded forums.
Answer: If you know effective area, you can calculate the physical area by dividing by efficiency.
Typical efficiency for a dish is about 60%, possibly less at low frequencies (under 1 GHz) or if it's a simple home made feed (yagi or straight waveguide). 70% is achievable with a choke, 80% in very special cases with a lot of optimising.
So $A_{dish} = A_e / 0.6$
From physical area you can work out diameter with $A_{dish}=\frac\pi4 D^2$
Efficiency here is not a true loss of power, it's a measure of how the dish area is not used perfectly. In transmitting, the dish is not illuminated uniformly, so the field is not uniform over the aperture. This is a natural consequence of balancing under-illumination (wasted area on the sides) with over-illumination (wasted power spilling over). The feed has a gradual taper, it can't just stop at the very edge. Also a tapering of the dish illumination gives a cleaner shape beam with lower sidelobes, if this matters to you.


What would be the best word to use for the "specificity" of data points?

Question: I've been stuck for about 20 minutes while working on a reporting application because I can't think of what to call this property. When requesting a report, the user must specify a start date, an end date as well as the "specificity" of the data points, for example "day", "week" etcetera. I have considered calling it "specificity" or "unit size", but I feel that none of those words properly convey the meaning of the property. What word (or words) would best describe the property?
Comment: Are you looking for _precision_? Or _granularity_?
Comment: @BraddSzonye: Precision makes sense! Very good suggestion.
Answer: Precision has two meanings related to data collection:

2 the ability of a measurement to be reproduced consistently
3 (mathematics) the number of significant digits to which a value may be measured reliably

While your usage is not a precise fit for either meaning, it should be intuitive enough for the application's users.
Answer: I'd suggest periodicity
1. The quality or state of being periodic; recurrence at regular intervals.
Another option is to use frequency of data.


How to change the order of the signatures in macOS Preview

Question: I added some signatures in Apple Preview. How can I change the order of the signatures? Rearranging via drag & drop is not working.
Answer: The signatures are stored in the keychain. Open Keychain and find your signatures (just search for 'signature'). They should be called Signature Annotation Privacy.
These signatures are binary .plist files, encoded in base64. In the files there is stored a date and this is the creation date. We can change that date to today and then it will be the first signature show in Preview:

Double click the signature you want to bring to the top in Keychain and click on "Show password" (enter your admin password).
Copy the whole text in the textfield and save it on your Desktop in signature.txt.
Open Terminal and type in: base64 --decode ~/Desktop/signature.txt > ~/Desktop/signature.plist
Convert the signature to xml file with: plutil -convert xml1 ~/Desktop/signature.plist
Open the .plist-file in TextEdit. Search for <key>NS.time</key>.
The time stored here is a time interval since 01.01.2001. So we need to get the actual time interval between 01.01.2001 and today. You can do it in Swift with print(Date().timeIntervalSinceReferenceDate)
Change the date value in the .plist file.
Convert it back to binary with plutil -convert binary1 ~/Desktop/signature.plist
Encode it to base64: base64 ~/Desktop/signature.plist > newSignature.txt
Take the new base64 string and save it to the Keychain.
Comment: at some point base64 requires '-i' flag to read input file. Besides this, works flawlessly, thank you very much for sharing!


What happens to expired items on announcement list on sharepoint?

Question: What happens to expired items on announcement list on sharepoint?
Can i get all items include the expired items?
Answer: Nothing happens to them as such - they are just filtered out of the display using a View with a Filter.
This is the filter used :-

You get to it by

Edit Web Part
Edit the current view
Comment: Hi , there is no filter on  the default view ( allItems ) , there is any work around that i need to do to see those items ?
Comment: There is no filter on the default view and that is why you can actually SEE the expired items - have you looked? The web part you see on the home page doesn't use that. It uses a filter of Expires =  OR Expires >= TODAY.
Answer: Problem is even if you modify the current view, expired list hides for my account. But say in an organisation where there are too many user where i need to make this view similar to what i see in my local administrator account.
At the moment i can able to hid the expired list under my administrator account but if i log in to normal account user i can still see the expired lists.
Since if thats the case ic ant go and ask all the users do the same
Answer: I changed the drop down option from Expires (indexed) to Expiration Date and assigned the formula it seems to be working for all users. Not sure what the difference though.
More over also noticed that i need to publish even after applying and click OK to that current view which is bit inconsistent in SharePoint where in some places you don't have to do this.


Where is the Runeguard for the Defiant faction in RIFT?

Question: Where is the Runeguard for the Defiant faction in RIFT?  The current world event requires me to find them, but doesn't exactly state where.
Answer: The runeguard for the Defiant faction is located in the Gardens of Meridian. Coming in from the entrance make a right at the mounts and head all the way to the far end. He is down there.
Answer: TBH i'm not sure because i stopped playing Rift but probable you mean the Runeguard faction:

The Runeguard are the dwarves that stayed behind to defend and free
their homeland of Moonshade Highlands. While individuals may have
feelings for the gods, or not, as a group they owe allegiance only to
the true King of Hammerknell.
Quartermaster Balint located at 6300,1600 in Moonshade Highlands

Source: The Runeguard (Rift Faction)


Fast filtering of a string collection by substring?

Question: Do you know of a method for quickly filtering a list of strings to obtain the subset that contain a specified string? The obvious implementation is to just iterate through the list, checking each string for whether it contains the search string. Is there a way to index the string list so that the search can be done faster?
Answer: Wikipedia article lists a few ways to index substrings.  You've got:

Suffix tree
Suffix array
N-gram index, an inverted file for all N-grams of the text
Compressed suffix array1
FM-index
LZ-index
Answer: Yes, you could for example create an index for all character combinations in the strings. A string like "hello" would be added in the indexes for "he", "el", "ll" and "lo". To search for the string "hell" you would get the index of all strings that exist in all of the "he", "el" and "ll" indexes, then loop through those to check for the actual content in the strings.
Comment: Ah, this seems to be an inverted index of all bigrams (n-gram, where n = 2).
Comment: Of course, it depends on the data as to how effective this will actually be at optimizing things.
Comment: What is this algorithm called?  I implemented this recently and it was fairly straight-forward and resulted in a significant speed improvement for my specific use case.
Answer: If you can preprocess the collection then you can do a lot of different things.
For example, you could build a trie including all your strings' suffixes, then use that to do very fast matching.
Answer: If you're going to be repeatedly searching the same text, then a suffix tree is probably worthwhile. If carefully applied, you can achieve linear time processing for most string problems. If not, then in practice you won't be able to do much better than Rabin-Karp, which is based on hashing, and is linear in expected time.
There are many freely available implementations of suffix trees. See for example, this C implementation, or for Java, check out the Biojava framework.
Answer: Not really anything that's viable, no, unless you have additional a priori knowledge of your data and/or search term - for instance, if you're only searching for matches at the beginning of your strings, then you could sort the strings and only look at the ones within the bounds of your search term (or even store them in a binary tree and only look at the branches that could possibly match). Likewise, if your potential search terms are limited, you could run all the possible searchs against a string when it's initially input and then just store a table of which terms match and which don't.
Aside from that kind of thing, just iterating through is basically it.
Answer: That depends on if the substring is at the beginning of the string or can be anywhere in the string.
If it's anywhere then you pretty much need to iterate over the entire list unless your list is so large and the query happens sufficiently often that it's worth building a more sophisticated indexing solution.
If the substring is at the beginning of the string then it's easy. Sort the list, find the start/end by biseciton search and take that subset.


Error while running 'Authorize an org'- command VS code (mac)

Question:
installed Vs code in mac
installed java 11
installed salesforce cli
installed salesforce extension pack

ran the command "create project with Manifest' -- successfully ran.
ran the command 'Authorized an org'
getting this error:
Starting SFDX: Authorize an Org
20:43:45.24 sfdx org:login:web --alias triggerpractice --instance-url https://login.salesforce.com --set-default
Warning: Ignoring extra certs from null, load failed: error:80000002:system library::No such file or directory
›   Warning: org login web is not a sf command.
Did you mean env log? [y/n]:
›   Error: Run sf help org for a list of available commands.
20:43:56.271 sfdx org:login:web --alias triggerpractice --instance-url https://login.salesforce.com --set-default
ended with exit code 127
what I have tried:
in the terminal ran these commands
sfdx plugin:install @firstname.lastname@example.com

but not working.
can you tell me, if I have to set the path for 'sfdx cli' in mac; if yes, please tell me how to do it.
Answer: I reinstalled the CLI and it worked


Earthquake database for fault

Question: I am trying to understand Deterministic Seismic Hazard analysis for which I believe seismic waves corresponding to a seismic sources (such as faults) are required to prepare the Gutenberg Richter curve and select an appropriate earthquake corresponding to a particular return period. However I do not know from where I can obtain the seismic data?
Comment: If you do not get an answer here, you can try at [OpenData.se] (But do not post on both sites at the same time, [crossposting across SE sites is discouraged](https://meta.stackexchange.com/questions/64068/is-cross-posting-a-question-on-multiple-stack-exchange-sites-permitted-if-the-qu))
Answer: Perhaps the Global Significant Earthquake Database request form from NOAA would help?
Comment: Also:

http://www.opendtect.org/osr/ and http://ds.iris.edu/data/sources.htm
Answer: I am interested in the same topic. Recently, research on the determinism behind earthquake triggering has been revived based on these studies from last year:

Ide, Satoshi, Suguru Yabe, and Yoshiyuki Tanaka. "Earthquake potential revealed by tidal influence on earthquake size-frequency statistics." Nature Geoscience 9.11 (2016): 834-837.
van der Elst, Nicholas J., et al. "Fortnightly modulation of San Andreas tremor and low-frequency earthquakes." Proceedings of the National Academy of Sciences (2016): 201524316.
Delorey, Andrew A., Nicholas J. van der Elst, and Paul A. Johnson. "Tidal triggering of earthquakes suggests poroelastic behavior on the San Andreas Fault." Earth and Planetary Science Letters 460 (2017): 164-170.

A few years before these results were published, another seismologist did an extensive evaluation:

"Characteristics of the earthquake-triggering pattern by Earth tides were studied utilizing over five hundred thousand events from an earthquake catalogue (NEIC-USGS) for global earthquakes with a magnitude range of 2 to 10."  -- Vinayak G. Kolvankar, "Sun, Moon and Earthquakes", New Concepts in Global Tectonics Newsletter, no. 60, September, 2011.

He was able to find correlations such as this:

So the best bet is to look at the NEIC-USGS database.   You should be able to cull from quite a few events across the intensity spectrum.

Earthquake database for fault


Can an imbalanced data set cause decision tree not to split?

Question: If I have an imbalanced response variable 80% majority, 20% minority, and my decision tree is not finding any splits. Could this potentially be because of the imbalance in my response?
Comment: 80:20 is not extreme imbalance. You might have chosen the hyperparameters unwisely, or no feature is informative for discriminating between the classes, or you have a bug somewhere. It would help to provide details.
Comment: What do you mean by "not finding any splits"?
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Answer: Yes, I suspect that is the case, but it could also be true for datasets without an imbalance, but it seems to me to be more likely with an imbalance.
If you are using an algorithm such as CHAID, it will perform a statistical significance test for each split and if the reduction in the cost function does not reach statistical significance.  If you are using an algorithm with reduced error pruning, it may initially find splits, only to have them pruned back because they don't reduce the error on a validation set.
In both cases, if there is an imbalance, weakly informative features are likely to split out only a small number of positive examples in the training data, which makes the split less likely to be statistically significant, and more likely to be over-fitting the noise in the dataset and not generalise (and hence be pruned back).
However, this problem will go away (as will most estimation problems) if you add more and more data (with the same class ratio), so it is not the imbalance per se that is causing the problem, but having too few minority class examples.


30°F / -1°C sleeping bag vs a 50°F / 10°C sleeping bag whilst wearing layers

Question: I'll be doing a multi day hiking and backpacking trip in a few weeks with a company that recommends that participants have a 30°F (-1°C) sleeping bag. I'm wondering if a 50°F (10°C) sleeping bag could work provided I wear some layers.
Comment: have they told you what temperatures to expect? Maybe they are planning that the 30 bag will work as long as you layer up...
Comment: There is a lot the OP has not told us, but a 50 degree F bag is  sufficient  only for very mild weather.    Bear in mind that you will not be doing anything energetic to warm you up while you are lying there -- except shivering.  Being cold at night for multiple nights is utter misery.    As for the layers, you will need a warm parka and warm fleecy pants to even begin to make up the difference between a 30 degree bag and a 50 degree bag.
Comment: And there is so much variance in what a 30F bag does for you in the first place. What temperatures have you used your 50F bag in, and how comfortable were you? Personally, I'd rather have a warmer bag than needed rather than hope whatever clothes I have will keep me warm.
Comment: If you are not sure, you should try to follow the recommendation of the guide. Or, if you have more details (like where, when, what conditions you expect, what sort of tent and mattress you'll be using, ...) maybe someone can give you a second opinion on the temperature rating of the bag.
Comment: Personal experience:  camping, one night, in Hawaii, with a 50°F sleeping bag purchased locally.  Miserable, miserable experience and I had all my clothes available in the car to put on.  (it *was* 30°-ish at 6000' in Haleakalā National Park, there was frost on the ground in the morning ;-).
Answer: I would go with the bag they recommend. It's much easier to cool down than to warm up.
You state a "multi day hiking and backpacking trip". I have been caught out with an inadequate bag, and for a single night it was manageable, but I was able to change my plans.
What will you do after the first possibly miserable and sleepless night? All you will have is what you carry.
Comment: In general yes but I would also look at the expected temperaturs during your hike, just to check that the recommendation is reasonable for the specific trip at the time of year OP plans to make. Maybe the organizer were lazy and just have a single recommendation for the entire year which would be way to warm for large parts of the year.
Comment: @quarague you would need to look at the expected elevation and wind exposure too. Temperature falls with height, and wind generally increases.
Answer: It may not be enough, but sometimes you can add a sleeping bag liner or a bivy to enhance the insulation and humidity and wind resistance of your sleeping bag.
Liners can be made of cotton, silk or polyester fibers, and can come in handy for sleeping in hostels or huts.
Comment: I don't know why this is downvoted.  This answer is correct and useful.
Comment: @gerrit Sleeping bag liners do not add much warmth at all, nowhere close to 20 degrees. A bivvy sack is similar to just carrying a second sleeping bag. So to make up the 20 degree difference with this strategy would require some bulky and heavy items compared to just carrying a warmer sleeping bag.
Comment: @usul they help, but not by 20 degrees, no.  Certainly, OP should follow the advice from the organisers.
Comment: @usul it's not 20 degrees, just 9 :) Jokes aside, I agree it's not enough for the specific case, but sometimes it can be enough to justify the saving, especially compared with just wearing more layers
Answer: If you are either going alone and can easily go back, or have enough time to collect e.g. leaves to bolster insulation, you can give the lighter bag a try. Then it's your decision.
If you will be traveling with a group, please don't start with disregarding explicit safety advice given by the organizer yet. Being not properly rested or unable to function (e.g. in aptly handling a belay device) puts a lot of unnecessary strain on the group, might be an impediment in reaching an intermediate target, or even endanger others. So this might be a bad idea.
If you have good reason to make do with the lighter bag (e.g. weight considerations, or maybe the cost of buying a new sleeping bag), you should ask the organizer. Be open with them. In any case, please don't silently disregard their advice. They should have a very clear idea of what temperature to expect in average and outlier years, and what safety margin is acceptable.
Answer: Summary

Layering clothes to "boost" the sleeping bag about 11 °C is unpractical: too heavy and too bulky, and likely won't fit into the sleeping bag.

A 2nd summer sleeping bag to layer/combine with your sleeping bag may be an option, though.
That's also heavier and bulkier than going with one thicker sleeping bag, but can be much cheaper. Particularly, if you can borrow the additional sleeping bag. Make sure it is large enough.

Long version
Sleeping bag temperature ratings (according to ISO EN 23537) already assume that you wear a base layer of thermo underwear. AFAIK, it will also assume that you close the hood except for a little breathing hole. Then, at

comfort temperature: a standard female can sleep comfortably in relaxed position.

lower limit temperature: a standard male can (just still) sleep, but already needs to take a curled up position to avoid waking up because of feeling cold. I don't know whether this also assumes breathing into the sleeping bag hood - which IMHO in practice creates nothing but misery due to moisture.
Side note: if you cannot curl up inside, or your sleeping bag has less insulation at the back (quite common), don't expect to sleep at that temperature.
Unless you are substantially more muscular than the standard man (or know that you react to outdoor activity plus good feeding in the evening by being very warm during the night), it is not a good idea to consider lower limit rating other than telling you that there's bit of margin for temperatures getting lower than expected without endangering the rest of the tour.

Back of the envelope calculations
for the additional layer(s):

Skin temperature during sleep ≈ 33 °C (Kräuchi et al: Circadian and homeostatic regulation of core body temperature and alertness in humans: what is the role of melatonin? In: Circadian Clocks and Entrainment. Volume 7 (pp.131-146, 1998)
(We have lower core body temp, but higher skin temp when sleeping compared to being awake. Or maybe rather: we need higher skip temp in order to sleep.)

FWIW, the warmest thermo underwear I have (270 g/m2 fleece), for me makes a difference of maybe 4 °C at rest. I think it's similar to the effect of a thick fleece pullover + pants.

The 10 °C sleeping bag thus covers a temperature difference of ≈19 °C.

Another 11 °C are needed, plus a bit of margin because you'll loose more heat through breathing at -1 °C than at 10 °C.

Extrapolating from my X-warm thermo underwear, you'd need to layer up like Michelin Man, and that also corresponds to my experience of how much stuff I wear when sitting in camp in the evening at temperatures where I'd barely wear long sleeves when active during the day (e.g. sitting comfortably at slightly below 0 °C: in downhill ski suit).
In general, sufficient additional clothing layers are much heavier than additional sleeping bag insulation.

If you go for layers, I'd recommend to test your plan. I currently have night temp around 0°C, so perfect test conditions. If you don't, you may be able to approximate it by sleeping in a room with, say, 15 °C in your layers but without the slightest covering. (I added a safety margin of 3 °C for breathing cold air and uncertainty about the thermo underwear).

If that suggestion sounds crazy and miserable: that's the level of misery to expect when planning to sleep in a +10 °C sleeping bag at -1 °C...

very rough guesstimate from the specified differences of a series of sleeping bags vs. temperature rating suggests that maybe 6 cm additional loft between you and the outdoors is needed to go from +10 °C to -1 °C.
However, you can also layer up sleeping bags (obviously, the outer one needs to be larger so the inner one doesn't get compressed). A 2nd summer bag would do here.
When I went winter camping long ago with university sports, an additional large summer sleeping bag was lent out to those who didn't have a suitable sleeping bag. We stayed in quincies, so temperature was approx. 0 °C, and that combo worked well.


HTC desire bravo sim card is always ejecting

Question: I have to hold the card in place while using the phone otherwise it pushes itself out. When troubleshooting the problem, being as gentle as possible by the way, it clicks into place but doesn't catch and is pushed out by the spring lock.
Answer: Sounds like the micro SD card slot is physically broken on your phone. You need to take it to a technician to fix it, or return it if it's new or still under warranty.


How to set up equal height columns with a title on top?

Question: This is what I'm trying to do on Pages '09: two equal height columns with a title on top. Any suggestions?
Answer: I just got it to work — inserted a layout break after my headline and set it up as a one-column layout and the rest of the content as a two-column layout. Applied some padding to it and it's perfect.
Answer: I don't have access to Pages at the moment (I'm on an old Macbook on a travel) but a quick fix to your problem would be to set up a text box on top that doesn't allow text to be under it and expand it to cover both columns.
With that said, I'm sure there's a way to set up the columns to behave like that in a more "correct" way, but you'll have to wait until tuesday for me to get back, been offline for almost 30 days and I haven't touched Pages in a while :)
Comment: That would also work, though I don't seem as an appropriate semantic solution to use on a big fat imortant document, as a masters thesis. A good solution, though ;)
Answer: page layout- page breaks- continues


What does the Local exactly mean in CVSS?

Question: CVSS (http://www.first.org/cvss/) provides the keyword local in the base vector.
The definition given by FIRST is somehow not so clear for me: Local: Exploiting the vulnerability requires either physical access to the target or a local (shell) account on the target.
Can anyone provide me with clear definition for it? I mean is it localhost? is it desktop application that are not available through HTTP?
Answer: Simply put a local vulnerability means the attacker has prior access to the target.
That may mean already having an account on the machine. With an account already on the machine an attacker could raise their level of privileges with an exploit.
A good example of this being the latest Linux kernel exploit CVE-2010-3081. The exploit allows for a local, unprivileged user to escalate their privileges to that of root.
Comment: Does local here means in my Local Area Network or physically Local on the machine?
Comment: Physical Local on the machine or via SSH to the machine.


Is it possible that IPv6 multicast address is shown in the "IPv6 Address" column of the "show ipv6 neighbors" command in Junos?

Question: Is it possible that IPv6 multicast address(i.e address from ff00::/8 address block) is shown in the "IPv6 Address" column of the "show ipv6 neighbors" command in Junos?
Comment: Multicast is not assigned to any particular host, so it should not be an IPv6 neighbor. Multicast addresses are destination addresses, not source addresses. Hosts subscribe to listen to traffic sent to a multicast group, but they do not send packets with source multicast addresses.
Comment: @RonMaupin Thanks! That's what I thought as well. Could you please mark your comment as an answer so that I can accept this.
Comment: OK, I did that.
Answer: Multicast is not assigned to any particular host, so it should not be an IPv6 neighbor. Multicast addresses are destination addresses, not source addresses. Hosts subscribe to listen to traffic sent to a multicast group, but they do not send packets with source multicast addresses.


Is it possible to copy U1 files between two PCs locally when an Ubuntu user account is recreated?

Question: I have 2 Ubuntu 11.04 PCs (desktop and laptop), both synced via U1. Recently I completely rebuilt the user account (completely deleted the home directory) on one of the two (the desktop), and now I have to resync. Problem is that the PC is on a slow connection and I have difficulties resyncing the 14gb of data. Of course I have the opportunity of moving it to a place where the connection is faster, but it's not comfortable, and it will take some time. Since the laptop is in sync with the account I was wondering if stopping the service and copying the files + some database (which files is the question) could let me avoid resyncing everything.....
Answer: Yes, simply copy all of your laptop's files to an external flash/hard drive, then mount it on your desktop and transfer the data over that way. It is much faster, but then I'm not sure whether you would have such a drive handy.
Comment: This is exactly the way to do it. I do this even with a good connection. Backup machine 1's U1 files, copy them over to machine 2, then sign in to U1 on machine 2. By far the fastest solution.
Answer: You could give this a try.
Comment: Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference.


Never understood the concept of the p-value, it should be higher than 0.05

Question: In multiple places, p-value is defined as something that quantifies the probability of obtaining test results at least as extreme as the result actually observed, under the assumption that the null hypothesis is correct. A p-value < 0.05 is usually considered in favour of the alternate hypothesis.
If I understand correctly 'more extreme' are results in favour of the null hypothesis, because then a high p-value is in favour of it.
My actual question is that, I  feel a p-value of 0.05 is way too low to reject the null hypothesis. To have conclusive favour in support of the null hypothesis, it should be more than that.. maybe 0.7 or 0.9? Perhaps I don't understand the p-value well enough intuitively. Any help would be appreciated.
Thanks.
Comment: Welcome to Cross Validated! Could you please elaborate on why you think $0.7$ or $0.9$ would be better than $0.05?$
Comment: It sounds like you need a clear beginner's guide to p-values and their roles in inference. Can I recommend my own? https://link.springer.com/chapter/10.1007/164_2019_286
Comment: You either *accept* the alternative hypothesis or you *keep* your null hypothesis (but you do not accept it).
Comment: Please check this [wonderful answer](https://stats.stackexchange.com/questions/31/what-is-the-meaning-of-p-values-and-t-values-in-statistical-tests/130772#130772) to the question 'What is the meaning of p values and t values in statistical tests?'.
Answer: 'More extreme results are in favor of the null hypothesis' --> This is not true!
The point of the p-value is to quantify how extreme your observation is if you assume the null hypothesis to be true. Assume you have a null hypothesis that states that some mean is equal to 3 and the alternative hypothesis states it is larger than 3. You now collect data and build a test statistic and calculate a p-value. If you have a mean in your sample that is close to 3, the p-value is going to say that it is quite normal to find a sample that has a mean that is at least as extreme as the one you have. And thus the null hypothesis seems plausible (note: you NEVER accept it!).
However, if you have a sample with mean equal to 5, the p-value will be very low since, assuming the true mean is 3 (your null hypothesis), it will be very unlikely to find a sample with a mean at least equal to 5. A low p-value (let's say 0.01) will then tell you: there is 1% that your results will occur when the null hypothesis is actually true. So this is good evidence to say that the null hypothesis might not be true at all (Note again: you also don't accept the alternative since you can never know 100% sure it is true, here it is still 1% possible that you found this extreme result due to luck and that the null hypothesis is still true).
I hope this clarifies that extreme results do not favor the null hypothesis since they are exactly the prove against it that you need.
If you would set the significance level equal to 0.9 as you say for example (so you reject the null hypothesis for all p-values lower than 0.9), you are going to make a lot of wrong conclusions since a p-value of 0.85 says that there is 85% probability to find a result like you did under the null hypothesis (so it is very common to find it and really gives no strong evidence against the null hypothesis), but since it is below your significance level of 0.9, you would still reject the null hypothesis based on this result and probably make a type I error.
Note that also your significance level is in fact your type I error probability, so controlling it on 90% means that you still allow results that have 90% chance to be a type I error.
In conclusion: you really want a low p-value to avoid type I errors as much as possible.
Comment: I mostly agree, but see my answer. Sometimes type 2 error is much worse than type 1.
Comment: Certainly! I focussed here on the type I error since it seems that the OP was strangled with the basic concepts, but sure, it is equally important to be aware of trade-off between the type 1 and type 2 errors and their uses/(dis)advantages
Answer: You wrote:

If I understand correctly 'more extreme' are results in favour of the
null hypothesis, because then a high p-value is in favour of it.

this is just the opposite of the case. More extreme result give a lower p. Let's demonstrate:
set.seed(1234)

x1 <- rnorm(100, 1, 5) #Random normal, mean 1, sd 5
x2 <- rnorm(100, 5, 5)  #Random normal, mean 5, sd 5

t.test(x1) #p = .67
t.test(x2) #p = 0.0000000000000002

Of course, p is also affected by sample size, and the effect size is affected not just by the difference from 0, but by the sd.
However, you are on to something when you complain about p < 0.05 being so generally accepted. If you lower the threshold for p, you decrease the type 1 error rate, but you increase the type 2 error rate. Often we accept power of 0.8, which is \beta of 0.2 implying that type 2 errors are four times worse than type 1 errors. This may be reasonable, or it may be nonsensical.  Suppose, for example, that you have come up with a new treatment for a terminal disease that has no known treatments. Then a type 1 error means you give an ineffective treatment to someone who is dying, while a type 2 error means you fail to cure people.
Even Ronald Fisher once said that researchers should vary the threshold to suit the case, but, while I remember reading this, I cannot find the citation.
However, a threshold of 0.9 seems preposterous; it's hard to think of a case where that could be useful.
Comment: Nice answer (+1), Peter. Out of curiosity, what was the statement sort of like that you attributed to Fisher? I would love to dig in some sources, if you can frame the statement.
Comment: Peter, I asked a question at hsm to which I got a comprehensive answer. I think you would find it interesting: [Did Ronald Fisher ever say anything on varying the threshold of significance level?](https://hsm.stackexchange.com/questions/16236/did-ronald-fisher-ever-say-anything-on-varying-the-threshold-of-significance-lev)
Comment: Thanks @User1865345.  That looks like an interesting site!
Comment: @User1865345 It was something like "no sane researcher uses the same significance level in all cases."
Comment: Thanks, Peter. That's a reasonable statement.
Comment: Yes, Peter, hsm is indeed a wonderful place!
Answer: Sometimes it is easier to look at a visual representation to better understand the as extreme or more part of the definition of the p-value, or the p-value itself.
Suppose you repeat an experiment over and over again under the exact same conditions. You measure 10 samples and calculate the sample means, standard errors, and t-statistics for each experiment. The t-statistic in its simplest form is just the difference of the sample mean and some hypothesized parameter value (let's just for simplicity say it's zero) divided by the standard error of the mean of the respective sample:
$$t=\frac{\bar{x}-\mu_{0}}{s/\sqrt{n}}$$
Then you plot the t-statistics in a histogram or density plot (see purple line in the plot below). This distribution is also known as a sampling distribution, which fully characterizes your experiments with respect to the underlying unknown parameter. The sampling distribution will eventually converge to Student's t-distribution whose area under the curve will sum up to 1 (shaded blue and red areas in the plot below).

Now let's forget about the sampling distribution, which we never directly observe anyway, and instead focus on Student's t-distribution which serves as a very good approximation of the sampling distribution (provided the assumption of independent and random sampling has been satisfied). The shape of the distribution only depends on the degrees of freedom of your sample ($n-1$). Now you can ask for example which values will I observe on average 95% of the time given this experiment. This would be the blue-shaded area and all values that fall within this area would be in agreement with the null hypothesis that those values were generated from the same data generating process (experimental condition). But we still have to account for the remaining 5% under the curve. We can shove those into the tails, i.e. 2.5% left and 2.5% right, which are the red-shaded areas. Any values that would fall into those extremes (extreme in the sense of far away from the mean of the distribution), would not be in agreement with the null hypothesis and we would reject the null hypothesis, meaning that we believe that those values have likely originated from a different experimental population. This would be a significant result and the probability of observing these values is 0.05 or smaller than that. Remember areas under the curves represent probabilities, so if you fall into the red extremes, the area is small and hence the probability or p-value is small.
From that you can also see that the p-value is always a probability statment about the observed data and not a probability about the null or alternative hypothesis being true. A small p-value indicates that the observed data is unlikely (but not improbable) under the null hypothesis provided the null hypothesis is true.
Here's the code I used, just in case you were wondering. You can change those values and play around with it. Simulation is very helpful in understanding these concepts.
# required package
library(tidyverse)

# create a simulation function for 95% confidence intervals and p-values
simulation <- function(n, mu, stdev) {
  s <- rnorm(n, mu, stdev)
  tibble(
    N = length(s),
    sample_mean = mean(s),
    sample_sd = sd(s),
    sample_se = sample_sd / sqrt(N),
    confint_95 = sample_se * qt(0.975, N - 1),
    t_statistic = (sample_mean - mu) / sample_se,
    p_value = (1 - pt(abs(t_statistic), N - 1)) * 2
  )
}

# specify parameters and sample size for each draw or experiment
n <- 10 # sample size
mu <- 0 # population mean
stdev <- 5 # population standard deviation

############ SIMULATION ##############

# choose number of repetitions
sim <- 1:1000

# rerun experiment under exact same conditions
map(sim, ~ simulation(n, mu, stdev)) %>%
  bind_rows() %>%
  mutate(experiment_id = 1:length(sim)) -> draws

ggplot(data = draws_colored, aes(x = t_statistic)) +
  geom_area(fun = dt, args = list(df = n-1), stat = "function", fill = "red") +
  geom_area(fun = dt, args = list(df = n-1), stat = "function", fill = "steelblue", xlim = c(qt(p = 0.025, df = n-1), qt(p = 0.975, df = n-1))) +
  stat_function(fun = dt, args = list(df = n-1), color = "steelblue", linewidth = 1) +
  geom_density(color = "purple", linewidth = 1.5) +
  scale_x_continuous(limits = c(-5,5)) +
  labs(x = "t-values", y = "Probability density", title = paste("t-distribution with",n-1,"degrees of freedom"))


Are (some) compliments in the comments suppressed by moderators?

Question: In a comment to my question, user surfasb made a flattering remark.
It has just been deleted, a few minutes ago. Did a moderator erase it? I don't think the compliment was deserved ("best question in a year"),  but since I know that, for example, addressing users as "dear XXX" is frowned upon and edited away, I am curious about the origin of this suppression .
Answer: I deleted that particular comment because it was simply noise and brought nothing to the table. We don't mind comments such as <code>+1 for research</code> because that explains why the question is good, but

OMG, best qestion [sic] THIS YEAR!!!!

is not a constructive comment. In addition, the caps, multiple exclamation marks, and misspelling of question didn't help.
Comment: @georges On SE, a good question is upvoted. 13 users, including me, agreed that your question is good and interesting—I'm not trying to censor "that's a good question" views here. Looking at the comment specifically, I'm going to break the comment down: (1) OMG (2) best qestion (3) THIS YEAR!!! #2 translates to an upvote, #1 and 3 are pointless. In addition, I deleted the comment without acknowledge because a comment "Please note that your comment was deleted because it was noisy" doesn't improve the comment thread. I would be happy to ask another mod to review this deletion if you would like.
Comment: I beg to differ: I think that it is extremely interesting and constructive that a user judges that an apparently flippant question can have real linguistic content.Your deleting a comment without acknowledgment and your decreeing that it is "noise"and "not constructive" is not very convincing nor very polite to *surfasb* .
Comment: @jasper The difference is that the comment originally discussed essentially translates to an upvote, so I don't see how the actual comment text itself contributes. And per [general SE policy](http://meta.stackexchange.com/questions/22272/what-can-we-do-about-the-jon-skeet-jokes-and-other-spam-in-comments), comments are allowed to have jokes. I see no reason to override this policy for English.SE specifically, so I'm fine with those comments.
Comment: OMG, best anser of THIS YEAR!!!! (but to nit-pick: slapping [+/-]1 in front of a comment is pretty much noise too - if you can write a constructive compliment *without it*, please do)
Comment: @jasper I've just taken a quick glance through heavily commented posts and found nothing that I would consider as noisy. Perhaps a few examples? (I promise not to delete them before discussing them)
Comment: @waiwai. Your proposition to ask another moderator to review the deletion shows a sense of  fair play that I appreciate, but this is not necessary, thank you. Actually, it was only with your judgment on the quality of *surfasb*'s comment  that I disagreed and I was definitely not pleading for a reversal of the deletion. Anyway, you have answered my question, stated your point of view and I think we can live in good intelligence despite our little disagreement.Ah, and thanks for the upvote!
Comment: Thank you  (and all the others) for the upvote, Jasper.
Answer: Network policy on comments has always been that there has to at least be some bare minimum contributatory (contributionary? contributing?) nature to it. That's why they have a reputation requirement:

So by the time they earn 50 rep, they should have learned roughly how things work, and be in a position to offer a useful comment and not a "+1 AWESOME ANSWER" sort of comment. - Jeff Atwood

An earlier discussion on Meta Stack Overflow, less about deletions but more about good comments, sheds some light into this particular scenario. I won't point at any particular answer in that thread, but rather, the general sentiment expressed in nigh every answer.
Support is good. I think everyone appreciates being told that their question or answer is helpful, that someone is finding their content meaningful in some fashion. But we have a resource to perform exactly that - upvotes, which are possible long before you gain the privilege to post comments on the vast majority of the site (and on anyone else's questions, for that matter). They indicate to the author of the post, that a user has found their stuff useful (and in the context of the site, they give a little more bonus to the user in the form of reputation).
Usually, these kind of comments get flags on other sites, if it states nothing more than a rough equivalent to "I love this answer!". Had it a smidgen of maybe a "why" or something else to add, even if just to get a wry giggle, then I don't think it would've been struck so fast.
I hope it's understood that in general network policies, this kind of deletion is not about censoring courtesy or silencing compliments as much as it is just removing something that can be considered redundant and non-contributing.
Comment: *contributory* is a word, but not exactly what you want it to mean.


See the items in a chest

Question: I want to make a command that check how many and what type of items are in a chest and then it will give 12 end portal frames to the nearest player.
I have tried with redstone but it is too big.
The idea is that the player comes to the chest and put in some specific items in a specific order (see image below).
It will then empty the chest give the 12 end portal frames to the player.
This is for a chunk challenge map.
Comment: 1 last thing that i forgot i will still continue to making my map and if i don't find a way to add this chest i just add a new chunk with the ende portal and tell the player where it is but i think that the way with the chest is more challenging for the player
Answer: You can use /testforblock:
/testforblock X Y Z chest -1 <blockdata>

Is something you'll probably understand, depending on your command block experience. If you don't:
X Y Z should be replaced with the coordinates of the chest. "chest" means the command block only returns a success when it's a chest. -1 means it can be any data value, in a chest's case this means any rotation.
Now for the harder part, you should add the blockdata testing:
/testforblock X Y Z chest -1 {Items:[{Slot:*ID*,id:*ID*,Count:1}]}

The slot IDs are numbered from left to right, top to bottom, starting with 0. This means the top left is 0, top right is 8, bottom right is 26.
Item IDs can be found by pressing F3 and H at the same time (which reveals advanced tooltips) and hovering over the item in your inventory. An emerald, for example, would be "minecraft:emerald".
The count part can be anything you like, although I think you'll want it to stay at 1.
And then there's one last thing to do: add a comparator running out of the command block, into a command block that replaces the chest with an empty one, and one that gives the nearest player the frames.
To make filling in the blockdata easier, I recommend this. Just select the /blockdata command, fill in all the slots, then copy the part between curly brackets into your /testforblock command.
Answer: ok first one thanks for the help and second i made the command that will empty the chest but i have problems with the command that will check when the item is in the chest here is 2 pictures with what i did http://prnt.sc/d5vrq7 -  http://prnt.sc/d5vryv  both the repeating command blocks have this command /testforblock -1402 51 -895 chest -1 {Items:[{Slot:0,id:emerald,Count:1}]} which theoretically it will chek the chest for the emerald and both the chain and impulse command block have this command /blockdata -1402 51 -895 {Items:[{Slot:0,id:air,Count:1}]} which it will replace the chest with air this command works but for some reason the /testforblock command dosn't activate i can't make it work with the comparator so i used a chain command block but nothing and all the command blocks are in always active mode exept impulse command block
Comment: The only issue I can think of here is not setting the command blocks to always active...
Comment: well all of them are in always active maybe it's a letter that i miss and didn't work anyway since i could made this iv made a villager that trade the 12 frames thanks anyway

See the items in a chest


Correlations between two questionnaires that have different scoring scale

Question: For example, questionnaire 1 has 20 items scored from 1-5, questionnaire 2 have 10 items, and it is a True/False scale (so the final score is like true =1, false =0, and add them up), can I still do a Pearson correlation between them? If I had to standardize the score, how should I standardize them? just merely averaging everything?
Answer: The fact some of your items contain different ranges of numeric values (i.e., [1,5] for 18 of your items & [0,1] for your two T/F items) is not problematic. For example, in past work, I would often estimate the correlation between salary and years of experience, which do not have the same range (e.g., [0-50] for years of experience and [30,000, 750,000] for salary). The issue is that your items are categorical. Specifically, your T/F items are dichotomous, and your other 18 items are ordinal. Pearson's correlation is a measure of linear association between two continuous variables. As the number of response options goes to infinity, this will typically be less problematic; however, because two of your items are dichotomous, I would suggest you consider alternative measures of linear association. Given this, the spearman's rank correlation and/or tetrachoric/polychoric correlation may be viable alternatives.
Comment: Got it!! Thank you so much! :D
Comment: No problem @IvesDragonfly! If you found my answer helpful, please accept my answer and give it an upvote!


Are multi-sigs multiple keys signing on a single shared signature, or one signature per key?

Question: And if it is a single shared signature, how does that work?
Answer: Multisig is multiple keys with one signature per key.
Shamir's Secret Sharing is how a single key can be split in multiple parts, and those parts combined to recover the key (which can be used to create a signature):

a form of secret sharing, where a secret is divided into parts, giving each participant its own unique part, where some of the parts or all of them are needed in order to reconstruct the secret.
Counting on all participants to combine the secret might be impractical, and therefore sometimes the threshold scheme is used where any k of the parts are sufficient to reconstruct the original secret.

A Github or web search on "shamir secret sharing" will help you find implementations.


Filtering noise out from bare-earth DEM with terrace fields?

Question: I have a 1m bare-earth DEM, derived from LiDAR data, representing a terraced landscape. For the sake of any subsequent use of the DEM (e.g., least-cost path, cost surface analysis, and the like) I am wondering if it is sound/necessary to 'blur' the DEM in order to de-emphasize any possible 'noise' produced by the terrace fields (e.g., sharp changes in slope values due to the terrace walls). If the answer is yes, what type of approach is better: something like a low-pass filter (I am not familiar with it, and how it can be performed in ArcGIS 10.1) or should I go back to the LiDAR data and create a bare-earth DEM from scratch with a larger cell size?
Comment: @AndreSilva You have to consider it being represented as a raster, so the cell size (resolution) dictates slope distribution. If you have fine enough resolution to make out the terraces, then say 90% of your cells are 2% slope while 10% are something really high. If you smooth out/decrease the resolution, depending on how much, 100% of your cells are the constant top to bottom slope value or some other breakdown (50% @ 2% slope while 50% are not as high as the original 10% terraces but higher than 2%). You're right the *actual* overall slope doesn't change, but the representation values do.
Comment: Can you elaborate on what you mean by noise? Maybe post a screenshot showing an example? I'm not sure I understand what you mean or would agree with treating the terraces as 'noise'. You can, of course, generalize the DEM to whatever degree you want, but if you eliminate those break lines/areas you're basically increasing the overall slope value to make up for it.
Comment: Thanks for your reply. Sorry if I was not clear. Since the use of the DTM is aimed to archaeological purposes, and since we do not know if the terraces were already there 8000 years ago, I was wondering if it is possible to 'down-weight' the effect of the terrace walls on the DTM. What I am worried about is what effect (if any) can the terrace walls have on, e.g., the calculation of a least-cost path between (archaeological) sites. Hope this manages to make things a little bit clearer.
Comment: Well, that would depend on how you calculate the cost values. Assuming slope is to be a factor, and at a large scale, then yes, presumably a sudden jump from 2% to 50% or whatever could contribute to a barrier. At the same time, if smoothing them out results in an overall slope of 20% when it's really mostly 2% with a few breaks, that's going to skew your cost as well. I would think there would be ramps or some other path between terraces to allow for a flow path. But I don't know the scale or details of what you're looking at (and would think the terraces were somewhat datable).
Answer: One would wonder if a 1m resolution is the appropriate scale to be addressing you question. Bigger is not always better.
If the scale is too fine and is picking up undesirable detail, a reasonable approach would be to figure out what scale supports your question and generalize the dem accordingly. This can be done through a resampling, with a bilinear or cubic convolution, approach.


Temporarily prevent a full toilet bowl from draining

Question: I want to fill the toilet bowl with water as high as I can and let the water sit without draining for up to 24 hours. Why? To let some (gentle) cleansers do their work. I've tried shutting off the water at the wall and refilling the bowl from a pitcher, but inevitably the water starts draining too soon. Ideas?
Comment: It drains because there's nothing actually holding it in - just the curve of the pipe which makes up the 'trap'. You'd have to physically block it somehow to keep the level above its normal 'finished flushing' level.
Comment: Use a toilet plunger fit the plunger and fill if it is a good seal the bowl will stay full. I have had a young child flush a balloon that got stuck in the trap took a while to figure that one out, finally popped it with a drain auger but if the right size the balloon will make a good seal if the plunger won't seal tight.
Comment: The only think I can think of is Bernoulli. If it's windy outside, the wind over the top of the vent stack can create a Bernoulli effect and partially empty the toilet bowl. I cannot think of anything else that could cause the bowl to empty except a crack in the bowl itself, which would be pretty obvious.
Comment: Use gel cleaner and you won't have to keep the bowl filled.
Comment: Something like this: https://www.petersenproducts.com/PIPE-PLUG-MECHANICAL-T-HANDLE-RUBBER-5-8-DIA-p/1432063.htm
Answer: The toilet bowl can only hold water as high as the top of the porcelain inside of chamber 5 in the picture below, unless you do something to stop it:
Comment: Not sure why this answer has so many votes. It explains _why_ the toilet flushes itself, but it doesn't answer the question of how to prevent the self-flush.
Answer: Fill small plastic bag with one quart of water, remove excess air from bag and tie off. Place in toilet bowl. Dispose of bag when finished in trash receptacle.
Comment: I'd go further - secure a cord to the bag somehow, or use a very large bag not a small bag.  Don't want it going down accidentally.
Answer: I know this is an old post but it seems to have a lot of recent views... so I hope by adding my experience it will help someone.
I use a heavy-duty (freezer or thicker) gallon ziploc bag and stuff a couple of wet microfiber kitchen towels or terry washcloths inside it, favoring one bottom corner to make a stuffed pointed bag. Then tie it shut with a string long enough to tie it off outside the toilet.
Shut the water off and flush to empty the tank, then empty the bowl with a fast bucket of water. Wedge the bag into the opening starting with the corner and shaping the bag as needed to fit (my Toto has a different shape than my American Standard).
This may take some time and effort to compress the cloths and achieve a proper seal. The bag will need to go in quite far, so tie it securely with no slack once it is in place. (I use enough wet towels in the bag to ensure the bag is a bit too large to go down easily, as added insurance. The force to flush it down will be very strong when you start to remove it.)
Seal any bottom jets the same way using wet terry washcloths and small freezer bags, also tied off outside the bowl.
Once the bottom openings are blocked, use a bucket to slowly and gently fill the toilet with the cleaning solution until it is full past the rim to the top edge. Do not rush this!
The water level holds overnight for me with little or usually no seepage.
To empty. Get a good grip on both bags and pull them away simultaneously and just enough to allow a small and steady stream of solution to release.  The jet bag might pull away fully. Continue until the level has gone down enough to make the bags easy to pull away. Never pull just one bag (if using two).
Since the OP mentioned wanting to do this to have a cleaning solution soak, I want to mention an alternate method that doesn't require filling the bowl to the top.
I use an inexpensive submersible pond pump ($10-$15, 3-4 foot lift, low GPM) to circulate the solution from the bowl into the rim via the overflow tube.
Once a year, after plugging the bottom openings of the toilet as above, I run 1:1 bleach/water to kill any mold inside the rim for a couple of hours. After thoroughly rinsing away the bleach solution, I follow with a 10% citric acid solution (I've also used straight white vinegar) for a few hours to clear scale buildup. This annual maintenance keeps the toilets flushing and looking like new.
(In addition to following all electrical safety precautions when using the pond pump, I also plug the pump into an outdoor switchable outlet made for Christmas lights. It has a battery powered on/off remote control. I can operate the pump from anywhere, touchless. Safety first!)
Comment: This is a brilliant answer and I wish the OP would accept it. The idea of a cheap pond pump to recirculate cleaner is fantastic!
Comment: Thanks! I use the pump annually on all the toilets. Acids and other cleaners will eventually ruin the pump (the cheap ones are not chemical resistant), but I usually get a few years out of one before it goes. IMO the ease of use is worth the cost.
Answer: My solution was to sop up all the water first. I then used a balloon and filled it with some of that expanding foam. I gave it some time to harden creating a perfect fit for the opening. Washed it thoroughly & ready for subsequent uses
Comment: Nice - I like this idea :)
Answer: Wad up a large trash bag and stuff it into the bowl, about as far as it will go. If it's not large enough, place a few crumpled paper towels into the bag and re-wad. It should be large enough to clog most toilets, it's easy to remove, and won't seep like a towel or rag would.
Comment: +1 but I will add that you need to be real careful that you don't flush that bag down when you fill the bowl with water, could make for a bad day.
Comment: you can always tie the drawstings around the toilet rim to be sure ;)
Answer: I would try a child's balloon.   You'll have to wedge it in tight so it doesn't float up.   If you can't wedge it....try a water balloon.
In either case, with a string on the balloon tied to the flush handle or toilet seat.
Answer: I got it done but it is not as easy as one might think. Most of the time there remain some gaps water uses to drain out, and after a couple of minutes, water level is back to normal. So it is required to apply some kind of pressure all around the toilet bowl.
The best solution I have come up with involves using a garbage bag and a plunger.

Fill the garbage bag with water at 25% and stick it down the hole.
Put the plunger inside the bag so the bag adheres to the bowl, as depicted below.

If you press hard enough, it should be sealed tight enough.

Even with this technique, water level only holds for 1 or 2 hours, which is barely enough for cleansers to do their job.
Answer: Here's a completely different solution - to stop the water leaving, stop the air getting in. It will be fiddly but significantly reduces the risk of getting something stuck half way down.

Cut a sheet of heavy plastic sheet that fits tidily over the top of the open toilet.
Tape the edges all round smoothly and evenly with duct tape, leaving the front flapped back and having more tape ready.
Fill through the opening.
Flap down the front and tape.

If you can make it airtight the level will stay high indefinitely.  More likely a tiny bit of air will get in but it will still hold for a few hours.  Use clear plastic sheet and you'll be able to keep an eye on it.  Untape carefully starting at the front, and you'll be able to stick it back down if the first treatment wasn't enough.
Comment: This is good, outside-the-box thinking! I've got to ask if you've tried this. I've poured water directly into the bowl, and it flushes pretty darn quickly. I'd imagine it would be difficult to fill the bowl then close & seal the flap before physics took over and emptied the bowl again. However, I'd be more than happy to be shown wrong on this one.
Comment: @FreeMan I've done it with other things, and a toilet that was draining very slowly, to get cleaner soaking in the bend.  Though a toilet drains faster than a sink, the flush allows fast (at least partial) filling.  In fact filling using the flush will push air out so a small flap could be left shut but not taped right down.  The key is to add the cleaner and any extra water both quickly and through a small gap.  Taping around a funnel may also help.  Funnels can be made to self seal by putting a floating ball (bigger than the outlet) in the bowl.
Comment: ... I'd consider experimenting, but I got rid of some bits of suitable sheet in this morning's rubbish collection and don't think I've got any more
Answer: i hate to just plug a product but on tv flex tape looks like it may work. he literally takes a piece and pluggs up a above ground pool by taking a piece of the tape and literally plugging it from the inside of the pool. so the tape can get wet and still stick. enough pieces, im sure would make a perfect seal. and then just peel once done.
Comment: Seems overly complicated compared to the other solutions. The more joined pieces, the more places a leak can occur. And this has the risk-of-going-down-drain problem. It may be a fine produce (don't know) but this does not seem the right application for it.
Answer: I am in the process of doing my toilets. The following process worked perfectly for me: You will need 3-4 bread bags (for strength), fine sand, plumbers putty, string, 10 pound weight, vinegar, Zep Calcium, Lime, Rust remover.

Create a sand bag with tripled up bread bags. Use enough sand to make the bag fit into the outflow, with enough to spread over the top of the outflow. (I filled 1/3 of the bag.) Tie off the bag near the top to create room to shape the bag into the toilet outflow.
Create a ring from the plumbers putty and place on top of the toilet outflow. This servers as a gasket.
Shape the sand bag into the toilet outflow.
Place the weight on top of the sand bag.
Fill the toilet with an appropriate mixture of vinegar and calcium, lime, rust remover.
Periodically brush the toilet with a brush. I used a dish brush.
Wait until rust, lime, calcium is loosened. It took a few hours or less for me. (I was not watching closely). Your results may vary

I hope this helps!


What is the difference between Stack Overflow and Meta Stack Overflow?

Question: What is the difference between Stack Overflow and Meta Stack Overflow?
Comment: This must be a duplicate, if not a FAQ!
Comment: I'm not sure why this is gathering close votes as `Not Constructive` - it's got a definite answer and isn't a rant.  Downvotes are perhaps understandable due to lack of research effort but still in my opinion a valid question.
Answer: Stack Overflow is the site for questions about a real, actual programming problem you're facing. Meta Stack Overflow, on the other hand, is the site for questions about Stack Overflow.
Hence, you've actually asked this question on the right server. ;)
At the top of each Stack Exchange site is a link to the FAQ, which describes the purpose of each site, what kinds of questions are on-topic, and what kinds of questions are off-topic.
Answer: Look at FAQ of both Stack Overflow and Meta Stack Overflow.
Stack Overflow is Q&A site for professional and enthusiast programmers where you can ask questions about programming problems, software algorithm etc.
Meta Stack Overflow is for bug reports, feature requests and talk about the Trilogy and Stack Exchange sites.
Look at the blog about Meta Stack Overflow.


How can I make a room feel bigger than it is?

Question: I've cleaned to make space for organizing the spot and adding shelves and I have still not felt the space is bigger than it is.
Comment: Are you able to paint the room or is this a dorm/apartment that you can't make changes to?
Comment: Too little information to help. What size is the room? What color are the walls? What are you allowed/not allowed to do in terms of painting or other changes? Any windows? What kind of lighting?
Answer: Ways to make a room feel big (not a complete list):

Cover one wall with mirrors - this may be extreme but it is effective. Even framed mirrors make a room feel larger.
Increase the amount of light in the room
Paint your walls a light color
Reduce the amount of furniture/stuff in the room
On wood or tile floors use an area rug that is smaller than normal
Pull the furniture away from the wall
Leave your windows uncovered

Hopefully one or more of these suggestions will help.
Answer:
Paint your walls and floor with light colors- this will give you the illusion of a bigger space.
Maximize your space by using hidden storage- By doing this, there will be less clutter in your room. Clutter actually makes space look small (and unorganized).
Install shelves close to the ceiling- to draw the eye upward.
Vertical shelves and storage- Take advantage of your vertical space. Horizontal shelves make your space look tight and crowded.
Small items in your room make it look crowded, get decorations that are big to give an illusion of a bigger space.
Uncover your windows to give a room depth.
Glass or acrylic materials make your space bigger.
Pieces of furniture with legs give it a spacious illusion.
Match colors with different shades for coordination.


Do quark charges repel one another?

Question: Positive electrical charges repel other positive charges, and negatives repel negatives. But does that happen for quarks, too? I never saw mention of it, but if so, that would mean the up quarks in a proton actively repel each other, would it not? The same for down quarks in neutrons, of course.
Answer: Experimentally the charge distribution of protons and neutrons has been measured as a function of the radius.

So the different charge content of the two nucleons does affect the distributions. As the other answer states  this is the regime where only quantum chromodynamics models can attempt to describe the wavefunctions of the quarks within the nucleons, so if the word force has a meaning it is through the potential that represents it classically. In the nucleon, it is not a simple 1/r coulomb potential between free quarks , since the strong interaction with the colored charges between quarks dominates the problem.
In the regime of elementary particles, and the quarks are a part of them, one usually talks of interactions and not forces , but people do call them forces also:

Fundamental interactions, also known as fundamental forces, are the interactions in physical systems that do not appear to be reducible to more basic interactions. There are four conventionally accepted fundamental interactions—gravitational, electromagnetic, strong nuclear, and weak nuclear. Each one is understood as the dynamics of a field. The gravitational force is modeled as a continuous classical field. The other three are each modeled as discrete quantum fields, and exhibit a measurable unit or elementary particle.

If one has an electron and a proton, one can solve for the coulomb 1/r potential for the hydrogen atom and get results that fit the spectral data.  The 1/r comes from the connection of conservative forces to potential (  -dV(x)/dx=F(x)),  the behavior of the electromagnetic force, although it is not something which is directly  measurable. Only the probability distributions for finding the electron at an (x,y,z,t) can be predicted by the quantum mechanical theory/model.
In the case of the strong interaction there exist color charges between quarks which are attractive and the potential  goes as  ~r^2, increasing with increasing distance. The interplay between these two potentials when inputted in the quantum mechanical models should give the distributions observed as well as other functional forms, like dipoles and quadrupoles.
Answer: This is not a meaningful question.
No, really, it isn't. Quarks don't exist as free charged objects on which we could take the classical limit and consider "forces" on them. They are confined, and occur only as constituents of bound states. In quantum mechanics, it doesn't make sense to ask whether the constituents of a bound state "repel" or "attract" each other. The electrons in an atom are not in any meaningful sense "attracted" by the nucleus except for the "attractive" Coulomb potential being responsible for the existence of the bound electron states in the first place - but there is no "force". All that is left of the classical idea of force will be a certain contribution to the binding energy by the corresponding potential.
Answer: In the article "The Anatomy of a Neutron" by Timothy Paul Smith, (available on line),the author said in Figure 3. that "In a quark model that includes spin, there is a repulson (repulsion?) between quarks with parallel spins, so the quarks will have slightly distorted orbits. In the proton, the effect on the charge radius is almost unnoticeable. However, in the neutron, it leads to a slightly negative surface and a slight positive center."
Answer:
Do quark charges repel one another?

No. Quarks aren't little balls, and nor are they point charges. It's quantum field theory, not quantum point-particle theory. It's the wave nature of matter, not the point-particle nature of matter. Take a look at some pictures of electromagnetic waves. The first part of the wave is positive, the second part is negative. But the two parts don't repel each other. It's similar for quarks. You can kind of work this out by thinking about proton diffraction and pair production and annihilation. In low-energy proton-antiproton annihilation to gamma photons, you started with 2 wavelike things and you ended up with 2 wavelike things. The fact that the former have three parts and the latter have two doesn't make much difference.

Positive electrical charges repel other positive charges, and negatives repel negatives. But does that happen for quarks, too?

No, because a quark is not actually a charged particle like an electron. I know people say it's a fundamental particle, but nobody has every seen a free quark. IMHO it's better to think of it as a "lowest-common-denominator particle component" rather than an actual particle in its own right. It's similar for gluons. The gluons in ordinary hadrons like the proton are virtual, and virtual particles exist only in the mathematics of the model.

I never saw mention of it, but if so, that would mean the up quarks in a proton actively repel each other, would it not? The same for down quarks in neutrons, of course.

No. Like ACuriousMind said, quarks don't exist as free charged objects, they're confined, and occur only as constituents of bound states. IMHO to really grasp  this you have to look to topological quantum field theory. See the blue trefoils at the top of this TQFT club page? They're there for a reason, and it's the worst-kept secret in physics. Have a rummage around and you soon find these pictures of a proton and a trefoil:

Put your finger on the trefoil at the bottom left, then go round it anticlockwise calling out the crossing-over directions: up, down up. Now where have you heard that before? LOL! The quarks are just parts of the bound state. They aren't point particles. If they were, you couldn't diffract protons, or neutrons, or buckyballs. Quarks are "partons", or parts, not things that can exist on their own.

Do quark charges repel one another?


Why aren't my Minitest tests being run in parallel?

Question: I just recently figured out that my Minitest test cases can run in parallel. All I had to do was
require "minitest/hell"

and so I did. Unfortunately, my tests run exactly like before. Everything passes and it takes exactly as much time as it usually does. I checked htop while running my test suite, and only one core is utilized.
I set a breakpoint in a random test to check if the tests were actually set to run in parallel:
(byebug) Minitest::Test.test_order
:parallel
So what's going on?

My first assumption was that Minitest counts the amount of CPU cores when deciding how many processes to spawn. I had multiple physical processors (in a virtual machine) but just 1 core per processor. I have changed my VPS to having two physical processors, each with 4 cores, and my tests still aren't being run in parallel.
$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             2
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 62
Stepping:              4
CPU MHz:               2600.000
BogoMIPS:              5200.00
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              20480K
NUMA node0 CPU(s):     0-7
Answer: Minitest uses threads and not processes for parallel test execution.
Since MRI (the standard Ruby interpreter) has a Global Interpreter Lock only one thread can be executed at a time. Therefore your tests do not run in parallel when using MRI.
You can get you tests to run in parallel by using a Ruby interpreter that supports concurrent threads like JRuby or Rubinius.
Read this article for more details.
Comment: Oh lord... I was absolutely certain I read that Minitest uses fork for parallel testing. Is there any way to get Minitest to use multiprocessing rather than multithreading for parallel testing?
Comment: @Hubro you could try to use *spork-minitest*, see http://stackoverflow.com/questions/9932384/spork-minitest
Answer: severin's answer about MRI not being able to execute in parallel because of the GIL is correct.  (Disclaimer: I wrote the article he links to.)  The language gets a little fuzzy in many writeups, but you can read this article for a very straightforward description.
If you're still interested in running tests in parallel and can't change Ruby interpreters, take a look at the parallel_tests gem as an alternative for doing that, albeit with some limitations.
Answer: To run tests in parallel, you either need a Ruby version that enables parallel execution (e.g. JRuby), or you can use simple shell commands to launch multiple minitest runs.
For example, use gnu parallel:
find test -type f | parallel --dry-run  bundle exec rake test TEST={}

(The dry-run flag is so you can see what's happening before you run it; omit the dry-run flag when you're satisfied the commands will do what you want.)
The overhead of bundle exec and rake are very high. The core advantage of the parallel execution is to ensure your tests behave correctly -- i.e. the core advantage is not speed. If you use parallel, you will likely want to try spork which keeps a pre-warmed app ready.


How to prove that symmetric closure of reflexive closure is identical to reflexive closure of symmetric closure?

Question:
Let $X$ be the set of all relations over $\mathbb N$. Let $R\in X$. Let $r(R)$ be the reflexive closure of some relation $R$. Accordingly, let $s(R)$ be the symmetric closure of $R$. I need to prove that $s(r(R))=r(s(R))$.

While this totally makes sense, I'm not sure how to formally prove this.
For any $(a,b)\in R$ such that $a\neq b$ we have that $r(R)=\{(a,b)\}\cup \{(a,a), (b,b)\}$. If $(a,a)\in R$ then $r(R)=R$. So essentially $r(R)$ is a union of all original pairs in $R$ plus their reflexive "counterparts". Applying $s$ onto $r(R)$ will add symmetric "counterparts" for all pairs $(a,b)$ such that $a\neq b$ while the pairs of type $(a,a)$ are already symmetric. So all pairs $(a,a)\in R$ are already symmetric and reflexive therefore applying $s$ and $r$ on them will just return the pairs themselves, while applying $r$ and $s$ on all pairs $(a,b)$ will result in the union of symmetric and reflexive pairs which is the same for $s(r(R))=r(s(R))$.
Answer: R' = { (a,b) : bRa }.  sR = R $\cup$ R'.  rR = R $\cup$ N×N.
rsR = sR $\cup$ N×N = R $\cup$ R' $\cup$ N×N.
srR = s(R $\cup$ N×N) = R $\cup$ N×N $\cup$ (R $\cup$ N×N)'
. . = R $\cup$ N×N $\cup$ R' $\cup$ N×N.