Biology Discrete Population model

Question: I'm stuck on a particular part of a long question, so I will post the entire question and tell you guys where I'm stuck.
Q: The size of a locust population in each year is given in terms of the population in the previous year, according to the relation
$x_{t+1}=F(x_t)$, $F(x)=r(1-x^2)$, $r>0$.
where $t$ is the time measured in years, and $x_t$ is a dimensionless measure of puplation size.
(a) Sketch the graph of $F(x)$, ane hence (or otherwise) find ranges for the value of the initial population size for all $t>0$.
(b) Obtain the steady states of the model by finding the roots of a suitable monic quadratic $Q(x)$. Use linear stability analysis to describe the first bifurcation that occurs at a positive value $r=r_1$, which you should find.
(c) Write down the equation for period two solutions, and show that it can be rewritten in terms of $Q=Q(x)$ as $$r\left( (x-rQ)^2 -1 \right) +x=0.$$ Explain why the roots of $Q$ satisfy this equation, and hence show that for $r>r_1$ the solution with minimal period 2 alternates between the values $x_+$ and $x_-$, where $$x_{\pm}=\frac{1}{2r} \pm \sqrt{1-\frac{3}{4r^2}}.$$
(d) Give the condition for a pitchfork bifurcation in the doubled map, and apply it to find the value of $r_2>r_1$ such that the period two solution becomes unstable at $r=r_2$. Given that the next period doubling bifurcation happens at $r=r_3\approx 1.1696576163$, calculate an approximation to Feigenbaum's constant to 3 decimal places.
A:
(a) Realistic population ranges for $x_0$ and $r$ I believe are $0 \leq x_0 \leq 1$ and $0<r\leq 1$.
(b) I found the steady states by solving $F(x)=x$ and then the I also got that $$Q(x)=x^2+\frac{x}{r}-1.$$ Te first bifurcation also occurs at $r=r_1=\frac{\sqrt{3}}{2}$.
(c) I showed that $Q(x)=\frac{1}{r}(x-F(x))$ in order to show what they wanted, then also noted that the roots to $Q(x)$ satisfy $F(x)=x$, and solutions of that equation satisfy $F(F(x))=x$. So take a root of $Q(x)$, then we get $F(x^*)=x^*$, so $F(F(x^*))=F(x^*)=x^*$.
Edit: I just figured it out. It being in this form helps greatly because we can write $$r( (x-rQ)^2-1)+x=r(x^2-2xrQ+r^2Q^2-1)+x.$$ Then from here we get that $$r(x^2-2xrq+r^2Q^2-1)+x=rx^2-2xr^2Q+r^3Q^2-r+x.$$ Now we are almost there, we can then do $$rx^2-2xr^2Q+r^3Q^2-r+x=Q(r^3Q-2xr^2)+rQ.$$ So upon dividing by $Q$, as we want to eliminate the two steady state roots, we get the equation $$r^3Q-2r^2x+r=0.$$ Plug $Q$ back into that and simplify, you'll get a quadratic with the roots they wanted me to derive.
Answer: With your definition of $Q(x)$, the solutions of $x=F(F(x))$ solve
$$
x=r(1-r^2(1-x^2)^2)=r(1-(rQ(x)-x)^2),
$$
or, equivalently,
$$
(rQ(x)-x)^2=1-\frac{x}r=x^2-Q(x),
$$
or, expanding the LHS,
$$
Q(x)\cdot(r^2Q(x)-2rx+1)=0.
$$
The solutions of period $2$ solve $r^2Q(x)-2rx+1=0$. Expanding $Q(x)$, this is
$$
r^2x^2-rx+1-r^2=0,
$$
hence the formulas for $x\pm$ when $r^2\geqslant3/4$. This solves (c).

Biology Discrete Population model


Does upgrading fishing rods affect what visitors can catch?

Question: In the Holohouse mode, sometimes visiting members will catch fish for me. If I upgrade my fishing rod at Bloop's Fish Shop or equip a different rod, does that affect what types of fish the visiting members can catch?
Answer: Yes. The equipped rod affects which fish visiting members can catch.
I equipped the Beginner's Rod then waited at the House. The next 10 members that went fishing only caught Tuna, Shrimp, or Clownfish. When I equipped the Golden Rod they caught Manta Rays, Lobsters, Tuna, Squid, Pufferfish, Eels, and Koi Fish.


Stuffing meat cannelloni and refrigerating to be cooked the next day

Question: Is it safe to make uncooked beef cannelloni with cheese and eggs, stuff the raw shells and leave in fridge overnight?  I would put the hot tomatoe sauce over top just before baking.
Answer: Is the meat cooked or not ? it's not clear.
I would prepare the stuffing, cook it all and cool it down and stuff the cannelloni and put that in the fridge.
Personally, I would bake it all, sauce included the day before and cool it down and put that in the fridge. (I treat that the same as a lasagna).
Answer: It is fine to assemble the dish ahead of time, as long as it is cooked thoroughly when you finish it.
The hazard would be making sure it is done, since it will start from cold, but if you check (beef is easy to visually tell if it is cooked) and see the meat has turned brown and there are no bloody juices in the pan, then you will be fine.
Remember, too, many people order rare or medium rare hamburgers and steaks. If the meat is fresh, and the assembled dish is refrigerated, there is nothing to worry about.
Comment: Everything went well for our cannelloni dish. I stuffed them the day before and refrigerated them overnight and the next day poured the sauce in the pans and baked as usual. They were just like I made them fresh that afternoon. Thanks for all the comments.
Answer: It's safest to cook everything except the pasta. Assemble the dish, cool, cover and refrigerate overnight. Make sure you bring the dish up to room temp prior to baking. It should take ~30 minutes to prevent having your dish burst from thermal/temperature shock.  Note: The pasta will absorb moisture overnight and the finished dish will be "al dente".


Dynamics CRM 2011 - Outlook vs Browser client

Question: MS Dynamics CRM 2011 can be accessed via browser or via the outlook client.
Are there any differences in functionality between the two? e.g. are there features that only occur in the Outlook client, or only in the browser client?
Answer: This is a  link where the differences are explained.

Depending on how you look at it, this may be a reason to use CRM for Outlook or it may be a reason to use the Web Client.  CRM for Outlook leverages some great Outlook functionality (like categorizing, flagging for follow-up or conditionally formatting your CRM lists).  On the other hand, individuals that use this functionality tend to be Outlook power users.    In addition, these settings do not update any CRM data (so, for example, if a user categorized a contact using Outlook categories, this information will not be stored in CRM, making it useful only to the single user who set the category).  Plus, if you'll click the image, you'll notice that CRM for Outlook tends to make a lot of text look blurry (only joking, that's just text that we were hiding in the image).  The Web Client, on the other hand, has some excellent functionality that is not available in CRM for Outlook.
Many users keep Outlook open to their inbox and want to actively monitor their email throughout the day – they think of Outlook as mostly an email tool (and to a lesser extent a calendar and contact management tool).  When users are forced to access CRM within Outlook, they must then constantly toggle between the various modules of CRM and their Outlook inbox.  This can be somewhat mitigated by just opening the CRM for Outlook area in a separate window – but few users seem to remember to take this action.  Many users like the idea of have two applications that they can "ALT+TAB" between rather than having to constantly use the mouse to navigate between different parts of Outlook to do their jobs.
Most business leaders assume that, because CRM can work with Outlook, it will be easier to learn.  While this may be true for "Outlook Power Users", it is not necessarily the case with everyday users.  When you decide to train users on CRM for Outlook, it creates a need to explain how CRM integrates with Outlook in some detail.  Users will need to grasp how CRM integrates with existing Outlook items (i.e. email, contacts, appointments) and how CRM also has it's own items (i.e. leads, accounts, opportunities) that are also available within the Outlook interface.  What seems to create more confusion is that users now have two places to go, inside of Outlook, for what should appear to be the same information (i.e. CRM has contacts and Outlook has contacts; CRM has appointments and Outlook has appointments).  Because CRM and Outlook have different sets of records to track the same information this can be confusing for new users.  By starting with the Web Client, users can be eased into basic CRM concepts without having to learn the details of how data is synchronized between the applications.
Answer: You can have two different windows in Outlook, one with your email inbox, and one with the CRM.
In Outlook, just right-click on the name of your CRM, and click "open in new window".
The same works for contacts, appointments, etc...


Convert elevation

Question: I have a big trouble with a DTM. I have original DTM with SR WGS84/32633.
Now I want merge at it a new DTM create from LiDAR data, but this (new DTM) have elevation that is 40/42 meters high that original DTM.
I think that I must convert the elevation in correct geoid, but I don't know how do.
Comment: It sounds like your LiDAR is ellipsoidal heights. Consider contacting the agency that you procured the data from and ask for your height datum; LiDAR editing software should have a module for converting ELL to a nominated height datum. If this is not an option then you must procure the ellipsoidal to your height datum transformation but implementing that depends greatly on your available software. Or you can find a local company that captures LiDAR and request that they do it for you, for a small fee. Unless you're editing LAS files *a lot* it's very expensive to buy the required software.
Comment: Ok thank for answer. I used SAGA GIS to create DTM from Lidar. Now try to ask in SAGA GIS forum for help me.
Comment: What is your target SRID?
Answer: There is a utility that converts ellipsoidal height to geoidal height called GeoidEval which uses EGM2008/96/84. Online version is available and you can also download and use it on your pc. For more information, check out GeoidEval.

Convert elevation


MIcrosoft Wireless 3050 Mouse not working on Ubuntu 19.10

Question: Having a wireless 3050 microsoft mouse and keyboard I am trying to get it working but it seems that when I plug the USB, Ubuntu doesn't detect it at all. Is that even possible to get that product work with 19.10? I never tried a microsoft product before on Ubuntu so I don't know even if that's possible.
Answer: You will probably want to look in /var/log/kern.log for any error messages. Even better, I have found that tailing all logs will help resolve many issues:
<code>sudo tail -fn0 /var/log/{*,*/*}
</code>
If you find that there are no error messages when you plug in the mini-tranceiver, it might not be an issue with the keyboard at all. Some possible causes for this issue could be:

BIOS settings - check that USB hasn't been disabled.
faulty tranceiver
faulty usb port


Arma 2 CD Key Problems

Question: So, my Arma 2 Operation Arrowhead of steam is banned (battleye/cd key ban).
If I buy Arma 2 Arrowhead and Dayz on the humble bundle then add it onto steam, will it reset my cd key to the one I just bought or just keep my default?
Answer: Steam will not issue a new key if you purchase it or redeem it on the same account. When this happened with me (I was stupid and got my key stolen), I ended up buying it through Amazon instead. Redeeming it through a new Steam account should work though, since the CD Key is per-account.
Answer: Arma 2 and Arma 2: OA are very insecure games if you ask me. I, myself, had my CD key stolen just buy playing on a "hacked" DayZ server. To answer your question directly, no you can not add two of the same games on the same account. However, you can make a new account and add your CD key to that account. This may be more beneficial to you as some server owners will ban players by their Steam ID.
As a side note, if you had your CD key stolen or you think you were banned unjustly, you can contact Bohemia Interactive's support e-mail and let them know what happened. If you provide them with all the needed information then you will receive a new CD key for both games. Be aware, when you email them to tell them your situation, they will email you back asking for your IP address, username, and a few other things that you will need. Hope you can get your issue fixed.
P.S. Sorry for not putting any links. I am currently on my school campus and they have Bohemia Interactive's website blocked. I'm sure that you'll be able to find them though.

Arma 2 CD Key Problems


In FTP, what are the differences between passive and extended passive modes?

Question: Can anyone simply explain the differences between Passive mode FTP (PASV) and Extended Passive mode FTP (EPSV)?
Comment: @DavidPostill Sorry, I was really only interested in PASV vs EPSV.
Answer: The only difference is that PORT/PASV are limited to IPv4, while EPRT/EPSV work with any network protocol (although only IPv6 is used in practice).
The standard PORT (active) and PASV (passive) commands in the FTP control protocol exchange address & port information as six 1-byte decimals, from which the other end has to reconstruct a four-byte IP address and two-byte TCP port number.
PORT <address[4]>,<port[2]>

PORT 132,235,1,2,24,131

But then other protocols started appearing. IPv4 was about to be replaced with "IPng", which had quite a few competing replacement proposals (OSI CLNP, TUBA, SIP, SIPP, CATNIP – at various times in history), some with shorter, longer, even variable host address sizes, until IPv6 with 16 byte addresses finally got defined.
Just sending more bytes wouldn't have worked – servers and clients couldn't be expected to know the right protocol based purely on the address length. (For example, what if you have one protocol with 16 byte address + 4 byte port, another with 12 byte address + 12 byte port?)
Besides – even though this was less important 20 years ago – these days there are millions of NAT devices on the Internet, which inspect and mangle FTP control connections so that the "outside" host would only see global IPv4 addresses even if the "inside" host sent a RFC1918 local one. Even without NAT, stateful firewalls often watch the control commands to automatically allow a data connection without manual rules.
This basically means that simply sending more numbers with PORT or PASV is guaranteed to break for many people. Perhaps some firewalls would quietly misinterpret some address bytes as the port and quietly discard the rest; others might drop the connection, or just crash.
To avoid various problems like the above, new commands had to be introduced for multi-protocol support in FTP.
In 1993, RFC 1639 (originally RFC 1545) introduced the "long address" LPRT and LPSV commands, which were like PORT & PASV but with a variable address length; they included the protocol type identifier as well. (It didn't change the syntax though – IPv6 address:port would simply be sent as 21 numbers rather than six.)
LPRT <protocol>,<addr-length>,<address...>,<port-length>,<port...>

LPRT 4,4,132,235,1,2,2,24,131

LPRT 6,16,16,128,0,0,0,0,0,0,0,8,8,0,32,12,65,122,2,20,162

However, that still didn't fix some of the problems, such as asking a server to use a different protocol than for the control connection. The RFC also quickly became out of date as well; when IPv6 came out just a year later, it couldn't be used with LPRT because there was no LPRT protocol identifier assigned for it (only for the various early proposals).
To fix this, RFC 2428 in 1998 added EPRT and EPSV, aka "extended port" and "extended passive", which also had a method for negotiating a protocol that both ends support. The "extended" commands also send addresses in human-readable form – for IPv6, that means using hex & colon notation, rather than a series of separate decimal numbers.
EPRT x<protocol>x<address>x<port>x

EPRT |1|18.104.22.168|6275|

EPRT |2|1080::8:800:200C:417A|5282|

In conclusion, IPv6 support is the only difference.
Comment: Another difference is that the `EPSV` response does not include the IP address (what `PASV` response does). This is to avoid common problem when the FTP server located behind a NAT does not know it's external IP address and confuses the FTP client by sending it its internal address.
Comment: Wow, all the sites I read and it didn't click until this one. Thank you for that. I'll accept it (probably) in an hour or two, want to see if anyone else does it different. Also, the reason I asked for Active as well was that due to the tagging working well with google, this question/answer will be found in searches. If no one adds to the answer (making it more totally complete for a google answer) I'll edit my original question and body to reflect the contents of your answer, essentially fitting my question to your answer.
Comment: To add to what @MartinPrikryl says, another reason is when using FTP-over-TLS, the firewall/NAT can't intercept the IP address in the PASV command to rewrite it (at least without MITMing the control connection.) While in the Unix world people generally use SFTP instead of FTP-over-TLS, FTP-over-TLS is commonly used with IBM mainframes, since FTP has support for record-oriented files (STRU R, MODE B), while SFTP only supports stream-oriented files
Answer: Difference between active and passive is already answered. Extented passive (EPSV) is just passive with IPv4 and IPv6, because the syntax of the response to PASV was specific to IPv4 and and thus a new command was needed for IPv6. Same with EPTR vs. PORT in active mode.
There is a slightly different behavior with EPRT and EPSV in that they can only contain the port,not IP and port like PORT and PASV do. Thus data transfer can only be done between the systems which have the control connection. With PORT and PASV it is possible to create a data connection between other systems (although this is today considered bad design and a security risk).
Comment: This was the kind of answer I didn't want. It tells me exactly as much as I could find elsewhere, which is that EPSV was created for IPv6, but not **explaining** why. (i.e. I don't accept your reason as a good enough explanation) I'm telling you this in the hope you'll maybe make your answer even better.
Comment: Edited response to make it clear, that the response to the PASV command to not support IPv6 and thus a new command was needed.


How to make a rigid body pass through only certain other rigid bodies?

Question: I have a human model made of separate objects. Body, thighs, legs, feet, toes, etc. I got the body to collide with the toes and not pass through each other. However, I want the thigh and leg capsules to be placed so their ends overlap, and are able to rotate, as if they can pass through each other. But they must not pass through say the toes when they collide. I thought about Groups but no progress. The human will be able to feel around its body, so, setting limits won't stop it from "puncturing" itself with its finger at any area. Therefore a all-can-pass-each-other solution won't work. The calves behind the knees would, if both can pass each other like want, would actually need set limit rotations, but that works there.
Answer: Rigid bodies collisions do not allow the kind of control you describe so, instead, a different approach is required.
First model the system using non-overlapping rigid bodies - create the rigid bodies and enable collision and use Rigid Body Constraints to set up the relationships between them.

The constraints can be easily created using the 'Connect' button in the Physics tab of the 3d view Tool Shelf (T). However, for each connection you need to uncheck the Disable Collisions property in the Rigid Body Constraints panel so that the collisions remain active.

To add the overlapping elements, create new objects and size and position them as desired and parent each one to the relevant rigid body (select the new object, hold Shift and select the associated rigid body, then press Ctrl+P and select 'Object') - they will now follow the motion of the associated rigid body.
Since the overlapping elements are no longer rigid bodies they do not affect the collision (and so can overlap) while the (non-overlapping) rigid bodies can handle the physics. You can 'hide' the rigid body 'skeleton' by moving it to another layer if desired - or simply set it not to render (click the camera icon against each object in the Outliner).

To take this a step further you could parent bones to the rigid bodies and have those deform a mesh that would act as a 'skin' to the rigid body skeleton. This is more complicated but would produce much more convincing joint motion for 'organic' characters.
Comment: When you say the line "you'd need each element to not collide with its immediate neighbors but to collide with every other object", are you saying a solution in this very line? If so, it doesn't explain how to do it.
Comment: @FriendlyPerson44 Sorry for the confusion - I was just trying to describe what you would need to be able to do to directly achieve what you describe. Unfortunately, the rigid body system doesn't provide any mechanism to provide such complicated collision rules. I believe the solution to this would be to have rigid bodies that *don't* overlap to act as the collision bodies and for that to then be 'skinned' with the actual overlapping elements. I didn't explain it very well. I'll provide a more detailed illustrated answer later.
Comment: @FriendlyPerson44 I've updated the answer - I hope this makes more sense now.
Comment: In my model, I already have a skin linked to bones linked to empties linking to rigid bodies with a gap. My concern, however, was the human baby can poke its finger through the gaps, if it chooses to do so.
Comment: @FriendlyPerson44 That wasn't clear to me from the question - you mentioned overlapping rigid bodies. Either close the gaps to smaller than the width of a finger or you could try adding 'shielding' passive rigid bodies set to 'animated', parented to the joints and in a different collision group - with the fingers also in that collision group. This way (since they're passive and set to 'Animated') they won't actively take part in the simulation but will still collide with the fingers, preventing access to those gaps.
Comment: Um......now I have discovered collision layers. Is this what we are looking for ! ? Both BGE and Cycles modes have them!
Answer: In both BGE and Cycles, Rigid Body Joints (BGE) or Rigid Body Constraints (Cycles) have a option called "linked collision" that allows them to pass through each other.
If you make ball joints to go around problems in your project though, like fixing joints being loose or rising/dropping/repeat, then you won't have this option because you won't be using "joints" with such option...


GlassFish 3.1 Netbeanz 7 and REST web services

Question:
I tried to run example here http://download.oracle.com/javaee/6/tutorial/doc/gipzz.html  and didnt work...  There is a bug at netbeans site but i couldnt understand what they are talking about.
It seems that wadl file isnt created....
However a workaround for this was to use the servlet       com.sun.jersey.spi.container.servlet.ServletContainer
and seems to work...
Does anyone knows whats wrong ??
Answer: The RESTful stuff in NetBeans and Glassfish definitely works, I use it on a daily basis.
Try following this NetBeans tutorial and see if you get anywhere. I've always found the tutorials on the NetBeans site too be very helpful, and easy to follow.
Answer: Just to answer..
The problem was that i did the mistake to use the glassfish version that came with Netbeans.  This doesnt work . Installing glassfish seperately did work greatly.


does the temperature of ambient air affect the power consumption of an incandescent light bulb

Question: With its filament held within a vacuum, does the temperature of ambient air surrounding the bulb affect the power consumption of an incandescent light bulb.
Comment: "Most modern bulbs are filled with an inert gas to reduce evaporation of the filament and prevent its oxidation. The gas is at a pressure of about 70 kPa (0.7 atm)" - https://en.wikipedia.org/wiki/Incandescent_light_bulb#Gas_fill
Answer: Since the temperature of the filament in an incandescent light bulb is so much higher than any reasonable ambient temperature, its power consumption would not be affected to any significant degree.
Answer: Yes. The filament is thermally joined to metal supports that then connect to the metal connections outside the bulb. So, the temperature of the filament is affected by the ambient temperature of the surroundings. The resistance of the filament is highly temperature dependent, so changing its temperature changes its resistance, which changes its power consumption.
This effect will be so small that it would be extremely difficult to measure.
Comment: Heat transfer via the inert gas fill is MUCH more significant than any transfer via the filament supports.
Comment: Thermal radiation may have a slight effect also.
Comment: @DaveTweed Yes, I agree. I guess I was being sarcastic with the answer, since almost any question that includes "have any affect on" will almost certainly get an answer of "yes", just like almost any question that asks "is it possible". The OP stated that the filament was in a vacuum, which as you point out is not true.
Answer: Assuming supply voltage is fixed, the power consumption is only affected by the resistance. The resistance of the tungsten filament is somewhat dependent on the temperature (with a positive tempco), so a higher filament temperature will result in lower power consumption.
All heat loss to the environment is dependent on the temperature - conduction through the filament supports, convection and conduction if the envelope is filled with a gas (consumer large lamps typically are, smaller lamps often not), and radiation.
So if the ambient temperature (including all objects that influence the lamp) increases in temperature you can assume the power consumption will be decreased a bit, the lamp will emit more light (thus becoming more efficient), however the lamp life will be shortened. Also, the light will look "colder" (higher colour temperature).
As to the amount to expect, the temperature of the bulb is at several thousand degrees C (or K), so normal room temperature variations have little effect. However, under more extreme conditions there may well be a noticeable effect. Quoting Haier/General Electric Appliances:

A bulb that isn't rated for oven use will not last long in an oven! We
recommend using only genuine GE Appliances parts.
Comment: First person who said that higher ambient temperature will cause slightly lower power.


Studentized residual distribution

Question: I read that in a regression with $k$ regressors, the t-statistic corresponding to a certain coefficient follows a $t(n-k)$ distribution. However, later on I read that studentized residuals follow a $t(n-k-1)$ distribution. How could it be that the extra degree of freedom is lost: isn't this also just based on a regular t-statistic?
Comment: Do you mean externally studentized residuals? These are calculated by deleting one observation, which would explain a loss of 1 degree of freedom.
Comment: There is generally a lot of inconsistent notation about what "k" means in a regression model across books. Some take it to be the number of regressors, in which case the degrees of freedom is n-k-1. Some take k to be the number of regression coefficients (which is the number of regression coefficients + 1 for the intercept), so in that case the degrees of freedom would be n-k. But you have clearly specified that k is  the number of regressors, so the former is correct.
Comment: @ved Thanks for your reply. To be honest I'm not entirely sure what you mean with "externally" in this context. The studentized residual that I mean is the t-statistic for $\hat{\gamma}$ that can be obtained from the regression $y=X\beta + \gamma D_j$. Do you mean that the fact that there is a dummy in the regression somehow implies that the degree of freedom is lost?
Comment: No, that was not what I meant. By the way, it is a fact that for a multiple regression model with k regressors, the t-stats for individual coefficients have (n-k-1) degrees of freedom.
Comment: @ved That's exactly where my confusion comes from. My book states that in general t-statistics in a multiple regression model follow a $t(n-k)$ distribution. (So not $n-k-1$)
Comment: @ved Oddly enough the book that I use uses both without specifiying that the definition of $k$ changed. Therefore I thought that there might be something 'special' about the studentized residuals. But if that's not the case then I assume the book is simply not clear. Thanks for your effort and help :)
Comment: @ved - since you answered the question, you may as well rewrite your comment(s) as an answer and get credit for it!
Comment: The usual reason for this form of discrepancy is a differing definition of $k$ (specifically, whether the intercept is included in $k$ or not)
Answer: In my opinion there are two possible explanations here:

Externally studentized residuals are based on data with one observation deleted, this may account for the loss of the single degree of freedom.
There is inconsistency across books what $``k"$ actually refers to in a multiple regression model. If $k$ is the number of regressors, then the correct degrees of freedom is $n-k-1$. On the other hand, if $k$ is the number of regression coefficients (which is usually the number of regressors plus one, for the intercept), then the correct degrees of freedom is $n-k.$

Note: In general, the distribution of studentized residuals doesn't depend on whether there are dummy variables in the model or not. To be clear, let the regression model be $Y=X\beta +\epsilon$, where $X \in R^{n \times (k+1)}$, where $n$ is the number of observations and $k$ is the number of regressors. The design matrix $X$ may contain continuous variables, dummy variables and/or both. In this general framework, the internally Studentized residual is defined as
$$
r_i = \frac{e_i}{MSE(1-h_{ii})}
$$
where $e_i$ is the $i^{th}$ residual, $H=(h_{ij})=(X'X)^-X'Y$ is the so-called "hat" matrix. The internally Studentized residuals do not follow a $t$-distribution, because $e_i$ and $MSE$ are not independent.
The externally Studentized residual is defined as
$$
t_i = \frac{e_i}{MSE_{(i)}(1-h_{ii})}
$$
where $MSE_{(i)}$ is the mean-square error from the regression model fitted with the $i^{th}$ observation deleted. In this case, $e_i$ and $MSE_{(i)}$ are independent, and it can be shown that $t_i \sim t_{n-k-2}$, the loss of the extra one degree of freedom due to the deletion of observation $i$.
I hope this makes it clearer. So to understand the degrees of freedom in your case, you should consider the design matrix as a whole, and not break in into two parts - one with continuous predictors and one with dummy(s). Once you do that, figure out if the Studentized residuals in questions are externally or internally studentized. Then apply the above.
Comment: I have only one question for the answer above: Are the $e_i$ and $MSE_{(i)}$ independent in the $t_i$? If not, then how could we say that $t_i$ follows t distribution?
Comment: Sorry to say but I think I know the answer now and that this is actually incorrect. I think the answer is that because the t-statistic for the studentized residual is $\frac{e_j}{s_j\sqrt{1-h_j}}$, and because $s_j$ is computed in the regression with the dummy (and hence a zero residual for that observation), $s_j^2 \sim \frac{\chi^2(n-k-1)}{n-k-1}$, and hence the whole thing is $t(n-k-1)$ distributed.
Comment: I have made an edit, hopefully should be clearer now.
Comment: Yes that's what I meant. Apparently my definition of studentized residual was then the 'externally studentized residual' (my book doesn't mention the two cases). Thanks again for your help! (One small note: in the first to last paragraph I think $n-k-2$ should be $n-k-1$; although it depends again on how you define k ;) )

Studentized residual distribution


What is more stable, Na+ or Na?

Question: As per noble gas configuration $\ce{Na+}$ should be more stable than $\ce{Na}$. But at the same time $\ce{Na+}$ has a positive charge so it will be easily attracted by negative charge while $\ce{Na}$ will remain unaffected in presence of negative charge. So accordingly, should not $\ce{Na}$ more stable than $\ce{Na+}$? Please help me get out of this confusion.
Comment: You can't compare stability of these two things. It simply makes no sense.
Comment: If you mix NaCl with elemental sodium, nothing will happen. So they have the same stability???
Comment: In vacuum Na is certainly more stable than its ion *and* a free electron. This is crystal clear. But see also Ivan Neretin comment (you cannot compare different things, at least one should be aware of the differences) as well as the answer by Poutnik.
Comment: context is all. Under what conditions is the question asking about (if it doesn't specify them, it is a bad question).
Comment: Actually, if you put $\ce{NaCl}$ and metallic $\ce{Na}$ to two separate beakers full of water, which would catch fire?
Answer: Relative stability of both depends on environment.
In gaseous atomic phase $\ce{Na}$ is somewhat more stable than $\ce{Na+}$  and  $\ce{e-}$ pair due the needed ionization energy.
In water, Na  is very unstable, as a big  amount of energy is released by reaction of $\ce{e-}$ with water and by hydration of Na+. That leads to very fast up to explosive reaction.
Note that this explosion ( that can be accompanied by the hydrogen-oxygen explosion ) is primarily a physical Coulombic explosion due excessive positive charge of melted sodium.
Comment: Fast electrons leave sodium much faster than slow sodium ions, what charges sodium positively. Just before Coulombic explosion, sodium builds charged spikes of metallic sodium, pinching through isolation layer of water vapour and hydrogen and by sparks ignites the stuff at contact with air.. It was both simulated by quantum calculations and observed by high speed cameras. Search for recent Nature article.
Comment: To Poutnik: what causes melted sodium to get an excessive positive charge? Would an explosion occur in the absence of atmospheric oxygen?
Comment: Thanks! I remember now an article about NaK alloy, which is much more reactive.
Comment: @James Gaidis. Yes it is. But the main point in using it was it form an eutecticum with low melting point, so they could work with liquid Na-K alloy.
Comment: Many years ago, I did an experiment with what I considered a small piece of sodium (about 20 grams). I dropped it into a laundry tub (in our basement)  which contained about 2 inches of COLD water (because I had read that sodium would explode in hot water). I watched it fizz and zip around on the surface for about 15 seconds; then it suddenly melted and became globular. About 5 seconds later, it blew up, throwing little droplets of sodium all over, but they rapidly burned up. I suppose the spikes could cause sparks. Lithium reacts slower and does not seem to cause explosions.

What is more stable, Na+ or Na?


Is it safe to remove generic kernel image on EC2?

Question: I was tempted to remove the *-generic kernel image from my EC2 instance since it's not the one running, according to uname. What's running is the *-virtual one. Thing is I'm not sure if it's safe, me not being comfortable with how these EC2 things work.
Answer: Technically, it is safe to remove any non-running kernels, including the generic kernels (for EC2 nodes). EC2 is powered by Xen and running a virtual kernel (smaller footprint and trimmed for guest OS) helps to maximize performance to some extent.
I've installed and purged generic kernel images (also the headers) on EC2, no issues. Don't worry, it's not going to break things.
BTW: It is recommended to use Ksplice uptrack (free for Ubuntu and Fedora) to keep your running kernel up to date (it only supports release kernels from official repository though).
For example, the default kernel for a Ubuntu Server 12.04 is 3.2.0-23, ksplice can apply the security patches (auto or uptrack-upgrade -y) to the running kernel without rebooting, so the effective kernel running (uptrack-uname -a) is actually 3.2.0-53.
Answer: You should have something like this:
linux-header-x.x.x.x
linux-header-x.x.x.x-generic (possiably generic-pae or i686)
linux-image-x.x.x.x
If they are the same version I suggest you leave them but if they are different versions it is ok to leave just the ones you use now.
From what I know a generic kernel is used by any driver that needs headers or modules for
the current kernel knows how to find the appropriate data.
Hope I was clear enough.


How does a synchro resolver converter work?

Question: There are Synchro converters or transducers used on aircraft to measure angle of attack using 3 sinusoidal inputs. I could not understand where  these 3 inputs come from and what angle information is generated by the synchro converter on the basis of the input signals?
Answer: The angle of attack sensor turns the shaft on a synchro (or a resolver: they're essentially the same thing) which is a transformer whose outputs are uniquely related to that shaft angle. That's where your 3 inputs come from. There are lots of possibilities for what happens next. The shaft angle is not the same as the angle of attack. The synchro is not measuring. It's just conveying measurement information from the sensor to the flight crew and other aircraft systems.


Can I improve handwriting recognition in OneNote?

Question: When I convert a handwritten passage from ink to text I get decent, but not 100% correct recognition. With speech recognition you can teach the software to understand your voice better, is there a similar method for handwriting? Specifically in OneNote 2010/2013.
Comment: You could always used different OCR software.  Outside of that I don't believe so.
Answer: There is a training that improves handwriting recognition overall in Windows.
There are 50 sentences and you have to train for each language used. However, you can save and transfer these "training files" :
Transfer handwriting personalization to another Tablet PC
Yoga member at Surface Forums explains how to find it in Windows 8+ by going to "the handwriting "training". It's in "control panel"/"Time, Language,Region"/"Add Language"/. Edit the Options of the installed language."
Comment: This is only a little better than a "just a link" answer. If you could copy/paste the instructions on how to get into the handwriting recognition training program, this answer would be much better.
Comment: I'll try to do that later today, though my system is in pt-br and windows 8.1. So, I don't know if it will help too much.
Answer: Go to the control Panel Language options sections. Use the personalize handwriting training tool. Complete the 50 sentences. Works fantastic after that.


RelatedTo in plugin based search

Question: $criteria = craft()->elements->getCriteria(ElementType::Entry);
$criteria->section = 'stories';
$criteria->search = $this->query;
$criteria->order = $this->orderSql();
$criteria->limit = 1000;
$criteria->visibility = $this->checkVisibility();
$criteria->thisIsAGuide = ':empty:';

I need help adding a relatedTo criteria to help pull related entries.
The current search scope is searching on entries ("Story").
The entry("Story") contains an entry ("channel").
That channel has a category("brandCategories")
I need to return stories that contain entries that have a matching brandCategory.
That brandCategory is getting pulled from a GET var of "&brands%5B%5D={{categoryId}}
Answer: You can create 2 queries, first you pull all the channel entries, that are related to your bandCategory
$criteria = craft()->elements->getCriteria(ElementType::Entry);
$criteria->relatedTo = $bandCategory;
$criteria->section = 'channel';
$relatedChannelEntries = $criteria->ids();

// then continue your code
$criteria = craft()->elements->getCriteria(ElementType::Entry);
$criteria->section = 'stories';
$criteria->search = $this->query;
$criteria->order = $this->orderSql();
$criteria->limit = 1000;
$criteria->visibility = $this->checkVisibility();
$criteria->thisIsAGuide = ':empty:';
// and search only for entries that are related to channel entries that are related to your band
$criteria->relatedTo = $relatedChannelEntries;

RelatedTo in plugin based search


Page manager (or panels) override path

Question: I want to override Drupal 8 paths (routes) like node/{node} or taxonomy/term/{taxonomy_term} with custom panels variants. Is it possible?
Answer: Page Manager module.  Add a new page that has the Path of <code>/taxonomy/term/%</code> and as @Todd Young wrote, disable the default Taxonomy view.
However, there is a bug that this is not working at https://www.drupal.org/node/2785195
Answer: There is a Page Manager module which you could use for this purpose.

This is the Drupal 8 version of Page Manager, formerly part of the CTools module written by merlinofchaos
It supports the creation of new pages, and allows placing blocks within that page.
Like Drupal 7's Page Manager, it provides a concept of "page variants", each with their own selection conditions.
Additionally, it can be used to take over an existing page, like overriding /node/% to change what is displayed when viewing a node.
Comment: I'm already using it, but it works only for 'node/{node}'.
I've tried to use several patterns: `/taxonomy/term/{taxonomy_term}`, `/taxonomy/term/%` - it doesn't works.
Also I failed to override simple `/node` path.
Which one should I use?
Comment: Downvote, because I'm asking for a practical solution, that one is theoretical only - it should work, but it doesn't. Perhaps I should create a bug report. Please correct me if I'm wrong.
Answer: I would comment but I don't have a reputation here yet.
The Page Manager module will indeed do what you are trying to accomplish.  The problem you are having in the comments is due to the path you are trying to use already being taken.
Drupal 8 comes with a stock View for the Taxonomy page.  You're probably setting the Page Manager page up correctly but you will need to disable this built-in View to "release" that path before it takes effect in your Page Manager page.

Page manager (or panels) override path


square root of a symetric matrix

Question: I have a symmetric matrix which positive-definite, but it contains zero as eigen value. So the method of Cholesky does not work, could someone give another method to do this? I do not want an iteration method, just as Denman–Beavers iteration and Babylonian method to the exact square root of a given matrix. Many thanks!
Comment: If it possesses zero eigenvalues, it is, by definition, *not* positive definite. Also, can you simply diagonalise $A=U\Sigma U^\ast$ and take $\sqrt{A}$ as $U\sqrt{\Sigma}U^\ast$?
Comment: the general diagonalisation is not very fast in computer, is there any better method
Comment: @user1551 Orthogonal diagonalization is an iterative method (usually done by an iterative repetition of the QR factorization).
Comment: @VedranŠego I know (see my answer), but when I wrote my comment, I thought the OP meant to find the square root by hand (with the aid of an interactive environment such as Matlab).
Comment: @user84572, a decent $A=LDL^T$ decomposition should be fast on your computer (i.e. similar to Cholesky). E.g. check out http://eigen.tuxfamily.org/dox/TopicLinearAlgebraDecompositions.html
Answer: You may read chapters 6 (Matrix Square Root) and 7 (Matrix $p$th Root) of Higham's Functions of Matrices: Theory and Computation to see if there is anything helpful. However, practically all linear algebra solvers are iterative in nature. If you want something non-iterative, I doubt there is any.
Answer: You could use the square root's Taylor series (calculating only the sum of the first few elements):
$$\sqrt{{\rm I} + X} = \sum_{n=0}^\infty \frac{(-1)^n(2n)!}{(1-2n)(n!)^2(4^n)}X^n = {\rm I} + \frac{1}{2}X - \frac{1}{8} X^2 + \frac{1}{16} X^3 - \frac{5}{128} X^4 + \dots$$
However, just because you could, doesn't mean you should, as this is a very bad approach (slow, numerically unstable,...). There are good reasons why this stuff is done iteratively.
If your positive semidefinite matrix is of an order up to $4$, you might be able to get an exact formula for the elements of its square root. Otherwise, forget the non-iterative methods and follow @user1551's advice on reading Higham's book.

square root of a symetric matrix


Genesis 1:26 and Genesis 3:22

Question: Why do English translations (NIV, etc) say "us" and "our"  in Genesis 1:26 and Genesis 3:22 but the Hebrew doesn't say that when viewed with an Interlinear version?
Comment: Welcome to BHSX.  Thanks for this question.  Do not forget to take the Tour below.
Answer: The "of us" and "our" are present in the Hebrew.  In Genesis 1:26 what is translated as "in our image" parses as follows:
בְּ – in (the same letter as the first letter of Genesis 1:1)
צַלְמֵ – image (shadow)
וּנ – our (of us) [you will also see these letters regarding the Hebrew of "our likeness"]
Literal rendering of Genesis 1:26 might be "In shadow ours"
In Genesis 3:22 you will see the words below:
כְּאַחַ֣ד – as one
מִמֶּ֔נּוּ – of us
Hoped this helped
Answer: The word "image" in Genesis 1:26 and 3:22 has appended to it (as is the norm when denoting the possessive in Hebrew) the letters נו (pronounced nu), making the word not simply "image" but "our image." You may recognize this ending from the famous Jewish 'creed' the Sh'ma: "Hear O Israel, the Lord is our God: the Lord is one." The word "God" here has likewise appended the letters  נו (pronounced nu). That is, "eloheinu" ("our God").
This contextual usage of the word is not considered in some interlinears (and even when it is, it assumes knowledge of the Hebrew language sufficient to recognize how the translators treated the original Hebrew, which may on a literal level, mean something quite different: e.g. "nose" being translated "rage" or "anger").
Answer: To make it clearer what others are saying, here's an example from Blue Letter Bible.
Notice that the column heading says "Root Transliterated".  I.e. it shows the root Hebrew word, not the word as it is actually used in the text.
The roots are listed as "צֶלֶם" and "דְּמוּת", while the original Hebrew verse at the top says "בְּצַלְמֵנוּ כִּדְמוּתֵנוּ".
If you look at only the words in the table, you'll see only the roots, and will miss the grammatical prefixes and suffixes (in this case meaning "in our" and "after our").
Comment: Nice post.  Thanks for the clarification Ray.

Genesis 1:26 and Genesis 3:22


Pretty-printing Micheline JSON

Question: How can I pretty-print a Michelson contract in JSON to concrete syntax?
Comment: This is done by the SmartPy.io/dev explorer. We could extract the code if you need it or integrate it in the CLI.
Answer: Edit: I realized that I misread the question and answered it for Michelson to Micheline when you wanted Micheline to Michelon. I do not know if there is a way to do that via the command line. Regardless, it would be nice to have both supported by the tezos-client tool.
Michelson to Micheline
It would be nice if there was a dedicated tezos-client command to do this, but as far as I know there is not. This is what I usually do.
tezos-client -l typecheck script michelson.tz > micheline.json 2>&1

There will be some none json details in micheline.json that need to be removed.
This is an even bigger problem if you want to translate a lambda in Michelson to Micheline to use it in a Tezos library that only knows how to handle JSON. My current work around is to dry run the lambda in the contract that is going to use it.
tezos-client transfer 0 from alice to aliceLimit --entrypoint 'do' --arg '{DROP; PUSH address "KT1HWN9KL97fo7oYZgy36Je7ZYZAY6Xt4ye2"; CONTRACT %transfer (pair (pair address address) nat); IF_SOME {PUSH mutez 0; PUSH nat 100; PUSH address "tz1boB5GrcAVRtjQQLrpjM4Xpp1E438La4Wn"; PUSH address "KT1Etn69GyqDCAhZp7wY21s4Y8HefH2ujrSf"; PAIR; PAIR; TRANSFER_TOKENS;} {PUSH string ""; FAILWITH;}}' --dry-run > lambda.json 2>&1

If it succeeds you can delete the extra details from the file. There will be a lot of other unrelated things in there.
Answer: With PyTezos it would be (don't mind the naming, it is wrong, will be fixed at some point):
>>> from pytezos.michelson.converter import micheline_to_michelson
>>> print(micheline_to_michelson({'prim': 'pair', 'args': [{'string': 'hello'}, {'int': '42'}]}))
pair "hello" 42

Pretty-printing Micheline JSON


Powerful security tools to use in penetration testing

Question: I want to ask you about some good security tools you've used or heard about, please let us know the ability in every tool and the difficulty to use it and which is the best situation to use this tool .
Edit: my question is about tools like metasploit, scapy, nmap ....etc
Comment: Hello, I wish you had included what you want to pentest as the scoep of this question is really really big! You would get different answers for different pentests. For example if you want to pentest a website? A server? A specific technology?
Comment: @ChrisAD: actually I am talking about LAN networks and computers Security
Answer: I couldn't agree more with @spinkham's answer.  That is the best answer.
To add to @ygjb's power tool list, on the web app side, these tools are excellent for extracting data

First use the Burp Suite to identify points of opportunity - this tool can be challenging to gain proficiency in  if you're new to how web apps work

Powertools to help you exploit SQL injection vulnerabilities

sqlmap & sqlninja
  sqlmap & sqlninja have been invaluable to me - the information revealed from extracting the data in target databases (usernames, password hashes, trust relationships, etc.) was key to attacking/compromise additional devices

Also, there are many commercial exploit kits, to name a few:

White Phosphorus Exploit Pack http://www.immunityinc.com/products-whitephosphorus.shtml
  Agora Exploit Pack http://gleg.net/agora.shtml
  VulnDisco Exploit Pack Professional http://www.intevydis.com/vulndisco.shtml
  D2 Exploitation Pack http://www.immunityinc.com/products-dsquare.shtml
Answer: Your brain.  Tools can be excellent force multipliers, but the most essential pen tester tool is a well tuned noggin that knows in depth the systems (both technological and human) it is attacking.  The ability to think creatively about potential failure modes is indispensable.
Answer: If you are referring to attack platforms that would be used for penetration testing, then you are probably best off looking into the following:

Metasploit (+ Express, Pro), free with commercial versions
CANVAS commercial (low cost)
CORE Impact (high cost)

But those tools don't necessarily have everything you would want.  You should also look at the Backtrack linux distribution, which is a VM or disc image that contains a large collection of security tools for many disciplines.
Aside from that, there are so many powerful tools and libraries written in it, Python deserves a mention too :)
Answer: Today while I was searching I saw this book : SecurityPowerTools, it covers many security tools and really has great explanations about them.I think it covers a huge side in my question.
Comment: Note that the linked book was published in 2007.


Magento Grunt Less Compilation behaves weird

Question: I have a custom theme Mycompany/mytheme including <Magento>/<blank> as parent.
The locale is set to de_DE.
When I execute php bin/magento setup:static-content:deploy de_DE everything works fine, my custom-m.less and custom-l.less get compiled into custom-m.css and custom-l.css and I also get the Magento/blank theme files and viewing the magento website with chrome also loads these files.
custom-m.less and custom-l.less are exact copies from the blank themes styles-m and styles-l less files

The Problem:
Using grunt exec:mytheme and grunt less:mytheme kinda behaves strange. I still load the Magento/blank styles-l.css but everything else gets loaded via their own less component files (e.g. _extend.less or _module.less)

Here is my grunt config file:
magento-root/dev/tools/grunt/configs/themes.js
module.exports = {

    -----------------------------
    ... blank and luma stuff here
    -----------------------------

    mytheme: {
        area: 'frontend',
        name: 'Mycompany/mytheme',
        locale: 'de_DE',
        files: [
            'css/styles-m',
            'css/styles-l',
            'css/email',
            'css/email-inline',
            'css/custom-m',
            'css/custom-l'
        ],
        dsl: 'less'
    },

    --------------------------
    ... backend stuff here ...
    --------------------------

};

'css/styles-m', 'css/styles-l', 'css/email', 'css/email-inline' are not inside my mytheme, but as magento devdocs says should anyways be included because of the parent theme inheriting. I also tried to not include these files inside the config file = Same result
BTW: grunt commands throw no errors, seems to work fine, in var/view_preprocessed I see my custom files inside the Mycompany/mytheme folders, same as pub/static/frontend....
I deleted the cache after each new try
Server-side compilation enabled
developer mode enabled

Question:  Can someone help me with this? Can someone explain whats wrong?
And what is the expected workflow? Magento Documentation is a bit unclear about that

php bin/magento setup:static-content:deploy -> grunt watch ?
php bin/magento setup:static-content:deploy -> grunt exec:mytheme -> grunt watch ?
grunt exec:mytheme -> grunt watch ?

Should I use the magento php compiler at all? Because I don't want to, way too slow
Comment: There is two types of compilation in magento, you can compile via grunt or server side compilation. Which type are you used for it ?
Comment: as I described, using server-side compilation using `php bin/magento setup:static-content deploy` works fine. When I use grunt I get this strange behavior, as described above
Answer: You need use Grunt for display source code inspecting in firebug and you have explain how it works.

Magento 2 - How to configure Grunt in PhpStorm
Comment: [@juhanix](https://magento.stackexchange.com/users/44070/juhanix) Helped you with my answer?


IBM Cloud Code Engine: Locally built container image gives exec format error when deployed

Question: I have created a container image on my machine (Mac). When testing it locally, all works fine. But the following does not work:

Push the image to the Container Registry in IBM Cloud
Create an application in Code Engine using the image

It produces this error:

exec /usr/local/bin/docker-entrypoint.sh: exec format error

I've looked in to the docker-entrypoint.sh and that seems to be ok. What is wrong? How do I address it?
Answer: Code Engine runs on x86 machines internally. In order to push an image to CE that has been built on a M1 Mac, please add docker build --platform linux/amd64 ... when you do your docker build.
Comment: Alternatively, instead of building the image yourself, you could have Code Engine build it for you, and that would make sure it's x86 as well. More information here: https://cloud.ibm.com/docs/codeengine?topic=codeengine-plan-build
Answer: The reason for the problem is the chip architecture. IBM Cloud Code Engine is based on the Intel x86 architecture, many Mac computers use ARM 64 (M1 or similar). There are two options to work around it:

Use Code Engine to build the container images.
Use docker build --platform linux/amd64  to specify the build platform in your local builds.

Also, check out the Code Engine FAQs and the Troubleshooting section.
Answer: Which CPU do you have on your Mac? Currently, Code Engine can't run images that have been build on a M1 ARM 64 machine.
You can add this parameter your local docker build command..
docker build --platform linux/amd64 ...

Or you can use a Code Engine Build to do it for you.


How do I check the internet speed inside Ubuntu 14.04

Question: How do I check the internet speed on my computer, a dell Inspiron 1545,  while using ubuntu 14.04?
Answer: indicator-netspeed works nice
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install indicator-netspeed

You can watch the internet speed in top panel and it takes less space in top panel.
Comment: run `indicator-netspeed &` to start it as a background process
Answer: Observing the current upload and download rate is fairly easy in Ubuntu. The easiest option is to use the System Monitor, but you can do it through the console as well.
GUI Option
Ubuntu comes with an application called System Monitor, which acts like the Windows Task Manager. To open it, search for "System Monitor" in your dash and start up the proper application. Select the Resources tab and you should see CPU History, Memory and Swap History, and Network History. What you want is the network history, which should show your current upload/download rates, as well as a graph of them over time.
Command-Line Option
Alternatively, you may want to test your speeds. To do this, you could use SpeedTest.net or wget. The latter is a Terminal command. To use it, enter wget in the console and provide it with a download URL as an argument (i.e. wget http://download.org/download.tar.gz). You should choose a fairly large file you know to have good speeds. Once you've done that, you can observe your download speed from the console. Feel free to delete the downloaded file afterwards. If you ran the command immediately after starting Terminal, it will be in your home directory.
Answer: speedtest-cli is Command line interface for testing internet bandwidth using speedtest.net. It uses python.  You can download and run it like so:
wget https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
chmod a+rx speedtest_cli.py
sudo mv speedtest_cli.py /usr/local/bin/
sudo chown root:root /usr/local/bin/speedtest_cli.py

Answer: The best thing is to open system monitor and look in resources or you can install Cairo-Dock and use netspeed.
Answer: The best option is indicator-netspeed-unity.
This indicator applet is made into PPA, available for Ubuntu 15.10, Ubuntu 15.04, Ubuntu 14.04, Ubuntu 12.04, and Elementary OS. You can install it either from PPA or by downloading and installing .deb manually:
Install the applet by adding the developer's PPA:
sudo add-apt-repository ppa:fixnix/netspeed
sudo apt-get update
sudo apt-get install indicator-netspeed-unity

After installation, it starts automatically at next login. Or you can start it immediately from app launcher.
indicator-netspeed-unity

Screen Shot Link


Intuition behind singular $n$-simplex

Question: I came across this definition that a singular $n$-simplex in a topological space $X$ is a continuous map $\sigma\colon \Delta^n \to X$. Using this definition a few examples were put forward: a singular $0$-simplex is a point, a singular $1$-simplex is an essential path in $X$. Now, I am aware that a $0$-simplex is a point and a $1$-simplex is a line. Can someone explain the similarities of these two examples?
Comment: Careful how you use the word 'essential'.
Comment: @Tyrone Actually I did not put it that way. I found it that way. The example further goes on to show that if we define a function f by $f(t) = \phi (1-t,t).$ Then f gives a path $f: C\to X$ from $\phi(v1)$ to $\phi(v2)$ and vice versa. This is where the word essential stems out.
Comment: It's usual to say that a map $f:X\rightarrow Y$ between spaces $X,Y$ is *essential* if it is not null homotopic. I don't think this is what you mean when you use the word.
Comment: @Tyrone Okay, so what difference does essential path create ?
Comment: A *singular* $1$-simplex is *any* continuous function $\Delta^1 \to X$. It could in particular be a constant function, which is trivially null-homotopic and therefore not "essential" in that sense. In fact since every simplex $\Delta^n$ is contractible every singular $n$-simplex is null-homotopic as a function, though it's possible that the *image* is a non-contractible subspace of $X$.
Comment: Have you studied simplicial complexes and simplicial homology? And have you studied singular homology? And if so, have you searched this site for similar questions such as [this one](https://math.stackexchange.com/questions/229036/difference-between-simplicial-and-singular-homology?rq=1)?
Answer: The reason of considering singular simplices is because simplicial homology is only defined for simplicial complexes (or more generally $\Delta$-complexes). In that context the simplices are part of the underlying structure of the object you're working with, and using the properties of this structure it's clear how to define the "boundary" of a simplex as a formal sum of simplices of one dimension lower (being careful to take orientations into account so that the boundary operator is a differential on the chain groups).
But say we want to define a homology theory for ALL spaces. We like the combinatorial nature of simplicial homology and we want to replicate it as much as we can in the most general context, but there are no simplices given to us. So instead, where we would normally have a set of $k$-simplices given as part of the structure, the most natural thing to do is to say that "a simplex in $X$" is just a continuous function $\Delta^k \to X$. The "singular" part comes from the fact that these don't have to be embeddings, for example this includes constant functions. The "boundary" of a singular simplex is expressed as a formal sum of singular $(k-1)$-simplicies in an analogous way, by precomposing with the various simplicial face maps $\Delta^{k-1} \to \Delta^k$. Then to construct singular homology you consider free abelian group on the set of all continuous functions $$C_k^{sing}(X) = \mathbb{Z}\langle C(\Delta^k, X) \rangle = \mathbb{Z}\langle \{ \Delta^k \to X \} \rangle$$ with the appropriate boundary operator.
For a non-trivial example consider $\Delta^1\cong [0,1] \to S^1$ given by $t\mapsto e^{2\pi i t}$. This singular $1$-simplex is actually a $1$-cycle, and generates the singular homology group $H_1^{sing}(S^1)$. In fact this is part of a general example: for all $k>0$ the quotient space $\Delta^k/\partial \Delta^k$ is homeomorphic to $S^n$, and a "quotient map" $\Delta^k \to S^k$ will generate $H^{sing}_k(S^k)$.
Note: As continuous functions all singular simplices are automatically null-homotopic because $\Delta^k$ is contractible for all $k$, but this fine in terms of homology because the homotopy relation is not used at all in the definitions of our groups.

Intuition behind singular $n$-simplex


Which type of regression analysis should I use for consumption pattern data?

Question: I conducted a survey asking people of various income groups about their annual expenditure under various consumption brackets such as food, clothing, housing etc. I then calculated the amount spent by people of different income brackets in these categories as a percentage of their total income. Now, to plot this data and find the best fit line which type of regression analysis should I use. Also are there some other good statistical tools that I can use for exploiting this data?
Comment: Could you please elaborate question and what is your objective? Hows you're data look like? (sorry I didnt find link to add comment)
Comment: I took some liberty in reassigning tags, while I feel your old ones had nothing to do with the question, the ones I assigned could be off the mark as well (so feel free to change them).
Answer: Your charts will depend on what story you are interested in.  Are you interested in amounts spent (on average the rich usually spend more on most items than the poor do)? Or are you interested in the shares of expenditure (or income) going on different items?   Can you avoid your charts getting too cluttered? Do you intend to adjust your numbers for household size?  Or household type, especially whether there are children?
You might get some ideas from the UK publication Living Costs and Food Survey.  You will find that linear regression of expenditure on income is often not particularly appropriate.
Comment: @user152509 I have collected data from survey questionnaires which ask the respondents their annual income bracket and their expenditure in various categories such as food, clothing etc. Now I want to obtain a plot with various income categories on x-axis and percentage of annual income spent on a particular category(such as food) on y-axis. My plots show that people of lower income bracket generally tend to spend a greater percentage of their income on basic necessities such as food. Now, I want to obtain curves for this data. Can you suggest which type of regression is used in such cases?
Answer: I don't think regression will serve your purpose. You seem to want to show how expenditure breakdowns differ among people of different income categories.  Imagine you have a table with, say, 5 rows representing the income groups and 6 columns representing types of expenditures.  Within each cell would be a dollar amount.  You'd want to show where there are disproportionalities from row to row.  Do you see what statistical test would be applicable there?


Find a Water Pump for Clothes Washer

Question: I'm trying to run a front load He Samsung washer (13 gallons water per wash) with water from a 18gal tub sitting on top of it. This is not enough pressure to get the water to work. It needs a minimum of 20psi but likely better if we can get a normal home pressure, roughly between 60-80psi. This means I would need to get a pump, but what flow rate for the pump? There are garden pumps with 1gallon per minute rate that runs 60psi. Will this work? I called Samsung and they tried but have no answer as to flow rate.
Please help identify what requirement in terms of flow rate or anything else you know that I might have missed for a pump to work in this situation.
Why? House burned down. No water source currently, only rain & collected water in buckets. I'm running this off of a generator. It seems the He washer uses less than actual hand washing the clotehs for the family. Thanks!
Comment: Beware: if you have a pump you'll have to have some sort of pressurized reservoir between it and the washer to moderate the pump's on/off cycles. Otherwise the pump's supply and the washer's need will likely conflict, and you'll have trouble.
Comment: Could you please elaborate on what trouble might come without a pressurized tank? I just got the first two washes from a tub-pump-washer setup and it worked really well. The pump is on-demand marine pump and I put my hand in the tub to feel when it was working and when not. It seemed to synchronize just right with the washer demand. If having a tank might mediate potential future issues, I'd do it.
Comment: I probably sounded more certain than I should have. If the pump is designed to supply water needs on-demand then it's likely you'll be fine.
Answer: Possibly a sump pump.
Or, you can get about 8 psi for every 20 feet of height of the tub, such as on the roof or in a tree.
Or you can put it on pause, open the door and pour in the water.
Or you can remove the top cover, and find the vent in the top of the outer stationary tub, attach a hose and fill.
You could get poly drum 20 gallons or larger, or gang together 4 five gallon buckets with gasket lids.  Attach a bicycle or auto tire valve stem and a garden hose outlet. Put your 15 gallons water into the drum. Replace the screw-bung so it's air tight then pressurize it bicycle pump.  The smaller the air space, the less time to pressurize, but the quicker the pressure will drop.
Comment: I'll look into sump pumps.I think the bike/air pump sounds doable. I wonder how much the air pressure translates to water pressurre. If I get the drum to 50 psi, does it translate to 50 psi in water pressure?.  Hanging the water some 50ft up won't be feasible. For pausing, these washers actually move water differently ( they spray water through the clothes); so dumping water in won't work right and will not wash properly.
Comment: air psi will equal water psi.  but air will expand to replace the exiting water.  If the air space doubles the pressure will cut in half. the equation is $P_1V_1 = P_2V_2$.
Comment: I think manually adding water could work if the OEM required quantity was known, but i've never tried it, nor any of the others.

Find a Water Pump for Clothes Washer


Are there any methods to figure out how aerodynamic a race car is without a Cd number?

Question: For the top speed of a car, I believe it's usually limited by drag and horsepower. However, I've also learned that gearing can affect the top speed and acceleration of a car. Are there any methods to figuring out how much more aerodynamic one car is to another only using speed and power? I know this sounds unclear so I'll provide an example: The 2009 Corvette C6.R has 590 hp and can reach 200 mph. The 2008 Aston Martin DBR9 has 600 hp and can reach 180 mph. If you give the C6.R 600 hp, its new theoretical top speed would be 201.1 mph. Does mean that it is more aerodynamic, or is there more to it?
Comment: There is more to it.
Comment: I can guarantee that gear ratios and final drive are causing the 20mph difference in these two cars, not aerodynamic drag.
Comment: I believe it's usually limited by drag, *weight* and horsepower.
Comment: @chili555 On a flat surface, *weight* has little to do with top speed.
Answer: There is a test called coasting which is done by some car magazines. In this test, they reach the car to a certain speed (usually 100 km/h), put it in neutral and let off the throttle immediately and measure how much time it takes for the car to come to a complete stop. If the car travels more distance (and takes more time) before coming to a stop, it means that it has less air resistance. This test not only shows aerodynamics of a car, but also shows other negative forces acting on a car such as wheel bearings friction, tire friction, etc. However, this test is only accurate if you compare two cars at the same time and in similar weather conditions and in the same road. Otherwise, results could be different and unreliable.
Comment: Which is why REAL engineers use wind tunnels.
Answer: Ever studied aerodynamics using coefficient of drag formulas in theoretical calculations? Aerodynamics was adapted to racing cars, land speed attempts, NASCAR, dirt track, F1 and drag strip racing. Raising horsepower isn't the only answer to higher speed as drag limits top speed no matter how much hp is added. Drag can be seen as two dimensional, frontal drag as seen standing a few feet in front at waist level, calculating total frontal surface area that creates drag against forward motion thru air. Try walking forward with a 4x8 piece of plywood with the flat face into a breeze then do the same with the narrow thin side into the breeze. The flat portion  has a larger frontal surface area and requires more force to walk into a breeze. Walking with the thin side into the wind is much easier and takes less force to walk.   Trial and error using mathematics mixed with wind tunnel tests eventually results in a lower Cd. F1 is between 0.7 and 1.1 using a great deal of tuned down force to enter turns at high speed. Cars with 0.25 and 0.3 Cd can't enter turns at high speed unless downforce devices are used. Suvs between 0.35 and 0.45 Cd.


How to perform logistic lasso in python?

Question: The scikit-learn package provides the functions Lasso() and LassoCV() but no option to fit a logistic function instead of a linear one...How to perform logistic lasso in python?
Comment: I still have no answer to it. I ended up performing this analysis in R using the package glmnet.
Answer: The Lasso optimizes a least-square problem with a L1 penalty.
By definition you can't optimize a logistic function with the Lasso.
If you want to optimize a logistic function with a L1 penalty, you can use the LogisticRegression estimator with the L1 penalty:
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import load_iris
X, y = load_iris(return_X_y=True)
log = LogisticRegression(penalty='l1', solver='liblinear')
log.fit(X, y)

Note that only the LIBLINEAR and SAGA (added in v0.19) solvers handle the L1 penalty.
Comment: Agreed. Originally defined for least squares, Lasso regularization is easily extended to a wide variety of statistical models. In scikit-learn though, the `Lasso` class only includes least-square. Other classes include L1 regularization (`LogisticRegression`, `NMF`, ...), but it is called "L1 regularization", and not "Lasso".
Comment: lasso isn't only used with least square problems. any likelihood penalty (L1 or L2) can be used with any likelihood-formulated model, which includes any generalized linear model modeled with an exponential family likelihood function, which includes logistic regression.
Comment: ah ok. i thought you were referring to lasso generally.
Answer: You can use glmnet in Python. Glmnet uses warm starts and active-set convergence so it is extremely efficient. Those techniques make glmnet faster than other lasso implementations. You can download it from https://web.stanford.edu/~hastie/glmnet_python/
Answer: 1 scikit-learn: sklearn.linear_model.LogisticRegression
sklearn.linear_model.LogisticRegression from scikit-learn is probably the best:
as @TomDLT said, Lasso is for the least squares (regression) case, not logistic (classification).
from sklearn.linear_model import LogisticRegression

model = LogisticRegression(
    penalty='l1',
    solver='saga',  # or 'liblinear'
    C=regularization_strength)

model.fit(x, y)

2 python-glmnet: glmnet.LogitNet
You can also use Civis Analytics' python-glmnet library. This implements the scikit-learn BaseEstimator API:
# source: https://github.com/civisanalytics/python-glmnet#regularized-logistic-regression

from glmnet import LogitNet

m = LogitNet(
    alpha=1,  # 0 <= alpha <= 1, 0 for ridge, 1 for lasso
)
m = m.fit(x, y)

I'm not sure how to adjust the penalty with LogitNet, but I'll let you figure that out.
3 other
PyMC
you can also take a fully bayesian approach. rather than use L1-penalized optimization to find a point estimate for your coefficients, you can approximate the distribution of your coefficients given your data. this gives you the same answer as L1-penalized maximum likelihood estimation if you use a Laplace prior for your coefficients. the Laplace prior induces sparsity.
the PyMC folks have a tutorial here on setting something like that up. good luck.


Finding equation of tangent line at a point parallel to another function

Question: So I'm having trouble trying to solve this. I have been puzzling over it. I know I need to use the slope of the parallel line to find the derivative but I just can't seem to work it out in my head. I need to find the equation of the tangent line of:
$$f(x)=−4x^2+11x−2 $$ at $$x=2$$ that is parallel to $$ y=-5x-1$$
Answer: Firstly, we find the derivative to be $f'(x)=-8x+11$. At the point $x=2$, the derivative is equal to $-5$ (found by evaluating the derivative at this point), which tells us the slope of the tangent line. Since this and the slope of the given line are the same, then we just have to find an equation for this line. At $x=2$, the y-value of the function is $4$. Since we know the slope and a point, we can find the equation of the line to be $(y-4)=-5(x-2)$.
Comment: $-44$? $-4*2^2+11*2-2=-16+22-2=-4$
Comment: My bad, silly calculation error. I believe it is positive 4 though, I will fix now.
Comment: Do you even need to find the derivative? It gives you the slope already and a coordinate point of the line we want. Just seems unnecessary to mention.
Comment: If you assume the slopes are going to be equal no, I just did it to confirm that the slopes are indeed parallel.


Stopword removal (suprisingly) decreases accuracy of naive-bayes model

Question: I'm building a model that predicts the subreddit of a given reddit submission. I have a question regarding pre-processing my text (submissions). The order I followed when pre-processing my text was:

Remove punctuations
Remove stopwords
Lemmatize the remaining text

I then fed the parsed text into a CountVectorizer.
While this got me decent accuracy on my naive bayes model, I discovered I was getting much better results (about ~5% gains) when I skipped #2 altogether. What are some reasons why this could be happening?
Answer: Stop words typically remove such things as "a, an, the, it". Often this can be beneficial when we are classifying based on topics, which are well described by nouns and adjectives.
However some text classification tasks are more abstract. Consider classifying fiction and non-fiction articles on the same topic, what would the difference between these two writing styles be? They would probably use the same nouns but what about the frequency of "the" vs "an" or "he" vs "they"?
Stop words are, by definition, words that contain no information for your classification task. There is no universal set of stop words that will improve all text classification tasks. If you use an off-the-shelf stop words dictionary, you could be throwing away valuable information.


How does follower system work in multiplayer?

Question: What happens to followers when playing multiplayer? Can they be used?
Answer: For both followers and non-follower NPCs, any quest-reliant companions will continue with you on any quests in which they are relevent - initially, this includes the Templar, the Scoundrel, and the Enchantress (all for different quests). At that point in time, regardless of whether or not you are playing multiplayer, they are not actually considered "a follower" - you cannot adjust their abilities or inventory.
After they have been recruited as your follower, it will prompt you as to whether or not you wish to keep them. If not, you can hire them again in town any time you are playing alone in a game. If you are playing with multiple players, followers cannot be hired. If you have a follower when you game switches from single player to multiplayer (i.e. someone joins your game or you join someone else's game), your follower will be "un-hired" (teleported back to town, where you can re-hire them next time you are alone again).
As mentioned by @Hurda in the comments, when all co-op players leave, the game will prompt you with the option to re-hire your previous companion, who will join you again without having to go back to town.
TL;DR You cannot hire a follower in multiplayer, and anytime you either gain any or lose all co-op players, the game auto-dismisses or prompts for re-hire.
Comment: and when your cooperator leaves your previous follower asked if you want hire him immediately no matter where you are.
Comment: Also note that they get teleported back to town, once you're back on your own, you can simply pick whichever follower you want to take along. So you don't have to worry about 'losing' a follower
Comment: And note that even though it says 'Hire' when you talk to them, it doesn't cost gold.
Comment: It's also worth noting that followers can double up, so for example in single player if you have the templar with you and enter the cathedral leading up to his quest line, you will end up with both your follower with you and the 'Warrior' up until Jondar.
Answer: In multiplayer, followers will stay with you during the quests for which they are required. For example, the templar will follow you unitl Jondar is slain, and the enchantress stays with you until she reveals the bridge.
Once you would have the option of whether to keep them or not, they go back to town automatically. You can not choose to use them in a co-op game.


How to "autoplay" an HTML5 audio element in Mobile Safari?

Question: I am porting a vehicle in-dash display unit app over to the browser.  The big goal is to get it running completely within Mobile Safari.
It's an HTML5/JS music app that relies heavily on jQuery.load to move around between different "screens" by loading in page fragments.
The issue is that when a user selects a track to play, they are taken to the "now playing" screen, which should start playback of the track.  The track is not playing though once this screen is reached, and the user instead needs to explicitly click play from this screen in order for audio playback to start.  Once this has happened for the first time, autoplay works for the duration of the app.
I understand that Mobile Safari intentionally put blockers in place to prevent audio from autoplaying so that web apps are kept from consuming data unless in direct response to user input.
The thing is, my audio playback IS in direct response to user input...sort of.  However, a bunch of things need to happen before my playback actually starts, and those things happen within the now playing page (calling API to get URL for track to be played, report user is playing track, get track metadata, yatta yatta yatta).
To try and get around this, I have the app preload a silent .1s mp3 file into the audio element on startup.  Then in direct response to a click event to transition to now playing screen, I call .play() on the audio element.
I assumed that having a call to .play in direct response to user input would the subsequent call to .play() within the now playing page to work, since this is the behavior I had previously observed.
Only, it didn't seem to make any difference.
Any ideas on how I can adjust my flow in order for audio playback to start after loading the now playing screen?
EDIT:
Added some code snippets below
Vehicle.audio = {
        init: function () {
            audioElement.setAttribute("src", "/audioinit.mp3");
            audioElement.play();
        },

        play: function (source) {
            log("VEHICLE: playing audio from source " + source);

            Vehicle.audio.stop();
            audioElement.setAttribute("src", source);
            audioElement.play();
        },

In response to user selecting a track:
$(document).on("click", "a.play-track", function () {
    Vehicle.audio.init();
    /* my wrapper function for jQuery.load() */
    replace_wrap("nowplaying.html");
});

Then on the now playing page, Vehicle.audio.play() is called.
Comment: Possible duplicate of [How can I autoplay media in iOS >= 4.2.1 Mobile Safari?](http://stackoverflow.com/questions/4259928/how-can-i-autoplay-media-in-ios-4-2-1-mobile-safari)
Answer:
The thing is, my audio playback IS in direct response to user input...sort of. However, a bunch of things need to happen before my playback actually starts, and those things happen within the now playing page (calling API to get URL for track to be played, report user is playing track, get track metadata, yatta yatta yatta).

Try adding a "touchstart" event listener to the entire "now playing page" which will then synchronously call .play() on the audio element:
$(document).one("touchstart", function () {
  Vehicle.audio.init()
})

This way as soon as an iOS user touches anywhere on the now playing page, the audio should begin loading/playing.
Answer: AFAIK it is a restriction placed intentionally by iOS. User must interract with the device (touch/click event) before the script is allowed to start playback.


What is the legality of France specifically banning all pro-Palestinian protests?

Question: French Prime Minister Gérald Darmanin has recently instructed the prefects (regional state representatives) to ban all pro-Palestinian protests as they are "likely to cause a public disturbance". What is the legality of this?
Comment: @bdb484 I almost downvoted due to this being a one-line question sharing no prior research (https://law.stackexchange.com/help/how-to-ask) and containing an assertion ("France has recently banned [...]" which is not cited. Citing the source would speed up volunteer answerer's time & allow scrutiny of a source for potential errors.

I didn't downvote though, because assuming the assertion to be true, this is a really good legal question, possibly pitting the French government against human rights obligations in the EU & ECHR, not to mention its own constitution.
Comment: I'd love to know what all the downvotes are about.
Answer: germany
In Germany on Friday 13th a lot of pro-Palestinian protests on the same day and Saturday 14th of October 2023 were banned. The ARD did report about the legal situation while various outlets did report reasonings given to the press. The reasons for various cases were, among others:

Several of the people organizing official protests did allege allegiance to Hamas or PFLP, which are banned terrorist organizations in Germany. It is illegal to glorify a banned terrorist organization or crimes under §140 StGB, something that would be very much the result of a protest claiming allegiance and agreement with the recent attacks on Israeli citizens.
It is very likely people would want to burn flags. This is illegal under §104 StGB.
The protests were sought as a result of the open call of Hamas to assault Jewish people on Friday 13th after the Friday prayer. This was connected in radio reports to be part of the reason the demonstrations were banned.
In Hamburg, a pro-Israel demonstration on Monday went haywire with at least one serious injury. The shifted situation made such a result for the banned demonstrations nigh certain. This was quoted repeatedly together with the fact that the demonstration was banned.
In Berlin, a demonstration was banned for being an "endangerment to public safety and order". This is precedented by a ban of a similar demonstration in April, and a history of bad actors using signs glorifying crimes or repeatedly yelling illegal paroles that fall under "Volksverhetzung" [~hate speech], StGB § 130. This is an established reason to ban a demonstration.
One of the organizers had a similar demonstration in Neukölln go very haywire in May 2021, and this was cited in the reasoning to ban a new protest on October 13th in the same area by the organizer. This very organization is currently under investigation if it could be banned as a terrorist organization, but only in the first steps.

It is of note that each and every demonstration was banned individually, and there was no blanket ban, despite the reasoning of many bans being nigh carbon copies of one another.
Comment: I presume that at least some of these reasons would apply to pro-Israeli protests as well. In particular because that demo in Hamburg was _pro_-Israel.
Comment: @PMF the danger to the public can, but it is expected to have less or no violations of sections STGB §130, 140, and 104.
Answer: France is a signatory to 1966 International Covenant on Civil and Political Rights, Article 21 of which says

The right of peaceful assembly shall be recognized. No restrictions
may be placed on the exercise of this right other than those imposed
in conformity with the law and which are necessary in a democratic
society in the interests of national security or public safety, public
order (ordre public), the protection of public health or morals or the
protection of the rights and freedoms of others.

The actual order is not presently available to us, but is said here to include the statement (probably in French) that "Pro-Palestinian demonstrations must be prohibited because they are likely to generate disturbances to the public order". This is the circumstance under which a ban on exercising the right of assembly is allowed under the law. The law does not dictate a specific standard of evidence required for a ban.
Answer: I edited your question to add a source and a bit of context.
I don't have a definitive answer to it. However, here are some hints.

The administrative court of Paris stated a few days ago that the Paris police prefect's decision to ban a pro-Palestinian demonstration was legal.
However, this kind of statement is by no means systematic. There are many occurrences (this one in 2020 or this one in 2022 for instance) of the same court stating that ban of protests were illegal. Last June, it even suspended the ban on a pro-Palestinian demonstration.
These decisions are often taken on a case-by-case basis, and depend in particular on the arguments put forward by the parties. The above-mentioned order argued that "the claimant association has not provided any information on the implementation of an internal security service at the event capable of preventing the risks and dangers identified". Associations applying specific security measures are more likely to be heard.
The administrative court of Paris is not the highest court in France, and the Conseil d'État or the European Court of Justice may rule otherwise.
This is only my opinion, but: It is likely that the ban on all pro-Palestinian demonstrations is illegal (even during the Covid crisis the Conseil d'État stated that ban of all protests was illegal), but it is likely that a prefect can legally ban any individual demonstration with minimal arguments (given the context), and a group wishing to organize such an event should have a good lawyer...

Edit 2018-10-27
So the Conseil d'État stated that a general ban of pro-palestinian protests was illegal, and that it's up to the prefects to decide by a case-by-case basis.
Since that date a few demonstrations were held without being banned, in Paris or Nantes for instance (can't post a source for this one, not enough reputation).
Comment: The **reason** for banning the protests is relevant, as I explained for the german situation


Getting column widths for RadGrid on client side

Question: This RadGrid stuff has been a complete nightmare, but I think I'm almost there.
I'm trying to truncate text that's too long and add an ellipsis...
The tricky part is that the user can chose which columns they want to show/hide, so the size of the columns will depend on how many columns are being displayed. My idea is to get the current width of the column and determine how many characters to allow in the cell based on that.
It seems I'm not able to get the widths on the server side if they're not explicitly set. Can this be done on client side?
I've done this, but I'm still getting blanks for the widths:
var grid = $find("<%= rgResults.ClientID %>");
var mtv = grid.get_masterTableView();
var columns = mtv.get_columns();
for (var i = 0; i < columns.length; i++) {
var element = columns[i].get_element();
    alert(element.width);
}

Answer: You need to use the clientWidth property instead of just width:
var grid = $find("<%= rgResults.ClientID %>");
var mtv = grid.get_masterTableView();
var columns = mtv.get_columns();
for (var i = 0; i < columns.length; i++) {
    var element = columns[i].get_element();
    alert(element.clientWidth);
}


When to use VS 2010 vs. SP Designer for development

Question: When do we use Visual Studio 2010 for SharePoint 2010 web part development and when do we stick with Designer? Are there pros/cons? As a noob, it seems that for more robust, customized web parts, Visual Studio is the way to go. Thanks.
Comment: the more I use SPD, the more I discover problems in deploying customization from dev to production platform. I feel that the MS deployment model is to work with SPD directly on the production. But when you enter in a industrial process (with dev to test to production requirements), VS is more suited. But also with a lot more things to learn.
Comment: you are right, SPD can only be used to customize native OOB webpart. you can't have custom webpart development with SPD. However, do not underestimate the power of native WebPart : DataFormWebPart, ContentByQueryWebPart, XslViewWebPart, etc. With a bit of habit, sometimes a bit of trick and hack, you can achieve specific requirements far more complex than with a custom WebPart. It's hard to emit an universal rule to decide when to use SPD + native webparts or VS and custom webpart, but OOB native webpart gains the full UI integration hard to reproduce with VS.
Comment: Thanks, Steve. I've found Designer to be problematic for web part development. VS is the way to go for serious developers.
Answer: SharePoint Designer is intended as a "power user" tool, whereas Visual Studio is intended for developers. There is no real concept of deployment in SPD, so you can't really expect to use it to develop solutions. If you want to do development, you need Visual Studio and someone with development skills. But if you are just doing customization you can achieve a lot with SharePoint Designer.
Using Visual Studio you can create solutions that change files on your front-end servers and make modifications to your farm's configuration, whereas with SPD you are limited to making changes to the content database. Even so, SPD is powerful enough to do serious damage to a farm in the wrong hands. That is why the administrator has the option of disabling it.
Of course SPD is a useful tool for developers also. But artefacts created by developers with SPD, or by other means, would normally be packaged up using VS for deployment.
As far as web parts are concerned, as mentioned in the question, you are restricted to configuring web parts using SharePoint Designer. If you want to develop a web part you need VS, although you don't always need to - you can achieve a lot by skillful configuration of existing out-of-the-box web parts.


How do I properly install the StarUML software?

Question: Can someone please step by step explain to me how to install StarUML software? I've downloaded and unzipped it but other than that I'm just unable to go any further with this.
Answer: I suppose you clicked on the big green download button. Unfortunately that downloads the source and my guess is that you want staruml-5.0-with-cm.exe instead.


I can't find Generate local resource from tools menu in visual studio 2010

Question: I'm in design view (markup) at webpage. I can't find "Generate Local Resource" from my tools menu. Can any one tell me how to enable this tool.
Answer: Ensure you are viewing the "Design" or "Split" tab, not the "Source" tab when viewing the aspx or ascx file. Additionally, this post may help, which states in part,
"If you are using Microsoft Visual Studio 2010, this walkthrough assumes that you selected the Web Development collection of settings the first time that you started Microsoft Visual Studio 2010."
How to generate local resources in Microsoft Visual Studio 2010
Comment: The fact that  actually need to have the WYSIWYG active is silly, but you were really helpful thank you for the information!
Answer: In addition, this may also be usefull to know that VS.net Web Express editions (at least, in 2012 Web Express) do not implement this functionality.
Or it is really, really hidden and not in the same menu as it used to be because I just don't find it at all!
Here are all options of Tools Menu:
Comment: I'm using 2012 Web Express, I have checked Choose Toolbox Items but see Localisation is already installed - So I couldn't add an option for it. Could you able to add ? What did you select ? Currently I have only an option for adding Global Resource (Add New Item -> Resource File, but this adds Global Resource). I couldn't add Local Resource.
Comment: Nah, but in fact,  I was just showing this image to let other see what is shown when hovering "TOOLS" menu from `VS.net Web Express 2012`. When not in Express, you'll see the Generate Local Resource Button. Otherwize, you'll have to create it manually.
Comment: Hm okey, thank you. In fact I have add by this option, but it showned as disabled. But thanks anyway.
Answer: For anyone using Visual Studio Community and still not being able to find the option in Tools, go to Tools > Options > Web Forms Designer > General and switch to Legacy Web Forms designer. Restart and check again. This solved it for me.


What does Magento 1's end of life mean for security?

Question: With Magento 1 nearing it's end of life in June 2020, what are the biggest threats when it comes to security?
Answer: With the Magento 1's end of life, the software support that includes quality fixes and security patches will stop. Owing to the end of security patches, the Magento stores will become vulnerable to the loopholes that are, for time being, secured with the SUPEE patches.
Also, if any loopholes are discovered in the future, Magento would not release the security fix for the same.
With no security measures, it becomes easy for hackers to access your admin panel and you surely do not want it!
That's why it is important to migrate the Magento stores to Magento 2 asap.
Comment: Great awnser, thanks!


Django form query

Question: I saw this piece of code and have few questions..If anyone could explain that would be really helpful.
views.py
def search_page(request):
    pdb.set_trace()
    form = SearchForm()
    bookmarks = []
    show_results = False
    if 'query' in request.GET:
        show_results = True
        query = request.GET['query'].strip()
        if query:
           form = SearchForm({'query': query})
           bookmarks = Bookmark.objects.filter(title__icontains=query)
    variables = RequestContext(request,{'form': form,
                                       'bookmarks': bookmarks,
                       'show_results': show_results,
                       'show_tags': True,
                       'show_user': True})

    return render_t7tr o_response('search.html', variables)

form.py
    class SearchForm(forms.Form):
        query = forms.CharField(label=u'Enter a keyword to search for', widget=forms.TextInput(attrs={'size':32}))
How do the below line of code work?
If 'query' in request.GET
how the 'query' string is in the request.Get?..When I debugged the dictionary contains the value contains the search value I have given.
THe code works fine but I want to understand.
Answer: Containment testing on mappings checks the keys.

key in d

Return True if d has a key key, else False.

EDIT:
Django parses the query string and populates request.GET from it.
Comment: how does the dictionary contains the KEY-'query'..The VALUE that I gave is 'GOOGLE'(Example)..

Django form query


What is meant with overdamped motion?

Question: I'm learning about Brownian motion. I use the approximation of overdamped motion. I read that the average acceleration is $0$ then, but I don't really understand the concept. So, what does overdamped exactly mean, especially in the context of Brownian motion, and why is the acceleration $0$? Thanks!
Comment: Related: https://physics.stackexchange.com/q/556859/226902 and https://physics.stackexchange.com/q/666606/226902
Answer: Overdamped means that viscosity forces are much more "relevant" than inertia. When this is the case, essentially any movement will very quickly reach terminal velocity, so the acceleration will be $0$.
As a toy model, imagine trying to push an object through a viscous medium. If we apply some constant force $F$, then Newton's second law gives us the following differential equation:
$$m\ddot x=F-b\dot x$$
It is easy to see that terminal velocity is $v_T=F/b$, and the relevant time scale to relax to terminal velocity here is $\tau=m/b$. If the system is overdamped, then $b$ is very large, which makes $\tau$ very small. In other words, the more damping you have, the faster you reach terminal velocity where the acceleration is $0$.

Iin this regime you can create a "trick Newton's second law" where the velocity is proportional to the applied force: $$F=b\dot x$$ Don't show introductory physics students this ;)

What is meant with overdamped motion?