Can geometry be considered a law of physics instead of law of logic?

Question: Geometry deals a lot about mathmatics of our dimensions of space. But the laws of logic don't require dimensions at all. There could be a reality where there weren't any dimensions at all so they couldn't have geometry (although if there were no dimensions, there would be no life so nothing even could think of it if it was there). So if it were possible for them to not have geometry, could you conclude that geometry is just part of our laws of physics?
Comment: It is not a law of logic. It is the mathematical theory of space, that can be applied to physical space.
Comment: I cannot think of anyone who thought that geometry was part of logic, even the logicist Frege did not. Geometry has the same status as analytic dynamics. One can take them as abstract mathematical theories, and some parts of them are only that, or one can take them as mathematical models of physical phenomena, in which case their laws *are* laws of physics. The geometry of Minkowsky space is a model of special relativity, for example, and the structure of its cones then expresses the law that the speed of light is the limiting speed.
Answer: Yes, absolutely. That is Mathematical Anti-realism (ie, that math doesn't have a seperate realness, like say Mathematical Platonists believe). I disuss how numberlines can be thought of as abstractions of continuous symmetry operations, here: Could our natural numbers be non-standard?
But, mathematics is not just numbers. Logic is clearly important. The view that mathematics reduces to logic, is called Logicism. Personally, I see logic as a domain of abstraction, one that specifically considers the entailment of systems that can be unambiguously modelled, in a way that makes alternative histories where another of a set of options or decisions would have happened explicitly, or been very likely. I think of the ruthless logic of electrical circuits, or computer code. Coders I know react very strongly against the idea what they do is math. It's about if/then/or, and comparing the entailment of explicit rigorous models to results in the world (and so logical deduction). Discussed here: Why is a measured true value "TRUE"?
The 'laws of logic' are to me, suspect. It's a legacy of axiomatic thinking. Look at the Parallel Postulate. It seemed like a 'self evident elementary truth', then you get Minkowski space, and the Relativistic recognition that Euclidean space is not the default. The Law of the Excluded Middle is similarly suspect. 'Natural numbers' are about what is intuitive, not what is fundamental, discussed here Relationship between real quantities and numbers, and similarly with a given set of axioms or rules - as Wittgenstein inveighed, look to the game, to understand the rules. I'd look to Hofstadter's work, to Strange Loops, and the idea of Tangled Hierarchies, to see that, more interesting than law-based axiomatic thinking, are feedback and emergence, what happens beyond First Order Logic. As I see it we aim towards a meaning-cosmology that situates us, so as to be able to act effectively. We try to interface between our sections of understanding, with more and more versatile concepts. See

Is the idea that "Everything is energy" even coherent?
Is the idea of a causal chain physical (or even scientific)?
Why is the universe governed by very few laws of high generality instead of lots of particular ones?

Another way I would caution about overconfidence in regard to the scope of geometry, is to consider entropy. I would argue modern science is property-dualist, between mass-energy, and entropy. The assumption has been entropy is a secondary characteristic of mass-energy, simply it's arrangements. But as Quantum-gravity has stayed stubbornly out of reach, it seems increasingly clear information flow is a key bridging framework: propagation of measurements in QFT, light-speed signals in Relativity. Wheeler proposed the It From But paradigm. Loop Quantum Gravity works with what we see as emergent from a spin-lattice network, time and space as emergent from a shifting flow of information. And my favourite proposed direction Constructor Theory, looks at what physical transformations of systems are possible as fundamental, the topology of their symmetry operations. So, instead of entropy getting subsumed into geometry, we may find time as emergent from entropy, as discussed here: Are the concept of time and space apriori to natural language or are they just references within natural language? with I think the implication space dimensions are emergent too, following Noether's Theorem that they can be understood as the result of sets of continuous symmetries equivalent to conservation laws. Modern physics requires we seperate time as a dimension from time-ordering, because of the relativity of simultaneity. We have to understand logic, and the entailment of events, seperately from the idea of reference to a universal clock, in the same way Minkowski space leaves behind neatly ordered Euclidean space; and the Bell Inequalities change how we understand locality.
For me the 'universality' of geometry is really about what experiences are intersubjective. We can use different forms of logic based on different experiences and intuitions, but we all necessarily experience consequences of specific degrees-of-freedom - if we didn't, our chemistry wouldn't work. Intersubjectivity is the real key to understanding a 'global' or shared reality with laws in common between experiences, it is the symmetry operation of 'if I were you and you were me'. The co-arising of mind and world, of self and other. Logic and mathematics are sets of abstractions, the domain of the Private Language Argument, and so necessarily they exist in this intersubjective space where we are trying to play certain language games, to extract transferable information, and find processing shortcuts like local or continuous symmetries, to 'chunk' our experiences and make our communication more capable.
See Do we create knowledge? and According to the major theories of concepts, where do meanings come from?
Comment: "*All I can say is, Wow, what a way to leave the solar system!*"
Answer: Geometry is derived from mathematics i.e., a particular form of geometry can be associated with a particular form of algebra within mathematics. In this sense geometry has nothing to do with logic, but lots to do with the parts of physics which have algebras embedded in their description.
Answer: Mathematics is infinite -- the number of possible postulates, and resulting derived mathematics principles, is uncountable.
Geometry is one category of derived consequences.  There are multiple possible geometries.  That one, or several, of them manifest in our world, IS "physics", or at least an empirical discovery.  It is not logic.
What mathematics, if any, and what LOGIC (logic is also infinite, like math is) manifests in our world is a CONTINGENT fact, it is not a logically derivable one.
Answer: Geometry is the art (technique) of measuring the land (geo-metry).
This is somewhat lost on English speakers, but is apparent in French, for example, where "géomètres" means land surveyors.
By extension, geometry is the logic of space, and by further, relativist, extension, the logic of space-time.
The purely formal treatment of the logic of space or space-time is geometry in the mathematical sense.
Thus, mathematical geometry is derived from the technique of the land surveyors of Euclid's time.
We had to wait for Einstein, a scientist, not a mathematician, to arrive at a good mathematical model of the geometry of space-time.


How to use Magento Currency in CMS Page

Question: I have 3 difference currency on my Magento store.
I want to add Delivery options with prices but I want price to change for selected currency.
Comment: change delivery price by changing store
Answer: I think the way to go here would be implementing a widget. Then you could define the price in your base currency in the widget, and the widget then converts it to the actual currency used in the frontend. Then you can just add your widget to the page and define a price in your base currency
one of many tutorials for creating a widget can be found here: http://code.tutsplus.com/tutorials/custom-widget-development-in-magento--cms-23015
a good starting point for converting the currency can be found here: http://blog.chapagain.com.np/magento-convert-price-from-current-currency-to-base-currency-and-vice-versa/
Answer: Try to give different delivery price depend on store view..
As if you have a store with currency $ and the name of the store is us.. Then you need to change the store to US. Then add a different price for that store..
You can see more details here.
Happy learning
Comment: I have store views for Languages. All StoreViews can access all Currencies.

How to use Magento Currency in CMS Page


How to draw OpenGL ES context above the camera's video in iPhone?

Question:
Possible Duplicate:
OpenGL Layer on top of Video on iPhone?

I want to draw some OpenGL ES context above the camera's video in iOS 4.
I am using this tutorial from Apple to get the video frames from the camera:
http://developer.apple.com/library/ios/#qa/qa2010/qa1702.html
Works like a charm. I am able to get video frames from the camera, and display them.
But - I want to display some OpenGL ES drawing above the video. That context should have a transparent background, and display only what I draw.
The code used to display the video:
<code> AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:session1];
</code>
UIView *aView = [self view];
 previewLayer.frame = aView.bounds; // Assume you want the preview layer to fill the view.
 [aView.layer addSublayer:previewLayer];
The code used to display the OpenGL drawing:
<code>  glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer);
</code>
[context presentRenderbuffer:GL_RENDERBUFFER_OES];
Problem is - I can only draw a full OpenGL layer (meaning, with a background, say black) and cannot only draw some artifacts of opengl, with a transparent background (so that the user can see the video below the opengl context).
Thanks alot,
fiod
Answer: Render a plane textured with the camera images behind your 3d model


Why didn't Collin Sullivan kill Madolyn?

Question: Near the end of The Departed, we find out that Dr. Madolyn Madden was informed that Sullivan was Costello's mole inside the MSP. She confronted Sullivan about it and gave him the silent treatment during Costigan's funeral which should have given Sullivan a red flag. It's only a matter of time before Madolyn tells someone about everything she knew. Why didn't Sullivan kill Madolyn for simply knowing that information? He even killed Costello once he admitted to being the FBI's informant. What's stopping him from doing the same to some shrink?
Comment: He not only didn't kill Madolyn. He even didn't try to eliminate the tape.
Answer: He didn't kill her because she was carrying his baby (or possibly not).
Of course, that could all change after her shunning him at the funeral, but he doesn't have time to kill her, because he himself gets killed when he gets home.
Comment: First of all, he gets killed because (likely) Madolyn told Dignam about the information. Second, you say he didn't kill her because she was carrying his baby? Okay, so he could simply destroy the document against himself. Why didn't he do that too?


How to extract full icon from figma file

Question: I have got the following icons in the Figma file and I want to extract them as a whole as SVG, but when I click or control-click the border as well as the play icon, and choose copy as SVG, I only get the border (as shown below). How can I make copy the whole icon as an SVG or if it is even possible?
Comment: I can't reproduce the problem here, it works for me. Are you sure all objects you want to copy are inside the group?
Answer: Make sure all objects are inside the group you selected. Alternatively you can to export the icon as SVG.
Select the whole group, make sure all objects are inside the selected group.
On the right side panel, in the Export section add an export format + and change it to SVG. Click on Export Group 1 (or whatever the name of your group) and you'll have the SVG with all elements.
Alternatively, instead of a group add all objects in a Frame (shortcut F) and export the frame. That way you can have some padding in your exported icon (useful to export square icons when the outer bounds are not in a square shape).


Applications of fork system call

Question: fork is used to create a copy of process from which its called.
This is typically followed by calls to exec family of functions.
Are there any usages of fork other than this?
I can think of one. Doing IPC with pipe functions.
Answer: Yes of course. It's quite common to start a process, do some data initialization and then spawn multiple workers. They all have the same data in their address space and it's Copy On Write.
Another common thing is to have the main process listen to a TCP socket and fork() for every connection that comes in. That way new connections can be handled immediately while existing connections are handled in parallel.
I think you're forgetting that after a fork(), both processes have access to all data that existed in the process before the fork().
Comment: There's also the "fork, let one instance continue work and the second check-point the state of computation to stable storage".
Comment: I guess this cannot be achieved using just multiple threads.. is it because in order to allocate new resources(TCP Sockets) we need new processes and threads alone cannot do this as they share common resources??
Answer: Another use of fork is to detach from the parent process (falling back to init, process 1). If some process, say bash with pid 1111, starts myserver which gets pid 2222, it will have 1111 as parent. Assume 2222 forks and the child gets pid 3333. If now process 2222 exits, the 3333 will loose its parent, and instead it will get init as its new parent.
This strategy is sometimes used by deamons when starting up in order to not have a parent relationship with the process that started it. See also this answer.
Answer: If you have some kind of server listening for incoming connections, you can fork a child process to handle the incoming request (which will not necessarily involve exec or pipes).
Answer: A "usage" of fork is to create a Fork Bomb
Answer: I have written a small shell, and it was full of forks (yes this is exec..), especially for piping elements. wikipedia page on pipe

Applications of fork system call


Command Prompt - Directory Listing function

Question: Is there a way to produce a directory listing which only returns the first level of folders and none of the sub-folders? This list will then be outputted to a text file.
Answer: Actually non-recursive is the standard. If you only want directories, try this:
dir *.

In comparison this will list only directories but recursively:
dir *. /s

Comment: Brilliant, just what I needed. I also added the /b switch to return the folder names only.


What is the subdivision corresponding to the blowup of a toric divisor of a singular toric variety?

Question: Let $X$ be an affine toric variety corresponding to the cone $\sigma$. If $X$ is smooth, blowups of toric strata correspond to star subdivisions of $\sigma$. Suppose that $X$ is singular and let $D \subseteq X$ be a toric divisor corresponding to a ray $\rho \subseteq \sigma$. What is the subdivision of $\sigma$ corresponding to blowing up $D$? What about the toric strata of higher codimension?
Comment: The blow up of a divisor yields an isomorphic map
Comment: @Henri Only if the locus of the blowup is smooth, I am asking about the singular case. E.g. if you blow up the divisor $x=t=0$ in $xy-tw=0$ you resolve the singularity (this corresponds to a toric variety that is the cone over a square).
Comment: The blowup is an identity if and only if the center is the Cartier divisor (not necessarily smooth).
Comment: @Sergey Yeah, I just wanted to communicate that there are examples when it is not an isomorphism but you're right of course.
Answer: I guess the answer is that, in general, these subdivisions can be rather complicated. In the divisor case, one can obtain the subdivision as follows (the general case is similar):

Let $\check{\sigma}$ be the dual cone and let $P$ be the monoid of integral points of $\check{\sigma}$. Suppose that $P$ is generated (as a monoid) by $e_1, \dots, e_n$ and take all the generators $e_{k_1}, \dots, e_{k_m}$ that are not in $\rho^{\perp} \cap P$. Then these generate the ideal $I_D$ of $D$ in the monoid algebra $k[P]$.

By reversing the logic in section 3 of https://arxiv.org/abs/1612.09206, the subdivision of $\sigma$ by blowing up $I_D$ is the cut locus of the PL-function $\min\left(\langle \cdot, e_{k_1} \rangle, \dots, \langle \cdot, e_{k_m} \rangle\right)$.
Comment: And in the dual picture the answer is quite easy: if the divisor D corresponds to the facet F given by inequality $f≥0$, then to obtain the blowup you just move this facet inside, i.e. replace it by inequality $f≥\epsilon$.
Comment: The blowup $f : Y \to X$with centre $Z\subset X$ is the terminal object in the category of morphisms $f': Y' \to X$ with $(f')^* Z$ being a Cartier divisor on $Y'$ (pullback in the sense of sheaves of ideals).

So you want the minimal subdivision, such that the preimage of your divisor D is Cartier. This means that there exists a piecewise-linear function that takes value $1$ on the ray $\rho$ and takes value $0$ on all other rays (old and new).

Then your answer 2 and references solves this problem.


Difference in time between sunset and moonrise on a full moon

Question: So as a Sailor I have experienced some times where sunset and moonrise are very close together (this happens when it's full moon) which is particularly beautiful. I assumed that this was always the case but looking more closely at time difference between sunset and moonrise they can change quite dramatically.
2019 (Porto-Vecchio France)
Date        sunset   moonrise  diff
04/20       20:08    21:24     1:16
05/19       20:39    21:20     0:41
06/18       20:59    22:05     1:06
07/17       20:54    21:31     0:37
08/16       20:21    21:12     0:51

As you can see there is some degree of variation, can someone explain why this happens and how I can find out where and when they are closest together?
Comment: All of your dates are off by 1 day for the Full Moon (according to the Astronomical Almanac for 2019). Also, you need to look at the sunset/moonrise OR sunrise/moonset that is closest to the time of Full Moon to determine how close they occur. If the Full Moon is at 10 o'clock in the morning, then you should not be comparing the time of moonrise that occurs at 9 o'clock at night.
Answer: Technically, the Moon is Full at a specific time. Therefore you need to check the time of sunset/moonrise OR sunrise/moonset that is closest to the time of Full Moon. Then you can more accurately compare the variation. Here is the list for 2019 created using the U.S. Naval Observatory website.
Longitude E9° 8', Latitude N41° 35'
All times in Universal Time (UT)
Date of Full Moon   -------- Sun ----------     -------- Moon --------  Moon-Sun
     Date    Time              Date    Time              Date    Time     Diff
 1/21/2019    5:16   Rise  1/21/2019    6:45     Set 1/21/2019    6:54   +0:09
 2/19/2019   15:53    Set  2/19/2019   17:01    Rise 2/19/2019   16:55   -0:06
 3/21/2019    1:43   Rise  3/21/2019    5:26     Set 3/21/2019    5:58   +0:32
 4/19/2019   11:12    Set  4/19/2019   18:08    Rise 4/19/2019   18:14   +0:06
 5/18/2019   21:11    Set  5/18/2019   18:39    Rise 5/18/2019   18:14   -0:25
 6/17/2019    8:31   Rise  6/17/2019    3:49     Set 6/17/2019    3:54   +0:05
 7/16/2019   21:38    Set  7/16/2019   18:56    Rise 7/16/2019   18:49   -0:07
 8/15/2019   12:29   Rise  8/15/2019    4:32     Set 8/15/2019    4:09   -0:23
 9/14/2019    4:33   Rise  9/14/2019    5:02     Set 9/14/2019    4:59   -0:03
10/13/2019   21:08    Set 10/13/2019   16:46    Rise10/13/2019   17:02   +0:16
11/12/2019   13:34    Set 11/12/2019   16:07    Rise11/12/2019   16:25   +0:18
12/12/2019    5:12   Rise 12/12/2019    6:40     Set12/12/2019    6:42   +0:02

The difference is much smaller than your original list.
Why this happens
MCG and Carl Witthoft explained why it happens, namely because:

If the moonrise/set is not the same time as the exact Full Moon, then moonrise/set  occurs earlier or later than the sunset/rise.
Because the Moon passes above and below the ecliptic (the path of the Sun in the sky), the Full Moon is rarely directly opposite from the Sun. Therefore, it can rise earlier or later than the Sun even when exactly "Full".
Even if the Full Moon were exactly opposite from the Sun (180 degrees apart, and in a total lunar eclipse), there would still be a difference between the time of sunset/moonrise. Those times are when the limb of the sun/moon is visible, and the limbs are closer together than 180 degrees apart. Also, atmospheric refraction shrinks the separation a small amount.

Where and when are they closest?
This is more involved but can be reasoned using the following figure. The Sun is in the direction of 1, so the ring of sunset-sunrise is the circle A-A. The Full Moon is in the direction of 2, so the ring of moonrise-moonset is the circle B-B. Where these two circles cross at C is where the sunset and moonrise (or sunrise and moonset) occur at the same time. The highlighted area is where the Moon and Sun are both above the horizon at the same time. Note that this figure is highly exaggerated for illustrative purposes.
Comment: Ok, I think i was a day off because the night where the moon rises as completely full is they day after the full moon. Checking your data source for Greenwich 17/06/19 it will rise incomplete and be full at 08:31. So the night after the rise will be a fair bit after sunset everywhere !!
Answer: I'm wondering where you got your list.  It appears that other days might be better choices.  As an example, for Porto-Vecchio, April 20,2019 is a day late:
Apr 19, 2018 sunset: 20:07, moonrise: 20:13, diff: 0:06
The moon rises about 50 minutes later on consecutive days.  In addition, the sunset time might be changing by a couple of minutes a day as well.  Since sunset only happens once a day, then we'd expect the rise after a full moon to be anywhere in that ~50 minute period late.  On average then, I'd expect the closest sunset/moonrise of a month to usually be a quarter of that range (cut in half because closest could be before or after, and another half for variation) or about 15 minutes.
There are a lot of sites with accurate sunset/moonrise times, but I don't know of any that directly give the delta between them.  Could probably create one with some python scripts, but not something I've done.
Answer: The reason for this is quite simple. While we orbit the sun, the moon is orbiting us.

Look at the direction of the sunlight (this will show where the Sun is), then look at the position of the Moon.
Let us take the Full Moon as an example. Imagine, in this 2D image, the Earth is rotating anti-clockwise. As the Sun is on one side, the moon is on the other. So Sunset and Moonrise will occur at close to the same time.
Now let us look at the first quarter. At sunset, the moon is going to be almost directly overhead, which means moonrise occurred hours previously.
Using a 2D visual representation makes it easy to visualise. Of course, it is not always so black and white, as the moons orbit is not a perfect circle same as ours is not perfect around the sun (hence different rise times throughout the year during the same phases), then there is axial tilt etc, etc. But this will give you a pretty good idea. The closer to the full moon it is, the closer Moonrise and Sunset will be.
Comment: @CarlWitthoft the question has been edited since I answered. When I did, the only mention of a full moon was OP stating that its most beautiful during a full moon, but no mention of realising that's when it is happening. Then asked *why* is there a difference throughout different days. Hence my answer. It's sue to the orbit of the moon. So at the time, it did make sense. I didn't see the question edit
Comment: This doesn't appear to address the question at hand.
Comment: The OP asked why there is variation **at full moon**, and then how to find when  sunset and **full moon rise**  are closest.  Not why it's different for quarter vs. full
Comment: Ahh, yes, the famous "moving target" question.  I've been burned by that too.  Sorry.
Comment: The last quarter Moon is not "almost directly overhead" at sunset. The last quarter Moon is not even visible at sunset. You may have confused yourself from the diagram because the earth is rotating counter-clockwise in the diagram, not clockwise. The first quarter Moon is near the meridian at sunset.
Comment: I said that with respect to the drawing after stating I am imagining a clockwise rotation. I can change it to counter clockwise and first quarter if you'd like? I was just using a quick example to explain about rise and set times using the picture
Comment: @Carl how does it not? OP asked how they can find out when they are closest. I answered by using visual observations and saying how to do just that
Comment: I just made sure it was simplified for OP
Comment: @CarlWitthoft no need to apologise! These things happen. Had it a few times on the EE stack exchange too. I'm sure it won't be the last time either! I assume that was the reason for the downvote? Unless there was something else I missed too?
Answer: Going out on a limb a bit here -- depending on the month, the compass location where the sun sets varies as well as the length of time the sun is above the horizon (note also there are different definitions of "sunrise" - visible, half up, etc).  The moon's compass location varies with a different cycle because the moon's orbit is not perfectly over the equator.
Combine those two variables, keeping in mind that a "perfect" full moon happens when the sun and the moon are exactly $\pi$ radians apart from our point of view, and it would appear quite reasonable to have significant variation in their relative rise/set times.
Comment: The equatorial plane isn't very relevant here. The plane of the Moon's orbit is around 5 degrees from the ecliptic plane.
Comment: @PM2Ring can you quantify that claim, i.e. how much time difference +/- 5 degrees actually causes?
Comment: The point of my previous comment is that the ecliptic plane is what we need to consider for this question, since that's the plane of the Sun's apparent motion, and it's also fairly close to the plane of the Moon's motion (which is pretty unusual since satellites *are* normally equtorial). The equatorial plane is about 22 degrees away from the ecliptic. The details of the Moon's motion are rather complex, eg its orbit is relatively eccentric, and it precesses fairly quickly. Its apparent speed varies quite a bit even on a short timescale.
Comment: The inclination of the lunar orbit to the ecliptic is only one of several factors affecting the variation in the period of one Full Moon to the next. To compute that period with precision of around one minute takes about a dozen trigonometric terms. To answer your question re the 5 degree inclination I'd have to do some spherical trig, but at a rough guess, it means that Full Moon can be more than an hour off from the time when the Moon has an ecliptic longitude 180 degrees from that of the Sun.
Answer: One of the problems I see in this thread is that how we determine the full moon has changed over time. In ancient times, the day of the full moon was determined only at sunset and occurred with the moon rising after the sun has set. If the sun sets, after the moon has already risen, it is not considered a full moon.
Comment: The dates and times provided in the question all refer to the year 2019. From what I understand, the OP is not concerned with ancient practices to determined the full moon, but only with modern ones.
Comment: I thought this information would be helpful in understanding what we consider to be a full moon and why there is variability in regards to the full moon at sunset and sunrise.


iMac main/admin account won't log in (iMac mid 2011, High Sierra)

Question: So I'm at a loss with my Imac which suddenly wouldn't log in and I really really don't want to lose all the information I have on there. I've tried to be as detailed as possible but might have forgotten some things, so ask away if there's something missing etc. Also, I did do a minor back-up a few months before on the most essential things but far from everything and without the latest files.
Problem:
When I try to log in to my main (admin) account the computer gets stuck only showing the account name and picture, with a wheel that won't stop turning. At first the wheel freezes and a spinning beach ball appears for a few seconds before disappearing again, whilst the other wheel continues. Then it stays like that. At most I had the computer on for weeks (forgot to turn it off after I tried something) and when it woke, it still spun.
Computer info:
Mid 2011 iMac with High Sierra 10.13.6, 16gb RAM, 1tb HDD
Background:
I moved six months ago and when I plugged the computer back in something was off. First it was really slow and then it started acting up, only showing questionmarks in the status bar. In the same time I added another account for my girlfriend (I'm pretty confident the problem had started before that but I'm not entirely sure) and before long the problem was as is still. Note: when moving I had it packed down in the original box so it should've been safe, and I carried it from one apartment to another (just 30 meters or so) so I don't see how it could've been damaged from that.
What I'm able to do:
As far as I can see my girlfriends account works without any problems
My research so far:
So having googled this for six months now I've A) found people with similar problems (though no (working) solutions), and B) ran out of keywords. Lots of people which describe a similar problem seemed to have it caused by either faulty startup objects or faulty hardware. Since I can't log in, not even in safe mode, I can't disable the startup objects (I tried to log in whilst pressing down the shift-key but that didn't work) and a hardware/hard drive analysis says everything's fine.
What I've tried:

Hardware check which came up empty, saying everything was alright
HDD scan which came up empty
Resetting PRAM/NVRAM and SMC
Safe mode which managed to get me inside at first but then froze. Now I can't even log in this way.
Login without start objects (login in whilst pressing shift-key)
Reinstalling the OS (twice) which did nothing (actually it was after that safe mode stopped working (not that it was really working before))
Disconnected all peripherals/tried with another mouse+keyboard (for no reason at all really)
Talked with the apple support which amazingly not only gave support for a soon to be 12-year old, but did so for quite some time. They suggested reinstalling the OS, which as mentioned did not work
Update: changing the password didn't work

What to do next:
Yes, exactly, what do I do next? Any other possible solutions? Can I reach my files through the other account somehow (the support told me no but surely there must be a way with another admin account and the password?), perhaps through the terminal. or maybe turn off the startup objects from there? Install an earlier OS (mine is the latest for that model)?
Update: This thread describes a very similar problem and points out icloud (at least by one person) as a potential instigator, something I had issues with (couldn't log in/out and it kept telling me to do so for about six months(!)). Anyway, the suggested solution(s) aren't possible in the way that they suggest and as I understand it it's not possible to change the UUID from High Sierra and onwards and it's not possible to log out/change the apple ID from outside an account?
Thanks!
Comment: Does this answer your question? [Two login accounts, admin account password unable to login](https://apple.stackexchange.com/questions/163606/two-login-accounts-admin-account-password-unable-to-login)
Comment: I don't think so since typing the wrong password at the login screen doesn't take me beyond that and the problem arise when typing the right password. But it doesn't hurt to try I suppose so I'll do that later (doing an extended hardware test atm for no reason at all really). Thanks for your reply!
Answer: If UserB is an Administrator, then UserB can run an interactive shell as user UserA by entering the command below.
sudo -i -u UserA

If prompted, enter the password for UserB. Once the shell is executing, files for UserA can be moved/copied to the /Users/UserA/Public folder, where UserB can access the files using the Finder application.
Comment: Very good news! In case nothing else comes up I'll do this for sure. Thank you!


How to list folders first in a Documents list

Question: Yes, OK folders=bad.  With that out of the way, what's the best way to have folders appear first in a Documents library then have the documents sorted alphabetically?  Right now I'm sorting on Title which is blank or null for folders, then Name linked to document with edit menu.  Any better way?  This seems to work so far but I'm concerned that relying on a blank meta-data field might not be the best course of action.
Comment: Instead of Title you can use "Folder Child Count" Decsending, which will put the folders to the top.
Answer: Done a lot of searching and this is the best solution I've come up with so far to mimic file explorer behavior. Sorting on the Title metadata field which is blank or null for folders, then the Name (linked to document with edit menu) metadata field gives you Folders sorted to the top of the listing alphabetically, then Files sorted alphabetically BUT if you have users that put information into the Title field of the documents, then you're back to square one. One other option is to sort by Type first then Name.
Answer: Option 1:
I agree with - Damjan Tomic
Option 2:
Another option I found was provided by LauraRogers MVP on MSDN Social entitled: Custom Ordering in Document Library
create a custom "folder" content type:

Site Settings - site content types
Click Create
Call it "New folder" or whatever you want.  parent content type =
"folder content type" and then "folder".
Create a new site column to be associated with this new content
type.  Call it "folder order" or something, and make it a number
column.
on your library, go to library settings and advanced settings.
Change "allow mgmt of content types" to YES
In the library's settings "content types" section, click to add an
existing content type, and pick that new one called "new folder" at step 3
In the library's advanced settings, change "Display "New Folder"
command on the New menu" to NO.

Now in the "new" drop-down box there's the ability to create a new folder, and that new folder has a "sort order" column.  Then you just have to sort your list by that column (MSDN Social).
Comment: OPTION2: I've seen that but doesn't that require the user to populate the column with a value?  I'd like this to be passive and additionally sort the folders alphabetically.  Just like how Windows File Explorer works.
Comment: OPTION 1: Tried that but SharePoint faithfully sorts on the number of child nodes in the directory so it doesn't end up being alphabetical.
Answer: Sort on Item Child Count (descending) instead of Folder Child Count. This will put folders at the top.


Problem with Faraday's Law for a Circuit with Battery

Question: From Maxwell's equations, we know,
$$\nabla \times \vec E=-\frac{\partial \vec B}{\partial t}\Rightarrow\oint \vec E\cdotp d\vec l=-\int\frac{\partial \vec B}{\partial t}\cdotp d\vec a \tag{1}\label{1}$$
and from the definition of EMF,
$$\varepsilon=\oint \vec f\cdotp d\vec l \tag{2}\label{2}$$
where, $\vec f$ is the force per unit charge.
Now, consider a simple circuit with just a battery and a resistance. The circuit is placed in a time varying magnetic field. So, $\vec f=\vec f_s+\vec E$, where $\vec f_s$ is the force per unit charge due to the battery. So, the EMF
$$\varepsilon=\oint(\vec f_s+\vec E)\cdotp d\vec l=\oint\vec f_s\cdotp d\vec l+\oint\vec E\cdotp d\vec l=\oint\vec f_s\cdotp d\vec l-\int\frac{\partial \vec B}{\partial t}\cdotp d\vec a \tag{3}\label{3}$$
But from Faraday's law, we know that the EMF,
$$\varepsilon=-\frac{d\phi}{dt}=-\int\frac{\partial \vec B}{\partial t}\cdotp d\vec a \tag{4}\label{4}$$
Combining these two expressions of $\varepsilon$, we get
$$\oint\vec f_s\cdotp d\vec l-\int\frac{\partial \vec B}{\partial t}\cdotp d\vec a=-\int\frac{\partial \vec B}{\partial t}\cdotp d\vec a \tag{5}\label{5}$$
$$\Rightarrow \oint\vec f_s\cdotp d\vec l=0$$
But, $\oint\vec f_s\cdotp d\vec l$ is actually the voltage across the battery terminals which shouldn't be zero.
Where is the problem with this analysis?
Comment: how did you  lose $\oint \vec E\cdotp d\vec l$?
Comment: I used Maxwell's equation (the very first equation here) to lose it.
Comment: I have been asking myself the same question as @Mobin_Haque for a long time. Electro-chemistry says that the Gibbs energy is the origin of the electromotive force of batteries, but I am not convinced. I think it is not yet possible to derive the electromotive force of a battery from the fundamental laws of physics.
Answer: You're confusing induced EMF with total EMF, which is sum of all contributions to EMF, including the induced EMF(due to induced electric field, described by the Faraday law) and the battery EMF (due to electrochemical processes in the battery, not described by the Faraday law).
Net EMF due to both induced field and battery can be written as
$$
\mathscr{E}_{net} = \mathscr{E}_{induced} +  \mathscr{E}_{battery}
$$
$$
\mathscr{E}_{net} = \oint \mathbf E_{induced} \cdot d\mathbf s +  \mathscr{E}_{battery}.
$$
$$
\mathscr{E}_{net} = -\frac{d}{dt}\int \mathbf B \cdot d\mathbf S +  \mathscr{E}_{battery}.
$$
If resistance of the circuit is $R$, then Kirchhoff's second circuital law predicts that current due to both sources of EMF will be
$$
I = \frac{\mathscr{E}_{net}}{R}.
$$
Comment: Thank you for your clarification. No wonder the voltage across the battery terminals was found to be zero in my analysis !!
Answer: The Equation (4), third equation up from the bottom: Faraday's law gives the emf due to changing magnetic flux. You seem to be equating $-\frac{d\Phi}{dt}$ to the total emf in the circuit, including that of the battery.
Comment: Thank you for your answer. I understand my mistake now.


Why do we have minimum deviation angle in a Prism?

Question: why do we have minimum deviation angle in a prism? I mean why does the angle of emergence first decreases, attains a minimum value and then increases.why?
Answer: I would like to answer this question step by step. Let's start from angle of deviation.

Why do we need a measure called angle of deviation?

It's because a ray of light undergo deviation from its actual path if it is allowed to pass from one medium to a different medium. This is due to the change in index of refraction of the media. The angle of deviation is a measure of how much this deviation has happened at the interface. In the case of a prism (usually made of glass), light enters the prism from air. Since air and prism have different refractive indices, light undergo a deviation from it's actual path. Let's call this deviation at the air-glass interface the angle of deviation.  This is as illustrated in the figure below. The dotted line represents the undeviated direction of the ray if the prism was no there.

Picture source: $\small{\text{https://en.wikipedia.org/wiki/File:Deflection_of_light_ray_passing_through_prism.png}}$

What is the angle of minimum deviation?

Of course, this is the minimum value of angle of deviation. At the minimum deviation angle, the angle of incidence and  the angle of emergence of the ray are identical. As you can see from the above figure, this will occur only if the light ray inside the prism passes parallel to the base of the prism (you can prove it from the prism equation. See for example: https://www.physics.wustl.edu/ClassInfo/316/Theory/Refraction.pdf). Also, this angle of deviation happens only for a particular angle of incidence.

$\small{\text{Picture source: https://en.wikipedia.org/wiki/File:Minimum_deflection_of_light_ray_passing_through_prism.png}}$
If the angle of prism is $A$, the deviation angle for a particular angle of incidence $i$ be $D$ and the corresponding angle of emergence be $e$. Then we have the relation,
$$i+e=D+A$$
At $D=D_{min}$, then $i=e$, which implies that
$$D_{min}=2i-A$$

Why does the angle of emergence first decreases, attains a minimum value and then increases?

When a ray of light is incident obliquely on the interface of another medium,  refraction happens. However, if the ray of light is incident normally on the interface, then refraction will not happen (actually the refraction is always there and in this particular scenario, the angle of refraction becomes zero), and the the ray of light passes undeviated through the prism, leaving the angle of deviation zero.  This is the normal position.
When you rotate the prism about an axis passing perpendicular to the plane of incidence, then you can see that the angle of deviation changes with change in angle of incidence and finally reaches a minimum value and after that it increases again on further rotation in the same direction.
If the incident light beam is rotated in either direction from the minimum deviation position, the deviation of the light from its incident path caused by refraction in the prism will be greater. So the angle of refraction emergence will be greater as you move either way from the minimum deviation position. This means that if you move along a particular direction, then the angle of emergence first decreases (on rotating towards the angle of minimum deviation position), then reaches a minimum value (equal to the angle of incidence) at the minimum deviation position and after that it again starts to increase with increase in the angle of incidence.
Answer: I attempt to explain the presence of a minimum mathematically instead of experimentally.
The light ray travels through air and hits the glass prism, at an angle $\theta_1$ (the angle of incidence) to the normal of the glass boundary.
When the ray is in the glass, the angle of the ray changes to $\theta_2$ (the angle of refraction), to the normal of the glass boundary. The two angles are related by Snell's Law, such that:
$$\frac{sin\theta_1}{sin\theta_2} = \frac{n_{glass}}{n_{air}}$$
where $n_{air}$ is the refractive index of air, and $n_{glass}$ is the refractive index of glass. Since $n_{glass} > n_{air}$, $\theta_2 < \theta_1$.
Assuming you know $\theta_1$, $n_{glass}$, and $n_{air}$, then you can find out $\theta_2$.
Then, when the light ray (which is currently inside the glass) hits the air boundary, there is a new angle of incidence $\theta_3$. $\theta_3$ depends on the the angle at the top of the prism, $A$.
$$sum\space of\space angles\space in\space triangle = 180^{\circ}$$
$$180^{\circ} = A + (90^{\circ} - \theta_3) + (90^{\circ} - \theta_2)$$
$$\theta_3 = A - \theta_2$$
We want to know the angle of refraction $\theta_4$. So we apply Snell's Law again:
$$\frac{sin\theta_4}{sin\theta_3} = \frac{n_{glass}}{n_{air}}$$

From geometry,
$$angle\space of\space deviation = \theta_1-\theta_2+\theta_4-\theta_3$$

Substituting $\theta_3 = A - \theta_2$,
$$angle\space of\space deviation = \theta_1+\theta_4-A$$
To minimize $angle\space of\space deviation$, assuming A is constant, we need to minimize $\theta_1+\theta_4$.
We can find $\theta_4$ in terms of $\theta_1$. Equating the two Snell's Law equations,
$$\frac{sin\theta_4}{sin\theta_3} = \frac{sin\theta_1}{sin\theta_2}$$
Substituting $\theta_3 = A - \theta_2$,
$$\frac{sin\theta_4}{sin(A - \theta_2)} = \frac{sin\theta_1}{sin\theta_2}$$
$$sin\theta_4 = (sinA\space cos\theta_2 - cosA\space sin\theta_2) * \frac{sin\theta_1}{sin\theta_2}$$
$$sin\theta_4 = (\frac{sinA}{tan\theta_2} - cosA) * sin\theta_1$$
Substituting $\theta_2 = sin^{-1}(\frac{n_{air}*sin\theta_1}{n_{glass}})$,
$$\theta_4 = sin^{-1}\Bigg(\bigg(\frac{sinA}{tan(sin^{-1}(\frac{n_{air}*sin\theta_1}{n_{glass}}))} - cosA\bigg) * sin\theta_1\Bigg)$$
Because I'm not good at math, this is where my analysis ends, and WolframAlpha begins. Punching in arbitrary values for the angle of prism, and for refractive indeces, we find the values of $\theta_1$ such that we minimize $\theta_1 + \theta_4$.
The very fact that WolframAlpha can find minima for $\theta_1 + \theta_4$ means that there are values of $\theta_1$ such that $angle\space of\space deviation$ has minima.
Notice that the values of the minimum are offset from the value of $\theta$ by a constant amount every time. This constant amount happens to be $\theta_1$ such that $\theta_1 = \theta_4$. So, this shows that the $angle\space of\space deviation$ is minimum only for $\theta_1 = \theta_4$.
Comment: but looking at the expression is not telling me why is there an angle of minimum deviation physically . Is it due to some geometrical reasons , ofcourse it is , but how and why ?


Wifi Enabling broadcast coming late

Question: I've got a widget that I'm trying to use to enable/disable wifi, as well as display some additional info. I want to show a transitional hourglass icon while Wifi is enabling/disabling, so I'm listening for the android.net.wifi.WIFI_STATE_CHANGED intent.
When that intent is caught I'm calling the widget's onUpdate function, and in that I have this block of code for changing the image displayed:
<code>WifiManager wifiMan = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wifiMan.getConnectionInfo();

RemoteViews views = new RemoteViews("com.nickavv.cleanwidgets", R.layout.wifi_toggle_layout_large);

supState = wifiInfo.getSupplicantState();
wifiState = wifiMan.getWifiState();

if(wifiState == WifiManager.WIFI_STATE_ENABLED) {
    //Show enabled image
} else if(wifiState == WifiManager.WIFI_STATE_DISABLED){
    //Show disabled image
} else {
    //Show hourglass
}
</code>
And here's my code for intercepting clicks and wifi state changes:
<code>@Override
public void onReceive(Context context, Intent intent) {
    super.onReceive(context, intent);
    if (intent.getAction().equals(ACTION_WIDGET_RECEIVER)) {
        if(wifiState != WifiManager.WIFI_STATE_ENABLING || wifiState != WifiManager.WIFI_STATE_DISABLING) {
            switchToggle(context);
        }
    }
    AppWidgetManager myAWM = AppWidgetManager.getInstance(context);
    ComponentName cn = new ComponentName(context, WifiWidgetLarge.class);
    onUpdate(context, myAWM, myAWM.getAppWidgetIds(cn));
}
</code>
This works fine on the smaller widget, which is just a toggle switch, but on the larger widget the exact same code doesn't produce the correct results. It shows the hourglass while disabling, but not while enabling. It seems that the intent is being received too late to display anything, as debug logs show that it is eventually being received. It's just not coming in with WIFI_STATE_ENABLING until immediately before the state changes to WIFI_STATE_ENABLED.
Most baffling of all, the widget works fine on my tablet, and my roommate's phone, just not on my phone. However, I don't want to release it until I can be more sure of its performance. Any ideas?
Comment: What versions of the OS are on all those devices you mentioned?
Comment: Gingerbread on my phone, and my roommate's. Ice Cream Sandwich on my tablet
Comment: I've now tested it on my other roommate's Asus Transformer running Ice Cream Sandwich (works as expected), and my yet other roommate's Acer A500 running Honeycomb (works as expected). What's so different about my phone?
Comment: your widget enables your wifi, right? then why is important to able to see the hourglass, if the wifi already enabled?
Answer: May be there were more tuning after Gingerbread version. What you could do now is check for the android version and if its a GB, you would need to do some hack.
You could check for WIFI_STATE_CHANGED_ACTION and get the previous/next states using
EXTRA_WIFI_STATE
EXTRA_PREVIOUS_WIFI_STATE
Comment: I'm about to resort to a hack of some kind, it just bothers me that the same code on the same phone works on my other Wifi widget but not this one

Wifi Enabling broadcast coming late


Do some side quests become unavailable later on in the game? (Dragon Quest IX)

Question: Are there any side quests that become unavailable after a certain point in Dragon Quest IX or can I come back any time and do them all (for example after finishing the main storyline)?
Answer: Nintendo shut off the wifi for this game (along with all other DS titles) As of May 2014. Because of this, you are no longer able to download any of the DLC quests, making all of these unavailable at this time. If you had them downloaded from before this time, you should still be able to complete them.
Otherwise, no. At any time (assuming you have the means to get there), you can go back to any area of the game and finish side quests there.
Comment: Yeah I meant the sidequests in the main game. What do you mean when you say "assuming you have the means to get there"? Can't you use the Zoom spell anytime?
Comment: I have not played the game for quite a while, so I do not remember if there are any points in the game where you lose access to your vehicles. You may not be able to zoom in a certain spot, etc. It just covers the times in the game where you technically cannot get to a side quest, but none of them are ever closed.
Comment: Do you remember if you can travel anywhere after the end of the game?
Comment: Yes you can. Many of the grottos and quests are going to end up being harder than the end of the game, and expect you to have done so.


How to access a Python global variable from C?

Question: I have some global variables in a Python script. Some functions in that script call into C - is it possible to set one of those variables while in C and if so, how?
I appreciate that this isn't a very nice design in the first place, but I need to make a small change to existing code, I don't want to embark on major refactoring of existing scripts.
Comment: I think what you meant by global variable is only the `__main__` module's global variable. Actually each imported python module has its own global variables.
Builtin function [globals](https://docs.python.org/3/library/functions.html#globals)
Answer: I'm not a python guru, but I found this question interesting so I googled around. This was the first hit on "python embedding API" - does it help?

If the attributes belong to the global
  scope of a module, then you can  use
  "PyImport_AddModule" to get a handle
  to the module object. For  example, if
  you wanted to get the value of an
  integer in the main  module named
  "foobar", you would do the following:
PyObject *m = PyImport_AddModule("__main__");
PyObject *v = PyObject_GetAttrString(m,"foobar");

int foobar = PyInt_AsLong(v);

Py_DECREF(v);

Comment: 'This' link is broken- anybody have a fixed link?
Comment: Fixed it - Odd that they would rearrange the list archives like that, but googling for the quoted text found the message easily enough. :-)
Comment: Aaand its broken again
Answer: For anyone coming here from Google, here's the direct method:
PyObject* PyEval_GetGlobals()

https://docs.python.org/2/c-api/reflection.html
https://docs.python.org/3/c-api/reflection.html
The return value is accessed as a dictionary.
Answer: Are you willing to modify the API a little bit?

You can make the C function return the new value for the global, and then call it like this:
my_global = my_c_func(...)
If you're using Robin or the Python C API directly, you can pass the globals dictionary as an additional parameter and modify it
If your global is always in the same module, Sherm's solution looks great
Answer: I recommend using pyrex to make an extension module you can store the values in in python, and cdef a bunch of functions which can be called from C to return the values there.
Otherwise, much depends on the type of values you're trying to transmit.


What is worker process recycling....?

Question:
I would like to know what is exactly worker process recycling?
What exactly it does at the time of worker process recycling?
Worker process resides in application pool and can be configured
through application pool?
Is that application pool is responsible
to recycle worker process? or IIS is responsible to recycle it?
What happens at the time recycling worker process?
What are the impact of not forcing it to recycle?
Answer: IIS Worker Process Recycling is the process whereby IIS kills of the child processes that it spawns to handle incoming requests and starts clean copies of them.
The first time IIS gets a request for a web application in a given application pool, it spawns a worker process to actually do the work. This process does things like maintaining the session state and static data from your ASP.NET code, ISAPI handlers, etc. Over time, problems could arise in the processing (memory leaks in the application code, undisposed resources, etc.) that IIS wants to clean up without having to shut down the server. So it will periodically tell the worker process to die off, and spawn a new one.
When the recycle period comes around, IIS stops sending new service requests to the dying process and allows it to finish whatever it's doing normally. It will spawn a new, replacement process in advance and start sending new requests to that one while the old one finishes up. Once there's nothing left for the old process to do, it terminates normally.
Worker processes are isolated to a given application pool, because that's how IIS accomplishes process isolation. (This is why, for example, you can mix .NET Framework versions on a single server -- each app pool gets its own loaded Framework libraries separate from the others.) The app pool determines other things about the worker processes, including their credentials and how long the process stays around before being shut down.
There's really not a good reason to turn off recycling, but if everything is working properly it shouldn't hurt anything. The problems arise if you run code within the worker process that misbehaves; over time even tiny memory or resource leaks build up and you have to shut down application pool down to clean them up. With overlapped recycling, IIS takes care of that for you with no disruption in service.
Comment: +1: To add a little more, you might start hurting performance if you turn recycling off all together. After a long time, the heap will become fragmented, even if you are sure your application is not leaking memory at all.
Comment: @vcsjones, thanks for adding few points to understand problems associated if not recycled workerprocess
Answer: Worker process recycling just means the restart of the asp .net worker process (aspnet_wp.exe) . It's done due to various reasons. The following article describes things quite decently.
http://technet.microsoft.com/en-us/library/cc759005(WS.10).aspx
Please go through it.
Comment: is it restarting aspnet_wp.exe or w3wp.exe?
Comment: Not quite, there are a few exceptions to that. It's tied more to the IIS version than whether it is Server/Client. In IIS 6.0+ it is w3wp.exe, less than 6 uses aspnet_wp. Windows XP 64-bit, which isn't a server, uses IIS6 so you still get App Pools and w3wp. Windows Server 2000, which is is a server, uses aspnet_wp since IIS doesn't support App Pools.
Comment: @vcsjones you are right :). Just deleted my above comment to avoid confusion. The difference is IIS6 has w3wp.exe and lower versions of IIS its aspnet_wp.exe
Answer: Scenarios vary, but just to keep in mind: If your web app does initial in-memory caching of db information (let's say huge initial caching), the first request to the newly spawned apppool will take long to complete.

What is worker process recycling....?


If car starts and cuts out after 10 seconds, does that mean its definitely not related to CCA?

Question: If a car starts, I assume it means there is enough cold cranking amps to start the car.  Therefore if it cuts out after a few, 10, or even 30 seconds, it means the cut out problem is definitely not related to your battery's CCA.  I just want to check that my assumption is correct.
Comment: You've received a comprehensive answer from Fred_dot_u to the question you asked. Asking a new question regarding which other systems to suspect would be a proper next step.
Comment: @psaxton he seems to be implying less then 10 seconds maybe a problem and I did mention a 'few seconds' in my question too.  Unless I am interpreting his answer incorrectly and he is saying an immediate cut out after a start means no cca or starter problems.
Comment: @JamesWilson if the starter is able to turn the motor the battery is fine.  Also CCA is about performance in extreme temperature conditions, it is mid March so unless you are in a polar region you probably are not operating in extreme cold.
Comment: A separate question helps future internet people to find and resolve their problems as well.
Answer: If your engine turns over fast enough with the systems operational in a manner sufficient to start the engine, even if the engine is running only 10-30 seconds, and you've released the key from the start position, the battery/starter circuit is out of the picture.
Your assumption is correct.
Comment: @JamesWilson: It takes a few cycles for some alternators to start working. I've actually had my truck stall because I let go of the starter too fast.
Comment: When the engine dies immediately after releasing the starter the first suspect is the ignition resistor.
Comment: what about less then 10 seconds, and if its a problem why?
Comment: I have gone on to find that while a starting car should mean the cca is ok, cutting out doesn't mean the battery and starter circuit is ok.  In this case, the cut out was caused by corroded battery terminals.


In an effort to fight my homosexual tendencies, I have been inserting a tampon in my anus; is this haram?

Question: I am a gay Muslim and I am fighting my tendencies. To restrict men accessing my anus, I have been inserting a tampon. Is this haram?
Comment: It is good that you are fighting the illegal desire and trying to improve yourself! But why is there a need to do such a thing, it's not like you are bare infront of men that they would do such things and are you always in that state ? If so that is not correct! And you need to be clean of every dirt and impurities to worship Allah in any way of worshipping.
Answer: Oh, my God. At the first stage, it would be significant to know regarding the major sin of Lavat. In truth, it is counted as the worst sins. And it is mentioned as a major sin based on the Quran and hadiths. In the meantime it is declared that its punishment is more than Zina. For instance look at the following verses of the holy Quran:

لتَأْتُونَ الْفاحِشَهَ ما سَبَقَکُمْ بِها مِنْ أَحَدٍ مِنَ الْعالَمِین
  / عنکبوت، ۲۸٫
And [mention] Lot, when he said to his people, "Indeed, you commit
  such immorality as no one has preceded you with from among the worlds.
  (28)
إِنَّکُمْ لَتَأْتُونَ الرِّجالَ شَهْوَهً مِنْ دُونِ النِّساء بَلْ
  أَنْتُمْ قَوْمٌ مُسْرِفُونَ. / نمل، ۵۵٫
Do you indeed approach men with desire instead of women? Rather, you
  are a people behaving ignorantly." (55)
http://tanzil.net

At the second stage, in regard to what you explained "… I have been inserting a tampon …", at least it is good that it is important for you that you are endeavoring to avoid … (although it could be haram if it is harmful for your body), but you should pay heed that the punishment of this awful act (although without dokhul could be so larger than inserting a tampon. Consequently the best solution is endeavoring to avoid being a gay. Since according to Shia (and p think Sunni too) it is considered as a major sin with an awful Had.
I suggest you to read the following tradition regarding that:

Imam Reza (a.s.):
«وَاعْلَمْ انَّ حُرْمَةَ الدُّبُرِ اعْظَمُ مِنْ حُرْمَةِ الْفَرْجِ
  لِانَّ اللَّهَ اهْلَکَ امَّةً بِحُرْمَةِ الدُّبُرِ وَ لَمْ یُهْلِکْ
  احَداً بِحُرْمَةِ الْفَرْجِ
Imam Sadiq (a.s.):
That will be Akhar-al-Zaman (end of the world) when "men to men" and
  "women to women" would be satisfied. (lavat …)

In the meantime it is declared that the Hormat (being haram) of Lavat is more than Zina (as Imam Sadiq (a.s.) said such tradition as well). Besides, it is said that in such situation as you are, it is wajib for you to get married in order to leaving such haram act.

On the other hand, don't forget that it is declared that its Had is 100 lash (knout), and even it is said that the punishment of killing would be for that if sb repeat it three or for times. www.wikifeqh.ir and this

Moreover, I strongly recommend you to read the links below as two related helpful issues.
www.islamquest.net (1)
/
www.islamquest.net (2)

Reference:

http://islampedia.ir
www.wikifeqh.ir
and tanzil.net


Multi instance Drupal on single server. Is SSO possible to be implemented?

Question: may I know if we can configure single sign on , on a single server that have 2 Drupal instance running in parallel?
Answer: I see that this answer is late but, yes.  I am setting that up now but still working through some config.

I created a D7 installation called auth.local.domain.com (these are currently only on my dev machine).  For this instance I installed oauth2_server and openid_connect_sso modules
I created a separate D7 installation called client1.local.domain.com.  Here I installed the openid_connect and openid_connect_sso modules.
I installed 9 more sub-sites (client2 - client9) under Client 1, using drush.
I used Drush to enable the openid_connect and openid_connect_sso for all sub-sites.
I added all 11 of the sites to my Apache config (I am using MAMP Pro on Mac) and tested them.
I had some config to do on on the auth site relating to each client site and to each sub-site for the SSO.

I am using https://drupalcommerce.org/blog/32567/using-openid-connect-single-sign-drupal as my general guide for setup and configuration of the modules as well as https://www.youtube.com/watch?v=3K-2IfC8lpg but the multi-site part I figured out myself.


Get status of running worker nodes at regular intervals in spring batch deployer partition handler

Question: I am using deployer partition handler for remote partitioning in spring batch. I want to get the status of each worker node at regular intervals and display it to the user. ( Like heartbeats ). Is there any approach to achieve this ?
Answer: This depends on what your workers are doing (simple tasklet or chunk-oriented one) and how they are reporting their progress. Typically, workers share the same job repository as the manager step that launched them, so you should be able to track their StepExecution updates (readCount, writeCount, etc) on that repository using the JobExplorer API.
If you deploy your job on Spring Cloud DataFlow, you can use the Step execution progress endpoint to track the progress of workers.
Comment: Yes. You could use JMX to report such metrics or leverage micrometer's monitoring and metrics features which are used behind the scene by Spring Batch and Spring Boot. Please refer to https://docs.spring.io/spring-batch/docs/4.3.x/reference/html/monitoring-and-metrics.html#monitoring-and-metrics and https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html
Comment: Thanks ! Also, is it possible to get the cpu and memory usage of each worker ?


Integration with the Webflow platform

Question: I have experience with CiviCRM and am considering it for a new client. They have multiple websites and constituent databases. Their primary website is built on Weblow with a Shopify subdomain. Will CiviCRM play nice with Webflow?
Answer: You can only install it with the cms's listed at https://docs.civicrm.org/installation/en/latest.
Depending on what you need, you don't have to really do anything with that cms except set up users in it, and then you could use one of a couple remote options to connect data. See e.g. How can I connect my website to CiviCRM on a remote server?
Not sure if you need to integrate with shopify at all but see also https://lab.civicrm.org/extensions/shopify
Comment: Also there is work being done for a 'standalone' CiviCRM but not really production ready afaik
Answer: CiviCRM doesn't integrate directly with Webflow. As Demerit has said it only integrates directly with WordPress, Drupal, Joomla and Backdrop.
However, this isn't necessarily a problem. There are many organisations that host their CRM separately from the main website. Any integration can be performed via the API and/or with the help of some of these extensions:

Inlay
Form Processor
CiviProxy

Integration with the Webflow platform


Dry edges on sponge cake, nest 2 sheet pans for insulation?

Question: I'm tweaking a thin sponge cake with nut flour that I want to roll with a filling. My third attempt at the cake was delicious, but it didn't bake evenly. The edges were dry and there was a slightly sunken, dry section in the middle. The sections that weren't dry were great! I'm using a half sheet pan that's quite thin and may be a bit warped. I have another one just like it. Could it possibly help to nest the two pans to create an insulated baking environment?
Comment: What kind of oven do you have, gas or electric?
Comment: It's an electric oven, new.
Comment: Do you just mean the 1/2 inch or so at the edge of the pan?  If so, that is normal in a jelly roll; trim it off.
Comment: @SAJ14SAJ Nope, a bit more than that, maybe an inch. Plus there was the dry patch in the middle. The cake was so tasty that I wouldn't mind trimming even the full inch, but the dry patch was problematic.  Tonight I'm going to try upping the ingredients 50%, that would still make it plenty thin to roll, but it would still leave me with the uneven baking problem. I've baked enough in this oven, and tested it enough, that I don't think the oven itself is the problem. Still, I'm going to move the cake more as I rotate it this time. I'd really like to know if nesting the pans could help.
Comment: @Jolenealaska, sounds like you need to make a trifle. :)
Comment: @Marti That's funny, my failed attempts at the cake for a roll are in the freezer for exactly that! I was actually thinking a riff on tiramisu, but, ya know, same basic concept. :)
Comment: Nesting pans will slow heating from the bottom, much like it would in a cookie, but it won't solve the unevenness problem.  I would do that only if you are getting overbrowning on the bottom.
Answer: There are a couple of things that can lead to uneven heating in an electric oven. Here a couple of things that can help.

Let the oven 'thoroughly' preheat. Are you putting the cake in before or just as the oven preheats? Let the oven sit for a good 5 minutes after it has reached the desired baking temp.
Keep the oven door closed until the expected baking time has been reached. Each time the door is open a significant amount of heat escapes, causing the elements to come back on for a longer period, this will cause the heat to circulate in an uneven pattern.
place either a pizza stone or another baking sheet on a rack above the cake (with enough room for the cake to rise). If the broiler element is coming on the direct heat might be causing the dry center (note: if you had a gas oven then I would put the stone a rack below the cake.)
finally, lower the temperature 25°F and extend the baking time.
Comment: I have to go to the hardware store tomorrow. It's been on my list to get some bricks for even baking (as you describe in your third point). I'll try 4 or 5 bricks on my second cheap sheet pan on the rack above my cake.
Comment: If the hardware store has UNTREATED tiles (granite or marble) that might make a better choice.
Comment: You might also consider light coloured bakeware. Dark pans radiate the heat onto the edges of the bake, causing more browning. Professional grade pans are almost always made from something like thick gauge aluminium to help prevent this.


When using vi typing a "c" will delete a character

Question: This also happens when copying and pasting.  I am attempting to edit Go code and typing or copying and pasting "package main" comes out as "pkage main".  No idea why I can't type a c.  Pressing delete backspace prints out a ^? and pressing delete actually deletes a character.  I tried restarting it but I have no idea how else to troubleshoot this and I could find nothing online.
Comment: See also http://unix.stackexchange.com/a/199207/38906
Answer: Possible Cause 1:
If c works normally everywhere such that this problem only affects Vim, it could be that there may be an abbreviation or mapping set up for c.  Examine your .vimrc file(s).
I just temporarily turned my c into backspace in Vim in the normal, command, normal and insert modes:
:map c ^?
:nmap c ^?
:imap c ^?

(Where ^? denotes the result of typing Ctrl-VBackspace.)
Possible Cause 2:
You have c as the erase character in your TTY. That is to say, as if the following command had been executed:
stty erase c

However, this would also affect other programs and shells. Try
stty sane

in your shell to reset the TTY parameters to some reasonable default settings. This is a useful command to remember; it comes in handy when some visual program unexpectedly dies, leaving the TTY settings in an inappropriate state.
Comment: +1 for including the `stty sane` command. Well worth remembering. The number of times I had to kill a terminal window because something got corrupted...
Answer: Sounds like something garbled in the paste process.
When you paste to any other editor, does it work or just the same? If it is the same, then perhaps the source was already garbled to begin with.
If other editors paste fine, then, try the clipboard paste shortcut:
"+++p
If you are copying from the other app using merely selecting with your mouse, you should use instead:
"+*+p
If you still find oddities, try:

:set paste to enter vim's paste mode.
then try the above paste shortcuts
When you want to turn off paste mode for any reason just :set nopaste.
Comment: I don't think it is a paste issue.  Just pressing the "c" key results in deleting the most recent character.  Typing func goes like, f, fu, fun, fu.
Also pasting into cat >example has the exact same results.  Pasting into the shell however works just fine.
Comment: vim's paste mode has the same problem, along with the keyboard shortcuts.
Comment: In that case, on command prompt, when you run `lsb_release -a` there should be multi-line system summary info, and `vim --version` should also be a multi-line response with version details. Would you be able to copy paste these two outputs and update the question with this info? Thanks
Comment: Kaz answered it for me but thanks for the help!
Comment: No problem, and welcome to the world of Linux!
Answer: Copying and pasting in the console works in the way that the text is inserted char by char, and Vim interpretes each char to mean something.
When using Vim, make sure you're in --INSERT-- mode, and not command mode. In Command mode, a 'c' means change, and for example, if you type ce, Vim'll delete till the end of the word and enter Insert mode.
'^' stands for Command. ^C means Ctrl+C. That's the console, not the Vim editor itself. You'll get a similar character If you press Ctrl-(something) or the Escape key.
All the standard navigation keys(such as Home, Delete, PgUp/PgDn, arrow keys), are included in modern Vi as a backup. It's for users who prefer not to use/find it hard to use x or d or the hjkl scroll keys.


How many maximum files per directory on CentOS 5 64bit or Linux RedHat 64bit?

Question: Now, I have any 20,000 files in single directory.
How many maximum files per directory on CentOS 64bit ext3?
Answer: The number of files in a directory is limited primarily by the maximum file size, divided by the size of a directory entry. As the maximum file size is in the terabytes range, there is no practical limit on a directory size. Depending on what ext3 features you use, performance may degenerate as the directory grows larger.
There is a limit of 32000 subdirectories.
Comment: In redhat 5 using ext3 with the limit of ((32K - 2)) on centos 7 with ext3 I don't see this problem
Answer: https://stackoverflow.com/questions/466521/how-many-files-in-a-directory-is-too-many


Why do we use wool for insulation?

Question: I'm really struggling to understand the science behind wool, and why it's a good insulator. I'm doing an investigation about heat transfer, and the topic I chose is insulators.
Comment: I'm voting to close this question as off-topic because it shows [insufficient prior research](https://physics.meta.stackexchange.com/questions/5778). Results are immediately available  for the google search "why is wool a good insulator?"
Answer: The best insulation is air, actually it must be trapped air (not allowed to convect).  Wool traps the air, similar to fibreglass or other home insulators.
Answer: Wool is a good insulator as it traps air in it and prevents it to flow out carrying heat with it and thus prevents lowering temperature of body

Why do we use wool for insulation?


Trying to use second sd card raspberry pi

Question: I just got a new 64 GB micro sd card and installed NOOBS based off this tutorial (https://projects.raspberrypi.org/en/projects/noobs-install). I did not format it since I just bought the sd card and it had nothing previously on it. When I inserted it into my pi 4, the green light did not turn on, and there was no hdmi signal. I have prevously used a 32 GB micro sd card with NOOBS preinstalled to run Raspbian on this pi 4, but I wanted to try with this micro SD card. Why isn't this working?
Comment: Does this answer your question? [Formatting 64/128gb microSC card to run on RP3](https://raspberrypi.stackexchange.com/questions/57970/formatting-64-128gb-microsc-card-to-run-on-rp3)
Comment: What software you used for installing the disk image?
Answer: Because the SD Card is formatted as exFAT. It needs to be reformatted - BUT save yourself a lot of trouble and forget NOOBS
.
Install Raspbian using the Foundation installer.


'NoneType' object is not subscriptable in python

Question: #i'm just testing it

lst=[3, 2, 4, 5,1]

print([i for i in lst if i % 2 != 0].sort()[0])

#i haven't tried any thing

#I expect the output 1

Comment: `#i haven't tried any thing` -- I suggest that you do: remove the `[0]` and see what type the expression has (you can use `type` for that or just `print`).
Answer: sort() sorts a list in place and returns None. Looks like you meant to use sorted instead:
print(sorted([i for i in lst if i % 2 != 0])[0])

Note, however, there's no need to sort the list if you just take its first element. You could use min instead for the same result with a better performance (O(n) instead of O(nlog(n)):
print(min([i for i in lst if i % 2 != 0]))

Comment: Or use sorted like this heheheh
Answer: The problem here is, when you run the 'sort' function on a list, this function updates the list and returns void. So you really are trying to call a index on a NoneType object.
The best way to solve this problem is setting the filter to a variable, run the sort on this var and after this, print the value that you want to.
Ex:
l = [i for i in lst if i % 2 != 0]

l.sort()

print(l[0])

Answer: sort() is modifying method and returns None
This one works:
lst=[3, 2, 4, 5,1]
odds = [i for i in lst if i % 2 != 0]
ods.sort()
print(ods[0])


Engagement during iddat of a girl

Question: If any girl is in "iddat"(iddah) and parents wants to see any person for her new marriage. Is it "Halal" to commit any girl with someone during "iddat", although marriage will be done after completion of iddat. Kindly guide me.
Thanks.
Comment: What do you exactly mean by committing any girl with someone? I don't see any harm in proposing for marriage to a woman in 'iddah as the qur'an say's there no harm in it [2:235](https://legacy.quran.com/2/235) the point might be the how to!
Answer: During Iddat women not allowed to even talk with some "Na Mehram", Even she is not allowed to see "Na Mehram".Then how can a women can be committed to someone or get engaged with someone.So this is not allowed during the time period of Iddat ,yes it is allowed after Iddat duration.
Comment: Could you provide any evidences supporting your claims? The qur'an addresses proposals for ladies in their 'iddah in verse 2:235
Answer: No its not right because in iddat the lady have to be restricted she is not allowed to met talk and seen by any na mehram so how can be committed to anyone else?
So the lady have to complete her duration according to Islamic laws then she can committed to any one where she or her parents wants.
Comment: Do you have any evidence for this? See [answer].

Engagement during iddat of a girl


Dropbox Objective-C SDK on Mac OS X?

Question: I would like to integrate Dropbox support in my application but it appears that the only SDK Dropbox has for Objective-C is for iOS. Does anyone know if the SDK can run in unison with Mac OS X considering they use the same language or is there a framework made by someone else that I can use? Been unsuccessful in my search so far.
Answer: Dropbox just released its OS X SDK today: https://www.dropbox.com/developers/reference/sdk
Answer: Dropbox's SDK support focuses on mobile platforms, but they're all just shims over a standard REST API. However, Dropbox might not approve your use of their service in your desktop application. Probably best to drop them a line and see.
Answer: The official answer from Dropbox.

Dropbox Objective-C SDK on Mac OS X?


PSO Clustering using R using Repplab package

Question: I wish to try clustering a matrix of numerical data using swarm intelligence.
(Matrix is 28000 X 53 and sparse). I'm working in R and found the REPPlab package and used the EPPlab function. My question is how do I go from here to actually cluster my data? I know PSO can be used for clustering as well as optimisation but I'm stuck!
Comment: Looks like I asked a related question when I was first getting into this: http://cs.stackexchange.com/questions/29533/what-is-the-global-function-we-are-trying-to-optimise-with-clustering-algorithms/44468#44468
Answer: I know nothing of this package, or of R, but I do know PSO and clustering.
Intro:
In short PSO, can only be used for Optimization, but Clustering can be described as an optimization problem.
We have some a set of points in N-Dimentionals Space (the columns of your matrix), -- call this set $X$
we want to partition the points into several clusters, call the set of clusters: $S=\{C_1,C_2,...,C_k\}$.
For any cluster $C\in S$ we can find its centroid: $\mu(C)=\dfrac{1}{|C|} \sum\limits_{\forall x\in C}x$
and its variance:  $\sigma^2(C)= \sum\limits_{\forall
  x\in C}{\left(x-\mu(C)\right)^2}$
What makes a clustering Good?
One way is:  We would like to minimize the average variance of the clusters.
We can express this as an optimization function to minimize:
 $g_{fit}(S)=\dfrac{1}{|S|}{\sum\limits_{\forall C\in S}}\:{\sum\limits_{\forall x\in C}{\left(x-\mu(C)\right)^2}}$
By minimising the average varience we are saying we don't care for one over the others. It is worth making one cluster half as compact, to make another 3 times a compact.
Not that $\dfrac{1}{|S|}$ is a constant. The work of Ahmadyfard (see below), uses another constant factor:  $\dfrac{1}{|X|}$, but it also doesn't matter -- Constants scaling factors don't change the performance of PSO at all.
This is not the only measure we could use. Chen and Ye's
                2004 paper (below) uses: $g(S)={\sum\limits_{\forall C\in
    S}}{\sum\limits_{\forall x\in X}{\left(x-\mu(C)^2\right)}}$
Ye and Chen's 2005 paper uses a much, much more complex optimization function.
Both the above formula are scalar valued Optimization functions, parameterized by numerical values, in this case  the numerical values are the locations of the Centroids of the clusters. Note: There is a isomorphism between the location of all the centroids and points $X$, and the membership of the clusters -- Simply assign cluster membership to the cluster with the closest centroid, or to go in reverse take the centroid using the mean equation above.
To explain with math: That function of assigning membership can be describes as being given by: $\mathcal{C}:Z\to S: z\mapsto C_i$. Where $Z$ is the set of all centroids. And $C_i$ is the ith cluster, which as $z$ as its centroid:
Then we reexpress the fitness function:
$g_{fit}(Z=\{z_1,z_2,...,z_k\})=\dfrac{1}{|Z|}{\sum\limits_{\forall z \in Z}}\:{\sum\limits_{\forall x\in \mathcal{C}(z)}{\left(x-z\right)^2}}$
Since we have a numerical optimization function, we can now solve it with a PSO.
You should probably look into the methods that combine PSO with K-Mean.

References

Chen, C.-Y. & Ye, F. Particle swarm optimization algorithm and its application to clustering analysis Networking, Sensing and Control, 2004 IEEE International Conference on, 2004, 2, 789-794
Ye, F. & Chen, C.-Y. Alternative KPSO-clustering algorithm Tamkang Journal of science and Engineering, TAMKANG UNIVERSITY, 2005, 8, 165
Ahmadyfard, A. & Modares, H. Combining PSO and k-means to enhance data clustering Telecommunications, 2008. IST 2008. International Symposium on, 2008, 688-691

See also:

Rana, S.; Jasola, S. & Kumar, R. A review on particle swarm optimization algorithms and their applications to data clustering Artificial Intelligence Review, Springer, 2011, 35, 211-222
Tsai, C.-Y. & Kao, I.-W. Particle swarm optimization with selective particle regeneration for data clustering Expert Systems with Applications, Elsevier, 2011, 38, 6565-6576


How soon can I re-enter the USA having stayed for 90 days under the Visa Waiver Program?

Question: I am currently visiting the USA from the UK (I am a UK citizen) and am intending on staying here for the full 90 days under the Visa Waiver Program.
How long would I have to stay out of the US at the end of this period before returning again?
Would I have to return to the UK, or could I stay with friends in another country (such as Canada) for a while?
Comment: @chx Seriously? Are you just trying to chase a badge now? The answers contain *one* item of similar content (rule of thumb = 91 days) but the questions are not even *similar*! And that doesn't address *where* the intervening time needs to be
Comment: Be aware that the ESTA only applies to direct flights into the US, not to crossings via land borders.
Comment: What exactly does that mean? Should the OP leave US by plane, or if he leaves and intends to enter by land he should get another visa? Can you clarify that, maybe posting a link to an official source?
Comment: @gmauch There is no visa or ESTA at all for land crossings; they do the paperwork at the border, not beforehand.
Comment: Related: https://travel.stackexchange.com/questions/10446/what-is-the-minimum-wait-before-i-may-i-re-enter-the-usa-after-a-90-day-visit-on
Comment: @cpast no visa at land crossings applies only to people who are using the VWP or some other visa exemption.  Anyone who needs a visa to fly into the US also needs a visa to cross the land border.
Comment: @phoog The OP is a UK citizen using VWP.
Comment: Just to clarify, a national of a visa waiver country, who would ordinarily enter by air with an approved ESTA, does not require an ESTA at a land crossing, and may enter under the visa waiver program by filing a paper I-94W: https://help.cbp.gov/app/answers/detail/a_id/1132/~/citizen-of-visa-waiver-country%2C-wants-to-drive-into-u.s.-from-canada-or-mexico%2C
Answer: It all comes down to a 'reasonable length of time' between stays.
Now that's about as ambiguous as they come - what's reasonable?  It's like this on purpose - it's up to the official at the border, as the purpose of this is to try and work out if you're trying to live in the states and just border hopping every 90 days, instead of visiting.
From the CBP website:

When traveling to the U.S. with the approved ESTA, you may only stay
  for up to 90 days at a time - and there should be a reasonable amount
  of time between visits so that the CBP Officer does not think you are
  trying to live here. There is no set requirement for how long you must
  wait between visits.

If you're worried they may think you're trying to live there, then you could bring extra documents as evidence - eg, your flight out of America back to the UK, or proof of your current employment and residence in the UK.  Basically anything to convince them that you're not actually surreptitiously residing in the US :)
Note that going to islands or Canada doesn't reset it, as found on most US embassy websites:
"The Visa Waiver Program (VWP) enables nationals of certain countries, including Australia, New Zealand, and the U.K., to travel to the United States for tourism or business for stays of 90 days or less without obtaining a visa, if certain requirements are met. Under the VWP, time spent in Canada, Mexico, and adjacent islands counts towards the maximum of 90 days stay allowed under the program."
Short version - it doesn't matter, what matters is convincing  the border officer that you're visiting, not living in the US.
Comment: actually it might....from most US embassy websites: "The Visa Waiver Program (VWP) enables nationals of certain countries, including Australia, New Zealand, and the U.K., to travel to the United States for tourism or business for stays of 90 days or less without obtaining a visa, if certain requirements are met. Under the VWP, **time spent in Canada, Mexico, and adjacent islands counts towards the maximum of 90 days** stay allowed under the program."
Comment: @MarkMayo I would edit that last comment into the answer. It's very important that the OP understands it. If they go to Canada for "a short time" and try to come back, they are very likely to be refused.
Comment: That's very helpful Mark, thank you! If I did go to stay with friends in Canada at the end of the 90 days, would that cause a problem with re-entry to the US subsequently, if I didn't return to the UK first?
Comment: @philyates No it shouldn't, unless you decide to fly from Cuba. :)
Answer:
If you go to Canada and Mexico or the Caribbean, and while you are there, your initial 90-day period of entry expires, but you need to come back in to the U.S. to fly home, you may encounter a problem. The terms of the VWP are very clear - it is only to be used for occasional, short visits to the U.S. If the CBP Officer thinks you are trying to "reset" the clock by making a short trip out of the U.S. and re-entering for another 90-day period, you can be denied entry. (If that happens, you will have to obtain a visa for any future travel to the U.S.) In order to be re-admitted to the U.S. shortly after a previous admission expired, you will have to convince a CBP Officer that you are not trying to "game" the system.

https://help.cbp.gov/app/answers/detail/a_id/194/kw/90%20days
(as of 25 Mar 2015)
Answer: https://travel.stackexchange.com/a/61835/4188 has the answer.

the important paragraph reads:

The Visa Waiver Program doesn't work that way. If he decides to use the Visa Waiver Program (ESTA); maximum stay is 90 days and he needs to allow adequate time between visits. The rule of thumb is if he is in the US for 90 days; should be out of the U.S. for 91 days before returning.

It's not an official regulation but a "rule of thumb".
Answer: There is no official rule on this. It is up to the discretion of the customs office dealing with you at the border to decide if you can or can't enter. This applies whether you have a visa or wish to use the Visa Waiver Program (VWP).
The prime directive of the officer is to assume you wish to permanently live in the USA (i.e. immigrate there). It is up to you to prove otherwise. The amount of "proof" required may be as simple as your verbal statement that you intend to do XYZ whilst there, and intend to leave on XYZ date. Yet there are scenarios that tend to trigger suspicion at boarder control. For example, if the records show you have been spending more time in the USA than you have outside the USA, the officer may decide you are misusing the VWP system to "live" in the USA. Another example, if you have previously stayed in the US for a maximum 90 days on the VWP, and then you return, let's say, within 12 months of your previous entry (although, it's totally at the discretion of the officer you deal with) this can alert them to questioning you more throughly. I know of numerous first-hand cases when that second scenario has played out. One was a friend from Sweden who stayed 89 days on the VWP. She returned 11 months later, to visit for another 80 to 90 days (which she told the officer), and she was taken aside for 3.5 hours of searching and questioning. She missed her connecting flight, and had to go to great lengths to convince them she had zero intention or desire to immigrate there.
My personal experience is that some ports of entry have officers with significantly stricter attitudes. Others are more relaxed. For instance, in my experience, the difference between entering the USA via Florida and New York is like night and day. I've entered through both on many occasions. I've also noticed a significant difference between LAX and SFO when entering on the West coast. Although, I will say recent (2015 to 2017) experience at LAX has been more relaxed. I always come and go through SFO if possible. It's not as much of a difference as MIA and FLL (both in Florida), but enough to warrant avoiding LAX and NYC if possible. Also the airport is less busy in SFO so that's a plus.
It is my understanding that if you are denied entry you will require a visa to return to the USA (and this will hold true for a period of 10 years). Receiving a visa may also be more difficult if you were refused entry at the border. You will likely have to go to much greater lengths (if even possible) to prove the validity of your reasons for visiting the USA, and applying for a visa. Caution is advised.


Viewshed for each pixel in raster?

Question: please can you help me with writing script for viewshed that evaluate a count of visible cells from every pixel? Or is there any plugin that can do it?
Comment: Welcome to GIS SE!  Would you be able to edit your question to include the GIS software, extension and version that you are using, please?  Also, you will find that you are much more likely to get help with where you are stuck on code if you can post a snippet that works up to that point.
Answer: This is exactly what the Visibility index is. For further details see my reply to this post and my blog at this site, which describes the index and some of the complications for calculating it. The site also provides a link to the open-source software that can be used to perform the analysis. Importantly, since a cumulative viewshed area is an extremely computationally intensive thing to calculate, the algorithm uses several approaches to make it more feasible.
Answer: I would use ArcGIS for this, but the approach can be used in any GIS package which is capable of making a cumulative raster.
This is going to take a long time to run -- possibly days, depending on the size of your input raster. I suggest testing on a small subset area for, to make sure the results are what you want. But you don't need a script.

Convert the raster to a point feature.
Run Viewshed on the point feature, with the original raster as the elevation surface.

This produces a cumulative viewshed, instead of the traditional binary viewshed. Instead of a simple "visible/not visible" raster result, it is a count of how many of the input features are able to see a specific pixel. (Useful theoretical paper on the subject if you're interested.)
Typically, this is used with a small number of observation points -- so if 10 points are used as the input, the output raster has values from 0 to 10 depending on how many points can see a given cell. But we can assume intervisibility: if an observer can see a target point, then the target point can also see the observer point.
Therefore, if you use the entire raster as input observation points, the resulting cumulative raster tells you how many other cells each cell can see.

Viewshed for each pixel in raster?


Is a hashgacha required for freshly squeezed orange juice?

Question: Does freshly squeezed orange juice require a hashgacha? (ex: the freshly squeezed orange juice at Whole Foods)
Comment: [Welcome to MiYodeya](https://judaism.meta.stackexchange.com/a/3887/11501) Aryeh and thanks for this first question. Can I recommend you take the [tour](https://judaism.stackexchange.com/tour) to get a sense of how the site works?  Great to have you learn with us!
Comment: Another problem might be orlah and/ or ma'aser, if you're in Israel (and orlah even outside of israel, if you know the fruit tree belongs to a Jew).
Comment: are they squeezing it on the spot for you, or is it sold in bottles?
Comment: If you're talking about getting freshly squeezed OJ from a juice cart or store that squeezes the oranges in one of those automated machines, I can't envision a problem. The only items I've seen going into these machines are citrus fruits. I can't fathom grapes fitting into this machine, anyway, and even if it were, it **might** be nullified in 1/60 anyway. Whole oranges are stacked into the top of the machine and the machine cuts and squeezes fruits. As for a manual process, here too, usually the knife used is for just the fruits, and there's no problem cutting grape stems (cont.)
Comment: The only problem here might be if they use the same machine to make grape juice.
Answer: From the cRc juice list:

Fresh (refrigerated) orange juice should preferably be purchased with reliable kosher certification.  If that is not available or there is a particular brand that is considerably lower in price, one may purchase orange juice that is not certified, as long as it does not contain any kosher-sensitive ingredients (e.g. colors, flavors, other juices).

practicalhalacha.com "When Hechsher NOT Needed" writes:

Pure fruit juice NOT made from concentrate (such as orange or pineapple juice) does not normally require a hechsher (except for grape juice, which always requires a hechsher!).

However, see ShulchanAruchHaRav.com's "Juice without a hashgacha" for additional considerations.
As always, safest bet is to CYLOR.
Comment: +1 but you might want to add the case of a machine preparing fresh orange juice on premise, which I think is the case of the OP. Like made from real oranges with nothing else (yes it exists!)


Heat blowing hot but only on low

Question: I have a 2000 DODGE Ram 1500 v8. My heat only work while its blowing low and when I switch speeds it starts to get cold. I almost checked everything that could be check other than the wires.
Comment: Do you have a temp gauge on your dash? I'm thinking your thermostat is stuck open. Either that or you have a blocked heater core.
Answer: I'm pretty sure the thermostat is stuck open. The coolant/engine won't heat up fully and you'll get cool coolant through your heater core. In most vehicles (and I'm pretty sure this is how the Dodge Ram's work) the coolant goes from the engine to the heater core directly. If the engine is running cold due to an open thermostat, only cooler coolant will be making it to the core. Your description of the heater putting out warm air when sitting still, then going cool after rolling fits right into this scenario.
Answer: Is it a gradual change? Like when you turn the speed selector dial, does it slowly get cold? Or does it just literally instantly change? Are there any noises you hear when you change from low to different speeds?
This is important. I believe they use HVAC control units in those and that may be causing the problem. There are two motors, one for vent control and the other for your blend door. If there is an issue with the control unit, it can act up. I've seen similar issues electrically in many Dodge vehicles. Dodge (Chrysler) is known for having issues with their HVAC (Heating, Ventilation, Air Conditioning) systems.
Comment: If I let it set and heat up then switch speeds it want change right away but it does eventually. I check my blend doors and they open and close, I just flush my heater core today and it went clear almost instantly. It doesn't run hot at all.
Comment: For those circumstances I would deduce that it would relate to your thermostat. It could possibly be the water pump beginning to fail; Doubtful though. Your thermostat is probably the issue here. @Paulster2 is most likely correct.
Comment: Quick question if my truck isn't running hot how could it be a thermostat. Just asking... @Paulster2
Comment: One of the few purposes of the thermostat is to help the vehicle heat up quicker. When closed it blocks the flow of coolant circulated within the engine. Once the engine reaches operating temperature it will open the thermostat allowing it to circulate coolant throughout the entire system. When the thermostat is stuck open a vehicle will not heat up properly because it is flowing throughout the entire system constantly rather than allowing the engine to get up to operating temperature
Comment: @cloudnyn3  Did you mean to mention "vacuum operated" HVAC controls.  This would be correct, but not likely to cause this problem.
Comment: I'm changing my thermostat and given my truck a oil change tomorrow well today. I'll let you know how out turn out.
Answer: Some cars have a small electric pump for creating coolant flow around the heater matrix.  I don't know if your car has one of these, but if it has, it could be the problem.
Comment: No extra pumps on these.
Answer: I have a 1999 dodge ram did the same thing. It was the heater core. Mine would blow heat on low but no other speed. Once I replaced the heater core everything worked great.

Heat blowing hot but only on low