Due to long use and positive reputation across other stack exchange sites, I've started getting 100 reputation immediately on joining a new stack-exchange site. A question interested me in a site I had just joined. It showed that I had 100 reputation. However, on trying to answer the question I found that I was blocked with a message that because this question was highly active, I needed to earn 10 reputation before answering. Reloading the page did not resolve this. Was this by design because my reputation did not come from that particular site? Or was that a bug?

Questions can be protected (i.e. marked "highly active").   What does it mean for a question to be protected? Why are some questions protected? Who can protect and unprotect questions? Who can answer a protected question? How are protected questions displayed? When should I protect or unprotect a question? When does the Community user protect a question?


The classical version of k-means uses the Euclidean distance in the first step, and the arithmetic mean (the value center) in the second step. Is k-means generalizable to other distances and other operations than the arithmetic mean so that it converges? There are special cases like k-median, where the distance is city-block, and the center's value is the median of the cluster points.

Is there a specific purpose in terms of efficiency or functionality why the k-means algorithm does not use for example cosine (dis)similarity as a distance metric, but can only use the Euclidean norm? In general, will K-means method comply and be correct when other distances than Euclidean are considered or used?  [Addition by @ttnphns. The question is two-fold. "(Non)Euclidean distance" may concern distance between two data points or distance between a data point and a cluster centre. Both ways have been attempted to address in the answers so far.]


I know for words starting with the letter 'h' the usage of "A" vs. "An" depends on how its pronounced.     A - Before a word starting with a pronounced, breathy “h,” use “a.” Examples: A hotel; A happy time; A historical day; A healthy, happy baby.      An - Use “an” with words beginning with an unpronounced “h.” Examples: An herb garden; an hour; an honor; An heir.         But what about when your word is just the character 'h' such as in the sentence:     This word starts with a/an 'h'   "An" seems to fit better when I say it, and I suppose it fits the definition of not starting with a breathy "h" sound. But also its not an unpronounced 'h' because that's literally all you're pronouncing.  Which is correct?

A basic grammar rule is to use an instead of a before a vowel sound. Given that historic is not pronounced with a silent h, I use “a historic”. Is this correct? What about heroic? Should be “It was a heroic act” or “It was an heroic act”?  I remember reading somewhere that the h is sometimes silent, in which case it’s an, and when the h is pronounced, it’s a. But then I also remember reading that it depends on which syllable is stressed. And I also think I read somewhere that it might differ between British and American English.  Personally, I pronounce the h, and believe that a is correct. I find that it sounds incorrect to use an and pronounce heroic without the h.  So how do I know when to use a and when to use an with a word beginning with the letter h? Are both acceptable or is there one that is correct?


I remember there was a setting in Windows Server 2003 that made a user account on the domain auto-logon when the computer booted up. It was just one setting on the server, and not a registry edit on the local computer. Does anybody know what it was called and where to find it?

I have a computer with Windows XP installed.  My user does not have a password.  When Windows starts, it goes to the login screen. Because my user has no password, is there any way to bypass this screen, and log in automatically?


Jesse didn't believe that there are notebooks, Then when he saw it for himself he believed the was.

What's a word or phrase that could be used to describe a person who needs to see the evidence for a claim in-person before believing it?


I need to revert back to Windows7 for some reasons, I have Ubuntu 14.04 installed. I have extracted my windows7 iso and copy it to a pen drive but when I restart my laptop I cannot boot it, F12 wont work.  I've been searching around but I don't understand how to fix this issue, what is the simplest way to go back to Windows7?

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


Since Lion, I have used the AlwaysAppendSearchDomains trick on mDNSresponder to resolve names with dots in search domains.   In yosemite this doesn't work any more. In fact, mDNSresponder doesn't seem to be running:  $ ps ax | grep -i dns | grep -v grep $

This is a direct follow-on to . , I'd add the "-AlwaysAppendSearchDomains" argument to the mDNSResponder plist file so that all local resolver lookups added the search domains, regardless of whether there was a period in the label to be looked up. For example, whether I try to ssh to hostname foo.bar or foo, the search domain of baz.com should be tried, not only for the latter case, as was (and is) the default behavior.   Now, it looks like the mDNSResponder is gone, replaced with discoveryd. I cannot find a similar option to get it to always appending the search domain. Suggestions? I'd rather not go the route of using a non-default local resolver, but I'd consider it as an option. For now, I'll just type in the long FQDNs, but I'd really rather not.  Thanks, Pete


How can I use the spotlight in blender to cast shadows such and the batman symbol, or other "cool" lighting effects. I went into the compositor and tried assigning it a material, but that didn't work.

While trying to use the new cycles volumetric rending features to create  (with the intention of updating ), I have found this to be a little trickier than I anticipated.    When I create a basic setup with a spot lamp (sun lamps don't seem to work, not sure if that is a result of their one directional nature or what..) and a world material like this:    Which gives me this (500 samples):    The problems with this that make me think that I'm missing something (aside from the rendertime and noise, which I understand to be a part of using bleeding edge new features) are:   The background shader/sky texture isn't visible at all (volume is too dense?) The lamp needed to be set to 50000 strength (this is of course dependent on the distance from the camera, but the kinds of strengths required to get some nice defined rays will blow everything out if volumes are disabled)   I can't seem to get a straight render (no compositing tricks) to look anything remotely like the pretty image in the release notes:        (source: )     Is this just how it works? Or is there some trick I have missed (not counting compositing/renderlayer tricks)?


I have two polygon layers. One containing vegetation features and one containing the borders of different monitoring areas. I want to calculate the total size of different vegetation types per monitoring area, however, the vegetation features often go over the borders of two areas (see example below, with red monitoring area border).    I want to split the vegetation features that cross borders so that they fit to the borders of the monitoring areas. How can that be done? I found the split line by line tool in QGIS but couldn´t find the same for polygon. Splitting manually is not an option as I have many thousand features.

I have two layers :    The red layer with 2 features : 1 and 3. The green layer with 3 features : area 1, area 2 and area 3.   I need a layer which contain my green layer split by my red layer. In that example, I would have a polygon layer with 6 features in it. I would like the attribute table like :  area 1 | NULL area 1 | 1 area 2 | NULL area 2 | 3 area 3 | 1 area 3 | NULL   I didn't see such an algorithm in QGIS. What is the best way to do that ?


I've heard the total energy is zero, but I've also heard it cannot be said to be zero since there's so much unknown stuff in the universe. Is that true?

In popular science books and articles, I keep running into the claim that the total energy of the Universe is zero, "because the positive energy of matter is cancelled out by the negative energy of the gravitational field".  But I can't find anything concrete to substantiate this claim. As a first check, I did a calculation to compute the gravitational potential energy of a sphere of uniform density of radius $R$ using Newton's Laws and threw in $E=mc^2$ for energy of the sphere, and it was by no means obvious that the answer is zero!  So, my questions:   What is the basis for the claim – does one require General Relativity, or can one get it from Newtonian gravity? What conditions do you require in the model, in order for this to work? Could someone please refer me to a good paper about this?


Let  $a,b,c,z$ be complex numbers such that for all $|z| \le 1$ we have $|az^2+bz+c| \le 1$. How to prove that $|bc| \le  \frac{3 \sqrt{3} }{16}$?

is one I listen to.  Does anyone else have a recommendation?


I installed qt5.4 from  in Ubuntu 14.04, but when I run:   qmake -v   I always get the old version Qt5.2.1, although I think it is installed here Qt version 5.4.2 in /opt/qt54/lib. Can anyone tell me how to make sure that Qt5.4.2 is installed properly?   Thanks

I have installed Qt5 from the Qt5 project site, to the following directory   /opt/Qt5    I would also like to mention that I had Qt4 installed previously, I have removed all instances of Qt4 through the software center.   Now that I issue designer from the command prompt, the system gives the following error:   designer: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/designer': No such file or directory   What can be done to correct this problem?


Although I'm frequently using the command line terminal, I find it very irritating when I cannot execute applications from Nautilus.  I sometimes write small Swing based Java apps and I've just noticed how the OpenJRE disappeared from the "Open with..." options.  I do have the OpenJRE installed through the OpenJDK.  Screenshots attached. /// actually I cannot! Why do I need a reputation of 10? \\  Thanks for your help!

I have run    sudo apt-get install openjdk-7-jre   It says   Reading package lists... Done Building dependency tree        Reading state information... Done openjdk-7-jre is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 229 not upgraded.   However, In my /usr/share/applications folder, there is no openjdk-7-jre.desktop. The only file I have found on my computer related to openjdk is OpenJDK Java 7 Policy Tool. What have I done wrong? I am using it to be able to run .jar files with a doubleclick. I can run them from terminal already, but there is no open with option for java


I am testing a second solution that has been provided to me here, for checking and recording each check box that has been checked. First solution works like a charm but the second more efficient solution does not even run.  for (x in aL.results) {   aLIds.push(aL.results[x].listing_id);   aLTitles.push(aL.results[x].title);   aLQuantities.push(aL.results[x].quantity);   aLDescs.push(aL.results[x].description);   aLTaxPaths.push(aL.results[x].Tax_path);   aLTaxIds.push(aL.results[x].Tax_id);   aLTags.push(aL.results[x].tags);   aLUrls.push(aL.results[x].url);   aLPrices.push(aL.results[x].price);   aLViews.push(aL.results[x].views);   aLHearts.push(aL.results[x].num_favorers);    $('#tblListings').append(     '
' + '<input type="checkbox" name="updateListings[]" value=' + x + ' >	' + '' + aLQuantities[x] + '	' + '' + aLTitles[x] + '	' + '' + aLPrices[x] + '	' + '' + aLViews[x] + '	' + '' + aLHearts[x] + '	' + '
'   ); }  $('input:checkbox').change(function() {     alert('ah');     var uLIndex = $('input:checkbox:checked').map(function() {         return this.value;     }).get();     console.log(uLIndex); });

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.


This is a short mathematical puzzle from mindciphers.com which says :  The London racetrack needs to submit its top three horses to the Kentucky Derby next month in order to compete for a prize. However in a recent electrical storm, all the racetrack's previous race history was erased such that no one knows the previous times of any of the horses. To make matters worse, each horse looks identical and it is impossible to remember which ones were the fastest.  London racetrack is home to 25 horses, but their track can only race 5 horses at a time. What is the fewest number of races that can be conducted in order to determine the 3 fastest horses?  Shouldn't be the answer be 6,Am I correct? Logically speaking, dividing 25 horses into 5 groups and racing each group would give us the fastest among each and then racing the winner from each group will give us the horses eligible for 1st,2nd and 3rd positions but i am still confused why is the solution to problem is 7 ..  The solution to the problem says that :  Divide the 25 horses into groups of 5 and race each group independently. (5 races)Place the winner of each preliminary race in a Championship race to determine the fastest horse of the 25. (1 race).Now you have the fastest horse but you still need to determine the 2nd and 3rd fastest horse. You can start by eliminating all horses that finished 4th or 5th in the preliminary races since there are clearly three horses faster than each of them (15 horses remaining). Next, you can eliminate all the horses from the groups that the 4th and 5th place Championship horses came from for the same logic (9 horses remain). Next, you can eliminate the horses that placed 2nd and 3rd from the group where the 3rd place Championship horse came from, as well as the horse that placed 3rd from the group where the 2nd place Championship horse came from (6 horses remain). Lastly, you can set aside the winner of the Championship race as s/he is clearly the fastest of the whole lot (5 horses remain).     Now that you have 5 horses left, you can determine the 2nd and 3rd fastest horses of the entire group of 25 by the winner and 2nd place finisher of this last and final race. (1 race) ===>>>> 7 races in total.

There are $25$ horses. You can take $5$ horses at a time and race them. Each horse always finishes the race in the same amount of time, and there are no ties. The only information you get from each race is the order that the $5$ horses finished in. What is the smallest number of races you need to find the $3$ fastest horses, in order?   I found this problem on  and cannot figure out the best answer. Please help.


ClassName    BookCode First          2 Second         2 Third          2 First          3 Fourth         3 Fifth          3   I want to concatenate this into like this :  ClassName             BookCode First,Second,Third       2 First,Fourth,Fifth       3

Consider a database table holding names, with three rows:  Peter Paul Mary   Is there an easy way to turn this into a single string of Peter, Paul, Mary?


How do we find the IP of a server address (like http://google.com is 209.85.148.103) using the Windows CMD?

I need to know the ip address of another machine in a lan network.  What is the Windows command for getting ip address from machine name and vice versa?


I need to write a method that takes both the name and the type of a passed argument. For example, a call might look like this:  MyMethod( nameof(MyVar), MyVar.GetType() );   Is there any way to simplify this call so that I pass only one argument instead of two, but the method can still figure out both the name and type of that passed argument? The only way I know is by creating a macro and running the source through a pre-build external C# preprocessor. Then the call could look something like:  MyMethod( MyVar );   ...but I want to avoid using a preprocessor.

Let me use the following example to explain my question: public string ExampleFunction(string Variable) {     return something; }  string WhatIsMyName = "Hello World"; string Hello = ExampleFunction(WhatIsMyName);  When I pass the variable WhatIsMyName to the ExampleFunction, I want to be able to get a string of the original variable's name. Perhaps something like: Variable.OriginalName.ToString()  Is there any way to do this?


I have small question. A want to create a login system, which will remember logged user. But there are lots of security problems and I dont know how to do it correctly. So the target is, when user logs in, browser save something into cookies and when user open page again, it will select his data from db according to cookies and save it into session? But what to save to cookies and why? Thank you very much.

I want my website to have a checkbox that users can click so that they will not have to log in each time they visit my website. I know I will need to store a cookie on their computer to implement this, but what should be contained in that cookie?    Also, are there common mistakes to watch out for to keep this cookie from presenting a security vulnerability, which could be avoided while still giving the 'remember me' functionality?


In my high school physics class, I was taught that the energy of light is dependent only on the frequency, as demonstrated in the equation $E = h \cdot \nu$.  My question is, why is amplitude part of the equation? As the amplitude of the light increases, it gets more intense, i.e. brighter (ignoring that more light also makes things brighter), so wouldn't it make sense that light that has a greater amplitude also has more energy? And as an extension of that assumption: that lower amplitudes have less energy?  EDIT: not a duplicate, because I'm asking why amplitude is not part of the energy equation, not if a particle has amplitude.

Maybe an illegal question. Sorry.  Having read that a photon has both wave and a light characteristics it is natural for a novice like myself to wonder "what is the amplitude? "  Naturally I have looked on wiki and other sources and there are a number of answers some of which appear not so much to contradict one another of varying opinions of which is the most meaningful in physics.   I seem to get a higher number of physics sources saying the amplitude depends on how many photons you have and if you have one the question has no meaning.  Of course I have not idea if this is accurate or how one would even test this.   Maybe there are some physics teachers in the audience that can give me a layman's intuition with a little math tossed in.


Playing through the story in No Man's Sky, and just got to the part where I discover the distress beacon which reveals the name of Artemis.  Right next to it was an abandoned ship.  It had a button to "Add to Collection."  I added it, then discovered that it needs a ton of repairs.  I didn't see another ship in the map, although I didn't look that hard.  Basically I'm asking, will I be able to get my old ship back, or will I have to struggle through and repair all the new ones.  I've repaired the thrusters and hull, I think, so I should be able to get it to a station if absolutely necessary.

I found a ship from a distress signal and misunderstood the inventory prompts when switching to it so all of my old ships inventory is still on the old ship. I have no idea where I left it but I just want to know if it is worth searching for it at all? Will it still be in the same place and will it have everything it had in it before the switch?


In Gravity, when they get back to the ISS, she was barely holding onto him, but they were both stopped.  Why, then, did he have to let go or otherwise he'd pull her with him?  As far as I could tell, their momentum, at least in relation to the ISS, had been stopped.

In the scene where Dr. Ryan Stone's (Sandra Bullock) leg is entangled in Soyuz's parachute cords and she is tethered with Matt Kowalski (George Clooney) through a strap, there is tension in the strap, suggesting act of some external force. Where is this force coming form that is causing tension in the strap and pushing both Dr. Ryan and Matt outwards?  I'm guessing that the tension might be coming from centrifugal force, but immediate events before this scene, as well as other parts of ISS in same scene do not suggest presence of such force (or presence of any kind of rotation).


I could do \subsection{} and \subsubsection{} but not \subsubsubsection{}. This command does not seem to be available in LaTeX. Is there an alternative command?

I have a document which requires many levels of sectioning. I have sections, subsections and subsubsections, but require one more level below that. I can't change the sections to be parts and move everything up a level, as this document will eventually be included in another document which has parts/chapters already.  I see that the \paragraph command is used for defining the section level below subsubsection, but that doesn't produce headings in the same way that subsection and subsubsection do. Is there any way to either (1) change the \paragraph command so that it works like subsubsection but just adds another number - ie. 1.2.3.4 or (2) create a \subsubsubsection command to do the same thing?


Let $E=F[\alpha]$, $\alpha$ is algebraic over $F$ and $[E:F]$ is odd. Prove that $E=F[\alpha^2]$. Now clearly $[F[\alpha^2]:F]|[E:F]$ so $[F[\alpha^2]:F]$ is also odd. But how can we show that $E=F[\alpha^2]$?

I have a question about simple field extensions.  For a field $F$, if $[F(a):F]$ is odd, then why is $F(a)=F(a^2)$?


I have several child classes that I would like to not have to rewrite certain initialized code for.. I've tried something like..  #include <iostream>  struct A {    A() { init(); }    virtual ~A() {}    void init() { load(); }     virtual void load() = 0; };  struct B : public A {     void load() { std::cout << "loading.." << std::endl; } };  int  main(int argc, char* argv[]) {     A* a = new B; delete a;     return 0; }   Which gives the runtime error/exception - "pure virtual method called"..  I've read through other threads that explain that this is not possible; but I don't see any solution besides being forced to re-write the same code over and over in the child class.  Is there a better way to encapsulate this?  (Other than doing this in the child constructor..)

I know that calling a virtual method from a base class constructor can be dangerous since the child class might not be in a valid state. (at least in C#)  My question is what if the virtual method is the one who initializes the state of the object ? Is it good practice or should it be a two step process, first to create the object and then to load the state ?  First option: (using the constructor to initialize the state)  public class BaseObject {     public BaseObject(XElement definition) {         this.LoadState(definition);     }      protected abstract LoadState(XElement definition); }   Second option: (using a two step process)  public class BaseObject {     public void LoadState(XElement definition) {         this.LoadStateCore(definition);     }      protected abstract LoadStateCore(XElement definition); }   In the first method the consumer of the code can create and initialize the object with one statement:  // The base class will call the virtual method to load the state. ChildObject o = new ChildObject(definition)   In the second method the consumer will have to create the object and then load the state:  ChildObject o = new ChildObject(); o.LoadState(definition);


My method constructor accepts a template parameter value and I know templates can be used in the implementation file (.cpp) by preceding each method with  template<class T>; classname<T>::memberfunction(){ }   When i put the definition of my constructor together with the class definition, the error doesn't show. For learning purposes, i want to put the implementation on a seperate file .cpp   I'm getting this error:     Severity  Code    Description Project File    Line    Suppression State   Error LNK2019 unresolved external symbol "public: __cdecl   myclass::myclass(int)" (??0?$myclass@H@@QEAA@H@Z) referenced   in function   main  ConsoleTestProject  C:\Users\Winux\Desktop\MINE\Project\Lab1\ConsoleTestSolution\ConsoleTestProject\ConsoleTestProject.obj  1   How do you properly put the implementation in the cpp file?  I saw suggested similar questions but not specific to my error and problem. Here's a simple code on how to recreate the bug. For simplicity, i did not include the getter and setter of the field.  myclass.h  #pragma once  #ifndef myclass_h #define myclass_h  template <class Type> class myclass { private:     Type value;  public:     myclass(Type value); }; #endif    myclass.cpp  #include "myclass.h"  template <class Type> tree<Type>::myclass(Type value) {     this->value = value; }   mysample.cpp  #include <iostream> #include "myclass.h"  int main() {     myclass <int> aclass(10);      return 0; }

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.)


One of the first knives I was ever given was a .  Over my years of use, I've never put much thought into the cut-outs along the side of the blade (which appear to be variously referred to as "hollows", "scallops", or a "Granton edge") which many santoku-style knives seem to feature.  Just to be clear, I'm talking about the oval indentations, evenly spaced down the side of the knife face, as prominently shown on this similar model:    I idly noticed these the other day and started a bit of research into their function, but what I found wasn't exactly definitive.   make them sound like quite an advantage:     ...it's the enhanced slicing ability - without shredding, ease of cutting and better food release that makes this particular knife design so popular with professional chefs and home cooks alike.   I question this, as I never noticed any of the professional chefs I've worked with in the past using a scalloped-sided blade, and I personally have never noticed a significant performance difference between my santoku and other knives of similar thickness.  Likewise, there seems to be  about whether this feature is actually effective for its stated purpose.  Many users seem to think that there's no real difference.  So, my main question: has anyone conducted a comparison of scalloped vs. non-scalloped knife designs?  Was there any significant difference?  In addition, some follow-on questions that an ideal answer could address:   What's the principle that these cut-outs supposedly work on?  In other words, if they work: why? Does the prominence of the cut-outs matter?  They're fairly subtle and shallow on my Wusthof, but are they more effective if deeper/more prominent, like on ? Is there a particular method that makes the best use of these cut-outs?  For example, do they have more effect when using a slicing motion across the food, as opposed to a chopping motion straight down to the board?   EDIT: Let me clarify, I'm not asking about general knife preferences here.  There are tons of other answers on this site related to what to look for in a knife, and I'm experienced enough to know what I like, and what works well.  But, if I were faced with a choice between two knives, identical in every way except that only one had scallops, could I anticipate any noticeable difference in their performance?

I haven't been able to find a post specifically on fluted knives, so hopefully this isn't a duplicate.  I was wondering if fluted knives actually work. I came across a comment (possibly an Amazon review) that fluted knives don't actually help in preventing vegetables from sticking to the knife -- causing the user to have to still have to stop and remove the cut product.   I've never used a fluted knife, so I literally have no idea. I was wondering what the general consensus on SA was: Have you noticed that a fluted knife makes enough of a difference to purchase the fluted version of a particular knife over the non-fluted version?


n=raw_input("Enter no. of numbers in Fibonacci series: ") n=int(n) fib=[]    fib[0]=0   fib[1]=1   for i in range(2,n):     fib[i]=(fib[i-1])+(fib[i-2])    print fib      The error I'm getting: IndexError: list index out of range Help me with the mistake.

I had originally coded the program wrongly. Instead of returning the Fibonacci numbers between a range (ie. startNumber 1, endNumber 20 should = only those numbers between 1 & 20), I have written for the program to display all Fibonacci numbers between a range (ie. startNumber 1, endNumber 20 displays = First 20 Fibonacci numbers). I thought I had a sure-fire code. I also do not see why this is happening.  startNumber = int(raw_input("Enter the start number here ")) endNumber = int(raw_input("Enter the end number here "))  def fib(n):     if n < 2:         return n     return fib(n-2) + fib(n-1)  print map(fib, range(startNumber, endNumber))   Someone pointed out in my Part II (which was closed for being a duplicate - ) that I need to pass the startNumber and endNumber through a generator using a while loop. Can someone please point me in the direction on how to do this? Any help is welcome.    I'm a learning programmer and I've run into a bit of a jumble. I am asked to write a program that will compute and display Fibonacci's Sequence by a user inputted start number and end number (ie. startNumber = 20 endNumber = 100 and it will display only the numbers between that range). The trick is to use it inclusively (which I do not know how to do in Python? - I'm assuming this means to use an inclusive range?).  What I have so far is no actual coding but rather:   Write Fib sequence formula to infinite Display startNumber to endNumber only from Fib sequence.   I have no idea where to start and I am asking for ideas or insight into how to write this. I also have tried to write the Fib sequence forumla but I get lost on that as well.


Vacuum is said to have an intrinsic impedance. What is the source of this? Impedance is quite understandable in bulk matter, but I'm unable to comprehend it's presence in vacuum.

On Wikipedia, the  $Z_0$ is defined as square root of the ratio of the permeability of free space $\mu_0$ to the permittivity of free space $\epsilon_0$, i.e. $$Z_0 = \sqrt{\mu_0 / \epsilon_0} \, .$$ The value is approximately 377 Ohms.  Now impedance is described as an impeding effect to flow of something, it makes more sense for electric current travelling in a wire where the characteristic impedance of the line (as the line consists of capacitance and inductance per unit length) prevents the flow of AC/DC flow.  Why in the world does free space have a characteristic impedance? That makes no sense to me. Wires makes a lot of sense, but free space having 377 ohm of impedance is too much and not clear why such a value exists.


Is there a better way to get the summation of $$\sum\limits_{i=1}^n\left\lfloor\frac ni\right\rfloor$$ I would like to know a way that is better than the complexity of $O(n)$ ... because there seems to be a pattern in the way all the floor values decrease .   This is a code that does it in less than O(n) complexity but I am unable to prove it why it works             long long N;         cin >> N;         long long K = 1, mn = N, mx, sum = 0;;         while (mn > 0)         {             K = N / mn;             mx = N / K;             mn = N / (K + 1);                        sum += (mx - mn)*K;         }

In a few programming contexts, I've come across code along these lines:  total = 0 for i from 1 to n     total := total + n / i   Where the division here is integer division. Mathematically, this boils down to evaluating  $$\sum_{i = 1}^{n}\left\lfloor\, n \over i\,\right\rfloor.$$  This is upper-bounded by $n H_{n}$ and lower-bounded by $nH_{n} - n$ using the standard inequalities for $\texttt{floor}$'s, but that upper bound likely has a large gap to the true value.  Is there a way to either get an exact value for this summation or find some simpler function it's asymptotically equivalent to?


When refering to the rate or probability of getting a false alarm from any kind of system for fault detection, I usually see "false alarm rate" writen, but I think it should be "false-alarm rate". Are both of them correct?  For instance, when writing this question, I also thought about writing "fault-detection system", but I had the same doubt: with or without the hyphen?  [EDIT] CONTEXT: The term "false alarm" is commonly used in quality control, statistical process control, etc., and is equivalent to "false positive", which is maybe more widespread.

I'm currently reading "Assuming a mantle of power" from International New York Times (May 14, 2015), and the article is about a soft power look that female leaders are donning, with pencil skirts and three-quarter-sleeved jackets being the best examples of the look.   Then, I came across the following phrase:     Put simply: written one pencil-skirt, three-quarter-sleeved jacket suit critique, written ’em all.    Is "one" the determiner? And are "pencil-skirt" and "three-quarter-sleeved" adjectives? Is "critique" being a noun that "one" modifies? Then what is "jacket suit"?   I guess what I'm really asking is how come there are no hyphens between "sleeved" and "jacket;" and "jacket" and suit"? As far as I know to make a compound adjective that modifies a noun before it must be hyphened.   Not comprehending these mechanics here, I'm totally confused what the author is trying to convey here.  Can somebody explain what the meaning of the phrase and all the hyphens here? Or if they are used wrong, maybe suggest the right way to use them?


This is homework but I would appreciate a hint : If $(a,b)=1$ and $(\frac{a}{b})^m=n$ then show $b=1$ From $(\frac{a}{b})^m=n$ we can conclude that $a^m=n b^m$ so $b^m | a^m$ But what next? It’s obvious that because of $(a,b)=1$ b should be 1 to make that happen but how should I write it down ?

It is well known that $\sqrt{2}$ is irrational, and by modifying the proof (replacing 'even' with 'divisible by $3$'), one can prove that $\sqrt{3}$ is irrational, as well.  On the other hand, clearly $\sqrt{n^2} = n$ for any positive integer $n$.  It seems that any positive integer has a square root that is either an integer or irrational number.        How do we prove that if $a \in  \mathbb N$, then $\sqrt a$ is an integer or an irrational number?      I also notice that I can modify the proof that $\sqrt{2}$ is irrational to prove that $\sqrt[3]{2}, \sqrt[4]{2}, \cdots$ are all irrational.  This suggests we can extend the previous result to other radicals.        Can we extend 1? That is, can we show that for any $a, b \in \mathbb{N}$, $a^{1/b}$ is either an integer or irrational?


How can I verify that the second static method was invoked within the first static method using the PowerMock framework?  public class A {     public static int firstMethod(String s) {         return secondMethod(s, 10);     }      public static int secondMethod(String s, Integer i){         return /*some expression*/;     } }   Update:  I haven't see yet any solution using the PowerMock framework. And definitely there are no acceptable answers for me in the .  Update2:  @Test public void test() {     PowerMockito.mockStatic(A.class);     Mockito.when(A.secondMethod(Mockito.anyString(), Mockito.anyInt())).thenReturn(1000);     A.firstMethod("test");     PowerMockito.verifyStatic(); }

I need to find the caller of a method. Is it possible using stacktrace or reflection?


I want to automation of the different steps by adding a schedule to the batch. By launching a single class (CRON creation). Setup the launch of the multiple phase throughout the time.  Example:   Phase 1 : NOW + 1hour Phase 2: NOW + 6 days Phase 3: NOW + 10 days Phase 4: NOW + 12 day   How to set the CRON_EXPR for the above phases?  I have created this class. Could anyone plase help me to complete this class?  global class ScheduleBatch_AnonymizeEmail implements Schedulable {        /*         Call this from Anonymous Apex to schedule at the default regularity       */   global static String schedulePhase1() {     Datetime sysTime = System.now().addHours(1);      String chronExpression = '' + sysTime.second() + ' ' + sysTime.minute() + ' ' + sysTime.hour() + ' ' + sysTime.day() + ' ' + sysTime.month() + ' ? ' + sysTime.year();     ScheduleBatch_AnonymizeEmail job = new ScheduleBatch_AnonymizeEmail();     return System.schedule('Email Anonymization Phase1', chronExpression, job);   }   global static String schedulePhase2() {     Datetime sysTime = System.now().addDays(6);      String chronExpression = '' + sysTime.second() + ' ' + sysTime.minute() + ' ' + sysTime.hour() + ' ' + sysTime.day() + ' ' + sysTime.month() + ' ? ' + sysTime.year();     ScheduleBatch_AnonymizeEmail job = new ScheduleBatch_AnonymizeEmail();     return System.schedule('Email Anonymization Phase2', chronExpression, job);   }   global static String schedulePhase3() {     Datetime sysTime = System.now().addDays(10);      String chronExpression = '' + sysTime.second() + ' ' + sysTime.minute() + ' ' + sysTime.hour() + ' ' + sysTime.day() + ' ' + sysTime.month() + ' ? ' + sysTime.year();     ScheduleBatch_AnonymizeEmail job = new ScheduleBatch_AnonymizeEmail();     return System.schedule('Email Anonymization Phase3', chronExpression, job);   }   global static String schedulePhase4() {     Datetime sysTime = System.now().addDays(12);      String chronExpression = '' + sysTime.second() + ' ' + sysTime.minute() + ' ' + sysTime.hour() + ' ' + sysTime.day() + ' ' + sysTime.month() + ' ? ' + sysTime.year();     ScheduleBatch_AnonymizeEmail job = new ScheduleBatch_AnonymizeEmail();     return System.schedule('Email Anonymization Phase4', chronExpression, job);   }    global void execute(SchedulableContext sc) {     // This is good practice if you are likely to be processing a     // lot of records at a time     Batch_Class b = new Batch_Class ();     Database.executeBatch(b);   } }   is this correct?

I have a Apex batch class which I would like to schedule at a particular date time. The date time is stored in a variable and changes dynamically. ex Datatime scduleDateTime = datetime.now() ; I want to schedule the apex batch file to run at this datetime variable value.  How can I do that using system.scheduleBatch()  I started with this but could'nt see how I can specify a datetime variable in here:  datetime d = datetime.now(); sampleapexbatch b = new sampleapexbatch(d); System.scheduleBatch(b,'Sample Job',XXXXXXXX)   Any help is appreciated!


I'm trying to create a individual List with a templated value, but unfortunately I can not link from my List to the ListElements with templates.  In my main I call List<int> list1; to create a instance of the class List. A List contains multiple ListElements that contain the value, that should be templated.  Compiler throws an error at   ListElement* first; ListElement* last;   in List.h. It says C2955 - 'ListElement' : use of class type requires type argument list  List.h  #pragma once #include <string> #include "ListElement.h" template<class T> class List { private:     ListElement* first;     ListElement* last; public:     List();     ~List();     void printList();     void pushBack(T value);     void pushFront(T value); };   List.cpp  #include <iostream> #include "List.h"  template<class T> List<T>::List() {     first = NULL;     last = NULL; }  template<class T> List<T>::~List() { }  template<class T> void List<T>::pushBack(T value) {     if (last)     {         ListElement* tmp = last;         last = new ListElement(value);         last->setPrev(tmp);         tmp->setNext(last);     }     else     {         first = new ListElement(value);         last = first;     } }  template<class T> void List<T>::pushFront(T value) {     if (first)     {         ListElement* tmp = first;         first = new ListElement(value);         first->setNext(tmp);         tmp->setPrev(first);     }     else     {         last = new ListElement(value);         first = last;     } }  template<class T> void List<T>::printList() {     if (first)     {         ListElement* tmp = first;         while (tmp)         {             std::cout << tmp->getValue() << std::endl;             if (tmp != last)                 tmp = tmp->getNext();             else                 break;         }      }     else      {         std::cout << "List is empty!" << std::endl;     } }  template class List<int>; template class List<std::string>;   ListElement.h  #pragma once #include <string> template<class T> class ListElement { private:     ListElement* next;     ListElement* prev;     T value; public:     ListElement(T val);     ~ListElement();     ListElement* getNext() { return next; }     ListElement* getPrev() { return prev; }     void setNext(ListElement* elem) { next = elem; }     void setPrev(ListElement* elem) { prev = elem; }     T getValue() { return value; } };   ListElement.cpp  #include "ListElement.h"  template<class T> ListElement<T>::ListElement(T val) {     value = val; }  template<class T> ListElement<T>::~ListElement() { }  template class ListElement<int>; template class ListElement<std::string>;

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.)


Is it recommended to write post edits to the bottom of a question and start them with "EDIT"?  Example:     EDIT: I tried to do x, y, and z, but they didn't work.

I often see questions edited into this form:     Lorem ipsum dolor sit amet blah blah blah paragraph paragraph original question.            UPDATE: The Lorem disappeared and left this message: "new information".   I find this format unaesthetic (since Stack Exchange posts are supposed to be useful in the long term and update boundaries are artifacts of the creation rather than the content) and feel that new information should, whenever possible, be incorporated into the original text “as if it had always been that way” if practical, and pointing out an update should be done mostly in comments.  Is this an appropriate writing style, and if so under what circumstances? If not, should it be removed or discouraged?


Here is the file strings.xml which includeing 3 sentences:  1.string name="schedulelist_nofiles">Não existe agenda de registro! Por favor,   here is missing line tecla “Add” (Adicionar) para adicionar uma. string  2.You should skip this line!  3.string name="Programme_name">GUIA DE PROGRAMA string  I use cat command 'cat strings.xml | grep "string name=" but it only get below lines:  string name="schedulelist_nofiles">Não existe agenda de registro! Por favor,  string name="Programme_name">GUIA DE PROGRAMA string  I want to get the complete line like this , just like sentence 3, start with 'string name' and end with "string". What can I do for this?

Is it possible to do a multiline pattern match using sed, awk or grep? Take for example, I would like to get all the lines between { and }  So it should be able to match    1. {}  2. {.....}  3. {.....      .....}  Initially the question used <p> as an example. Edited the question to use { and}.


How should I calculate this integral? $$\int_{-\pi}^\pi \cos(rx) \cos(kx)dx$$  [My attempt] $$\int_{-\pi}^\pi \cos(rx) \cos(kx)dx=2\int_0^\pi \frac{1}{2}\cos(r+k)x +\cos(r-k)xdx \\=[\frac{1}{r+k}\sin(r+k)x+\frac{1}{r-k}sin(r-k)x]_0^\pi \\ =\frac{1}{r+k}\sin(r+k)\pi+\frac{1}{r-k}\sin(r-k)\pi$$ I have calculated so far, but I do not know the steps ahead. What should I do?

I'm pretty sure that there's a theorem that says that the Fourier coefficients of a sum of $\cos(nx)$ and $\sin(nx)$ 's are the coefficients of the sum itself.   I tried to prove that in the specific case of $f(x) = \sum_{n=1}^{\infty}\frac{\cos(nx)}{n^2}$. In calculating the Fourier coefficients I got to calculating  $\cos(nx)\cdot\cos(mx)$, but I'm now stuck. Any tips would be appreciated!


If I switch to ubuntu from windows will my programs from windows still work on ubuntu? or will I have to download the ubuntu counterpart of the program?

Can .exe and .msi files (Windows software) be installed in Ubuntu?


I'm trying to get dns resolution of Avahi .local domains.  I can do:  $ avahi-resolve-host-name redacted.local Redacted.local  10.xx.xx.xx   but not  ping redacted.local ping: redacted.local: Name or service not known

I freshly installed Ubuntu 16.10 and rsync'd a backup of my previous home directory from kubuntu 16.04 to my new install. Things work well, but I have not been able to resolve local addresses despite much trial and error.  All networking seems to be working flawlessly. Internet browsing, DNS lookup of outside addresses, ssh, etc. are great. Locally, I can access machines via ssh with their addresses, but not their names. It all works fine in nautilus/samba, meaning WINS works. The single problem, it appears, is local network DNS. I have avahi-daemon installed and running, as it came with Ubuntu.  I've included some troubleshooting, using <<>> to shorten redundant or correctly working portions.  $ nmcli g STATE      CONNECTIVITY  WIFI-HW  WIFI     WWAN-HW  WWAN     connected  full          enabled  enabled  enabled  enabled   $ ping tendril8 << or tendril8.local >> ping: tendril8: Name or service not known  $ ping gateway PING gateway (192.168.1.1) 56(84) bytes of data. 64 bytes from gateway (192.168.1.1): icmp_seq=1 ttl=64 time=4.16 ms  $ ping askubuntu.com PING askubuntu.com (151.101.129.69) 56(84) bytes of data. 64 bytes from 151.101.129.69 (151.101.129.69): icmp_seq=1 ttl=49 time=43.0 ms  $ nslookup askubuntu.com Server:     127.0.1.1 Address:    127.0.0.1#53 << followed by several IP addresses >>  $ nslookup tendril8 << or tendril8.local >> Server:     127.0.1.1 Address:    127.0.0.1#53 ** server can't find tendril8: NXDOMAIN  $ cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 127.0.1.1  $ ls -la /etc/resolv.conf lrwxrwxrwx 1 root root 29 Oct 15 19:30 /etc/resolv.conf -> ../run/resolvconf/resolv.conf  $ cat /etc/nsswitch.conf # /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # If you have the `glibc-doc-reference' and `info' packages installed, try: # `info libc "Name Service Switch"' for information about this file.  passwd:         compat group:          compat shadow:         compat gshadow:        files  hosts:          files resolve [!UNAVAIL=return] mdns4_minimal dns [NOTFOUND=return] networks:       files  protocols:      db files services:       db files ethers:         db files rpc:            db files  netgroup:       nis   Note: I've spent a great deal of time looking at "older" solutions, prior to Ubuntu switching to systemd.resolved in 16.10. They have not worked for me and I don't believe this to be a duplicate question to similar ones with prior Ubuntu configurations.


I have just done the upgrade from 14.04 to 14.10. After restarting i get a black screen, with the cursor blanking, but i cant type anything on the screen. I am using Think-pad T400. How should i proceed?

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


how to round up number upper or lower in the simplest way? for example 36 >>> 40 33 >>> 30

How to, in C# round any value to 10 interval? For example, if I have 11, I want it to return 10, if I have 136, then I want it to return 140.   I can easily do it by hand  return ((int)(number / 10)) * 10;   But I am looking for an builtin algorithm to do this job, something like Math.Round(). The reason why I won't want to do by hand is that I don't want to write same or similar piece of code all over my projects, even for something as simple as the above.


I have followed the instructions for reinstalling GRUB boot loader in my Ubuntu installation as explained in . After that my GRUB works fine for booting Ubuntu but Windows does not boot anymore. Does anyone know how to fix it?  It returns the message: error: premature end of file /EFI/Microsoft/Boot/bootmgfw.efi.

I installed Windows on my computer, followed by an installation of Ubuntu. However, now I'm unable to boot into my Windows install.  What can I do to fix this?


I was wondering how to calculate the expected value and variance of some function f(x). For the Expected value, I integrated x*f(x) and I'm confident that is correct, but I'm confused about how to calculate the variance using integrals and f(x). I was wondering if I should use:  where I would set a variable to the value of the expected value I found earlier and use that formula. Any help would be greatly appreciated.

was wondering how to calculate the expected value and variance of some function f(x). For the Expected value $\mu,$ I integrated x*f(x) and I'm confident that is correct, but I'm confused about how to calculate the variance using integrals and f(x). I was wondering if I should use: This Formula for Variance $Var(X) = E(X^2) - \mu^2.$ where I would set a variable to the value of the expected value I found earlier and use that formula. Any help would be greatly appreciated.


So I'm revising definitions of algebra for my exam and I'm wondering what an Ideal actually is?  I believe the definition is:  $I$ is an ideal of $R$ if $xr,rx\in I$ where $r\in R$ and $x\in I$  However, after looking about the web, I'm finding that unity has a lot to do with it. I'm struggling to find out how though. I know a unit is an element which can be multiplied by another element in the set (is set the right word?) to get 1.  Essentially I'm asking what it means for a ring to have unity? and what doe an Ideal mean/tell you  I'm just looking for some clarification on this, so any explanation would help, and an example would be great. We were asked to find all Ideals in $Z_6$ today and I didn't understand at the time, so this as an example explained would help me a lot.  Thanks a bunch.

To briefly put forward my question, can anyone beautifully explain me in your own view, what was the main intuition behind inventing the ideal of a ring? I want a clarified explanations in these points:   Why is the name "ideal" coined?. In English 'ideal' means "One that is regarded as a standard or model of perfection or excellence." Why did people gave the name of ideal to such group? And why are the ideals not present in the case of groups? And give me a very fantastic intuition and motivation behind the ideals and what are the roles served by them in advanced mathematics.   Thanks a lot, to every one.


Once in a while I stumble on some question or answer with HUGE amount of upvotes (thousands for a question and multiple hundreds for an answer). Here is the perfect example:  What I found that most of such questions/answers are:  Quite old (dating back to 2008, 2009, sometimes to 2010) Very often these super high voted answers could be googled in 10 seconds in some other resources (meaning that both the question and the answer aren't THAT valuable).  Another thing which I found that there are users (Old timer's) who answered literally one such question 5 years ago. And these users can get more reputation each week doing nothing than a newcomer (like me) answering couple of questions each several days. So, I decided to investigate a little bit and wrote a query which calculates a ratio of Total reputation / number of posts (Answers + Questions). Here is it:  It's interesting to see how people got into 5k+ with 1 contribution to SO and there are even people with 10k+ (admin rights) with just 10 questions/answers. Generally speaking, I have nothing against old reputation. However, a person doing nothing for 5 years and still beating me in daily reputation - kind of pisses me off :) I just want to hear your opinion on this thing. Especially, it would be interesting to hear from other members who become active recently (I understand that for an admin with 30k reputation and thousands of answered questions it's not that big deal that somebody got 7k reputation from one answer). P.S. 8 years passed since this post. I am old timer now and I can sit and accumulate points (and badges) without doing anything, while some new comers are fighting to get their first 1000 points. On top of that I stopped contributing to SO probably 4 years ago.

Recently I answered two questions on SO: The  is a completely trivial answer to a really basic question (kind of "read the manual and follow the one liner example there"). On the other hand, my  is a much more complicated answer that requires much more specialized knowledge of a very specific domain (happens to be related to my PhD research).  Clearly, the first answer could have been given by many SO users - I just happened to be the first to pick up the glove on this question. However, this is not the case for the second answer.  In contrast, when it comes to reputation - the first answer instantly got upvoted (everyone can relate to a simple question/answer), while the second one - I don't believe it will get much upvotes...  So, life isn't fair: for the one answer that really very few people could provide (the second answer) and is much harder to find and get -- is not rewarded, while the trivial answer is rewarded fast and strong...  How can we amend this? How can we encourage rare and specialized answers for difficult and deep questions?  Do we want SO to turn into a pool of trivial and superficial questions?    Update: Thanks to many meta-users who took the time to read through this question and ponder its implication, both answers I used as examples got exposed far beyond their fair-share. So, despite the fact that my original claim that the specialized answer get less reps is no longer valid, this does not change fact that in general my claim is stil valid: specialized answers requiring expert knowledge will recieve less attention at first.    Bottom line: (following my wish to have some sort of ). Indeed it sometimes seems like life isn't fair, but this is only in the short term. In the long run high quality answers do get their proper credit and exposure and their fair share of reputation. The reputation system of SO works quite well balancing and accounting for many factors and parameters. It would require a really strong argument backed up with serious research to change this mechanism.   Thank you all for the lively discussion and for showing me that life is fair after all.


How can I tell (in php) if a site is visited through a mobile device?  I can't use get_browser() because I'm not able to edit php.ini (to set the path of browscap.ini).

We are beginning to go down the path of mobile browser support for an enterprise e-commerce webapp (Java/Servlet based).  Of course there are many decisions to be made, but it seems to me the cornerstone is to be able to reliably detect mobile browsers, and make decisions on the content to be returned accordingly.  Is there a standard way to make this determination (quickly) based on the http request, and ideally glean more information about the given browser and device making the request (screen size, html capabilities, etc?).  I would also appreciate any supplemental information that would be of use from someone who has gone down this path of taking an existing large scale enterprise webapp and architect-ing out mobile browser support from the development side.  [edit] I certainly understand the request header and the information about a database of standard user agents is a great help.  For those talking about 'other' request header properties, if you could include similar standardized name / resource of values that would be a big help.  [edit] Several users have proposed solutions that involve a call over the wire to some web service that will do the detection.  While I'm sure this works, it is not a good solution for an enterprise e-commerce site for two reasons: 1) speed.  A call over the wire for every page request to a third party would have huge performance implications.  2) dependency/legal.  We'd tie our website response time and key functionality to their service, which is horrible for legal and risk reasons.


How do you prove :   $ \forall n \in \mathbb{N}$  if $ u_n=\Re(({\frac{1+i\sqrt{7}}{2}})^n) $  where  $\Re$  mean the real part of a complex number, that $$ \lim_{n\rightarrow +\infty}\left | u_n \right |=+\infty$$  $\left | u_n \right |$ is the modulus of $u_n$

Let $a=\frac{1+i\sqrt 7}{2}$ and $u_n=\Re(a^n)$   show that  $(|u_n|)\to +\infty$   I think basics method does not works here.  Any ideas ?


I am new to Ubuntu 17.10 and there is a problem I can't solve on my own or with doing research on the Internet. First of all, I resized the partition to get space for another one for having Windows 7 and Ubuntu coexisting on my Computer.  So as the title says, I want to receive that unallocated space which lies within my /home partition. I unmounted and resized it by login as root in terminal, using the following command:  resize2fs /dev/sda5 500G   The screenshots show my problem, as the space within the resized partition isn't assigned to the unallocated space and I can't get it to.

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


I have a SQL Server table with Customer Names and Phone Numbers. Customers will be an owner or party member. There are chances where owners and party member give the same mobile number. I wanted to check the table and if the mobile number is duplicated then I need to remove it from the table. How can I achieve it? CustomerName   MobileNumber ---------------------------- AAA             +447000000000 BBB             +447000000000 CCC             +447000000000  Result I expect: CustomerName   MobileNumber ---------------------------- AAA             +447000000000 BBB             NULL CCC             NULL

When removing duplicate rows, using the below query from  tutorial, how would I go about forcing which of the found duplicates to remove?  DELETE FROM dbo.ATTENDANCE      WHERE AUTOID NOT IN (SELECT MIN(AUTOID) _ FROM dbo.ATTENDANCE      GROUP BY EMPLOYEE_ID,ATTENDANCE_DATE)    And this works great. The reason why I am using this one is because the only unique id available is one in the IDENTITY column. And to determine if there are duplicate rows I have to look at a combination of multiple columns.    But if I have a set of duplicate rows how do I / how does SQL Server decide which to remove? And how would I force it to remove all but the one with the highest IDENTITY value?  EMPLOYEE_ID     ATTENDANCE_DATE     AUTOID A001            2011-01-01          1 A001            2011-01-01          2   If I would run the query now it happens to remove the second one, with AUTOID 2. But I am trying to remove all but this one (because this is the one latest added).


Let $G$ be a subgroup of the symmetric group $S_n$.   Suppose that $G$ has the following property:  given any positive integer $k\leq n$, there exists an element of $G$ having a cycle of length exactly $k$.  Is it any true that under this assumption $G=S_n$? If not, could one make a counterexample with $n$ prime?  Please notice that I am not saying that $G$ has elements which ARE cycles of order $k$.  Could you please remove the duplicate, as if you read it carefully you see that it is a different question? (please see also the answer that I accepted)

Consider the following result of Dedekind:     For any polynomial $p \in \mathbb{Z}[x]$ and any prime $q$ not dividing the discriminant of $p$, if $p$ factors modulo $q$ into a product of irreducible polynomials with degrees $d_1, \ldots, d_s$, then the Galois group $\text{Gal}(p)$ contains a permutation with cycle structure $(d_1, \ldots, d_s)$.   In particular, it is known that in $S_r$, $r$ prime, is generated by a $2$-cycle and an $r$-cycle, so if one can find appropriate primes, one can use Dedekind's result to show quickly that a given polynomial of prime degree has full Galois group $S_5$. This condition is rather limited, however, and this motivates the following question:     Suppose we know the cycle types of some elements of a group $G \leq S_n$. Under what conditions on those cycle types can we conclude that $G$ is actually the full group $S_n$?   This line of thinking was motivated, by the way, by , which asks about the solvability of the polynomials $$p_n(x) := x^n - \sum_{k = 0}^{n - 1} x^k$$ that arise when studying the so-called $n$-nacci sequences. Two of the answers there report CAS computations giving that the Galois group of $p_n$ is $S_n$ for $n \leq 12$, and one speculates that that holds for all $n$. For $n = 5$, one can use the primes $q = 3, 5$ to show that the Galois group contains $2$- and $5$-cycles, and hence by the above fact $\text{Gal}(p_5) \cong S_5$. One can do the same, for example, with $n = 13$ and $q = 5, 17$ to conclude that $\text{Gal}(p_{13}) \cong S_{13}$, extending the other answers there.


Ikea founder Ingvar Kamprad dies aged 91      Company says man who founded firm in 1943 aged 17 died peacefully at home in Sweden   Please say why in the title it is said in Present Simple Tense "Ingvar Kamprad dies aged 91"? Why not Past Simple Tense. What a rule can describe this?

What is the difference between the examples below?  Generally, in a newspaper, news is based on past tense (things which have already happened).   Then why are headlines written in ways that says: He Kills (shouldn't it be: He Killed)?  For example:  Parliament passes bill vs. Parliament passed bill  Also  He kills his friend vs. He killed his friend  Please help.


I create a new subject which is the next of .  I have a form on drupal.   There is a function to create it : commerce_checkout_account_pane_checkout_form  There is a function to validate it : commerce_checkout_account_pane_checkout_form_validate  There is a function to submit it : commerce_checkout_account_pane_checkout_form_submit  Everything work with Firefox, but not with Chrome or IE.  If I do a real click on the submit button, I go to the validate function. If I use jQuery to trigger click on the submit button, I can see ajax gif but my page is reloaded and there was no passage into validate function ( I use drupal_debug to log passage ).  How it is possible there is a difference, in two case there is a click on the submit button ?  All day on this problem, I really need to fix it quickly.

I have create a form with form_validate and form_submit functions.  Using Firefox, everything is OK so the problem is not about an error in functions names.  Using Chrome, when I click on submit the page is just reloaded. I have added to my code drupal_debug to track the process into validate function and submit function. System not going into these functions.  I have no ideas about how form_validate function could be linked with choice of browser.  UPDATE : I have found more details about the cause of the problem :  To submit the form, user not click on the submit button directly. He have to click on an other button which launch js function.  At the end of the js function, I use jQuery( "#edit-continue" ).trigger( 'click' ) to simulate click on the real submit button.  I have tried to click directly on the real submit button and it is working but with trigger I see the ajax GIF of drupal but there is no passage to my form_validate function.  So, I really need to know how drupal can make the difference between a real click and an emulated one. And the most important how can I do to fix or skirt this problem.


I have always said, "Our hope and prayer is..." but was recently corrected by my husband and told that the correct grammar would be, "Our hope and prayer are...".  Which one is correct?

I am having trouble with the following sentence:      "The complexity and diversity of the new platforms is worrying us."   If "complexity" and "diversity" constitute two subjects, then the verb should presumably be "are"; however, the sentence feels more natural with "is". Is this correct? Is there a linguistic term for this occurrence?    The following questions address the general topic of compound subjects, but not specific cases like this:             And the following question seems to have somewhat inconclusive answers:         So this question is not really a duplicate of these three.


My table is like this:  Sitecode    Month  Amount --------    -----  ------ XX          Jan     1000 XX          Jan     3000 XX          Apr     3000 XX          Apr     1000   What I want is, to show the result something like this:  Sitecode    MonthJAN   MonthAPR --------    --------   -------- XX          4000       4000


I have divided my signup page into a three-step signup:   Account info (username, password and email) Personal Info (full name, gender and zip) And lastly, telling the user to verify his/her email address   Is that really a good idea? As there are only six fields in the total signup process which will not seem to be tough for user at first glance.

I am designing a registration form for a site with multiple sets of information required from the user. I have categorized the data fields into relevant groups. Now should I present the form sections in one go or follow a wizard-like approach? What things should I keep in mind while deciding on this?


I have a problem when inserting figure. a space is displayed after the figure. Here is the code and the figure displayed

I have a figure in my paper (I am using IEEEtran package). After this figure there exists a space between the figure and the text. How can I reduce the size of this white space. To be specific the space is between the caption of the figure and the text of my paper. Any suggestions?


I have already asked this question on stack but for some strange reason I didn't get enough help/ people didn't respond back so I am asking this again.  A student prepares for an exam by studying a list of 12 problems. She can solve 9 of them. For the exam, the instructor selects 7 problems at random from the 12 on the list given to the students. What is the probability that the student can solve 5 of the 7 problems on the exam?  I am really confused by this problem. My first initial thought was to do:  $$\frac{{7 \choose 5} {5 \choose 2}}{ {12 \choose 7}}$$  I was given a recommendation to account for the last 2 question that weren't answered. I am not 100% sure about this.

A student prepares for an exam by studying a list of 12 problems. She can solve 9 of them. For the exam, the instructor selects 7 problems at random from the 12 on the list given to the students. What is the probability that the student can solve 5 of the 7 problems on the exam?  I am really confused by this problem. My first initial thought was to do:  (5 chose 7)(7 chose 0)/ (12 chose 7)  I am not 100% sure about this though.


I'm learning algorithms in C, and I want to know what is the best category here on Stack Exchange to ask questions about introductory algorithms(those who are usually left as exercises in introductory CS courses.)   I don't want things like; "Theoretical computer science","Artificial Intelligence".

There seems to be more than a few computer science/programming Stack Exchange networks (is that the correct term?). Stack Overflow, being the first, has by far the most users, questions, and answers.  What is the reasoning for creating the others, and are there clear guidelines for which kinds of questions should be posted? I can see a large amount of potential overflow, many cases of people not getting a good answer to their question, because the person who has the answer isn't browsing that particular network at the moment.  I understand that they were probably created for organizational purposes, but wouldn't it almost make more sense to just have them as categories under Stack Overflow, keep them separated but still connected, instead of making people have to create multiple 'account's, one for each network?  I am sure there was a very good reason to break them up, but as someone that is new to SE, it can be somewhat intimidating to decide which one to post in to ensure you get a good answer. For example, if I am a computer science student, my first instinct might to be to post in the computer science network, until I see that it literally has 1% of the users as the Stack Overflow network, which still seems to be for programming/computer science related questions.  So my second instinct would then to be to post it into the Stack Overflow site on the basis that I have a significantly higher chance of my question being seen and getting a good answer. Then I notice that there is also a 'programmers' network, and I don't even begin to know where that fits in. I, and I am assuming most people, will probably just post on Stack Overflow to be safe.  My question is, other than the short little description blurb of each one, is there a clear cut set of guidelines which what each network is intended for, what kinds of questions should go to each one, and is anything being done to encourage people to post in these newer, smaller (more specialized?) networks as opposed to just posting in big daddy Stack Overflow?  Now again, this is for computer science/programming/"why isn't this code doing what I want?" related questions, I am not saying that if I had a question about Linux or WordPress or something I would have the same confusion.


I would like to add a line in my Windows hosts file via Python with this code:  fh = open("C:\Windows\System32\drivers\etc\hello.txt", "w") fh.write("new line") fh.close()   But I get this error:  PermissionError: [Errno 13] Permission denied: 'C:\\Windows\\System32\\drivers\\etc\\hello.txt'  It doesn't work even if my antivirus is disabled.  I don't know how to write a file as an administrator on a Windows machine.

I want my Python script to copy files on Vista. When I run it from a normal cmd.exe window, no errors are generated, yet the files are NOT copied. If I run cmd.exe "as administator" and then run my script, it works fine.  This makes sense since User Account Control (UAC) normally prevents many file system actions.  Is there a way I can, from within a Python script, invoke a UAC elevation request (those dialogs that say something like "such and such app needs admin access, is this OK?")  If that's not possible, is there a way my script can at least detect that it is not elevated so it can fail gracefully?


Problem :   Prove that : all natural numbers formula :   $n=3^{k},k\in\mathbb N^{*}$ divide $2^{n}+1$  For example : $k=1$ then $n=3$ so : $9|_{2^{3}+1=9}$ correct ?   I'm think use induction for $k$ mean I will prove that :   $2^{3^{k+1}}+1=m.3^{k+1}$ , $m\in \mathbb Z$   $2^{3^{k+1}}+1=8^{3^{k}}+1$   How I complete ??

Describe all positive integers,n such that $3^{n+1}$divides $2^{3^n}+1$. I am little confused about what the question asks-if it asks me to find all such positive integers, or if it asks me to prove that for every positive integer n,$3^{n+1}$ divides $2^{3^n}+1$. Kindly clarify this doubt and if it's the former part, please verify my solution-n=1.


Is there a better word for the following example than astonished?     I was astonished at the lack of respect Joe showed to his parents.   I’m trying to use the word astonished in a sentence, but I want to convey that I am surprised at a negative outcome.  Here, the lack of respect towards one’s parents is the negative part, but astonished is neutral, not negative.

I'm searching for a word representing "Negatively surprising", or "Negatively amused" in an appropriate form. Example: Someone who proclaims he aims to do things in the right way has done something in the completely opposite way.    How could you have done such a thing? That action is very ___.   Said with the purpose of showing the contrast between the expected and the actual, and asking for change to adhere with his set goals, instead of just pointing out disappointment.  It is different from  because it asks there about surprise of being affected by the disappointment. The meaning of surprise here is different.


I have 3 disk partions in my Windows 7 laptop. I would like to replace Windows with Ubuntu. But I want to save my data on other 2 partions. Is it possible for me to format C:/ Windows default partition and install Ubuntu on it? For so long I wanted to do this. Appreciate your help.

I would like to see a full how-to guide on how to install Ubuntu.


I'm trying to separate out records in a quasi-summarized table.   Currently, my features are geocoded address points. Each address point has one record associated with it with a field showing how many trees were planted at the property. Most of the time there will only be one tree per property but sometimes there are multiple trees planted at the property.   Ideally I'd like to separate/expand my records so that the number of attribute records for a particular address reflects the number of trees planted at that address.   For example, if property A has 3 tree plantings there will be 3 corresponding records in the attribute table (one-to-many).   If property B has 1 tree planting there will be 1 record in the attribute table.   Is there a tool or workflow that can automate this process??

I have a point layer in ArcGIS that has a field named "Population" that stores an integer value for every point in the layer.  I want to create N points in the exact place of the feature that has N as value in the population "field". I mean, if a point has in the population field 16, I need to create 15 more points in that exact lat long (1+15 so that there are 16 in total) of that point.


I am not very good with Ubuntu and clueless on how to install Virtualbox. Please help.

How can I install applications like Google Chrome on Ubuntu?  Are there any commands to install an application?    Index of answers:


I've got a very simple question, I hope. I have a table MYTABLE like this: FIELD1   FIELD2   FREQ A1       B        10 A1       C        20 A1       D        5 A2       X        7 A2       Y        12 ...  and I want to get something like this: enter code here  FIELD1   FIELD2   A1       C              A2       Y                that is I want to get for every distinct FIELD1 the row having the max(FREQ) but also with its FIELD2 value Oracle 10g Thanks in advance! Mark

Table:   UserId, Value, Date.   I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle)  Update: Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date.


Take a = [1,2,3,4,5] as an example. From my instinct, I think a[::-1] is the same as a[0:len(a):-1]. But the result turns to be wrong:  >>> a = [1,2,3,4,5] >>> print a[::-1] [5, 4, 3, 2, 1] >>> print a[0:len(a):-1] [] >>> print a[0:3:-1] [] >>> print a[0:2:-1] [] >>> print a[:2:-1] [5, 4] >>> print a[:0:-1] [5, 4, 3, 2] >>> print a[0:-1] [1, 2, 3, 4]   I actually can't understand the last 6 attempt's output. Could anyone give me some idea? Thanks tons.

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


The sentence is "You look pretty tonight". I believe that pretty would be an adjective as it's referring to "You".   However in the sentence "You look pretty gorgeous tonight" I believe that pretty would be an adverb.  In the first sentence is pretty saying how "You" looks though, meaning it would be an adverb?

What part of speech is handsome in the sentence:     The bridegroom looked so handsome.


establishes that there is no integer $a$ to which it satisfies $a^{2}+3a+5\equiv0 \pmod {121}$

This equation is like this: $$x^2-x+6 \equiv 0 \pmod{9}$$  I want to find x by using modular arithmetic. How I could do that?   My solution was:     $$\begin{align*}  x(x-1) &\equiv -6 \pmod{9}\\ x(x-1) &\equiv 3 \pmod{9} \end{align*}$$      So $x$ is either:   $$ x \equiv 3\pmod{9}$$      or       $$x - 1 \equiv 3 \pmod{9}$$      Which is $x \equiv 4 \pmod{9}$   I know what I have done is very dumb. So what is the correct solution? Give me the instructions also please.


I have programmed my ATtiny1616 to output the clock on a pin.  Here is my reading:    Why is there all that ripple? How might I reduce it?

I own a cheap oscilloscope Hantek DSO4102C. It's rated bandwidth is 100 MHz, and sample rate is 1 GSa/s. Some info about the tool can be found here:  Now I have an Atmega328P MCU running from an external quartz at 16 MHz, without any code it it (chip erased by usbasp), only CKOUT fuse bit is set. So I supposed to see a square wave at PB0 pin, but my scope shows it quite distorted:  MCU's datasheet doesn't mention a pin rise time, which was a big surprise to me, so I cannot check if measured 9.5 ns is a valid value. But judging by Pk-Pk voltage exceeding 6 volts (and even going below zero for a good 560 mV), I believe there's a problem with the scope. Am I right?  ADDED LATER, AFTER GETTING SOME ADVICE I've assembled everything on a  breadboard, rather then using Arduino Uno. I've connected ground clip from the scope to the ATMega's ground pin with a wire through breadboard. I'm measuring directly at the output pin (see photo of my layout below). Now I'm getting better results, also with 20 MHz oscillator.    Obviously, Pk-Pk values are now more close to reality, as well as signal shape. So thanks everybody for the help!


I have looked into Cantor's diagonal argument, but I am not entirely convinced. Instead of starting with 1 for the natural numbers and working our way up, we could instead try and pair random, infinitely long natural numbers with irrational real numbers, like follows:   97249871263434289...   0.12834798234890899... 29347192834769812...   0.23489712349789878... 42987412938478321...   0.23487912836784798... 43921649873612384...   0.58792834796781823... 49238749213847921...   0.58971238456497213... 98123489712348790...   0.58291739429587199... 45678294218374691...   0.09123498915832837... 69217346876217384...   0.23897123484839759... 52189347981283490...   0.34823948750038273... . . .   Couldn't we just as easily apply the diagonal argument to the natural numbers, and therefore generate a new natural number after completely exhausting our list? Here's another way to look at it:   97249871263434289...   0.0 29347192834769812...   0.1 42987412938478321...   0.2 43921649873612384...   0.3 . . . 49238749213847921...   0.8 98123489712348790...   0.9 45678294218374691...   0.10 69217346876217384...   0.11 52189347981283490...   0.12 . . .   If we accept Cantor's diagonal argument, doesn't the second argument now prove that there are more natural numbers than real numbers between 0 and 1? If you imagine this infinite list of real numbers, which in fact does include all numbers between 0 and 1 (or else the set [1, 2, 3, 4, 5, 6...] wouldn't contain all the natural numbers), it seems like the only distinction between the two sets are the inclusion of a preceding "0." for the real numbers. Does that magically make the set larger?

I'm having trouble understanding Cantor's diagonal argument.  Specifically, I do not understand how it proves that something is "uncountable".  My understanding of the argument is that it takes the following form (modified slightly from the  article, assuming base 2, where the numbers must be from the set $ \lbrace 0,1 \rbrace $):  \begin{align} s_1 &= (\mathbf{0},1,0,\dots)\\ s_2 &= (1,\mathbf{1},0,\dots)\\ s_3 &= (0,0,\mathbf{1},\dots)\\ \vdots &= (s_n \text{ continues}) \end{align}  In this case, the diagonal number is the bold diagonal numbers $(0, 1, 1)$, which when "flipped" is $(1,0,0)$, neither of which is $s_1$, $s_2$, or $s_3$.  My question, or misunderstanding, is: When there exists the possibility that more $s_n$ exist, as is the case in the example above, how does this "prove" anything?  For example:  \begin{align} s_0 &= (1,0,0,\mathbf{0},\dots)\ \ \textrm{ (...the wikipedia flipped diagonal)}\\ s_1 &= (\mathbf{0},1,0,\dots)\\ s_2 &= (1,\mathbf{1},0,\dots)\\ s_3 &= (0,0,\mathbf{1},\dots)\\ s_4 &= (0,1,1,\mathbf{1},\dots)\\ s_4 &= (1,0,0,\mathbf{1},\dots)\ \ \textrm{ (...alternate, flipped } s_4\textrm{)}\\ s_5 &= (1,0,0,0,\dots)\\ s_6 &= (1,0,0,1,\dots)\\ \vdots &= (s_n \text{ continues}) \end{align}  In other words, as long as there is a $\dots \text{ continues}$ at the end, the very next number could be the "impossible diagonal number", with the caveat that it's not strictly identical to the "impossible diagonal number" as the wikipedia article defines it:     For each $m$ and $n$ let $s_{n,m}$ be the $m^{th}$ element of the $n^{th}$ sequence on the list; so for each $n$,      $$s_n = (s_{n,1}, s_{n,2}, s_{n,3}, s_{n,4}, \dots).$$      ...snip...      Otherwise, it would be possible by the above process to construct a sequence $s_0$ which would both be in $T$ (because it is a sequence of 0s and 1s which is by the definition of $T$ in $T$) and at the same time not in $T$ (because we can deliberately construct it not to be in the list). $T$, containing all such sequences, must contain $s_0$, which is just such a sequence. But since $s_0$ does not appear anywhere on the list, $T$ cannot contain $s_0$.      Therefore $T$ cannot be placed in one-to-one correspondence with the natural numbers. In other words, it is uncountable.   I'm not sure this definition is correct, because if we assume that $m = (1, \dots)$, then this definition says that "$s_n$ is equal to itself"&mdadsh;there is no "diagonalization" in this particular description of the argument, nor does it incorporate the "flipping" part of the argument, never mind the fact that we have very clearly constructed just such an impossible $T$ list above.  An attempt to correct the "diagonalization" and "flipping" problem:  $$s_n = (\lnot s_{m,m}, \lnot s_{m,m}, \dots) \quad \text{where $m$ is the element index and} \quad\begin{equation}\lnot s_{m,m} = \begin{cases}0 & \mathrm{if\ } s_{m,m} = 1\\1 & \mathrm{if\ } s_{m,m} = 0\end{cases}\end{equation}$$  This definition doesn't quite work either, as we immediately run in to problems with just $s_1 = (0),$ which is impossible because by definition $s_1$ must be $ = (1)$ if $s_1 = (0)$, which would also be impossible because...   Or more generally, with the revised definition there is a contradiction whenever $n = m$, which would seem to invalidate the revised formulation of the argument / proof.  Nothing about this argument / proof makes any sense to me, nor why it only applies to real numbers and makes them "uncountable". As near as I can tell it would seem to apply equal well to natural numbers, which are "countable".  What am I missing?


I am attempting to read some data off of a server for a built in update function and I am getting a compile time error. Is there any way I can get around this? I need this to check if the user has a working internet connection and if not skip the update check. (Unless there are more reliable ways in .Net 4.5)  WebClient client = new WebClient(); try  {     Stream stream = client.OpenRead("http://repo.itechy21.com/updatematerial.txt");  } catch (Exception ex) { MessageBox.Show(ex.Message); }  StreamReader reader = new StreamReader(stream); // <-- error here String content = reader.ReadLine();   Error:     stream does not exist in the current context

In C# and in Java (and possibly other languages as well), variables declared in a "try" block are not in scope in the corresponding "catch" or "finally" blocks.  For example, the following code does not compile:  try {   String s = "test";   // (more code...) } catch {   Console.Out.WriteLine(s);  //Java fans: think "System.out.println" here instead }   In this code, a compile-time error occurs on the reference to s in the catch block, because s is only in scope in the try block.  (In Java, the compile error is "s cannot be resolved"; in C#, it's "The name 's' does not exist in the current context".)  The general solution to this issue seems to be to instead declare variables just before the try block, instead of within the try block:  String s; try {   s = "test";   // (more code...) } catch {   Console.Out.WriteLine(s);  //Java fans: think "System.out.println" here instead }   However, at least to me, (1) this feels like a clunky solution, and (2) it results in the variables having a larger scope than the programmer intended (the entire remainder of the method, instead of only in the context of the try-catch-finally).  My question is, what were/are the rationale(s) behind this language design decision (in Java, in C#, and/or in any other applicable languages)?


I'm following Andrew Price tutorial to create an anvil and I'm really new at blender. I cleaned up all my faces making sure they all had 4 vertices only and when I select with ALT and face, they seem to flow well.    But when I apply the subsurface I still get ONE vertex left in the middle of my old cylinder which I had erased and therefore the cut out is weird.    Thanks for the help :-)

I am currently trying to develop my modeling skills, and following a tutorial found on YouTube. The tutorial teaches how to create an anvil. At 19:10 or so into the video, a subdivision surface modifier is used to create a smooth, soft look.  However, when I do the same, mine looks very sharp and generally bad.  Any ideas why? I will include the blend file below, I appreciate your time and suggestions.    This is his when he subdivides, which is very different from mine when I do the same at the same settings. (I cannot post more pictures because I am new, but if you check the blend file I attached, you should be able to see the difference.   This is what it looks like when I subsurf without the base face.


For example I use  $building_name = $_POST['BuildingName']; $metering_type = $_POST['MeteringType']; $query = "INSERT INTO buildings (BuildingName, MeteringType)                        VALUES ('$building_name', '$metering_type')"; if(mysqli_query($link, $query)) {     echo json_encode(Array("success"=>true)); }   And I believe that this prevents me from SQL injections. Am I safe?

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?


Can thought originate from nothing? I was thinking about this last night and got me wondering what would happen if someone was born without senses.

Does consciousness depend on our five senses? If we never have senses, would we have consciousness? It seems that if we lose our senses, we would maintain our consciousness. But if we never had senses to begin with?  Imagine a child born without any of the five senses.  If we must have some senses first before consciousness, then does that mean that computers can never have consciousness?  What do the various philosophical systems say about this?


I guess the asterisk has a general meaning at that position and probably should know it, but I just can't find it in amsmath manual.

After some brief searching I can't find the difference between align and align*. Google summarily ignoring the * is making it harder I think.  Can you tell me the difference between these two?  Moreover, can you tell me where you generally go for this type of information? As a relatively new user I'm still building up my resources.


I'm taking an algebraic structures class and we are doing a lot of work involving group theory. Specifically, dihedral groups, abelian groups, isomorphisms, cyclic groups, and others. I'm finding it interesting but I'm lost on what the point of it all is. Is it just something that mathematicians like to play around with or does it have any real-world applications? Can we use it practically? I understand the general applications of permutation groups and the dihedral group, but what about something more specific? Such as, for what reason is it necessary to know that a group is cyclic?

I would like to know whether there are examples where finite group theory can be directly applied to solve real world problems outside of mathematics.  (Sufficiently applied mathematics such as cryptography, coding theory, or statistics still count.)  Let me clarify: I am not interested in applications of elementary group theory which happen to involve finite groups (e.g. cyclic/dihedral/easy groups as molecular symmetries).  I am interested in applications of topics specifically coming from finite group theory as a discipline, like one might see in , , or .  "The Schur multiplier has order 2640, so we should point the laser that way."   "Is this computer system secure?"  "No - Frobenius kernels are nilpotent."  I'm aware of , but many of the applications listed there are inside mathematics or fall in the "applications of easy groups" category.  It is entirely possible that what I'm looking for doesn't exist, and that finite group theory is still an untouchable, pure subject, like number theory in the days of G. H. Hardy.  But perhaps not.  Does anyone know of any applications of the higher level stuff?


Today I got my 11th hat but I have not received the hat 011, whose requirement is to get 11 hats, I found it a bit strange since it has been a few hours since I got the 11th and I have not been given.  Are there any extra requirements for this hat? Or is it a bug? Or all the hats have to get them in the same place?

I have reached the twenty hat threshold! However, I have not been awarded with The Milliner. At first I thought this could just be a case of being impatient, so I waited, but it still hasn't arrived!    Does this have something to do with my 20th hat being a secret hat? Should I just suck it up and wait until I get my 21st hat?


With a lot of the models I have been importing from a game there are dark spots in some places. I removed doubles already and recalculated normals, but I still get this when rendering:    The dark spots are on the top and bottom walls on the right side. It's not a shadow because moving the sun lamp and even using ambient occlusion does nothing. I checked the normals, but they look fine.    The only things I can thing of that make this (imported) object different from one made from scratch are that it is already triangulated since it is a game asset, and it has sharps, which I have been told can store data. I'm probably missing something here; I've never seen this before though.

Here is the viewport in material view.  The node setup is just a PNG texture into a diffuse shader.    And this is in rendered view.  I've tried using environmental lighting as well as a directional light, and while the lit parts become brighter/washed out, the darker parts stay dark.  Normals are correct and there is no z-fighting.  Ambient Occlusion is not enabled.  Changing to Flat shading makes it worse.    Update:  Any modifier that alters the mesh (bevel, subdivide, etc) make the problem go away instantly.


I just noticed some weird behaviour which I don't really understand. Maybe a bug, or is it just something I didn't get yet?  I'm refereing to this question:    In the answer there is a comment from this   Now I wanted to ask something using the @ to address him, but strangly his name doesn't appear in the selection box which usually appears. I entered part of the name manually, but when I submitted the comment, the name was removed from it and it appeared as if typed without it.

How do the comment replies (aka "pinging users") work?  Who can I send an @reply to? How do I respond to a specific user when entering my comment? Will they be notified? What do people mean when they talk about "pinging" another user?  Related:


I understand why looking at the sun is bad.  I also understand that looking at the eclipse is bad.  Is it more dangerous to glance at an eclipse than the sun, assuming you avert your eyes right very quickly?  I assume that the dangers of looking at an eclipse is that there is less light coming off the eclipse, but that the energy is similar meaning physically my eyes wont shut/pupils won't react the same?  Can someone help me with the science that makes eclipses so much more dangerous to look at then the sun, if this is the case?

It is said one should avoid staring at Sun as it can damage the eyes, but it is also said that one should not come out in sun during eclipse as it emits dangerous rays. Is that true? If yes, why?


a) Let X be a topological space, and $\mathcal{A}$ a family of closed, compact subspaces. Then, if $\bigcap_{A \in \mathcal{A}}A \subseteq U$, and $U$ is open, then $\exists\ \mathcal{F} \subseteq \mathcal{A}$ such that $\mathcal{F}$ is finite and $\bigcap_{A \in \mathcal{F}}A \subseteq U$  b) Let X be a topological Hausdorff ("$T_2$" for some people) space, and $\mathcal{A}$ a family of compact subspaces such that $\bigcap_{A \in \mathcal{F}}A$ is connected for every finite $\mathcal{F}$. Prove that $\bigcap_{A \in \mathcal{A}}A$ is connected.  Proof: a) Suppose the contrary, then $\bigcap_{A \in \mathcal{F}}A \cap U^c \neq \emptyset$. By the Finite intersection Property, ($\bigcap_{A \in \mathcal{A}}A \cap U^c$ is compact), we arrive at a contradiction.  b) Here's where I get stuck... Suppose the contrary.   First, an observation: as $X$ is Hausdorff, so the subspaces are also closed.  Then, $\exists\ U, V$ open (there) such that $B:= \bigcap_{A \in \mathcal{A}}A = U \cup V$, and $U$ and $V$ are disjoint.  Then, $\exists\ U', V'$ open in $X$ such that $U = B \cap U'$, $V = B \cap V'$.  From there, I can get a finite $F$ such that $C:= \bigcap_{A \in \mathcal{F}}A \subset U' \cup V'$. I'd like to shrink the size of U' and V' so I disconnect C, but I couldn't so far. I think I haven't used "enough" the fact that X is Hausdorff.  Can anyone help me? Thanks!

This is an old exam question that I don't have a solution to:  Let $X$, a compact Hausdorff (T2) space, and let $\phi$ a family of closed, non-empty, and connected subsets of $X$, such that for every $A, B \in \phi$, $A \subset B$ or $B \subset A$.  Prove that $Y:= \cap \{A: A \in \phi\}$ is connected.   I tried to solve this question with a friend, and this is what we came up with:   Obviously, $X$ is normal space (T4). We tried to see what happens if $Y = U_1 \cup U_2$, disjoint and open sets (and?) We tried to use nets and maybe see if we can create a net that converges to $x \neq y$ (and contradict X being Hausdorff space). We tried to work with continuous functions, but this idea didn't lead us anywhere either.   I feel like there is a simple observation that we are missing. Any ideas?  Thanks!