Hook to edit an column on comments screen?

Question: At the moment I'm doing
add_filter("manage_edit-comments_columns", function($columns) {
        unset($columns["author"]);
        $columns_one = array_slice($columns,0,1);
        $columns_two = array_slice($columns,1);
        $columns_one["user"] = "User";
        $columns = $columns_one + $columns_two;
        return $columns;
    });

add_filter( 'manage_comments_custom_column', function($column, $column_id) {
        echo "Test";
    },10, 2 );

Is there a way to just edit the author column instead of removing and creating my own?
Answer: There is no filter for this column. So answer is 'No'.
WP_List_Table search for method column_{something} inside class of Lister. Comments List class has column_author. So kill this column, and create filter as you do now.
Answer: I came to this question since I needed a similar thing. While an answer by qwerty-qwerty is correct, it's correct only partially so to say. As far as I understand, author needed to change a column name, while I needed to change contents of the author column itself. So, while this is a bit different, I'll just leave it here in case someone finds this question like I did. This also works if you need to get some additional data regarding comments which isn't stored in meta table and isn't not cached like said table and don't want to do separate query for each item.
So, what you can do is hook into the_comments filter. This filter passes an array of of WP_Comment_Object instances for each comment found that matches the request. In my case, comments could be saved with name other than user's display name, so where it was the case, I needed to get an actual display name from wp_users table and display it like comment_author_from_wp_comments (display_name_from_wp_users). I went through array passed by the filter, figured which comments needed additional info from wp_users table, ran a single query to that table, then modified elements within original array with new data. Here's a general idea of how my code works:
function my_filter($objects)
{
    global $current_screen;
    if (is_admin() && $current_screen->id == 'edit-comments') // I only needed it on that screen within admin
    {
        if (count($objects) > 0)
        {
            foreach ($objects as $key => $object)
            {
                //find out which comments needed 'fixing'
            }
            //do the actual fixing
        }
    }
    return $objects; //return modified or unmodified array
}
add_filter('the_comments', 'my_filter');

Hopefully, someone in the future will find this useful.


How do I motion track a person and control an armature?

Question: I am working on an animation series with fight scenes. Animating everything by hand takes a lot of time and doesn't always look good. I was wondering if I could motion track a person with various markers and transfer the movement to a rigged character. Then movements would be smooth and realistic. Can I do this only using Blender or do I need special equipment and software? ;)
Answer: Check out the camera tracking capability. The tutorials (e.g. from Blender Guru) use it to track camera motion, but you could try and attach your rig to the tracked objects.
Haven't tried it myself.


Can PC joystick simulate aerodynamic lock in spin?

Question: I never explored joysticks for playing simulators on PC. Can some kind of joystick simulate aerodynamic lock during spin? You do hands off control stick and it stays there, won't center as usual. I understand that force feedback is often included in such products, but can force feedback override auto centering?
Comment: I did play with [force feedback](http://mobile.thrustmaster.com/node/847) joysticks but it was before I touch a real airplane's stick, so I cannot tell you how realistic it was but it definitely not autocentered when offline
Answer: Yes there are PC joysticks that can remain in an off center position: the active feedback joysticks, without the force feedback switched on. The stick feels pretty light in that situation and kind of remains where you put it, almost like a helicopter cyclic stick with the trim button released.
When switched on, the force feedback can act like a passive spring and accepts some input parameters for varying the feel. The neutral position can be varied, the return position of the spring. All pretty course, not bad for the money, although the stepper motor produces grainy feedback forces.
Comment: Part of the reason that there aren't many of these Force Feedback joysticks nowadays is that a company apparently had the patents locked up until just recently.  I don't know all the details, but it goes back to Sony v Immersion
Answer: I think it's more of a question about the simulator software than the joystick. For example Flight Simulator 2004 did have force feedback modeled into it, but I don't recall it being very sophisticated. I do not know the current status of "consumer grade" sim software, but I'm highly doubtful that they would be able to mimick actual feel of stick forces in a very natural way. Doing it would require quite a lot of computation.
FS2004 did emulate the affect of speed on control forces, but it was pretty crude.
Answer: Such effects can only be produced by so called 'force feedback' (FFB) devices. They exist, but few of them, if any (in the consumer market) produce satisfactory results.
Good force feedback simply cannot be done cheaply, and this restricts the market to niche enthusiasts and professionals. It is relatively easy to produce 'effects' such as vibration and impulses, and most consumer FFBs can do it. But to simulate the whole range of forces reqire a specialised drive and very solid construction.
In addition (and perhaps because of the small niche market of such devices), none of the common game simulators even attempt to simulate control forces reasonably. Tellingly, even the Windows interface (API) to drive FFB hasn't been updated for some 15-20 years (it even retarded a bit).
But all is not that bad. While I'm still not aware of any FFB stick/joystick controller that can do a satisfactory job, there are at least FFB yokes (such as this one) that can potentially deliver a relevant experience in GA aviation. They are not cheap by gaming standards ($1500+), but very cheap by aviation standards. To overcome software limitations, they typically extract flight data from the games and run their own force simulation, which requires some fiddling with set-up.
The car racing game industry is in a better position: the number of enthusiasts is larger, and an FFB steering wheel is a simpler device (being a single degree of freedom and lower force). There are quite a few racing FFB steering wheels on the market that can be considered decent, but even they are fairly expensive (~$1000).


Apple Instruments - Counters - Source unavailable

Question: I've been running into a problem with Apple Instruments (4.6, Xcode 4.6.2 on 10.8.3).
Normally when using the Time Profiler, I can look at my source and see the hotspots without any problems (same project).
This time I've been trying to use the "Counters" Template to sample my CPUs Performance Counter Events. It samples the events as it should and I also have the same time based profiling information as well, however when I try to step into my code to look at the hot spots, like I can do for the "Time Profiler", all I get is "Unavailable" where I used to have the source. No Assembly either.
The Project is built as:

Release build
Debugging information is on and not stripped
DWARF + dsym is used to store the profiling data.

As I said, its the same configuration that works for the time profiler.
I already tried to (pretty much all that's stated in here: Xcode 4 Instruments doesn't show source lines , except for doing -O0, debug performance is not of interest to me)

recompile
relocate the dysm file using "File -> Re-Symbolicate"

As soon as I plainly close Instruments, start another Profile from Xcode and choose the Time Profiler, it works, if I go back to the Performance Counters, it stops.
Is this the default behaviour? Should it be like this? Has anybody already managed to get it working, in the current Instruments version? Otherwise it might be worth to file a bug with Apple.
Thanks a lot!
Comment: I have the same problem with Xcode 5.0.2.
Answer: Try the Xcode 5.1 beta4. For me its fixed there: Counter works now.
The seed notes mentions some details what they did. Don't know if its under NDA.


Do those Hermitian and unitary matrices form a basis for the underlying complex vector space?

Question: I conjecture that in the complex vector space $\mathbb{C}^{2^N \times 2^N}$, where $N$ is a positive integer, there is a basis $\mathcal{B}$ whose elements are Hermitian and unitary. However, I don't know how to prove (or counterprove) it.
Given a number $N$, it is always possible to find $2N$ distinct Hermitian and unitary matrices other than the identity $\{\gamma_1. \cdots. \gamma_{2N}\}$ such that each pair of them anti-commutes:
$$\gamma_i \gamma_j + \gamma_j \gamma_i = 0 \ \text{if} \ i \neq j.$$ Physicists usually call those $\gamma$ Majorana operators, and the reason why it is always possible to find $2N$ such matrices is based on the relation between fermionic operators and Majorana operators. For example, if $N = 1$, we define a so-called fermionic annihilation operator as
$$d = \begin{bmatrix}
0 & 1\\
0 & 0
\end{bmatrix}.
$$
Then the matrix
$$\gamma_1 = d + d^\dagger = \begin{bmatrix}
0 & 1\\
1 & 0
\end{bmatrix}
$$
and the matrix
$$\gamma_2 = i(d^\dagger - d) = \begin{bmatrix}
0 & -i\\
i & 0
\end{bmatrix}
$$ are Majorana operators.
The set of $2N$ Majorana operators can be extended to a set of $4^N$ Hermitian and unitary matrices:
$$\mathcal{B}=\left\{i^{\frac{n(n-1)}{2}} (\gamma_{a_1} \cdots \gamma_{a_n}): \ n, a_i \in \{1,\cdots,2N\}, \, a_i < a_{i+1}\right\} \bigcup \{1\}.$$
For instance, when $N = 1$,
$$\mathcal{B}=\left\{1, \gamma_1,\gamma_2, i \gamma_1 \gamma_2\right\}.$$
A direct calculation shows
$$|\mathcal{B}| = 1 + \sum_{n=1}^{2N} \begin{pmatrix} 2N\\n \end{pmatrix} = \sum_{n=0}^{2N} \begin{pmatrix} 2N\\n \end{pmatrix} = 2^{2N} = 4^N = \dim\left(\mathbb{C}^{2^N \times 2^N}\right).$$
I feel this set $\mathcal{B}$ is a basis for the complex vector space. Indeed, it is true at least when $N = 1$: $\mathcal{B}$ is the set of Pauli matrices. Nevertheless, I don't know how to prove it in higher dimensional spaces.
Thanks in advance for your help. :)
Answer: I worked it out myself. This is the link to my proof.


Create WordPress taxonomies based on theme settings

Question: Is it possible to create taxonomies based on theme settings? That is, are theme settings actions run before taxonomies / post types are initialized?
Answer: Yes. Post types and taxonomies are (should be) registered on the init hook. You are able to use get_option inside that hook to retrieve your theme's settings and register your post type/taxonomy with args based on those settings.
(By the way post types and taxonomies are really plug-in territory... :) )
Comment: @pogoking, consider having a theme require a plugin ... http://wordpress.stackexchange.com/a/51087/9844
Comment: Thanks for the answer! Regarding the plugin territory - I know it, and you're right in most of the cases. I'm not a fan of throwing everything and a kitchen sink into the theme, but once you want to create complete solution to a certain problem, that is design plus functionality then theme is the only way to go. :)


How does Linux kernel wifi driver determine when a connection is lost?

Question: My understanding is that current WiFi driver uses rate control algorithm to choose a data rate within a small set of predetermined values to send packets over the WiFi medium. Different algorithms exist for this purpose. But how does this process work when WiFi driver decides that the connection is lost and shutdown the connection all together? Which part of the code should I read in open source WiFi driver such as MadWiFi and the likes?
Answer: The WiFi driver for your hardware which runs in Linux communicates with the WiFi chip which also runs a pretty complex firmware. The interface between the driver and the firmware is hardware specific. In some hardware the detection of connection loss events is done completely by the firmware and the driver only gets a "disconnected" event while in others the driver is also involved.
Regardless of who does what disconnection usually occurs due to either

Receiving a DEAUTH frame from the AP
Detecting too many missing beacons. Beacons are WiFi frames sent periodically by the AO (for most APs every ~100ms) . If you get too far from the AP or the AP was just powered off you stop seeing the beacons in the air and usually you'll signal disconnection or try to roam to a different AP.
Too many failures on Tx of packets (i.e. not receiving ACK frames for too much traffic)
This usually indicates that you've gone too far from the AP. It could be that you can "hear" the AP but it can't hear you already. In this case it also makes sense to signal a disconnection.

For example you can look in TI wifi driver in the Linux kernel drivers/net/wireless/ti/wlcore/events.c and the function wlcore_event_beacon_loss()
Answer: In Cfg80211 architecture, assume we are station mode.
driver call kernel API cfg80211_send_disassoc() if we received a deassoc/deauth frame.this function will notify corresponding application (ex wpa_supplicant) a disconnect event.
on another hand, when we decide to disconnect with AP, applicantion (ex wpa_supplicant) can call linux kernel API cfg80211_disconnected(), it will trigger corresponding driver ioctl function to finish disconnection task.


What is the difference between least squares method and mean squared method in calculating the error?

Question: I think I am a little bit confused between the LSE (Least Squared Error) and the MSE (Mean Squared Error). So how can these two methods differ in calculating the error of the linear regression model?
And if available, please provide the mathematical equation of both methods.
Answer: You can think of least squares method as minimization of mean squared errors. In other words the latter is the subject of minimization of the former with respect to the parameters $\beta$:
$$\min_\beta MSE(\beta)$$
Once you find the optimal parameters $\hat\beta$ then $MSE(\hat\beta)$ is your LSE
Answer: The least squares method aims to minimize:
$$
\sum_{i = 1}^n\bigg(
y_i - \hat y_i
\bigg)^2
$$
Here, $n$ is the number of observations, the $y_i$ are the observed values of $Y$ (all $n$ of them), and the $\hat y_i$ are the predicted values of $Y$ (all $n$ of them). By calculus, this is equivalent to minimizing the following, even though the two will have different values of their respective minima.
$$
\dfrac{1}{n}\sum_{i = 1}^n\bigg(
y_i - \hat y_i
\bigg)^2
$$
In other words, both expressions will achieve their minima for the same $\hat y_i$ values, even though those minimum values are different.
The second expression is the mean squared error: $$MSE=
\dfrac{1}{n}\sum_{i = 1}^n\bigg(
y_i - \hat y_i
\bigg)^2
$$
Answer: Least squares minimizes the sum of the squared errors between the actual value and prediction of model. This is used to find the best fit line using Gradient Descent Optimisation. The line which gives the minimum least squared error is known as best fit line
LSE =  Sum over all observation((Y_actual - Y_predicted)**2)
While MSE is mostly used as evaluation error and formulae is given below


Investing inheritance money to build a spec home

Question: Last year I inherited several thousand dollars from my mom's estate.  I paid off my mortgage and purchased a lot in my neighborhood.  We are debt free as of this year.  My husband is a builder and we would like to build a spec home to sell for a profit.  We have $250K left from the inheritance which is in a money market account.  We would invest 100-125K into building a nice little spec home and sell it for quite a bit more than our initial investment (that will be around 200K total).  We are hoping to build a home worth 280-300K (the current market average) so our profit after selling fees would be around 250-275K or more.  I'm wondering if we would pay taxes on all of that profit or just the portion over and above the 200K of inheritance $'s invested?
Additionally, we are planning to invest the remaining portion of 125K into retirement accounts and an emergency fund.  Any thoughts or advice would be appreciated.  Thank you!
Comment: I think you have some vocabulary confusion here.  Profit = difference between (revenue received) and (costs).  So if it costs you $200k and you sell it for $300k and have $25k in sales costs, then your profit is (300k-200k-25k) or 75k.  Your numbers also don't really add up - you might want to make them more consistent across the way.  "Several thousand dollars" up in the first sentence, for example, is incongruous with "$250k left" which is much more than 'several' suggests.
Comment: I think she's ignoring the cost to purchase the lot (which is implied to be around $75k-100k.
Comment: Upvoted because it's a good question. I don't get downvoting questions...  You will pay taxes on the gains you make from the sale of the spec home. As stated above, gain = revenue-cost.  (assuming you've already paid the inheritance taxes if any).  Is this a good idea? No way to know. Is your husband an awesome builder? Is there demand for housing where you live? Will interest rates stay down? It's a "spec" home, not a sure thing.
Answer: When you sell the spec home, you will owe taxes on the sales price minus the cost of the home, including the land, materials, paid labor, and other expenses. The fact that you pay for this with with the inheritance in the money market account won't affect the taxes you owe when you sell the spec house.
Answer: You should very much nail down your planned expenses and profit. However beyond that you may have some better options to avoid taxation assuming all your plans go well.
You should take into account the ability to avoid taxes on the sale of a primary residence. You could build the spec house, then move into the spec house. You could then sell the primary (avoiding any profit less than $500k filing jointly, assuming you meet the Home Sale Tax Exclusion requirements).  You can then in another two years or so sell the spec house if you want and again avoid up to $500k in profit.
http://www.nolo.com/legal-encyclopedia/the-250000500000-home-sale-tax-exclusion.html


Can one get a refund for their airplane ticket if their visa is rejected?

Question: In some countries you need to show accommodation and airplane ticket before applying for a visa, so I thought what to do if one applies and then finally visa itself is rejected. Is it possible to get a refund giving reason as "visa being rejected"?
Comment: What country are we talking about? Many countries on the contrary very explicitly tell you NOT to buy tickets until you have your visa. Beyond that, there's no universal rule. Each airline may or may not have such provisions, you would have to check their terms & conditions.
Comment: It is simply not 'a special case' - it's pretty normal. Why should the airline care - and pay - for _your_ problems? They are a business.
Comment: So, in the case of by default non refundable ticket, there is no chance for a refund due to the special case? @Midavalo
Comment: Schengen visa country , it is required on the apps @jcaron
Comment: Which country exactly are you applying for, which country are you applying from, what is your nationality, and what type of visa (standard C visa I suppose?). I just checked what France says for applications from Tunisia for instance, and it says "Réservation du billet aller-retour ou itinéraire". This is far from requiring you to buy a ticket. Likewise for the hotel it says "réservation d'hôtel" which in this case is even simpler.
Comment: It looks like the OP does indeed need a full itinerary. https://visa.vfsglobal.com/one-pager/germany/kuwait/english/pdf/schengen-visa-kuwaiti-tourism-nov-2021.pdf VFS global handles Visas for the German Consualte in KUwait
Answer: If you are buying something that you know you may need a refund for, and the vendor sells two versions of it, one refundable and one not, you must buy the refundable one even if it costs more. You cannot buy the non-refundable one and then explain that you have a special circumstance you can't control. The airline certainly can't control it and isn't responsible for it. They aren't going to refund your nonrefundable ticket just because you want them to.
That said, careful reading of the terms and conditions may help you find an airline whose specific terms and conditions include that they will refund it if you don't get your visa. This answer to a related question lists some but more importantly tells you how to check for yourself.
But the refundable version costs more money! Yes it does. Perhaps, if cheaper tickets are still available when you get your visa, you can refund the expensive one and buy the cheap one. Or perhaps you can look at the extra expense for plane tickets as yet another way needing a visa makes travel more expensive for you. It's not fair, but it is reality.
But first, double and triple check that you truly do need to book tickets. Since many people book refundable tickets and cancel them if they don't get the visa, this requirement is really more "you have a few thousand dollars you can tie up for a while" more than it is "you are committed to this visit" and many countries have dropped the requirement as a result. I know you're sure: I also know many people have been completely sure about countries that in fact do not require plane tickets to be pre-booked. Check again. Also check whether it needs to be just "booked" (something a travel agent can do for you without you paying for the ticket) or actually paid for and issued. Reading the fine print will help you.
Comment: @Aplateofmomos because it means you may well never have to hand over actual money: the ticket booking, visa application and issuance, and ticket refund, hopefully all happen within a single card billing cycle, so the money is purely notional.
Comment: It's for cases like this where having credit cards help. Book a refundable ticket or hotel then cancel after obtaining your visa. Done that numerous times
Comment: How does credit card make things different than debit here? I don't quite understand @AugustineofHippo
Comment: Now that I read it again I feel this answer is really condescending. I feel it is unreasonable to assume after the text i wrote and first comment  under my post if the question was about refundable and non refundable ticket. The question is not to explain what are the obvious choice but rather if this additional possibility exists. At least after the edit it sends to a more related link but OP...
Comment: I'm not trying to be condescening but to be realistic. Refunds and other business policies are not based on your wishes but on those of the business who sell them. This is easy to forget. Many services come in only one version and refunds must be negotiated case by case. Plane tickets are different. A reminder of that is not condescending, in my opinion. I'm glad you find the link useful.
Answer: In case you really need to get a ticket up front, you have a few different choices here.

Buy a refundable tickets. This may or may not be a good option, since these are often very expensive (compared to a regular ticket).
Buy a fully refundable ticket and cancel it as soon as your visa has been issued. These tickets tend to be very expensive. Make sure you fully understand the terms and conditions of the ticket. Not all tickets that are marketed as "refundable" are fully refundable for cash for any reason. Also make sure that the Visa application isn't tied to this specific flight (which would be unusual)
Buy a throw away ticket. Buy the cheapest ticket that meets the Visa requirements and just let it lapse.
Buy the ticket you actually want to fly and hope for the best. That depends a bit on your details and what the likelihood is, that your Visa will be delayed or denied
Try travel insurance. That's rarely a good idea: most insurances do NOT cover Visa problems so you would have to go for a "cancel for any reason" insurances which are a) ridiculously expensive and b) cover only a part of your cost.

there is no chance for a refund due to the special case

Generally no. Visa's and proper documentation to enter the destination country are responsibilities of the passenger. All airlines state this clear in their terms conditions that you have to agree to when you buy the ticket.
Comment: Suppose I cancel the booked ticket and hotel, would it be fine to book something else earlier for accomodation and ticket and visit Germany? I can't seem to find what exactly is the policy on this anywhere.
Comment: Relevant: https://travel.stackexchange.com/questions/68165/are-there-any-airlines-which-refund-fare-including-economy-class-fully-in-case (Though of course the rules may have changed from years ago, but the general way to check the ticket conditions still holds true)
Comment: #2 would probably constitute some form of immigration fraud, as might #3.
Comment: @Vikki in which case I am proud to say I have committed immigration fraud at least 50 times. Demanding fully paid tickets is an unreasonable request and should be addressed such tactics as book and cancel!
Comment: @Vikki: this would only be "fraud" if the rules clearly state what changes to the itinerary are allowed and which ones aren't. To the best of my knowledge no such rules exist and the assumption that no changes at all are permissible seems very unreasonable. The OP has every intention to travel to the country. This is just a work around for a stupid catch-22 scenario


LED Christmas lights without limiting resistor

Question: My LED Christmas light strings do not have a series limiting resistor, how is this achieved? They are 70 LED strings with two 35 bulb sections. I have carefully checked and there are no provisions in the plug or inline with the wire. I measured resistance from sockets back to plug and measured no impedance. What am I missing? Can the the LEDS be made (doped) so the internal resistance be high enough that as a group they provide sufficient impedance?
Comment: These lights typically have a power supply for them ...that in all probability will be a CC supply so does not need any series resistance in the LEDs..
Comment: These are 120 Vac plug in lights, no separate power supply. I have used infrared thermometer and saw no heat rise in sockets or plug.
Answer: If you are willing to watch "Big Clive's" vlog, he uses the "easiest" method of finding the resistors, a thermal imaging camera.
In the 220V set he found 3 resistors in 3 of the LED bases, the rest had no resistor. Each resistor was 510R for a total of 1530\$\Omega\$. He also says he found a bridge rectifier molded into the bit where the wires split.

That was for an apparently Polish made set. It's certainly possible that other sets
use variations on this theme but you get the idea. Bridge rectifier plus a few hidden resistors distributed out among the LEDs (to spread out the heat dissipation, otherwise they could use just one resistor).


How to update the saleable quantity after invoice creation in magento2

Question: Normally the saleable quantity is updatd after when we place the order. I want to update the saleable quantity after invoice creation for my custom producttype..
Answer: Just a solution from the top of my head - create shipment automatically after invoice creation for this specific product type.
If I understand correctly - you assume that the product was shipped and is no longer in your warehouse; this solution should work fine for your needs.


Curtains and groups

Question: This picture is a copy of the pattern on my curtains.  The points of a hexagonal lattice are each coloured with one of four possible colours.  It has translational symmetry in two directions: a vertical shift by four lines and a horizontal shift by six lines.  One generating patch is shown with a solid line.

However if you change just three colours of the 24 in the generating patch, many more symmetries appear.  This picture shows the same pattern, except that the colours within the dotted line have been changed.  The new symmetries are: 180 degree rotational symmetry about any of the marked points and also a horizontal translation by three composed with the operation which switches dark blue for light blue and dark pink for light pink.  The latter symmetry can be applied twice to get the horizontal translation by six symmetry from before.

If the person who designed this pattern didn't know about the extra symmetries, they might have just filled in the 24 colours in the generating patch at random and then translated it to produce the whole curtain.  The number of ways of doing this is $4^{24}$.
However, they might have started by generating the full pattern.  If they had done that, I think they would have only had 6 choices (both the rotation and the translation by 3 should cut the number of choices in half).  If instead they had decided to start with the full pattern and then make up to three changes to it, they would have needed to make the 6 original choices, then choose three of 24 colours to change and the colours to change them to.  The number of ways of doing this is $4^6 \times \binom{24}{3} \times 4^3$.
Thus, the probability that the first scenario (choosing 24 colours at random) would produce a pattern so close to the modified one is $\frac{4^6 \times \binom{24}{3} \times 4^3}{4^{24}} \approx 1.885 \times 10^{-6}$.  This might suggest that they broke the full symmetry group intentionally to upset people like me.  However, I do not know how to calculate the chance that a randomly chosen generating 6 by 4 patch would be close to a pattern with some extra symmetries.
My questions

Suppose I generate a curtain pattern by choosing an $n$ by $m$ generating patch from $c$ possible colours.  This pattern automatically has symmetry group $\mathbb{Z}^2$.  What is the average number of colours I will have to change to get a larger group?

(Or more precisely, if I want the group to be, say, twice as big, how many changes will I have to make on average?)  It's likely this depends on the underlying lattice (here, it's hexagonal) but I'm looking for techniques to answer this kind of question rather than numerical answers.

The modified pattern has symmetry group generated by:

$a$, the vertical translation by 4
$b$, the horizontal translation by 3 combined with the colour switching
$c$, the rotation by 180 degrees about one of the marked points.

It is $<a,b,c \mid c^2=e, cac=a^{-1}, cbc=b^{-1}>$, which is like two infinite dihedral groups combined together.  Does this group have a name?
Why would the designer intentionally break such a nice symmetry group?
Comment: I just like how you describe that this upsets you :)
Comment: There are only 17 kinds of group that appear in this way, and there are several naming conventions: https://en.wikipedia.org/wiki/Wallpaper_group.  Which of the 17 is the nicest is a matter of taste.
Answer: I will answer your question only partially:
As it is mentioned in the comments, such groups are very famous, known as the Wallpaper groups, and there are several notations to deal with them.
I would go on the other direction for turning one group into another: begin with the larger groups and start breaking the symmetries. By coloring, for example.
A periodic pattern should fit in one of the five lattices of the plane:

And the symmetry group of the lattice itself will be bigger than any other pattern which fits inside such lattice.

Curtains and groups


Highlight polygon on hover and click in TileMill

Question: I have created a MapBox.js map with several layers of polygons each with hover/click interactivity to show attributes about each polygon.  I want the polygons to become highlighted upon a user hover/click with a darker border to help the user identify a polygon.  Something similar to this example.  What code would I need to add to make this happen? I'm assuming I need to create a CSS file to define the color and size of the outline but I don't know how to make it work with my JavaScript code.  My current source code is here.
Answer: No, if you are loading leaflet tile layers, it is not possible to change their style once loaded.
The key difference between your code and the example code you linked to is that the example code renders geoJSON data directly in the browser.  Notice this line of code:
var featureLayer = new L.GeoJSON();
//...
map.addLayer(featureLayer);

You are loading you data as a bunch of tile layers, which are pre-rendered .png images, and so can't be restyled in the browser.
With tile layers, all your data is first converted into small png images (either on a server, or locally with something like MapBox's TileMill) for fast load times and nearly no limit on data size; however as a raster source, you lose the ability to manipulate the data itself.
With feature layers loaded from a geojson, you reserve the ability to manipulate your data as a vector--style it in browser, run queries over it, etc--but loading even moderately sized datasets can become an issue.
If you want to be able to restyle your polygons on hover, look at using L.geoJSON() or L.mapbox.featureLayer().
Comment: Thanks for the answer, I forgot that the layers are only images and no longer vectors. Maybe it will be possible through vector tiles in MapBox Studio.
Comment: @cbunn check out this SE question: http://gis.stackexchange.com/questions/112302/why-arent-mapbox-vector-tiles-rendered-in-the-browser
Comment: Yes, it is possible with MapBox GL, but it's still early in development.  Expect the MapBox GL library to expand a lot; also, there's some talk of expanding leaflet support for vector tiles.


Relation between well-orderings of $\mathbb{R}$, and bases over $\mathbb{Q}$

Question: The following question arose from a discussion about the definability of bases of $\mathbb{R}$ as a $\mathbb{Q}$-vector space.
(ZF without AC) something we can note is that the existence of a (definable) well-ordering of $\mathbb{R}$ is easily seen to be equivalent to that of a (definable) well-ordered basis of $\mathbb{R}$ as a $\mathbb{Q}$-vector space.
After these remarks, the following question seems natural :
Is it consistent with ZF that there be a basis of $\mathbb{R}$ over $\mathbb{Q}$ that cannot be well-ordered ?
Answer: The problem is generally open. However, recently Liuzhen Wu, Liang Yu, Ralf Schindler and Mariam Beriashvili posted a preprint in which they prove the consistency of the existence of a Hamel basis and $\Bbb R$ cannot be well-ordered. Specifically, they show there is such a basis in Cohen's first model.
This can be found on Ralf's homepage.
Comment: It means that this hasn't been vetted through the usual channels. I read the proof myself, and it looks okay (although I am certain it can be somewhat simplified, at least conceptually, if one takes the approach of symmetric extensions... but then again, I am fluent in the language of symmetric extensions, and less in the language of relative definability.)
Comment: But then what do you mean "generally open" ? Is it simply that they didn't publish yet ?
Answer: There are actually two papers: "ZF + there is a Hamel basis" doesn't give that every infinite set of reals has a ctble. subset, see  https://ivv5hpp.uni-muenster.de/u/rds/hamel_basis.pdf , and "ZF + DC + there is a Hamel basis" doesn't give that there is a w.o. of R, see  https://ivv5hpp.uni-muenster.de/u/rds/hamel_basis_2.pdf


Where can I take a shower at Dubai Airport?

Question: I've got two transfers between long-haul flights coming up at DXB, and I'd like to freshen up with a shower. Information on the net is outdated and contradictory, and the official site is remarkably useless. I will be in the Terminal 3 (Emirates), although I'll do the long schlep to T1 and back if I need. I have no frequent flier lounge access.
What are my options for a shower?
Comment: I like this kind of posts, personal experience beats any reference. Thanks for sharing this, many people will benefit from this.
Comment: Do you have enough time for the T3-T1 walk? IIRC, there are more third party lounges in the T1 side, and a long walk can do you good after a long flight!
Comment: I've got ~3 hours both ways, so I can probably manage, but I'd prefer to take it easy in T3 though -- especially on the way back when I need to hit the duty free as well!
Comment: I found the information right there [on the official website](http://www.dubaiairports.ae/while-you-are-here/services-facilities#showers) - not sure when you looked. Also, dubaiairport.com was not the official site of the airport; the domain was bought and now redirects to dubairairports.ae (the official site).
Answer: I hereby present...
The Exhaustingly Exhaustive Dubai Airport Shower Guide
All prices and info accurate as of June 2014.
Marhaba lounge
The Marhaba lounge in T3 Concourse A (between gates A2/A3) has rather nice showers, easily on a par with a four-star hotel.  A shower alone without lounge access costs Dhs 55 (~US$15), including towel and cosmetics kit (shampoo, body soap, toothbrush, shaving kit, etc).  Just beware that in the muggy Dubai summer, even "cold" water is lukewarm, and ventilation is kind of minimal so it gets pretty sauna-like pretty fast if you shower too long.  Opening the cubicle door provides rapid relief though. There might be a queue (even longer than the free shower). Overall score, 8/10.

Full lounge access is Dhs 190 (~US$50), which gets you a buffet, internet access, and a buggy transfer to your gate as well.
Bonus: Lounge access is free with a "Titanium, Platinum or World" MasterCard if (per the T&Cs) issued in the Middle East & Africa, although enforcement appears to be a bit loose.

Dubai International Hotel
You can take a shower at any of the many Dubai International Hotel outlets, including the one in Concourse A, for US$15.  Not tested yet.
G-Force Health Club
Access to the G Force Health Club gym (including showers), at T3 Concourse B only, elevator to level 5 right opposite the elevators to the Gate A trains, can be purchased for Dhs 70 (~US$19) for 1.5 hours.  The gym is basic but does the job: treadmill, stationary bike, multipurpose machine, dumbbells.  The shower, on the other hand, is rather nice, the amenity pack includes everything down to Q-tips and you even get a bathrobe.  Plus water is cooler and it doesn't steam up as badly as Marhaba's version.  Overall score, 10/10!

Public showers
There are clearly signposted free public showers in Coucourse A, near gate A1 right opposite the Le Clos wine shop.  These look clean but no-frills, you'll need to bring your own towel and toiletries (there is a soap dispenser), and there was a (short) queue when I came to take a look (but it might be shorter than the Marhaba lounge).  Apparently Concourse B has a similar setup at gate B13, and there are a few signs pointing the way.
Per Sleeping in Airports, the free showers in Terminal 3 can be found near these gates:

Terminal 3, between Gates A1 - A24, Gates B13 - B19 and Gates C18 and C22.
Comment: Are you at the Dubai airport *right now*?
Comment: 27 times since 2007.  And trust me, if you're flying Australia<->Europe, you could use a shower too at the halfway mark...
Comment: No, this is a few weeks off.
Comment: You've taken a shower multiple times at the Dubai Airport? :O How often do you travel thru Dubai?
Comment: I had a shower last time, I don't remember the gate, but basically is rest room with a free shower.
Comment: Just to update here - I tried the Platinum Mastercard free entry trick at the Maharaba lounge in Q3 2016 and it didn't work - had to pay the USD $15 to get in.


Bs250 transistor as switch

Question:
Hi so I have button connected to pins 5 & 6 on rpi3. This is to "power it on"...
The button is also connected to another gpio 18 pin and python script listen for change and when it's pressed issues shutdown command. Problem is that pin 5(SCL) is also used by sound hat and amplifier. So I was thinking to not interfere with these I'd put bs250 transistor that I'll control with gpio17 pin so I would be able to shorten pins 5&6 only when pi is off, and when it's on I'll set gpio 17 high and break the connection. Would this work please? I don't want to fry anything. Thank you
Comment: Your schematic & description make no sense to me. Please read [this answer to a related question](https://raspberrypi.stackexchange.com/a/117019/83790), and try to edit your question. Also see this URL for [pin assignments](https://pinout.xyz/#)
Answer: It is far from clear what you have done (or are proposing to do). Rather than vague hand drawn circuits use the schematic tool above your question.
To clarify the SCL pin is used as output in normal I²C operation so should not impact on REBOOT function (which is controlled by the Video Core). The REBOOT only works AFTER shutdown.
You can use ANY pin to shut down (but not reboot).

Bs250 transistor as switch


finding which files were removed from /tmp upon reboot

Question: Hoping against hope here, but is there some in-built logging mechanism through which I can find out which files were deleted from /tmp upon reboot? I could obviously tweak the shutdown scripts, but that's not what I'm asking.
Answer: No, nothing keeps track about what gets deleted from /tmp upon reboot. Some distros even mount /tmp in RAM, so that's just gone upon reboot. You could implement such tracking yourself if you want, in your shutdown scripts, like <code>/etc/rc.d/rc.local_shutdown</code> for example.


Contacts shows truecaller and paytm links

Question: I use LETV with marshmallow. I use PAytm and truecaller. recently these apps started to show up their pay for the friend and send money links and it's irritating. I don't want to uninstall these apps but I want contacts to show only call option.
Answer: This is how you've to proceed.
Step 1: Go to Settings.
Step 2: Scroll down to Accounts

Step 3: Choose either Paytm or Truecaller.

Step 4: Disable contact sync for both.


How can I correct a word on the CKEditor field?

Question: When editing a text area in Drupal 8, right clicking a highlighted spelling error doesn't produce a context menu option to correct the misspelled word. How can I correct the word on the CKEditor field?
Comment: Did you install a CKEditor spell checker plugin? [By default CKeditor in D8 does not provide spell checking](http://i.stack.imgur.com/vLv1T.jpg)
Comment: NVM I'm still using 8.0.5 in my dev, the [The spell checking feature was added in 8.1.0](https://www.drupal.org/node/2624982)
Answer: According to AdamPS in Enable browsers' (native) spell checker in CKEditor

2) If you browser supports spelling suggestions, the way to access
  them in Drupal is slightly different. When you are in an edit area,
  then the normal browser context menu may be replaced by the editing
  context menu. However you can access the browser menu by clicking
  Control. [But on a Mac it is potentially command and on a tablet
  ....??]

You need to hold down CTRL before right clicking. (which worked for me on Windows OS)

An alternative would be to install the SpellCheckAsYouType(SCAYT) plugin for CKEDITOR

Note: You have to build a custom module to install CKeditor plugins in
  D8.
Comment: It looks like it's Alt+Cmd (⌥+⌘) for Mac OSX.


What is the current status of Multi-Sign function in bitcoin network?

Question: Are they convenient enough for some real world transactions? Like an easy escrow that the two party can assign to a third party to finish a transaction?
Answer: This topic has gotten a lot of traction recently, with new implementations continually popping out.
For example, there's a really nice standalone HTML5 app with slick interface called Copay, developed by Bitpay. There's also an online service BitGo (haven't tried this one though).
Answer: Absolutely. It's a feature being used by a variety of wallets such as GreenAddress and BitGo.


Changing UIView background color using an animation

Question: I want to change my UIView background color with a transition animation. For example, if the view is red and I change it to blue. The blue color will slide up from the bottom of the screen to the top and fill the whole screen. I was thinking of doing this by making a UIView of identical size with the desired color and then animating it from off screen up to the top. This doesn't seem like a very elegant way to do it though. Is there any better way of doing this? Any points would be really appreciated. Thanks!
Answer: Try this:
CALayer *layer = [CALayer layer];
layer.frame = CGRectMake(0, self.view.bounds.size.height, self.view.bounds.size.width, self.view.bounds.size.height);
layer.backgroundColor = [UIColor blueColor].CGColor;
[self.view.layer addSublayer:layer];

CABasicAnimation *animation = [CABasicAnimation animation];
animation.keyPath = @"position.y";
animation.byValue = @(-self.view.bounds.size.height);
animation.duration = 1;

animation.fillMode = kCAFillModeForwards;
animation.removedOnCompletion = NO;

[layer addAnimation:animation forKey:@"Splash"];

You can try this out:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.0];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp
                       forView:self.view cache:NO];
self.view.layer.backgroundColor = [UIColor blueColor].CGColor;
[UIView commitAnimations];

I also have another suggestion that make the transition smooth:
[UIView animateWithDuration:2.0 animations:^{
    self.view.layer.backgroundColor = [UIColor blueColor].CGColor;
} completion:nil];

Comment: Sorry, I may have not written my question correctly. I mean more of a slide up animation. Just having a look now with your code to see if there is anything I can sub in to make it slide up.
Comment: Actually, you want the animation for transitioning the view controller or just a simple animation within the same view?
Comment: Sorry, I was busying at something. The first portion of the code should do what you want.
Comment: The way you describe is more using higher level API which is okay. But `CAAnimation` can let you understand more.
Answer: You could:

Use another UIView as a intermediate in the animation, as you mentioned. its not that elegant but it works and its simple.
Work with CALayer, if you search for it you could find lot's of easy examples, this one for example, from Ray Wenderlich, which i find great.

UPDATE
I took upon myself to create this effect using CAShapeLayer, and i also created the effect using UIView animation. Here are the snippets, its commented, and feel free to modify:
UIView
- (void)changeColorWithFillingAnimation {
    //we create a view that will increase in size from top to bottom, thats why it starts with these frame parameters
    UIView *fillingView = [[UIView alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height - 1, self.view.bounds.size.width, 1)];
    //set the color we want to change to
    fillingView.backgroundColor = [UIColor blueColor];
    //add it to the view we want to change the color
    [self.view addSubview:fillingView];

    [UIView animateWithDuration:2.0 animations:^{
        //this will make so the view animates up, since its animating the frame to the target view's size
        fillingView.frame = self.view.bounds;
    } completion:^(BOOL finished) {
        //set the color we want and then disappear with the filling view.
        self.view.backgroundColor = [UIColor blueColor];
        [fillingView removeFromSuperview];
    }];
}

CAShapeLayer + CABasicAnimation + CATransition
- (void)changeColorWithShapeLayer {
    //create the initial and the final path.
    UIBezierPath *fromPath = [UIBezierPath bezierPathWithRect:CGRectMake(0, self.view.bounds.size.height - 1, self.view.bounds.size.width, 1)];
    UIBezierPath *toPath = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];
    //create the shape layer that will be animated
    CAShapeLayer *fillingShape = [CAShapeLayer layer];
    fillingShape.path = fromPath.CGPath;
    fillingShape.fillColor = [UIColor blueColor].CGColor;
    //create the animation for the shape layer
    CABasicAnimation *animatedFill = [CABasicAnimation animationWithKeyPath:@"path"];
    animatedFill.duration = 2.0f;
    animatedFill.fromValue = (id)fromPath.CGPath;
    animatedFill.toValue = (id)toPath.CGPath;

    //using CATransaction like this we can set a completion block
    [CATransaction begin];

    [CATransaction setCompletionBlock:^{
        //when the animation ends, we want to set the proper color itself!
        self.view.backgroundColor = [UIColor blueColor];
    }];

    //add the animation to the shape layer, then add the shape layer as a sublayer on the view changing color
    [fillingShape addAnimation:animatedFill forKey:@"path"];
    [self.view.layer addSublayer:fillingShape];

    [CATransaction commit];
}

Comment: hey, just out now. I'll check this out later. Looking forward to it. Cheers!


Which Salesforce License is required to use Environment Hub?

Question: Preface: this is no duplicate
This is not a duplicate of this question Which Salesforce License is required to use Dev Hub (beta)?
Dev Hub and Environment Hub are two totally different things. Only the question about which license is required for using each of them can be asked for both distinct Hubs. Please don't get confused. I've carefully split up these two questions and the duplicate mark is definitely wrong.
Original Question
Today I've tried to enable Environment Hub for some of our Developers. Environment Hub itself is working only for me as I am using a Salesforce license with the Profile System Administrator.
Since the Devs are not involved in selling activities, we use Plattform Licenses (Force.com) for them.
Now they should be able to spin up and manage SSO for our dev orgs.
I was able to grant them access to the tab and the objects - but not for the Environment Hub App.
Is there any way to allow these licenses to use the environment hub? If not, why such an restriction? It does not make sense to provide them with a Sales Cloud License.
Comment: Within the settings for the app itself, is the app visible to those profiles? (QuickFind > Create > Apps > [Env Hub - Edit])
Comment: @Uwe Heim did you manage to get this sorted out?
Answer: If you follow the steps outlined in this documentation (see below), you can actually get access.
However, the Environment Hub tab still won't show up in your app launcher, but you can go there by navigating to https://YOUR_DOMAIN.lightning.force.com/lightning/o/EnvironmentHubMember/list. Everything seems to work well from there, viewing all connected orgs as well as creating / connecting orgs.

Contact Salesforce to enable the Environment Hub in your org. If you're an ISV partner, you can skip this step. The Environment Hub is already installed in your Partner Business Org.
Log in to the org where the Environment Hub is enabled, and then go to Setup.
Assign users access to features in the Environment Hub.
  a. From Setup, enter Profiles in the Quick Find box, then select Profiles.
  b. Create a profile, or edit an existing one.
  c. Edit the profile's settings.

Custom App Settings
  Enable the Environment Hub custom app to make it available in the App Launcher in Lightning Experience or App Menu in Salesforce Classic.
Connected App Access
  Unless advised by Salesforce, don't adjust settings in this section of the profile.
  Service Provider Access
  If you enable single sign-on (SSO) in a member org, new entries appear in this section of the profile. Entries appear in the format Service Provider [Organization ID], where Organization ID is the ID of the member org. Users who don't have access to the service provider sometimes see this message when attempting to log in via SSO: "User '[UserID]' does not have access to sp '[Service Provider ID]'."
  When configuring the Environment Hub in a new org, this section is empty.
Administrative Permissions
  Enable "Manage Environment Hub" to allow users to:

Create orgs for development, testing, and trials.
Configure SSO for member orgs.

General User Permissions
  Enable "Connect Organization to Environment Hub" to allow users to connect existing orgs to the Environment Hub.
Standard Object Permissions
  Grant object permissions based on the level of access required by the Environment Hub user.
Hub Members object:

"Read"—View existing Hub Member records.
"Create"—This permission has no impact on the ability to create Hub Member records. That's because record creation is handled either by connecting an existing org or creating an org from the Environment Hub.
"Edit"—Edit fields on existing Hub Member records.
"Delete"—Disconnect an org from the Environment Hub and delete its corresponding Hub Member record and Service Provider record (if SSO was enabled for the member).
"View All"—Read all Hub Member records, regardless of who created them.
"Modify All"—Read, edit, and delete all Hub Member records, regardless of who created them.

Hub Invitations object:

If you enable the "Connect Organization to Environment Hub" permission, enable "Create", "Read", "Update, and "Delete" for Hub Invitations.

Signup Request object:

If you enable the "Manage Environment Hub" permission, enable "Create" and "Read" for Signup Requests to allow users to create orgs. Optionally, enable "Delete" to allow users to remove orgs from the hub.
d. Select Save.


sumscores instead of factorscores or SEM

Question: Suppose I would like to use sumscores after running a confirmatory factor analysis (CFA) with two latent factors. The items for each factor are then summed and in subsequent analyses these sums are used as dependent variables. I am aware of the problems involved when using sumscores in general, but let's assume I would still choose using sumscores instead of more advanced SEM models for my subsequent analyses. However, I'm wondering about the following. The CFA gave a good fit (rmsea, CLT, TLI, normed chisquare) after letting the error terms of two items of one of the factors correlate. Without allowing for this particular correlation, the fit was sub-optimal. What additional problems, if any, would this correlation create when using the sumscores for the subsequent analyses (regression models)? And would e.g. using saved factorscores instead of sumscores (perhaps partially) solve these problems? Thanks for any guidance!
Answer:
What additional problems, if any, would this correlation create when using the sumscores for the subsequent analyses (regression models)?

Correlated errors are evidence of multidimensionality. It is statistically equivalent to replace a residual correlation with an orthogonal factor on which those 2 items load.  Even if that other factor is just a source of systematic measurement error, it is compounded in the composite when it is present in more than one item.  See the mathematics here:
Little, T. D., Rhemtulla, M., Gibson, K., & Schoemann, A. M. (2013). Why the items versus parcels controversy needn't be one. Psychological Methods, 18(3), 285–300. https://doi.org/10.1037/a0033266
How that effects your estimated regression coefficients depends on whether/how the non-target factor correlates with the other variables in your regression model.  Refer to the causal-inference literature about colliders, confounders, instrumental variables, and such.

would using saved factor scores instead of sum scores (perhaps partially) solve these problems?

The factor scores would exclude variance due to the non-target factor, even if you only estimated the residual covariance.  But then your inferences in factor-score regression would need to account for the fact that factor scores are estimates (with their own SEs), not observed data.  A plausible-values approach could help (http://www.statmodel.com/download/Plausible.pdf ; for lavaan, see semTools::plausibleValues documentation), or Croon's correction (see also the recently developed SAM technique: https://osf.io/pekbm/
Comment: Terrence, great answer, thanks a lot!! So, in general this seems an additional argument for using factor scores instead of sumscores, as the influence of the non-target factor is filtered from the factorscores, which are then "cleaner", whereas sumscores are "contaminated". B.t.w. I noticed that the loadings of the two items with correlating errors,  got closer to zero after allowing their residuals to correlate in the confirmatory factor analysis. Is this a general trend, you think, or coincidental? I expected this to happen but I'm not sure. Thanks again.
Comment: Yes, that is expected because of propagation of errors. Without the residual covariance, those 2 items can't correlate enough, so their factor loadings are increased to make up for that (which should then decrease other items' loadings).
Comment: Thanks again Terence for your answer. But as is often the case, each good answer raises a new question. You previously said that allowing for correlated errors is equal to modeling a second factor, orthogonal to the primary factor, on which the two items load. That makes sense. But what would happen if this second factor is *correlated* with the primary factor? Would that mean that allowing correlated errors is not a solution for that situation, and hence, that allowing the two item residuals to correlate would still lead to wrong or biased factor loading on the primary factor?
Comment: Problem remains, but diminishes as the factors become more redundant (positively correlated).  But I'm not sure your model would be identified if you tried to estimate the factor correlation, and it would be less parsimonious than the correlated residuals (which is equivalent only to an additional orthogonal factor).


How do you manage api keys

Question: I'm looking at building an API and was considering oauth for managing access to the api, but what I'm doing is more of a b2b system allowing businesses to access data to incorporate into their sites. I won't have any b2c at the beginning.
So oauth doesn't seem like the right tool for me, I've been looking for sources regarding building a key based system, but haven't come across anything.
Is something available out there already?
Is it best to just create a hash of some user submitted data or something like that?
Answer: What you need is just something that uniquely identifies the user... Just use a UUID or maybe a hash of a UUID.
Just make sure that this ID is passed over a secure channel, if you are passing it over an insecure channel you may need to implement some method of securing the ID similar to HTTP digest auth.
Answer: Take a look at almost any Web 2.0 site/service.  They all have varying degrees of doing auth and managing API keys.  Flickr, Twitter, Github, etc.
Comment: right, but looking at the services isn't really giving much of an indication on managing keys and auth (not that i can recognize anyway).
Answer: Depending on requirements, in the world of web api's, giving your partners/developers an API key (identification) and requiring they sign the calls (authentication) is pretty standard.  There are lots of ways to spec signatures.  A pretty common one these days is; take all params of the call, a timestamp (+/- 5 min wiggle), a shared secret, and hash it using SHA-1 or MD5 (SHA-1 better).
You can either do implement this yourself or find a partner (there are a few) to do it for you.
Answer: The general approach being suggested here (to use a hash which includes an API key and the current time) are all good - certainly better than including a "password" in the message.
However, there is a crypto standard way of doing this "mung" operation called HMAC.  Well worth looking at if you want something more standard / robust / safe.
Finally there is obviously the "gold standard" from security options - use a digital certificate to sign either all requests (can be computationally expensive) or use to sign an initial request which then generates a limitted use session key (e.g. one API only, with an expiry after 60 minutes).
Alternatively you could use 2-way SSL for the transport layer and simply trust that within the application / API.
Really depends how secure you want it... :]
Answer: I wouldn't just use user submitted data, as that can create a situation where API keys are guessable. Generally, I take some data that is generated by the user, and then combine it with some data that is relatively unique (ie, current system time) and hash that using SHA-1 or something, perhaps change the representation if I don't want it to obviously be a SHA-1 hash, and then use that as the key.

How do you manage api keys


Replace tables with divs in pages generated by views

Question: How can I replace the page layout generated by views with the grid format into something  tableless? I need those columns displayed in css stylished divs.
Answer: The short answer is to edit the View and change the Style Settings from table to unformatted.
Comment: But i want to keep the columns..
Comment: then use css and style the view appropriately: each and every bit of data Views displays is wrapped in all sorts of easily styled divs or spans.
Answer: True, especially if you use Views 3, where a lot of options are available via the UI. Almost everything can be done there short of pure CSS stuff.


Are there any spell guidelines for increasing size in Hermetic Magic?

Question: I saw a short story written by someone who writes a Diedne blog and it mentions the mage using magic to increase size. Is this possible and are there any existing spell guidelines for it?
Answer: It is certainly Muto Corpus 3, as in Preternatural Growth and Shrinking, and also and the spell Assume the Stature of the Giants of El Cid (MoH p.49, MuCo15). Note thoug that after the initial change the cost to continue to change size is not 1:1.
Many spells change the size of a person or creature, or creatures have their size altered to suit the story needs of an Ars Magica saga. The rationale fro the mechanics below is because +2 mags equates to a 10x times increase in overall mass (as per +2 mags for T: Group), which is demonstrated by the maximum group size being 10x individuals.
Therefore each +1 mag in spell design will add up to 3 size levels (note some spells sampled from the core books seem to use +2 levels instead, but there has been much discussion and the fair middle ground seems to be +3 size per mag).
Each +1 mag in spell design will reduce size by 6 levels (again variable by books, some spells seem to be able to reduce by a far greater amount than increase, I think that is primarily because once a creature is smaller than size -4 they have such low wound levels than it is almost moot).
Each +1 Size = +2 Strength, -1 Quickness, +1 point in the wound level damage ranges (see HoH:MC p. 39).
That means changing a soldier from normal (size +0) size to size +2 adds 4 strength, subtracts 2 quickness, and alters their first "light wound" damage range to 1-7 points instead of 1-5. That might not sound like much of a change but it makes the soldier far more offensively oriented. Slower, harder to kill, and able to inflict more damage.
This is also why reducing an opponent down to -3 or smaller is very effective, it might make them quicker but they have radically reduced wound levels for penalties, which is savage in a prolonged battle.
There is also a point at which the difference between the attacker and defender becomes so extreme that the defender really shouldn't be able to "parry" to defend. A rationale is: A mouse can avoid the boot of a man easily due to speed, but if the man successfully steps on it, then it really should be dead, or mostly dead.
Answer: This is absolutely possible. "Utterly change the appearance or size of a person" is a Muto Corpus level 3 effect (AM5e core, page 132). The sample spell Preternatural Growth and Shrinking on page 131 allows a caster to increase a human target's size by 1 or decrease it by 1 or 2 using that effect.


Use of the word "entire"

Question: Why should I use the words "entire group of boys" instead of "entire boys". I know the first one is correct but can't explain why other than it sounds right. I need to explain why as part of a paper.
Comment: Maybe because "entire boys" sounds like the boys' whole bodies instead of parts of boys?  "Entire" defines the group, not the boys, IMO.
Comment: Another option is "the entirety of the boys." But to me that's kind of awkward and sounds like a PE teacher from the 1970s. And it's not a phrase I would use, without boys/boy's/boys' being a modifier, such as in "the entirety of the boys team." But then you could just say "the entire boys team." But "the entirety of the boys group" seems to have a different stress from "the entire group of boys."
Comment: It's just that the construction ***the entire X***, and synonymous alternatives such as *the **complete** X, the **whole** X*, syntactically and logically require a ***singular X***. That's to say it can't always directly replace ***all of the X***, within which ***X*** can be either singular or plural.
Answer: Entire means whole, all parts of.
Now, the entire group (of boys) means the whole group (as opposed to a part of the group), whereas entire boys means whole boys (as opposed to parts of boys — arms, legs, heads).

The entire car -> the whole car, tires, seats, engine, etc
  The entire group of cars -> the whole group, every single car in the group

Use of the word "entire"


Norfolk Pines and water usage

Question: We have two infant Norfolk pines planted in the ground on property in west central Florida. There has been some concern about these trees 'sucking up' all the water in the water table. We are on a peninsula jutting out into St. Joseph Sound near Tarpon Springs. Is this truly a cause for concern?
Answer: I am not a hydrologist or a geologist or anything like that, but we can all read about a phenomenon called "watering-up"; there is a review article here which indicates that when trees are removed the water table can rise measurably, depending on the soil type. Deciduous trees can "divert" falling rain back into the atmosphere by 15% and evergreens do so to 30%. I suppose this means that by wetting the tree bark and leaves the rain never actually makes it to the ground to percolate down into the water table - it rather clings to the surface it lands on and then slowly evaporates. And the rain that does reach the ground is trapped by capillary action and made available to the tree roots, from whence, again, it travels back to the canopy to be evaporated and transpired. Where there are no trees, more rain can reach the surface and more of that can reach the water table. So the presence of trees might be less "sucking up" than preventing percolation down.
But then you must ask whether there would be as much rain? With no trees to put water back into the air the humidity will fall making it less likely to rain. Also there is the issue of fast runoff; when rain hits dry ground not penetrated by tree roots it is likely to head to the nearest city drain to be fast transported to the ocean.
Norfolk Island Pine can grow to 100 feet and looks pretty strange if it is not allowed to grow naturally - I hope you have a large yard for them to grow in and they have enough space.

Norfolk Pines and water usage


Ampscript For Loop

Question: We are displaying hours of operation in the footer.The operating hours are different for every center( some are open from Mon-Sat and some from Mon-Sunday)
If i use For @i=1 to 7 do and that center has Mon-Sat as the working days,its throwing me an error. Similarly, If i use For @i=1 to 6 do then its displaying the output but Sunday is showing blank.
My Code :
SET @rows = LookupOrderedRows(@DE, '0','StartTime DESC',"CId",@TestID)

 SET @rowCount = rowcount(@rows)

 if @rowCount > 0 then

  for @i=1 to 6 do
   SET @row = row(@rows,@i)
   SET @DayOfWeek  =  FIELD(@row, 'DayOfWeek')
   if @DayofWeek == "Monday" THEN
     SET @MonStart = FIELD(@row, 'StartTime')
     SET @MonEnd = FIELD(@row, 'EndTime')
     SET @MStart = FormatDate(@MonStart, "hh:mm")
     SET @MEnd = FormatDate(@MonEnd, "hh:mm")
   ELSEIF @DayofWeek == "Tuesday" THEN
     SET @TueStart = FIELD(@row, 'StartTime')
     SET @TueEnd = FIELD(@row, 'EndTime')
     SET @TuStart = FormatDate(@TueStart, "hh:mm")
     SET @TuEnd = FormatDate(@TueEnd, "hh:mm")
   ELSEIF @DayofWeek == "Wednesday" THEN
     SET @WedStart = FIELD(@row, 'StartTime')
     SET @WedEnd = FIELD(@row, 'EndTime')
     SET @WStart = FormatDate(@WedStart, "hh:mm")
     SET @WEnd = FormatDate(@WedEnd, "hh:mm")
   ELSEIF @DayofWeek == "Thursday" THEN
     SET @ThuStart = FIELD(@row, 'StartTime')
     SET @ThuEnd = FIELD(@row, 'EndTime')
     SET @ThStart = FormatDate(@ThuStart, "hh:mm")
     SET @ThEnd = FormatDate(@ThuEnd, "hh:mm")
   ELSEIF @DayofWeek == "Friday" THEN
     SET @FriStart = FIELD(@row, 'StartTime')
     SET @FriEnd = FIELD(@row, 'EndTime')
     SET @FStart = FormatDate(@FriStart, "hh:mm")
     SET @FEnd = FormatDate(@FriEnd, "hh:mm")
   ELSEIF @DayofWeek == "Saturday" THEN
     SET @SatStart = FIELD(@row, 'StartTime')
     SET @SatEnd = FIELD(@row, 'EndTime')
     SET @SaStart = FormatDate(@SatStart, "hh:mm")
     SET @SaEnd = FormatDate(@SatEnd, "hh:mm")
   ELSEIF @DayofWeek == "Sunday" THEN
     SET @SunStart = FIELD(@row, 'StartTime')
     SET @SunEnd = FIELD(@row, 'EndTime')
     SET @SuStart = FormatDate(@SunStart, "hh:mm")
     SET @SuEnd = FormatDate(@SunEnd, "hh:mm")

  ENDIF

]%%
 %%[ next @i ]%%
    %%[ else ]%%
    %%[ endif ]%%

My Requirement: Display the working days of the center + If the center is open from Mon-Sat only those 6 days should be in the output
Answer: Iterate the same number of times as there are records in your rowset:
for @i=1 to @rowCount do
    /* Print a row */
next @i

Ampscript For Loop


Electric field of a negative charge

Question: How was it discovered that the electric field of a negative charge points towards the charge itself? Is it true?

(Courtesy of wikipedia)
Comment: Small note: "induction" has a specific meaning in electromagnetism having to do with the effect of having other materials present. For this question you can just say "the electric field of a charge."
Answer: The electric field of a negative point charge points towards the point charge as a result of the definition of the electric field of a point charge.  To see this, recall that the electric field of a point charge $q$ is defined as
$$
  \mathbf E = \frac{1}{4\pi\epsilon_0}\frac{q}{r^2}\mathbf e_r
$$
where, $r$ is the distance to the charge, and $\mathbf e_r$ is the outward pointing radial unit vector field emanating from the location of the charge.  If $q$ is negative, then we see that the electric field points in the direction of $-\mathbf e_r$, and therefore it points radially inward.
You might then ask "well this is fine, but why is the electric field defined in this way?  Couldn't we have defined the electric field in such a way that the electric field due to a negative point charge points radially outward?"
Well, the definition of the electric field is motivated by Coulomb's Law, the empirical fact that the electrostatic force exerted by a point charge $q_1$ on a point charge $q_2$ is
$$
  \mathbf F_{12} = \frac{1}{4\pi\epsilon_0}\frac{q_1q_2}{r^2}\mathbf e_{12}
$$
where $\mathbf e_{12}$ is the unit vector pointing from charge 1 to charge 2.
The idea in defining the electric field is that we want to associate a vector field (which we call the electric field) to each point charge individually such that if we multiply that field by any other charge (which is usually called a test charge), then we obtain the force that would be exerted on the test charge due to the original charge.  If we factor $q_2$ out of the right hand side of Coulomb's law, then the rest of the stuff is precisely such a vector field associated to the charge $q_1$
$$
  \mathbf F_{12} = q_2\underbrace{\left(\frac{1}{4\pi\epsilon_0}\frac{q_1}{r^2}\mathbf e_{12} \right)}_{\text{stuff that only depends on charge 1}}
$$
so we define the electric field as the stuff in parentheses.  Notice, however, that we could just as well have factored out $-q_2$ in which case the electric field would have been opposite in sign to the conventional definition, and in this case, the electric field of the negative charge would have pointed radially outward by definition.
Comment: I think the equation is:
F=k (q_(1  ) q_2)/r^2
Answer: There's a few ways to answer this. The best way to understand this is that it's true simply by the construction of electromagnetic fields, and field theory. In general, a field will always point from higher to lower potential energy. This is represented by the equation:
$$\vec{E} =-\nabla V $$
This means that the electric field is the negative gradient of the electric field. The reason it is constructed this way is because any object in a potential energy field will accelerate towards a lower potential, so using the above equation, the field lines point in the direction of the force.
A positive electrical charge has more potential energy the farther it is from the negative charge. As it gets closer, it loses potential energy (which becomes kinetic energy). This means that the closer you get to the negative charge, the less potential energy it has.
$$U=\frac{1}{4\pi\epsilon}\frac{q_1q_2}{r}$$
Since $q_1$ is negative, the potential energy decreases (becomes more negative) as r decreases.
So in conclusion, just think of an electric field, or any field, as pointing in the direction of decreasing potential energy. This is simply the construction of fields.
Comment: If I think of an electric field, or any field, as pointing in the direction of decreasing potential energy, then if we bring a positive test charge near a source charge which is positive as well, then in bringing them closer the potential energy will increase and the electric field points towards decreasing potential energy. What if we pull away a negative charge from a positive one then its potential energy will increase in the direction where it is supposed to be decreasing in case of a positive test charge?
Comment: @SamamaFahim Yes, bringing a positive test charge closer to a positive source charge will increase its potential energy, so the electric field of a positive source charge points away from the charge. Yes, pulling a negative source charge away from a positive one would **increase** its potential energy. This seems to run counter to what I said above, but I used the example of a positive source charge for a reason. There is a difference between **electrical potential** and **electrical potential energy**.
Comment: @SamamaFahim Electrical potential energy can be calculated from electrical potential with the equation $U=qV$. What the field really corresponds to is the direction of decreasing electrical **potential**, not necessarily electrical potential energy. When the test charge is positive, the electrical potential energy has the same sign as the potential. When it is a negative test charge, the electrical potential energy has the opposite sign. Does that clarify it?
Answer: According to me positive charge is present in nucleus so it will attract towards negative charge and -charge is present outward nucleus so attraction is radially outward.

Electric field of a negative charge


Is there any way to edit partial design using Scriban?

Question: Is it possible to style the partial design using the scriban template. For example, I just made the new header partial design for my new site, and I am now clueless on how to style it. I have been styling my other components using Scriban, beacuse I find it really easy to use (for me at least).
What is your preffered way of designing/styling the header partial design in SXA Sitecore?
Answer: A partial design works just the same as the other items/pages when it comes to adding components and styling those. You can open the partial design in the Experience Editor and add all the components you want - including the variants (where you can use Scriban) and styles if needed.
You will notice that a partial design has a layout definition, so you can also edit the layout just as you are used to with other items.
More information in the official docs: https://doc.sitecore.com/xp/en/developers/sxa/102/sitecore-experience-accelerator/create-and-change-a-partial-design.html
Comment: So I can just add the new for example Link List with the Scriban template variant on the header partial design, and it would look like the way I designed it, with CSS and everything?
Comment: Yes, your partial design can use the variants (with Scriban) for any component.
Comment: Thank you for explaining to me properly!


Why do holes appear black during the day?

Question: Why is it that when an object has a small hole, the hole appears dark during the day?  Why doesn't sunlight fill the enclosed space and make the hole appear to be the color of the interior walls?
Comment: The hole is a very basic version of a black body: https://en.wikipedia.org/wiki/Black_body#Cavity_with_a_hole
Answer: Long story short: because points in the hole can't see very many bright things that could light them up.
Objects in the room are lit during the day by the sun if they have a direct line of sight to the sun.  These sunlit objects receive a large number of photons from the sun.  They absorb some of them and emit the rest of them in all directions.  These "secondary" light rays hit other objects, lighting them up, but less than the sun lit up the sunlit objects because of that absorption.  These objects also absorb light and emit the rest, so on and so forth.
The "brightness" of an object is based on the total number of photons that hit it.  If we add up all of the primary, secondary, tertiary, etc. rays we can see how bright any one point will be.
If you have a hole, it's hard to get light in there.  If you think about the perspective of a point in the hole, it's going to be lit up by all of the rays from the room which can hit this point.  Very few of those come from outside the hole.  If you look most directions inside the hole, you see one of the other walls of the hole.  That means the illumination from most directions inside the hole has undergone many many bounces to get there, each one diminishing the light.
If you have a hole constructed of a material which absorbs very little light, such as white styrofoam, you'll find that the darkening of the hole is very minimal.  This is because less light is absorbed with every bounce, so there's more opportunity for the light to take paths which lead to any nook or cranny within the hole.
You may also notice an interesting effect with color here as well.  If, in your very white hole, you paint one green wall, the entire hole will look green.  This is because many of the paths bounce off of the green wall, absorbing non-green light.  The light that succeeds at bouncing many times (thus lighting the hole effectively) will mostly have hit the green wall at least once, causing the entire hole to become green.
You can see a similar effect if you hold a colored object up to a white wall.  You'll see that the wall takes on the color of the object.  This is called "diffuse reflections."
Answer: Shallow holes ARE well illuminated in daylight.
One reason 'a hole' is dark,
is that a deep hole has much more surface area than the aperture area, and
only light that shines on the aperture (proportional to the aperture area
and the illumination) illuminates that area (hole-bottom area plus sidewall
area).  So, on average, brightness of the hole is that of the
material times the ratio of aperture area to the aperture-plus-sidewall.
For a 1/4 inch cylinder hole, 1.5 inches deep, that ratio is 1:7
A second, trivial, reason that holes are dark, is that one often
examines such a hole by directing light at it, and looking straight down.
Alas, your head blocks any light directed straight down.  So, the light
is shined from the side and directly illuminates only the sidewall of the hole; you don't
see that because your viewing angle is edge-on to that side.


Is it possible to install Ubuntu 20.04 in MacOs M2 chip?

Question: I am using ubuntu 20.04 in UTM virtual machine, but gazebo is not properly working. So I decided to install ubuntu 20.04 as dual boot but unable to make in M2 chip, any source from where I can install Ubuntu 20.04 as a dual-boot option with MacOS M2 chip for ROS 1, or is there an alternative method to use ROS 1 on higher version of Ubuntu.
Answer: Docker is a good alternative you can try. You can find the docker images for ROS- Distros and gazebo in OSRF Docker Images.
Also, I found this Docker for Robotics playlist quite helpful and easy to understand and there are a lot other resources you can try.
Hope that helps.


send email to email field in specific content type content creation

Question: I'm using Drupal 7. I can't find out how to send mail to email field in specific content type content created. like, someone create content and fill out email field in that content, then site should send email notification to that email field.  Is it possible? I've research Rules but with Rules basic function can't do this.
Answer: I am sure this can be done using rule, you just need to use the replacement pattern there in rules action, all the fields value are available there like [node:title] for title of  the node and [node:body] for the body of the node, similarly something must be avaiable for your email field, you just need to put that replacement string in the "To value" in rules action.
Hope it helps.
Answer: if i am right, you want to send an email if new content was created?
I don't have experience with "Rules" but you could build your own custom module for that.
You only need to hook into all events you might need for that.
For example:
hook_insert: Respond to creation of a new node
This requires basic understanding of Drupal Module System.
Complete List of Hooks: http://api.drupal.org/api/drupal/includes!module.inc/group/hooks/7
Module developer's guide: http://drupal.org/developing/modules
Greetings.


How to change a field type in production instance using a change set?

Question: We need to change a field type (Number to Currency) in the production instance using a change set. And we can't change the field type directly, because there are references of those fields in triggers and classes.  we can remove the references and change the field type, after that we can add all references again. Then we send that change set in to production those changes will be apply?
Answer: Firstly comment all your field references in sandbox and change the field type. Later un comment all the previously commented code.
Then prepare a change set and deploy to production.
Comment: Do you know what will happen to existing production data in this case (e.g. if the custom field field is Number in production but a changeset deploys an update making that field Text)?
Answer: It can be done using the metadata api. Flosum is the tool which automates such changes since it leverages the salesforce metadata api in the backend. It can also help with field level security and other issues that are quite hard to solve.
Answer: You cannot do it in a change set AFAIK.
The process would be to:

Comment out the use of the field in all code in production
Change the field in production
Put the code back to the way it was

It is a stepwise process and not necessairily an easy one if the field is used in many places. Test methods using it in asserts or the field being required to get proper values is also an issue.
Answer: I just tested this from a Developer Sandbox to a Full Sandbox. It is possible to do the following:

Comment out references in the Dev sandbox
Change the custom field type (my change was from Text to Text Area)
Restore the references
Create a change-set including only the changed custom field
Successfully deploy the change-set to the Full sandbox

Note the benefit of this approach is three-fold (1) you don't have to touch the apex in the target system (2) you don't have to do any data migration (3) deployment has no downtime
EDIT: Note, I have not tested this from Number to Currency, so it's possible it may not work for those data types
Comment: Text to text area is not an issue. Number to Currency is an issue https://help.salesforce.com/articleView?id=notes_on_changing_custom_field_types.htm&language=en_US&type=0
Comment: Thank you, I have edited my answer to note that I have not tested it for those data types
Comment: It may be possible in some types but general rule is to comment code, verify data and export it. Change field. Uncomment code. Doing via change set when field exists with data and references is not best approach.
Comment: Can you elaborate on why that's not the best approach, e.g. in my example?
Comment: Data Loss. In your example it is fine but the OP is asking about Number to currency. Additionally it all depends on each situation as when I have attempted to change field types via change set I always threw an error that I could not do it. You just happened to try with one of the few that you can change via change set without worry. So a general answer, unless you know what you are doing, is always the least risky. Hence best practice. Best practice is not always the easiest. If you would like to ask a question please do, comments are not for extended discussion
Comment: It looks like I wrongly downvoted your answer then, if you edit it, I will be able to correct that


storing energy (as mass)

Question: When chemical energy is released mass is reduced, if only by a negligible amount. Presumably that's true for all energy.  And presumably that works in reverse as well: storing energy involves an increase in mass. It seems to follow that moving some object against a gravitational gradient, increases the mass of the object -- potential energy is being stored.  Somehow that's difficult to understand. Is it really true?
Comment: Wow, you got a response from Sean Carroll? Nice ;-) That will be great for this site
Comment: I also asked the question on [ http://goo.gl/52V3t ] (Google+) and got a good answer in the comments. I can't post it here because I don't have authority to do so before 8 hours.
Answer: From your question and your comments on Google+, it appears you think there is a problem with having the increased energy stored in the gravitational field since the gravitational field is really just curved space-time.  That is not a problem, curved space time does have an energy density and in fact can cause additional curvature of space time. That is why general relativity is much more difficult than Newtonian gravity or electrostatics - the equations of general relativity are non-linear exactly because the energy stored in the curvature of space-time causes additional curvature of space-time.
In fact, John Archibald Wheeler conceived of the possibility of a gravitationally bound object that is only made from gravitational waves.  From Wikipedia:

Wheeler introduced the notion of geons, gravitational wave packets confined
  to a compact region of spacetime and held together by the
  gravitational attraction of the (gravititational) field energy of the
  wave itself. Wheeler was intrigued by the possibility that geons could
  affect test particles much like a massive object, hence the slogan
  mass without mass.

It is believed that a geon could be formed, but that the "particle" would dissipate due to gravitational waves that escape from the object, thereby reducing it's mass.
So, to get back to your question, two different configurations of particles that had the same total rest mass but different gravitational fields would, indeed, have different overall total mass/energies due to the different amount of energy stored in the differently curved space-times around the objects.
Comment: It sounds to me that this answer and the one by @Manishearth are both saying that the additional mass is stored in the field/space itself. That seems like a strange concept, but that's why I asked the question.  So to summarize, if one had an isolated system of masses, enclosed, say, in a rigid container, and modified it by separating the internal masses, then the system as a whole would have more mass than before. That could be measured, say, by applying a force to the container and checking its acceleration. The before and after results would be different. Right?
Comment: Yes. That is correct. It would have taken work performed by something outside the box to move the masses into the configuration with the masses more separated. That energy is stored in the curvature of space and would have to be accelerated also.
Comment: The only additional caveat is that some of the gravitational energy could be outside of the box itself. Also, whenever any mass is accelerated there will be some gravitational waves generated - similarly when a charge is accelerated, some electromagnetic waves are generated. But none of this changes the fact that curved spacetime does contribute to the mass/energy that curves spacetime.
Answer: I'm explaining this for an electrostatic situation first, as gravitational potential energy is a strange concept in GR. The basic explanation should be the same for gravity, too, just that the formula may be different.
Let's take two positive point charges, and let's bring them together. So we did some work.. Where did the energy go? It wnt into the field (you'll find this written in many places as 'the configuration of the system'). And electric field requires energy to be generated. So, there is an energy density, $\frac{1}{2}\epsilon_0E^2$ associated with the field at every point in space. Integrating this formula with respect to dV will give us the energy enclosed in a certain area. So basically, this energy is spread throughout the universe (or atleast the local region). So if you draw an imaginary box near these charges (but not containing the charges), you will find that its mass-energy has changed. Even though the box has no massive particles in it.
One way of looking at this energy stored in an electromagnetic field is that it comes from the photons which mediate the field. Wherever there are field lines, there have to be photons which transmit the field. These photons have an energy, thus giving rise to the net energy density.
A similar thing exists for gravitation, though here the energy goes into the curvature of space. So no, moving a point body against a gravitational gradient does not increase its mass, but it increases the mass of its surroundings, however 'empty' the surroundings may be. If the body is not a point body, then its mass can change, as the field has some energy stored inside its volume as well. But this new mass won't exactly be part of the body's mass, it will just be in the same spot as the body. The rest mass used in the relativistic expressions will not change unless the body is heated by the change in PE (In this whole explanation, i have assumes an external force is moving the masses around. If there is heating involved, the masses will change due to the mass-energy equivalence)
Summing up, potential energy is stored in the field itself and not inside the masses that make up the field.
Answer: Let's say we have thousand identical masses spread around in space. These masses coalesce into one large mass, without any energy being radiated away, which means the large mass will become hot. Mass is conserved, so mass of the large mass equals thousand times the mass of one small mass.
Now one thousandth part of the large mass is winched up, so it's far away from the large mass, floating in space as in the beginning. It's like an original small mass, with some heat added into it.
We want to know where the mass of the fuel of the winch went. Into the lifted mass went a mass that is equal to the mass of the heat energy.
Lifting the next chunk, identical to the previous one, will require one thousandth part less energy, because gravity field is now one thousandth part smaller. This energy came from the winch fuel, and was stored into the large mass. As there are 999 of these chunks, almost the same amount of energy that went into the small mass, went into the large mass. The exact ratio is 999/1000.
EDIT:  Let's consider Alice, who holds a rope, and Bob, who descends into a gravity well, sliding along the rope, wearing gloves. The gravity field is homogeneous, so Alice will say that weight of Bob does not change. Bob will say that the gloves get hot, and their mass and weight increases.
Now let's say Bob slides down so slowly that any extra heat is radiated away. In this case Alice will say that mass and weight of Bob decreases. Bob will say that his mass and weight do not change.
If braking energy leaves Bob, Bob loses mass.
If Alice is lowering Bob into a well, mass moves from Bob to Alice. The reverse process of this is Alice pulling Bob up from a well, mass moving from Alice to Bob.
When Bob is descending, there is NO energy moving from anywhere into Bob, although physicists may so claim. Alice will confirm this. Bob's weight newer increases, during descending process, that's what Alice will say.
Here more about Bob and Alice
Comment: Sorry, your answer does not make any sense. -1
Comment: Mass is conserved, so when I walk down the stairs, mass of earth is unchanged. That is the idea in the first paragraph. Any objections on this? (We consider Kartsa to be part of the Earth)
Comment: Yes, the mass of the earth is the same. And the mass/energy of the whole system which consists of the earth, you and the mutual gravitational field of you will be constant. However, the energy in the gravitational field will decrease very slightly and your heat energy (and thus your mass) will increase very slightly.  Instead of walking, imagine you fell off a high building - your kinetic energy, when you hit the ground will be converted to heat. The mass/energy of the heat came out of the gravitational field.
Comment: Does general relativity really tell that I can change energy of space by 2000 Joules by walking downstairs? I bet that if we actually calculated the change of energy of space, it would be about billionth of a Joule.
Comment: No, it wou ld be 2000 joules. Yes, it would be a billion billion billionth of the energy of space. But its still 2000 joules.  A joule is as it is a pretty small unit. Look at it this way: if you move one meter, then in the eyes of the universe, how much do you move? One meter. The fact that one meter is insignificant in thw eyesof the universe is a different matter.
Comment: Energy of space decreases by 2000 joules, when I collapse gravitationally downstairs?

storing energy (as mass)


How can I pay off my school loans (denominated in dollars) with Euros without an exchange fee?

Question: I will soon begin earning an income in Europe and
paying off school loans in the U.S.
Any way to do this without paying an extra exchange fee?
Comment: I won't answer because I am unsure, but perhaps your loan servicer would accept Euros?  If they are a big bank, they might have a EU arm?
Answer: You will always pay exchange fees when you exchange currency. The minimum would the the price arbitrage - the difference between the buy and sell prices.
Shop around and check where the exchange rate is the most favorable for you and go there. Don't just look for "no fees" signs because the fees are still charged, through a less favorable exchange rate. Nothing is free, and currency exchange services included.
You would probably get better rates with wire transfers than with checks or exchanging cash.


Data privacy on shared external HDD

Question: I have a shared external HDD with my family and want to encrypt/secure my data. Now we already have a software that password protects the overall hard drive but once the HDD is accessed, all folders and files are viewable. I know the long route of 7zipping a folder and assigning a password but it takes a really long time to just zip a file, 150GB+ data can take almost 9-10 hours to just create a zip file not to mention deleting the files are the zip is created. Is there any way that can help me encrypt a folder on an already encrypted drive?
Comment: Welcome to Software Recommendations! Could you please **[edit]** your question to include what OS you are using, and whether the software must be free (or how much you'd be willing to spend at max)? The file system used might also be of interest. There are several solutions, from container based (like Veracrypt in Romeo's answer) to file based, which may apply based on that.
Answer: One possible solution is VeraCrypt. You can use file (or partition) which you can mount as disk drive. It is very secure and very stable software. And its free.
To add a bit more info: veracrypt is available for Windows, MacOS, Linux, FreeBSD, Raspberry Pi OS.
P.S. No affiliation with developers of this product.
Answer: I rather suggest encryption of individual files or directories. You can decrypt them specifically when you need them, without having to decrypt all files. This encryption is slower than a hard disk encryption, but much more targeted. Possible solutions are Cryptomator, File Lock PEA, AESCrypt.

Data privacy on shared external HDD


Iframe 4shared invisible chrome and ie9

Question: The following code is not being visible in the browser chrome and IE9 seems not to open or invisible generated by this code and playlist on 4shared

for test: http://gamermag.com.br/index.php/screenshots-e-wallpapers/
Comment: Did you try to set the values in quotation marks? ``
Answer: As @dop-trois said the values should be in quotes.

Remember that some websites prevent loading their pages in iFrames with JS similar to below so if you try loading a site like that (twitter for example) it won't show anything or redirect your whole page to their site. Just be careful of that.
if(top.frames.length > 0)
    top.location.href=self.location;

Iframe 4shared invisible chrome and ie9