body1
stringlengths
20
4.1k
body2
stringlengths
23
4.09k
i am having some trouble trying to understand this simple formula: $\frac{n!}{\left(n-r!\right)r!}$ Even though i am able to solve exercises easily using this formula i can't understand it. How was this formula derived? Is it possible to understand the formula or is it just the result of some certain mathematical work? The part that i don't understant is how does diving the possible combinations by the redundancies result in the possible number of arragements of something ignoring order.
I perfectly understand the permutations formula i.e. if you have $n$ things how many ways can you rearrange it if taken $k$ at a time (or if you have $k$ slots)? So you draw the following tree. And the formula comes out naturally. $$^nP_k = \frac{n!}{(n-k)!}$$ I get that it is including all of the duplicates, too. And to get rid of them we use the combinations formula: $$^nC_k = \frac{n!}{k!(n-k)!}$$ Can somebody explain why we have to divide by the "number of ways to re-arrange the slots" to get rid of the duplicates? I understand that it works and the division is used to scale a number down but I am not getting that "aha moment" of why we do it. Can somebody explain it?
I answered this question: but I did not get the bounty for it. Now Is there a way to understand why? Following those 3 point for an eligible answer: The answer must have been given after the bounty was started The answer must have a score of at least +2 The answer must not have been written by the bounty starter I tried to find out if there was a point I didn't satisfy, but where can I find the statistics on where and when the bounty started or ended on that specific question? EDIT: I created a change request for this:
It's possible to offer and award bounties of reputation on questions. What is a bounty? How can I find questions that have a bounty attached? How do I start a bounty? When can I start a bounty? Why is the system requiring me to choose a bounty amount that's higher than the minimum? Can I use Markdown formatting in the bounty remarks? Can I edit the remark? How long is the bounty period? How do I award a bounty? Can I award a bounty to my own answer? Can I award a bounty to an old answer? If I offer a bounty on someone else's question, can I award the bounty to their answer? After awarding the bounty, can I remove it or move it to another answer at a later time? What happens if there's no answer after the bounty period? What happens if I feel my question is still unanswered? What is automatic awarding? Are bounty awards exempt from the 200 points/day reputation limit? How does Community Wiki mode affect bounties? How does user deletion or post dissociation affect bounties? Can I award a bounty to an answer from a deleted user or one where the author was dissociated? Can I offer a second bounty after the first one has expired? Can I raise my bounty? What happens if a bounty question is closed or deleted? Why can't I vote to close or migrate a bounty question? What happens if I delete my account while I have an active bounty? Do I keep an awarded bounty when I delete my answer? What happens if a question where I awarded a bounty later gets deleted or migrated? Can I cancel my bounty? Can I affect / divide / share part of my bounty to two (or more) users? How many outstanding bounties can a single user have? See also: in the Help Center
The concept of potential energy is best understood with examples, so let me give an example: There lies a mass of $1~\mathrm{kg}$ on ground, I lift the mass to a height of $1~\mathrm m$. Since I have done a work (force times displacement) against the gravity, therefore, I have given potential energy to the mass. Well, how can I know that the mass has gained any energy, if you say that “Let it fall and it will gain kinetic energy”. This argument shows that potential energy that I gave to the mass during the lift is now converting into kinetic energy, but I see it as the gravity doing work on the mass and therefore its kinetic energy is increasing. Gravity is a force, so it can provide kinetic energy to a body by setting it in a motion and that’s exactly what’s happening in the above argument. Just imagine that I lifted that mass of $1~\mathrm{kg}$ and at when I reached to a height of $1~\mathrm m$ I just switched off the gravity. Now, will the potential energy convert into kinetic energy if I let the mass to fall (the word fall here refers only to my leaving it there). I think no, it will just remain there. So, it can be argued that energy-conservation is violated and hence the thought experiment is sloppy, but this contradiction of energy-conservation has come only from axiom of potential energy (the axiom that working against a field lets the object to gain some kind of energy called potential energy) So, why there is a concept of potential energy when it can be understood as the field is doing the work and supplying the kinetic energy rather than potential energy is getting converted to kinetic energy? A Second View of the Situation: Let's take magnetic field instead of gravitational field, imagine that I have two wires with current flowing in both of them in same direction, like this According to the principles of magnetism, the two wires will attract each other, now if I take the violet wire far away (all I mean is doing the work against the attractive field) and then suddenly switching off the current in the red wire, would my violet wire accelerate towards the red one? If not where the potential energy has gone which I supplied it during taking it away. We can also imagine this situation using electrostatic field (as @FGSUZ has said in his comment) by using parallel plate capacitors. We can do same thing in this setup too. Thank you. Any help will be much appreciated. Explanation of why I don’t think that my question is a duplicate: The question which was suggested to me as of which mine is a duplicate, I think that question is basically on work-energy theorem, there OP’s main problem was why potential energy came when work is defined as change in kinetic energy. My question is why do we say that potential energy converts into kinetic energy when it is the force(the gravitational force) which is supplying the kinetic energy? Another defense against duplication: The question, to which my question is seemed to be of duplicate, says clearly in the last second paragraph above the EDIT as "Secondly, the force done by us (the external agency), is along the direction of the displacement, the work done is positive and so the change in kinetic energy should be positive (by the work energy theorem?)" It says clearly that the OP wants to understand things in terms of energy theorem and doubts within it. My question deals with the interpretation of conversion of PE into KE and the work done by the field to supply KE.
So the title's a bit irrelevelant. And I'm having a tough time thinking how to describe my doubt but I'll try my best. Apologies if it is vague, do let me know in the comments. So I just finished reading the work energy theorem and was moving on to the concept of potential energy (which my book explains poorly, or I'm missing something). I understand that by the work energy theorem the change in the kinetic energy of a body is the work done by an external force force on the body. ✓Got it, the change in the kinetic energy of a body is equal to the work done by the net force So I moved on to potential energy, where my book tries to explain stuff by starting off with an example in which we're elevating the book of mass $m$ by doing work $mgh$ on it, where $h$ is the height to which it is raised. My first doubt is, since the force we applied is $mg$ (equal to the gravitational force of attraction in magnitude yet opposite in direction), the resultant force on the book is 0. Since the resultant force is zero, the work done by the resultant force on the book should be 0, and there should be no change in the kinetic energy. Secondly, the force done by us (the external agnecy), is along the direction of the displacement, the work done is positive and so the change in kinetic energy should be positive (by the work energy theorem?) What am I messing up? Mixing the two concepts (potential energy and work energy theorem)? Yet after the work we do, potential energy increases, not the kinetic energy? What am I confusing? Edit So the given answers helped me understand where I was going wrong (somewhat). The change in the kinetic energy of a particle is equal to the work done on it by the net external force (if the particle is the system) Now I'm having trouble interpreting the work energy theorem for a system of particles. A book explains it by considering a system of two charges (one positive and one negative; attracting each other). It says: Because of mutual attraction, the particles are accelerated towards each other and the kinetic energy of the system increases Firstly, how can we consider something which isn't fixed as our system (the charges move...). Secondly, there is no net force on the system, so how is the kinetic energy even increasing. PS: I'm still all confused about potential energy. Before my book starts about potential energy it goes on to talk about the work energy theorem for a system of particles, and that's where I'm confused now.
I am writing a science-fiction story, which contains a 'crazy' planet. I would like some input into the consequences of this physics according to standard physics. The planet in question is Earth-sized and it orbits a Sun-like star. Within the story, this planet has been taken over by a malignant 'force' and has been hollowed out, so that there is one mile of basalt crust forming a spherical shell, and the inside is a void filled with nitrogen. This force keeps the planet intact, but does not affect the planet in any other way (i.e. any standard-physics problems regarding the integrity of this spherical shell can be ignored, as the story explains them in other ways). The force has no mass. Given this setup, what would the gravity be like at the center of the planet? In the story, the protagonist is able to fly around in a large bubble of zero-gravity at the middle. Would this be possible? (Assume that the protagonist can survive the atmosphere.) Could he, assuming he has a suitable raft, get around by blowing?
It is quite easy to derive the gravitational field intensity at a point within a hollow sphere. However, the result is quite surprising. The field intensity at any point within a hollow sphere is zero. What exactly is the reason behind this? Except for, of course, the mathematics behind it. Is there any logic why the field intensity should be zero within a sphere? For example, it is logical to say that the field intensity would be zero at the center, as all the intensities cancel out. However, this cannot be the case for any point within the sphere.
I am trying to make a game with the and would like to implement some sort of planetary gravity. Essentially I just want the player to be able to walk on a circle or orbit a point. I was wondering what would be the best way to do this in phaser. I know that you can set objects gravities but you can only do so in the x and y direction.
I'm trying to make a simple game where a spaceship is launched and then its path is effected by the gravity of planets. Similar to this game: I wish to know how to replicate the effect the planets have on the spaceship in this game so a spaceship can 'loop' around a planet to change direction. I have managed to achieve some bogus results where the spaceship loops in a huge ellipse around the planet or is only slightly affected by the gravity of a planet using Vectors. Thanks in advance. p.s I have plenty of coding experience just none to do with game dev.
I am attempting to model Count Dooku's lightsaber from Star Wars. However, I can't figure out how to make that triangular grip on the middle portion of the lightsaber on my model as shown in the ref image below. The triangular black portions are especially giving me trouble as well as the bumpy texturing on the grips. I would appreciate some help in solving this problem! Reference image My model so far Edit: I think I forgot to clarify. I actually have two problems. The first is actually getting the triangular shape of the grip onto my model. The second is the black texturing portion. You guys seem to have solved the texturing portion of it - thanks for that! But, I'm still having trouble with modeling the grip section. I've tried using knife project but the base corners of the triangle don't stretch out to the sides if I attempt to project from a top view!
What is the easiest way to model this diamond grip pattern into a cylinder?
I've been trying to make a navbar with css grid. However des pite my best efforts the elements refuse to align according to the grid I have set. Please look over this html and css and help me identify my problem. <body> <nav class="container"> <div class="1"> <a href="#intro">home</a> </div> <div class="2"> <a href="#work">work</a> </div> <div class="3"> <a href="#contact">contact</a> </div> </nav> and this is the corresponding css for the navbar body { font-family: 'Roboto', sans-serif; font-size: 14px; margin: 0; padding: 0; } a { text-decoration: none; } nav { display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: 1fr; } .container> div:nth-child(odd){ background: #000; padding:1em; } nav.container { height: 100px; background: #e59033; align-items: center; align-text: center; border: 1px solid #000; } .1 { grid-column: 5; } .2 { grid-column: 6; } .3 { grid-column: 7; } According to me this seems fine but for the life of me I can't figure out where I am going wrong.
What characters/symbols are allowed within the CSS class selectors? I know that the following characters are invalid, but what characters are valid? ~ ! @ $ % ^ & * ( ) + = , . / ' ; : " ? > < [ ] \ { } | ` #
I have a list of complex objects and would like to order it with linq (to objects) according to an "order-by-keyword": protected override sealed List<IndexViewModel> Order(List<IndexViewModel> listToOrder, string orderBy) { List<IndexViewModel> indexViewModels; switch (orderBy.ToLower()) { case "creator": indexViewModels = listToOrder.OrderBy(s => s.Creator).ToList(); break; case "startdate": indexViewModels = listToOrder.OrderBy(s => s.StartDate).ToList(); break; ... default: indexViewModels = listToOrder.OrderBy(s => s.CreationDate).ToList(); break; } return indexViewModels; } Is there any way to improve my code? Probably by assigning my keyword to linq and let it decide how to sort it?
I found an example in the for Dynamic LINQ that allows you to use a sql-like string (e.g. OrderBy("Name, Age DESC")) for ordering. Unfortunately, the method included only works on IQueryable<T>. Is there any way to get this functionality on IEnumerable<T>?
It really simple, but for some reason the second segment doesn't work at all. Clicking a card doesn't do ANYTHING. $('.container__card').hover(function(){ $(this).toggleClass('container__card container__card--hover') }); $('.container__card--hover').click(function(){ $(this).toggleClass('container__card--selected container__card--hover'); });
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.
Why do Americans say off of when they tell someone to get off them?
How can I explain to people that the phrase off of is grammatically incorrect? I‘ve heard this phrase used a lot, especially by Americans (though they aren't the only ones). In my understanding, off of should usually be replaced by off, as in, I took the book off the shelf as opposed to I took the book off of the shelf Am I wrong? Or is there perhaps some simple way I can explain this to most people?
When does Lollipop hit AT&T Note 4? I have read many articles that the Note 4 was going to receive Lollipop late January. But still no updates. I believe the Galaxy S5 AT&T has Lollipop. Any one have any ideas what the release date is?
Android 5.0 (Lollipop) was officially announced on October 15th, 2014. You can review the high-level changes at the and the announcement on the official . Of course, not all devices will get this update right away and others won't get it at all. Each manufacturer and carrier often choose to add their custom modifications which tend to delay the official release. When will each device get Android 5.0, either officially or unofficially, if ever? See also:
I have sets of objects CustomObjectA, CustomObjectB, CustomObjectC... that I need to pass to a method. I would like to put them in a Map of type Map< String, Set< sObject > >, but when I try, I get an error: Incompatible types since an instance of Set<CustomObjectA> is never an instance of Set<sObject>. Incompatible types since an instance of Set<CustomObjectB> is never an instance of Set<sObject>. When I change it to lists instead of a sets (using Map<String, List<sObject>>) and lists of my custom objects, I don't encounter the same problem. Why would that occur?
As most stories here begin, I was writing some code for a project that I was working on, and stumbled across an oddity when writing some unit tests. I was testing a method that has a Set<sObject> parameter, and I was attempting to pass this method a Set<Account>. As Account inherits from sObject, I thought this would work fine. However, when running my test, I got the error Method does not exist or incorrect signature: [TestClass].someMethod(Set<Account>) Yes, the method that I was testing expects an argument of Set<sObject>, but an Account can be up-cast to an sObject, and Salesforce handles that implicitly, right? Since Salesforce was throwing a fit when I tried to rely on implicit casting, the next thing I tried was explicitly up-casting. When I tried to explicitly up-cast my set, I was greeted with a different error Line: someNumber, Column: otherNumber Incompatible types since an instance of Set<Account> is never an instance of Set<SObject> This can be reproduced with the following snippet Set<sObject> testSet1; Set<Account> testSet2 = new Set<Account>(); testSet1 = (Set<sObject>)testSet2; I haven't found anything in the documentation to suggest that up-casts for sets aren't allowed. Given that we can up-cast Lists and Maps, I feel this is rather unexpected. Furthermore, knowing that an Apex set is really a Java HashSet in the back-end (look at the bottom of ), I tried to look for documentation to see if this is somehow dictated by Java, but I came up empty there as well. I've been able to move on with my project, but this leaves me wondering... Is there some documentation (Salesforce or Java) that explains this behavior? Failing that, can someone cobble together a feasible explanation for why Sets can't be up-cast?
In Avengers: Endgame Thor took his hammer from the Asgard in the past and brought it back to the present. So, does Thor from the past use present Thor's hammer after present Thor brought it to the present?
In Avengers: Endgame, Thor brings back Mjolnir (his hammer) from the past to his "future" self through the quantum tunnel. Later in the movie, Captain America gets hold of it being worthy. However, I don't remember if Cap takes it back to the past in the climax. If he doesn't - that would break the spacetime continuum, Mjolnir being destroyed in the past. If he does bring it back, how come he knows the exact time and place to return?
I have a question and I'm really struggling to grasp what I need to do. I have Rolle's theorem and Mean Value Theorem given to me, and the question follows; Let $f(x)$ be a continuous function on $[0,1]$ such that $$\int_{0}^{1} f(y) dy = 1$$ Prove that then $f(x)=1$ for some $x\in[0,1]$. I don't know if it's the way this is worded but I've never been so confused in my entire life! Thanks in advance.
We are asked the following: let $f(x)$ be a continuous function on $[0, 1]$ such that $$\int _ {0} ^ {1} \ f(y) dy = 1$$ prove that $f(x) = 1$ for some $x ∈ [0, 1]$ The question asks to take into account Rolle's Theorem and Mean Value Theorem. I'm aware of the definitions, but I am really unsure how to answer this question and my tutors are not really responding till after easter. Could someone please help? Why is there a "y" involved? Thanks you
I want to prove that for all positive integers $n$, $2^1+2^2+2^3+...+2^n=2^{n+1}-2$. By mathematical induction: 1) it holds for $n=1$, since $2^1=2^2-2=4-2=2$ 2) if $2+2^2+2^3+...+2^n=2^{n+1}-2$, then prove that $2+2^2+2^3+...+2^n+2^{n+1}=2^{n+2}-2$ holds. I have no idea how to proceed with step 2), could you give me a hint?
$\displaystyle\sum_{i=0}^n2^i=2^{n+1}-1$. I don't understand induction so I could use some help.
How to transform (d e normalize) predicted values when I normalize the data in the range between -1 to 1?
Alright so i have found really good answer on how to normalize my data. I implemented @user25658 's code into my own project successfully, trained a linear model and used it to make a prediction. Say y = 0.4513869 is the predicted normalized value which i would like to de-normalize. Based on the normalization code below, how can i achieve this? normalized = (x-min(x))/(max(x)-min(x))
Light travels in the form of a wave.It has masless photons travelling at the speed of light.Does it mean that tha photons travels in the trajectory same as that of a wave.
At the end of this nice video (), she says that is a chain reaction of electric and magnetic fields creating each other so the chain of wave moves forward. I wonder where the is in this explanation. What is the relation between electromagnetic wave and photon?
I have this simple java code: import java.nio.file.*; import java.io.*; public class Write { public static final String PATH = "/home/user/Desktop/hello.txt"; public static void main(String[] argv) { Path path = Paths.get(PATH); OutputStream out; try { out = Files.newOutputStream(path, CREATE, APPEND); } catch (IOException e) { System.out.println("Caught IOException: "+e.getMessage()); } } } which wont compile due to this error: Write.java:14: error: cannot find symbol out = Files.newOutputStream(path, CREATE, APPEND); ^ symbol: variable CREATE location: class Write Write.java:14: error: cannot find symbol out = Files.newOutputStream(path, CREATE, APPEND); ^ symbol: variable APPEND location: class Write 2 errors Usually this means that I've forgotten to import some stuff. I even tried to add: import java.nio.file.StandardOpenOption But I get the same error. EDIT: Ok so, I've solved my problem by following @rmlan advice. I did miss those constants. Thanks.
When used like this: import static com.showboy.Myclass; public class Anotherclass{} what's the difference between import static com.showboy.Myclass and import com.showboy.Myclass?
I was reading about packages, and I wondered what are package names for commands like "ls" and "echo"? These commands were installed on every Linux machine I've worked with, and I don't know which package installs them. $ sudo apt purge ls Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package ls $ sudo apt purge echo Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package echo And the same thing happened for lots of other commands. Q1. Is there any package which has all these primary commands in? Q2. Do "ls" or "echo" or ... have a package? or they are just some commands? Q3. How can I find the package name of commands like "ls", "echo", "read" and so other?
Simple enough question: is there some shell command (or GUI method) I can use that, given the path to a file on my system, tells me what package put it there? Assuming the file did in fact come from a package, that is. Bonus question: what if it's a file that isn't installed on my system? Is there, say, a website that will let me look up a file and see what packages, if any, provide it?
I know about Connectedness and Path Connectedness in Topology. Recently, I got stuck into a problem. Let $A$ be the following subset of $\mathbb{R}^2:$ $$A=\{(x,y) \mid (x+1)^2 + y^2 \leq 1\}\cup \{(x,y) \mid y=x\sin(\frac{1} {x}),\ x>0\}$$ The connectedness is obvious from if $A$ is connected then $cl(A)$ is also connected. But I can't prove the path connectedness ( The answer is given that $A$ is both connected & Path connected). Please help. Thanks in advance.
Let $A$ be the following subset of $\mathbb{R}^{2}$:$$A=\{(x,y):(x+1)^{2}+y^{2}\leq 1\}\cup\{(x,y):y=x\sin(\frac{1}{x}),x>0\}$$ Then $1.$ $A$ is connected. $2.$ $A$ is compact. $3.$ $A$ is path connected. $4.$ $A$ is bounded. It is clear that $A$ is unbounded as the graph of $x\sin(\frac{1}{x})$, so option $2$nd and $4$th are not correct. Again $A$ is connected by using the fact that closure of connected set is connected. But i am confused about path connectedness of $A$. Please help me about path connectedness of $A.$ Thanking you.
I am trying to figure out the best way to do multiple LIKE matches in a complicated soql statement. I want to change the hubFilter value from just "BCS%" to "BCS%,Benefit Advisor,Mgr of Ben,BSR". I tried this and got nothing back so I assume it's not reading those as separate values. Any ideas? Here is a basic example of what my query looks like: list<BCS__c>hubs = new list<BCS__c>(); private string hubfilter; if(showAll == TRUE){ hubFilter = '%'; }else{ hubFilter = 'BCS%'; } hubs = [ SELECT /*fields and subqueries*/ FROM BCS__c WHERE /*other clauses*/ AND Title__c LIKE :hubFilter ];
Is there a way to mix LIKE operator with IN ? Something Like SELECT Id FROM Account WHERE Name LIKE IN:nameList Where nameList is list of String? Is this is possible ? (I can make a dynamic query by doing OR with all the elements, but was looking for a more elegant way to do this)
I have done that when I push button it should insert data into mysql database but it only inserts it when I reload page. Here Is the code: <script> function minuscredits() { alert("hah"); <?php mysql_query("UPDATE `users` SET credits=credits-1 WHERE user_id=".$_SESSION['user']); ?> } </script> When I push button I get alert but not insert into database only if I reload page it inserts successfully.
Is it possible to call a function from PHP using onsubmit from JavaScript? If so could someone give me an example of how it would be done? function addOrder(){ $con = mysql_connect("localhost", "146687", "password"); if(!$con){ die('Could not connect: ' . mysql_error()) } $sql = "INSERT INTO orders ((user, 1st row, 2nd row, 3rd row, 4th row) VALUES ($session->username,1st variable, 2nd variable, 3rd variable, 4th variable))"; mysql_query($sql,$con) if(mysql_query($sql,$con)){ echo "Your order has been added"; }else{ echo "There was an error adding your order to the databse: " . mysql_error(); } } That's the function I am wanting to call. Its an ordering system, you type in how much of each item you want, hit submit and it should add the order to the table.
I am looking for a tool that tells what keys (including Alt, Shift, Ctrl, etc) are pressed now. Need it to do a health-check on a possibly faulty keyboard.
I'm going to be giving a short "talk" about efficient note taking with LyX. As such it'll be important to focus on keyboard shortcuts. Since people can't see me type, however, I want a tool that displays keyboard combinations as I press them, like this: I'm sure I've read about something like this on OMG Ubuntu!, but my google-fu is weak. Ideas?
I'm scanning log files (in a directory) for specific lines, need to output all in a text file. For some reason, I do not understand, I have an error: NameError: name 's' is not defined I tried to assign Var s to a different Var but still cannot get around the problem. In my code, I going to have one "if" and 5 "elif" like this: If var1 elif var2 elif var3 elif var4 elif var5 elif var6 write.output_file(var1+var2+var3+var4+var5+var6+'\n') Here is the code: import os import re start_tm = '," Start Time' test_ID = ' Host Name: ' cell_f = open('C:\\03\\OUTCOME.txt','w') given_path = 'C:\\02\\en15\\TST2' for filename in os.listdir(given_path): filepath = os.path.join(given_path, filename) if os.path.isfile(filepath): #print("File Name: ", filename) print("File Name\\Path:", filepath+'\n') with open(filepath) as mfile: for rn_l in mfile: rn_l= rn_l.rstrip() if start_tm in rn_l: *extraWords,st_t1 = rn_l.split('Time') # Grtting Start Time # s=str(st_t1) s=s.replace('"','') print ("Start String \"s\"is a TYPE ", type(s)) print ("START TIME STRING "+s) elif test_ID in rn_l: *extraWords,t_id1,t_id2, = rn_l.split( ) print ("TESTER ID --->>> "+t_id1) t_id11,t_id12, = rn_l.split('Host') *w,e,c,d = re.split(" +", t_id11) cell = str(e+'_'+c) cell = cell.replace('[','').replace(']','') print ("Cell Line " + cell+'\n')
What exactly are the Python scoping rules? If I have some code: code1 class Foo: code2 def spam..... code3 for code4..: code5 x() Where is x found? Some possible choices include the list below: In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop Also there is the context during execution, when the function spam is passed somewhere else. And maybe pass a bit differently? There must be a simple reference or algorithm somewhere. It's a confusing world for intermediate Python programmers.
How do I pick a random row of text from a file?
Is there any Linux command one can use to sample subset of a file? For instance, a file contains one million lines, and we want to randomly sample only one thousand lines from that file. For random I mean that every line gets the same probability to be chosen and none of the lines chosen are repetitive. head and tail can pick a subset of the file but not randomly. I know I can always write a python script to do so but just wondering is there a command for this usage.
We know how to typeset the commonly used diagonal dots, i.e., \ddots, whose slope is -1. Now I want to produce dots with slope 1, which is perpendicular to \ddots. Does anyone know how to do it?
I was wondering if anyone knew how to draw 3 dots in a matrix that go in a diagonal way usually to represent that element flow similarily in the slots. I know there's one that goes in the bottom right corner. But is there one that goes in the bottom left?
I have looked at at least 10 SO questions on get/set but cannot find mine. So I hope this is not a duplicate. public class myint { public int value{get;set;} } vs public class myint { public int value; } The above 2 codes look the same to me. If I want to use the myint class, I just write the code below and it can run on either class. myint A; A.value=10; So what is the get/set use for?
I see a lot of example code for C# classes that does this: public class Point { public int x { get; set; } public int y { get; set; } } Or, in older code, the same with an explicit private backing value and without the new auto-implemented properties: public class Point { private int _x; private int _y; public int x { get { return _x; } set { _x = value; } } public int y { get { return _y; } set { _y = value; } } } My question is why. Is there any functional difference between doing the above and just making these members public fields, like below? public class Point { public int x; public int y; } To be clear, I understand the value of getters and setters when you need to do some translation of the underlying data. But in cases where you're just passing the values through, it seems needlessly verbose.
Is there a keyboard shortcut to shut down OSX 10.10.1?
I want to bind a gesture in BetterTouchTool to the shut down menu that is invoked by pressing the power button on my MacBook Air. It's fairly simple to bind gestures to keyboard shortcuts, so what I'm really looking for is a way to bind a keyboard shortcut to the shut down menu. You can't use the power button in BetterTouchTool, so I need to bind it to a standard keyboard shortcut such as Command+Shift+S.
Sometimes you will not get a runtime error when you access your array out of range in C code. such as: char array[1024]; char* ptr = array; *(ptr-10) = 'a'; //or *(ptr-4096) = 'a'; Assuming the array is on the stack, I am curious about what is the MIN SIZE that will let *(ptr-SIZE) = 'a' throw a segmentation fault in any situation? for example: *(ptr-4096*1024) = 'a' // this will always throw a segmentation fault *(ptr-4096*8) = 'a' // sometimes this will not throw a segmentation fault 2017/1/10, new added: I feel sorry for not stating the question clearly. : ( What I want to know is not just a ambiguous UNDEFINED. Assuming the stack is high, and heap is low. So the memory layout will be: high ********* * stack * <- my array goes here ********* * * * * <- ptr may be here * * ********* * heap * ********* * ??? * <- ptr may be here ********* Of course I know that The problem is that C/C++ doesn't actually do any boundary checking with regards to arrays. It depends on the OS to ensure that you are accessing valid memory So, the code above will cause the OS kernel invoke do_page_fault, and will try to find vma of the address, and check if the vma->vm_start < address. Now, let's come back to the question I asked: the MIN SIZE that will let *(ptr-SIZE) = 'a' throw a segmentation fault in any situation. In other word, I want to know the SIZE that the do_page_fault can afford. It is nothing about the C compiler, but how your OS protects your memory.
Why does C/C++ differentiates in case of array index out of bound #include <stdio.h> int main() { int a[10]; a[3]=4; a[11]=3;//does not give segmentation fault a[25]=4;//does not give segmentation fault a[20000]=3; //gives segmentation fault return 0; } I understand that it's trying to access memory allocated to process or thread in case of a[11] or a[25] and it's going out of stack bounds in case of a[20000]. Why doesn't compiler or linker give an error, aren't they aware of the array size? If not then how does sizeof(a) work correctly?
I own a website . We did not have proper content before so to prevent search engine from crawling our site we added a robots.txt with code to prevent crawling. Now we had updated our sites content and want to get it crawled, but Google is not crawling it yet. We removed the code from robots.txt to prevent Googlebot to crawl, but still it is not getting crawled. We almost did this change before 20-21 days but still Google is not crawling our site and if search I search on Google it displays: A description for this result is not available because of this site's robots.txt – learn more. Kindly guide me, what I need to do for this?
(Note that I am going to use screenshots here because I suspect writing about this will change the behavior over time.) If you do a Google search for uiviewcontroller best practices either with or without the quotes, you end up with results like this: Note that none of these pages resolve to the actual Stack Overflow question containing those words in the title. They resolve to either a) sites that are mirroring our creative commons data and correctly pointing back to the source question without nofollow, as properly specified by or b) our own internal links to the question, but not the actual question itself. The actual page with the title ... Custom UIView and UIViewController best practices? ... does exist at this URL ... http://stackoverflow.com/questions/3300183/custom-uiview-and-uiviewcontroller-best-practices ... and apparently it is present in Google's index! But why does it not appear when we search for uiviewcontroller best practices ? We know that Google contains this page in its index Our search terms match the title of the question Stack Overflow has much higher pagerank than the other sites that are I don't get it. What are we doing wrong here?
I'm trying to write a very simple mkcd command: #!/bin/bash mkdir $1 cd $1 The directory is created but the change directory part doesn't seem to run. Update based on comment: mkcd () { mkdir "$1" cd "$1" } I'm trying to run it first as a local file: ./mkcd My end location is /opt/bin, neither location seems to work.
I wrote a script for the purpose of changing directory and then scan a file. #!/bin/bash model_dir=/mypath function chdir () { cd $1 } chdir ${model_dir}/config if [[ ! -s *.cfg ]] then echo `date` "configure file does not exist" exit 1 fi I don't why my current directory is not changed after I execute this script with source myscript.sh.
I used all options on the web but this seems to trick me every time. u used flex vertical alignment I don't want to add margin or padding. You can comment to start the discussion. I am just adding this bcox its asks for more explanation: .topnav { overflow:hidden; background-color: #333; padding-top: 10px; padding-bottom: 10px; padding-left: 5px; margin: 0px; } .topnav div { float: left; display: flex; color: #f2f2f2; font-size: 15px; margin:auto; text-align: center; padding-left: 10px; } .topnav div:hover { background-color: #ddd; color: black; margin:auto; position: relative; vertical-align: middle; } .topnav div.active{ color:white; display:flex; font-family: Arial, Helvetica, sans-serif; font-size: 20px; margin:auto; } <div class="topnav"> <div class="active">Some Title</div> <div>Link</div> </div>
I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS needed for this to work on all common browsers? <div id="header"> <img src=".." ></img> <h1>testing...</h1> <img src="..."></img> </div>
I installed (or downloaded) drupal 8 via: composer create-project drupal/drupal my_site_name 8.0.* Which, at the time I ran it, downloaded Drupal 8.0.1. Now drupal 8.0.2 is available and I'd like to update to this version. I'm not sure how to update core but I decided to try running composer update from my drupal site's root directory. This updates many packages (e.g.): $ composer update Loading composer repositories with package information Updating dependencies (including require-dev) - Removing composer/installers (v1.0.21) - Installing composer/installers (v1.0.22) Loading from cache > Drupal\Core\Composer\Composer::vendorTestCodeCleanup - Removing symfony/class-loader (v2.7.6) - Installing symfony/class-loader (v2.7.9) Downloading: 100% > Drupal\Core\Composer\Composer::vendorTestCodeCleanup - Removing symfony/console (v2.7.6) - Installing symfony/console (v2.7.9) Downloading: 100% (...) > Drupal\Core\Composer\Composer::vendorTestCodeCleanup - Removing twig/twig (v1.23.1) - Installing twig/twig (v1.23.3) Downloading: 100% However I don't see anything about updating drupal/drupal. And when I visit my site's status report it still shows 8.0.1. So how do I actually update core via composer?
I want to use composer to manage Drupal 8 dependencies, but I'm not sure what is the right core update workflow. At the moment I'm using drush to update core to latest beta release, but I also have some dependencies in my composer.json file, so after the update I'm using composer install to install all the contrib vendor dependencies. It appears that running composer install overrides some files in the core directory, although I've just updated core to latest version. I've also tried to manually edit the composer.json file and replace the "drupal/core" line with the specific beta release, e.g. "drupal/core": "~8.0-beta14",, but it still overrides files in the core directory. What is the right workflow?
We have to find the limit of the following' $$\lim_{x\to 1}\frac{\left(\sum_{k=1}^{100}x^k\right)-100}{x-1}.$$ I thought to use sandwich theorm But in I am not getting how to start .
I am able to evaluate the limit $$\lim_{x \to 1} \frac{x + x^2 + \dots + x^n - n}{x - 1} = \frac{n(n + 1)}{2}$$ for a given $n$ using l'Hôspital's (Bernoulli's) rule. The problem is I don't quite like the solution, as it depends on such a heavy weaponry. A limit this simple, should easily be evaluable using some clever idea. Here is a list of what I tried: Substitute $y = x - 1$. This leads nowhere, I think. Find the Taylor polynomial. Makes no sense, it is a polynomial. Divide by major term. Dividing by $x$ got me nowhere. Find the value $f(x)$ at $x = 1$ directly. I cannot as the function is not defined at $x = 1$. Simplify the expression. I do not see how I could. Using l'Hôspital's (Bernoulli's) rule. Works, but I do not quite like it. If somebody sees a simple way, please do let me know. Added later: The approach proposed by Sami Ben Romdhane is universal as asmeurer pointed out. Examples of another limits that can be easily solved this way: $\lim_{x \to 0} \frac{\sqrt[m]{1 + ax} - \sqrt[n]{1 + bx}}{x}$ where $m, n \in \mathbb{N}$ and $a, b \in \mathbb{R}$ are given, or $\lim_{x \to 0} \frac{\arctan(1 + x) - \arctan(1 - x)}{x}$. It sems that all limits in the form $\lim_{x \to a} \frac{f(x)}{x - a}$ where $a \in \mathbb{R}$, $f(a) = 0$ and for which $\exists f'(a)$, can be evaluated this way, which is as fast as finding $f'$ and calculating $f'(a)$. This adds a very useful tool into my calculus toolbox: Some limits can be evaluated easily using derivatives if one looks for $f(a) = 0$, without the l'Hôspital's rule. I have not seen this in widespread use; I propose we call this Sami's rule :).
I have a array list which have a list of a type, but all values are duplicated. Specifically, my blog url is in my array list twice. How can I remove the duplicates?
Anyone have a quick method for de-duplicating a generic List in C#?
I want to test if cron's mailing stuff after an executed task and things like that work. Is there a more elegant way to test this, then setting a cron job to run every few seconds? So, is there any way to simulate the execution of a cron job / start a cron job manually, but with the same behaviour it would have when being run automatically by cron?
I have a cron job that is scheduled to run everyday, other than changing the schedule, is there any other way to do a test run of the command right now to see if it works as intended? EDIT: (from the comments) I know the command works fine when enter it in shell (my shell), but I want to know if it works correctly when cron runs it, it could be affected by ENV or shell specific stuff (~ expansion) or ownership and permission stuff or ...
I want to use ubuntu 16.04 with windows 8.1 (dual boot) . But after installing ubuntu it only boots with a USB. after booting in the grub page it shows 4 options . they are :- try ubuntu without installing. install ubuntu odx installation (for manufacturers) check for drive errors. I am now using the 1st option because after installing ubuntu this is the option that I find suitable for using. I have installed ubuntu 2 times but nothing is working out for me. then I saw a post which instructed me to write some codes in the terminals. the result I got after I tried the below codes:- $ ls -l /dev/disk/by-label/ total 0 lrwxrwxrwx 1 root root 10 Apr 27 15:46 RECOVERY -> ../../sda5 lrwxrwxrwx 1 root root 10 Apr 27 15:46 UBUNTU\x2016_0 -> ../../sdb1 lrwxrwxrwx 1 root root 10 Apr 27 15:46 Windows -> ../../sda4 lrwxrwxrwx 1 root root 10 Apr 27 15:46 WINRE -> ../../sda1 $ sudo grub-install /dev/sdb Installing for i386-pc platform. grub-install: error: failed to get canonical path of `aufs'. Even I am not able to access any files in my pc through Ubuntu. it shows the error :- unable to access "windows". Error mounting /dev/sda4 at /media/ubuntu/Windows: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=999,gid=999" "/dev/sda4" "/media/ubuntu/Windows"' exited with non-zero exit status 1: Blockquote I am not able to understand what is wrong and I am not able to find a solution for it. I am a new to Ubuntu so do give a bit of explanations.
I had Ubuntu 12.04 Beta installed on my computer. When 12.04 was finally released, I made a bootable USB Flash Drive using Startup Disk Creator. Then I decided to check if this drive works properly and to reinstall the system on my desktop. I must add, my desktop behaves a bit strange when it comes to bootable USB's, it recognizes them as HDD. In BIOS I changed priority of boot so USB Flash Drive (recognized as HDD) was first. Successfully booted, I installed Ubuntu. Everything worked fine, but... Now I cannot boot from my real HDD. Every time I want to boot, I put the USB Flash Drive into my computer, boot, safely remove it and everything works. What do I need to do to repair boot?
I have understood that it's trivial to reconstruct the internal state of a hasher for many hash functions, if one only knows the output hash. Then, one can append data after the original data and obtain a valid hash for the original data plus the appended data. However, recently . If hash functions append the length, why doesn't that stop the length extension attacks? For a good hash function, if the attacker knows hash(message || length), there should be no way to obtain hash(message) to be able to calculate hash(message || appended_data) which would allow calculating hash(message || appended_data || total_length). Related: ...although the related question doesn't discuss appending of the length which MD5, SHA1, etc. do.
I have been trying to understand exactly how a length extension attack works on SHA-1. I'll detail below what I've understood so far, so that I can convey my understanding of the same and hopefully get advice on where I'm going wrong. Lets assume that for a message $m$, a secret $s$ is appended to it and the SHA-1 hash is calculated. If $\textrm{len}(m) + \textrm{len}(s)$ is not a multiple of the block size, a certain amount of padding is added to it to make it a multiple, and the hash is generated using what is essentially $s || m || \textrm{padding}$. Now SHA-1 internally uses 5 registers — it takes in an block, generates new register values, turns the crank, takes in another block, generates new register values, turns the crank ... and so on till the end. When all blocks are exhausted, the register values are concatenated and spit out. Assume that an attacker knows a certain value of $m$, for which he also knows the hashed key. In such a case, he knows the state of the 5 registers when $(s || m || \textrm{padding}$ was processed. Lets also assume that the attacker knows the length of $s$, so that he can predict how much padding was added. Here is where I get confused. From what I've read so far, the attack involves taking the known hash, adding a certain amount of padding and then the value that we want. However, isn't the padding already used up in creating the hash? Why are we using padding in our attack?
I am confused why we can introduce differentials into an integral when performing an integration by substitution. Consider the integral $$\int \frac{1}{ x \sqrt{1-x} } dx.$$ We can perform the substitutions $$x=\sin^2u,$$ $$dx=2\sin u \cos{u} du ,$$ on the integral to give $$\int \frac{1}{ \sin^2u \sqrt{1-\sin^2u} } 2\sin u \cos u du .$$ Why can you treat $dx$ as a differential? From my understanding the integration sign $\int dx$ works as as if it is an operator, just like how $\frac {d}{dx}$ works as an operator and not as a fraction. Which means $\int$ and $dx$ should not be interpreted separately. But at the same time treating $dx$ as a differential always work out fine so there must be some validness in treating it as an differential.
I just finished taking my first year of calculus in college and I passed with an A. I don't think, however, that I ever really understood the entire $\frac{dy}{dx}$ notation (so I just focused on using $u'$), and now that I'm going to be starting calculus 2 and learning newer integration techniques, I feel that understanding the differential in an integral is important. Take this problem for an example: $$ \int 2x (x^2+4)^{100}dx $$ So solving this... $$u = x^2 + 4 \implies du = 2x dx \longleftarrow \text{why $dx$ here?}$$ And so now I'd have: $\displaystyle \int (u)^{100}du$ which is $\displaystyle \frac{u^{101}}{101} + C$ and then I'd just substitute back in my $u$. I'm so confused by all of this. I know how to do it from practice, but I don't understand what is really happening here. What happens to the $du$ between rewriting the integral and taking the anti-derivative? Why is writing the $dx$ so important? How should I be viewing this in when seeing an integral?
On Ubuntu 20.04, when I select multiple files on Desktop and move them (either moving icons around on desktop, or moving multiple files to Trash), only the item over which mouse is residing gets moved, the rest are left behind. As a result, I am unable to do multi-icon mouse drag'n'drop actions on Desktop. This behavior doesn't happen when I move files in File manager, across windows and/or folders. Thoughts?
In Ubuntu 20.04, on the desktop, there is a number of actions I wish I could do, such as, by order of importance : use keyboard shortcuts such as select all, copy / paste. use drag & drop with icons deactivate the "mouse over" highlight, and restrict the clicking area to only the icon, not the surrounding square To put it simply, I'd like to have the exact same features as offered by the desktop of Ubuntu 18.04 (probably related to a specific version of GNOME, and not Ubuntu itself). Am I missing something obvious here? I actually see no reason why those actions are removed or deactivated on the desktop, since they all work in any Nautilus window.
I am trying to send an send a request using get method of HTTP Request and I need to pass the username and password of Named credentials in the URL as username as clientID and password as the client secret Below is the code @future (callout=true) webservice static void requestCall(String first, String second, String third) { HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); Http http = new Http(); String url ='?first=' + first+ '&second=' + second+'&third=' + third+'&client_id=' + '{!HTMLENCODE($Credential.Username)}' + '&client_secret=' + '{!HTMLENCODE($Credential.Password)}'; req.setEndpoint('callout:Named_Credentials'+url); req.setMethod('GET'); req.setCompressed(true); req.setTimeout(120000); try { res = http.send(req); System.debug(req); } catch(System.CalloutException e) { System.debug('Callout error: '+ e); System.debug(res.toString()); } } I am getting a response following response in the debug { "message": "Bad Request" } Also, when I store the client Id and client secret in custom setting and use them, it is working fine and getting a proper response. Any suggestions or help that how can I fetch the username and password from Named credentials
I have a named credential as follows: Name Test_Credential URL https://www.somesite.com Identity Type Named Principal Authentication Protocol Password Authentication Username foobar Password mySomeSiteDeveloperKey Generate Authorization Header FALSE Allow Merge Fields in HTTP Header TRUE Allow Merge Fields in HTTP Body TRUE The service that I am trying to authenticate against uses URL parameters to pass in the developer key and username. Is there any way to use to pass those in to the URL? The Named Credential attributes seem not to get decoded until the request is actually sent, as debugging the endpoint, or headers if I set them per the linked doc, show the un-merged data. I can get the callout to go to the right place, and return the expected error because the auth information is not provided. Anybody know of a "show me my HTTP request" site that I could point to to get a better idea of how this works? I've tried both of these: req.setEndpoint('callout:Test_Credential/api/action?id={!$Credential.Password}&account={!$Credential.UserName}'); req.setEndpoint('callout:Test_Credential/api/action' + '?id=' + '{!$Credential.Password}' + '&account=' + '{!$Credential.UserName}'); (Edited to remove the part about $Credential vs. $Test_Credential as I was able to determine that it is the former, and see the merged creds by calling out to .)
A dog is tied to circular pillar by a rope. Radius of this pillar is $1m$ and length of rope is $\pi m$. What is an area where dog can roam? I tried to find the area of all semicircles and then to find its sum. It is easy to find an area at front side of the pillar. It is $\displaystyle\frac12\pi^2\pi=\frac{\pi^3}{2}$. Problem is how to find remaining area. I tried to write this area using compass and straightedge, but I couldn't. Then I wrote this in AutoCAD and it looks like this: Is it possible to find the exact value of this area?
How do we find the area that the cow can graze? The question goes as follows-- There is a circular barn house surrounded by a huge grazing field. A cow is tied to the rope ($AB$) at the end $A$ as shown. The length of the rope is half the circumference of the barn. Find the area that the cow can graze. The left side of the area is obvious but i cannot get a hang of what is happening on the right side..all i can say is that the rope starts to wrap around the barn when the cow goes to the right. The length of the rope is $16\pi$ units.
I noticed today that a request for protection came up due to the the large number of me-too answers on a trending question I answered recently. This got me thinking, since trending questions get far more attention than the average question, should questions that trend be automatically protected? On the upside, this does seem to be a common problem and the auto-protection could be put in place only while the question is trending. On the downside, it would make it more difficult for new people to participate in answering a trending (highly visible) question so it could be a barrier to entry. Thoughts?
Expanding the criteria for auto-protection has been discussed in the past: But I think that discussion addresses the wrong problem: Protecting a question with a large number of answers doesn't do anything to fix the problems caused by having a large number of answers. In most cases, the question should still be either cleaned up or closed. Large numbers of answers does not necessarily indicate a honeypot for misguided newbies. While a fair number of these do fall into territory, that's not universally true - and blocking outsiders from answering a question just because a lot of "insiders" have already gotten to it doesn't solve anything. The occasional drive-by answer on an old, answered question isn't that much of a problem and we have existing tools for identifying and handling them. Generally, are sufficient for perpetually-popular posts. However, there is a scenario that isn't addressed by them: a question that sees a sudden, extreme increase in popularity and as a result attracts a large number of non-answers that must then be deleted. The classic case is a post that rises to the top of Reddit for a while, although we've seen similar effects from other sources (and even generated internally from links on our own Hot List or meta posts). Let me be clear: these 15 minutes of fame aren't inherently bad: a good question that attracts a lot of attention can also attract some really great answers. But there's always that temptation to just participate even when you've nothing of value to contribute - and moderating a sudden influx of such answers can be troublesome, particularly on smaller sites: If no moderator is around, it falls on trusted members of the community to remove non-answers. We're working on distributing the load here, but this will still be labor-intensive on smaller sites. When your first experience on a site is having your post deleted, it doesn't exactly endear you to the community there. Yes, you may well have Learned A Valuable Lesson from it, but we could be a bit more gentle about teaching that. The communities on these sites, knowing full-well how troublesome such answers can be, may try to questions that start to garner a lot of attention - potentially locking out good answers on questions that wouldn't actually be problematic if left to themselves. That last one in particular concerns me. I think most users use their privilege responsibly, but the notion that "hot" questions need preemptive protection has proved stronger than common sense here - and I don't think we should fight it. Instead, let's... Expand the existing heuristics to protect questions that are demonstrating problematic tendencies, but haven't yet been proven problematic As explained in the title, this means protecting questions that've gotten more than N answers (deleted or otherwise) in a 24-hour period from users who've earned less than 10 reputation on the site (excluding any association bonuses). This would be a check made when the answer is posted - so if N is 3, the third answer from a new user would block further answers. On most sites, N can be fairly large - a threshold of 5 would protect questions like these on Stack Overflow: On certain sites, we might want to set the threshold significantly lower. A threshold of 4 would protect questions like these on The Workplace: Coupled with this change, I think it also makes sense to expand the to allow users to unprotect questions that were automatically protected, thus allowing them to override the system if it becomes overzealous. Related:
I want to re-create this image with tikz. Currently I'm at this point, but I don't know how to improve my code to make it smoother: \documentclass{article} \usepackage{xcolor} \usepackage{listings} \usepackage{float} \usepackage{tikz} \usepackage{siunitx} \usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri} \definecolor{mycolor}{RGB}{31,22,70} \definecolor{mycolor2}{RGB}{21,126,251} \begin{document} \begin{figure}[H] \centering \begin{tikzpicture}[ scale=0.8, transform shape, show background rectangle, background rectangle/.style={fill=gray!10}, box/.style={draw, font=\itshape} ] \coordinate (b) at (current page.center); \node[rounded corners=3mm, label=center:{Onboard}, fill=mycolor2!20] (onboard)at (b) [draw,minimum width=2.5cm,minimum height=2.4cm] {}; \node[below right = of onboard, rounded corners=3mm, label=center:{Deploy}, fill=mycolor2!20] (deploy) [draw,minimum width=2.5cm,minimum height=2.4cm] {}; \node[below right = of deploy,rounded corners=3mm, label=center:{Monitor}, fill=mycolor2!20] (monitor) [draw,minimum width=2.5cm,minimum height=2.4cm] {}; \node[below left = of monitor, rounded corners=3mm, label=center:{Scale}, fill=mycolor2!20] (scale) [draw,minimum width=2.5cm,minimum height=2.4cm] {}; \node[left =of scale, rounded corners=3mm, label=center:{healing/fault-recovery}, fill=mycolor2!20] (healing) [draw,minimum width=4cm,minimum height=2.4cm] {}; \node[above left = of healing, rounded corners=3mm, label=center:{Update}, fill=mycolor2!20] (update)[draw,minimum width=2.5cm,minimum height=2.4cm] {}; \node[above =of update, rounded corners=3mm, label=center:{Undeploy}, fill=mycolor2!20] (undeploy) [draw,minimum width=2.5cm,minimum height=2.4cm] {}; \draw[thick, mycolor](onboard)--(deploy); \draw[thick, mycolor](deploy)--(monitor); \draw[thick, mycolor](monitor)--(scale); \draw[thick, mycolor](scale)--(healing); \draw[thick, mycolor](healing)--(update); \draw[thick, mycolor](update)--(undeploy); \draw[thick, mycolor,->](undeploy)--(onboard); \end{tikzpicture} \caption{xxx} \end{figure} \end{document} And here is the output:
I have 3 nodes placed on a circle. These nodes are differently shaped. I want to connect them and want the arrows to look like a circle, because it is a repeating process. I can connect them with bend left, but that is not circle enough for me. I could mess around with in=... and out=..., but that is not a smart solution, because I would have to mess around every time I want such a picture. Here an example code: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} % three differently shaped nodes on a circle \node [rectangle, draw, text width=3cm] (a) at (180:3cm) {Hello World! Hello World!}; \node [rectangle, draw, text width=2cm] (b) at (60:3cm) {Hello World!}; \node [rectangle, draw, text width=2cm] (c) at (300:3cm) {Hello World!}; % connectors between the nodes \draw[->] (a) to [bend left] (b); \draw[->] (b) to [bend left] (c); \draw[->] (c) to [bend left] (a); % the circle I wish the connectors to be placed on \draw[dashed,red] circle [radius=3cm]; \end{tikzpicture} \end{document} I would like the connectors to be placed directly on the red dashed circle. Has anyone a smarter solution than try and error with in and out?
Every time I type a question in Stack Overflow , I occasionally see a "Draft Saved" string under the question area. Does this mean that Stack Overflow has a draft saving feature? If so, how is it used?
Many times it takes me a while to properly compose my question before posting. Sometimes it's just a jumble of ideas and concepts, and is not something I'd want seen immediately. However, there is no way to save a partial question unless you post it. This should work exactly like it does in Gmail. There, once you start composing your question, it's autosaved as a draft. If your browser crashes or you need to come back later to complete it, it will be there for you to finish and post later. Optionally, allow multiple draft questions and a page to edit/delete them. If needed, make them expire after some amount of time.
Suppose G is an finite group. Let N be a normal subgroup of G and A be an arbitraty subgroup. Prove that $$\mid AN\mid=\frac{\mid A\mid\mid N\mid}{\mid A\cap N\mid}$$ My initial approach is that I should somehow invoke one of the isomorphism theorems that involves quotient group and then apply another theorem to grasp about its size. Yet I've no idea how to actually approach it, especially with the given condition that $N$ is normal.
Let $H$, $K$ be subgroups of $G$. Prove that $o(HK) = \frac{o(H)o(K)}{o(H \cap K)}$. I need this theorem to prove something.
i have seen a video where a person finds a legendary in a vending machine as the item for the day, is this possible? Or did he simply mod his game to make it look like he did so?
Very similar to some vending machines in Borderlands 1 (There was a "secret" vending machine in New Haven that would have very high legendary spawn rates), can vending machines in Borderlands 2 spawn Legendary weapons? What affects their spawn rate? Level? Class?
I was reading the code for the Arrays.hashCode provided below, public static int hashCode(Object a[]) { if (a == null) return 0; int result = 1; for (Object element : a) result = 31 * result + (element == null ? 0 : element.hashCode()); return result; } I find it's not as clear as for why 31 is chosen for the hashing. Secondly, the element.hashCode() send me to the Object class that defines it: @HotSpotIntrinsicCandidate public native int hashCode(); How the element.hashCode() is calculaed for the each iteration? Thank you.
Per the Java documentation, the for a String object is computed as: s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1] using int arithmetic, where s[i] is the ith character of the string, n is the length of the string, and ^ indicates exponentiation. Why is 31 used as a multiplier? I understand that the multiplier should be a relatively large prime number. So why not 29, or 37, or even 97?
I've just started with C#. I was reading about operator precedence and there was a part about precedence of unary operator. I've tried to imagine the situation where I can see such stuff. And for example: int a = 5; a = -a++; Example is stupid but still... "Unaries" are right-associative. I expected a result of -6 but it's -5. I understand that "++" returns first then increments. But WHAT it increments if not "a"? Why "a" is not affected? Thanks =]
Have you ever tried this before? static void Main(string[] args) { int x = 10; x = x++; Console.WriteLine(x); } Output: 10. but for static void Main(string[] args) { int x = 10; x++; Console.WriteLine(x); } Output: 11. Could anyone explain why this?
If two or more identical fermions cannot occupy the same quantum state simultaneously, then shouldn't the entire universe have no two identical fermions in the same quantum state at any given time? Intuition tells me this isn't true, so how do you define the boundaries for a quantum system in which the Pauli exclusion applies?
Can two electrons be in the same state, when they belong to two different atoms, which are "far enough" (whatever that means) apart from each other? With "same state" I mean that (as far as specifiable) the states are really identical, except for the position of the electrons. More specifically: I am still not clear of how the separation of particles is taken into account for the Pauli exclusion principle. E.g. in a crystal the electrons seem close enough for the exclusion principle to become meaningful, for particles "a universe apart" from each other, it seems that it is kind of redundant (is there specific maths to that?), but what about everything in between? (This is closely related to the talk Brian Cox gave, see this question: physics.stackexchange.com/q/18527/16689 )
I understand that the integral of a PDF provides tangible value --i.e., the integral of a PDF allows one to see the probability of a value or less than that value, under a particular distribution, occurring. But, what does the value of just the output of the PDF provide? In other words, what does the PDF of the standard normal distribution at x=0.5 mean?
I understand that the probability mass function of a discrete random-variable X is $y=g(x)$. This means $P(X=x_0) = g(x_0)$. Now, a probability density function of of a continuous random variable X is $y=f(x)$. Wikipedia defines this function $y$ to mean In probability theory, a probability density function (pdf), or density of a continuous random variable, is a function that describes the relative likelihood for this random variable to take on a given value. I am confused about the meaning of 'relative likelihood' because it certainly does not mean probability! The probability $P(X<x_0)$ is given by some integral of the pdf. So what does $f(x_0)$ indicate? It gives a real number, but isn't the relative likelihood of a specific value for a CRV always zero?
during my work with Latex I encountered a problem with my tables. As you can see in the following MWE, theses tables sometimes have rows witch contain cells with multiple lines. Those rows have less distance to the following row than a row with only one-line cells. I have to use the tabu package because of its flexible columnwidth handling.R \documentclass[10pt]{scrbook} \usepackage{tabu} \usepackage{booktabs} \begin{document} \begin{table}[H] \begin{tabu} to \linewidth{lX[10000]} \toprule \textbf{Name} & \textbf{Description} \\ \toprule Row one & Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\\ Row two & Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.\\ Row three & Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\\ Last row & One last row.\\ \bottomrule \end{tabu} \caption{MWE} \end{table} \end{document} Compiled it looks like this: I tried several solutions, I found during my search in this community and the whole www containing one or a combination of these commands: \linespread{0.5} with \rmfamily or \selectfont renewcommand{\arraystretch}{1.2} \setlength{\extrarowheight}{2.5mm} >{\setlength{\baselineskip}{0.75\baselineskip}} between l and X in the \linewidth{lX[10000]} command Now I hope anybody can help me to solve this. Best regards, Gwedhwen
Consider the following table example, the text in the second row is wrapped. \documentclass[a4paper]{article} \usepackage[english]{babel} \usepackage[utf8x]{inputenc} \usepackage{tabu} \usepackage{booktabs} \usepackage{array} \setlength{\extrarowheight}{5pt} \begin{document} \begin{tabu} to \linewidth {X[.5,c] X[1,l] X[1,l] X[2,l]} \toprule \rowfont{\bfseries} Row & Head 1 & Head 2 & Head 3 \\\hline 1. & short text & ? & ? \\\hline 2. & long long long long text & ? & ? \\\hline 3. & short text & ? & ? \\\hline 4. & short text & ? & ? \\ \bottomrule \end{tabu} \end{document} It renders like: Why is there so little space between the text in the second row and the rule below it? How can I fix it? What comes to my mind is to use \\[1ex] instead of \\, is there a better solution?
I don't understand how the integral $$\int \frac{\sqrt{9-x^2}}{x}=\sqrt{9-x^2}-3 \ln(\sqrt{9-x^2}+3)+3 \log(x)+c$$ I keep getting $-3/x +c$ as the answer.
I need to solve $\int \frac{\sqrt{25-y^2}}{y}dy$. I originally thought IBP, but that led to a very large and confusing algebra problem. Then I started to look at the $\sqrt{25-y^2}$ and started to consider doing a $u$-substituion, and letting $u=\sin\theta$ and $du=\cos\theta d\theta$. Once I started playing a bit, the intuition was lost. Any and all help is appreciated.
In C++, I can use the following code to implement the functions. char result=0; for(char c:s) result^=c; However, when I try to implement this in Ruby, it fails. result=0 s.chars.each do |c| result^=c end How should I XOR each char in a string in Ruby? Thanks very much!
I have a string, lets say "123|ABC|test|12345|FF" and I want to xor the ascii value of each character and print the result in hex. What is the simplest way?
Well, I asked a question about several weeks ago. I accepted the answer, but I didn't upvote it, not because the accepted answer is not good, but I have already accepted it. I'm not stingy to give him/her an upvote,but I am just curious whether it is an unspoken rule that I should give him/her an upvote if I accepted his/her answer? Ps. I'm not angry with anybody. :-)
Is there ever a case where you would want to accept an answer, but not upvote it? I can't think of a single situation where this would be the case.. So would it not make sense to have the "Accept" button upvote the answer too?
def blue(): global blue_old global blue_new while blue_old > blue_new: blue_old = blue_old - 0.01 print blue_old os.system("echo 21=" + str(blue_old) + " > /dev/pi-blaster") time.sleep(0.01) while blue_old < blue_new: blue_old = blue_old + 0.01 os.system("echo 21=" + str(blue_old) + " > /dev/pi-blaster") time.sleep(0.01) print "blue done: " + str(blue_old) Hi, using threading method in Python I have this code to control intensity of RGB LED strip via RPi. Basically when new value is higher than current, it adds value 0.01 in loop until new and old values are equal, to have a nice brightening effect. If new value is lower than current it does exact opposite, decreasing value in 0.01 steps, but if I want to complete shut it down(value = 0) I get this output: 0.1 0.09 0.08 0.07 0.06 0.05 0.04 0.03 0.02 0.01 -7.52869988574e-16 Why am I getting this strange negative number instead of 0? You can run this if you want to test: import os import time import threading blue_old = float(1) blue_new = float(0) def blue(): global blue_old global blue_new while blue_old > blue_new: blue_old = blue_old - 0.01 print blue_old time.sleep(0.01) while blue_old < blue_new: blue_old = blue_old + 0.01 print blue_old time.sleep(0.01) print "blue done: " + str(blue_old) blue = threading.Thread(target=blue).start() Thanks.
Consider the following code: 0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 Why do these inaccuracies happen?
So I was a cook and now I can be and have to reshape how I cook I became highly allergic to onions about 4 months ago and I'm having a hard time replacing them in so recipes I have tryed garlic but its now the same what else should I try
I am an allium lover with a strong allergy to all alliums. It is technically a sensitivity, as it isn't an instant reaction, but spending an hour in the bathroom because of one stray piece of red onion warrants a scarier word then "sensitivity". For those not familiar with plant taxonomy, alliums are the plant family that holds garlic, onions, chives, and leeks. My allergy is progressively getting stronger and I can no longer lie to myself. I need a good substitute for that fantastic allium taste. Right now I can still eat garlic in reasonable amounts (thank god), but red onions are out, and everything else from white onions to leeks is somewhere in between. Any and all preparations of allium trigger the allergy, so no onion powder. I am desperately looking for a non-allium onion substitute. My hope and dream is something that tastes like onion but isn't an allium. I would accept any strongly flavoured class of plants to switch addictions to.
I have a large file of plain text on Mac OSX that contains many http(s) URLs. For example: blah blah https://www.stackexchange.com blah https://www.stackoverflow.com blah blah https://www.google.com blah What's the easiest way to view that text in a way that I can click on each link and open it in a web browser? I would prefer a solution that doesn't require uploading the text file to the Internet.
I'm copying a slab of plain text that contains URLs into an RTF file in TextEdit, which I am hoping to automatically, (as there are a lot of them in the text), 'linkify' into rich text hyperlinks - make them clickable, and underlined in blue or as per the default appearance. In WordPad on Windows, if you paste plain text, WordPad will automatically linkify any links, but TextEdit, Word 2011, and Pages on the Mac all will not. I've also tried to export the text to PDF in TextEdit, Word 11 and Pages and fiddled around with Tools in Acrobat Pro itself - all to no avail. An AppleScript would be fun, but (even if hooked into FastScripts), still not as quick or elegant as Windows' WordPad's instant and automatic linkification of URLs upon insertion into a document. Is there something this elegant in OS X?
Most of the Quidditch games we see in the Harry Potter movies end with someone catching the Snitch (and winning). How often do Quidditch games end without the Snitch being caught? (I don't expect an exact percentage - but does the Snitch matter as often as it seems from the movies? or is it less frequent?)
The game can only end when the Snitch has been caught, or by mutual agreement of the two teams' Captains; the latter is very rare, however, as one team would have to lose. (source: HP Wikia on Golden Snitch) Is there an example from canon of this resolution to the game ever happening?
Recently Pokemon GO updated and shows all users the language agree with the system locale. My devices (iPhone SE and iPad mini) were set to use Chinese (Traditional) and so now it is not displaying English at all. However, although I came from China, I live in Australia now and the kids are still learning Chinese from us whilst they can already read English pretty well. So I wonder if I can make it display English again without having to change my system locale?
My game is currently in French, probably because my phone is in French. I would like to change the language of Pokémon GO because I always played Pokémon in English and, as a result, I don't know the names of the Pokémon in French. Is it possible for me to change the language of Pokemon GO to English? How can I achieve this?
I recently seen a message called serial voting reversed. In my "reputation" in my user profile on Mi Yodeia, there was 62 downvotes canceled and 5 of my downvote canceled. There was also 8 upvotes on answer reversed and one upvote on question. My question is if there is someone who likes downvoting my answers in a serial way, the statistical correction of stack exchange is retroactive only or is there a preventive measure against recidivism. I searched and did not find an answer. Please help me to know. I have a high presumption, based on the fact that the last downvote was on an answer in which the same user wrote a comment on an other answer to the same question at the same time. An additional reason is that the difficulty to lose a compulsory activity is great. In the past it was very hard for me to be taken seriously by moderators. I feel that somewhat is not clear for me how can I require to get advocacy. I feel that for a lengt time moderators refuted to help me. Is there something non appropriate in the moderation system?
I just noticed that I lost a bunch of points from my reputation score, and I used the "reputation" tab on my user profile page to try and track down the cause. During my investigation, I noticed there was an unusual event of type "reversal". In the normal place of a question title, it says "voting corrected". What does this mean, and what caused it? Did I do something wrong? Why did I lose all of that reputation? Is the system punishing me for leaving too many good answers? Is there any way to earn it back?
I have the following model : Y = B1X + B2X + e. I want to test if B1 = B2, and also if B1 = B2 = 0. Any suggestions to which test that would be appropiate? Thanks in advance.
What exactly is contrast matrix (a term, pertaining to an analysis with categorical predictors) and how exactly is contrast matrix specified? I.e. what are columns, what are rows, what are the constraints on that matrix and what does number in column j and row i mean? I tried to look into the docs and web but it seems that everyone uses it yet there's no defition anywhere. I could backward-engineer the available pre-defined contrasts, but I think the definition should be available without that. > contr.treatment(4) 2 3 4 1 0 0 0 2 1 0 0 3 0 1 0 4 0 0 1 > contr.sum(4) [,1] [,2] [,3] 1 1 0 0 2 0 1 0 3 0 0 1 4 -1 -1 -1 > contr.helmert(4) [,1] [,2] [,3] 1 -1 -1 -1 2 1 -1 -1 3 0 2 -1 4 0 0 3 > contr.SAS(4) 1 2 3 1 1 0 0 2 0 1 0 3 0 0 1 4 0 0 0
looking for a screen recorder for 16.04 that can record my screen be able to pause and resume record ingame audio and audio from other things like discord for when im playing with my friends does anyone have any ideas.
I make gaming videos and recently installed Ubuntu and I haven't been able to find a good screen recorder for gaming. Are there any recommendations (preferably free ones) that can record in HD, use multiple audio sources (i.e. Headset and computer sound), and is in the Ubuntu Software Center? If it's not in the software center I still might get it, just preferably in the software center. I've already tried Kazam Screencaster and RecordMyDesktop, but they didn't work out for me. Thanks guys!
I am trying to setup a CentOS 7 server with Squid as a proxy server. The proxy server is strictly private and doesn't need to be available to anyone other than myself and other 2 servers, therefore I have decided to lock down all ports to the 3 IP addresses. I would also point out I have VNC access to the server in case my IP changes. Here are the IP table rules I am using to lock down the server (where 1.1.1.1 is just an example)... #!/bin/bash IPTABLES=/sbin/iptables MYIP=1.1.1.1 #start and flush $IPTABLES -F $IPTABLES -t nat -F $IPTABLES -X $IPTABLES -P FORWARD DROP $IPTABLES -P INPUT DROP $IPTABLES -P OUTPUT ACCEPT #HTTP traffic $IPTABLES -A INPUT -p tcp -s $MYIP --dport 80 -j ACCEPT #SSH traffic $IPTABLES -A INPUT -p tcp -s $MYIP --dport 22 -j ACCEPT #FTP traffic $IPTABLES -A INPUT -p tcp -s $MYIP --dport 21 -j ACCEPT $IPTABLES -A INPUT -p tcp -s $MYIP --dport 20000:20050 -j ACCEPT #SQUID traffic $IPTABLES -A INPUT -p tcp -s $MYIP --dport 3128 -j ACCEPT #loopback $IPTABLES -A INPUT -i lo -p all -j ACCEPT The problem is when I execute these rules, Squid stops working. It tries connecting but eventually returns a Squid error saying "Connection timeout". Even though all OUTPUT traffic is allowed, yum and wget also stop working so I am guessing it's failing to allow outbound traffic? Can someone help me where I am going wrong please?
here's my problem: # iptables -P INPUT DROP # host -t mx gmail.com ;; connection timed out; no servers could be reached # iptables -P INPUT ACCEPT # host -t mx gmail.com gmail.com mail is handled by 20 alt2.gmail-smtp-in.l.google.com. gmail.com mail is handled by 5 gmail-smtp-in.l.google.com. gmail.com mail is handled by 40 alt4.gmail-smtp-in.l.google.com. gmail.com mail is handled by 10 alt1.gmail-smtp-in.l.google.com. gmail.com mail is handled by 30 alt3.gmail-smtp-in.l.google.com. after setting iptables to drop all input packets unless specified otherwise, I can't resolve hosts and therefore postfix fails to send mails. I think it is crucial to set firewall up - what is the firewall setting that I missed? here's my current iptables: # iptables -L INPUT -n -v Chain INPUT (policy ACCEPT 120 packets, 17552 bytes) pkts bytes target prot opt in out source destination 2669K 160M fail2ban-ssh-ddos tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 22 2669K 160M fail2ban-ssh tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 22 122 19135 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 252 27262 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:143 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:587 46 3191 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:21 264 2459K ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
Fiz DualBoot Recentemente Com xiuindows 10 e Ubuntu 20.04 Mais Deixei Apenas 50gb Para o Ubuntu E Queria Aumentar Para 100gb English: I did Dual Boot recently with windows 10 and Ubuntu 20.04 but I left only 50gb for Ubuntu and now want to increase it to 100gb
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 the habbit to select a whole word by standing at the first character of the word and doing CTRL + SHIFT + right arrow key. But when the word has capitals then it stops at each capital. Can I disable this behaviour?
Is there a way that I can configure Visual Studio 2008 to understand CamelCase? Specifically, I'd like to be able to get Ctrl + right or left cursor to take me to a subsection of a variable or type name. i.e., if my cursor was at the start of this line: LongNamedExampleClass longNamed = new LongNamedExampleClass(); and I hit Ctrl + right, I'd like to jump to "Named" in the class name, rather than the start of the variable name. If I hit it again, I'd like to go to "Example". I hope that makes sense. I used this navigational feature in Eclipse quite a lot, and find it difficult to unlearn something so ingrained.
I have several expenses and incomes in the application I'm currently coding. What can I call an entity like that, that is either positive (income) or (negative)? It should be related to money, if possible. Edit: Not sure if I expressed myself clearly. I'm looking for a word like "money-transfer", "stream" or "money that goes over the table" (no matter which direction). A word that fits in a financial context.
I’m looking for a generic word that means “debit or credit”. Say I have a transaction, and I don’t know whether it’s a debit on the account or a credit on the account, and I want to ask about it, is there a word I can use? For example, if I were asking whether a book were green or blue, I would ask, “What’s its color?” If I ask whether a transaction was a debit or a credit, can I fill in the blank, “What’s its _?” (Background: I’m looking to name a variable while programming, and the best I can come up with is type, which is not very descriptive).
Also, does that mean that dice gained from either of these features never become d8's?
Assume two 1st level Rogues, Alice and Beatrice. Alice gained 3 levels of Rogue and on her 4th level of Rogue, instead of an ability score increase she picked up the Martial Adept feat. She later gained 3 levels in Fighter, and chose the Battle Master archetype. Beatrice gained 3 levels of Fighter, and chose the Battle Master archetype. She then gained 4 levels of Rogue, and instead of an ability score increase she picked up the Martial Adept feat. Alice and Beatrice each now total four Rogue levels and three Fighter levels, obtained via different paths. Is the superiority dice gained from the Martial Adept the same dice for both Alice and Beatrice? (The text above was posted as an example in that was closed as too broad. After talking to a moderator, it was decided the best thing would be to post the example as a separate question.) The second bullet point of the Martial Adept feat says (PHB, p. 168): If you already have superiority dice, you gain one more; otherwise, you have one superiority die, which is a d6. [...] The already have implies that you need to have superiority dice when you acquire the feat, otherwise it is a d6. Beatrice is safe. RAW, she already has superiority dice when she gets the feat. Is Alice stuck with a d6 superiority die for the rest of her career?
I can't understand why this code gets unresolved externals error. stack.cpp #include "stack.h" #include<iostream> using namespace std; template<int i> st<i>& st<i>::operator=(const st<i> &other){ if(this!=&other){ delete[]anarray; anarray=new int[i]; for(int i=0;i<10;i++) anarray[i]=other.anarray[i];} return *this; } template<int i> void st<i>::push(int i2, int val){anarray[i2]=val;} stack.h #pragma once template<int i> class st{ public: int *anarray; st(){anarray=new int[i];} ~st(){delete[]anarray;}; st<i>& operator=(const st<i> &other); //int& operator[](int i); void push(int i, int val); }; main.cpp #include<iostream> #include"stek.h" using namespace std; void main(){ cout<<"----"<<endl; st <10> z1; st<10> z2; for(int i=0;i<6;i++) z1.anarray[i]=2*i; z2=z1; for(int i=0;i<6;i++) cout<<z2.anarray[i]<<endl; cout<<"----"<<endl; system("pause"); } I know how to implement this so it works, but my question is why this particular example doesn't work.
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.)
My attempt: First I converted this expression to sum notation: $\sin(1^\circ) + \sin(3^\circ) + \sin(5^\circ) + ... + \sin(175^\circ) + \sin(177^\circ) + \sin(179^\circ)$ = $\sum_{n=1}^{90}\sin(2n-1)^\circ$ Next, I attempted to use Euler's formula for the sum, since I needed this huge expression to be simplified in exponential form: $\sum_{n=1}^{90}\sin(2n-1)^\circ$ = $\operatorname{Im}(\sum_{n=1}^{90}cis(2n-1)^\circ)$ $\operatorname{Im}(\sum_{n=1}^{90}cis(2n-1)^\circ)$ = $\operatorname{Im}(\sum_{n=1}^{90}e^{i(2n-1)^\circ})$ $\operatorname{Im}(\sum_{n=1}^{90}e^{i(2n-1)^\circ})$ = $\operatorname{Im}(e^{i} + e^{3i} + e^{5i} + ... + e^{175i} + e^{177i} + e^{179i})$ Next, I used the sum of the finite geometric series formula on this expression: $\operatorname{Im}(e^{i} + e^{3i} + e^{5i} + ... + e^{175i} + e^{177i} + e^{179i})$ = $\operatorname{Im}(\dfrac{e^i(1-e^{180i})}{1-e^{2i}})$ $\operatorname{Im}(\dfrac{e^i(1-e^{180i})}{1-e^{2i}})$ = $\operatorname{Im}(\dfrac{2e^i}{1-e^{2i}})$ Now I'm stuck in here;
How can we sum up $\sin$ and $\cos$ series when the angles are in arithmetic progression? For example here is the sum of $\cos$ series: $$\sum_{k=0}^{n-1}\cos (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \cos \biggl( \frac{ 2 a + (n-1)\cdot d}{2}\biggr)$$ There is a slight difference in case of $\sin$, which is: $$\sum_{k=0}^{n-1}\sin (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \sin\biggl( \frac{2 a + (n-1)\cdot d}{2}\biggr)$$ How do we prove the above two identities?
I have a relational database Access 2010 which I would like to run with an Ubuntu programme. Is this possible?
I have a .accdb file created with Microsoft Office 2010 and I want to know if it is possible to open it with some native Ubuntu application like LibreOffice or OpenOffice, I know LibreOffice has LibreOffice Base but I can't figure out how to open or if it's even possible to open a .accdb file. Is there any way I can open a .accdb file without Wine or VirtualBox?
I am currently making a quiz program but if i close the dialog box when it is asking for an input, a NullPointerException occurs. How do i make it do something else, like display a text message and prompt for a valid entry. String qn_1_ans = JOptionPane.showInputDialog( null, "What is the answer for Question 1? \nPink \nBlue \nBlack \nRed", JOptionPane.OK_OPTION ); if (qn_1_ans.equals(qn_1_right_ans)) { JOptionPane.showMessageDialog(null, "Thats correct"); Score = Score + 1; } else { JOptionPane.showMessageDialog(null, "Your answer is wrong. The correct answer is " + qn_1_right_ans); }
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
I am unable to upgrade Ubuntu from 16.04 to 16.10. Error message: Failed to lock /var/cache/apt/archives/lock There are numerous answers on how to fix it. I tried all. But no success. Can anybody help? Existing posts on the same topic: Error Message: Calculating the changes Calculating the changes Do you want to start the upgrade? 10 installed packages are no longer supported by Canonical. You can still get support from the community. 16 packages are going to be removed. 293 new packages are going to be installed. 1842 packages are going to be upgraded. Installing the upgrade can take several hours. Once the download has finished, the process cannot be canceled. Continue [yN] Details [d]y Fetching Fetched 0 B in 0s (0 B/s) Upgrading Could not download the upgrades The upgrade has aborted. Please check your Internet connection or installation media and try again. Failed to lock /var/cache/apt/archives/lock Traceback (most recent call last): File "/tmp/ubuntu-release-upgrader-kfjtjdko/yakkety", line 8, in <module> File "/tmp/ubuntu-release-upgrader-kfjtjdko/DistUpgrade/DistUpgradeMain.py", line 242, in main File "/tmp/ubuntu-release-upgrader-kfjtjdko/DistUpgrade/DistUpgradeController.py", line 1880, in run File "/tmp/ubuntu-release-upgrader-kfjtjdko/DistUpgrade/DistUpgradeController.py", line 1845, in fullUpgrade File "/tmp/ubuntu-release-upgrader-kfjtjdko/DistUpgrade/DistUpgradeController.py", line 1263, in doDistUpgrade File "/tmp/ubuntu-release-upgrader-kfjtjdko/DistUpgrade/DistUpgradeController.py", line 1385, in abort File "/tmp/ubuntu-release-upgrader-kfjtjdko/DistUpgrade/sourceslist.py", line 366, in restore_backup File "/usr/lib/python3.5/shutil.py", line 236, in copy copymode(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.5/shutil.py", line 138, in copymode chmod_func(dst, stat.S_IMODE(st.st_mode)) PermissionError: [Errno 1] Operation not permitted: '/etc/apt/sources.list' Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 109, in apport_excepthook pr.add_proc_info(extraenv=['PYTHONPATH', 'PYTHONHOME']) File "/usr/lib/python3/dist-packages/apport/report.py", line 544, in add_proc_info self['ExecutableTimestamp'] = str(int(os.stat(self['ExecutablePath']).st_mtime)) PermissionError: [Errno 13] Permission denied: '/tmp/ubuntu-release-upgrader-kfjtjdko/yakkety' Original exception was: Traceback (most recent call last): File "/tmp/ubuntu-release-upgrader-kfjtjdko/yakkety", line 8, in <module> File "/tmp/ubuntu-release-upgrader-kfjtjdko/DistUpgrade/DistUpgradeMain.py", line 242, in main File "/tmp/ubuntu-release-upgrader-kfjtjdko/DistUpgrade/DistUpgradeController.py", line 1880, in run File "/tmp/ubuntu-release-upgrader-kfjtjdko/DistUpgrade/DistUpgradeController.py", line 1845, in fullUpgrade File "/tmp/ubuntu-release-upgrader-kfjtjdko/DistUpgrade/DistUpgradeController.py", line 1263, in doDistUpgrade File "/tmp/ubuntu-release-upgrader-kfjtjdko/DistUpgrade/DistUpgradeController.py", line 1385, in abort File "/tmp/ubuntu-release-upgrader-kfjtjdko/DistUpgrade/sourceslist.py", line 366, in restore_backup File "/usr/lib/python3.5/shutil.py", line 236, in copy copymode(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.5/shutil.py", line 138, in copymode chmod_func(dst, stat.S_IMODE(st.st_mode)) PermissionError: [Errno 1] Operation not permitted: '/etc/apt/sources.list'
I get this error when trying to use apt-get: E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it? How can I fix this?
Should I take the effort to correct spelling mistakes in titles? I get a +2 from correcting, but this is a never-ending-task. Is this useful or should I spend my energy in something else?
Being a fairly new user something I don't seem to be able to locate is information on whether small edits to the title are considered as trivial edits. I see the usual recommendation when suggesting an edit is: Avoid trivial, tiny one-letter edits unless absolutely necessary. I can see the logic in that for most cases, but for example I just read a question with a title containing "Andriod" which would be trivial in one way but also affect the ability of users to locate the question using both the site and external search engines. Would it be frowned upon to suggest an edit for those cases?
{"5eaa9ce8": { "Id": "1958208", "priority": 0 }, "5eaa9bs8": { "Id": "1958208", "priority": 2 }, "6eaa9ce8": { "Id": "1958208", "priority": 1 } } Need to sort this Map based on the priority of the key. and needed output is { "5eaa9bs8": { "Id": "1958208", "priority": 2 }, "6eaa9ce8": { "Id": "1958208", "priority": 1 }, "5eaa9ce8": { "Id": "1958208", "priority": 0 } }
I am relatively new to Java, and often find that I need to sort a Map<Key, Value> on the values. Since the values are not unique, I find myself converting the keySet into an array, and sorting that array through array sort with a custom comparator that sorts on the value associated with the key. Is there an easier way?
I'm creating my first game and want to improve upon the graphic design aspects of my game. By graphic design I mean layout, font, spacing, etc.. Is there a good resource for learning graphic design for a programmer? I've taken human-computer interaction classes, but that has more to do with task and making task as easy as possible for the user. Not necessarily about layout/spacing. I mention layout/spacing twice because that's the biggest problem I'm having. I can clearly tell that things need to be spaced properly to be more visually pleasing. Thanks to all that reply
I want to learn how to create custom graphics, not use freely available resources. But I have been looking around for articles or tutorials on how to start with 2D game design in general, and I can't seem to find a good starting point — books or otherwise. I mostly come across resources for those that have had formal studies in graphic design (advanced stuff), but I won't have the luxury of formal studies for a good while (if at all). On the other hand, I find resources for learning the programming side of things, but not on how to create the graphics you'll manipulate. Are there any good resources for learning game oriented graphic design? Specifically 2D, which is the one I'm most interested in, but 3D is also welcome.
I am new to bikes and was wondering if there is a difference between inner tubes for a 27 x 1 1/4 bike and a 27 x 1 1/8 bike. My bike has 27 x 1 1/8 tires but I wanted to use 27 x 1 1/4 inner tubes since they are easier to find.
I have 27 x 1 1/4 inch tires on my bike and need to buy new tubes. Can I use 700c or just 27 inch?
I'm working on a to-do list app in Java as a learning exercise in databases. I'd like to write the app agnostic to a theoretical user's setup and not assume they have anything like MySQL installed. How can a Java application create and manage a local database, in this case to hold things like tasks, deadlines, etc? Is something like SQLite the only way to go for local?
I intend to develop a small (Java) application for managing my finances. I believe I need to use an embedded database, but I have no experience regarding this issue. I tried to look at , but I can't decide which one would be more suitable for me. , , and seem to be good candidates, but I still don't see how they compare to each other. I appreciate your help comparing them and helping me decide which one to use. I intend to use Hibernate for my application (unless you would recommend using DBMS-provided API), but I also want to have the ability to edit the database easily using a SQL browsing tool (modifying schema and changing data). Thank you.
I just signed up with Careers 2.0, and I have a Public profile. Is there any way I can create a badge saying View my Profile on Careers?, like the one which LinkedIn offers. Stack Overflow offers a Flair, which has the reputation and badges along with the name. I am just wondering whether a similar option is available in Careers? I have gone through the FAQ of the website, but could not find anything related.
Are there any image badges like those on for Careers.SO? I would like to add a nice image to my website profile.
I thought these 2 sentences, "All we do is hide away" and "All we do is to hide away", meant the same. However, one day, a native English speaker told me there's a subtle difference in meaning between those two sentences. I asked for an explanation but he said it was too subtle to explain. Can anyone tell me what's the difference between those two sentences?
I was speaking to an English learner and said, “All you have to do is read a lot.” And they thought that sentence wasn’t grammatically correct because I dropped the word to between is and read. They thought it should be “All you have to do is to read a lot.” That sounds weird to me. How do I explain to them the reason you drop the to? Or am I incorrect and it really should have a to?
Is there a place or an option to see my own suggested edits with their review status (accepted or declined) in form of a list or a graph? I'd like it to be more like a list of my flags where there is a visible thing that says [active] or the reason why it was declined. It'd make it much easier to see if and where I have gone wrong.
Issue 1: I find it a bit irritating that when I click the Improve button and further edit it, even if I mark it as helpful, only Community takes the credit for the approval. I know the topic itself will contain the link to the suggested edit, but my activity history only says that I made an edit, and not approved a suggested edit. The same holds true for marking one as unhelpful. The activity history should say I rejected an edit, and then made an additional edit. I know it's not often, but sometimes I do try to go back to a suggested edit I've rejected, but when I improved and rejected, it's not traceable for me as it doesn't show in my history or in the question's revision history. So if I don't remember what user suggested it, it's lost to me. This issue also plagues the which are awarded for approving and rejecting suggested edits, which essentially you have done, you're just not receiving credit for it. I suggest that when I mark an edit as helpful or not helpful, both me and Community be listed as the approvers or rejecters, unless another user is already listed in the appropriate place. Update: Here is of the confusion this causes. Update 2: Also, when improving a post and marking it as "not helpful", it would be nice to be able to along with it. Issue 2: Expanding off the idea that users need more notice for suggested edits that get rejected, the activity history page is much too useless when it comes to listing the suggested edits a user has made. Literally all it does is list them. A user still has to click through to each one in order to find out if it was approved or rejected, or even if it's still pending. Take, for example, this screen shot of the suggested edit history: Is it really necessary to say I suggested a suggested edit? Really? Of course I suggested it, it's a suggested edit. This isn't ! A good way to fix this would be to change the second "suggested" word into one of: pending, approved, or rejected. This would be a quick way to tell which edits have been approved or rejected and which ones are still pending. Users would be able to target out rejected edits and review them for the reasons. Something like this:
i want to get files from my windows vista pc directly to my phone. i dont want remote control like i get from teamviewer. there are people using the computer while i am using my cell phone and i need to acces certain files without bothering them. also i want to gain aces to the entire hdd without any permision. something similar to wifi file explorer but from pc to phone. something like airstream (for some reason it doesnt work on my pc).it doesnt have to be free dont mind to spend a few dollars. and i DONT want a external server to contain all my files like mega or dropbox. Also it would be good to have an opsion to do it offline, or only being conected to the router since i need to moove farely big files too. any ideas??
I have a shared network drive full of files I want to access from my phone over wifi. Is there a easy way to mount it on my phone? I have a rooted Motorola Milestone.
I've been looking for a solution to my problem for a few days without finding it, so I'm posting my question here hoping I'm in the right place. I had Blender 2.68 working very well, and I wanted to switch to version 2.72. Because I have Windows Vista 32-bit, I downloaded the 32-bit .exe file, which installed without problems, but when I try to open Blender, a small black window opens and quickly closes and then nothing. I don't know what might be causing this, your help would be welcome. Thanks in advance! Cordially, Fred
I installed blender on a windows 7 64 bit system. I opened it one time then went to the tutorials. in the meantime I had a power failure and when I tried to start blender again I get a dos window that closes itself then nothing. I reinstalled Blender and get the same thing. I am going to try to uninstall then reinstall but in the mean time, any other suggestions are welcome.
I encountered today the following question: Because it should be asked in Math.SE site. I voted to close it. You can select it should be posted into one of five other forums, but is not possible to select. Why are not all Stack Exchange sites available?
Wouldn't it be a good idea to be able to vote for questions to be moved to any Stack Exchange site? For example, I just voted as off topic, but that was all I could do. I wish I could've voted it be moved to . It's OK to have the predefined list of sites that is now when voting to move, but it would be nice to have a more link, where we could pick any Stack Exchange site. Here's a quick mockup of how I see this implemented: When the more link is clicked, a list of all the Stack Exchange sites should appear.
if A , B are subsets of {1,2,3,4,5} How many ordered pairs (A,B) have: |A∩B|=1
How many ordered pairs $(A,B)$ they are if $A$ and $B$ are subsets of $\{ 1,2,3,4,5 \}$ such that $A \cap B = \{1\}$? If 1 is in both sets : Size of $A$ is $>1$ and size of $B$ is $>1$. $\Rightarrow$ Size of $A \cup B =4$ $$5 \cdot (3 \cdot 3 \cdot 3 \cdot 3) = 405$$ is not correct. What am I missing here?
I know there are lenses like f/0.7 However as a beginner I'm wondering what's the barrier of making ultra fast lenses like f/0.01 ? Also if lens manufacturers willing to make wide aperture lenses, why it become more expensive? What factor makes it more costly?
has a maximum f-stop value of 2.8. I've held it in my hands, it's a big lens. Meanwhile, can go up to f/1.2, despite being 25% cheaper and a LOT smaller. So at least with these two lens, there is not a very direct correlation between price and f-stop ability. What is it that determines a given lens' f-stop range? Why can't that 105mm go sub-2?
I am using XAMPP server. I wanted to know does taking backup of entire database using mysqldump utility locks all table during the process. Means whether INSERT/UPDATE/DELETE queries get rejected during dump process or not. Or is it safe to take dump in live environment.
I want to copy a live production database into my local development database. Is there a way to do this without locking the production database? I'm currently using: mysqldump -u root --password=xxx -h xxx my_db1 | mysql -u root --password=xxx -h localhost my_db1 But it's locking each table as it runs.
In informal spoken English, one encounters sentences like this: ?That's the man who I wasn't sure where he had gone. This construction doesn't strike me as quite right because it sentence includes not only the relative pronoun who but also the relativized pronoun he. In more typical relative phrases, the relativized element is deleted: _That's the man who was lost, not *That's the man who he was lost. In who I wasn't sure where he had gone, though, the relativized pronoun is in a nested relative clause introduced by where, which inhibits the deletion: *That's the man who I wasn't sure where had gone doesn't work. If the nested relative clause is introduced by that, one can't delete the relativized element and preserve that: That's the man who I thought was lost or ?That's the man who I thought (that) he was lost, but not *That's the man who I thought that was lost. But where, like most subordinators but unlike that, cannot be omitted when it introduces a relative phrase. There's often no good alternative to these constructions, though. My ?who I wasn't sure where he had gone example might be recast as That's the man whose whereabouts I wasn't sure of, but this means something subtly different and requires turning the simple verb gone into the clunkier whereabouts. (Many alternatives to these constructions require changing the secondary relative clauses into verb nominalizations, similarly, and any good style manual warns against overuse of verb nominalizations.) So, two questions: (1) Are constructions that repeat relativized elements in relative phrases ever acceptable in formal writing? (2) If not, am I missing a good standard method of recasting these constructions as something unambiguously grammatical?
"Give him a box that everyone knows what it contains." Is this correct English? It sounds wrong to me.
Recently, after booting the window appears "System Problem Detected" - and I choose "Report problem". So how can I find out what actually is the problem? Otherwise everything works as expected. Xubuntu 18.04 on HP15 laptop.
This started to happen immediately after I had rebooted the first time after doing a system upgrade. It first starts with a dialogue that says "System program problem detected". Then when I try to hit 'report problem' not much happens. I am led through a dialogue that always ends up the problem cannot be solved. I am aware this is not a lot of information, however I'm not sure which information I need to publish and how should I obtain it to debug this problem. Here's a screenshot!
I have a script that opens a csv file, applies a substitution and then writes out to a new file then deletes the old one. with open('file-presub.csv', 'r') as reader, open('file-postsub.csv','w') as writer: for row in reader: row = re.sub('(\+*,[^,]*,[^,]*,[^,]*,\ 0)', ' (Core)\\g<1>', row) writer.write(row) os.remove("file-presub.csv") Is there any way I can make it so I just edit the file-presub.csv and write it out with the same filename instead of making a second file and deleting the original? I'd like to avoid importing OS just for this one line. Of course if it's not possible I'm able to import OS, just asking if it's possible at all.
I'm using Python, and would like to insert a string into a text file without deleting or copying the file. How can I do that?
I have a muslim sounding name. But I was born to a christian family and I consider myself an atheist. I have been trying to get fellowship in Canada. Will mentioning my religion in the CV help?
I recently moved to a Nordic country in an academic position. For my first grant application, I collaborated with other researchers at the university. As I was submitting the proposal along with the CVs, I noticed that two of the researchers had mentioned their religion. I have never seen this in academia, at least in South-east Asia where I spent majority of my work life. Here are other details that I think are relevant: Our research domain is engineering, not humanities or social sciences. Both researchers are Muslim. The funding agency is a private one that favors industrial collaborations. My questions: Is it appropriate to mention one's religion in an academic CV? Does mentioning one's religion help in grant proposals or academic positions? I think in a fair world it shouldn't. Do western countries, especially European, favor candidates who are Muslim?
I have to find the number of solution of this congruential equation $x^k\equiv 1 (mod\space p)$. Surely I know that $x^{p-1}\equiv 1 (mod\space p)$ so, $x^d \equiv 1$ where $d$ is the MCD between $(p-1,k)$. Now I have to count how many divisor of $d$ there are, but I don't know how.
I wish to find the number of solutions to the congruence $x^n \equiv 1 \mod p$ where $n$ is any natural number, $p$ prime. I tried using primitive roots and Fermat but I don't know where to go from here.
I have no idea how to prove that $\mathbb{Z}[i]^{\times}$ is finite (unit group of $\mathbb{Z}[i]$). I don't know any theorem and never studied properties of unit groups, so I don't even know where to start here. This fact fact appeared to me as an example while I was studying modules. Any help or hint would be appreciated. Thanks in advance.
How can we show that $\pm 1, \pm i$ are the only units in the ring of Gaussian integers, $\mathbb Z[i]$? Thank you.
This is the full question: Consider an integer $n\ge 1$ and the integers $i$,$1\le i \le n$. For each $k=0,1,2,\cdots$, find the number of $i$'s that are divisble by $2^k$ but not by $2^{k+1}$.Thus prove $$ \sum_{j=1}^{\infty} \left[ \frac{n}{2^j}+\frac{1}{2} \right] = n$$ and hence that we get the correct value for the sum $\dfrac{n}{2}+\dfrac{n}{4}+\dfrac{n}{8}+\cdots$ if we replace each term by its nearest integer, using the larger one if two exist. Note: $[x]$ denotes the greatest integer function/floor function of $x$. This is what i did: The number of integers less that $n$ divisible by $m$ are given by $\left[ \dfrac{n}{m}\right]$, those integers will be $m, 2m, \cdots, \left[ \dfrac{n}{m}\right]m$. Hence for the first part of this question, the answer will be precisely $\left[ \dfrac{n}{2^k}\right]-\left[ \dfrac{n}{2^{k+1}}\right]$. But i am not able to see how this helps in proving the given sum. Also i don't understand what the question is trying to say after we have calculated the sum.
I was doing some basic Number Theory problems and came across this problem : Show that for any integer $n$ $\geq$ $1$ ; $$\sum_{i=0}^\infty [\frac{n}{2^i}+\frac{1}{2}] = 2n$$ ; where $[x]$ represents the greatest integer / floor function I am all thumbs , even a hint would suffice P.S. In the , this question is given in the section on the Greatest Integer Function , perhaps that might help . Also , this is not a homework question , I am just practicing number theory questions on my own from the book
I am searching on StackOverflow site for SolrNet based Question/Answers relating to edismax But it is giving me same result in single result page but as different Q: and A: prefix and votes respective to those Question and Answer. However I believe if the resulting item are point to same question (when you hover the links will show same question id in url) then it should be not shown twice or so Because this way I am being kept far far away from probable question or answer and page 1 is populated with duplicate. Thus also the count of 20 results (shown in screenshot) is very much incorrect. Search Url: Search Text: solr edismax [solrnet] Search Screenshot:
The Stack Overflow search shows questions twice. See for example. Results include "A: Add Search Engine into MVC Music Store" and "Q: Add Search Engine into MVC Music Store". Why is search displaying the question twice, and what does "Q" and "A" mean? Edit: @Stephen answer : The search is returning both a question (Q) and an answer (A) to the question, as both posts match your search criteria. and my another question If the question have multiple (like 100) answer ,then the answer link(A: Question Link) shown 100 times? Is it correct functionality ? But i saw only one answer link , not a other answer link .. why ?
I have trouble when I use the command \cal{B} , sometime the content after this command will be change to arrow or triangle or similar unwanted symbol . this is the code:- \documentclass{article} \begin{document} \cal{B}=(b_i)$ \end{document} any help appricated
Why does \cal{M}_n give “M>” in parts of my LaTeX file and works correctly in other parts?
I was asked to review a technical paper for a journal at a large commercial publisher. The paper extends on another publication that is cited several times throughout the document. The cited paper was published at the same publisher but in a different journal. I work for an R&D department in a private company. We do not have a subscription with the publisher and no budget to buy articles (at least not in cases like this). I.e., I cannot access the cited paper. Would it be acceptable to ask the editor of the journal I review for to provide me with the cited paper? Additional Information: The review process is double blind, so I do not know if the cited paper and the paper I'm reviewing are from the same authors. Given the specific topic, it seems likely to me. This is why I did not ask the authors for a copy. I was also unable to find a free version of the paper online. Outcome: I asked the editor for the paper and received a copy within hours. Along with ads for a subscription of that journal.
If you review a paper which relies on results some other paper and you do not have access to that paper, is it acceptable to contact the editor and ask whether the author can provide a copy of the referenced paper? Are requests like this reasonably common? Or should the referee simply take the word of authors that their conclusions based on the referenced paper are correct, even without seeing that paper?
$G$ is the dihedral group $D_6$ of order 6. I need to find all subgroups of order 2 and order 3. I have found the cyclic group $\left<b\right> = \{e, b\}$, but that's as far as I have come. How do you list all subgroups of eg. $D_6$? and how would you present all subgroups of eg. order 2?
How many subgroups of order $n$ does $D_n$ have? My work: Since subgroups of $D_n$ are either cyclic or dihedral, the subgroups of order $n$ of $D_n$ are $\left< r \right>$ (cyclic) and $D_{n/2}$ (dihedral). However, this works only for $n$ is even and $n\geq 2$. I don't know how to do when $n$ is odd.
I'm using \docummentclass{amsart}and when using \section it prints it out in the center of the line how to make it on left I used \begin{flushleft} \section \end{flushlef} but it didn't work.
I use a LaTeX template which center aligns all section titles. I want to left align these section titles but I do not know how. I tried \begin{flushleft} \section{\textbf{Introduction and Background}} \end{flushleft} but it has no effect on the section title (i.e., it is still centered). I tried \begin{flushleft} \textbf{Introduction and Background} \end{flushleft} and it is left aligned the word "Introduction and Background" but it is no longer a section title and thus the numbering using section number are all messed up. I am new to LaTeX so please keep it simple.
In quantum cosmology, the so-called wave function of the universe is introduced, which is described through the Wheeler-DeWitt equation (Schrödinger equation for the wave function of the universe). This equation does not depend on time, since the total Hamiltonian of the Universe, including the Hamiltonian of the gravitational field, identically vanishes. This means that the universe as a whole does not evolve over time. I searched for an explanation of this paradox in several sources, but did not find an illustrative one. The most obvious was the interpretation that the concept of evolution over time is not applicable to the universe as a whole, since there is no external observer in relation to the universe, and there is no external clock that does not belong to the universe. The wave function contains components that correspond to all possible states of the Universe (all possible geometries, and so on). When we artificially divide the Universe into two parts, one of which is an observer with a clock, and the second is the rest of the Universe, then there is still a connection, correlations between the two parts, because they are parts of one whole. And the states of the apparatus (clock) correlate with different states of the Universe. Thus, a sense of the passage of time and the evolution of the Universe is created. How correctly did I understand this interpretation?
It’s often said that the problem of time exists because time is treated as absolute in quantum mechanics but not so in General Relativity, see e.g. . However Quantum Field Theory merges QM with Special Relativity, which treats time as relative (time dilation, etc). What actually leads to the problem of time in Quantum Gravity?