I am trying to understand subnetting. I understand that you can take the 192.168.0.0/24 domain and break it into 2 subnets: 192.168.0.0/25 and 192.168.0.128/25. What if I need to create 2 more subnets inside both of those above subnets?  What if I need to create 2 subnets, which have 2 more subnets inside them and each of those 2 subnets have 2 hosts. As per my calculation, this would be something like.  top 2 subnets: 192.168.0.0/25 and 192.168.0.128/25  subnets of 192.168.0.0/25: 192.168.0.0/26 - 192.168.0.128/26  subnets of 192.168.0.128/25: 192.168.0.128/26 - 192.168.0.192/26  hosts of 192.168.0.0/25: 192.168.0.1/25 - 192.168.0.2/25  hosts of 192.168.0.128/25: 192.168.0.129/25 - 192.168.0.130/25  hosts of 192.168.0.0/26: 192.168.0.1/26 - 192.168.0.2/26  hosts of 192.168.0.128/26: 192.168.0.129/26 - 192.168.0.130/26  hosts of 192.168.0.128/26: 192.168.0.129/26 - 192.168.0.130/26  hosts of 192.168.0.192/26: 192.168.0.193/26 - 192.168.0.194/26  The above doesn't seem right, I am moving down like a tree, however the subnet mask and IPs are being repeated, I am just adding 1 to /x and making the IPs from there. Can anyone please tell me if this is correct?  The scenario I am trying to understand is similar to , however I just want to add hosts on each level as well.

This is a  about IPv4 Subnets.      Related:               How does Subnetting Work, and How do you do it by hand or in your head?  Can someone explain both conceptually and with several examples? Server Fault gets lots of subnetting homework questions, so we could use an answer to point them to on Server Fault itself.   If I have a network, how do I figure out how to split it up? If I am given a netmask, how do I know what the network Range is for it? Sometimes there is a slash followed by a number, what is that number? Sometimes there is a subnet mask, but also a wildcard mask, they seem like the same thing but they are different? Someone mentioned something about knowing binary for this?


I have a table created with \begin{tabu} whose columns contain lengthy strings that it won't wrap because they are not English text, they are actually programming language identifiers. How can I enable them to break on additional characters other than whitespace and hyphen (such as colons or underscores), or even at any character (if none of those additional characters are present).  A demonstration of my problem:  \documentclass{article} \usepackage{tabu} \begin{document} \begin{tabu}{|X[l]|X[l]|X[l]|} \hline ThisIsAVeryLongStringWhichINeedToBreakAcrossMultipleLines & Yet:Another:Very:Long:String:Which:Must:Be:Broken:Up & break\_up\_this\_string\_too\_please \\ \hline \end{tabu} \end{document}

I have data (generated from a database, not manually typed in) that mostly fits into a table cell with fixed width, but sometimes overflows because there are long words for which no hyphenation is found.  The problem can be demonstrated with the following example:  \documentclass{article} \usepackage[utf8]{inputenc} \begin{document} \begin{tabular}{|p{1cm}|p{4cm}|} 1 & Cell where normal hyphenation is possible ÄÖÜ \\ 2 & CellwherenormalhyphenationisnotpossiblebutshouldwrapinsteadofoverflowÄÖÜ \end{tabular} \end{document}   My requirements are:   Text never overflows the cell (assuming some minimum width such that at least a handful characters have place) First priority measure to achieve 1. is the normal hyphenation If 2. fails, it is allowed to break the word at any character, so fill the line and break just before overflow would happen (disregarding normal hyphenation rules)   In the example, the overflow in cell 1 is prevented by measure 2., the normal hyphenation. The second cell overflows. I would like to have this cell treated by measure 3.  For the answer please consider:   Package seqsplit didn't help me The custom macro \wrap proposed in the answer to  comes near my wish, but can't handle the non-ascii characters ÄÖÜ (independent if they are input with utf8 input encoding or with \"A\"O\"U) As the text comes from a database, no manual editing of the cell content is wanted.   One of my ideas was to insert \linebreak[0] after every character, to tell LaTeX that a break can be made if no better opportunities exist. But this doesn't work like intended.  Thanks for your suggestions!


As you can see i added three torus shapes to the center of the model but i would like to cut out the insides of those torus to leave circles in them how can i do this?

I'm trying to model a M16 but I have a problem with cutting the holes on top of the handguard of the weapon.     As you can see in the picture above, I have tried to cut holes into the handguard (The marked mesh in edit mode) with the object above it (The multiple cylinder one). But I simply can't. I have tried the Boolean modifier but the handguard just disappears and doesn't make any holes. Same with the Knife Project thing. Nothing works, it won't make a hole in it. I also installed the BoolTool 0.2 but that didn't work either...The multiple cylinder object goes invisible and doesn't make any cuts.    In the picture above you can see how I want the cuts to be made. I want the holes of the multiple cylinder object to be there on the handguard when I take it away. Nothing works. The 3 methods I tried with worked on other parts of this model but not on the handguard. It should be the handguards mesh's fault but I can do nothing about it. Is there any solution?


if $a,b$ are elements of a unital algebra $A,$ then $1-ab$  is invertible if and only if $1-ba$ is invertible.  because if $1-ab\ $ has inverse $x$ , then $1-ba\ $ has inverse $1+bxa$. but how ??  $$(1-ab)x=x(1-ab)=1$$  then $$(1-ba)(1+bxa)=1+bxa-ba-babxa$$  but how the expression on right hand side equal to $1$.  any hint ??

The problem is from  Algebra by Artin, Chapter 1, Miscellaneous Problems, Exercise 8. I have been trying for a long time now to solve it but I am unsuccessful.      Let $A,B$ be $m \times n$ and $n \times m$ matrices. Prove that $I_m - AB$ is invertible if and only if $I_n - BA$ is invertible.    Please provide with only a hint.


I am trying to install freetds-common, freetds-bin, unixodbc, and php5-sybase on Ubuntu 16.04.  When I run sudo apt-get install freetds-common freetds-bin unixodbc php5-sybase, I get the following errors:  Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package php5-sybase   How can I install this package?

so I've recently installed my first Ubuntu, to be precise, a daily build of 16.04, on my new laptop since the hardware was to new for 15.10. Now I'm in the process of setting it up and I want to install php5 and some extensions.  When I execute sudo apt-get install libapache2-mod-php5 I get the error message that there is no installation package available for php5 and libapache2.  The error message is in german, so I doubt that this would help, but anyways here it is. :-) E: For package »libapache2-mod-php5« existiert kein Installationskandidat.  Do I need to add a apt-get repository? Or what am I doing wrong?


I asked  and it was put on hold as opinion based in less than an hour. A few months ago, I asked another question about good practices and it got squashed quickly as well. I didn't realize good practices were so opinion based. I thought it was an agreed upon set of standards (unique to each language) that seasoned programmers agreed on.   I'm trying to learn programming, and the Stack Exchange sites are a big source of help. Books don't offer a lot of help about specific best practices. So I figured this would be a good place to get the information from people that write code regularly and really know what is expected and allowed in production code.  Are questions about best practices on topic for Stack Exchange? And if not, why?

I've written a few questions on Stack Overflow before that have been closed due to being "not constructive" or "not a real question".  Now, after scanning the FAQ for the site a few times, I understand that my questions were indeed closed for good reason.  However, even after reading the FAQ, I still don't understand why a question of "what's the best practice here?" is a bad thing.  I feel as though if you properly explain your situation as thoroughly as possible, then it shouldn't be a bad question at all.  Questions like "what's the best language?" or "which framework should I use?" are indeed bad questions initially, but I feel if you specify in the post (or preferably in the title itself) what the context is, shouldn't that be deserving of some kind of an answer?  In  I asked what would be "best practice", and naturally my question was closed.  So I read the FAQ and learned how to make a more constructive question, of which I've now re-edited in an attempt to be less vague.  I understand the desire to avoid debate and lengthy discussion over a question, but I also feel as though sometimes there are certain questions which should be asked if proper context is given.  Why is a question over "best practice" always a bad question to ask?


I am attempting to create a 4d array and assign variables to each of the cells.  Typically I would use four "for loops" but this is very messy and takes up a lot of space.  What i'm currently doing:  for x in range(2):     for y in range(2):         for j in range(2):             for k in range(2):                 array[x,y,j,k] = 1 #will be a function in reality   I've tried using list comprehension but this only creates the list and does not assign variables to each cell.  Are there space-efficient ways to run through multiple for loops and assign variables with only a few lines of code?

How can I get the Cartesian product (every possible combination of values) from a group of lists?  Input:   somelists = [    [1, 2, 3],    ['a', 'b'],    [4, 5] ]   Desired output:  [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...]


I want to block a user from installing or uninstalling any application in the system. Does anybody know how can I achieve this?

Can i prevent/restrict standard user from installing/uninstalling software in Ubuntu 12.04 desktop?


Is NSMutableArray *myArray = [[NSMutableArray alloc] init]; any more or less correct than NSMutableArray *myArray = [NSMutableArray new]; in terms of style or efficiency?

Learning Objective-C and reading sample code, I notice that objects are usually created using this method:  SomeObject *myObject = [[SomeObject alloc] init];   instead of:  SomeObject *myObject = [SomeObject new];   Is there a reason for this, as I have read that they are equivalent?


Given this code:  public class Test {    public void add(int x){     x++;   }    public static void main(String args[]){     Test t = new Test();     int a = 1;     t.add(a);     System.out.println(a);   } }   I just want to print out 2 instead of 1. I think I am calling this method wrong. Could you help me understand why?

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


If it evolved, how is a feature selected through a long time span with useless function before the feature becomes complete?  For example, an eye is a very complex organ consisting of countless small features. According to evolutionism, every such small feature should be formed by evolution over long time. But most intermediate features would be useless until the small incremental features are accumulated to provide any useful function good enough to be selected by nature. How do evolutionists explain this intermediate useless features and natural selection? I would appreciate if someone doesn't direct me to another long article but provide an essential succinct explanation. (think of all the organs' intermediate state.. would they survive?)

How has evolution created our blood, lungs and the heart?  We can't exist without blood, which transports the oxygen to all areas of our body. However, the blood needs a lung, which gives it the oxygen to transport. The blood also needs something which lets it flow through the whole body, which are our veins. And in order to allow the blood to flow through our veins, an organ is needed to pump the blood, which is our heart. We also need a brain which controls all that, and the brain in turn needs the blood in order to function right.  Evolution makes very slow steps....."it just doesn't jump". So, How did evolution manage to create all that?


Imagine I have an iron ball in vacuum and it is moving and it hits an iron wall. All the kinetic energy gets converted into heat, right?(since sound cannot be produced).Will there be any other energy conversion?  The ball does not bounce back and nor does the wall move. So,how is the momentum being conserved?  Energy can be conserved as the thermal energy is produced but since momentum is a vector,how do we know that the random motion of the particles of the ball and the wall all add up vector-ally to conserve momentum?

Suppose a sticky substance is thrown at wall. The initial momentum of the wall and substance system is only due to velocity of the substance but the final momentum is 0. Why is momentum not conserved?


Is $\Bbb Z[i]$ a Euclidean ring?  If not, what would be the simplest way of seeing that $\Bbb Z[i]$ is a PID?

I'm having some trouble proving that the Gaussian Integer's ring ($\mathbb{Z}[ i ]$) is an Euclidean domain. Here is what i've got so far.  To be a Euclidean domain means that there is a defined application (often called norm) that verifies this two conditions:   $\forall a, b \in \mathbb{Z}[i] \backslash {0} \hspace{2 mm} a \mid b \hspace{2 mm} \rightarrow N(a) \leq N (b)$ $\forall a, b \in \mathbb{Z}[i] \hspace{2 mm} b \neq 0 \rightarrow \exists c,r \in \mathbb{Z}[i] \hspace {2 mm}$ so that $\hspace{2 mm} a = bc + r \hspace{2 mm} \text{and} \hspace{2 mm} (r = 0 \hspace{2 mm} \text{or} \hspace{2 mm} r \neq 0 \hspace{2 mm} N(r) \lt N (b) )$   I have that the application meant to be the "norm" goes: $N(a +b i) = a^2 + b^2$, and I've managed to prove the first condition, given that N is a multiplicative function, but I can not find a way to prove the second condition.   I've search for a similar question but I have not found any so far, please redirect me if there's already a question about this and forgive me for my poor use of latex.


How can I enable blue/red 3D for yt3d videos in the YouTube android app? I tried watching a yt3d-enabled video on my Nexus 7 but it just plays normally, with seemingly no way to enable 3D.

How to see a YouTube video in  from a non-3D Android device? I am not able to enable Anaglyph mode from the YouTube application.


How do you connect Minecraft java edition (iMac) to Minecraft PE (pocket edition) to play a world together?

Minecraft noob here and I have several questions regarding pocket edition and realms. I'm interested in purchasing Realms for me and my two kids who know much more about Minecraft than I do but they have never used realms.   The oldest plays PC Minecraft but also has an iMac he could use, the youngest uses Pocket Edition on a tablet while I have a Macs. Both of them like Android and I have iPhone. Looking at the purchase page for Realms it's asking me to choose between iOS/Android or Mac/PC. So does this mean we're limited to our options here? My youngest doesn't have the skillset yet to do anything with computers so that would mean the rest of us would be limited to Pocket Edition as well? I'd like to be able to play on the Mac/PC when available and then pick up a phone at some other time on the go and play in the same world. Possible? What is the world size on Pocket Edition Realms? I tried searching for it but can only find info on PC Realms. Can you change the Realm type later? Ie if I do go with Pocket Edition realms can I change it to PC/Mac later on? I'm asking because I'm assuming the answer to #1 above is going to be segregated from PC and mobile realms.


My old door was 29. 11/16" and the new pre hung interior door is 28". Is this gap too big if an area to use this door. The other threads all have smaller gaps. Also should I butt up to one side or split on each side?  The trim is 2. 1/2" so the gap can be hidden.  Thanks.

I am replacing a door with a pre-hung door including the jamb. The old door was 29 11/16" wide. The new pre-hung door is 28".  Is this too big of a gap?  Should I make it plumb on one side and make up the difference on the other side? Other threads suggest making up space on the handle side, but this is more space than than what other people were asking about. The trim is 2 1/2" so the gap would be covered.


I am loading OpenStreetMap vector data into ArcMap (using the Download and Symbolize OSM Data tool of ). I'm sure there must be a simple way to apply the style/symbols of the Mapnik baselayer as rendered on the OSM website (), rather than using the ArcMap defaults or manually adjusting symbology for each feature type, but I just can't figure it out.  Can someone point me to a potential solution?

From what I understand, an ArcGIS mxd file contains the "styling" information on how to show data.  I downloaded and imported OpenStreetMap data into my geodatabase. Now I need to show them.  Is there any available mxd file match the OpenStreetMap fields/values that I can use?  I check this question(), but the links are all dead.  ps: right now the all the highway/roads/trail display as a single line in my map. I want to use mxd to show them in a better way, like Mapnik or google.


I would like to create a class, call it MyClass which has three data members- a, b and c. I then wish to put many MyClass objects in to a std::Vector<MyClass> and then sort the Vector according to the a data members.  Is there an elegant way of doing this using the STL? I didn't want to re-invent the wheel and I am sure this can't be a first. In Java I guess I would use a Comparator.

If I have a vector of pairs: std::vector<std::pair<int, int> > vec;  Is there and easy way to sort the list in increasing order based on the second element of the pair? I know I can write a little function object that will do the work, but is there a way to use existing parts of the STL and std::less to do the work directly? EDIT:  I understand that I can write a separate function or class to pass to the third argument to sort.  The question is whether or not I can build it out of standard stuff.  I'd really something that looks like: std::sort(vec.begin(), vec.end(), std::something_magic<int, int, std::less>());


Where do I find the on/off symbol of electronics?

I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?


Essentially, $$\sum_{I\subset[1,n]}\pi(I)$$ where $I\subset \mathbb{N}$ and $\pi(I)$ is the product of numbers in $I$

Let $A_1, A_2, \ldots , A_{63}$ be the 63 nonempty subsets of $\{ 1,2,3,4,5,6 \}$. For each of these sets $A_i$, let $\pi(A_i)$ denote the product of all the elements in $A_i$. Then what is the value of $\pi(A_1)+\pi(A_2)+\cdots+\pi(A_{63})$?  Here is the solution   For size 1: sum of the elements, which is 21 For size 2: $ 1 \cdot (2 + 3 + 4 + 5 + 6) = 20 $, $ 2 \cdot (3 + 4 + 5 + 6) = 36 $, $ 3 \cdot (4 + 5 + 6) = 45 $, $ 4 \cdot (5 + 6) = 44 $, $ 5 \cdot 6 = 30 $. Sum is 175. For size 3: Those with least element 1:  $ 6, 8, 10, 12, 12, 15, 18, 20, 24, 30 = 155 $. Those with least element 2: $ 24, 30, 36, 40, 48, 60 = 238 $. Those with least element 3: $ 60 + 72 + 90 = 222 $. Those with least element 4: only one possible subset, which is $ \{4, 5, 6\} $, the $ \pi $ of which is 120. The total sum here is 735. For size 4: Least element 1: $ 24 + 30 + 36 + 40 + 48 + 60 + 60 + 72 + 90 + 120 = 580 $; least element 2: $ 120 + 144 + 180 + 240 + 360 = 1044 $; least element 3: only one, which is $ 3 \cdot 4 \cdot 5 \cdot 6 = 360 $. The total sum here is 1984. For size 5: Exclude each one individually to get $ 720 + 360 + 240 + 180 + 144 + 120 = 1764 $ For size 6: $ 6! = 720 $  The final answer is $ 21 + 175 + 735 + 1984 + 1764 + 720 = \boxed{5399} $  Is there any shorter way for doing this ?  Thank a lot


This thing is driving me nuts.  So I load some simple HTML via AJAX and once it's loaded on the DOM I do this.  $('#wrap a.link').click(function(e) {     e.preventDefault();     alert("asdasdad"); });   It simply does not prevent the link from navigating to the url in the href attribute.  My syntax seems right and I've made sure the element is in the DOM and that the function finds the a.link element.  $("#wrap a.link").each(function(key, value) {     console.log("found a link"); // this shows up in the console });   I have also tried using off() and stopImmediatePropagation() just in case some other event may be interfering, but nothing. I've also tried binding the event inside the each() loop with the same result.  What could be causing this behaviour?

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


Im not a scientist, so go easy on the explanation!  As I understand it we can create two entangled particles. The entangled particles have a spin property which is opposing. When we measure one of the particles for spin we get a result and we can deduce the spin direction of the unmeasured particle. All makes sense, but...  How do we know that the entangled particles didnt already have spin before being measured?

When quantum entanglement is explained in "layman's terms", it seems (to me) that the first premise, that we have to accept on faith, is that a particle doesn't have a certain property (the particle is not IN one state or another) until that property is measured.    For example, I have read that a particle may have "spin up" or "spin down" but -- here's where I get lost -- it's not that we don't KNOW which spin the particle has until we measure it, but actually the particle has NEITHER spin until we measure it.  Now, if we accept that premise, then we can see how spooky it is, when two particles are created with correlated spins -- if one has spin up, the other has spin down, but neither particle "has" either spin until one of them is measured.  At that instant, the other particle "assumes" the other spin.   At least that's how I interpret things I have read.  Certainly, if we accept that a particle doesn't actually HAVE the property until it is measured, but rather the particle exists in a superposition of states until the measurement is made, then we "regular citizens" can understand what is meant by "spooky action at a distance".  (As soon as one particle is measured, the other particle assumes the "other" spin, no matter how far away it is.  How did the second particle know the first particle was measured?  That, I think, is the spooky action at a distance (and the information transfer can be faster than light).)  However, from a layman's perspective, I want to cry out "but the particle does have a definite spin, we just don't KNOW what it is, until it is measured!  Duh!"  Now, I can't believe that all of the physics community hasn't thought of that objection -- but -- here's my point -- although the spooky action at a distance can be explained to us, once we accept the premise of superposition -- Why isn't the fact of superposition explainable also, in terms mortals can understand?  I have looked, but I haven't found a layman's explanation of why we should accept the fact that a particle doesn't have a particular spin, or other property, until it's measured.  It sure seems that the particles "have" the properties, even though we haven't measured them yet.    I know that much of quantum mechanics is not "intuitive".  If anyone can explain why particles don't have a definite property, even before we measure them, I would be grateful.


A new environment can be made with: \newenvironment{name}[1]{stuff at the beginning}{stuff at the end}  In the document the environment can be created with: \begin{name} different stuff \end{name}  Now I want to call the same environment with different names. My solution is: \newenvironment{name1}[1]{stuff1}{stuff2} \newenvironment{name2}[1]{stuff1}{stuff2} ... \newenvironment{nameN}[1]{stuff1}{stuff2}  This is pretty dirty and makes my code confusing. Do you know a better solution? Something like this would be great: \newenvironment{name1, name2,  ... , nameN}[1]{stuff1}{stuff2}

When I want to globally modify a command in my document, I will often use a duplicated version of the original in the stencil, with the help of the \let macro.  For example, if I wanted to do something every time I created a section, I might say:  \let\svsection\section \renewcommand\section[1]{\mychanges\svsection{#1}}   It just dawned on me that I don't know how or if something similar can be done for environments.  What I would hope for is something like (I'm omitting arguments for the sake of simplicity, don't focus on that):  \let\svfigure\figure \renewenvironment{figure}{\blahblah\begin{svfigure}}                          {\end{svfigure}\moreblah}   Of course, this syntax won't work because \figure isn't a command.  But, I was hoping that the creation of environment abc would always be accompanied by the creation of associated constructed commands, for example, \start@abc and \end@abc, such that these associated commands could be \let to duplicate the original environment.  I also realize that one approach may be to "patch" the original environment, but I don't think that is really what I'm asking, since I'm not sure a patch can be easily undone, whereas redoing a \let in the opposite direction (e.g., \let\section\svsection) will totally undo the effects of redefinition.  It would be a handy feature to know how to duplicate an environment, so that the original copy can be \renewed in the fashion I describe.


In a maths document I am writing on Overleaf, I want to write 'LHS' as part of a proof for something, standing for Left Hand Side, and I want it contained within the dollar signs. Do you know how to do that? Note: I don't want it in italics, as it automatically appears if I simply type it within the dollar signs. Thank you.

I am trying to find a way to make the equations that appear in this text a bit better looking... here is my suggestions:     \documentclass{article}     \usepackage{amsmath}      \begin{document}     \begin{equation}         Risk_{i,t}=c+\alpha Risk_{i,t-1}+\beta_{1}         CEO_\text{PC}_{i,t}+\beta_{2} BR\_ind_{i,t}+\beta_{k}         Z_{i,t}+\epsilon_{i,t}     \end{equation}     \end{document}  Here a caption of the equation that I'm looking for :


First off, I'm not very experienced in math techniques, so I am wide open to suggestions.  I am working with a set of data in R.  I have a curve (mostly linear at first, peaking suddenly, then decreasing.)  I want to smooth it out, so I used a spline and that achieves what I want (especially the peak of the curve "off center" from the top point). But there is a dip right below the peak that I want to avoid, as its essentially linear right there.    I kind of understand (in a non-mathematical way) why this dip has to be there, to give the curve enough time to angle upwards.  But it doesn't represent that data.  Is there any way to avoid this dip?  I've thought about graphing it as two separate lines (a linear and a curved one), but that isn't appealing.  Is there something besides a spline?  Or code I can use to get around this?  Edited to include data  Time           Fe2+ 0.04    138.8181818    7    1258.636364   14    1320.545455   21     2110.37037   28    13730.37037   35    1550.909091

First off, I'm not very experienced in math techniques, so I am wide open to suggestions.  I am working with a set of data in R.  I have a curve (mostly linear at first, peaking suddenly, then decreasing.)  I want to smooth it out, so I used a spline and that achieves what I want (especially the peak of the curve "off center" from the top point). But there is a dip right below the peak that I want to avoid, as its essentially linear right there.    I kind of understand (in a non-mathematical way) why this dip has to be there, to give the curve enough time to angle upwards.  But it doesn't represent that data.  Is there any way to avoid this dip?  I've thought about graphing it as two separate lines (a linear and a curved one), but that isn't appealing.  Is there something besides a spline?  Or code I can use to get around this?  Time          Feave 0.04    138.8181818    7    1258.636364   14    1320.545455   21     2110.37037   28    13730.37037   35    1550.909091   All I'm using is splinefun in R (so cubic)  plot(P0mM$Time,P0mM$Feave, ylab="Fe2+ uM", xlab="Time", main="0mM P", ylim=c(0,15000)) arrows(P0mM$Time, P0mM$Feave-P0mM$Festerr, P0mM$Time, P0mM$Feave+P0mM$Festerr, length=0.05, angle=90, code=3) lines(spline(P0mM$Time,P0mM$Feave,n=200))


So I just installed a virtual machine with Ubuntu 13.10. I wanted to play with apache 2.4.6 before I update my ubuntu 12.04 servers. I want my document root to be in my home folder and so I changed it in the etc/apache2/sites-available/000-default.conf  When I did that I just get the forbidden message. I set the new folder permissions to 777 but still get forbidden. I even put an index.html file in the new directory that just says hello world but nothing still. Here is my 000-default.conf file.  <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. #ServerName www.example.com  ServerAdmin webmaster@localhost DocumentRoot /home/everett/webroot  <Directory /home/everett/webroot>     Options FollowSymLinks MultiViews     AllowOverride All     Order allow,deny     allow from all </Directory>   # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn  ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined  # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf </VirtualHost>  # vim: syntax=apache ts=4 sw=4 sts=4 sr noet

After upgrading from Ubuntu 13.04 server, the www pages won't display themselves.     Error 403 Forbidden You don't have permission to access / on this server.   I've changed access control saves from apache2.2 to apache2.4, but that didn't work. What else could I do?


I am kind of beginner in C++ and I want a simple way to convert a char string (char * str1) to an integer. I am able to do that with atoi, but I have read that this function is "devil" and should not be used.  I don't want to use C++ std:string for many reasons, so my string must be in char* format. Do you have any suggestions?  Thanks in advance

What's the C++ way of parsing a string (given as char *) into an int? Robust and clear error handling is a plus (instead of ).


I have trouble with calculating the critical region of an exp distribution. I know that the critical region is the region in which H0 should be rejected in favour of H1. I also know how to calculate the critical region in an normal and uniform distribution, but exponential distribution is still difficult. problem:  We assume that X has an Exp(λ) distribution with unknown λ. We want to test H0: λ=0.2 against H1<0.2  a. Calculate the critical region with significance level: 0.05. So I have to find the region in which H0 should be rejected. If this was an normal distribution I would work with Z-scores and normalising, but this isn't probably going to work with an Exp() distribution. The answer is [14.98, ∞ ). Can I have feedback on how to visualise this and come to an answer? Ter

I have trouble with the following problem:     We assume that X has a Exp(λ)-distribution with a unknowns value of λ.   We test H0: λ=0.2 versus H1: λ < 0.2. We use X as test statistic.  a.   Calculate the critical area for alpha = 0.05 b. The measured X=10,   calculate the P-value   ans: [14.98, infinity) and p = 0.135    I know that the critical area is the collection of values for which H0 is rejected in favor of H1. In the case of a normal distribution I know how to calculate the critical region. Depending on the kind of alternate hypothesis and the significance level I can caluclate the Z-value. With the Z-value I can calculate the X.   Unfortunately I don't know how to do this with an exponential distribution. I have issues with visualising it, since a different λ gives a different curve.   Can I please get some feedback?  Thanks,  Ter


I've skipped many questions that I can answer because of lack of time. And later, I can't find those questions.  It would be helpful if there were an Answer Later feature as an option. Inside my profile would be a section with those questions visible only for me.

I think it would be useful to add an "Answer Later" tab that would be similar to the "Favorites" tab so you could mark questions to answer at a later time. There are so many times I see a question which I would like to answer but don't have time, then I have a hard time finding it again later. Right now I mark it as favorite, go back and answer it, then unmark it as favorite (unless I really like the question).  Do you think other people might find this useful? Do you do this some other way?


I know that an application is a program that you interact with on the desktop, but what exactly are processes and services?  Are services classified as processes or is it the other way round?

How are these fundamentally different "things" on Windows? Aren't all running things Processes? It seems that every Application has an associated process that shuts it down if it is shut down. It looks like one process can manage more than one application instance. And Services, I'm not even sure what they are, exactly. Are they not processes themselves?


What is the best way to center div in the middle of another element?  I have an container with with set to 100% and height to 130% of the screen but i fail to centr it int the middle ( of the container ). i tried using  div {     margin: auto;     top: 0;     bottom: 0;     right: 0;     left: 0;     position: absolute;     text-align: center;     vertical-align: middle; }   But this will just set the the content of div in the middle horizontally only , and set the width and height of the inner element to container element.  What is the best trick to achieve such thing?  is demo

Best way to center a <div> element on a page both vertically and horizontally?  I know that margin-left: auto; margin-right: auto; will center on the horizontal, but what is the best way to do it vertically, too?


I am trying to understand and use if statements more in my code.    Say there's a String called answer with the value "yes".  Imagine there is also a boolean called yesOrNo.  I want to use an if statement to set the value of yesOrNo to true or false depending on the value of answer.  When I try the code below, I get an error that reads "Type mismatch: cannot convert from String to boolean."    boolean yesOrNo = false; String answer = "yes"; if (answer = "yes") {     yesOrNo = true; }   How can I change yesOrNo's value?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I have the following formula and I want the nominator and the denominator to appear in display style. I use \everymath{\displaystyle} so I don't understand why they are not in display mode. How can I make this happen? Also why doesn't \everymath{\displaystyle} do the trick? Thanks!  C=\frac{\iint \vec{E}\epsilon\cdot \vec{dS}}{-\int_{A}^{B}\vec{E}\cdot\vec{dl}}

What is best practice for typesetting fractions with large objects in the numerator and denominator?  For example, fractions with limits, integrals, summations, etc... cause the expressions to look contracted and somewhat odd.  I understand that it is probably best to leave this as is when writing mathematics inline, but as a stand-alone fraction I feel it would be much less distracting if the symbols were typeset at normal size and the fraction was given more height in which to place itself.  Are there standards (for pure mathematics) regarding this problem? And what are the options - if it's generally permitted - for expanding the fraction size to incorporate large objects?    Example  \frac{\sum_{i=0}^{n} i^2}{\iint_{D}\frac{\partial (x,y)}{\partial (u,v)}\,\mathrm{d}u\,\mathrm{d}v}   Both the summation and the integral look somewhat cramped.


I notice that I can add a tag which doesn't exist on Stack Overflow to my favorite tags. What happens when I do this? Does it mean I have created a new tag? But I don't have the privilege to create a new tag.

I noticed today that I can add a tag to my "favorite tag" list that does not yet exist.  I then went to ask a question using that tag and was told I do not yet have enough rep to create new tags.    So my question is this:    If someone else creates that same tag, do I get any credit for coming up with it first (as shown by the fact that I listed it in my favorite tag list), or is the fact that it appears in my favorite list, even though it doesn't yet exist, just a placeholder for when it does.


To calculcate tension in a rotating ring (about its own axis) the usual approach is to consider an element of angle $d\theta$ and consider the tension forces acting on it but isn't an element of circle taken to be a straight line? But in that case the tension forces would cancel out and the ring wouln't be able to rotate. So are we taking elements such that forces do not cancel? That seems to be a biased approach to me.

Suppose i have a hollow ring and i take it in some place where there is no gravity and there is no air. Then i just start to rotate it and then because of it's inertia it will continue rotating and won't ever stop because there is no friction.   Question - Suppose i take a point on it of mass $dm$ and i see that it is also rotating around the COM of course. Which force is really providing it the centripetal acceleration? It can't be tension because the tension by the adjoining masses on will cancel out. Then what force is it?


If I put something in the bag of holding and get attacked, and drop it, so it's laying half in and half out of the bag.. what happens to the item?   Meaning if I'm putting a long piece of lumber inside the bag of holding, and drop it before I finish putting the lumber inside, does the lumber get bisected? Or does it just hang out there. Is there a spot in the center not in the portal, but not out of it?

If you have an item that is larger than the space inside a , or if the item has dimensions (for the sake of the question, say it is largely L-shaped) that would prevent it all from fitting through the opening of the bag of holding, can it still fit partially inside the extradimensional space inside this wondrous item?


I would like to calculate the confidence interval for my autocorrelation function. Does this calculation differ in any way from the normal way of calculating confidence intervals? How would I calculate the CF for cross correlation between two time series?  Thank you for any help =)

How do you tell if the correlations at different lags obtained from the cross-correlation (ccf function) of two time series are significant.


In English there are some words which just refer to men, like Sir, or just refer to women, like Madam. Does flight attendant refer to women, men or both?

When I want to speak of a woman who serves food and drinks to passengers on a plane, should I use 'air hostess' or 'stewardess'? What's the difference? And when I take a plane, how should I address her?


I am running Ubuntu 16. I got this error every time I try to run the update-grub command.

I get this error whenever I try to install programs using the terminal:  home@ubuntu:~$ apt-get install myunity E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?   Also I'm unable to install updates using the terminal.


We know that standing waves are created when any wave traveling along the medium will reflect back when they reach the end. But in an open organ pipe, there is nothing to oppose the wave and reflect it back. So then how are standing waves created in such a case? In standing waves where is the pressure greater, at nodes or anti-nodes?

How can standing waves be produced in an open organ pipe even though both of its ends are open? Can someone explain with more clarity?


How can I remove the space after enumerated item and the next line in text ? I use following:  \begin{enumerate}     \setlength{\itemsep}{0pt}     \item bi-axial etc. etc.      \item uni-axial etc. etc.     \item uni-axial etc. etc.     \item uni-axial etc.  \end{enumerate} %

What is the best way to globally change the amount of vertical space between items in list environments?


I'm planning on getting into research in mathematical physics and was wondering about interesting topics I can get into and possibly make some progress on.  I'm particularity fond of abstract algebra and topology and if possible any topics that involve abstract algebra would/topology/calculus of variations would be especially appreciated  My mentor is involved in work dealing with topological field theories in regards to developments in string theory.


Let me explain..  I want to do this:  a = "somedir.somefile" b = "someclass" from a import b   Well, I want to do this to import automatic all classes inside a directory, and I don't know how many classes are there.

I'm writing a Python application that takes as a command as an argument, for example:  $ python myapp.py command1   I want the application to be extensible, that is, to be able to add new modules that implement new commands without having to change the main application source. The tree looks something like:  myapp/     __init__.py     commands/         __init__.py         command1.py         command2.py     foo.py     bar.py   So I want the application to find the available command modules at runtime and execute the appropriate one.  Python defines an __import__ function, which takes a string for a module name:     __import__(name, globals=None, locals=None, fromlist=(), level=0)      The function imports the module name, potentially using the given globals and locals to determine how to interpret the name in a package context. The fromlist gives the names of objects or submodules that should be imported from the module given by name.       Source:    So currently I have something like:  command = sys.argv[1] try:     command_module = __import__("myapp.commands.%s" % command, fromlist=["myapp.commands"]) except ImportError:     # Display error message  command_module.run()   This works just fine, I'm just wondering if there is possibly a more idiomatic way to accomplish what we are doing with this code.  Note that I specifically don't want to get in to using eggs or extension points. This is not an open-source project and I don't expect there to be "plugins". The point is to simplify the main application code and remove the need to modify it each time a new command module is added.


Let $F$ be a number field, and $\mathcal{O}$ its ring of integers. Is there always a finite set $S$ of places of $F$ such that $\mathcal{O}_S$ has class number one? Is it a consequence of standard results on class field theory or is it something else?

Let $K$ be a number field and let $R=\mathcal{O}_K$ be its ring of integers. Let $a_1, \ldots, a_h$ be ideals of $R$ generating the class group $Cl(K)$. Let $S$ denote the set of valuations corresponding to prime ideals dividing $a_1\cdots a_h$. Let  $$R_S = \{a \in K \mid v(a)\geq 0,\ v \text{ non-Archimedean valuation on } K, \  v \notin S \}$$ Silverman (p.213 Arithmetic of Elliptic Curves) claims that $R_S$ has trivial class group. I’m sure this is a standard and simple fact, but I’m having trouble proving it.   We have an inclusion $R \to R_S$ and a map $Cl(R) \to Cl(R_S)$. Let $I$ be an ideal of $R_S$, we want to show it is principal. We have $I \cap R \equiv \prod a_i^{e_i}$ in the class group so there exists principal ideal $P,P’$ of $R$ such that  $$P(I\cap R) = P’ \prod a_i^{e_i}$$ $$P(I\cap R)R_S = P’ \prod a_i^{e_i}R_S$$  Got stuck. Somehow the $a_iR_S$ become principal in $R_S$. I know  $$R=\bigcap\limits_\mathfrak{p} R_\mathfrak{p}$$ $$R_S=\bigcap\limits_{\mathfrak{p} \notin S} R_\mathfrak{p}$$ Where $\mathfrak{p}$ ranges over all maximal ideals of $R$


I use Firefox first-party isolate and UBlock Origin with fairly strong settings (no third-party JS except allow-listed domains, etc.) and the new cookie nag:  has buttons that do not work at all. Presumably the settings are being outsourced to some third-party, which is itself something of a privacy concern. But it's frustrating that the UI element itself is local and displayed even with these third-party domains not allowed, while the interactivity isn't, making it impossible to dismiss without debugging it. So far I've just been blocking the whole thing with the element picker on SE sites I hit it on, but it would be nice if it just worked without relying on third-party domains or if it indicated the domains you need to unblock to make it work (and disclosed that SE is outsourcing this).

Recently, every time I hit a new page in stackexchange, whether it be the list of questions in a given forum, or a specific question, I am getting a pop-up like this:   Your privacy By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. Accept all cookies Customize settings  I am able to click "accept" and it will go away, but it comes back as soon as I reload the page or view a new topic.  UMatrix shows it's a script from cdn.cookielaw.org and that it's trying to set a 3rd-party cookie. My guess is that since I'm blocking 3rd-party cookies and scripts, it just keeps trying. Given how bad we know 3rd-party cookies are, and how they are used to violate privacy, track people across sites, etc., why on Earth would Stack Exchange do this?


Why is step response so important? for finding properties of a system we use step response of a system why we don't use other basic signals such as impulse or ramp? thanks for your responses.

Whenever I am given a system type with a certain transfer function, I am always asked to proceed to find out the 1. impulse response and 2. step response of the system. My question is, what is so special about these two response types that other responses, like for example parabolic response, is not what I am asked to find out?


Aluffi III.2.6 suggests proving the following:     Let $\alpha : R \rightarrow S$ be a fixed ring homomorphism, and let $s \in S$ be an element commuting with $\alpha(r)$ for all $r \in R$. Then there is a unique ring homomorphism $\overline \alpha : R[x] \rightarrow S$ extending $\alpha$ and sending $x$ to $s$.   I've managed to prove this by postulating the behaviour of $\overline \alpha$ on zero-degree polynomials (which coincide with $R$, thus $\overline \alpha$ coincides with $\alpha$ on those) and on $x$, then using the ring homomorphism properties to show that the whole $\overline \alpha$ is uniquely determined to prove its uniqueness, and then showing that $\overline \alpha$ indeed satisfies the homomorphism requirements (thus it's a well-defined homomorphism).  But this whole construction looks awfully lot like proving $\mathbb{Z}[x_1, \dots, x_n]$ satisfies the corresponding universal property in the corresponding category. Could I somehow reduce the original claim to the latter construction?

On page 151 of Paolo Aluffi's Algebra: Chapter 0, an important property of the polynomial ring $\mathbb{Z}[x_1, \cdots, x_n]$ is introduced, namely that it's initial in the category of set functions from a fixed $n$-element set $A$ to commutative rings. (Or, to put it another way, a set function $f: A \to R$ with $R$ an arbitrary commutative ring factors uniquely through $\mathbb{Z}[x_1, \cdots, x_n]$.)  After establishing this property, two examples are given; the first, a special case when $n=1$, proves the existence of a unique ring homomorphism $\mathbb{Z}[x] \to S$ sending $x$ to an element $s \in S$ and extending the unique homomorphism from $\mathbb{Z} \to S$. So far so good.  The author then goes on to give a second example:     Let $a : R \to S$ be a fixed ring homomorphism, and   let $s \in S$ be an element commuting with $a(r)$ for all $r \in R$. Then there is a unique   ring homomorphism $\bar{a} : R[x] \to S$ extending $a$ and sending $x$ to $s$.   It is an exercise to provide the details of this construction. It's not hard to show what this map must be and prove that it's unique by "naive" methods, but, given its placement and the pedagogical bent of the text in general, I assume that there's a slicker way to define this map based solely on categorial considerations.   So: does this "extension homomorphism" satisfy a universal property?  (I've thought vaguely about this question for a little while but didn't hit upon anything; hints or full explanations would be much appreciated.)


A source is emitting photons towards all directions. An observer sitting at millions of light years away can receive the photon from all the places. There will be infinite directions from where the photons can be observed. Is it possible if the source is emitting photons towards infinite (not huge) directions?

It would seem that far-away stars are at such a distance that I should be able to take a step to the side and not have the star's photons hit my eye. How do stars release so many photons to fill in such great angular distances?


I have data in which I observe the following pattern: Variable A correlates with variable C Variable B correlates with variable C BUT variable A and B do not correlate with each other, even though they are theoretically very similar.  What could cause this? Variable C causing the other 2 is very unlikely theoretically.  Thank you!

I know empirically that is the case.  I have just developed models that run into this conundrum.  I also suspect it is not necessarily a yes/no answer. I mean by that if both A and B are correlated with C, this may have some implication regarding the correlation between A and B.  But, this implication may be weak.  It may be just a sign direction and nothing else.    Here is what I mean...  Let's say A and B both have a 0.5 correlation with C.  Given that, the correlation between A and B could well be 1.0.  I think it also could be 0.5 or even lower.  But, I think it is unlikely that it would be negative.  Do you agree with that?    Also, is there an implication if you are considering the standard Pearson Correlation Coefficient or instead the Spearman (rank) Correlation Coefficient?  My recent empirical observations were associated with the Spearman Correlation Coefficient.


I was playing a round of firestarter, on the day 3, full team We did it all stealthily and burned the money.  One guy started to sawing the boxes but next thing I knew all the boxes popped open.  One of the guys claims that in mastermind there is a hidden skill that makes unlocking one box opens all the others.  Is it actually a skill or was it a glitch or something?

I was hopping between random servers on Crime.Net looking for interesting heists.  I happened upon a bank heist and joined in.  Once we had drilled into the vault, I discovered that every deposit box was already open.  What could have caused this?  Was I playing on a hacked server?  I doubt it was an accident, since after completing that heist we went to Jewelry Store and all of the safes were open from the start of the mission.


If the earth stopped orbiting the sun, it would be pulled by the Sun's gravity and fall into it. How much time it will take is tricky as force is inversely proportional to square of distance. So I have solved this problem using calculus. See my solution in this picture. My solution gives the right answer, but have I set up it the right way? And are my assumptions right?

The Earth orbits around the Sun because it has angular momentum. If we stopped the Earth in orbit and then let it fall straight towards the Sun, how long would it take to reach the Sun in seconds?  Details and assumptions  The mass of the sun is 2*10^30 Kg. The mass of the earth is 6*10^24 Kg. The earth is 149,600,000 Km from the Sun. You may treat the Earth and Sun as point masses.


I'm new to Linux and have recently started working on my very first (very simple) project - a morse code generator. I've been able to get the translation working, and now I want to take the next step.   What would be the best way to go about replacing the character "." with a beep and "-" with a slightly longer beep? I would like to be able to actually produce audible morse code.  Which way would you more advanced users go about doing this? If you have any ideas, please explain in as simple terms as you can.  NOTE: My code is here on pastebin: .  echo echo "What would you like to translate today?" read transmission clear echo $transmission | sed 's/.\{1\}/& /g' | sed 's/a/.-/g; s/b/-.../g; s/c/-.-./g;

Using bash, how can I make the pc speaker beep?  Something like echo 'beepsound' > /dev/pcspkr would be nice.


Is there a way of confirming that the file attributes of a document are correct/genuine.  For example, the date created, modified etc.

Due to some court cases in my jurisdiction, I often see court-appointed experts determining the creation date of a document. Is it really possible to do this via software methods? How could one prove a creation date if a fake date was used before the document was created?  I know this part doesn't belong to superuser but anyhow I was also curious if any hardware methodology would work (to any precision - day/month/year).


We are 100% remote, meaning no office. Currently I have an IP filter that blocks the IP of every single team member but this is not manageable since A) It's a pain to get everyone to send me their IP address B) It's messy to setup, C) An IP address can change and D) Several team members, including myself, tend to have different working spots during the day.  Also we've thought about using browser extensions but not everyone uses Google Chrome, some use Safari, others Edge...  What's the best way to block internal traffic for a remote team?

I have integrated Google Sites website with Google Analytics and I access the website frequently to add more content. I want Google Analytics to track visits from real visitors only. How can I configure it to exclude or filter out my visits?


Here's my problem: I'm writing some mathematics lecture notes. I needed some different theorem types, such as propositions, lemmas, plus observations, examples and definitions whose numbering depends on theorems. Plus, I'm Italian, and wanted custom output labels for those. So I declared them as follows (found that solution probably here on StackExchange, even if I can't find the question right now).  \theoremstyle{plain} \newtheorem{thm}{Teorema}[chapter]  \theoremstyle{definition} \newtheorem{defn}[thm]{Definizione} \newtheorem{exmp}[thm]{Esempio} \newtheorem{obs}[thm]{Osservazione} \newtheorem{prop}[thm]{Proposizione} \newtheorem{lemmy}[thm]{Lemma}   However, right now, I get some problems with their numbering when using both the hyperref and cleveref packages. I want to use those to refer to a Proposition or such made somewhere before, such that I can be automatically redirected to where it is written by clicking on it, but with the link label automatically presenting the theorem type (Lemma, Osservazione and such), and eventually changing automatically if I decide to rename Lemma to, say, Short Theorem. I made a short example:  \documentclass[twoside]{book} \usepackage{amsthm} \usepackage{cleveref} \usepackage{hyperref}   \usepackage{mathtools}  \theoremstyle{plain} \newtheorem{thm}{Teorema}[chapter]  \theoremstyle{definition} \newtheorem{lemma}[thm]{Lemma}  \begin{document} \chapter{Chapter} \begin{lemma} \label{foo}Proposition here \end{lemma}  As stated in \hyperref[foo]{ \cref*{foo}}  \end{document}   Even if I replace \cref with \ref here, not actually using cleveref, I get the error anyway, so it depends just on the packages declaration.  The error I get is the following:  ! LaTeX Error: No counter 'l' defined   If I replace "lemma" with "observation" I get the same error with counter 'o', and so on. Practically, it sees the first letter of the name of the theorem type I have declared as the counter, or something similar. Has anyone got any clue on how to get rid of this conflict?

The hyperref documentation says: "Make sure it comes last of your loaded packages". The reason is that it redefines many LaTeX commands. It's a rule of thumb that helps to avoid errors.  However, there are exceptions, for instance the amsrefs user's guide notes that amsrefs has to be loaded after hyperref.  To avoid problems when adding hypertext functionality: do you know further such exceptions?


I have seen questions like this, but all relate to either the operating system itself or the java version of minecraft. I tried looking for the files myself, but I never figured it out.

I have searched in %appdata%, pulling up the list of files there, but there is no file labelled .minecraft. Searching %appdata%\.minecraft returns "no results found".   I also opened Minecraft to click on the resources button and could not locate that either.


I have an iPad 4th Gen that I could not have used for a few weeks already.  The iCloud overlay that says "you have not backed up for 35 weeks..." is covering up the whole screen, and the "OK" button is not responding at all.  If I press and hold the power button on the iPad for 5 seconds, the screen will show the "Slide and power off" widget, but the iCloud overlay is covering up the screen (transparently), and I cannot slide that power off widget at all to power off.  I think it was due to some race condition of the notifications / iCloud so that there is some error that prevents the iCloud overlay from closing and so I cannot do anything to the iPad.  It has been at least 8 weeks I can't use this iPad.  It was about 70% charged several weeks ago, and now it is down to 30%.  I set the screen to turn off automatically really quickly, so it is using power very slowly.  I was hoping to let the battery drain so that it will force itself to power down.  But there is still 30% and that means 4 more weeks or so.  I even tried to wrap the whole iPad around plastic bag first and then wrap aluminum foil around the whole thing, because in physics, it is said that the electromagnetic wave will not be able to pass through this way, and I was hoping to drain the iPad off power due to it trying hard to connect to WiFi.  But I did it for 24 hours already, and the power stayed at 30%.  One way might also be to put the iPad in the refrigerator, because I noticed that if it is an iPhone, during skiing, it became so cold that the battery dropped from 50% and to 20% and to power off in a few hours.  But I also don't want to damage the iPad if it is in really low temperature and the other reason is that it seems really stupid to power off the iPad by putting it into the fridge.  Is there a way to solve this?

I understand that when I press and release the power button on the top of my iPhone or iPad, it stays on but turns off the screen.  Whereas if I press and hold the power button, a "slide to turn off" control appears on the screen.  Sliding this, as I was told, does turn the unit off, but it does so by suspending the RAM to disk (flash memory, actually.) So, when turning on the iPhone or iPad, it isn't so much rebooting the OS as it is resuming it from flash storage.  How to force the OS to completely reboot on these devices?


Previously my host provider gave an option of setting up rewrite rules in apache configuration files. At that time below rule worked fine.  # Non WWW URLs to WWW URLs RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^(.*)$ http://www.example.com$1 [R=301,L]   Right now I am moving all these rules to .htaccess and in every redirect, it adds the document root like /var/www/sites... in URL.  Why is this behaving differently ?

This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.


I'm new to classes in php and have the following scenario:  whilst working on a larger framework than I'm used to I would like to use a version number for class names stored in a variable declared at the top of a script. Meaning i have tried the following using eval:  <?php   $Version = '001';  class Foo001{     public function bar(){         global $Version;         echo 'Version = '. $Version;         //Just so i can see its working     }    }   class Similar extends eval('Foo'.$Version) {     public funtion blah(){             // etc...      }  }   $Sim = new Similar;  $Sim->bar(); ?>   Thought this would be an eval case but obviously it didn't work, cannot find anything on google or a specific post on SO to help.   I have used the {$blah} method for other scenarios and call_user_func etc but have never needed to do this before.  Is this possible or am i just not able to do this?

Is something like the following possible in PHP?  $blah = 'foo1';  class foo2 extends $blah {     //... }  class foo1 {     //... }   This gives an error.  I want to dynamically set $blah so I can extend whatever class I want.  Edit: The reason for wanting to do this because I wanted to use a function out of another class in a related class. In the end it would have been something like:  Final extends foo1 extends foo2 extends foo3 extends foo4 extends parent { ... }   In the end I decided to instantiate the other class within the class and use it. Not the best options because they both you 2 of the same classes, but this won't be used that often, so it will work for now.


Why are principal components in PCA mutually orthogonal? I know that PCA can be calculated by eig(cov(X)), where X is centered. But I do not see why the eigenvectors should be orthogonal.

I am trying to understand some descriptions of PCA (the first two are from Wikipedia), emphasis added:     Principal components are guaranteed to be independent only if the data set is jointly normally distributed.   Is the independence of principal components very important? How can I understand this description?     PCA is sensitive to the relative scaling of the original variables.     What does 'scaling' mean there? Normalization of different dimensions?     The transformation is defined in such a way that the first principal component has the largest possible variance and each succeeding component in turn has the highest variance under the constraint that it be orthogonal to the preceding components.   Can you explain this constraint?


How can I prove that $$\int_{0}^{1} \ln x \ln(1-x)dx = 2-\frac{\pi^2}{6}$$  I could not find an antiderivative for $f(x)=\ln x  \ln(1-x)$. I was thinking to add a parameter but did not see a useful place where to add it. Any further suggestions?

Evaluate the integral,   $$ \int_{0}^{1} \ln(x)\ln(1-x)\,dx$$   I solved this problem, by writing power series and then calculating the series and found the answer to be $ 2 -\zeta(2) $, but I don't think that it is best solution to this problem.   I want to know if it can be solved by any other nice/elegant method.


I have gone through a lot of google results. Let me explain what I have tried first. I am currently working on a corporate laptop. Mac OS Mojave 10.14.6. Error that I get: sudo: /etc/sudoers is world writable sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin  ls -le /etc -rwxrwxrwx   1 root      wheel            179 Aug 18  2018 shells drwxrwxrwx   4 root      wheel            128 Aug 18  2018 snmp drwxrwxrwx   5 root      wheel            160 Nov 11  2019 ssh drwxrwxrwx   6 root      wheel            192 Nov 11  2019 ssl -rwxrwxrwx   1 root      wheel            257 Aug 18  2018 sudo_lecture -rwxrwxrwx   1 root      wheel           1630 Mar 11 11:51 sudoers drwxrwxrwx   2 root      wheel             64 Aug 18  2018 sudoers.d drwxrwxrwx   4 root      admin            128 Dec 25  2018 symantec -rw-rw-rw-@  1 01244861  wheel             47 Feb  2 18:13 sysctl.conf -rwxrwxrwx   1 root      wheel             96 Aug 21  2018 syslog.conf -rwxrwxrwx   1 root      wheel           1316 Aug 18  2018 ttys drwxrwxrwx   6 root      wheel            192 Aug 18  2018 wfs -rwxrwxrwx   1 root      wheel              0 Aug 18  2018 xtab -rwxrwxrwx   1 root      wheel            126 Aug 18  2018 zprofile -rwxrwxrwx   1 root      wheel            207 Aug 18  2018 zshrc  I have changed permission using chmod 440 /etc/sudoers and chmod 777 /etc/sudoers and also using info and manually updating from the file properties.  I am using iTerm2 as my terminal. echo $PATH /Users/01244861/.yarn/bin:/Users/01244861/.nvm/versions/node/v10.13.0/bin:/usr/local/opt/node@10/bin:/usr/local/opt/node@10/bin:/usr/local/opt/node@10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/go/bin  echo $SHELL /bin/zsh  My user permissions:  Is there anything else that I can do to fix this? Thanks

To run programs as sudo without password, I edited /etc/sudoers with wrong content.   Then I re-edited it with Mac's default text editor(course sudo cannot be used when /etc/sudoers is wrong).  I tried to run sudo agin, and get this error:   sudo: /etc/sudoers is owned by uid 501, should be 0 sudo: no valid sudoers sources found, quitting   What should I do? I cannot remember the root password (maybe I haven't ever set root password before).


I'm given that $f:\mathbb{R} \to \mathbb{R}$ is twice differentiable and $f(0) = f'(0) =1$.  Assuming that $f''(x) > f(x)$ everywhere show that $f(x) > 0$ for all $x$.  I know that $f$ and $f’$  are continuous ($f’’$ exists). Since $f(0) =  f’(0)= 1$ there is some $\delta > 0$ where $f(x), f’(x) > 0$ for $-\delta \leq x \leq \delta$. I tried using the second-order Taylor approximation to extend the interval but I cannot see how to show $f(x) > 0$ for all $x < -\delta$.

Let $f:[0,\infty) \to \mathbb R$ be a twice differentiable function, such that  $\,f''(x) \ge f(x)$, for all $x\in\ [0,\infty)$, and $ f(0)=f'(0)=1$. Can we deduce that $f$ is increasing?   I feel like it is, but I cannot see it. I can only show that to get it increasing it is enough to show that $f$ is non negative .


i'm someone who is very interested in games and want to be able to make them myself. I researched some things and i've started learning c++ because i thought that would be the best language to go with...  Now like i said i've started learning c++ and by that i mean i'm reading at this point this book : -Beginning c++ through Game Programming Third Edition- but my question to you guys is, what books should i read next to be able to make games, i mean the normal c++ books (if the knowledge i have from this book , what it probarly is, isn't enought) and game developement books?  Yes i know there has been a simular question :  but i ask something different, these books are good for the basic c++ but i want books wich can guide me to be a game developer...

This question attempts to collect the few pearls among the dozens of bad C++ books that are published every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a well-written C++ book. It is way too big and complex for doing this. In fact, it is so big and complex, that there are very many very bad C++ books out there. And we are not talking about bad style, but things like sporting glaringly obvious factual errors and promoting abysmally bad programming styles. Please edit the accepted answer to provide quality books and an approximate skill level — preferably after discussing your addition in . (The regulars might mercilessly undo your work if they disagree with a recommendation.) Add a short blurb/description about each book that you have personally read/benefited from. Feel free to debate quality, headings, etc. Books that meet the criteria will be added to the list.  Books that have reviews by the Association of C and C++ Users (ACCU) have links to the review. *Note: FAQs and other resources can be found in the  and under .


I would like some clarity around the following  (apologies in advance if this is a stupid question)  Am working on some existing code which calls a WCF service.  This code instantiates a WCF service client via an interface and performs the operations it needs i.e.:      IWCFService proxyClient = new WCFServiceClient()   However what am trying to do here is ensure the connection is closed gracefully i.e.: proxyClient.Close()  etc but I cant access these seeing as its created via an interface (which just houses the operations i.e.: DoSomething())  If i instantiate as a WCF service client (and not via interface) i will be able to access the Close() & Abort calls which i can use in try{}catch{} blocks. i.e.:  WCFServiceClient proxyClient = new WCFServiceClient()  //do some stuff.. proxyClient.Close()   Is it a simple case of adding Close() & Abort() to the interface definition and then calling these in the code which should in turn implement the WCF implementations of these?

I like instantiating my WCF service clients within a using block as it's pretty much the standard way to use resources that implement IDisposable: using (var client = new SomeWCFServiceClient())  {     //Do something with the client  }  But, as noted in , wrapping a WCF client in a using block could mask any errors that result in the client being left in a faulted state (like a timeout or communication problem). Long story short, when Dispose() is called, the client's Close() method fires, but throws an error because it's in a faulted state. The original exception is then masked by the second exception. Not good. The suggested workaround in the MSDN article is to completely avoid using a using block, and to instead instantiate your clients and use them something like this: try {     ...     client.Close(); } catch (CommunicationException e) {     ...     client.Abort(); } catch (TimeoutException e) {     ...     client.Abort(); } catch (Exception e) {     ...     client.Abort();     throw; }  Compared to the using block, I think that's ugly. And a lot of code to write each time you need a client. Luckily, I found a few other workarounds, such as this one on the (now defunct) IServiceOriented blog. You start with: public delegate void UseServiceDelegate<T>(T proxy);   public static class Service<T>  {      public static ChannelFactory<T> _channelFactory = new ChannelFactory<T>("");           public static void Use(UseServiceDelegate<T> codeBlock)      {          IClientChannel proxy = (IClientChannel)_channelFactory.CreateChannel();          bool success = false;          try          {              codeBlock((T)proxy);              proxy.Close();              success = true;          }          finally          {              if (!success)              {                  proxy.Abort();              }          }       }  }   Which then allows: Service<IOrderService>.Use(orderService =>  {      orderService.PlaceOrder(request);  });   That's not bad, but I don't think it's as expressive and easily understandable as the using block. The workaround I'm currently trying to use I first read about on . Basically, you override the client's Dispose() method wherever you use it. Something like: public partial class SomeWCFServiceClient : IDisposable {     void IDisposable.Dispose()      {         if (this.State == CommunicationState.Faulted)          {             this.Abort();         }          else          {             this.Close();         }     } }  This appears to be able to allow the using block again without the danger of masking a faulted state exception. So, are there any other gotchas I have to look out for using these workarounds? Has anybody come up with anything better?


Kdenlive's website . The command I used is   flatpak --user install flathub org.kde.kdenlive  which give this error on Ubuntu 18.04  error: Remote "flathub" not found  I have installed Flatpak previously and don't know what went wrong. Do you?

If you go to the kdenlive download page:   Under      Ubuntu | LinuxMint | Elementary   It reads:     It is recommended to download the AppImage version until the release   of Ubuntu 18.04.   Ubuntu 18.04 has been released. What is the best way to get it installed?


I'm planning to convert my "mechanical" bike into an E-bike for riding long distances to work, and I would like to buy only the motor kit since I already have the bike. I can see that I have two options for motor kits: central axis motor and wheel motor (see pictures)   vs   Intuitively, I think the wheel motor is more practical and better since I can keep the gears from the original bike. It's also easier to install/remove. The central axis motor involves more mechanical work and the front gears would vanish, but it is a bit more hidden, so to say.  I can find the same engine power for both options, but I can't figure out which one should I get and I would like to hear your opinion about this. Which one should I go for and why? What are the drawbacks of one and the advantages of the other?  Thank you!

I am 90% sure that I will buy an e-bike. Today one of my friends who owns an ebike strongly suggested that I should buy one with center motor, because they are more efficient and battery life will be longer.   Where I live ebikes with  costs three times more than ebikes I found .   Will it worth to buy a center motor ebike even it is more expensive?


GRUB DEFAULT =0 GRUB TIMEOUT =5 GRUB DISTRIBUTOR= 'LSB RELEASE -i - s 2> /dev/null | | echo Debian' GRUB_CMDLINE LINUX_DEFAULT ="quiet" GRUB_CMDLINE_LINUX=" "   which OS will boot by default What setting would you use if i wanted to boot the 3rd OS by default can someone also explain what the significance of the line GRUB_TIMEOUT=5 and what would happen if i completely omitted this line from the configuration file.

In Ubuntu 12.04 (or above), how do I set the GRUB time and the default OS (that I see at boot time) as I'm dual-booting Windows (7/8) and Ubuntu (12.04 or above)?


I saw  (link at bottom), and at around 10:10 they talk about writing numbers in the language of first-order set theory. For example, to write $0$, it showed the empty set: $$\exists x_1\neg\exists x_2(x_2\in x_1)$$ And to write $1$, it said: $$\exists x_1\forall x_2(x_2\in x_1\leftrightarrow(\neg\exists x_3(x_3\in x_2)\vee\forall x_3(x_3\in x_2\leftrightarrow\neg\exists x_4(x_4\in x_3))))$$  Edit: An answer has corrected this and showed that the above formula is for $2$, not $1$. I have left the above as this is what the video showed.  The video then alluded to writing other numbers, saying that it takes less symbols as the numbers get larger. This made me curious and I wanted to find out more about this topic. I have done research and tried to find how to write other numbers in the language of first-order set theory, but I haven't been able to find anything.  Question Does anyone know any resources/websites with information on how to write numbers in the language of first-order set theory? I have searched the internet many times but I haven't been able to find this.  Or is it just that there are no websites about this because there is no use for them and nobody really cares about them? Thanks. Numberphile video-The Daddy of Big Numbers (Rayo's Number)-Numberphile

I know that it is possible to represent each natural number using the concept of successor. But how do you assign meanings into the representation? I mean, when presented as a set, it's just a set unless we agree on some definition that some form of sets refer to natural numbers. Or is it something impossible at ZFC?  Thanks.


I've been looking into removing my Facebook (my only login) from my Stack Exchange networks accounts. I believe I've got a vague understanding of the correct way to do this from poking around, but I haven't been able to confirm this via the questions/answers I've looked at.  If I understand correctly, I need to do the following:   Create a new Stack Exchange account Link this as a login to my current account Remove Facebook from my list of logins   Will this have any ill effect? Will my sign-up date be shown differently, rep be affected, display name change, etc?

I no longer use the service that I originally used to register, and would like to change the service I use to log in, or at least add a second account.  Is this possible? How do I change my login provider or associate a backup method to log in?     For more information, see "" in the .


Does anyone know of ways to check the seat capacity or number of tickets sold or number of passengers onboard for past flights? I'm actually just trying to figure out how many passengers were on a specific flight, not the names of the passengers, just the number of passengers.

I almost always seem to be traveling on full flights. So almost never have the luxury to be able to change seats or even rows.  Is there any way to find out beforehand if a specific flight is on average not fully booked?  I am looking for an average load factor on a specific route.


We all know this old well-known idiom of lazy-init singleton:  public class Singleton {     private static volatile Singleton instance;      private Singleton()     {         // init...     }      public static Singleton getInstance()     {         if (instance == null) {             synchronized (Singleton.class) {                 if (instance == null) {                     instance = new Singleton();                 }             }         }          return instance;     } }   However, the following idiom is also lazy, by nature, because the instance will be init only when the class is first accessed, handled by the class loader:  public class Singleton {     private static final Singleton instance = new Singleton();      private Singleton()     {         // init..     }      public static Singleton getInstance()     {         return instance;     } }   So the question is, why would we want to use the first example and not the second? (not referring to the fact that it's better to use frameworks such as spring for managing your objects' life cycle..)  Even if you hold a reference to the singleton in another class, like this:  public class Holder {    private int member1;    private int member2;    private Singleton myService = Singleton.getInstance();  }   The singleton will be created when the Holder class is loaded, regardless of which approach we take  Any insights? thanks

What is an efficient way to implement a singleton pattern in Java?


My question is pretty much the same as my title.  "What were the planets destroyed in "Star Wars: Episode VII: The Force Awakens?"  I ask as I felt the republic planets destroyed didn't really hold much weight in the film and not a lot of light was cast on their importance. E.g. There was no mention of it it by Leia or to Leia or around Leia. In the film Leia has a force reaction at the final event with Kylo Ren and Han Solo on the bridge however she doesn't seem to be grieving or even effected by "the great disturbance in the Force, as if millions of voices suddenly cried out in terror and were suddenly silenced".  It has been stated that save for Hosnian Prime the planets are unnamed. However can anyone speculate as to the importance of the other 4 destroyed planets and if they were not planets such as Naboo or prequel republic based planets.

In The Force Awakens we see a powerful weapon capable of immense destruction. When it's activated, we see       five or so planets and a sun that are   enemies of the First Order destroyed.  Is there a verified list of the targets by name?   I'm not asking for merely the most publicized target.


I have data as shown below. I want to convert it to a single line for each part (starting with #).  I want it as:  #6536  -  NEW [R]  -  *NONE*.   communicationFailureEvent  -  SITE  -  MSC_MR1_B02_KBN1(55/JANPAT4-1/D311-CE/DEL-ODM_L): 55 SITE  -  15/04/2018  11:21:55.   [0]  Last RSL Link Failure   -  FMIC  -  Critical -/-.   Config Tag 1  #7811  -  NEW [R]  -  *NONE*.   communicationFailureEvent  -  SITE  -  MSC_MR1_B17_KB3(8/PNB_3G/D323-CE/DEL-IBM_L): 8 SITE  -  25/04/2018  15:52:04.   [0]  Last RSL Link Failure   -  FMIC  -  Critical -/-.   Config Tag 3ed1  #5569  -  NEW [R]  -  *NONE*.   communicationFailureEvent  -  SITE  -  MSC_MR1_B22_GZBD2(49/TRISHUL-APT_3G/D441-GZ/GZB): 49 SITE  -  23/06/2018  08:28:54.   [0]  Last RSL Link Failure   -  FMIC  -  Critical -/-.   Config Tag 86d217  #3369  -  NEW [R]  -  *NONE*.   communicationFailureEvent  -  SITE  -  MSC_KB1_B13_KB2(19/KIRTI-NAGAR_3G/D342-EA/DEL): 19 SITE  -  30/06/2018  11:06:41.   [0]  Last RSL Link Failure   -  FMIC  -  Critical -/-.   Config Tag 82cb8c  #1641  -  NEW [R]  -  *NONE*.   communicationFailureEvent  -  SITE  -  MSC_KB1_B06_KB1(27/MOTINAGAR-NW_3G/D342-EA/DEL): 27 SITE  -  30/06/2018  12:08:59.   [0]  Last RSL Link Failure   -  FMIC  -  Critical -/-.   Config Tag 8540f6 =========================================================== #6536 NEW [R]   *NONE*. communicationFailureEvent SITE   MSC_MR1_B02_KBN1(55/JANPAT4-1/D311-CE/DEL-ODM_L): 55 SITE 15/04/2018    11:21:55. [0]  Last RSL Link Failure    FMIC    Critical -/-.   Config Tag 1


If I have a file consisting of data that looks as follows, how would I sort the data based on the numbers in the 3rd column ? The space between the first two columns are NOT tab delimited but some number of spaces. The space between the second and third column varies based on the size of the number. Also note that there are spaces within some data of the second column ( like lp25( plasmid between ( and p) while other do not have any spaces( like chromosome).   HELIX       lp25(plasmid           24437 bp    RNA     linear       29-AUG-2011 HELIX       cp9(plasmid             9586 bp    DNA     helix       29-AUG-2011 HELIX       lp28-1(plasmid         25455 bp    DNA     linear       29-AUG-2011 HELIX       chromosome            911724 bp    DNA     plasmid       29-AUG-2011

I'm facing a huge 4-columns file. I'd like to display the sorted file in stdout based on its 3rd column:   cat myFile | sort -u -k3   Is that enough to perform the trick?


I am trying to do OLS regression to identify value-added predictors of an outcome. I've chosen predictors that are all zero-order correlates of my outcome. Then I began checking assumptions for each of those predictors. A few of my predictors are skewed above a guideline of >.8, and so I have attempted to transform those with power transformations, going down the ladder for positive skew (e.g. sqrt, and then natural log). These transformations successfully reduce the skew. However, after I make a trasnformation, I check graphical representations of residuals with the transformed variable and Y, such as the normal QQ plots and the plot of fitted residuals with a lowess curve. These graphics are either unchanged, or worse. As in, the tails of the normal QQ line are still curved, and the lowess curve is much less flat.  For example, here are the plots of the nontransformed variable. Lowess curve looks good, but QQ line is curvy at tails.   And here are plots of log transformed variable. Lowess curve is no longer flat and QQ line is still curvy!   Am I supposed to continue moving down the ladder and visually checking these assumptions as I go? Are increasingly powerful transformations likely to improve my problem? Should I instead ignore the guideline of skew above .8 (Tabachnik and Fidell)?

In linear regression analysis, we analyze outliers, investigate multicollinearity, test heteroscedasticty.   The question is:  Is there any order to apply these? I mean, do we have to analyze outliers very firstly, and then examine multicollinearity? Or reverse?    Is there any rule of thumb about this?


I have a page on which there is an overlay. I'm able to get the overlay's path using current_path(). How can I get the page's path on which the overlay is loaded.  Any ideas ?  Thanks

Is it possible to get the context, like the full URL, or the containing page path, title, etc., while inside an overlay page?  For example, I have a form pop up inside an overlay, and I want to, inside that form, be able to get the context of the page that triggered the overlay popup. I can't pass any information via the URL... I'd just like to be able to do something like arg(0) for the containing page (what's faded out in the background of the overlay.  Right now, if I do arg(0), request_uri(), $_GET['q'], etc., it always returns the overlay path, like   (I want the 'path/i/want' portion of the URL, somehow).


I want to find all occurrences of a given phrase in a passage. The phrases are user inputs and cannot be predicted beforehand.  One solution is to use regex to search (findall, finditer) the phrase in the passage:  import re  phrase = "24C" passage = "24C with"  inds = [m.start() for m in re.finditer(phrase, passage)]   Then the result is  inds = [0]   Because the phrase matches the passage at index 0 and there is only one occurrence.  However, when the phrase contains characters that have special meanings in regex, things are trickier  import re  phrase = "24C (75F)" passage = "24C (75F) with"  inds = [m.start() for m in re.finditer(phrase, passage)]   Then the result is  inds = []   This is because the parentheses are interpreted specially as a regex pattern, but this is not desirable as I only want to have literal matches.   Is there anyway to enforce the phrase to be treated as string literal, not a regex pattern?

I want to use input from a user as a regex pattern for a search over some text.  It works, but how I can handle cases where user puts characters that have meaning in regex? For example, the user wants to search for Word (s): regex engine will take the (s) as a group.  I want it to treat it like a string "(s)" .  I can run replace on user input and replace the ( with \( and the ) with \) but the problem is I will need to do replace for every possible regex symbol. Do you know some better way ?


I am trying to take input from the user and insert commas after every number. For example if the user types 12345 I want the result to be 1,2,3,4,5. Could someone please help me how to resolve this issue?

I have a one-dimensional array of strings in JavaScript that I'd like to turn into a comma-separated list. Is there a simple way in garden-variety JavaScript (or jQuery) to turn that into a comma-separated list? (I know how to iterate through the array and build the string myself by concatenation if that's the only way.)


How do you get the current time in python? I have seen people get the date and time, but I only want the time as a string. For example, if the current time was 8:30, the command should output: "8:30". Also, how do you find what day of the week it is> For example, if it is Tuesday hen the output should be: 2.

What is the module/method used to get the current time?


In the movie Mother!, Jennifer Lawrence kept drinking a golden colour drink that looks like the powder she used to paint the walls in the beginning of the movie.  When she got pregnant she threw the powder in the toilet.  I wonder what does it represent?

In the film , Jennifer Lawrence's character is seen drinking some kind of yellow substance several times. She pours it from what looks like an old bottle into a glass of water, then drinks it.  What is it, and why does she drink it?  The bottle it's poured from and her drinking it can be seen briefly in this trailer.


For a small script i have to test if a server i'm trying to download a file from is available to prevent errors. I Tried pinging the server (school website), but pinging is not allowed so i wouldn't get any responses. I could try pinging google.com, but this only checks the client side of the connection. pinging also doesn't work when i'm at school because of the same reason.  Code i am using now:  import subprocess  try:     subprocess.check_output(["ping", "-n", "1", "-w", "1000", "google.com"]) except subprocess.CalledProcessError:     # Code to run when no internet connection is available     return False   I was wondering if there's another way to check server availability without using ping, but by still using python. For the solutions I was able to find only i couldn't find a way to implement it in python (by my experience)

What I'm trying to do here is get the headers of a given URL so I can determine the MIME type. I want to be able to see if http://somedomain/foo/ will return an HTML document or a JPEG image for example. Thus, I need to figure out how to send a HEAD request so that I can read the MIME type without having to download the content. Does anyone know of an easy way of doing this?


None of my pcs are respawning after hard mode my house is not damaged in any way it is exactly how I built it but it says someone wants to move in but does not move in it is not infected and there is no invasion going on. Even when no one dies the after hard mode npc won't move in.

I am currently in hard mode and during a blood moon, several of my NPCs including my guide and my healer died. it's been several in game "days" now and they have yet to respawn. Is there a way to check why they aren't respawning?   Is there a list of reasons for the NPCs to not respawn?   Edit in reponse to lunbok's answer:  1. They don't have appropriate housing - There is an in-game housing query function (changes your cursor into a ?) that lets you click on your house to see if it is still a suitable house and I clicked in every room in my house and they are all listed as "This housing is suitable" or "This housing is already occupied".  2. Their spawn conditions aren't met anymore. - This doesn't explain why my guide isn't respawning since they don't need a condition to respawn (other than having a suitable housing which the point above already prove isn't the problem).  3. There's a goblin invasion going on. - Do the invasions last that long? It has been about two reals days and a lot more in-game "days" now. As far as I can tell there shouldn't be an invasion going on.  4. It could be because you built your house in a part of the world that is now corrupted


What exactly is happening? Hers and His sound correct; but why?

I have often heard people say "x of his" or "x of mine". But since his and mine point out ownership, isn't using "of" here doubles that ownership? Wouldn't it be more appropriate to say "x of him" or "x of them" etc.?  Example:     I was a good friend of your dad's. He told me all about you`


I just want to know  "you are not really lucky."   and  "you are really not lucky."   them which one is correct in both of them. And if  both are correct then is  there any difference between them ?

If someone says "David is not really a leader", it means something like: the speaker believes that David isn't the kind of person you would think of as a without-doubt a real leader; but the speaker isn't necessarily saying that David is definitely a very poor leader.  If someone says "David is really not a leader", it means that the speaker thinks that David is definitely a very poor leader.  What analysis (grammatical, dictionary, etc?) can help me understand how this difference in meaning is created?


unencryptionKey = (-16)   # Caesar Cypher Encryption def passwordunEncrypt(encryptedMessage, key):      # We will start with an empty string as our encryptedMessage     encryptedMessage = ''   # For each symbol in the unencryptedMessage we will add an encrypted symbol into the encryptedMessage for symbol in 'encryptedMessage':     if symbol.isalpha():         num = ord(symbol)         num += unencryptionKey   When I run the above code it tells me that, in the last line, 'unencryptionKey' is undefined.  In the first line it shows exactly what 'unencryptionKey' is.  Why the error?  In the original code the term in the last line was just 'key' so I changed it as I assume they mean unencryptionKey is to be used and thought tying it to the first line would allow it to run. I tried to screenshot so the line numbers would be included but it didn't work so had to cut and paste.

What exactly are the Python scoping rules?  If I have some code:  code1 class Foo:    code2    def spam.....       code3       for code4..:        code5        x()   Where is x found?  Some possible choices include the list below:   In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop   Also there is the context during execution, when the function spam is passed somewhere else. And maybe  pass a bit differently?  There must be a simple reference or algorithm somewhere.  It's a confusing world for intermediate Python programmers.


Trying to understand how people connect a Fresnel node into Viewer node.  I saw the Viewer node apear after Fresnel , so looking for some clarification.

Where is the Viewer node located at? Blender manual says it is an Output node but it is not under output. I have blender 2.77.  Regards, Koreenium


One method in my controller returns a view which has link like http://localhost:17000/Questionnaire/CompleteQuestionnaire?GuidToken=4815823D-3BFF-487D-AEB0-BB874AE9FBDE and other method returns just link like /Questionnaire/CompleteQuestionnaire?GuidToken=4815823D-3BFF-487D-AEB0-BB874AE9FBDE  [HttpGet]     public JsonResult ShowUrlQuestionnaire(int id)     {         var questionnaire = QuestionnaireRepository.GetById(id);         var questionnaireUrl = "/Questionnaire/CompleteQuestionnaire?GuidToken=" + questionnaire.QuestionnaireId.ToString();         return Json(questionnaireUrl, "text/html", System.Text.Encoding.UTF8,                     JsonRequestBehavior.AllowGet);     }   how can I add root part of link in var questionnaireUrl ?   I tried to add this method in controller   private string GetBaseUrl()     {         var request = HttpContext.Current.Request;         var appUrl = HttpRuntime.AppDomainAppVirtualPath;          if (!string.IsNullOrWhiteSpace(appUrl)) appUrl += "/";          var baseUrl = string.Format("{0}://{1}{2}", request.Url.Scheme, request.Url.Authority, appUrl);          return baseUrl;     }   but I got error Error  1   'System.Web.HttpContextBase' does not contain a definition for 'Current' and no extension method 'Current' accepting a first argument of type 'System.Web.HttpContextBase' could be found (are you missing a using directive or an assembly reference?) How to fix it?

Unfortunately, I need to do this.  I'm using ELMAH for my error log.  Before I route to my error.aspx view, I have to grab the default ELMAH error log so I can log the exception.  You used to be able to use   Elmah.ErrorLog.Default   However, this is now marked as obsolete.  The compiler directs me to use the method  Elmah.ErrorLog.GetDefault(HttpContext context)   MVC's context is of type HttpContextBase, which enables us to mock it (YAY!).  How can we deal with MVC-unaware libraries that require the old style HttpContext?


The first postulate of Special Relativity is that the laws of physics must be the same in all frames of reference i.e. invariant of coordinate transformations. I know this might be moot to ask but after reading a critique's paper on Special Relativity, I thought the question needs to be answered.   Is there any supportive evidence which suggests so other than the evidence of common sense and intuition?   As we know common sense and intuition are easily defied in most of the physics theories like Quantum Mechanics we should not rely upon such assertions to formulate an entire theory of Universe.

Einstein's Special Relativity theory is based on the assumption that the laws of physics are invariant in all inertial frames, and from there - according to Maxwell's equations - it derives that the speed of light must be the same in all reference frames, thus the need for time dilation etc...  But how is the initial assumption justified? I have always been explained this assumption in an "intuitive" way, as a thought experiment, for example regarding the fact that sitting on a sofa feels no different than sitting in a plane. But I could have made the same thought experiment about the hypothesis that velocities always add together, so one could make light "faster" by shining a beam from the tip of a rocket...