While working with the division remainder operator % in python 2.7 I faced an unexpected behavior (at least for me) when using it with decimal denominators. Bellow an example:  >>> 0.1%0.1 0.0                 # as expected >>> 0.2%0.1 0.0                 # as expected >>> 0.3%0.1 0.09999999999999998 # what the hell? >>> 0.4%0.1 0.0                 # aw expected >>> 0.5%0.1 0.09999999999999998 # what the hell?   Why the operations 0.3%0.1 and 0.5%0.1 return the result above instead of 0.0 as in the other cases and as I was expecting?  Thanks

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


I am trying to protect my website from sql injection.  Is it OK to write:  <?php  if(isset($_GET['id'])) { $id = strip_tags(trim(mysqli_real_escape_string($userprofileobj->con,$_GET['id']))); $row = $userprofileobj->show_all($table_name,$id)->fetch_assoc(); ?>   And in insert query should I use:  strip_tags(trim(mysqli_real_escape_string($connecton, $_POST['name'])));

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


I have this code:  public int GetIntSetting(Settings setting, int nullState) {     var s = GetStringSetting(setting);     if (string.IsNullOrEmpty(s))         return nullState;     return int.Parse(s); }   If the value of s is something like 1.234 then the functions creates an exception.   How can I make it so that if the value of s has a decimal point then the function returns 0?

What is the difference between Parse() and TryParse()?  int number = int.Parse(textBoxNumber.Text);  // The Try-Parse Method int.TryParse(textBoxNumber.Text, out number);   Is there some form of error-checking like a Try-Catch Block?


I'm sitting on this for quite some time now. I just can't find an answer so it would be cool if you guys could help.  There are two classes involved, one (XMLParser) is reading from a ifstream and is deserializing objects and stores them in a local veriable. A second is holding a vector<Someclass *> objVec;, so a vector which holds pointer to objects of a specific type. I'm pulling it all together like this:  ifstream file(filename, ifstream::in); if (file.is_open()) {     XMLParser xmlParser;     file >> xmlParser;     xmlParser.fill(&objVec);     file.close(); }   XMLParser.h:  class XMLParser { private: vector<Someclass> someVec; vector<SomeOtherclass> someOtherVec; public:     template<class T> void fill(std::vector<T*> *vec);     friend std::istream &operator>>(std::istream &stream, XMLParser &ob); }; std::istream& operator>>(std::istream &stream, XMLParser &ob);   XMLParser.cpp:  std::istream& operator>>(std::istream &stream, XMLParser &ob) {     //deserialize objects from stream and store them locally     return stream; }  template <class T> void XMLParser::fill(std::vector<T*> *vec) {     //fill the vector with the right objects }   Everything is compiling well, no errors or warnings. But when its time for linking I'm getting a undefined reference to 'void XMLParser::fill<Someclass>(std::vector<SomeClass*, std::allocator<Someclass*> >*)', XMLParser.o is of course provided.  what I've tried, among other things:  including the allocator: template<class T> void fill(std::vector<T*, std::allocator<T*> > *vec) -> same error  writing a specialization for fill width Someclass: template <> void XMLParser::fill(std::vector<Someclass*> *vec) -> working! but not what I want  I've searched for some examples on the web and none of them is providing the allocator class for the template, so this doesn"t seams to be the way. The specialization is working, but does anyone know why I need to provide a specialization for every class that might come along? Is there a way around? Cause it doesn't seams to be very generic if I have to provide a specialization for every class that might be in the XML.  Thanks Martin

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


In Enrico Fermi's eyewitness account of the Trinity nuclear test in 1945, he gives a brief description of a method that he used to estimate the blast energy of the test:     About 40 seconds after the explosion the air blast reached me. I tried to estimate its strength by dropping from about six feet small pieces of paper before, during, and after the passage of the blast wave. Since, at the time, there was no wind I could observe very distinctly and actually measure the displacement of the pieces of paper that were in the process of falling while the blast was passing. The shift was about 2 1/2 meters, which, at the time, I estimated to correspond to the blast that would be produced by ten thousand tons of T.N.T. - c.f.  via wikipedia.   Given the information provided in the above statement, is it possible to derive his estimate of 10kT T.N.T equivalent?

From Wikipedia: Fermi was known for his ability to make good approximate calculations with little or no actual data, hence the name. One example is his estimate of the strength of the atomic bomb detonated at the Trinity test, based on the distance travelled by pieces of paper dropped from his hand during the blast. Fermi's estimate of 10 kilotons of TNT was remarkably close to the now-accepted value of around 20 kilotons, a difference of less than one order of magnitude.  I have not been able to find any references explaining how he made this calculation. Please provide a reference or an example calculation.  See also:


Well you know how it's said that things can't travel at or past the speed of light? However, can't they move at speeds greater than the speed of light relative to another object?   For example: What if two rocket ships that are travelling at 60% the speed of light fly past each other? Won't people on both ships perceive the other ship as travelling at a speed greater than the speed of light? If yes, does this have any significance?

I understand that nothing can move faster than light due to time dilation. I want to build upon my understanding of Einstein's theory of Special Relativity, so I came up with this hypothetical problem for myself:  If both particles are moving at 0.9c towards each other (according to an observer on Earth), what speed does each particle have relative to the other?  I'm stumped since I am only familiar with Newtonian classical mechanics to solve this (which would be wrong). I am aware of Lorentz' factor $\gamma =\frac{1}{\sqrt{1 - \frac{v^2}{c^2}}}$ and the time dilation equation $t_m = \frac{t_o}{\sqrt{1 - \frac{v^2}{c^2}}}$, but I'm not sure how to apply it in this instance. I'm just looking for a gentle push in the right direction. Edit: My prior research:  This article, ,  talks about the effect of a baseball thrown at 0.9c would have as it traveled towards a batter. This is not what I'm looking for since it doesn't explain the math behind finding the collision speed between two high velocity entities.  This question on Yahoo, , asks a similar question to mine, but no math is involved to demonstrate the calculations behind the reasoning.  This question on Physics.SE, , does not answer my question either. I have not been able to find a similar Physics.SE question which can provide me to clues to my own hypothetical question.  I have also Googled the following phrases:    i. "collision faster than the speed of light" ii. "collision of high speed particles" iii. "lorentz transformation in a collision" iv. "collision analysis at light speed"


I made myself a little tag input field but i can't access the inserted tags with jquery.  Everytime you hit enter the value of the input field will be inserted before the input as a

.  If i try to do something on click it's only working for tags that aren't inserted by the input.    $('.chip').on('click', function() {   console.log('click'); });  $('.wrap input').on('keydown', function(e) {   var key = e.which,       input = $(this),       value = input.val();     if(key === 13) {     if(value != '') {       $('
' + value + '
').insertBefore(input);       $(input).val('');     }   } }); .wrap {   box-sizing: border-box;   width: 80%;   height: 55px;   line-height: 55px;   border: 1px solid #bebebe;   border-radius: 28px;   padding: 0 .5rem;   font-size: 1rem;   font-weight: 400;   display: flex;   flex-direction: row;   align-items: center;   overflow: auto; }  .wrap .chip {   font-size: 14px;   font-weight: 300;   background: #e6e6e6;   border-radius: 20px;   height: 40px;   padding: 0 20px;   line-height: 40px;   margin-right: 5px; }  .wrap input {   box-sizing: border-box;   height: 40px;   line-height: 40px;   padding: 0 1rem;   font-size: 1rem;   font-weight: 400;   border: none;   flex: 1; }  .wrap input:focus {   outline: none; }

tag1
   <input type="text">

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.


I am having trouble understanding a line of the proof of the following theorem in Marcus's Number Fields: If $R$ is a ring of integers, then $R/I$ is finite for any nonzero ideal $I$ (this is part of the larger proof that every ring of integers is a Dedekind domain). It goes as follows:  Let $\alpha$ be a nonzero element of $I$ and $m=N^K(\alpha)$ where $K$ is the number field corresponding to $R$. We know $m\in\mathbb{Z}$ and from the definition of norm we see that $m\neq 0$. Moreover $m\in I$: From the definition of norm we have $m=\alpha\beta$ where $\beta$ is a product of conjugates of $\alpha$. These conjugates may not be in $R$, but $\beta$ is because $\beta=m/\alpha$ and it is easy to see that $\beta\in\mathbb{A}$.  My question is: Why is $\beta\in\mathbb{A}$? (note here that $\mathbb{A}$ is the set of all algebraic integers).

I am reading a book about algebraic number theory and I'm wondering whether the following statement is true:  Let $K$ be a number field and $\mathcal{O}_K$ its algebraic integers. Let $\beta \in \mathcal{O}_K$, is it true that $N(\beta)/\beta \in \mathcal{O}_K$? ($N$ is the norm of K over $\mathbb{Q}$)  If $K$ is a Galois extension of $\mathbb{Q}$ then we have that the norm is just the product of all Galois conjugates of a given element. Thus $N(\beta)/\beta$ would be the product of all Galois conjugates of $\beta$ except the one corresponding to the identity. Since Galois conjugates of an algebraic integer are also algebraic integers, the above follows.   Now I'm struggling with what happens when $K$ is only a separable extension. (separable always holds since we are in characteristic 0)


Prove the divergence of $\sum_{k=0}^{\infty}{\frac{1}{10k+1}}$. By the ratio test:$$\frac{\frac{1}{10(k+1)+1}}{\frac{1}{10k}}=\frac{10k}{10(k+1)+1}=\frac{10k}{10k+11}=\frac{10k}{k(10+\frac{11}{k})}=\frac{10}{10+\frac{11}{k}}\overset{k\to \infty}\longrightarrow 1$$ thus it diverges for almost all $k\in \mathbb{N}$  Is that correct?

$$\sum_{k=1}^{\infty} \frac{1}{5k+2}$$   Can I say that $$\sum_{k=1}^{\infty} \frac{1}{5k+2}=\sum_{k=1}\frac{1}{5k}+\sum_{k=1}^{\infty} \frac{1}{2}=\frac{1}{5}\sum_{k=1}^{\infty}\frac{1}{k}+\frac{1}{2}$$  and we know that $\\sum_{k=1}^{\infty} \frac{1}{k}$ diverges so the expression diverges too?  Or should I use the integral test $$\int_{1}^{\infty} \frac{1}{5k+2}=\frac{ln|5k+2|}{5}$$ from 1 to $\infty$=  $\infty$


I'm having a selenium web automation project developed in selenium Java. We use ms excel as dataprovider and having a utility class TestDataHelper(which uses apache poi APIs methods) to access the data from xls file. The framework works perfectly well on the windows server. however, now we are in process of migrating our test environment to the centOS8.2 with Gnome(GUI) interface. The AutoDev env(new linux server) has been configured with the required browsers, Eclipse and Liberoffice7.0 already. Now when I try to run the same clone project from Linux(centOS) server using eclipse IDE, I'm getting the Null pointer exception. the error suggests that is faced a Null Pointer in the getRowCount(String) of the TestDataHelper class. Here, I'm not sure if this is an excel compatibility issue between Windows and Linux or MS excel vs Liberoffice calc or something else altogether. Any help here would be much appreciated. [RemoteTestNG] detected TestNG version 6.14.3 SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/vikas.verma/.m2/repository/ch/qos/logback/logback-classic/1.1.2/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/vikas.verma/.m2/repository/org/slf4j/slf4j-nop/1.7.28/slf4j-nop-1.7.28.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See  for an explanation. SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder] [TestNG] [WARN] Ignoring duplicate listener : com.iel.potter.automation.utilities.PotterApiListener ARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass$3$1 (file:/home/vikas.verma/.m2/repository/org/codehaus/groovy/groovy-all/2.4.5/groovy-all-2.4.5.jar) to method java.lang.Object.finalize() WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass$3$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release 2020-10-23T22:58:26.754 [iel] INFO  [com.iel.potter.automation.utilities.PotterApiListener] - About to begin executing Test Test [Utils] [ERROR] [Error] java.lang.NullPointerException: Cannot invoke "com.iel.potter.automation.utilities.TestDataHelper.getRowCount(String)" because "com.iel.potter.automation.utilities.DataProviderClass.excel" is null at com.iel.potter.automation.utilities.DataProviderClass.getData(DataProviderClass.java:34) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:74) at org.testng.internal.MethodInvocationHelper.invokeMethodNoCheckedException(MethodInvocationHelper.java:45) at org.testng.internal.MethodInvocationHelper.invokeDataProvider(MethodInvocationHelper.java:131) at org.testng.internal.Parameters.handleParameters(Parameters.java:706) at org.testng.internal.ParameterHandler.handleParameters(ParameterHandler.java:49) at org.testng.internal.ParameterHandler.createParameters(ParameterHandler.java:37) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:924) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832)

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


Prove/Disprove:     $\forall S' \subset S\subset\mathbb R^2$ such that $S',S$ are convex and have finite area, the perimeter of $S'$ is smaller than the perimeter of $S$.   e.g. $S$ could be the unit square and the claim suggests that any convex shape inside the square has perimeter $\leq 4$.

Let $A\subseteq B$ be subsets of the real plane. Show that if $A$ is convex and $B$ is bounded, then the length of the border of $A$  $\leq$ the length of the border of $B$.


Sometimes when I stare at a very bright thing such as the sky I see little dots. It's actually more of a circle with a little dot inside it. They are half-transparent and they move around a lot. When I first see them they tend to appear in a group out of nowhere. I have seen one that is gray and almost black. What is this?

I have noticed that if you look directly at tubelight (I have only white ones in my home) and close your eyes little, you see little random shaped colourless things sometimes with slow speed and sometimes with falling down.   They are shaped like circles with something in between and in chains of random length.   My father has also seen them. So, I am sure I am not imagining things. What the hell are they?


Is there an guide or way to install the Ubuntu phone OS on other devices and is it safe?  I saw  but they are saying that is not stable yet. I'm asking about  "Ubuntu Phone OS"  and I need an installation Guide as well or preferably a step by step installation guide.  If any thing happens will I be able to but android on my phone again ?  thank you .

I have read about this on , the articles were a few months old though.  Is there an official guide from Ubuntu on how to do this?


I need to amplify the microphone output to some level about 3-4 Vpp without a DC offset. The output voltage will only be sensed (it will pass through a peak detector). So I assume I don't need any current supplying ability.   I first thought of using a common emitter with around 400 gain, but there is also an option of using a non-inverting or inverting (I don't care phase shift) opAmp circuit with the required gain.   I wonder are there benefits of using one over the another, in which aspects do they differ?   Or, are both these two options a bad idea?

I have built a peak detector circuit using op-amps/comparators to amplify the signal from an electret microphone, hold the peak signal and create a sharp logic edge when a peak is detected to be sent to a microcontroller.  I have built the circuit as follows setting up OA1 as a non inverting amplifier with a gain of 1000, but the voltage out from the OA1 remains fixed at about 4.5V no matter how much noise I make into the microphone. The comparator part of the circuit is outputting approximately 2V low and 5V high depending on how I set the potentiometer. All the components appear to be working.         – Schematic created using


my internal speakers on my macbook pro just stopped working, they have disappeared from the sounds preferences control panel. the only option is 'optical digital outport'  the headphones still work, but there's a red light coming out of the headphone jack  help?

The volume on my macbook pro has suddenly become greyed out. I haven't installed any updates or made any modifications to the computer, it just suddenly became greyed out after waking the macbook up from sleeping.  I've tried resetting the PRAM, but I don't hear any chime at all when I start up my computer, no matter how long I wait/how many times the computer re-restarts itself.  There also seem to be no internal speakers detected when I go into system preferences. For both input and output the computer detects 0 devices.  Thanks so much in advance for any help!!


The claim is that for every Lebesgue measure $0$ set $N$, there exists $x \in \mathbb R$ s.t. $N + x \cap N = \emptyset$. I came up with this question while trying to figure out another proof of the uniqueness of Lebesgue measure (as a translation invariant Borel measure on $\mathbb R$ that is $1$ on $(0,1)$). For that, I think it suffices to prove the claim above. Effectively this should allow you to show that any (locally finite) translation invariant measure has a density with respect to Lebesgue. I'm not sure whether this is true, but no counterexamples readily come to mind (it's possible a tiling of $\mathbb R$ by the Cantor set is a counterexample, but I can't immediately show it). Note that in $\mathbb R^2$ there is a natural counterexample, take the $x$ and $y$ axes. This readily generalizes to all higher dimensions too. Note also it clearly suffices to consider Borel sets. So does the claim hold?

If $y\in E\cap E+x$ then $y=h=h'+x \implies x=h-h'$ for $h,h'\in E$. Likewise, if $x=h-h'$, then $h\in E\cap E+x$. So that $E\cap E+x$ is non empty iff $x=h-h'$ where $h,h'\in E$. Thus, if there exists a real $x$ which cannot be expressed as above, the result is proven. The problem is I cannot prove that such an $x$ must exist. I have tried assuming that all real $x$ are of that form, but that gives me nothing except that $E$ must be uncountable and unbounded. Any hints?


The biggest cook-pot I have available to mash my grain and boil the wort is about 3 gallons, but I'm trying to make a 5 gallon recipe (got the 5-gal carboy and plastic fermenter, etc). Can I make that work, or do I have to do the cooking in something that will hold 5 gallons?

The starting position for most new extract brewers is to use a partial boil set up.  Defined as using a pot smaller than the intended batch size, all the ingredients are boiled in a smaller volume.  Then the wort is diluted to the final desired batch size.  (Often the dilution step is used as part of a cooling step)  What are the Ups and Downs of both Partial vs. Full boils?


I recently asked a question and would like to mark one of the answers as accepted. The problem is that I do not see a way to do so. On the left-hand side of the answer I can either vote up/down or view the answer's timeline. Shouldn't there be a check mark as well? Neither Chrome or Firefox offer an option to check the desired answer as accepted. No plugins are enabled. The checkmark's DOM element is present on the page with CSS styling display: none !important;. I     to how to accepted an answer, but none of them offered a working solution.  Do certain communities disable the option to mark answers? Do I need a higher reputation to mark an answer as accepted?  I would appreciate any clarity you could offer as I would like to show my appreciation for the user's help.

I accidentally posted a question without being logged in. Is there a way to associate that question with my account?   For more information, visit "" in the .   a.k.a. How can you link a registered account to a cookie-based account? a.k.a. How do I merge an unregistered account with a registered account a.k.a. Merging users a.k.a. How do I associate anonymous questions I’ve asked with my registered account? a.k.a. Is there a way to claim an unregistered user? (in case anyone searches with those terms)


My account has been suspended on SO. I request moderators to close or delete my account. I want a new fresh start.

How can I delete my Stack Exchange account(s)? Also,  What happens to my content? Can I request it be deleted as well? What if I'm suspended, rate-limited, or banned from posting questions or answers? What will happen to my votes? Will other users be impacted? Why wasn't my account deleted immediately after the timer expiring? What will happen to my pending bounties and close, reopen, delete, or undelete votes? I want my account deleted on all Stack Exchange sites. How do I do this? Will my profile on chat be removed once I delete my site account?   For more information, see "" in the .


I was thinking of using Ratio test but I have been unsuccessful so far. It's sufficient for me to show that $\lim_{n \to \infty} \left| \frac{a_{n+1}}{a_{n}} \right|$ converges to $l <1$.  By hypothesis, we have that $\sum a_n ^2 < \infty$, hence, $\lim a_n =0$. But $\lim a_n =0$ is a much weaker hypothesis to prove that $\lim_{n \to \infty} \frac{a_{n+1}}{a_{n}}$ converges to some $l <1$. Because $\left( \frac{1}{n} \right)$ converges to $0$ but $\frac{1/(n+1)}{1/n}$ converges to $1$.  I don't need solutions, some hints would be enough for me to finish this.

Let $a_1,a_2,a_3,\ldots$ be reals. Prove that if $\sum_{n=1}^{\infty} a_n^{2}$ converges, then so does $\sum_{n=1}^{\infty} \frac {a_n}{n}$.   For this I have shown the case for when $ a_n^{2} \le\frac {|a_n|}{n}$ $\Rightarrow$ $ |a_n|\le\frac {1}{n}$ $\Rightarrow$ $\frac {|a_n|}{n} \le \frac{1}{n^{2}}$ and we know that $\sum_{n=1}^{\infty} \frac {1}{n^{2}}$ converges and hence $\sum_{n=1}^{\infty}\frac {a_n}{n}$ converges by the comparison test. Now considering $ a_n^{2} \ge\frac {|a_n|}{n}$ $\Rightarrow$ $\frac {|a_n|}{n} \le a_n^{2}$ $\rightarrow$ combining the two cases for any n we have: $\frac {|a_n|}{n}\le\frac{1}{n^{2}}+a_n^{2}$ Hence using the comparion test again we know that $\sum_{n=1}^{\infty} a_n^{2}$ converges and $\sum_{n=1}^{\infty} \frac {1}{n^{2}}$ converges hence the sum converges so we can conclude that $\sum_{n=1}^{\infty} \frac {a_n}{n}$ is absoluetly convergent $\Rightarrow$ convergent.  Not to sure if this is correct, any help would be much appreciated, many thanks.


A potential supervisor is greeting me with "Hi" followed by my first name. How should I greet him in return? If I say "Hi" followed by "Dr." and his last name, this will look awkward. If I say "Hello" followed by "Dr." and his last name, this will look more formal than his original greeting, and might look like a sign of my trying to distance myself. So how can I keep being formal yet not look awkward or "cold"?

If a professor in a North American country presents his- or herself by his/her first name in email messages, does this mean that students can refer to him/her by his/her first name? Or is this generally not a good idea, unless the professor has explicitly mentioned that he/she can be referred to by first name? I've noticed that most professors, who prefer to be referred to more formally, do not sign their emails with just their first names, but usually initials or first and last name.


I am trying to use a 24V 10A SMPS to supply power to multiple loads. The SMPS has 2 sets of V+ and V- outputs.  I wanted to power a 24V 5A motor connected to the SMPS, as well and use the 2nd output from the SMPS with a buck converter and power a 12V 8A load also.  I thought that in theory this works because the math all adds up, what I can't understand (I'm very new to electronics) is: Will the buck just use around the 24V 5A and turn it to 12V 5A or will it try to convert all the 24V 10A leaving the 1st load underpowered?

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


In the hosts file how do I make it instead of redirecting to an IP address redirect to either a domain(example.com) or a URL on an IP address(127.0.0.1/example.html)? I tried typing it in but it doesn't work. I need to know how for Windows and Linux. How can I do it without a program or DNS?

My /etc/hosts file looks like this:  127.0.0.1       localhost 10.20.7.67      testsitealpha.dev othersite.dev   testsitebeta.dev   The first two work. The last one doesn't. Why not? How do I make it work? The reason I am doing this, is because I have a test server (othersite.com), which is on the local network, but it's ip can vary. e.g. 10.20.7.98 one day, 10.20.7.35 another, etc.  So, how do I make my system always resolve testsitebeta.dev to the same ip as othersite.dev?


Is this the right time to start switching to Salesforce's new Lightning Web Component model (Is this perfectly compatible with Lightning Aura model, Lightning Data Service, Lightning Design System Currently)? Will Aura Component model be completely depreciated and then removed? and in future release I will have to move to LWC model having no Aura components supported?   I am still concerned about this.

I :   Aura Components, leveraging its own component model, templates, and modular development programming model. Lightning Web Components, built on top of the web standards breakthroughs of the last five years: web components, custom elements, Shadow DOM, etc.   Apart from both using , and perhaps common component names, at first sight, these look as different as  are.  Can anyone who has worked hands-on with both Aura Components and Lightning Web Components - pilot participants? - comment about how much commonality there is in the framework and tools, and what the learning curve is like for Lightning Web Components?  (I'm hoping this doesn't get closed for being a matter of opinion; my aim is to get some insight into how easy or hard it will be to switch over.)


I'm remembering that in my childhood, my brother and I were certain that you had different attributes depending on the driver you chose.  For instance, Toad and Yoshi were a tiny bit faster than the others.  Is this true, or were my brother and I just having illusions about differences between the drivers?

Obviously, some characters weigh more than others (e.g. Bowser weighs more than Toad), which gives them different characteristics such as acceleration, and being able to spin other players by running into them.  My question is if there are weight classes or if each character has a different weight. So for example, the three heaviest characters are Bowser, Donkey Kong and Wario, are they all the same weight or do they have different weights? If they do have different weights, does that mean that for example, you could take the heaviest one of them and run into the least heavy one and that will cause you to knock out (or at least shove) the less heavier player?


Imagine a helicopter that took off from point A on the ground and goes vertically in the air to a certain fixed point B in the atmospheric area at a certain fixed altitude with enough fuel to stay there (at point B) during let's say the whole week. Point B is fixed according to an external system - Copernic for instance. By the end of the week and after several earth rotations, does the helicopter remains at point B? I mean does the point B remains vertically and exactly above point A?

I was reading somewhere about a really cheap way of travelling: using balloons to get ourselves away from the surface of the earth. The idea held that because the earth rotates, we should be able to land in a different place after some time. As we all know, this doesn't happen.  Someone said that the reason why this doesn't happen is because the atmosphere (air, clouds etc.) also revolves around the earth (with the same angular velocity as the earth's rotation). Since we are also part of the atmosphere, our position doesn't change relatively.  Well, I'm not convinced with that answer. Why does the atmosphere rotate along with earth?  Gravitational force is towards the centre of the earth, but I don't see how it's making the atmosphere rotate.


I downloaded the Blender version 2.82 to edit videos.   I opened an .mp4 file to start cutting scenes out of it but when I saved it, it showed .blend file and I cannot find a way to render it because its different than any videos I found on the internet. Please give me a detailed step by step instruction as i dont need it for anything else but this?  Thank You

So I made an intro using animation and it saves it as a .blend and I want it so save as a video like .mp4 or something like that. I've tried changing the codec because I tried opening the intro with windows media instead of blend. I didn't try all the codec's but I tried some of them.


Whilst reading the answers to  question, I wondered.. If during the Doctor Who Season 5 story arc, the cracks in the universe absorb a number of creatures, erasing them completely from time and two of these casualities are Amy Pond's mother and father: how if they were erased and therefore never born, does the daughter of two beings who were for all intents and purposes unmade, exist?  It's been mentioned in the afore mentioned question that Amy has some kind of resistance to Space/Time anomolies due to her being the center of a fair few during her childhood, but surely that cannot counter her creators being unmade!?

How did Amy Pond survive without being consumed by the crack on her wall, given that the same crack consumed her parents?  I haven’t seen season 6 yet, so no spoilers please.


Is there anything wrong with using const_cast in situations like this?  class List { public:     const List * head () const     {         // seek to the head of the list     }      List * head ()     {         return const_cast <List *> (((const List *)this) -> head ());     } };   It seems clear to me that, assuming there are no strange tricks in the const version of the function, it should always be safe to defer to it in the non-const version (but not vice-versa of course).  Are there any nasty surprises in the language that would ever make this a bad idea?

Let's say I have the following class X where I want to return access to an internal member:  class Z {     // details };  class X {     std::vector<Z> vecZ;  public:     Z& Z(size_t index)     {         // massive amounts of code for validating index          Z& ret = vecZ[index];          // even more code for determining that the Z instance         // at index is *exactly* the right sort of Z (a process         // which involves calculating leap years in which         // religious holidays fall on Tuesdays for         // the next thousand years or so)          return ret;     }     const Z& Z(size_t index) const     {         // identical to non-const X::Z(), except printed in         // a lighter shade of gray since         // we're running low on toner by this point     } };   The two member functions X::Z() and X::Z() const have identical code inside the braces.  This is duplicate code and can cause maintenance problems for long functions with complex logic.    Is there a way to avoid this code duplication?


I have a htc wildfire s it is rooted but is it possible to get ubuntu on my phone? If so, how?  I am not so smart with this so please if it is possible a full tutorial?

With the announcement of the Ubuntu Phone OS I'd like to know what phone (and tablet) models are supported at this time.  Note from foss & Oli: We are making this the master question for all future "Will this work on <insert random tablet/phone/device here>?!" questions


While this sounds kind of silly, I'm a DM and trying to settle on a question a player asked me. In the game I use a battlemat and place all creatures in melee adjacent to each other. However a player asked me if being within 5ft meant that they could reach something that was one square away from them.  I can see their reasoning that if you imagine two sword fighters having at it, they aren't shield to shield and slapping each other but moving in and out of range with a significant gap between them.  Aside from practical, if a neutral creature who's foe to neither wanted to run in between two sword fighters my imagination says they could, but per how I place minis on a battlemat there's not a gap to move through.  Would it be a bad/game-breaking reason to leave a gap and call 5ft that gap, or is it implied more directly that creatures are small enough within their squares that the combined difference means adjacent creatures are actually 5ft away?

I’m looking for clarification regarding combat space in a one-on-one combat situation, since it impacts disadvantage rolls and opportunity attacks.   If a medium size opponent attacks you with a melee weapon (one that does not increase reach), it’s assumed they are within 5′ of you (PHB 146).   Based on the “SPACE” section in PHB 191-2, they are in one of 8 squares bordering yours.  Regardless of whether it’s a hit or miss, it’s now your turn.    You’re a spell caster that only has an option of a ranged spell.  Let’s assume you have no ‘touch’ spells and no melee weapon.  Based on PHB 195, would you have disadvantage on your ranged spell attack roll because you’re within 5′?  Or because each creature is in its own 5′ space, there is really 10′ between them combined, so there would be no disadvantage roll on the ranged spell attack?


I need to get software RAID configuration info from a remote windows server (2003, 2008, 2012) on a local linux system.  I have  and , but have been unsuccessful at finding a solution, as has, it seems, anyone else trying to do a similar thing.  (I would have included other similar links, but serverfault forbids me.)  WMI is the preferred method of retrieving this info because it requires no additional, non-default software to be installed on the remote windows server, but any other windows non-install solutions are also acceptable.  I have also looked through and searched the WMI reference without success on this topic. (http:// msdn.microsoft.com/en-us/library/aa394572%28v=vs.85%29.aspx)  Edit:  I'm thinking that winexe(1) is the answer.  I have seen and considered the link to the vb script(2) in the accepted answer of the duplicate question.  I consider that question to be similar enough to mine to be a real duplicate.  (1): http:// winexe.sourceforge.net/    (2): http:// www.anchor.com.au/hosting/dedicated/monitoring_windows_software_raid

I have a Mirrored Dynamic disk on my Windows 2003 Server. How do you monitor the health of the volume?  Is there a way to have the server send an email when there is an issue with the volume? Is there a way to have the server run S.M.A.R.T. tests?  EDIT: Nothing says WTF like logging into a client server, running DISKPART LIST VOLUME and seeing this.  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info ----------  ---  -----------  -----  ----------  -------  ---------  -------- Volume 0     X   xDrive       NTFS   Mirror       233 GB  Failed Rd Volume 1     C                NTFS   Simple        57 GB  Healthy    System Volume 2     D                       DVD-ROM         0 B  Healthy Volume 3     F                RAW    Partition    466 GB  Healthy Volume 4     E   New Volume   NTFS   Partition    932 GB  Healthy


I need to write a STIG rule that will check for all files within a user's home directory, and result in a 1 if any are found to be less permissive than 750.  This is what i have made so far.  egrep ":[0-9]{4}:" /etc/passwd | cut -d: -f6 | while read line; do   if [ ! -e "${line}" ];then     exit 1   else     if [ `stat -c "%a" "${line}"` -gt 750 ];then       exit 1     fi   fi done   However, this does not work when permissions are a number such as 557. I can't think of a way, at least with my skill level, to get this to work.  How would i check all files within a home directory, and have it return 1 if it finds a file that is less permissive than 750?  Example: 751,757, 551, 501, 001, 770, 570.. should all fail. My script does not capture all these.  To Clarify: I need to ensure NONE of the files in the home directory have ANY "other" attributes. If they have ethier r,w, or x in the "other", it needs to fail. Additionally, in the "group", it needs to only not have w. As long as it cant find any files where the "group" has write or the "other" has read, write, or execute, then it should pass. If it finds theses, it needs to fail.  If i could also modify this so that files owned from root are excluded, that would be helpful

I am moving a website from one server to another and Git does not store metadata such as file permissions. I need to find the directories and files that are not 775 / 664 respectively.  Right now, I'm using this cobbled-together contraption:  $ find . -type d -exec ls -la {} \; | grep ^d | grep -v ^drwxrwxr-x $ find . -type f -exec ls -la {} \; | grep -v ^d | grep -v ^-rw-rw-r-- | grep -v '.git'   Though this works, I feel it is rather hacky. Is there a better way to do this, perhaps a canonical way, or should I just be hacky?  This is running on a recent Ubuntu version with GNU tools under Bash.


I've got this file:   aaa.bbb.ccc.ddd aaa.bbb.eee.ccc ggg.hhh.jjj.kkk fff.uuu.yyy.ddd eee.rrr.ddd.bbb eee.rrr.www.zzz eee.rrr.sss.nnn eee.rrr.qqq.kkk   I want to filter it so it displays the whole line only when the first occurrence of the first two columns happens.   The expected output is:  aaa.bbb.ccc.ddd ggg.hhh.jjj.kkk fff.uuu.yyy.ddd eee.rrr.ddd.bbb   So far what I could do was:  cat file |awk -F"." '{print $1"."$2}' |uniq -c   but it only shows the first first two columns and the number of repetitions.

I have large 3-column files (~10,000 lines) and I would like to remove lines when the contents of the third column of that line appear in the third column of another line. The files' sizes make sort a bit cumbersome, and I can't use something like the below code because the entire lines aren't identical; just the contents of column 3.  awk '!seen[$0]++' filename


I'm in chapter 2 and so far, the main weapons seem more effective in most situations, and even if it were useful in some specific situations, changing weapon is quite slow, so I'd like to know if I missed something. There seem to be no point of using the secondary weapons slots, except to carry & sell them. The only one I can find some use, is the torch, but I prefer the cat potion...  So, is there any use for secondary weapons, except for selling ?

Besides using the steel or silver sword in The Witcher 1 you can also use smaller side weapons such as daggers or axes.  The only benefit I can see in these weapons is that some have an additional effect like having a higher chance of inflicting bleeding on the target. But since the weapon switching takes rather long I prefer not to use those weapons. They also don't deal that much damage.  Is there any other benefit in using the smaller side weapons?


I need something like this : Searching around I've found only material about tables, rotated text, diagonal lines and so on. I think the solution could be something like drawing a table with no borders, only one cell, with an (invisible) diagonal line crossing it, but I'm not sure and moreover I haven't any idea about implementing it. Help would be appreciated, I'm going mad. Thanks.

I would like to create a XeLaTeX layout where  multicol's columns (two in this case, no figures, text only) are tilted where they meet. The lines still should be ordinary lines below each other, but the start/end points of each line should glide a bit each line for it to look something like this:  xxxxxxxxxx  xxxx xxxxxxxxxx  xxxx xxxxxxxxx  xxxxx xxxxxxxxx  xxxxx SECTION   xxxxxx xxxxxxxx  xxxxxx xxxxxxx  xxxxxxx xxxxxxx  xxxxxxx xxxxxx  xxxxxxxx xxxxxx  xxxxxxxx xxxxx  xxxxxxxxx xxxxx  xxxxxxxxx xxxx  SUBSECTION xxxx  xxxxxxxxxx   So not the whole column is tilted, but one gets narrower while the other one gets wider.  I've seen examples using \parshape, but those I found are based that one counts lines and more or less manually defines the shape. I also would need that LaTeX keeps the multicol functionality (page breaks, text flow, ...) and does this automatically on each page for a longer chapter.  How do I create such a layout? If multicol is not easy to mix with this layout, what would be an alternative?


I installed acrordrdc via snap on Ubuntu 20.04 with Mate desktop manager. I found that acrordrdc can't open files in the /tmp directory. This is related with a previous question:  If I try acrordrdc /tmp/file.pdf  it doesn't work. Why? Can it be fixed?

Usually I'm avoiding snap-based applications, but sometime I need them. For example - Markdown Lint Tool is shipped only as Snap named  . It works great when files are in home folder - $ echo "# header" > ~/test.md $ /snap/bin/mdl ~/test.md ; echo $? 0  but it fails when file is located in /tmp directory: $ echo "# header" > /tmp/test.md $ cat /tmp/test.md # header $ /snap/bin/mdl /tmp/test.md /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl/doc.rb:57:in `read': No such file or directory @ rb_sysopen - /tmp/test.md (Errno::ENOENT)     from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl/doc.rb:57:in `new_from_file'     from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl.rb:75:in `block in run'     from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl.rb:73:in `each'     from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl.rb:73:in `run'     from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/bin/mdl:10:in `<top (required)>'     from /snap/mdl/140/bin/mdl:23:in `load'     from /snap/mdl/140/bin/mdl:23:in `<main>'  For this particular application there are no options for snap connect: $ snap connections | grep mdl home                      mdl:home                             :home                                 -  Also I can't install it as classic: $ snap install mdl --classic  Warning: flag --classic ignored for strictly confined snap mdl  mdl 0.9.0 from Snapcrafters installed   What should I do to give Snap application full access to the /tmp folder? Does it happen by Snap design or not?


This code separates a string into tokens and stores them in an array of strings, and then compares a variable with the first home ... why isn't it working?  public static void main(String...aArguments) throws IOException {      String usuario = "Jorman";     String password = "14988611";      String strDatos = "Jorman 14988611";     StringTokenizer tokens = new StringTokenizer(strDatos, " ");     int nDatos = tokens.countTokens();     String[] datos = new String[nDatos];     int i = 0;      while (tokens.hasMoreTokens()) {         String str = tokens.nextToken();         datos[i] = str;         i++;     }      //System.out.println (usuario);      if ((datos[0] == usuario)) {         System.out.println("WORKING");     } }

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 just have a problem on ubuntu. when i go to ubuntu Software Center, i can not download any application although i can surf the internet. when i download an app it stops at 10% and then an message appears <1. please help. i am from greece and my computer does not support ubuntu 14,04+.

Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found:  $ sudo apt-get install vlc Reading package lists... Done                Building dependency tree        Reading state information... Done     E: Couldn't find package vlc


What rule does this violate?  I know that it's wrong, but what is this tense or of what tense is it not a proper form? I hear these a lot: we are needing or we are wanting instead of we need or we want.

In the course of answering  (which is now deleted and may be viewed only by 10K+ community members), we have evoked some dispute over whether the phrase      Am I needing to read this book?   is grammatical.  I think it is correct, although not common, but others think differently. Is this a correct grammatical structure, albeit perhaps a bit odd?    EDIT: I think I should clarify further.  I don’t disagree that this phrasing is unusual; in fact, that’s what I said in the other answer.  What I am interested in is whether it is correct or not. I think it is because of its uncommonness that I am not certain. It might be more straightforward to ask it this way:     Is the sentence “I am needing to read this book” grammatical?  If not, why not?


The police have three suspects for the number of Mr. Boddy: Professor Plum, Colonel Mustard, and Mr. Green. Professor Plum, Colonel Mustard, and Green each declare that they did not kill Boddy. Mustard also states that he did not know Boddy and that he was out of town the day Boddy was killed. Green also states that he saw both Plum and Mustard with Boddy the day of the killing and that either Plum or Mustard must have killed him.  Assume one of the three men is guilty and that innocent men do not lie. The statements of the guilty man may or may not be true. Determine who killed Mr. Boddy and prove it.

I’m trying to solve a logic puzzle that goes like this:     The police have three suspects for the murder of Mr. Cooper: Mr. Smith, Mr. Jones, and Mr. Williams. Smith, Jones, and Williams each declare that they did not kill Cooper. Smith also states that Cooper was a friend of Jones and that Williams disliked him. Jones also states that he did not know Cooper and that he was out of town the day Cooper was killed. Williams also states that he saw   both Smith and Jones with Cooper the day of the killing and that either Smith or Jones must have killed him. Can you determine who the murderer was if one of the three men is guilty, the two innocent men are telling the truth, but the statements of the guilty man may or may not be true?   When i was young, i used to solve such puzzles graphically, drawing vertices and arrows and excluding impossible cases. But now i want to do that formally. How can i express this puzzle definition using proposition calculus notation, inference and truth tables? Or, in other words, when you stumble upon a logical puzzle and you want to solve it formally, what is your algorithm?  What i tried. I extracted several propositions from the definition:   S: didn't kill C S: J knew C S: W disliked C J: didn't kill C J: J didn't know C J: out of town W: didn't kill C W: S with C W: J with C   There are 3 groups of propositions, two of them are always true, the third may contain either true or false statements. Let be $A = 1 \land 2 \land 3$, $B = 4 \land 5 \land 6$, $C = 7 \land 8 \land 9$. Then from  by using truth tables and Karnaugh maps i deduct that the statement “some two of A, B, C are true” looks like $(A \land B \land \neg C) \lor (A \land \neg B \land C) \lor (\neg A \land B \land C)$. But wait, “may or may not be true” means that all statements might be true, not that at least one is false (hence the NAND is not appropriate here). So the sentence should be reformulated as “at least some two of A, B, C are true”. Am i going in the right direction?


I would like to run my R7-265 video card in my ubuntu 18.04 LTS. The problem is that you do not provide support since ubuntu 14.04 LTS later. (the screen below)    And I'd like to use my video card. How do I run it without official driver? Is the MESA driver I need to configure? How do I install this driver? SO I DID IT I installed mesa-util    But it still showing intel graphic card...    I've been researching ways to configure but I have not found a safe step on the internet.  Is there a way to FORCE the use via software? It was so easy with the catalyst ...

I have 14.04.5/16.04 or newer and an AMD GPU. I'm not getting the performance I want, and some programs say they need things like OpenCL.  I've heard about fglrx, but if I try to install it on my machine, it breaks and I have no GUI.  Is there anything I can do to get my AMD card working to its full potential?


Well in a book i am reading it is given that you can also prove this by showing that  Every prime factor is contained in $(n+r)!$ as often at least as it is contained in $n!r!$.  How does this prove the proposition, i am not getting the meaning of this.   Help appreciated.

How can we prove that the product of $n$ consecutive integers is divisible by $n$ factorial?     Note: In this  and the comments here the OP has clarified that he seeks a proof that "does not use the properties of binomial coefficients". Please post answers in said newer thread so that this incorrectly-posed question may be closed as a duplicate.


I let my younger cousins play on my S4 Mini from time to time, but now I have found that all their words they have used are the first to come up when I use my phone to text. It has gotten quite irrititating. Samsung seems to have very hard to find settings compared to my old sony Ericsson so I cannot find where to get rid of the word history typed onto my phone's keyboard.   Thank you.

I let my younger cousins play on my S4 from time to time, but now I have found that all the words they have used are the first to come up when I use my phone to text. It has gotten quite irritating. Samsung seems to have very hard to find settings compared to my old Sony Ericsson so I cannot find where to get rid of the word history typed onto my phone's keyboard.


I am sure there are a few questions on SO about usage of the negation operator (!) in C#, but I haven't been able to find them.  How would one go about finding questions that discuss the proper usage of this operator on SO? I'm interested in suggestions regarding whether one should typically follow one or the other of these conventions:  if (!isValid) { ... }   or  if (isValid == false) { ... }   I realize this might be something on Programmers.SE instead, also, but the challenge in finding it still exists.

I tried to find a related question here, but was unsuccessful.  Someone on SO asked ... I tried searching SO and was presented with the search options page. Even Google fails at this search.  So my question is, is there some way to search for an exact word (in quotes) that won't cause it to fail?


Okay so I asked this before well not exactly but can you get emoji's and the first gen iPod? I have and iPod 4 and an a iPhone 6 and they have emoji's but now I am buying the first and need to know. Thanks!

I am getting a 1st gen iPod touch for a friend and I was wondering if you can download like apps and games on it and if it has emojis? It would help to get an answer before I buy it!


how to handle captcha in selenium webdriver: I am using this code but it gives error"Error communicating with the remote browser. It may have died." code is below: driver.findElement(By.xpath(".recaptcha-checkbox-checkmark")).click();

How can I automate "Enter CAPTCHA" using Selenium WebDriver?


Why does enclosing a symbol in in curly braces e.g. {\in} suppress space around the symbol? I cannot seem to locate any documentation which explains this behavior, or describes which symbols it applies to. Any clarification or references would be much appreciated.

These seem to be very similar as they both separate two operands. When would one be used over the other? Is there any difference in the math spacing surrounding them?  How would the spacing in these relate to to the spacing produced by \mathop?


i use the package ngerman, which works well and transforms umlaut, i.e. \o" to ö, etc. Many people seem to use the babel package with the option ngerman, however. Whats the difference, which one is preferable?  Kind Regards

Is there something additional that \usepackage[ngerman]{babel} does that a simple \usepackage{ngerman} won't be able to do?


I just oneboxed http://stackexchange.com/, but the image was pure white (I think): . Thinking that this may have been a MSE-only issue, I did it in two other rooms  and . Both times, it was was the same white image.    This can be fixed by changing <img src="http://cdn-chat.sstatic.net/chat/img/se-logo-white.png" to <img src="http://cdn.sstatic.net/stackexchange/img/logo.png.

Oneboxing of site links is often not visible, especially on beta sites:        Many sites, like Ask Ubuntu and Sharepoint also have predominantly white logos in oneboxes.  These images should have a background colour, so that they are visible.   chat.stackoverflow.com has a slightly off-white background, so the white content is still slightly visible. chat.stackexchange has a pure-white background, white content is gone. the one-box for http://stackexchange.com is pure white, and looks like:        at least on chat.stackoverflow the white is visible:


I am modeling a laser beam in blender, and I was wondering exactly how to achieve the "beam" look of the laser.  I don't exactly want to use a bright red lamp, or an emission shader, because obviously laser dots don't really change in size as you increase the distance between it and the producer.   Here is an reference image of a beam similar to what I am trying to achieve:   There are a couple questions similar to this one, but they obviously do not give information about achieving the volume of the laser, or the bright "star" at the end.  A detailed node setup for a type of projection like this would be the correct solution to this question.  Part of the problem: When I tried the laser lamp node setup for my lamp, it had no effect except for color.   Here is a picture of the lazer lamp's node setup with the model of the lazer case in material view:   This is in rendered view with a volume cube surrounding everything. (Lamp is still selected): This is my model of the laser case:  Here is the .blend if you want to work with it:

I am modeling a laser pointer in Blender, but I am not sure how to make the laser's light beam.   The Spot light comes the closest to what I am looking for, but its starting diameter is 0, and you cannot set the spread amount to less than 1 degree.  I would like to be able to do this in the Cycles rendering engine if possible.      Edit: I am not trying to see the actual beam of light, like when you shine a laser beam through fog. Rather, I simply want to have the light beam go straight from the laser. So that if you were to shine it at an object up close, the dot would be the same size as if you were to shine it at a object farther away.  Not this:                              But this:        *Laser images from images.google.com


I am looking to make a website and in the future desktop apps as well and i know nothing about db design so what tutorials or books (online preferably) are there? thanks

I am pretty well versed with SQL Server, MySQL, Oracle etc but putting these Database products aside, is there a resource that will help me design relational databases well? Is there something like patterns or best practices for database design?  I have seen a few times that database is often not scalable; people have personal preferences with keeping columns like isChecked column which is boolean in nature but stored as Char(1) with values like 'Y' and 'N' instead of 0 and 1 which to me sounds better. Ways not to commit common mistakes while doing database design?  Links to books or articles will be highly appreciated.  Thanks in advance.


I know that it can be done with graphics packages like TikZ, but it seems to be a bit of an overkill. And for those not already familiar with the TikZ system, learning it can be a bit of a barrier. So my question is     Assuming the advanced graphics capabilities are not necessary, and I just need a bare-bones flow chart (which should be implementable just using the picture environment), is there a LaTeX package for simply making a flow chart?


Hey i need to do nim multiplication of numbers: a) 6 ⊗ 24 b)25 ⊗ 40  I starded with a) and calculate that $6\otimes 24= 96\oplus(6\otimes 8)$ and I dont know how to calculate this to the end. In point b) and dont know how to start

Let $a,b$ be . Is there an efficient algorithm to calculate $a*b$, the nim-product of $a$ and $b$?  The following rule seems like it could be helpful:  $$ 2^{2^m} * 2^{2^n} = \begin{cases} 2^{2^m} 2^{2^n} & \text{if $m \ne n$} \\ 3(2^{2^m - 1}) & \text{if $m = n$} \\ \end{cases}. $$  Juxtaposition denotes ordinary ordinal multiplication here (not nim-multiplication).


IF update command is run on a table and commit is pending then another user cannot be able to update the table.  Is there any query to get the user or PC which caused lock on the table.

If an update is run on a table with "Read Committed Snapshot" isolation level and a commit is pending  eg:    update table1 set col1 = col1 + 1 where PKcol < 3 update table1 set col1 = col1 + 1 where PKcol = 3 update table1 set col1 = col1 + 1 where NonPKcol < 3 update table1 set col1 = col1 + 1 where NonPKcol = 3 update table1 set col1 = col1 + 1 where PKcol < 3 and NonPKcol = 5   In above case PKcol is primary key in table and NonPKcol is a non-primary key.  Will updates be locked for only the rows satisfying the 'where' condition? Is it based on value or index or primary column?


After an update, I've been having a login loop and I can't log in.  I've tried to search for some solutions and followed a suggestion to reinstall nvidia.  Now I have this message that is constantly printing out to the terminal so I can't even use ctrl+alt+F1-6:  systemd-udevd[713]: failed to execute '/bin/systemctl' '/bin/systemctl start --no-block nvidia-persistenced.service': No such file or directory  systemd-udevd[852]: failed to execute '/bin/systemctl' '/bin/systemctl stop--no-block nvidia-persistenced': No such file or directory   Could someone please help?

My PC was working yesterday without any problem. I shut it down and tried to open this morning. It prints out these messages on the black screen:  systemd-udevd[713]: failed to execute '/bin/systemctl' '/bin/systemctl start --no-block nvidia-persistenced.service': No such file or directory  systemd-udevd[852]: failed to execute '/bin/systemctl' '/bin/systemctl stop--no-block nvidia-persistenced': No such file or directory   It then continued with the login screen. I entered my password and pressed enter. It waited for a while and the login screen reappeared again.  How can I fix the problem?


After various issues with Nvidia drivers (GT1030), trying various ones in the Ubuntu software manager with different levels of success, I went to the Nvidia site and searched for Linux drivers, for which very recent ones for my card seem to exist. But the download was a .run file, something I'd not seen before. Is this right for Ubuntu? It would only let me run it in recovery mode (as said an Nvidia driver was already loaded) and once installed, instead of auto logging on, I got the login window with my account, but was unable to log in. I restored from Time Shift. Can someone please enlighten me as to what I did wrong? Many thanks.

I just ordered the Nvidia GTX card. I have a dilemma, though. Should I keep using the driver which is available in "additional drivers" in Ubuntu, or should I install the driver from the Nvidia site?  So which driver is the best for me?


In what ways dragons can kill a person having Blood of the Dragon?  Obviously, there is:      fire, that can't kill a person having Blood of the Dragon, as Daenerys say after the Viserys death from the melted gold.   Also, can dragons kill a person having Blood of the Dragon on their own will or only on demand?

Twice in the books Daenerys has been in situations where it is reasonable to expect that she would have been burned to death, or at least seriously injured, yet has come out unharmed.  The first time was when she stepped into the funeral pyre of Khal Drogo, which resulted in her dragon eggs hatching.  The second time is in A Dance with Dragons, when she is exposed to Drogon's fire.  In both instances, all that happens to her is her hair is burned away.  I can't be certain, but I believe there may have been references in the first book to her touching burning coals and other hot materials, as well.  Is this a trait shared by other Targaryens?  Her brother certainly wasn't immune to molten gold, and while a number of Targaryens were fascinated with fire (Aerion Targaryen died from drinking wildfire, believing it would turn him into a dragon), I don't recall seeing mention of any Targaryen shrugging off fire.  Is Daenerys' apparent immunity explained anywhere?


When I plugin the USB cable the device light is on.  A window pops up and says installing expansion after two to three seconds the        window gets closed. The portable drive is not shown in the disk management and in My computer. Portable drive is seagate expansion 1tb/USB 3.0

What steps can I take to try to recover lost or inaccessible data from any storage device?  Answers:   This applies to any computer storage device, e.g. internal/external hard drives, USB sticks, flash memory. The most important thing is to STOP using it, any type of I/O can ruin your chances of a recovery.     We have separate questions covering common problems with USB flash drives in greater detail:


I am trying to zip 13 mp4s. The uncompressed versions of those files are 2.69GB.  But when I zip them with 7zip, using Ultra compression level and any of the compression methods - including LZMA, the resulting file is still 2.69GB.  Why is that?  Edit 1  I am even trying it in the 7z format, and as you can see from the image below the Compression Ratio is 99%! That doesn't provide me much compression at all.  The settings I used for .7z are LZMA2

A 398MB directory was only compressed to 393MB using 7Z and Normal ZIP compression. Is this normal? If so, why do people continue to use ZIP on Windows?


i would like to reply to your letter, which arrived two days ago, before leaving for Rome i was told yesterday that the company are going to send me there

I'd say Microsoft have a way of bending the rules and I know that McLaren have won the championship. While this sounds strange, I believe it is correct English (sorry, I'm not native).   But when it's a small company, would you still use it this way? Is a company always plural, or are small companies singular? I.e., would you say Bakery Johnson makes fine bread or Bakery Johnson make fine bread? Is it My book seller, Woody's, have moved or is it has moved?


I'm having problems booting Windows 7, and I need to extract files from the computer's hard drive onto an external hard drive.  When I insert the Windows 7 DVD, I get two options, formatting and repairing. When I try to repair the system, the process runs very slow and I am asked to reboot the computer when finished, even though the problem is not solved.  How do I transfer data off my system's hard drive onto an external hard drive? My computer is a Dell laptop running Windows 7.

What is the best way to access a laptop's hard drive to recover data (assuming there is still intact data) when the OS (Windows XP) won't boot?  EDIT: I've tried booting from a disc, but that failed as well.


I'm new to SQL (running SQL Server 2012), the query I'm running is returning these results.  IDNum   Email ----------------  1      a@a.com  1      b@b.com  1      c@c.com  2      d@d.com  2      e@e.com  3      f@f.com  3      g@g.com  3      h@h.com  4      i@i.com  5      j@j.com  5      k@k.com   I would like to get the following result set (a comma separated list unique to each id)  IDNum   Emails ---------------------------------  1      a@a.com,b@b.com,c@c.com  2      d@d.com,e@e.com  3      f@f.com,g@g.com,h@h.com  4      i@i.com  5      j@j.com,k@k.com   I've been trying to follow some of the answers from other questions but not having any luck. I'm sure it's some combination of my inexperience & all the other questions I'm finding with this are just results from a single table. My query is getting results from multiple tables if that makes a difference, would be similar to  SELECT DISTINCT      s.idnum, e.email FROM     student s JOIN      email e ON e.guid = s.guid WHERE      s.activeYear = 1 AND e.activeEmail = 1   Can anyone help? Thanks.  ******UPDATE******  I ended up using the following query after reading a few more articles here and on another website. Hope this helps someone in the future.  USE databaseName  SELECT s.idnum, STUFF(( SELECT ',' + e.email AS [text()]         FROM email e         WHERE         e.guid = s.guid AND e.activeEmail = 1         FOR XML PATH('')         ), 1, 1, '' )         AS emails     FROM student s  WHERE s.activeYear = 1

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)


I'm trying to learn a neural network with stop criteria of difference between error on current and previous iteration. But sometimes error starts growing instead of decreasing and only the difference between current and previous errors is not enough to deal with this situation.   Are there known or best techniques to eliminate this problem?  Now I'm doing something like this - I'm checking if error on current iteration is bigger than on previous one, and if yes count this. When it happens N times in a row, I stop learning. But it doesn't seems like 100% best solution

I have created my own neural net which is using batch gradient descent. In other words, it trains on batches of examples all at once.  My issue is trying to figure out when to stop the training of the batch. I'll try to make things as understandable as possible since there are so many options, but please comment if you need clarification.  Each batch allows me to compute a list of output errors that correspond to the error the computer has on each example. Each error is a vector with elements equal to the number of output neurons.  Let each error vector be notated by e1, e2, e3, ... so the list of output errors is [e1, e2, ...]. Let an error vector in general be notated by e.  Now there are 2 things we can do to a vector or a list:   Average: average all of the elements in a vector or list. This will be notated by the function a(). For example to find the average error of an example we would do a(e) Check: make sure that each element in the vector or list is below a certain value. If any of the elements are too high, we continue to train on the entire batch. (This function can also be applied to a single value.) This will be notated by the function c(). For example, if we wanted to make sure the average error in e was low enough, we would do c(a(e)) Sum: add up all of the elements in the vector or list. This will be notated by the function s(). For example, s(e) would be totaling the error found in error vector e.   Here are the methods I have determined for deciding when to stop gradient descent:   Iterative: just run the training a certain number of times Average of averages: Find the average error of each example, then find the average of those and make sure it's below a certain amount. This is given by the formula c(a([a(e1), a(e2), ...])) Specific error: Check to make sure the error in each output neuron is below a certain amount. This is given by the formula c(e1), c(e2), ... Specific averages: Check to make sure the average error in each example is below a certain amount. This is given by the formula c([a(e1), a(e2), ...]) Sum of sums: Total up all the error in the entire batch and then make sure it's low enough. This is given by the formula c(s([s(e1), s(e2), ...]) Sum of averages: Find the average error of each example, then add up all those and make sure it's below a certain amount. This is given by the formula c(s([a(e1), a(e2), ...])) Average of sums: Compute the average total error in each example, and then make sure it's below a certain amount. This is given by the formula c(a([s(e1), s(e2), ...])) Specific sums: Check to make sure the total of the error in each example is below a certain amount. This is given by the formula c([s(e1), s(e2), ...])   So my question is this:  Which one of these options is most commonly used when training neural nets? Why? (Is there another option that I've missed?)  (Edit: I have found a very general version of this question , where the answers seem to say there is no specifically good way. If that is still true, please say so in your answer. Note that this is not a duplicate, as I explain the specific methods I would like to use.)  Edit: as A.D pointed out, summing is pretty useless because it depends on how many values are in each list/array/batch. And if you know how many examples there are, you can just use averaging. So, the methods involving "summing" have been cut.


I’ve solved a physics problem about acceleration with the quadratic formula and I don’t understand the solutions. There is two vehicles A and B. A is before B of 50 meters. The velocity of A is 20 $ms^{-1}\hat{i}$ and B is 30 $ms^{-1}\hat{i}$.Then A start an acceleration of 2 $ms^{-2}$. How long do A overtake B. I’ve collapsed two equation such as: $\frac{1}{2}a_{A}t^2+v_{0A}t = x_{0B} + v_{B}$  Then i have à second degree equation to find the time, and i solve it with the quadratic formula: $x_{1,2} = \frac{-b \pm \sqrt{b^2- 4ac}}{2a} $  But then i have 2 solutions with one negative ex: 6 and -2. The positive solution is right but the negative can’t work because it lend to a negative time. Why there is a « false » solution ?

There are negative times and negative $x$ and $y$ displacement in parametric equations; what do they represent? And is it possible to tell the object's velocity, direction and acceleration from just a parametric equation?


I want to draw and label angle A (alpha) of my ABC triangle while still being able to change to coordinate of A B and C so that the angle and the mark adapts to it.     \documentclass{article}  \usepackage{pgfplots}  \usetkzobj{all} %also needed  \begin{document}  \begin{tikzpicture}  \coordinate (M) at (0,0) ;  \coordinate (A) at (canvas polar cs:angle=90,radius=3cm) ;  \coordinate (B) at (canvas polar cs:angle=-30,radius=3cm) ;  \coordinate (C) at (canvas polar cs:angle=30,radius=3cm);  \draw (M) circle (3cm);  \draw (A) -- (B) -- (C) --cycle;  \tkzDrawPoints(A,B,C,M);  \tkzLabelPoints[above](A,C);  \tkzLabelPoints(B,M);  \tkzMarkAngle[fill= red,size=1.5cm, opacity=.4](B,A,C); %thanks to Claudio  \tkzLabelAngle[pos = 0.8](B,A,C){$\alpha$};    \end{tikzpicture}  \end{document}

I'm using LaTeX with TikZ to create a (right-angle) triangle. Now I would like to label each angle by adding a half circle and a text label.  Unfortunately I only managed to create a label for the gamma angle. What do I need to do in order to put such a label into the remaining corners?  \begin{tikzpicture}[thick] \draw(0,0) -- (90:2cm) node[midway,left]{$opposite leg$} -- (0:4cm) node[midway,above right]{$hypotenuse$} -- (0,0) node[midway,below]{$adjacent leg$}; \draw[fill=lightgray, thick] (0,0) -- (0:0.8cm) arc (0:90:0.8cm) node at (45:0.5cm) {$\gamma$} -- cycle; \end{tikzpicture}


I am trying to understand how /etc/resolve.conf /etc/nsswitch.conf exactly works and what is significance of nameserver entry 127.0.1.1  I did strace ping google.com to get to know about the system calls involved , one part is :  stat64("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=172, ...}) = 0 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 4 connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.1.1")}, 16) = 0 gettimeofday({1413780874, 913366}, NULL) = 0 poll([{fd=4, events=POLLOUT}], 1, 0)    = 1 ([{fd=4, revents=POLLOUT}]) send(4, "\0040\1\0\0\1\0\0\0\0\0\0\6google\3com\0\0\1\0\1", 28, MSG_NOSIGNAL) = 28 poll([{fd=4, events=POLLIN}], 1, 5000)  = 1 ([{fd=4, revents=POLLIN}]) ioctl(4, FIONREAD, [204])               = 0 recvfrom(4, "\0040\201\200\0\1\0\v\0\0\0\0\6google\3com\0\0\1\0\1\300\f\0\1"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.1.1")}, [16]) = 204 close(4)                                = 0 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4 connect(4, {sa_family=AF_INET, sin_port=htons(1025), sin_addr=inet_addr("173.194.123.36")}, 16) = 0 getsockname(4, {sa_family=AF_INET, sin_port=htons(58830), sin_addr=inet_addr("192.168.1.13")}, [16]) = 0 close(4)   can any one please explain what is going on here ? specially connect on 127.0.1.1 as it is namsserver entry in my resolve.conf Why we need to make socket connection to 127.0.1.1 ? and how do we get response  from it ?

I am trying to understand how /etc/resolv.conf /etc/nsswitch.conf exactly works and what is significance of nameserver entry 127.0.1.1  I did strace ping google.com to get to know about the system calls involved , one part is :  stat64("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=172, ...}) = 0 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 4 connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.1.1")}, 16) = 0 gettimeofday({1413780874, 913366}, NULL) = 0 poll([{fd=4, events=POLLOUT}], 1, 0)    = 1 ([{fd=4, revents=POLLOUT}]) send(4, "\0040\1\0\0\1\0\0\0\0\0\0\6google\3com\0\0\1\0\1", 28, MSG_NOSIGNAL) = 28 poll([{fd=4, events=POLLIN}], 1, 5000)  = 1 ([{fd=4, revents=POLLIN}]) ioctl(4, FIONREAD, [204])               = 0 recvfrom(4, "\0040\201\200\0\1\0\v\0\0\0\0\6google\3com\0\0\1\0\1\300\f\0\1"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.1.1")}, [16]) = 204 close(4)                                = 0 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4 connect(4, {sa_family=AF_INET, sin_port=htons(1025), sin_addr=inet_addr("173.194.123.36")}, 16) = 0 getsockname(4, {sa_family=AF_INET, sin_port=htons(58830), sin_addr=inet_addr("192.168.1.13")}, [16]) = 0 close(4)   can any one please explain what is going on here ? specially connect on 127.0.1.1 as it is namsserver entry in my resolv.conf Why we need to make socket connection to 127.0.1.1 ? and how do we get response from it ?


$\text{Let }f:[0,1]\to \Bbb R\text{ be a continuous function}$ Evaluate the function $$\lim_{n\to \infty}\int_{0}^{1}x^nf(x)\,dx$$  Here is my work:  Given $\epsilon \gt 0$,since $f(x) \in C^0[0,1]$, by Weierstrass Approximation Theorem, there is a polynomial $p(x)$ s.t. $$|f(x)-p(x)|\lt \varepsilon$$ So we have  $$ \begin{align} \int_{0}^{1}x^n|f(x)-p(x)|\,dx & \lt \int_{0}^{1}x^n\varepsilon\, dx\\ & = \left[\varepsilon\,\frac{x^{n+1}}{n+1} \right]_{0}^{1}\\ & = \frac{\varepsilon}{n+1} \end{align} $$  Since $p(x)$ is a polynomial, suppose it has degree $m$, and has the form $$p(x)=a_0+a_1x+a_2x^2+\cdots+a_mx^m$$ $a_i\in \Bbb R\text{ for each }i$. Integrate it we get $$\int_{0}^{1}x^n\,p(x)\,dx=\frac{a_0}{n+1}+\frac{a_1}{n+2}+\frac{a_2}{n+3}+\cdots+\frac{a_m}{n+m+1}$$ By triangle inequality, $0\le |f(x)|\le |f(x)-p(x)|+|p(x)|$, so $$ \begin{align} 0\le \int_{0}^{1}x^n\,|f(x)|\,dx & \le \int_{0}^{1}x^n|f(x)-p(x)|\,dx+\int_{0}^{1}x^n|p(x)|\,dx\\ & \le \int_{0}^{1}x^n|f(x)-p(x)|\,dx+\int_{0}^{1}x^n\sum_{i=0}^{m}\lvert a_ix^i\rvert\,dx \end{align} $$ But we know that both $\int_{0}^{1}x^n|f(x)-p(x)|\,dx\text{ and }\int_{0}^{1}x^n\sum_{i=0}^{m}\lvert a_ix^i\rvert\,dx$ goes to $0 \text{ as }n\to \infty$ Then by pinching, $$\int_{0}^{1}x^n\,|f(x)|\,dx\to 0\text{ as }n\to \infty$$ then $$\int_{0}^{1}x^n\,f(x)\,dx\to 0\text{ as }n\to \infty$$  I don't I'm do the right thing? because I just come up with this idea, and seems strange.

I am trying to solve the following problem at the level of a senior undergrad analysis level. So, the problem is as follows: We are given a function $f$ which is continuous on the interval $\left [ 0,1 \right ]$, and the question is to find the limit: $$\lim_{n\rightarrow \infty}\int_{0}^{1}x^{n}f(x)dx\;.$$ The second part of the problem is to deduce the following limit: $$\lim_{n\rightarrow \infty}n\int_{0}^{1}x^{n}f(x)dx\;.$$  For the first part: I just did the following: For every $0\leq x< 1$: $x\leq M$, where $0< M< 1$. Then: $$\int_{0}^{1}x^{n}f(x)dx\leq M^{n}\int_{0}^{1}f(x)dx\;.$$ Then: $$\lim_{n\rightarrow \infty }\int_{0}^{1}x^{n}f(x)dx\leq \lim_{n\rightarrow \infty }M^{n}\int_{0}^{1}f(x)dx= 0.\int_{0}^{1}f(x)dx=0\;,$$ so $$\lim_{n\rightarrow \infty }\int_{0}^{1}x^{n}f(x)dx=\lim_{n\rightarrow \infty }f(1)\int_{0}^{1}1dx=f(1)\;.$$ Does that make sense? If not, please show me the correct one.  As for the second part, I have no idea what to do. Any help?


I am new to python, and I am trying to create a 2d list of list array. Below is two approach that I think should work, but one of them is actually not correct. board = [["."] * n for _ in range(n)] sth = [["." for _ in range(n)]] * n    when I perform assigned on [0][0] to replace '.' with 'Q' , sth initialize every row, while board only initialize first row. If list * n is a soft copy, and every list in each row of sth in the same, why would ["."] * n not a soft copy ? Here's the result before & after assignment. board[0][0] = 'Q', sth[0][0] = 'Q' board initialize: [['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.']] board assigned  : [['Q', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.']] sth initialize  : [['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.']] sth assigned    : [['Q', '.', '.', '.'], ['Q', '.', '.', '.'], ['Q', '.', '.', '.'], ['Q', '.', '.', '.']]

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


I didn't see the similar question. My question isn't a duplicate because I understand how to prove this. But I don't understand where the hint comes from. That question doesn't flesh it out.    Pretend the question didn't give the hint. How can you prognosticate (please see my profile) to Consider $(a*b)*(a*b)$? This trick is too magical and superhuman. I didn't see it. The other trick is to write $e *e = (a*a)*(b*b)$. How can you prognosticate this?

Prove that if $g^2=e$ for all $g$ in $G$ then $G$ is Abelian.   This question is from group theory in Abstract Algebra and no matter how many times my lecturer teaches it for some reason I can't seem to crack it.   (Please note that $e$ in the question is the group's identity.)  Here's my attempt though...  First I understand Abelian means that if $g_1$ and $g_2$ are elements of a group $G$ then they are Abelian if $g_1g_2=g_2g_1$...  So, I begin by trying to play around with the elements of the group based on their definition...  $$(g_2g_1)^r=e$$  $$(g_2g_1g_2g_2^{-1})^r=e$$ $$(g_2g_1g_2g_2^{-1}g_2g_1g_2g_2^{-1}...g_2g_1g_2g_2^{-1})=e$$  I assume that the $g_2^{-1}$'s and the $g_2$'s cancel out so that we end up with something like,  $$g_2(g_1g_2)^rg_2^{-1}=e$$ $$g_2^{-1}g_2(g_1g_2)^r=g_2^{-1}g_2$$  Then ultimately...  $$g_1g_2=e$$  I figure this is the answer. But I'm not totally sure. I always feel like I do too much in the pursuit of an answer when there's a simpler way.  Reference: Fraleigh p. 49 Question 4.38 in A First Course in Abstract Algebra.


Is there in the game any indication of how many wizards or clerics or druids of each level are in the world? I look for a number of those per regular person or per village/city of x size.  Same for magic items. What kinds of people could afford magic swords in times of war or charisma/social skill enhancing items?  How common is teleportation and mind-affecting magic and who can afford protection (in the form of magic items or recruiting the help of a caster) against it?  i have seen the thread who give what percentage of the population is for each level, but i was more looking for how many for each level by settlement/group/tribe/country depending of the size of the setllement/group/tribe/country.

This is kind of a variant of this  question. However, I'm looking for any specific rules regarding the basic math around spells and the availability of magic users.  Pathfinder's Golarion setting seems to be filled with inconsistencies centered around economy and magic. We're finding this very specifically in the Kingmaker campaigns, where a whole host of things just "don't add up".  The key problem seems to center around one very simple question.   How rare are spellcasters? Are they one in a million? one in a thousand? The obvious corollary, how much rarer are high level spell casters?   Are there any books investigating these ratios and their effect on a given world?


I understand that on is used for dates and at for times, as in . But what can I use when I have a string consists of both a date and a time? The issue is that I can’t change the date-time string to add at between the date and the time—so my options are:     On 19 January 2015 10:53   At 19 January 2015 10:53   Which one is the better option?

This must be a simple question for a native speaker.  I know that we use "on" with dates: I'll see you on January 1st.  And we use "at" with times: I'll see you at 17:30.  But what preposition has to be used when we speak for date and time:  I'll see you on January 1st at 17:30. looks ok.  But what in this case: It happened on 2014-01-01 17:30.  Is "on" correct when we are specifying the date and the time?   The date-time comes as a ready text as 2014-01-01 17:30 and I cannot modify it. I can only put text before the date-time string or after it.


How to make a script, which will write a string "signal caught" after sending 'interrupt signal' (after pressing ^C on the console, where the script was executed). On top of that after pressing third time CTRL-C it will ask user, if it should end (yes/no). If answer is "no" it will end.

I am trying to handle SIGINT/CTRL+C interrupt in such a way that if a user accidentally presses ctrl-c, he is prompted with a message, "Do you wish to quit?(y/n)". If he enters yes, then exit the script. If no, then continue from where ever the interrupt occurred. Basically, I need Ctrl-C to work similar to Ctrl-Z/SINTSTP but in a slightly different way. I have tried various ways to acheieve this but I didn't get the expected results. Below are few scenario which I tried.  Case:1  Script : play.sh  #!/bin/sh function stop() { while true; do      read -rep $'\nDo you wish to stop playing?(y/n)' yn     case $yn in         [Yy]* ) echo "Thanks for playing !!!"; exit 1;;         [Nn]* ) break;;         * ) echo "Please answer (y/n)";;     esac done }  trap 'stop' SIGINT  echo "going to sleep" for i in {1..100} do   echo "$i"   sleep 3    done echo "end of sleep"   When I run the above script, I get the expected results.  Output:  $ play.sh  going to sleep 1 ^C Do you wish to stop playing?(y/n)y Thanks for playing !!!  $ play.sh  going to sleep 1 2 ^C Do you wish to stop playing?(y/n)n 3 4 ^C Do you wish to stop playing?(y/n)y Thanks for playing !!!  $     Case:2  I moved the for loop to a new script loop.sh, thus play.sh becomes the parent process and loop.sh the child process.  Script : play.sh  #!/bin/sh function stop() { while true; do      read -rep $'\nDo you wish to stop playing?(y/n)' yn     case $yn in         [Yy]* ) echo "Thanks for playing !!!"; exit 1;;         [Nn]* ) break;;         * ) echo "Please answer (y/n)";;     esac done } trap 'stop' SIGINT  loop.sh   Script : loop.sh  #!/bin/sh echo "going to sleep" for i in {1..100} do   echo "$i"   sleep 3    done echo "end of sleep"   Output in this case is not as expected.  Output:  $ play.sh  going to sleep 1 2 ^C Do you wish to stop playing?(y/n)y Thanks for playing !!!  $ play.sh  going to sleep 1 2 3 4 ^C Do you wish to stop playing?(y/n)n $   I understand that when a process receives a SIGINT signal, it propagates the signal to all the child processes, thus my 2nd case is failing. Is there any way that I can avoid SIGINT being propagated to child processes and thus make the loop.sh work exactly the way it worked in the 1st case?  Note: This is just an example of my actual application. The application I am working on has several child scripts in play.sh and loop.sh. I should make sure that the application on receiving SIGINT, should not terminate but it should prompt the user with a message.


Describe the image of the set $\{z=x+iy:x>0,y>0\}$ under the mapping $w=\frac{z-i}{z+i}$  So from this mapping , I can see that $a=1, b=-i, c=1, d=i$ thus $ad-bc=i+i=2i \not =0$ so this is a Mobius transformation. Solving for $z$ I got  $$z=\frac{i+iw}{1-w}$$  for $w=u+iv$, we have   $$z=\frac{-2v+i(1-u^2-v^2)}{(1-u^2)+v^2}$$  so $x=\frac{-2v}{(1-u^2)+v^2}$ and $y=\frac{1-u^2-v^2}{(1-u^2)+v^2}$  Since $x>0$, $v<0$  and since $y>0$, $1-u^2 -v^2 >0$, thus $u^2 +v^2 <1$, this implies that the image is the interior of a unit circle center at the origin, but since $v<0$, we only take the negative part.


Question is to find (if any) $f: \mathbb{R} \to \mathbb{R}$ such that $f$ is non decreasing and the set of discontinuities is $\mathbb{Q}$.   I know a function $f :\mathbb{R} \to \mathbb{R}$ such that it is discontinuous at all rationals and continuous at irrational. But in the above question additional condition is imposed. So I am not able to find one.  Could anyone help me please. Thank you

Show that there exists a not decreasing function $f:(a,b)\rightarrow\mathbb{R}$ continuous on $(a,b)\setminus D$ and discontinuous on $D$ where $D$ is a countably infinite subset of $(a,b)$.  This is an exercise that I tried very last semester but my weak point is to get examples of functions. Can anyone help me with this?  *Moreover, one could indicate something for me to improve my skill with examples?


Referring to this question and answer:  I along with other immediately wondered why a low rep user was editing and posting as if they had the authority of a SE staff member:    Clicking on  reveals he is a SE Director, but technically any user could post such a claim in their Bio.  Danny further writes:     I'm working on getting a diamond added. As I typically don't "moderate", nor am I a developer, I've never needed the diamond before as the text in my profile usually suffices.   Which indicates he doesn't have the diamond because he doesn't generally "Moderate" and that character is generally reserved for mods.  Should SE Staff have a special character in their user name and if so which character should they have (a diamond or a different protected character)?  EDIT:  In the , one of the Mods/Staff mentions that "We don't want this to be an us vs. you site" and also "we like some of our staff to act as normal users under the radar". (both quotes paraphrased)  Why shouldn't a staff member have an account specifically marked as staff for posting official responses and a fly-under-the-radar account for interacting with the site?

Currently, SE employees are given diamonds wherever they need them. I agree with  on this to some degree, employees shouldn't be treated any different.  But... on meta, employees are different. They have the power to dole out official responses, and thus we should be able to differentiate between an employee and a normal user. Currently, only some employees have a diamond on MSO (see , ). This makes it confusing, especially when you see official-sounding posts like .  Now, giving diamonds to all employees on meta may not be the best solution to this. I don't think all employees want their precious inboxes spammed with all the suspensions that are doled out on meta, and other mod stuff. They won't really need the diamond powers either (though it wouldn't hurt).  So, I propose this:  Similar to how moderators have "Moderator" clearly on their profile    display "employee" on an employee's profile, along with the diamond if they have one. At least on meta.    It would imho be even better to display it on their usercards in some form, but that has already been shot down.  It would be even even better if non-MSO mods had greyed out diamonds, similar to , but that's just me wanting more shiny stuff ;-)


I'm an 3rd year undergraduate student, and this semester, I'm taking graduate course in one of my departments.  We have homeworks each week, and while doing the problems on those, I sometimes get stuck. In that case, sometimes I go to the instructor for some hints and discussions, and sometimes, if I really haven't made any progress in that question for long time, I search the answer onthe web (for example math.SE), and write that answer if it satisfies me.  In those latter cases, I put some notes/a disclaimer on the top of the question stating that "I've done these and these, but couldn't solve it, so I looked at the answer from the xxx website".  However, is this something that we indeed expected to do, or am I just making myself sometimes look like "incapable of solving even an elementary question" in the eyes of my instructor ?  Edit: My question is about the general norm in academia, not whether it is considered cheating or not.

Say you have a homework assignment and you're struggling with it. You ask a question about some portion of it on a site like physics.stackexchange or math.SE or stackoverflow.com, etc.  You then cite the help you received in your homework, as well as including a link to the post which helped you.  Given that you are removing the "dishonesty" part of the equation, is this still considered cheating? Or would a professor just not give you credit for the part which they feel you didn't do on your own?


I am writing a code for squeeze(s1,s2) that deletes each character in string s1 that matches any character in string s2 and I get "Segmentation fault (core dumped)" when I try to run the program. I believe the error comes from in how i call the function inside the main(). I am a beginner and I don't know how to call functions. Please help!  #include<stdio.h> void squeezer(char s[], char c[]);  main() {     squeezer("abcdefgabcdefgabcdefg", "abcd"); } void squeezer(char s[], char c[]) {     int i,j,k,z;     for(k=0; c[k] != '\0'; k++) {         for(i=j=0;s[i] != '\0';i++) {             if (s[i] != c[k]) {                 s[j++] = s[i];             }         s[j] = '\0';         }     }       for(z=0; z < j; z++)         printf("%c",s[z]); }

The following code receives seg fault on line 2:  char *str = "string"; str[0] = 'z';  // could be also written as *str = 'z' printf("%s\n", str);   While this works perfectly well:  char str[] = "string"; str[0] = 'z'; printf("%s\n", str);   Tested with MSVC and GCC.


I am currently trying to review Low Quality Posts, but every time I flag a question, the flag gets submitted but it comes back with:     Error Occurred When Reviewing this Item     I then have to skip to get to next item, though my flag has been created.  This is occurring a lot, but the rest of SO is working correctly for me, and this used to work.    Is anybody else experiencing this issue?  Has something changed?   I am running:   Chrome 30.0.1599.101 OS X Mavericks     Update:  I have tested in Firefox on the same machine and can't reproduce. So either the error was intermittent or isolated to Chrome. I'm having to wait for more Low Quality posts to appear so I can test again in Chrome.    Update (2):  I have tested again in Chrome and the issue is still occurring.     Resolved:  Issue was caused by the local browser cache. It must have cached a broken script.

On approving an edit, I just get this pop up since morning. At first I thought there might be some internet connection issue, but this is now the 3rd to 4th time I got the same error; also, the review is accepted because on refresh I can see my name with approved text beside, but it still throws this error.    I am on a Windows 7 machine, running Firefox 24 (Icognito/Private Mode)    Also, this happens only when edit(1) is written on an question/answer, I don't go to review queue and approve, these reviews were directly loaded from the notification beneath the question/answer.  Martijn Pieters reproduced the problem from the review queue three times; each time the improve option was picked, accepting the suggested edit but editing the post some more. The network console shows that posting to https://stackoverflow.com/review/task-reviewed fails, the server responds with a 404 error:  Request headers: POST /review/task-reviewed HTTP/1.1 Host: stackoverflow.com Connection: keep-alive Content-Length: 137 Accept: application/json, text/javascript, */*; q=0.01 Origin: http://stackoverflow.com X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 Content-Type: application/x-www-form-urlencoded DNT: 1 Referer: https://stackoverflow.com/review/suggested-edits/3575396 Accept-Encoding: gzip,deflate,sdch Accept-Language: en,en-US;q=0.8,nl;q=0.6,nb;q=0.4,no;q=0.2,de;q=0.2,fr;q=0.2 Cookie: <redacted>  POST data: taskTypeId=1&reviewTaskId=3575396&taskResultTypeId=5&fkey=f8791a329b445b658876f4d3afe7961e&postCommentId=null&taskResultSubtypeFlags=null  Response headers: HTTP/1.1 404 Not Found Cache-Control: private Pragma: no-cache Content-Type: application/json X-Frame-Options: SAMEORIGIN Date: Fri, 13 Dec 2013 12:04:53 GMT Content-Length: 0   On the  itself, no record is made of the accept; instead the suggested edit is recorded as approved by 3 people not including Martijn Pieters. In this case the improve review arrived too late.  In , improve again resulted in the error, but the Community account is shown rejecting the edit.