Typical labelled vs. unlabelled trees properties

Question: Consider two random tree models $T_1(n)$ and $T_2(n)$, chosen equiprobably among labelled and unlabelled trees on $n$ vertices respectively. I'm wondering if there are properties that are vastly more present in one model than another. That is, what are examples of natural property functions $f$ such that $\Pr(f(T_1(n)))/\Pr(f(T_2(n))) \to 0$ or $\infty$ significantly fast as $n \to \infty$? Can one of the probabilities tend to $0$, and the other tend to $1$?
Comment: Is $f$ defined on both labeled and unlabeled trees? Or do you mean that labeling of the former is ignored before applying $f$?
Comment: $f$ should not discern between isomorphic trees.
Comment: Check out Ralph Freese's paper "On the two kinds of probability in algebra".  He addresses (a version of) this question for general algebraic structures and answers it essentially in the negative. You may find the arguments applicable to your situation, or at least learn some f to avoid.  Gerhard "Things Good To Know About " Paseman, 2018.11.06.
Answer: Surely, these should be properties which w.h.p. imply that there are many (or few) automorphisms of an (unlabelled) tree. Not sure whether this counts, but here are few candidates of some random variables which seem to correlate with the number of automorphisms.
The most obvious one is, surely, the number of automorphisms itself;). So, a labelled tree should (at average) have more automorphisms (as an unlabelled tree) than an unlabelle one.
Another example is the number of leaves: if a tree has many leaves, it is likely that some of them are attached to one vertex, and so permutations of them provide automorphisms of the tree. And, indeed, the probability that a certain vertex of a labelled tree is a leaf is $(1-1/n)^{n-2}$ (since the vertex is a leaf iff it does not appear in the Pruefer code), so the average number of leaves in it is around $n/e$. The situation with unlabelled trees is harder, but it should be close to the situation with the rooted unlabelled trees. For such, the probability that the root is a leaf is the ratio of the number of rooted trees on $n-1$ vertex to that on $n$ vertices, and it tends to $1/\alpha$ where $\alpha=2.955765,,,$. Hence, the average number of leaves in an unlabelled tree should be not far from $n/\alpha$.
So, it seems that one valid property is, say, `the tree has at least $7n/20$ leaves'; I do not know, however, whether it counts as natural...


Best Practices to archive or remove old data in SQL Server 2012

Question: Our application has numerous tables that contain outdated data, some dating as far back as 2010. Despite having indexes defined on these tables, many of the index seeks retrieve old records, which is time-consuming and unnecessary. As a result, we plan to archive or delete the old records, retaining data from the past five years. What are the recommended practices for archiving or removing data from databases? Should we simply move the records to a new table for archiving, and delete them entirely for removal?
Answer: Indexes do not seek data, the query does. If your query check old data, then it is written incorrectly.
A simple example:
select year, sum(amount) from sales where shop=123 group by year
select year, sum(amount) from sales where shop=123 and year>2015 group by year

The first query will check all data including the old one. Even if shop=123 did not exist in 2014. The second query will immediately exclude old records. Of course, you need to have the year field in the index.

But if you really want to ensure that old data will not be touched, there are several ways to do the cleanup of unneeded data:

Just delete the old data. You will of course lose it completely, but it wont interfere with current data anymore.

Separating work data by view. Just add a set of views which would have select * from tbl where datediff(year, modifydate, getdate())<5. Ensure you have an index on the modifydate field. And write your actual queries against these views, not against the real tables. Advantages - very easy to setup, disadvantage - can be confusing (read from one object, update another object).

Partitioning - use the partitioning mechanism provided by the server. Advantages - easy and reliable. Old data is still available, but if request requires data from only one partition - it will go to just that partition.

Archiving in a table - partially manual process: Create a separate table in the same database, move (copy-delete) the old data from the work table into archive one, define a view with a union of work table and archive tables. Main disadvantage: you would have to have three separate queries for current-old-combined data. Another possible problem - if you decided to change the structure of the work table with current data - do not forget to update the archive table and combining view also. And you, of course, would have to setup a copy-delete procedure to be run regularly (manually or from some scheduler).

Two-server solution - one server has just the current data, another has all the data. Requires ETL between them. Requires second connection to read history. The client application have to be smart enough to combine history and work data. But on a plus side - the db structures between work and archive servers can be very different and be as much normalized or denormalized as you need. This approach often expanded into three-server solution: work data (current, highly normalized), history dump (absolutely anything), analytic-reporting data (highly denormalized, partial data which can exclude many fields unneeded in standard reporting).
Answer:
many of the index seeks retrieve old records, which is time-consuming

Doesn't make a ton of sense to me. Assuming you're not forcing index seeks with query hints, the seeks will be based off the value in the predicates of your queries. If your queries are selecting data from 10+ years ago, you should adjust your queries / predicates to not do that. No need to archive data. - user150011
Agreed, unless you need the space on expensive disks then it's just a matter of tuning your queries. Possibly partitioning may help. - user220697
Related: Archive Relational OLTP Database by Year


Locations for new crew members

Question: Where can I find a list of new people to recruit for the heists? I know at least one is available from a random encounter, I'm wondering how many there are total, and where they are located?
Comment: I've not seen a list but can tell you from playing it through that you get a few just by following the story.  I only had 1 through a random encounter.
Answer: You get 2 new crew member from random encounters:

Packie McReary from GTA IV, a highly skilled gunman.
Taliana Martinez, a highly skilled yet very cheap driver (definitely get her!)

Where to find them: Every copy of GTA 5 should be shipped with a map, we'll be using that map to locate them. Packie can be found in South Los Santos by the clothing store at H3 on the map.
Taliana is on the Great Ocean Highway in Blaine County at B5, where the highway and the railway intersect.
Keep in mind that since these are random encounters, there is a chance that their encounter will not trigger even as you approach the area.

You get 2 new crew member from doing regular missions.:

Rickie Luckens, a cheap and low-skilled hacker. Available after he calls Michael after completing the mission Friend Request. But also if you do the first heist with him or any other low skilled, low cut crew members they will gain skill and still take the same cut that he has started with in other heist(Jobs).
Chef, a highly skilled gunman. Available after he calls Trevor after completing the mission Trevor Philips Industries.
Comment: Those are the only 4 I know of. Feel free to complete the list, if there are more.
Comment: What happens with the map if you buy GTA on steam?
Comment: @Andalur - GTA5 has not been released for PC yet.  The map is going to be exactly the same though.

Locations for new crew members


What happens when a star gets hit by a supernova?

Question: This may sound like a strange question, but say that two stars are relatively next to one another in a binary star system, what would happen to one of the stars if the other went supernova? Would it explode as well, or would it survive the blast?
Comment: Interesting question - but be warned that a lot of different factors affect the outcome.  A supernova can grow to a rather large diameter, but will have a relatively low energy density compared with the partner star - even tho' that energy density is enough to kill anything vaguely alive.
Answer: There are certain cases where the remaining star survives; this happened to high-mass X-ray binary star systems, pairs which consist of a neutron star or black hole (the remnant of a supernova) and a massive star. The X-rays are produced when some of the material ejected by the star is captured by the supernova remnant.
The most famous of these is Cygnus X-1, the first object widely accepted to be a black hole. The massive star in this pair has the same name as one of our moderators.
Answer: Remember that although a supernova expels a huge amount of matter, this matter travels outwards in all directions and only a tiny fraction of it impacts on the binary partner. In the case of a core collapse supernova, the vast majority of the energy released is in the form of neutrinos, which will generally fly straight through the binary partner without impact.
In a type 1a supernova, most of the released energy is kinetic. However, as the exploding star is completely disrupted, this "kicks" the other star out of the system (think of swinging a ball on a string in a circle around you, and you suddenly relax your grip on the string), so it's not hanging around for the shock wave. Since this is travelling at 5,000-20,000 km/s, it will eventually (within a few hours) catch up with the escaping star, but will have become substantially attenuated by then.
In addition to Glorfindel's answer, it's worth noting that where the remnant partner of a high-mass X-ray binary is a black hole, it's likely that the progenitor star was also high-mass and collapsed directly to singularity, without a significant explosion. As Felix Mirabel and Irapuan Rodrigues note in Formation of a Black Hole in the Dark: "The observations suggest that high-mass stellar black holes may form promptly, when massive stars disappear silently."
You might also be interested in the answers to these questions on our sibling site [Physics.SE]:
What happens to the neighboring star of a type Ia supernova?
Regarding binary systems (with pulsars)
Comment: Thank you for that amount of info, it is quite interesting


grub booting problem

Question: I have Windows 8 and Kali Linux installed. While i was installing Kali there's an opportunity to install grub and i did it. But i am unable to boot Kali Linux and even see grub menu as far as there's the only boot option in boot menu i.e: windows boot manager so windows starts without grub. I tried to fix it by reinstalling and updating grub using post grub-install : command not found instructions. Grub was successfully reinstalled and updated, recognized both windows and Kali(as there're listed in grub.cfg) but i can't fix booting problem.
Comment: you still not finding Kali in Grub menu?
Answer: I am facing the same problem on kali-win 10 dual boot.
The root of the problem seems to be Windows Boot Manager which excludes the grub EFI partition on your drive while booting.
Link to my question: Kali Linux is Installed but not showing in boot manager
One Solution can be to install the os on Legacy Boot option.

grub booting problem


Get log files from Pod (containers) before it get killed?

Question: I am having 2 containers inside one pod, 1 is DB and 1 is application. When my  application container started but, not ready to accept traffic by this time the container generates some log files and I want those log files for further application investigation. As the container does not passes readiness probe and it failed to start so, the pod is getting killed so, the log files also getting deleted so how I can get those log files before the pod is getting killed??
Comment: Perhaps a bit silly, perhaps useful; but you could reattempt the upgrade of your deployment and check the logs during readiness checks simply using `kubectl logs `.
Comment: You should investigate how to use `oc debug` and run an instance where you get interactive shell access. You can then run the original startup command manually and watch what happens, using a separate terminal to `oc rsh` into the debug pod to tail any file system based logs if necessary. Using file system logs is bad practice, should send to stdout/stderr so the platform can capture them.
Answer: What about forward logs to STDOUT and STDERR? That would be the cleanest solution (however, it requires some changes in your code).
https://kubernetes.io/docs/reference/kubectl/cheatsheet/#interacting-with-running-pods
Answer: The quickest solution is probably to just mount a volume of type hostPath to your pod. Then, bind this volume to your log directory.
 See the documentation here.
Just keep in mind that this solution is certainly not the cleanest one. It's just for debug purpose.
Answer: A one-off solution is to install stern and then run the following command in a separate terminal before starting your application container:
stern <pod_name>

You can then pipe the output to local storage for further analysis
Answer: create a persistent volume and mount it on the log directory of containers.You will get logs even after pod is killed. Few volume type that you can be used for this task are -

azure disk
hostpath
gce persistent disk
The simplest one is hostpath but not preferred .
Answer: You can get logs of a container inside a pod by using -c CONTAINER flag of oc logs command.
If you know the name of the container in your pod, you can get the logs of that container with a command like below
for i in {1..100}; do oc get pods -o name | grep -v "deploy" | xargs -i oc logs -p {} -c CONTAINER_NAME; done
Of course it will be good if you run this in an empty project only with your failing pod.


Calculus area between graph and x axis

Question:
How to solve this question ?
The integral would be 0.3x^3+xc^2 + c
0.3(64)^3 +(64)c^2 +c =0
c= 78643.2/( -64+c)
am I right ?
Answer: Draw a picture. You will get a familiar parabola, with axis the $y$-axis. Note that the region we want the area of is below the $x$-axis, and extends from $x=-c$ to $x=c$. By symmetry, the area is
$$2\int_0^c (0-(x^2-c^2))\,dx.$$
So we are integrating $c^2-x^2$, and then doubling.  Calculation gives $\frac{4}{3}c^3$.
We want this to be $64$. It is now not hard to solve for $c$.
Answer: The problem should be restated because the area "between" the function $y=x^2-c^2$ and $y=0$ is always equal to $\infty$.
I would restated the problem as follows

Find the exact positive value of $c$ if the area of the region bounded by $y=x^2-c^2$ and the x-axis is 64.

Next, make some sketches.
Clearly the region bounded by the curve and the x-axis is the region in blue. The area between the 2 curves is the |pink area|+|blue area|.
The area bounded would be
$$\bigg|\int_{-c}^c(x^2-c^2)dx\bigg|$$
$$= \bigg|\frac{x^3}{3}-c^2x\bigg|_{-c}^c\bigg| = \bigg|\bigg((\frac{c^3}{3}-c^3) - (-\frac{c^3}{3}-(-c^3))\bigg)\bigg|$$
$$= \bigg|-\frac{2}{3}c^3- \frac{2}{3}c^3\bigg|$$
$$= \bigg|-\frac{4}{3}c^3\bigg| = \frac{4}{3}c^3$$
But
$$\bigg|\int_{-c}^c(x^2-c^2)dx\bigg| = 64$$
so
$$\frac{4}{3}c^3 = 64$$

Calculus area between graph and x axis


C# Function Awareness?

Question: In a multi-thread app. is there a way to programatically have thread-B check what function thead-A is currently in?
Comment: Here's a similar question: http://stackoverflow.com/questions/285031/how-to-get-non-current-threads-stacktrace
Answer: You can get a stack trace of another thread by doing this:
System.Diagnostics.StackTrace stackTrace = new System.Diagnostics.StackTrace(myThread);

From this you can get the call stack, and the function it's currently executing.
Comment: It's worth noting that I don't know if there are any threading issues you may encounter by doing this.
Comment: The other SO question says Suspend/Resume needs to be called.
Answer: This is something that should be built in to the application itself in order to avoid possible contention between threads.
In my opinion, a thread should never control the execution of another (e.g., suspend/resume), except for starting it. They should merely suggest that the other thread control itself (with mutexes and events, for example). That greatly simplifies thread management and reduces the possibility of race conditions.
If you really want thread B to know what thread A is currently doing, thread A should be communicating that to thread B (or any other thread such as the main thread below) using, as an example, a mutex-protected string with the function name in it. Something along the lines of (pseudo-code):
global string threadAFunc = ""
global mutex mutexA
global boolean stopA

function main:
    stopA = false
    init mutexA
    start threadA
    do until 20 minutes have passed:
        claim mutexA
        print "Thread A currently in " + threadAFunc
        release mutexA
    stopA = true
    join threadA
    return

function threadA:
    string oldThreadAFunc = threadAFunc
    claim mutexA
    threadAFunc = "threadA"
    release mutexA

    while not stopA:
        threadASub

    claim mutexA
    threadAFunc = oldThreadAFunc
    release mutexA
    return

function threadASub:
    string oldThreadAFunc = threadAFunc
    claim mutexA
    threadAFunc = "threadASub"
    release mutexA

    // Do something here.

    claim mutexA
    threadAFunc = oldThreadAFunc
    release mutexA
    return

This method can be used in any language or environment that supports threading, not just .Net or C#. Each function in thread A has prolog and epilog code to save, set and restore the values used in other threads.

C# Function Awareness?


Does the Improved Pact Weapon eldritch invocation let a Hexblade warlock add their Charisma modifier to attack/damage rolls with a longbow?

Question: The Hexblade warlock's Hex Warrior feature specifies you can use Charisma for attack and damage with any non two-handed property weapon, which would eliminate longbows.  But would taking the Improved Pact Weapon eldritch invocation allow for longbow?
Comment: On further thinking... the question I linked is about two-handed weapons and likely only melee ones and it does not address the ranged weapons that the Improved Pact Weapon Eldritch Invocation allows for
Comment: Related: [Does the Hexblade warlock's Hex Warrior feature let me add my Cha bonus to attack/damage rolls with a two-handed pact weapon?](https://rpg.stackexchange.com/q/112724/33569)
Answer: Hex Warrior works with any Pact Weapon
The final part of the Hex Warrior feature states:

[...] If you later gain the Pact of the Blade feature, this benefit extends to every pact weapon you conjure with that feature, no matter the weapon's type.

Notably, it says that you gain its benefits to every pact weapon, regardless of its type. Unfortunately, the rules do not actually define "weapon type" so we are left using the standard English definition of "type":

A category of people or things having common characteristics.

So a weapon's type is its categories. Within the books weapons have a few categories but I believe "type" here means weapon names such as "Javelins" or "Shortswords". Using this idea, we would conclude that Hex Warrior applies to any and all Pact Weapons regardless of anything else.

Unfortunately, that definition of "type" isn't truly supported, but perhaps related to that definition is the Kensei Weapons feature, which states:

Chose two types of weapons to be your kensei weapons: one melee weapon and one ranged weapon. Each of these weapons can be any simple or martial weapon that lacks the heavy and special properties. The longbow is also a valid choice.

Note it says to choose two types of weapons. Though it doesn't explicitly say "Javelins" or anything similar is considered a type of weapon, I've never seen this featured ruled any other way at a table. This could support how the word "type" is used in the Hex Warrior feathre but it ultimately isn't truly evidence because the rules use natural language and so words and phrases don't always have a consistent meaning, especially not terms used seemingly only twice and in two utterly different sections of the rules.
Comment: I think "type" here just refers to each individual entry in the weapons table: dagger, shortbow, greataxe, longbow, etc. See [SilentAxe's answer to "Does the Hexblade warlock's Hex Warrior feature let me add my Cha bonus to attack/damage rolls with a two-handed pact weapon?"](https://rpg.stackexchange.com/a/191490/33569) for reference.
Comment: @V2B Added stuff and wrote how I actually don't think that is evidence, but it is a good start
Answer: Yes, any Pact Weapon can benefit from Hex Warrior.
The Hex Warrior feature states the following for using it for any Hexblade warlock:

Whenever you finish a long rest, you can touch one weapon that you are proficient with and that lacks the two-handed property.

However, it later states (emphasis mine):

If you later gain the Pact of the Blade feature, this benefit extends to every pact weapon you conjure with that feature, no matter the weapon's type.

Since the Improved Pact Weapon invocation was released in the same sourcebook, I assume it is intentional for Hex Warrior to work on two-handed weapons as long as they are Pact Weapons.


Scroll view in WP 7.5

Question: This is the link for the screenshot of my page (Sorry I can't upload it directly because my reputation is not enough)
page
Problem in number:
1: If I scroll it up it will override my notes background so it will not look good. How I can limit the showing text to only in notes background and if I scroll it up, the text in the upper side will be vanished?
2: If I have more text in bottom side, it will cut my text. So it doesn't showing all of my text.
This is my xaml
<StackPanel x:Name="ContentPanel" Grid.Row="1" Margin="14,0,10,0">
            <ScrollViewer x:Name="textScroller" Grid.Row="2">
                <StackPanel x:Name="Resep" HorizontalAlignment="Center" Margin="0,40,0,0" Height="Auto" VerticalAlignment="Center" Width="362">
                    <TextBlock Text="{Binding LineTwo}" Foreground="Black" Height="393" MaxWidth="362" TextWrapping="Wrap" Margin="20,30,1,0"/>
                </StackPanel>
            </ScrollViewer>
        </StackPanel>
    </Grid>

Answer: You need to add the Height and Width attributes to your ScrollViewer.

Scroll view in WP 7.5


Can Catholics receive a canonically valid marriage after civil elopement?

Question: Would it be legitimate in the eyes of the Church if two Catholics eloped civilly prior to receiving a Catholic wedding - then later enter in to a canonically valid marriage after the 8 month waiting/marriage prep. period required by the Catholic church is over?
Comment: As far as I know, two Catholics who get "married" civilly (or any other non-Catholic way) are automatically excommunicated. They would have to be absolved of that excommunication before they could have a Catholic wedding (and before they could receive any other sacrament except Penance).
Comment: @Yksisarvinen I checked Fr. Heribert Jone's book "Moral Theology" and I can't find anything about automatic excommunication for getting married civilly. So I think you're right about that. Fr. Jone does however, list (in Section 438, item 1) automatic excommunication (reserved to the local Ordinary) for Catholics getting married before a non-Catholic minister.
Comment: @AndreasBlass No, there is no excommunication. I guess what you mean is that people who are living like wife and husband without marriage Sacrament cannot receive absolution, but that's due to lack of repentance (assuming they do not see anything wrong in premarital sex and will continue doing so), not due to excommunication. There's a list of offences that can be (or automatically are) incurred with excommunication on [wikipedia](https://en.wikipedia.org/wiki/Excommunication_(Catholic_Church)#Excommunicable_offenses).
Answer: No, as this is considered adultery. But it's not a barrier to Catholic marriage later.
Civil marriage (as in by administrative officer) is not considered valid by C.C. I know this for a fact(s):

Information given when attending pre-marital course as required by CC for marriage (with a host of other, very useful news).
I know of at least two couples where this exact scenario happened: first, the civil union, then after a 6-8 months church marriage. Not sure of the penance, though.
Comment: Can you provide a link that the Catholic Church allows such an exemption for the UK? I doubt that the **"UK's civil marriage is still considered a valid marriage for C.C. "**
Comment: @KenGraham - Re-edited answer. Because you're correct. And my edits before publication of it left it in the wrong place. But still looking for that source you asked.
Comment: @KenGraham - Ok, so I've refreshed my memory and had conversations with other people. And I confused the two - sorry for that, but it was 9 years ago. C.C. and C. o E. have same view on civil and church marriage, but slightly different process. The main issue there is that the church ceremony might not look like it and non-English people often confused the two. So we were told - in that pre-marital course - that if any of us were previously married in UK, they must speak to priest privately to make sure what kind it was.


python add object to variable when using deepcopy

Question: I've got a few questions. Keep in mind i need to use deep copy as my classes will be expanding in complexity.

Is there a way to make it not reach the recursion limit when i do a deep copy?
When I preform a deep copy I want the new copy to be appended to the NODES variable just like it does in the init?

import copy

# Global
NODES = []

# Classes
class Node(object):
    def __init__(self, name, age):
        self.name = name
        self.age = age

class Truck(Node):
    def __init__(self, name="", age=0):
        super(Truck, self).__init__(name=name, age=age)
        NODES.append(self)

class Car(Node):
    def __init__(self, name="", age=0):
        super(Car, self).__init__(name=name, age=age)
        NODES.append(self)

    def __deepcopy__(self, memo):
        print '__deepcopy__(%s)' % str(memo)
        return Car(copy.deepcopy(self, memo))

Truck( name="Tonka Truck")
Truck( name="Monster Truck")
Truck( name="Pickup Truck")
car = Car( name="Oldsmobile Car")
car.age = 55
new_car = copy.deepcopy( car )

type_name = "Car"
cars = [x for x in NODES if type(x).__name__ == type_name]
print cars

print "NODES:"
for node in NODES:
    print "\t", node.name, node.age

Comment: Why can't you do the first part of this in `Node.__init__`? You have all the relevant information by that point.
Comment: Sounds like a case for metaclasses. Good luck, they confused the hell out of me.
Comment: how would i do part 2 then?
Comment: https://docs.python.org/2/library/copy.html
Answer: First, you really should use a defaultdict for Toys. It just meet this requirement If the superclass doesn't exists, it adds and appends the object. So let's go with
Toys = collections.defaultdict(list)

If you did not want to use copy.deepcopy, you could simply change Node.__init__ method to:
class Node(object):
    def __init__(self, name, superclass):
        self.name = name
        self.superclass = superclass
        Toys[superclass].append(self)

It works fine when you create a new Truck:
t = truck()
Toys['Trucks'][-1] is t

gives True
Unfortunately, deepcopy uses a special construction scheme and bypasses __init__ here.
But when __init__ can't do, just call __new__ to help...
__new__ is a lower level special method called as a class method to create the object before __init__ is called. And even deepcopy created objects are created with __new__. As it is a class method, you just need to declare the superclass names (BTW a superclass is another animal and you really should use a different name...) as a class attribute.
You code becomes:
import copy
import collections

# Globals
Toys = collections.defaultdict(list)

class Node(object):
    def __new__(cls):
        obj = super(Node, cls).__new__(cls)
        superclass = cls.superclass
        Toys[superclass].append(obj)
        return obj

    def __init__(self, name=""):
        self.name = name

class Truck(Node):
    superclass = "Trucks"

class Car(Node):
    superclass = "Boats"

class Boat(Node):
    superclass = "Nodes"

class Plane(Node):
    superclass = "Planes"

t = Truck()
t.name = "Tonka Truck"
print Toys
t2 = copy.deepcopy( t )
print t, t2, Toys

With this output:
defaultdict(<type 'list'>, {'Trucks': [<__main__.Truck object at 0x0000000002D71A20>]})
<__main__.Truck object at 0x0000000002D71A20> <__main__.Truck object at 0x0000000002D71B70> defaultdict(<type 'list'>, {'Trucks': [<__main__.Truck object at 0x0000000002D71A20>, <__main__.Truck object at 0x0000000002D71B70>]})

That proves that:

Trucks list has automatically been added to Toys
t created as Truck() as been correctly added to Toys['Trucks']
t2 create with deepcopy as been correctly added to Toys['Trucks']

You now just have to change to superclass name for this code to be acceptable...
Comment: just to be clear, you are saying i should not use 'superclass' since that is already being used in python as something else?
Comment: why use collections.defaultdict(list) over just empty [] or {}
Comment: Lastly, if i want any time a new node is created for it to get a new GUI where would i place that? `import uuid nodeID = uuid.uuid4()`


What's the deal with the rat king?

Question: I've found a "rat king" monster on floor 5 in a treasure room behind a secret door. I can't seem to attack it, and it just wonders the floor aimlessly. What's the point with that monster? Is there any way to defeat it, or does it have any other gameplay impact?
Answer: Taken from the Wiki.

The rat king was added as an easter egg referencing an aprils fools joke on reddit.
The rat king will try to run away from you if he sees you. You cannot harm the rat in any way.
Comment: You can however talk to it...
Answer: I've found that if you try and attack the King Rat too many times, he starts to hit you; taking 1 HP away each hit.
Comment: This is very nearly a comment the way its worded.
Answer: The rat king was added as an easter egg and does nothing but run around the level.
Interacting with it makes it say: "I'm not sleeping!" And Interacting with it again will make it say something else.
The rat king spawns in the rat king room which is lined with chests.
The rat king cannot be harmed by any means exept by using a scroll of wipe out.
In remixed pixel duenguoen the rat king can be killed easily
Answer: Use scroll of wipeout.
After that the chests you open in the secret room on Goo level should give you good items such as battle axe / halberd etc.

What's the deal with the rat king?


Exchange webmail internal dns

Question: How do I modify my internal dns-server, so that I can
use the same DNS address as I use externally?
Example; Exchange.domain.com should point to
192.168.X.X instead of external static ip.
Regards
Answer: Add that entry as an A record in your DNS server.
Assuming this is Windows, go into your DNS manager, and open your forward lookup zones. Add a New Host (A). Put in the servers FQDN as the name and it's LAN IP as the address.
Answer: There is already, of course, an exchange host a-record with the internal name "exchange" and points to its static ip 192.168.x.x.
Is it now unproblematic to add a-record exchange.domain.com to point to the same internal ip?
I mean, will any services/outlook clients start to act insane? :D

Exchange webmail internal dns


Why did Eisenhower iconize Robert E. Lee?

Question: I recently discovered this clip of General Eisenhower: Eisenhower Explains About General Lee (1957)
In it he claims "The 4 top Americans of history: Franklin, Washington, Lincoln and Lee"
I don't think anyone would claim General Eisenhower's respect for Lee was because of racism or confederate romanticism; given his strong stance against segregation, and his own ancestors fought for the Union. So what is there about Lee that Ike admired so much to place him in the same category as Lincoln?
Comment: Unless Eisenhower documented it that falls under "internal motivations" for Eisenhower.  I'd *guess* he probably admired Lee's military competence, without supporting what he fought for.  Thing is, as America confronts the legacy of slavery more head-on, notions about the "romantic aspects" of the Confederacy's resistance towards the North have taken a back seat to realizing the evil they were fighting for.  But that was not yet the case as recently as the first Dukes of Hazzard TV series.
Comment: Please don't use comments to debate the question matter. If you would like to answer, please post a real answer. If you would like to discuss, please use the chat function: this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/119109/discussion-on-question-by-bertrand-einstein-iv-why-did-eisenhower-iconize-robert).
Answer: There's an interesting political angle to be made here. Starting with their meeting in 1946, Eisenhower cultivated a relationship with Lee-biographer, journalist and Virginia politician
Douglas Southall Freeman, whose tomes on Lee (although winning a journalism award in the 1940s) were described by some later historians as rather hagiographical.
According to one PhD thesis on Freeman, which details the substantial extent of public and private support that Freeman poured into Elsenhower's bid for the presidency:

Freeman's public championing of Elsenhower was
important in swinging Virginia into the Republican column In
the election of 1952.

Eisenhower was one of the most politically adroit generals.
The extent to which his admiration for Lee was genuine
(probably so on military grounds) and convenient politically is
probably difficult to disentangle. It's also worth noting that the 1950s were the time when Lee made his iconic reappearance at West Point.
Freeman described Eisenhower's bid for presidency in a sort of analogous way with how he described Lee's answer to the Confederate cause--a great man reluctantly responding out of a sense of duty.
Having said this, Eisenhower was neither the first nor the last 20th century US president to say complimentary things about Lee. Eisenhower perhaps does stand out a bit with the extent of his professed or at least explained his admiration, in the second half of the century (although Woodrow Wilson surely exceeded it in the first half, himself having written a book on Lee). Eisenhower's letter to a dentist that is often brought-up on this matter pretty much describes Lee's participation in the Civil War along standard Lost Cause terms, namely that Lee was allegedly fighting for the idea of secession being a states right and it makes no mention of slavery.

General Robert E. Lee was, in my estimation, one of the supremely gifted men produced by our Nation. He believed unswervingly in the Constitutional validity of his cause which until 1865 was still an arguable question in America; he was a poised and inspiring leader, true to the high trust reposed in him by millions of his fellow citizens; he was thoughtful yet demanding of his officers and men, forbearing with captured enemies but ingenious, unrelenting and personally courageous in battle, and never disheartened by a reverse or obstacle. Through all his many trials, he remained selfless almost to a fault and unfailing in his faith in God. Taken altogether, he was noble as a leader and as a man, and unsullied as I read the pages of our history.
From deep conviction, I simply say this: a nation of men of Lee's calibre would be unconquerable in spirit and soul. Indeed, to the degree that present-day American youth will strive to emulate his rare qualities, including his devotion to this land as revealed in his painstaking efforts to help heal the Nation's wounds once the bitter struggle was over, we, in our own time of danger in a divided world, will be strengthened and our love of freedom sustained.
Such are the reasons that I proudly display the picture of this great American on my office wall.

Eisenhower's letter also praised Lee's post-war reconciliation efforts, but left out that Lee also called for a restoration of white rule in the South even after the war (although that fact can be found in Freeman's books.)
Comment: Re *hagiographical* I learned a new word.
Answer: Things are bit different nowadays, but until quite recently you could both be not racist and be into things Confederate at the same time (just stating a fact, not expressing an opinion about that). A comment already mentions the 70s/80s show "The Dukes of Hazzard". Although Bo and Luke drove around in a car called "The General Lee" with a prominently displayed Confederate flag on it's roof (see picture) it was a fairly uncontroversial show at it's time and shown on a major network. Also I do remember seeing an episode as a child where Bo and Luke rescued a black man from the KKK or a similar organization.
As for why Eisenhower professed such admiration for General Lee. I think as a former military commander himself he admired General Lee's supposed military genius (although there are historians who have a different opinion about this).
Answer: Dwight Eisenhower was a "country boy" raised in Abilene Kansas. As such, he was partial to "homespun" wisdom of the kind best displayed today by Warren Buffett. Eisenhower's four heroes had similar, practical views on life.
Ben Franklin was a "country boy" for his time (the 19th century), and publisher of Poor Richard's Almanac, whose aphorisms included "A penny saved is a penny earned," and "early to bed, early to rise, makes a man healthy, wealthy and wise."
George Washington was a product of rural Virginia, as was Robert E. Lee. Washington was what we would now call a "cloth coat" Republican, who said, "To be prepared for war is one of the better means of preserving peace." Eisenhower himself echoed, "In the final analysis, a soldier's pack is lighter than a prisoner's chains." Lee famously said, "It is a good thing that war is so terrible, otherwise we would grow too fond of it." Lincoln was a country lawyer, and one of his most best-known quotes is "you can fool all of the people some of the time, and you can fool some of the people all of the time, but you cannot fool all of the people all of the time."


Is TOEFL minimum score strict in UK?

Question: I recently gave TOEFL and got 99 with only 20 in writing. However the 6.5 equivalent of IELTS corresponds to minimum 23 in writing. Do I need to redo the test?
Comment: My experience is that students with minimum TOEFL scores tend to struggle a lot with their studies because of their lack of command of English.  The TOEFL is really a test to protect you from wasting time and tuition on going to a university where you can't learn because you don't understand the language of instruction well enough.  If your TOEFL score is marginal, I suggest you postpone going to university in the UK until you have improved your English, even if your TOEFL score meets the minimum requirements.
Comment: This will depend on what program you are applying to. If studying for a PhD there may be some flexibility depending on the supervisor and department for marginal cases. But even then it would be a risk if your English ability was not sufficient to produce a dissertation of acceptable quality and defend it in a viva. There probably isn't much flexibility for undergraduate/taught masters programs since a lack of English ability could be a major hinderance to successfully completing the program.
Answer: Depends on who is asking for it, and their regulations.
Ask them first. Some universities in the UK accepts only IELTS regardless of what else you have at hand. Others look at your overall experience, and ask for an IELTS only if they think your level may be not high enough.
Never heard of anyone asking for TOEFL in the UK, as it is an American test.

Is TOEFL minimum score strict in UK?


Do people modify open source code to hack?

Question: I am trying to create an authentication client and server for my project, and I am trying to think of ways on how a potential hacker could modify my code and use it to hack the servers. Do people actually do this often and if so, how do programmers try to get around it in open source projects?
Answer: You cannot trust input from the outside world, whether it's messages in your authentication scheme or data files.
Attackers can and will feed you invalid messages to trigger bugs or information leaks in your public-facing endpoints. They will also happily spoof credentials if your (assumedly homebrew) authentication scheme blindly trusts the foreign party.
There is no universal security or trust, all established mechanisms rely on establishing trust relationships up-front (pre-sharing keys) or by deferring to existing trust vendors (certificate authorities for TLS).
The only thing that differs between attackers leveraging your source and attackers reverse-engineering protocols and binaries is that it's slightly easier for them to get a grip on what your program does from decently written source code.
Answer: People do this sometimes, yes.  For example: http://m.slashdot.org/story/40281. One mitigation is to require cryptographic signing of commits from maintainers.  But you still have to trust your maintainers.
Comment: Sorry, I'm new here and not sure why this is getting downvoted.


Connect ALU to CPU in Logism Circuit Design and output to 7-segment Display?

Question: I've been playing around in Logisim to get some experience in designing basic electrical circuits. While I'm sure not the best, I was able to put together a functional ALU:
1-Bit:

This ALU is capable of the operations AND, OR, XOR, NOR, ADD/SUB.
[A] & [B] are separately 8-bit inputs.
The [Sub] input designates whether adding (0) or subtracting (1).
The [Operation Setter] designates what operation is being performed.
[R] is the result of the designated operation, with the [Zero Flag] alerting us
to a '0' output, such as when a number is subtracted from itself.

Using the 1-Bit ALU I pieced together an 8-bit ALU (this image directly below performing an ADD operation):

(SUB operation):

I'm now attempting to take my ALU and combine it with some form of CPU (for now mainly focusing on adding/subtraction & outputting to a few 7-segment displays). I've got a 7-segment Display put together (also have another for alhpa characters AbcdEfG):

I can't quite figure out a good way to take what I have for an ALU and place the output into my 7-Segment Display (ultimately I want to have the result display via 3 to display all possible 255 values from my 8-bit addition):
The following is what my circuit does for each different operation:
AND Operation - 1.1 = 1:

OR Operation - 1+0 = 1:

XOR Operation - 1 XOR 0 = 1:

NOR Operation - 1 NOR 0 = 6:

ADD/SUB Operationg - 1+1 = ERROR (Sub Flag is errored out for all OP's??):

I'm not quite sure:

Why my Sub Flag isn't selectable.
Why my Zero Flag errors out on an Add/Sub Operation.
How to fix my result from my ALU to properly go into and display in my 7-segment Display (currently outputting 8-bit into an 8-bit splitter and then placing the first 4 as my input for the 7-segment Display).

Does anyone have any input for how I can correct the issues in my design and make this work? Thanks in advance!
EDIT:
Sub flag issue fixed. Somehow when I brought the circuit over for use in my main one, it had the properties of being an Output, and being 3-state (which I don't believe I ever set). In any case, that minor issue is fixed.
Seems the Zero Flag was also set as 3-state for some reason.
Any advice on fixing the Add/Sub issue?
Answer: In the last few pictures, it looks like you've configured the "sub flag" as an output, not an input. Since there's nothing driving that net, it's resulting in an error.
Comment: I'm not sure how those properties got changed, but you're right! The sub flag in my main circuit was both set as an Output & as 3-state. Thanks! Any advice on the rest?


Sharing Apache Server with the Internet?

Question: I installed Apache with WAMP. I want to make my computer as a server for my web page for make some experiment on my web site.But I can`t open my server in Internet. I can see it in http://localhost/mysite/index.html but when I try to reach it in another computer like http://myserverip/mysite/index.html  it says server not responding. I am using wireless router and also forwarded to my LAN ip.
Answer: A few ideas:

check that apache is bound to your PC's internal IP rather than just localhost - run netstat -an and verify that you have local address 0.0.0.0:80 not 127.0.0.1:80
check that you're definitely forwarding port 80 from the router to your PC
check that you're not firewalling off the traffic, i.e. make sure there's an exception in the windows firewall for port 80 (and 443 if you're using HTTPS), or a program exception for httpd, or even try turning off the firewall temporarily whilst debugging this
find out if your ISP is blocking this - some won't let you run web servers from your home connection; you could try a different web port to see if that helps?
try connecting from some other machine - there could be some proxy configuration that's upsetting looping back into your PC
Comment: I have nod32. I closed internet filter and now it says that you have no permissionto access on this server .403 Forbidden. Is it about windows firewall?
Comment: I don't know nod32, sorry, but Windows firewall wouldn't generate that: instead it would just refuse the connection. A 403 error is probably being generated by Apache - maybe check the Apache logs to see?


Is Moon too hot?

Question: I find it puzzling that Moon's maximum "daily" equatorial temperature is almost 400K. Earth's theoretical black body temperature would be 279K at 1AU, and Moon is the same distance from Sun, yet its equatorial temperature is well over 100K hotter than Earth's. Thoughts on this?
Answer: How did you come up with the black body temperature of 279K? That's plain false. The solar radiation above the atmosphere is approx. $1.4kW/m^2$ and the black body temperature of that is around 400K, which is approx. right. Did you happen to use the AVERAGE thermodynamic temperature for a quickly rotating body at 1AU? That would be around the 279K, if I am not mistaken. Clearly that approximation doesn't apply to the max. temperature of the lunar soil.
Answer: I'm not familiar with the math, but am wondering if the 4 should be a 2 instead, (for hemisphere).
The Moon's day is about 13.5 of our days, so at its highest the lit side and dark side of the Moon can vary up to 500 degrees F, from about 250F on the lit side to about -250F on the dark side.
I would suggest that our atmosphere - which is literally mass itself - (though it is mostly invisible so a lot of people don't think of it as mass) - none the less it is mass - among other factors this mass acts as a thermal blanket to equalize the temperatures - thus causing things like hot/cold convection currents, winds and storms to occur which are not normally seen on the moon.  The moon does not have a similar atmosphere, though studies are now suggesting it does have certain atmospheric gasses - they are not the same type and do not have the same affects as our atmosphere on Earth.
Answer: Its very simple, there are no atmospheric layers, no air and the surface is not similar like earth. Complex carbonaceous matter present on the lunar surface is cool and have no ability to absorb heat. when hot sun rays directly strike to lunar surface it become warm according the intensity of sun rays and when there are no rays it cool down to its own original temperature.

Is Moon too hot?


Priority inversion

Question: I am having problem understanding Priority Inversion
Snippet from the article:

Consider there is a task L, with low
  priority. This task requires resource
  R. Consider that L is running and it
  acquires resource R. Now, there is
  another task H, with high priority.
  This task also requires resource R.
  Consider H starts after L has acquired
  resource R. Now H has to wait until L
  relinquishes resource R.
Everything works as expected up to
  this point, but problems arise when a
  new task M starts with medium priority
  during this time. ` Since R is still
  in use (by L), H cannot run. Since M
  is the highest priority unblocked
  task, it will be scheduled before L.
  Since L has been preempted by M, L
  cannot relinquish R. So M will run
  till it is finished, then L will run -
  at least up to a point where it can
  relinquish R - and then H will run.
  Thus, in above scenario, a task with
  medium priority ran before a task with
  high priority, effectively giving us a
  priority inversion.

The question is relevant to the second part of the article. Why is that a process with H (Higher) priority cannot pre-empt a process with L (lower) priority but a process with M (medium) priority can pre-empt? i.e. If H was put to block since R was in use, why was M not blocked as well ?
Comment: Not sure how or why ..but it is not...
Comment: This smells like homework.  Still, a good question.
Answer: Because M does not require resource R, so it is able to run while L still has it in use; H, on the other hand, cannot run until L is able to release R.

Priority inversion


Properness of moduli space

Question: Here is a question about construction of moduli space of Higgs bundles or Hitchin pairs. Let's say we are constructing the moduli space of stable Hitchin pairs or Higgs bundles (doesn't matter at this point), E-->E\otimes K over a smooth curve, a surface, etc with the condition that E is a stable sheaf. Is this construction done somewhere? In particular I am concerned about the properness of this moduli space (the stable E's cut an open subscheme inside their projective Quot scheme). So before even discussing the Higgs stability, we are dealing with an open scheme of E's. Is there a proof somewhere which uses valuative criteria etc, to prove the properness of this particular moduli space?---It would be great if someone else already did this (?). Thank you.
Comment: What if $(E, E\to E\otimes K)$ is stable as a Higgs bundle but $E$ alone is unstable?
Comment: What I meant is that it might (and in fact does, if I remember correctly) happen that a family $(E_t, psi_t:E_t\to E_t\otimes K)$ of (Higgs-)stable Higgs bundles has $E_t$ stable for $t\neq 0$ while $E_0$ is not stable. This seems to imply that the moduli space your question is about is non-proper.
Comment: Well that is ok, and such moduli spaces have been constructed before. in normal situation; we first construct the Quot scheme of E's, then there is a scheme that parameterizes the morphisms E-->E\otimes K , then we cut the Higgs-stable locus inside that latter scheme and mod out by Auto's (of the pair). Simpson I believe constructed these moduli spaces of HiItchin pairs, as moduli space of some modules over a dg algebra (he calls them \Lambda modules ? ) but I dont think he required the E's to be stable in the first place, and that is what my main question is about.
Answer: Even if we restrict to Higgs bundles where $E$ is stable as a vector bundle, the moduli space is not proper. If you take $(E,\sigma)$ with $\sigma \neq 0$, then $$\lim_{t \to \infty} (E,t\sigma)$$ does not exist.
Another way to see this is that there are nonconstant functions on the moduli space of Higgs bundles (think of the Hitchin fibration), which would be impossible if the moduli space were proper.
One way to think about this failure of this properness is that the moduli space of stable Higgs bundles is isomorphic to a moduli space of stable torsion sheaves on the total space of the cotangent bundle of your base $X$. The moduli space is not proper, since the total space isn't proper, but there's a fairly natural compactification coming from taking torsion sheaves on the projective completion of the total space of the cotangent bundle. We can think of this as allowing the spectral varieties of the Higgs bundles to go to infinity.
Comment: The torus fixed locus is going to correspond to the locus where the map $E \to E \otimes K_X$ is the zero map. I would expect that this doesn't have to be proper in general, but I haven't thought hard about it.
Comment: Thanks, so in the case of torsion sheaves on total space of the canonical of X, there is a torus acting on the moduli space---so here stable torsion shaves are in 1-1 correspondence with stable pairs downstairs, which is induced by the action of the torus which scales the fibers of K, and torus fixed locus of the moduli space is proper, as long as the base X is projective. I wonder if we restrict to stable sheaves E in this situation, whether we could argue that torus-fixed locus of the moduli space of E-->E\otimes K_X (where E is stable ) is proper (?).

Properness of moduli space


No representative tag found and no reputation to create tags

Question: I was writing a question for which none of the currently created tags would be representative and I had no reputation enough to create a new tag.  What would be the correct way to proceed in such a situation?
Answer: There are three ways to get a tag added to the site:

The easiest way is to suggest an edit, i.e. click the edit or improve this question button (so named on some sites) below the question. It would be peer reviewed and approved if it's good. A positive side effect is, that you would get +2 reputation for an accepted edit suggestion, which brings you nearer to the right to create tags and edit questions and answers.
The other acceptable way would be to flag the post for moderator attention. This works for any suggestion or problem with a question or an answer, so also for tagging suggestions. Don't hesitate with flagging, better point to something than leaving it unsolved. Moderators are there for it. If you would be unsure if a tag would be a good choice or not, or regarding a similar general question, the meta site is a good place for discussing it together.
Another possible way would be to comment to your own question, mentioning this, so somebody could add the tag for you. But this would require to remove the comment afterwards. Using the suggested edit feature is a better mechanism. I mentioned that way because we don't have our own moderators yet, but I'm sure the SE moderators would jump in. So better let's go back to point 2.
Comment: Just to clarify, all of these involving saving it with no tags, or if that's not allowed, some placeholder tag and then asking for assistance?
Comment: @DaveNoonan Yes, choose the tag which is the best match. I know that mods will gladly take care of fixing it once they were notified. The small reputation score barrier gives moderators and community a chance to assist and support very new users.
Comment: @Stefan: Option 1 doesn't work. You can't suggest *new* tags (tags which don't exist within the system) via Suggested Edits.
Comment: @Matt Interesting! Should be a feature, I think, because it would be checked for approval.
Comment: @Stefan: Was thinking the same thing myself; a [feature-request](http://meta.stackexchange.com/questions/tagged/feature-request) on Meta Stack Overflow would be the next step. If you beat me to posting one, you'll have my up vote ;).
Comment: @Matt your finding, go ahead :-)


Why does UK not have a scheme for researchers from third countries?

Question: If UK and Ireland are both members of the EU, why does UK not have a scheme for researchers from third countries (http://eur-lex.europa.eu/legal-content/EN/TXT/?uri=URISERV:i23023), while Ireland does (http://www.inis.gov.ie/en/INIS/Pages/Researchers)? How can third-country researchers in the UK encourage the UK government to introduce such a scheme?
Answer: The UK (and Denmark) did not opt-in to this directive.
The UK, Ireland and Denmark have the right, under Treaty, to opt out of certain directives. Ireland chose to opt-in to this directive. The UK and Denmark chose not to. You can lobby your government to put diplomatic pressure on the UK. I would not expect any foreseeable government to change this.
There exist alternative schemes for third party researchers: Academic Visas and Tier 5 admission, for which see the travel stack exchange.


Who would doubt it?

Question: How does one render in French expressions such as "Who would doubt it?", "Who would think so?" More specifically, is it more appropriate to use the conditional tense (Qui douterait ça ?"), or the imperfect (Qui doutait ça ?), or perhaps there is an equivalent French expression?
Answer: The conditional is what I would use:

Qui douterait de ça ?
Qui en douterait ?
Qui pourrait en douter ?
Qui penserait ça ?
Qui le penserait ?
Qui pourrait penser ça ?
Comment: @PapaPoule *Qui en penserait ?* doesn't work indeed but *qui en penserait autrement ?* while rare is possible. *Qui penserait à ça ?* is possible, but the meaning is slightly different ("think about it" vs "think so"). *Qui en croirait ?*  doesn't work alone, but is possible in, for example, *qui en croirait un seul mot ?*, otherwise that's *qui y croirait ?*. *Qui s'en douterait ?* is possible but the meaning is the opposite: *Qui en douterait ?* means everyone is expected to believe it while *Qui s'en douterait ?* means everyone is expected not to guess it.
Comment: Yes, *qui y penserait ?* is fine for *penser à qqch/qqn*. TLFi: *Je pensai à Anne. J'y pensai d'une telle manière que je m'assis sur mon lit, le cœur battant (Sagan, Bonjour tristesse, 1954, p. 76).*
Comment: I'm glad to see that "Qui en douterait?" is idiomatic and on your list because I really like to use "en" and that's what first came to my non-native mind to use with "douterait."  I was even tempted to think that "en" might work with "penserait," but your bolding of "**de**" at the top of the list reminded me that "penser" takes a direct object.  To satisfy my desire to use/overuse "en" whenever I can get away with it, could "en" be used with "croirait" or even "**se** douterait" to approximate the notion of "Who would think so/that"?:ie, "Qui en croirait?/Qui s'en douterait?"?
Comment: Thank you! The point about the preposition is also a revealing one. Although now I am confused about *penser à qqch/qqn*: could it also be: *Qui y penserait?*
Answer: Qui aurait des doutes là-dessus ?
Qui mettrait ça en doute ?
Chez qui ça éveillerait des doutes ?
Comment: I like your answer too. However it has less of the idiomatic sense that I was looking for. Thanks!

Who would doubt it?


Is Coulomb's law accurate for moving charges?

Question: Can we use Coulomb's law to calculate the force between two charges which are not at rest? If not, what formula should be used to calculate the force? I searched it, but I couldn't find a clear answer.
Comment: related: [/3618/can-maxwells-equations-be-derived-from-coulombs-law-and-special-relativity](http://physics.stackexchange.com/q/3618/)
Answer: Coulomb's law is not precisely true when charges are moving-the electrical forces depend also on the motions of the charges in a complicated way. One part of the force between moving charges we call the magnetic force. It is really one aspect of an electrical effect. That is why we call the subject "electromagnetism."
There is an important general principle that makes it possible to treat electromagnetic forces in a relatively simple way. We find, from experiment, that the force that acts on a particular charge-no matter how many charges there are or how they are moving-depends only on the position of that particular charge, on the velocity of the charge, and on the amount of the charge. We can write the force $\mathbf{F}$ on a charge $q$ moving with a velocity $\mathbf{v}$ as $$\mathbf{F}=q\left(\mathbf{E}+\mathbf{v}\times \mathbf{B}\right)\,.$$
We call $\mathbf{E}$ the electric field and $\mathbf{B}$ the magnetic field at the location of the charge.1

Credits: 1Feynman lectures on Physics-II.
Comment: You can search for the PDF version of Feynman's lectures on Physics. You will get good answers for your question in depth.
Comment: In the frame where the source charge is stationary, there is no $B$ field, so shouldn't Coulomb's Law be ok?  If the source charge is moving, then I can see that there will be a magnetic field, plus one needs to account for the finite speed of the transmission of the field (speed of light).  In small systems, which means almost everything that we see on a day to day basis, the retardation can be ignored.
Comment: After reflection ... my comment above only applies if there exists an inertial frame in which the source is at rest.  If not the answer becomes complicated.  The source will radiate, and we have near-field and far-field ... so the short answer to the OP is "it depends".
Comment: So the magnetic field that would be generated by a moving charge with ,for example, 2 m/s velocity is negligible. Right?
Answer: Suppose in some reference frame S, we have two stationary charged particles, $q_1$ and $q_2$. The force experienced by the first particle due to the second is given by
$$\textbf{F}_{12} = k \frac{q_1 q_2}{r^2_{12}} \hat{r}_{12}\,,$$
where $k$ is Coulomb's constant, $q_i$ is the charge of the respective particle, $r_{12}$ is the distance between the two particles, and $\hat{r}_{12}$ is the unit radial vector point from particle 2 to particle 1.
As is commonly done in most electromagnetism textbooks, it then makes sense to introduce the electric field vector, defined as the "force per unit charge." In the same frame S, the stationary particle (at position $\textbf{r} = \textbf{0}$) with charge $q$ creates the electric field
$$\textbf{E}(\textbf{r}) = k \frac{q}{r^2} \hat{r} \, ,$$
where $r = ||\textbf{r}||$ and $\hat{r} = \frac{\textbf{r}}{||\textbf{r}||}$.
With a bit of magic (just kidding, all math), it is possible to show that this statement is equivalent to Gauss's law:
$$\oint_\Sigma \textbf{E} \cdot d\textbf{A} = \frac{Q_{\text{enc}}}{\epsilon_0} \, .$$
It is understood that the field is integrated over a closed surface $\Sigma$ and that $Q_{\text{enc}}$ is the amount of charge located within said surface.
As it turns out, the first so-called "definition" of the electric field is only true for the frame(s) where the particle is stationary. For other frames, it is necessary to apply the standard transformations of special relativity. The most convenient approach is to recognize that charge is an invariant quantity (i.e., it does not change under a Lorentz transform). This implies that Gauss's law is true for all reference frames. The only quantities that transform are the electric field and the surface of integration:
$$\oint_{\Sigma'} \textbf{E}' \cdot d\textbf{A} = \oint_\Sigma \textbf{E} \cdot d\textbf{A}\,.$$
Thanks again to special relativity, we can show that a moving particle must generate a magnetic field in some frames of reference. The final expressions for the general electric and magnetic fields for a frame of reference where the particle is moving with an arbitrary velocity and acceleration are complicated, but nevertheless can be calculated.
Applying these fields along with the Lorentz force law,
$$\textbf{F} = q(\textbf{E} + \textbf{v} \times \textbf{B})\,,$$
we can find the trajectories of both particles. However, these trajectories are quite complicated, and need to be simulated on a computer.
TL;DR - No, in a sense Coulomb's law cannot be applied to the motion of two interacting charged particles.
Answer: As many people have already said in their answer, if you ask yourself what is the force between any two charged particles which have some velocities at some time in the frame of reference of the lab, then what you find is the Lorentz force: $\mathbf{F} = q(\mathbf{E} + \mathbf{v} \times \mathbf{B})$.
Now, the problem is when you try to resolve the dynamics of such a system because it turns out that the Lorentz force is not reciprocal that is to say, it doesn't satisfy Newton's third law ($\mathbf{F}_{12} \neq - \mathbf{F}_{21}$).
This is very well explained here (with animations and all).
This was already figured out by Poincare and it puzzled him for a while until he realized that the reason for this violation was because we were not accounting for variations of the momentum-energy tensor of the electromagnetic field itself.
Hence, if you want to solve for real this dynamical problem, this is a very complex one where the electromagnetic field needs to be resolved at the same time as the positions and momenta of your two particles.
Now, it turns out that if you are only interested in statistical properties of an (classical) assembly of charges (at thermodynamic equilibrium), then one can show that it is sufficient to consider only the Coulomb interaction between charges; so in a way, depending on what you want to do, yes Coulomb can be enough otherwise it becomes very complicated.
Answer: Lorentz's force is acting on the charge $$F = q(E+v\times B)$$
If the charge is moving in an uniform electric field $E$, there will be no $B$ and the force is $F = qE$. In the case of a non-uniform electric field (e.g. a point charge), the electric field at the charge will change in time and thus, by the Ampere's law, a $B$ will be induced. But usually (in non-relativistic cases) the induced $B$ will be negligible.
Comment: Risking a display of ignorance:  Is it not true that in the case of a stationary point charge, there is no magnetic field, period.  So Coulomb's Law is valid in that frame.  In the frame that moves with the test particle, there is a magnetic field, so Coulomb's Law needs help.  So isn't the answer the same as the the Benchley's reply to Dorothy Parker's quip about girls and glasses: "It depends on the frame."


Using Libertine math fonts with Vollkorn text font

Question: I'm making a Beamer presentation and would like to use the very elegant Vollkorn fonts. Vollkorn doesn't have good math support, so I'd like to find a not-incongruous replacement. The Libertine font family have similar serif weights, and are hypothetically available for math using \usepackage[libertine]{newtxmath}, but I just can't quite get it to work. Another constraint that will become relevant is that I'd like to render white-on-black text on some slides.
I'll be partially following this answer which suggests \usepackage{unicode-math} and replacing mathbf with symbf, so I've replaced \symbf with a dummy command when demonstrating \usepackage[libertine]{newtxmath} for comparison.
I'm also using \usepackage{textgreek} so I can substitude text-rendering of some Greek characters to achieve desired styles.
I'll be compiling with pdfTeX 3.141592653-2.6-1.40.22, which has ok unicode source handling by default. I'll be comparing these to the output of XeTeX 3.141592653-2.6-0.999993. I installed this using the TexLive package on Ubuntu, version 2021.20220204-1.
Options when using pdflatex
newtxmath + default fonts
With pdflatex, using only \usepackage[libertine]{newtxmath} without \usepackage{libertine} pulls in OT1 fonts, which aren't pretty. The command mathbf is broken. Also, the serif weights here won't work with white-on-black text for any font weight. Notice that no glyphs are missing (pdflatex finds an OT1 substitution when needed)
\usepackage{textgreek}
\usepackage[libertine]{newtxmath}

newtxmath + libertine fonts
With pdflatex and both \usepackage{libertine} and \usepackage[libertine]{newtxmath}, we get a range beautiful styles, which are congruous with the body text and similar between Latin and Greek. I think the only difference here is that its using the Libertine main-text font to substitute missing glyphs, rather than OT1. Still, the serif weights won't work here for white-on-black, and I'd love to have some Vollkorn to spice things up.
\usepackage{textgreek}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}

Options when using xetex
Xetex with newtxmath
Using default fonts
The first thing we notice when switching to xetex, using \usepackage[libertine]{newtxmath} with the default fonts is that several glyps are missing. Now, it is \boldsymbol that is broken rather than \mathbf. Pixel-wise, it's not too different from pdflatex.
\usepackage{textgreek}
\usepackage[libertine]{newtxmath}

Using libertine fonts
In xetex, \usepackage{libertine} with \usepackage[libertine]{newtxmath} is slightly broken. It substitutes computer modern fonts in some places and is overall inferior to the output from pdflatex.
\usepackage{textgreek}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}

 fonts
Xetex with \usepackage{unicode-math}
Note: \usepackage{unicode-math} isn't compatible with \usepackage[libertine]{newtxmath}.
With the default fonts (not shown), \usepackage{unicode-math} is not nice. Glyphs are missing and font substitutions look out of place. Compared to \usepackage[libertine]{newtxmath}, the command \boldsymbol breaks.
\usepackage{textgreek}
\usepackage{unicode-math}

Adding \usepackage{libertine} (below) gives some improvements, but still has missing glyphs. Compared to pfdlatex with newtxmath, the command \boldsymbol is broken. You may also notice that the weight of the descender on the text μ is slightly lighter. In my opinion the rendering by pdflatex+newtxmath is more compatible with the style of the Latin text characters.
\usepackage{textgreek}
\usepackage{libertine}
\usepackage{unicode-math}

Adding the Vollkorn font
As far as I know, the Vollkorn font requires these two magic lines
\usepackage[]{fontspec}
\setmainfont[BoldFont=Vollkorn Bold, BoldItalicFont=Vollkorn Medium Italic, Numbers={Proportional,Uppercase}]{Vollkorn}

The packate fontspec doesn't work with pdflatex, so we'll be stuck with xetex or luatex here.
As you can see below, \usepackage{unicode-math} is really bad with Vollkorn. This is unsurprising, because Vollkorn has no math support.
\usepackage{textgreek}
\usepackage{unicode-math}
\usepackage[]{fontspec}
\setmainfont[BoldFont=Vollkorn Bold, BoldItalicFont=Vollkorn Medium Italic, Numbers={Proportional,Uppercase}]{Vollkorn}

Removing unicode-math and adding \usepackage{libertine} and \usepackage[libertine]{newtxmath} doesn't quite work either: It's substituting OT1 fonts sometimes, which look wrong.
\usepackage{textgreek}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
\usepackage[]{fontspec}
\setmainfont[BoldFont=Vollkorn Bold, BoldItalicFont=Vollkorn Medium Italic, Numbers={Proportional,Uppercase}]{Vollkorn}

So, this is all quite frustrating.

Vollkorn fonts are really nice, but fontspec restricts us to xetex/luatex
Vollkorn doesn't support math, so we need another option. the OT and CM fonts are not congruous. The unicode-math package is often suggested, but doesn't really work.
Libtertine math has similar serif weighs and \usepackage{libertine} with \usepackage[libertine]{newtxmath} works beautifully in pdflatex. But, this doesn't play nice in xetex once we add Vollkorn.

I'm assuming one option would be to do some very specific tweaking of the math styles, using various commands about which I know not. If you haven't guessed by now, there is another solution I found while writing this question, which I will post as an answer.
Answer: The final permutation, which I arrived on after exhaustive search, is to use fontspec to pull in the Vollkorn font, then use \usepackage[libertine]{newtxmath} without importing \usepackage{libertine}.
\usepackage{textgreek}
\usepackage[libertine]{newtxmath}
\usepackage[]{fontspec}
\setmainfont[BoldFont=Vollkorn Bold, BoldItalicFont=Vollkorn Medium Italic, Numbers={Proportional,Uppercase}]{Vollkorn}

Of course, this still leaves much to be desired:

\mathbf and \operatorname don't work on Greek.

With \usepackage{libertine}, it was possible to match styles by inserting text glyphs.
Now, the Vollkorn font is used. Bold does not look good, but standard medium-weight Vollkorn might stand in for bold Libertine in a pinch.

The Libertine font works really well in \text mode for styling math, Vollkorn not so much. I'm really missing the bold μ.

I'm sure there's some way to make xetex default to Libertine text and not Vollkorn text within math environments, without breaking the \mathbf and \operatorname commands, but what is it?
Comment: I suppose you could look at that question, which's my take on a somewhat similar problem:
https://tex.stackexchange.com/questions/690151/is-this-a-valid-fontspec-solution-for-using-arbitrary-fonts-in-math-text


What does "list comprehension" and similar mean? How does it work and how can I use it?

Question: I have the following code:
[x ** 2 for x in range(10)]

When I run it in the Python shell, it returns:
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]

I've searched and it seems this is called a list comprehension and similarly there seem to be set/dict comprehensions and generator expressions. But how does it work?
Comment: NOTE For duplicate closers: for questions specifically asking *how to write* a list comprehension, also consider https://stackoverflow.com/questions/25082410 for mapping, and https://stackoverflow.com/questions/4587915 for filtering
Comment: See also https://stackoverflow.com/questions/18072759 for questions about (explicitly) nested list comprehensions and about list comprehensions with multiple clauses.
Comment: Sure there must be a canonical question from 2008(?),
Comment: Related: *[What is the advantage of a list comprehension over a for loop?](https://stackoverflow.com/questions/16341775/)*, *[List comprehension vs map](https://stackoverflow.com/questions/1247486/)*, *[Create a dictionary with comprehension](https://stackoverflow.com/questions/1747817/)*, *[Why is list comprehension called so in Python?](https://stackoverflow.com/questions/1903980/)*, and *[Understanding the syntax of list comprehensions](https://stackoverflow.com/questions/68408065/)*
Answer: From the documentation:

List comprehensions provide a concise way to create lists. Common applications are to make new lists where each element is the result of some operations applied to each member of another sequence or iterable, or to create a subsequence of those elements that satisfy a certain condition.

About your question, the list comprehension does the same thing as the following "plain" Python code:
>>> l = []
>>> for x in range(10):
...     l.append(x**2)
>>> l
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]

How do you write it in one line? Hmm...we can...probably...use map() with lambda:
>>> list(map(lambda x: x**2, range(10)))
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]

But isn't it clearer and simpler to just use a list comprehension?
>>> [x**2 for x in range(10)]
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]

Basically, we can do anything with x. Not only x**2. For example, run a method of x:
>>> [x.strip() for x in ('foo\n', 'bar\n', 'baz\n')]
['foo', 'bar', 'baz']

Or use x as another function's argument:
>>> [int(x) for x in ('1', '2', '3')]
[1, 2, 3]

We can also, for example, use x as the key of a dict object. Let's see:
>>> d = {'foo': '10', 'bar': '20', 'baz': '30'}
>>> [d[x] for x in ['foo', 'baz']]
['10', '30']

How about a combination?
>>> d = {'foo': '10', 'bar': '20', 'baz': '30'}
>>> [int(d[x].rstrip('0')) for x in ['foo', 'baz']]
[1, 3]

And so on.

You can also use if or if...else in a list comprehension. For example, you only want odd numbers in range(10). You can do:
>>> l = []
>>> for x in range(10):
...     if x%2:
...         l.append(x)
>>> l
[1, 3, 5, 7, 9]

Ah that's too complex. What about the following version?
>>> [x for x in range(10) if x%2]
[1, 3, 5, 7, 9]

To use an if...else ternary expression, you need put the if ... else ... after x, not after range(10):
>>> [i if i%2 != 0 else None for i in range(10)]
[None, 1, None, 3, None, 5, None, 7, None, 9]

Have you heard about nested list comprehension? You can put two or more fors in one list comprehension. For example:
>>> [i for x in [[1, 2, 3], [4, 5, 6]] for i in x]
[1, 2, 3, 4, 5, 6]

>>> [j for x in [[[1, 2], [3]], [[4, 5], [6]]] for i in x for j in i]
[1, 2, 3, 4, 5, 6]

Let's talk about the first part, for x in [[1, 2, 3], [4, 5, 6]] which gives [1, 2, 3] and [4, 5, 6]. Then, for i in x gives 1, 2, 3 and 4, 5, 6.
Warning: You always need put for x in [[1, 2, 3], [4, 5, 6]] before for i in x:
>>> [j for j in x for x in [[1, 2, 3], [4, 5, 6]]]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'x' is not defined

We also have set comprehensions, dict comprehensions, and generator expressions.
set comprehensions and list comprehensions are basically the same, but the former returns a set instead of a list:
>>> {x for x in [1, 1, 2, 3, 3, 1]}
{1, 2, 3}

It's the same as:
>>> set([i for i in [1, 1, 2, 3, 3, 1]])
{1, 2, 3}

A dict comprehension looks like a set comprehension, but it uses {key: value for key, value in ...} or {i: i for i in ...} instead of  {i for i in ...}.
For example:
>>> {i: i**2 for i in range(5)}
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16}

And it equals:
>>> d = {}
>>> for i in range(5):
...     d[i] = i**2
>>> d
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16}

Does (i for i in range(5)) give a tuple? No!, it's a generator expression. Which returns a generator:
>>> (i for i in range(5))
<generator object <genexpr> at 0x7f52703fbca8>

It's the same as:
>>> def gen():
...     for i in range(5):
...         yield i
>>> gen()
<generator object gen at 0x7f5270380db0>

And you can use it as a generator:
>>> gen = (i for i in range(5))
>>> next(gen)
0
>>> next(gen)
1
>>> list(gen)
[2, 3, 4]
>>> next(gen)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
StopIteration

Note: If you use a list comprehension inside a function, you don't need the [] if that function could loop over a generator. For example, sum():
>>> sum(i**2 for i in range(5))
30

Related (about generators): Understanding Generators in Python.
Comment: @AChampion: Yeah, I mentioned that in my answer because I tried `[i for i in x if i else y]` when I was learning list comprehensions and it doesn't work. After some research I understand that I must use `[i if i else y for i in x]` instead. So I think if I mention it here then others can avoid the issue which I had before.
Comment: The ternary expression `x if cond else y` really doesn't have anything specifically to do with list comprehensions - any valid expression can be used inside a list compression - the ternary expression is one of many python expressions.
Answer: There are list, dictionary, and set comprehensions, but no tuple comprehensions (though do explore "generator expressions").
They address the problem that traditional loops in Python are statements (don't return anything) not expressions which return a value.
They are not the solution to every problem and can be rewritten as traditional loops. They become awkward when state needs to be maintained & updated between iterations.
They typically consist of:
[<output expr> <loop expr <input expr>> <optional predicate expr>]

but can be twisted in lots of interesting and bizarre ways.
They can be analogous to the traditional map() and filter() operations which still exist in Python and continue to be used.
When done well, they have a high satisfaction quotient.
Comment: This made my day: `When done well, they have a high satisfaction quotient.`
Answer: If you prefer a more visual way of figuring out what's going on then maybe this will help:
# for the example in the question...

y = []
for x in range(10):
    y += [x**2]

# is equivalent to...

y = [x**2 for x in range(10)]

# for a slightly more complex example, it is useful
# to visualize  where the various x's end up...

a = [1,2,3,4]
b = [3,4,5,6]
c = []

for x in a:
          if x in b:
                  c += [x]
#   \         \        /
#    \    _____\______/
#     \  /      \
#      \/        \
#      /\         \
#     /  \         \
#    /    \         \
c = [x for x in a if x in b]

print(c)

...produces the output [3, 4]
Answer: I've seen a lot of confusion lately (on other SO questions and from coworkers) about how list comprehensions work. A wee bit of math education can help with why the syntax is like this, and what list comprehensions really mean.
The syntax
It's best to think of list comprehensions as predicates over a set/collection, like we would in mathematics by using set builder notation. The notation actually feels pretty natural to me, because I hold an undergrad degree in Mathematics. But forget about me, Guido van Rossum (inventor of Python) holds a masters in Mathematics and has a math background.
Set builder notation crash course
Here's the (very basics) of how set builder notation works:

So, this set builder notation represents the set of numbers that are strictly positive (i.e. [1,2,3,4,...]).
Points of confusion
1) The predicate filter in set builder notation only specifies which items we want to keep, and list comprehension predicates do the same thing. You don't have to include special logic for omitting items, they are omitted unless included by the predicate. The empty predicate (i.e. no conditional at the end) includes all items in the given collection.
2) The predicate filter in set builder notation goes at the end, and similarly in list comprehensions. (some) Beginners think something like [x < 5 for x in range(10)] will give them the list [0,1,2,3,4], when in fact it outputs [True, True, True, True, True, False, False, False, False, False]. We get the output [True, True, True, True, True, False, False, False, False, False] because we asked Python to evaluate x < 5 for all items in range(10). No predicate implies that we get everything from the set (just like in set builder notation).
If you keep set builder notation in the back of your mind while using list comprehensions, they're a bit easier to swallow.
HTH!
Answer: Introduction

A list comprehension is a high level, declarative way to create a list in Python. The main benefits of comprehensions are readability and maintainability. A lot of people find them very readable, and even developers who have never seen them before can usually guess correctly what it means.

# Snippet 1
squares = [n ** 2 for n in range(5)]

# Snippet 2
squares = []
for n in range(5):
    squares.append(n ** 2)

Both snippets of code will produce squares to be equal to [0, 1, 4, 9, 16].
Notice that in the first snippet, what you type is declaring what kind of list you want, while the second is specifying how to create it. This is why a comprehension is a high-level and declarative.
Syntax
[EXPRESSION for VARIABLE in SEQUENCE]

EXPRESSION is any Python expression, but it is typical to have some variable in it. This variable is stated in VARIABLE field. SEQUENCE defines the source of values the variable enumerates through.
Considering Snippet 1, [n ** 2 for n in range(5)]:

EXPRESSION is n ** 2
VARIABLE is n
SEQUENCE is range(5)

Notice that if you check the type of squares you will get that the list comprehension is just a regular list:
>>> type(squares)
<class 'list'>

More about EXPRESSION
The expression can be anything that reduces to a value:

Arithmetic expressions such as n ** 2 + 3 * n + 1
A function call like f(n) using n as variable
A slice operation like s[::-1]
Method calls bar.foo()
...

Some examples:
>>> [2 * x + 3 for x in range(5)]
[3, 5, 7, 9, 11]
>>> [abs(num) for num in range(-5, 5)]
[5, 4, 3, 2, 1, 0, 1, 2, 3, 4]
>>> animals = ['dog', 'cat', 'lion', 'tiger']
>>> [animal.upper() for animal in animals]
['DOG', 'CAT', 'LION', 'TIGER']

Filtering:
The order of elements in the final list is determined by the order of SEQUENCE. However, you can filter out elements adding an if clause:
[EXPRESSION for VARIABLE in SEQUENCE if CONDITION]

CONDITION is an expression that evaluates to True or False. Technically, the condition doesn't have to depend upon VARIABLE, but it typically uses it.
Examples:
>>> [n ** 2 for n in range(5) if n % 2 == 0]
[0, 4, 16]
>>> animals = ['dog', 'cat', 'lion', 'tiger']
>>> [animal for animal in animals if len(animal) == 3]
['dog', 'cat']

Also, remember that Python allows you to write other kinds of comprehensions other than lists:

dictionary comprehensions
set comprehensions
Answer: For those looking for a nested inline operator:
[(i,j) for i in range(8) for j in range(8)]

Which is equivalent to itertools.product:
from itertools import product

list(product(range(8), range(8)))

For additional context, this is equivalent to the following nested loops:
results = []
for i in range(8):
    for j in range(8):
        coord = (i, j)
        results.append(coord)


Relationship between Mars and Earth rotation

Question: Is it by pure random chance that Mars and the Earth have nearly the same day duration (Mars day is barely 40 minutes longer, which is just 3% difference), or there is some causal relationship between the two?
Answer: The length of the day on Earth has been changing ever since it was formed due to the influence of the Moon, so the current near equality is an accident of timing. Go back or foward a few billion years and the day lengths would be more different.
Comment: is there some way to know the duration of  Mars a few billion years ago?
Comment: A good question and one that I deliberately avoided! :-) As far as I know there are no observations to tell how the length of the day on Mars has changed. However the main reason the day length changes on Earth is the tidal force from the Moon and the moons of Mars are too small to raise any significant tides. Tidal forces from the Sun will have some effect, but these are a lot lower on Mars, partly because they vary as $r^{-3}$ and partly because Mars has no oceans and much less energy is dissipated in tidal movements on land. So ...
Comment: ... although we don't know if the day length has changed on Mars it seems likely any change will be much less than the change on Earth.


How to set a gamemode radius with command blocks?

Question: I've been trying to figure out how to change a player's gamemode from adventure to survival when walking out a certain radius. The map size I'm using is 2956x2956 & I wanna be sure to cover all of it. I tried using /gamemode creative @a [r=10] with a repeat block just to test out what'll happen. But no matter how far I am from the block it keeps setting my gamemode to creative. Can someone show me how to properly write what I'm trying to do for minecraft 1.12.2? Screenshots would be much appreciated.  (also how can I stop the commands from blowing up my chat lol?)
Answer: If your command is actually as you wrote, your mistake is that there is no space between "@a" and "[r=10]". Here it is:
/gamemode creative @a[r=10]

And well, if you need it for 2956x2956 radius, simply change [r=10] to [r=2956] (Maybe 2956 won't be enough as the raidus is circular and not a square form. Test it out and see how big does it need to be).
Also, to disable the command feeback in chat, simply type in you chat:
/gamerule commandBlockOutput false

This will disable any and every feedback that otherwise the command would send to your chat.
Comment: Ok, you were right about the spacing lol. But how do I connect another command block to switch back to survival when outside the radius. And is there no way for me to change the circular radius to a more cubic shape?
Comment: No, you cannot change it to a cubic chape. To set the out of bounds radius to survivale, do `/gamemode survival @a[rm=2956]` , in which `rm` stands for Minimun radius. So anyone beyond the radius of 2956 will have their gamemode changed. You can also set up a maximum with `[rm=x,r=y]` so the game doesn't have to check trough the whole world, but that means if they teleport outside that range, they will not have their gamemode changed.


How to write/draw over the figure with site specific locations in Latex

Question: I wish to show some comment/text bubble on my picture in latex presentation. Kindly help me to write/comment on a included figure in latex.
Comment: [Welcome to TeX.sx!](http://meta.tex.stackexchange.com/questions/1436/welcome-to-tex-sx) This question is very similar to http://tex.stackexchange.com/q/9559/86. Please take a look at it as the answers there might help you. If they do, that's great, and we'll probably close this question as a duplicate just to keep the place tidy and to help people find the answers quickly. If they don't, please edit your question here to explain why so that people can better focus their attention to help you.
Comment: Yes, the question is similar. The answer here is more simpler than answer there based on my requirement. What to do?
Comment: Given that the answer you got *isn't* at that other question and is quite different to those at that, and that it is sufficient for what you want, then do nothing more than you have done: accepting the answer.  It hadn't appeared when I wrote my comment, so you can ignore (most of) what I said.
Answer: Use the picture environment described in section 5.2 of the Not So Short Introduction to LaTeX. Use a \put command to position your figure, and another \put command to position the comment.
\documentclass{article}
\begin{document}
\begin{picture}(200,200)
\put(0,0){\framebox{\phantom{\rule{200pt}{200pt}}}} %Dummy box in place of an image.
\put(150,50){\hbox{Over here}}
\end{picture}
\end{document}


How do I copy the URL under the cursor?

Question: In Vim, I can use gx in normal mode to open the URL under the cursor. Instead of opening the URL, how can I copy the URL?
I am looking for something faster than entering into visual mode, selecting the URL, and yanking the selected URL.
Answer: You should be able to use the same mechanism that can capture file paths, <cfile>:
<cfile>    is replaced with the path name under the cursor (like what |gf| uses)

This special keyword can be resolved to its associated value on the command line using the function expand(). For example, to put the URL in a register:
:let @0 = expand('<cfile>')

If you want to put the URL in the clipboard use "* or "+ register (depending on your system and its configuration).
Add it to a mapping...
:nnoremap <leader>u :let @* = expand('<cfile>')<CR>

...and with a couple key presses you can now paste the URL wherever you need it.

Update: A couple Q&As excerpted from the comments that may be useful to others...
Q: When I press p in normal mode to paste the URL, why is nothing pasted?
A: The type of environment (OS, window manager, GUI vs terminal) you're in usually dictates which register is tied to the system clipboard. If paste/put is working for you otherwise look at the register being used there and use the same in the mapping. If you're using *nix the "quote-plus" register (@+) may be what you need. (ed- It was.) For more details on clipboard use :h 'clipboard' is a good place in Vim help to start.
Q: How can I prevent the mapped command from appearing in the status bar? :nnoremap <leader>u :silent let@* ... doesn't work.
A: Instead of using :silent add <silent> after nnoremap.
:nnoremap <silent> <leader>u :let @* = expand('<cfile>')<CR>

<silent> is simply used to prevent a mapped command from being displayed when the mapped keys are entered. If the mapped command also has output that you don't want to see you'll need :silent in addition to <silent>.
Comment: Is there a way to make this silent? I tried `nnoremap u :silent let @* = expand('')` in my vimrc, but it doesn't seem to make the keybinding silent.
Comment: I tried your solution, but when I press `p` in normal mode to paste the URL, nothing is pasted.
Comment: Okay. Thank you. It works now. I was actually looking for one solution for pasting into Vim and another for pasting outside it. I should have mentioned that in my question. Anyway, `nnoremap  u :let @+ = expand('')` works perfectly for pasting outside Vim. For pasting inside Vim, I replaced the `@+` with `@"`. I am using terminal Vim on Ubuntu.

How do I copy the URL under the cursor?


what prevents a manifold to be symplectic?

Question: Are there any obstructions known which prevent an even dimensional orientable manifold from
being symplectic? I am a novice in this area so I unfortunately I cannot make the question more precise. What I have in mind is raw and is as follows:from the point of handle body theory you can put a symplectic structure on each handle as you are building the manifold, so there must something go wrong on the boundary of the handle which is a three manifold, for example in the case of spheres of dimension >2.  I just want to know if there is something related to this question in the literature.
Comment: Maybe this book will help you make precise your question:

http://www.mathematik.uni-muenchen.de/~kai/research/stein.pdf
Comment: For 4-manifolds, to be symplectic you are required to have $1-b^1(X)+b^2_+(X)=\frac{1}{2}(\chi(X)+\sigma(X))\equiv 0$ mod 2.
Answer: For a closed manifold of arbitrary dimension, there are two algebraic conditions which must be satisfied. Firstly as Russell states there must be a reduction of the structure group from $GL(2n)$ to $Sp(2n)$, or equivalently from $SO(2n)$ to $U(n)$. This is also necessary for open symplectic manifolds, and is equivalent to the existence of an almost complex structure.
Secondly, for a closed manifold, there must be a homology class $[\omega] \in H^2_{dR}$ so that the $n$-fold wedge product of $[\omega]$ generates $H^{2n}_{dR}$. This only holds for closed manifolds since there are exact symplectic structures on open manifolds.
For 4-manifolds there are further known obstruction due to Taubes, which tell us that the Gromov invariant must be equal to the Seiberg-Witten invariant, in particular the Seiberg-Witten invariant must be non-zero. This shows that the connected sum of three copies of $\mathbb{CP}^2$ admits no symplectic form, even though it satisfies the previous two conditions. As far as I know this is the only known geometric obstruction. For higher dimensional manifolds, it's my understanding that it's an open question whether the two algebraic conditions suffice.
Comment: I should also add that in the case of open manifolds, the reduction of the structure group to $Sp(2n)$ is a necessary and sufficient condition for the existence of a symplectic structure. Furthermore, we can prescribe the homology class $[\omega]$ freely. This result is due to Gromov. However this only works if we don't specify any boundary conditions at infinity. If we require boundary conditions such as symplectic convexity, the question is far more subtle and interesting.
Comment: "As far as I know this is the only known geometric obstruction": A little pedantically, there are further obstructions in 4 dimensions, beyond the Taubes constraints w.r.t. $[\omega]$ and the a.c. structure: namely, the Taubes constraints on a finite covering space w.r.t to the pullback data!
Comment: (This should have come first, but anyway: welcome to MO!)
Answer: Well, already the $4$-sphere, which is even dimensional and orientable, does not carry a symplectic structure.  It does not even support a $2$-form that is nowhere degenerate, much less a closed $2$-form that is everywhere nondegenerate.
There are now many known obstructions for compact orientable $4$-manifolds to be symplectic, but the easiest is that there must be an element of the de Rham cohomology group $H^2_{dR}$ whose square in $H^4_{dR}$ is nonzero.
Comment: @kaavek:  Generally, you can't perform surgeries preserving the symplectic structure or matching the symplectic structure across boundaries.  Asking 'what goes wrong?' is not really the right question.  What you should be asking is 'under what conditions can you hope to make symplectic surgery work?', since that is going to be the exception rather than the rule.
Comment: I am asking if there is known anything from the point of handle body theory, I want to know what does not fit as you are building a,say four manifold, by handle bodies.
Comment: for example for your example S^4, there is a symplectic form on both copies of D^4, then you attach them by the identity map of their boundaries, but the result is not symplectic, I want to know what goes wrong in this process in general.
Comment: Look at the Mayer-Vietoris sequence when you glue. If the pieces you glue together already have symplectic forms, then Mayer-Vietoris says you might have a problem getting the 2-forms glued together, because the overlap might not have a symplectic form, for cohomological reasons. That puts a general theory behind the $S^4$ example, although of course it is only a necessary condition.
Answer: Robert's comment is spot on.  Describing symplectic manifolds constructively via handle attachment is particularly tricky because you're dealing with a geometric structure.  Typically if you figure out a new way to build symplectic manifolds via surgery, it's worth writing a paper about.  The most basic ways to build symplectic manifolds via cut and paste are Weinstein surgery and Gompf's fiber sum.
Based on your comments, it sounds like you're interested in thinking about this problem using obstruction theory -- which is designed to address "what goes wrong?"-style questions.  For a $2n$-manifold $M$ obstruction theory allows you to figure out if can reduce the structure group of $TM$ from $GL(2n)$ to $Symp(2n)$ which will of course be satisfied if $M$ is symplectic.  This approach has the advantage that it turns these types of problems into algebraic ones; deciding whether certain cohomology classes are trivial in the style of Chris Gerig's comment.  The classical approach to describing these cohomology classes is to describe them as obstructions to extending a structure (non-vanishing section of some bundle if set up appropriately) over a handle in your manifold:  Try carrying out this structure reduction on a neighborhood of the 1-skeleton of $M$.  You won't run into trouble, so long as $M$ is orientable.  In other words, orientability (which is the same as the vanishing of the first Steifel-Whitney class) is your first obstruction.
The disadvantage however is that obstruction theory only deals with homotopical -- not geometric! -- structures.  For example, $S^{1}\times S^{3}\simeq(\mathbb{C}^{2}\setminus \{0\})/(x\sim 2x)$ is a complex manifold, so it's structure group reduces to $U(2)\subset Symp(4)$.  However, it can't be symplectic as it's $H^{2}_{dR}$ is zero.