body1
stringlengths
20
4.1k
body2
stringlengths
23
4.09k
class Player: def __init__(self, name, score): self.name = name self.score = score def __str__(self): return self.name +" " +str(self.score) n = int(input()) data = [] for i in range(n): name, score = input().split() score = int(score) player = Player(name,score) data.append(player) sorted(data,key=getattr(player.score,'name')) for i in range(n): print(data[i]) I am trying to sort a list by using the getattr function. When I try to pass the object in the arguments list I get the following error: Traceback (most recent call last): File "C:/Users/raghu/.PyCharmCE2018.2/config/scratches/demo2.py", line 15, in <module> sorted(data,key=getattr(player.score,'name')) AttributeError: 'int' object has no attribute 'name'
I've got a list of Python objects that I'd like to sort by an attribute of the objects themselves. The list looks like: >>> ut [<Tag: 128>, <Tag: 2008>, <Tag: <>, <Tag: actionscript>, <Tag: addresses>, <Tag: aes>, <Tag: ajax> ...] Each object has a count: >>> ut[1].count 1L I need to sort the list by number of counts descending. I've seen several methods for this, but I'm looking for best practice in Python.
In formal writing, is the following usage of punctuations acceptable? I keep asking myself. Who am I? Where am I from? And where am I going? I'm not quite sure whether using a period after I keep asking myself is weird. To me, the natural choice would have been a colon, but this also would have made the first interrogative sentence have to start with a lower case w whereas subsequent ones, as they follow a question mark, must begin with a capitalised W , like ..asking myself: who am I? Where am I from..., which doesn't make much sense to me either. Of course, alternatively, I can reorganise these interrogative sentences into clauses like I keep asking myself: who I am, where I am from and where I am going. But this feels much less emotionally charged than the first one, which makes it not so desirable to me.
Should the first word after a colon be capitalized? Which of the following is correct? For example: This. For example: this.
I'm looking through this project , and in one of the files (kseq.h, 75-77), there is macros this function: #ifndef kroundup32 #define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) #endif How does this function work? Does it return 7 things? I have an idea of the basic operations inside, I just don't get what is the form of its operation or output.
What does the , operator do in C?
Why did Wolverine start ageing in the movie Logan? I believe that Wolverine can heal fast and also won't grow old. It has been shown so in the previous movies as well. I remember in a previous movie (of the same X-MEN / Wolverine) series, Logan was lured into traps by saying that they will tell him his age and help him bring back his memories of what all happened before they shot him on his head with those Adamantium bullets. Can anyone please explain me why Wolverine started ageing in Logan?
In (2017), Logan seems to be dying from sort sort of ailment, that prevents him to heal properly and seems to be decaying his body in a way that wasn't happening in any of the other films his character appears in. I don't recall that this is being explained in the film. The Wikipedia page only mentions "adamantium poisoning" and "his healing factor fading", but it is not backed up with citations, so I would love to get an in-depth answer for this question, maybe using excerpts from the comic or original source material. What is happening to Logan?
I have referred to many websites online regarding the proof, but I haven't understood it at all.. Please do help. As far as I know, $n! = 1 \times 2 \times 3 \times 4 \times \dots \times n$ Then using the same logic, $0!=0$ Then why is it that $0!=1$ ?
How can I prove from first principles that $0!$ is equal to $1$?
I have the below MySQL query. select * from node where title LIKE 'born in care shelter breed'; Which is returning empty set. But when I try the below query select * from node where title = 'born in care shelter breed'; It is returning 1 result. What difference the both will make? I can't avoid the LIKE operator as the query creating after some condition checking
When using SQL, are there any benefits of using = in a WHERE clause instead of LIKE? Without any special operators, LIKE and = are the same, right?
Well, I'm having a problem with figure. I'm using figures like this: \begin{figure}[!ht] \centering \includegraphics[scale=1]{\importacaodedados importacaodearquivos.png} \caption{Importação de Arquivos.} \label{fig:importacaodearquivos} \end{figure} And I'd like to know if there is a way to IF the scale=1 exceeds the text width, use [max width = \textwidth] It would be really better if there is a way to put it in the style file. so I won't have to change every figure in the manual. (There are more than 140. Not all of them exceed the text width.)
With \includegraphics I can give the width of the resulting image (which would be scaled). How can I give a maximum width of the image? That is, if the original is smaller than X, I'd like to keep the smaller image, if the image is larger than X, then the image width should be X. Using pdflatex/graphicx.
I was trying to install mono, but the command: sudo apt-get install monodevelop-database is not working. How can I solve this?
How do I get to the Universe Repository in supported versions of Ubuntu?
I followed this guide in order to remove Cortana: But now, when I open windows menu, the search doesn't work, nor can I get cortana back. I factory resetted windows from scratch TWICE, but none of them work anymore, even when I check "use cortana" at the blue screen setting. (I see the cortana search window but it is disabled, But not the notebook)
With reference to: I removed the Cortana packages from my running Windows 10 using the method posted by magicandre1981 and using win6x_registry_tweak. My question is how can I re-install Cortana (or for that matter any other package removed similarly)? I have opened up the install.wim image (converted from a Win 10 install.esd file) and found Cortana in the system apps folder, but don't know how / what to use to re-install it. Any help please?
I have a list of objects called employee() and I used emp as my object. I want to increment over employees and print the name of all the objects. I really lost on how to do this. Thanks. for( emp ; ;employees()) { System.out.println(emp.name); }
Consider: List<String> someList = new ArrayList<String>(); // add "monkey", "donkey", "skeleton key" to someList for (String item : someList) { System.out.println(item); } What would the equivalent for loop look like without using the for each syntax?
i applied with my parents to Germany. my dad got the visa while me and mum got the following: One or more member states are of the believe that you are a threat to the public order, the internal security, public health according to Arrocle 2 No 21 of the Resolution (EC) Nr. 2016/ 399 (Schengen Border Kodex) or to the international relations of one or more member states. Any idea what that is or if it allows me to reapply? we always received Schengen visa together.
I applied for German Schengen visa as a medical escort to my relative in a different country from where I reside, but my visa application was refused and the refusal letter was written in German as the following: Ein oder mehrere Mitgliedstaaten sind der Auffassung, dass Sie eine Gefahr für die öffentliche Ordnung, die innere Sicherheit, die öffentliche Gesundheit gemäß Artikel 2 Absatz 19 der Verordnung (EG) Nr 562/2006 (Schengener Grenzkodex) oder die internationalen Beziehungen eines oder mehrerer Mitgliedstaaten darstellen. I was in Germany for nearly a year with my relative during his treatment; I extended my stay there 3 times; and I returned back home two months ago in order to renew my passport. I applied again using the same documents that I used for my extension in Germany. First, can anyone tell me what the refusal means? Next, is there any possibility that there is a mistake in the assessment? Note: In English this reason is... One or more member state(s) consider you to be a threat to public policy, internal security, public health as defined in Article 2(19) of Regulation (EC) No 562/2006 (Schengen Borders Code) or the international relations of one or more of the member states).
HOW?How do I simplify this expression? $276^{247} \mod 323$ Thank you so much.
How do I efficiently compute $a^b\bmod c$: When $b$ is huge, for instance $5^{844325}\bmod 21$? When $b$ is less than $c$ but it would still be a lot of work to multiply $a$ by itself $b$ times, for instance $5^{69}\bmod 101$? When $(a,c)\ne1$, for instance $6^{103}\bmod 14$? Are there any other tricks for evaluating exponents in modular arithmetic? This is being asked in an effort to cut down on duplicates, see and .
How do I use GNU touch to update a file called -? How do I use GNU cat to display a file called -? I'm running: % cat --version | head -n1 cat (GNU coreutils) 8.29 % touch --version | head -n1 touch (GNU coreutils) 8.29 Firstly, touch: % touch - % ls -l total 0 % touch -- - % ls -l -- - ls: cannot access '-': No such file or directory Ok, I'll give up on creating a file with touch. Let's create it with date instead: % date > - % ls -l - -rw-r--r-- 1 ravi ravi 29 Sep 8 19:54 - % Now, let's try to cat it: % cat - % # I pressed ^D % cat -- - % # Same again - I pressed ^D I know I can work around with: % > - and % cat < - But why don't these GNU utils support the convention that -- means that everything following is treated as a non-option? How do I use these tools in the general case, for example I have a variable with the contents -?
How do you remove a file whose filename begins with a dash (hyphen or minus) -? I'm ssh'd into a remote OSX server and I have this file in my directory: tohru:~ $ ls -l total 8 -rw-r--r-- 1 me staff 1352 Aug 18 14:33 --help ... How in the world can I delete --help from a CLI? This issue is something that I come across in different forms on occasion, these files are easy to create, but hard to get rid of. I have tried using backslash rm \-\-help I have tried quotes rm "--help" How do I prevent the minus (dash or hyphen) character to be interpreted as an option?
I've got a pressure sensor and a flow sensor. Both have a 5V span, but have a (different) null offset i.e. at zero pressure (gauge) or zero flow they read ~2V and ~1V respectively. I am using an and PiPyADC (from git) so can only read up to 5V. How can I remove these offsets? Git code has a function: | cal_self_offset(self) | Perform an input zero calibration using chip-internal | reference switches. | | Sets the ADS1255/ADS1256 OFC register. but I'm not sure that's what I need, I definitely can't make it do what I want anyway! Currently, my only thought is to step the voltage down over a 2/3 potential divider to get into range, though I'm bound to lose some accuracy this way. I'm hoping I can somehow remove the offsets from both sensors. I appreciate any help/guidance, Thanks.
I am trying to create a circuit which will allow me to scale and offset a voltage (be it AC or DC) to within the range of the Arduino ADC. The voltage could be anything between + and - 250V, but I also need to have good sensitivity over lower voltage ranges too. To this end I am looking at a circuit whereby you can vary the voltage range that it expects the input to be and amplify/attenuate it accordingly. How I will be making the decision and setting the different gains is for another topic for now. I am only interested in the scaling and offsetting at the moment. So far I have come up with this circuit: Which appears to do just what I want for the +/- 250V range. I don't know how "safe" this circuit is, and if I am endangering any of the components with the 250V or not. The graphs at the bottom are (left to right) the input voltage, the power consumption of the bottom 10M resistor, the voltage across the 100M resistor (which is simulating the Arduino ADC input) and the power consumption of the upper 10M resistor. Now, if I drop the input voltage to just +/- 2.5V and tweak the op-amp feedback resistor accordingly, for some reason the offset voltage the op-amp is adding jumps right up. I don't know for sure if this is the fault of the simulator I am using, or if it is really what will happen, as I haven't yet breadboarded this circuit (I guess that's the next stage). This is the output from the 2.5V version: You can see how the offset has jumped up and the output is clipping massively. If I drop the lower 10K resistor to the virtual ground offset voltage divider to just 3.3K it compensates, but that's not nice - I would like to just vary the one resistor. The op-amp is (will be) a 5V single supply rail-to-rail I/O one. The two diodes are to protect the input of the op-amp against over voltage - I don't know if this circuit strictly needs them, but I guess it doesn't hurt to have them there. Also, I don't know if the resistor values are quite what I want - I chose them to keep the power consumption right down and the impedance right up. I don't want them to impact the frequency response of the circuit more than I can help - the input waveform could be anything from DC up to around 500KHz or so, and I need that reproducing at the ADC end as faithfully as I can. (I know the Arduino can only really sample at lower speeds than that, but the Arduino is just for experimenting - the final system will use a dsPIC with 1.1Msps ADC). So, what can I do to A) get a more stable offset, B) allow the varying of the input sensitivity without nuking either the op-amp or the ADC, and C) make the circuit safe to connect to, for example, a European mains voltage?
When ever i update the custom post type it generates too many revision which crashed the website. ( memory exceeded) How can i debug this issue? Update : I was able to find the culprit. Will it be possible for some one to detect what i did wrong in the below code : if (class_exists('wpprolister_core')) { add_action('wp_insert_post', 'wpprolister_updated_to_publish', 10, 3); function wpprolister_updated_to_publish($post_id, $post, $update) { if (get_field('wpprolister_advanced_option_edit_seo', $post_id)) { $metatitle = get_field('wpprolister_seo_title', $post_id); $metadesc = get_field('wpprolister_seo_meta_description', $post_id); $metakeywords = get_field('wpprolister_seo_keyword', $post_id); $content = get_field('wpprolister_description', $post_id); $image = get_field('wpprolister_listing_slider_image', $post_id); $attachment_id = $image['ID']; if (!empty($image)): $size = 'medium'; $thumb = $image['sizes'][$size]; if (defined('WPSEO_VERSION')) { update_post_meta($post_id, '_yoast_wpseo_title', $metatitle); update_post_meta($post_id, '_yoast_wpseo_metadesc', $metadesc); update_post_meta($post_id, '_yoast_wpseo_focuskw', $metakeywords);} //also update the content and featured image $my_post = array( 'ID' => $post_id, 'post_content' => $content, ); wp_update_post($my_post); update_post_meta($post_id, '_thumbnail_id', $attachment_id); endif; } } } How i solved the problem (please let me know if i did wrong ): remove_action('wp_insert_post', 'wpprolister_updated_to_publish'); $my_post = array( 'ID' => $post_id, 'post_content' => $content, ); wp_update_post($my_post); add_action('wp_insert_post', 'wpprolister_updated_to_publish');
I have been using this site alot for solving my problems, but this time I did not succeed in finding and answer for my problem. I get and infinite loop when using wp_update_post inside a function that is called on save_post. I know that this is a common issue, but I can't figure out how to avoid it. I want to save the order of my posts (which is of the post-type 'section'). So I have made a custom meta box which contain some sortable html-elements. In each element there is an hidden input tag with name='sectionorder[]'. So when I click the standard WordPress 'Update' buttom, an array containing all the ID's of the posts (in order) are send via POST. So here is the code where I retrieve the array, and wants to save the order: // Update section sort order $sectionorder = $_POST['sectionorder']; if (isset($sectionorder)) { // Avoid error if there is no sections added yet foreach( $sectionorder as $no => $sectionID ) { $post_update = array(); $post_update['ID'] = $sectionID; $post_update['menu_order'] = $no; wp_update_post( $post_update ); } } But the problem is that it starts an infinite loop. How do I avoid that? Maybe I can do it in a completely different way? Appriciate your help!
Can I download Ubuntu on to a Mac, save it to a memory stick to install on a PC and leave the Mac untouched?
I am looking at this: I need to create a boot disk to test Ubuntu to make sure it will run on a PC (Compaq Mini CQ10-120LA) I was given. I can create the boot disk off of a Mac (in English) or Windows (but Windows is in Spanish and foreign to me). Questions: What format do I choose for the USB stick? (I wish the instructions stated this). What is Dash? (Will I know when I run the installer?) Can I do this from a Mac or Windows computer? Or only from Ubuntu?
Does anyone know what apps the notifications at the top left of the screen are for? I was sent a screenshot and I'm curious.
I'm concerned about an app on my child's phone. I saw an app icon in the notification area that looked strange (Andy Android head, slightly tilted as its icon). How can I find out what app it is from just having seen that icon in the notification bar?
When using a full frame lens on a crop body, does the lens require more light? If I use an f/2.8 full frame lens on a crop body, does it become an f/4.2 (*1.5)?
Let's say I have a micro-4/3rd camera and a full frame camera, both set to 1/60 at f/2.8, taking a picture of the same scene in the same lighting. Will the exposure be the same across both cameras despite the different sensor sizes? The reason why I'm asking is because of the difference in depth of field between micro-4/3 and full frame sensors. I'm finding that, in order to take a picture of certain scenes with the full frame camera at the same depth of field as the micro-4/3rd camera, I have to increase the aperture, which in turn forces me to crank up the ISO.
I know there are many similar questions like this but I am not sure why my code doesn't work. Basically, what I am trying to do is to initialize a 2D array to all 0s, get user input (row, column), and set the position to 1. def printBoard(positions): for row in positions: print(row) def main() x= int(input()) column = [0] * x Board= [column] * x printBoard(Board) for i in range(x): row, column = map(int, input().split()) Board[row][column] = 1 printBoard(Board) main() But the output is now what I expect. >>>2 [0, 0] [0, 0] >>>1,1 [0, 1] [0, 1] As you can see, the whole column is changed. May I ask why?
I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3 The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] Then I changed one of the innermost values: my_list[0][0] = 5 Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?
For some reason all of a sudden when I update cells in Excel, my equations are not being updated. For example, I have a simple equation =SUM(C4:C16). If I change any of the cells in C4-C16, the answer doesn't get updated... I don't know what happened I've never seen this fail before. Any ideas?
I have a formula in a cell which counts the values in 2 other cells. Normally, after entering in the values in these 2 other cells, the formula cell updates automatically when Enter is pressed or when the cells are clicked out of. However, for some reason, the value calculated by the formula does not update automatically. I am having to click on the formula bar, then I have to click enter for the formula cell to do its thing. Why is this happening?
Let $D$ be a bounded region and $f$ is an analytic function on $D$. Show that if there is a constant $c ≥ 0$ such that $|f(z)| = c$ for all $z$ in the boundary of $D$ then either $f$ is a constant function or $f$ has a zero in $D$. Is this just a direct consequence of the Maximum-Modulus Theorem?
Let $f$ be a non-constant and analytic on a neighborhood of closure of the unit disk such that $|f(z)|=\text{constant}$ for $|z|=1$. Prove $f$ has at least one zero inside unit disk. I thought of using Rouche's somehow. Using $f(z)-z$, and taking constant is less than $1$, I can actually conclude from Rouche's theorem that the equation $f(z)-z=0$ have a fixed point inside the unit disk. I am stuck for other constants greater than equals to one and exactly zero. I hope there should be a little trick I am missing here. It will be awesome to see if maximum principle can be applied to conclude the result.
So I'm just doing some tests but for some reason a variable is not letting it be loaded... Here's my code:import java.util.Scanner; import java.util.Scanner; public class EquipmentTest { static String choice; public static void main(String[] args) { Scanner SCANNER = new Scanner(System.in); Scanner enterScanner = new Scanner(System.in); choice = SCANNER.toString(); if(choice=="E") { int PLAYERINFO.HEADEQ "{--error here" = ARMOR.SILKHAT; } System.out.println(PLAYERINFO.HEADEQ); } } public class PLAYERINFO { //Player equipment public static int HEADEQ = 1; public static int CHESTEQ = 1; public static int LEGSEQ = 1; public static int FEETSEQ = 1; //Player defense calculation public static int DEFENSE = HEADEQ + CHESTEQ + LEGSEQ + FEETSEQ; //Player statistics public static int PLAYERHP = 10; public static int PLAYERDEFENSE = DEFENSE; public static int PLAYERSPEED = 7; public static int PLAYERATTACK = 6; public static int PLAYERMAGIC = 6; } public class ARMOR { public static int SILKHAT = 2; } Exception in thread "main" java.lang.Error: Unresolved compilation problem: Syntax error on token ".", , expected at EquipmentTest.main(EquipmentTest.java:15) I looked everywhere but I can't find my error. Any help is good!
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference?
Google give the following definition of the word "equation": "In mathematics, an equation is a statement of an equality containing one or more variables. Solving the equation consists of determining which values of the variables make the equality true." Is really an "equation" is a statement? I think that it more close to a "predicate". I will be happy if someone can give an exact (but still simple) definition of the term "equation" P.s. In all cases, I mean equation with unknown(s), not equal. Thanks!
I was just wondering about the formal definition of equation, I mean in terms of logic and the theory of sets. Suppose for example I wanted to define an equation on $\mathbb{R}$, of course it might be anything instead. I know every number is a set, and also I know that equality of sets has been defined previously. So I often hear people say something like "A linear equation is an object of the form $a_{1}x_{1}+a_{2}x_{2}+ \cdots + a_{n}x_{n}=b$". But how do you justify the part of "$x_{i}$ is an unknown". Because in that case I would also say that $3(2)+4(5)=0 $ is an equation.
Why for every normalized solution to the time-independent Schrödinger equation $E$ must exceed the minimum value of $V(x)$?
Consider e.g. the finite square well: $V = -V_o$ between $x=-a$ and $x=a$, $V=0$ elsewhere Now for scattering states, $E$ must be $> 0$. For normalizable bound states, $E$ must be $< 0$ and $> V_{\rm min}$ (=$-V_o$ in example). But if a particle in a lab has Energy which $< 0$ and $<V_{\rm min}$, is it bound or will it scatter? And I don't know why I haven't thought about this before but what does it mean for a photon to have negative energy?
Find all rational solutions to $x^2+y^2=2$ I rewrote the equation to $x= \sqrt{2-y^2}$ and thought that $x$ is rational if and only if $2-y^2$ is a square. So the only solution to the first problem is $x=1$ or $-1$ and $y=1$ or $-1$. Is there another approach? Thank you. Edit: Another question: Is there maybe a way to show this using elliptic curves?
Are there any rational numbers $x$ and $y$ such that $x^2+y^2=3$. I think there are no rational solutions, but I haven't been able to prove it.
I am working on parallel programming on c++ (with Mac and linux) and I want to know if there is a way to detect the number of cores assigned to this program in c++98. Thank you.
Is there a way to determine how many cores a machine has from C/C++ in a platform-independent way? If no such thing exists, what about determining it per-platform (Windows/*nix/Mac)?
Stack Exchange sites are about asking and answering. However, I can't help by answering because most of the questions are about something I'm not good at. I mean, everywhere. Though, I can help by asking questions which weren't asked before, related to the theme of the site where it's asked and either might be useful for someone in the future or provides useful and constructive answers. Is it enough?
Possible Duplicate: I've been for maybe a year to get answers to questions I couldn't find on my own. I always make an attempt first to find the answer on my own. As of this posting, I've asked 14 questions. I only once gave an answer, and it was to a non-technical question, and only because I was really bored and had too much coffee to drink. I wasn't intending to answer any other questions in the future, because on on my best days I'm only a mediocre programmer, and there are some real geniuses here on StackOverflow who can answer other peoples' questions faster and more accurately than I can. It actually is my nature. I am an Aquarian. We are asker-listeners. Today I discovered Meta Stack Overflow and started browsing around. I became familiar with the concept of the "Help Vampire". I seem to qualify. I continued reading more posts on the topic and got the distinct impression that people who only ask, and never answer, are less than welcome here, rather despised. So, should I just go away? Or should I start contributing answers just to have a answer-to-question ratio of 3-to-1 (I read somewhere that's the average) even though I am less than one eighth as knowledgeable as the 10K+ guys and gals? Or should I continue as I have begun? I mean, doesn't a 0-questions-asked user like Jon Skeet need a Blankman? Yin and yang, you know?
I am using biblatex with citestyle=authoryear and maxnames=5, along with \parentcite in the text. For papers with 3-5 authors, I would like them to appear with the full list the first time they are cited (as it does now), and with et al. the following times. Example: First appearance: (Author 1, Author 2, Author 3 and Author 4, 2018) Second appearance: (Author 1 et al., 2018) In , this seems to be done with the longnamesfirst command, but I haven't found a way to do this biblatex.
Basically all I need to know is how I can use "et. al" beginning from the second citation of a source. I am using the following \usepackage[ natbib=true, style=authoryear ]{biblatex} I need citations to look like this: First citation of a source Drobetz, Schillhofer, and Zimmermann (2004) Second and further citations Drobetz et al. (2004) Right now, every citation looks like the first one. With the biblatex option maxcitenames I can only adjust all citations and not all but the first one. Any help?
I played Deus Ex: Human Revolution (Director's Cut) for 43 hours and I have a total of 4 card drops. How can I earn rest of these cards. Also, I'm new to steam.
Steam . In order to get them, you're supposed to play specific games (currently there are supported, but they've said more will come). However, I can't figure out how to actually get the cards. I played a bit of Portal 2, but didn't find any cards. Do I need to find/pick up actual cards within the game? Do I get them for completing certain objectives/achievements? Do I need to beat the game? How do I get cards?
Consider a lone photon. As its frequency increases, its energy increases. Taken to the limit, a sufficiently-high-frequency photon could be a black hole unto itself. But the frequency of a photon is dependent on the inertial frame of the observer. Two observers could each observe this photon to be either above or below this critical frequency. Or, I could accelerate to "catch up" to this photon, red-shifting it until it is no longer energetic enough to be a black hole. So couldn't I at one moment observe a particle to disappear beyond the event horizon, accelerate until the event horizon no longer exists, and hence observe what happened to the particle after crossing that threshold? Is this in-principle possible? If not, why not? EDIT: to clarify, I am not asking how much energy-due-to-photon-momentum is required to create a black hole, I am asking: given that threshold energy, how does the event horizon appear to different inertial frames which observe the photon to be above/below this threshold?
I was wondering if it is possible for a single photon to form a black hole if it has a small enough wavelength.If so, what would this wavelength be? I came across this question because I am reading about loop quantum gravity, and have heard that it is 'untestable'. I know that the loops making up spacetime in loop quantum gravity are thought to have a size in the order of $10^{-35}$m, and I was wondering whether making a photon with a wavelength small enough to investigate this would form a black hole. I am aware of the two posts here, but neither seem to really answer my question because they refer to several photons: and . Thank you.
I have some previous experience with C++ and just getting started up with Python. I read this text from : In my experience, a general idea is, if you want to perform an operation on object 'O', you call a method on that object to do it. Eg. If I have a list object, and I want to get summation of all elements, I would do something like : listObject.getSumOfAllElements() However, the call given in above book excerpt looks a little odd to me. To me this would make more sense : return (["%s=%s" % (k, v) for k, v in params.items()]).join(";") i.e. join all the elements of the list as a string, and here, use this parameter ';' as a delimiter. Is this a design difference or just syntactically a little different than what I am thinking ? Edit: For completion, the book says this a little later :
This has always confused me. It seems like this would be nicer: my_list = ["Hello", "world"] print(my_list.join("-")) # Produce: "Hello-world" Than this: my_list = ["Hello", "world"] print("-".join(my_list)) # Produce: "Hello-world" Is there a specific reason it is like this?
I have two PCs, one is a Windows 7 desktop and another is Windows 10 laptop. I want to use remote desktop connection to connect to the Windows 7 desktop which is connected to the laptop with a LAN cable, no router and other things. Is it possible?
I've got two systems that are right next to each other, and connected wirelessly to the same router. I want to connect the two of them together with an ethernet cable - both have gig-e and autonegotiation so it should work. I DON'T need the second system to have internet, but I need any specific tweaks to be on that system only. I do not need to share internet. I need RDP to work, and thats it The wireless runs on a 192.168.1.x subnet and ICS always runs on a 192.168.0.x subnet so that wouldn't be a problem. Ideally I want this layout. Can I do this with ICS, or there some other free or open source way? +---------------------------+ +-----------------------------+ | Laptop 1 | | Laptop 2 | | Client- mobile | | 'server'- stationary system | | <-----+-----> | | RDP client | | RDP Server | | MUST have wireless access | ethernet | Runs ICS or similar | +---------+-----------------+ | wireless access optional | | +-----------------------------+ | | | | | | | +---------------+ wireless to internet
The Question Prove $1 + \frac{1}{4} + \frac{1}{9} + \cdots + \frac{1}{n^2} < 2 - \frac{1}{n}$ where $n\ge2$ and $n$ is an integer by Induction My Work Basis Step: 1 + $\frac{1}{4} = \frac{5}{4}$ $2-\frac{1}{2} = \frac{3}{2}$ $\frac{5}{4}<\frac{3}{2}$ Inductive Hypothesis: $1+\frac{1}{4}+\frac{1}{9} + \cdots + \frac{1}{k^2} < 2 - \frac{1}{k}$ Induction Step We must show $1+\frac{1}{4}+\frac{1}{9} + \cdots + \frac{1}{k^2} + \frac{1}{(k+1)^2} < 2 - \frac{1}{(k+1)}$ $1+\frac{1}{4}+\frac{1}{9} + \cdots + \frac{1}{k^2} < 2 - \frac{1}{k}$ $2 - \frac{1}{k} + \frac{1}{(k+1)^2} = 2 - \frac{(k^2+2k+1)+k}{k(k+1)^2} = 2-\frac{k^2 + 3k + 1}{k^3 +2k^2+k}$ My Problem I can't seem to complete the proof. Any hints on how to change my approach for success?
I am having trouble with the following proof: For every positive integer $n$: $$1 + \frac{1}{4} + \frac{1}{9}+\cdots+\frac{1}{n^2}\leq 2-\frac{1}{n}$$ My work: I have tried to add $\frac{1}{(k+1)^2}$ to $2-\frac{1}{k}$ in the inductive step and reduce it down to $2-\frac{1}{k+1}$ but cannot do so. I am beginning to think that my entire approach is wrong.
I need to search for the first occurrence of text between single quotes, return the text (without the quotes), but if there is no quoted text is found, return null. I cannot use any additional methods. For example: On input "this is some 'text' and some 'additional text'" the method should return: text On input "this is an empty string '' and another 'string'" it should return: nothing. My code: public static String findSingleQuotedTextSimple(String input) { Pattern pattern = Pattern.compile ("(?:^|\\s)'([^']*?)'(?:$|\\s)"); Matcher matcher = pattern.matcher (input); if (matcher.find()) { return (matcher.group ()); } else { return null; } } However I seem to fail the test and the output is null every time, please help me point out the problem.
I have several strings in the rough form: [some text] [some number] [some more text] I want to extract the text in [some number] using the Java Regex classes. I know roughly what regular expression I want to use (though all suggestions are welcome). What I'm really interested in are the Java calls to take the regex string and use it on the source data to produce the value of [some number]. EDIT: I should add that I'm only interested in a single [some number] (basically, the first instance). The source strings are short and I'm not going to be looking for multiple occurrences of [some number].
test.sh: /usr/bin/notify-send "test" The following works: bash ~/Documents/test.sh BUT the crontab never shows the notification. Why? */1 * * * * bash ~/Documents/test.sh
I am new to linux and I read and followed many instructions to run a python script at reboot but non of them worked: this is the command I want to run: /usr/bin/python3 /home/am/projects/AMAcc/map.py I used crontab -e and added @reboot /usr/bin/python3 /home/am/projects/AMAcc/map.py I tried sudo crontab -e and added the same command I even edited /etc/crontab file and added above command. Tried adding #!/usr/bin/python3 at top of my python code and changing its permissions like: sudo chmod a+x map.py As documents suggested that all users would be able to run cron jobs if cron.deny file exists but its empty, so I tried creating empty cron.deny files in both /etc/cron.deny and /usr/lib/cron/cron.deny. But still no luck running the cron job. What am I doing worng?
I am in a critical problem with the following question. Please help me. Prove by induction: $$4^n > n^2 \text{ for }n >= 1$$ Base case: n = 1 $$4^1 > 1^2$$ 4 > 1 which is true and for some n = k > 1 we have $$4^k > k^2$$ Next, Induction step: Now setting n = k+1 we get $$4^{k+1} > (k+1)^2$$ $$4(4^k) > k^2 + 2k + 1$$ Now how will I proceed?
Prove that $ n < 2^{n} $ for all natural numbers $n$. I tried this with induction: Inequality clearly holds when $n=1$. Supposing that when $n=k$, $k<2^{k}$. Considering $k+1 <2^{k}+1$, but where do I go from here? Any other methods maybe?
I'm trying to render a scene where a large amount of the scene is visible, but blender has a performance feature where it culls objects when they start to get a certain distance from the camera, whether it be the actual render camera or user camera. Is there any way to remove this? I'm including a picture of the rendered scene. EDIT> I found out right after posting this how to fix the problem.
I have created a simple model here When rendering it the end of it is cut off How can I get the camera to render a longer distance?
How can I find an example of subsets which satisfies; for every $i \in \mathbb{N}$ $c_1 \supset c_2 \supset c_3 \supset \cdots \supset c_n$ which are closed and connected subsets of $\mathbb{R^k}$ then $\bigcap_{i=1}^\infty c_i$ is not connected. until now I have $c_n=\{[n,\infty) , n \in \mathbb{N}\}$ $\Rightarrow$ $\bigcap_{i=1}^\infty c_i=\varnothing$ which is I couldn't decide whether if it is connected or not connected. $d_n=\{ ( [-\frac{1}{n},\frac{1}{n}] \times \{0\}) \cup (\{0\}\times ([-1,1]\setminus \{0\})), n\in \mathbb{N}\}$ $\Rightarrow$ $\bigcap_{i=1}^\infty d_i= \{0\} \times [-1,1]$ which is connected. (here I want to seperate the vertical one from the point $(0,0)$ for not path connected implies not connected. If i rearrange the $ [-1,1] \times \{0\}$ element -for not path connecting result- as $(-1,1) \times \{0\}$ the set will be not closed but intersection is not connected.) Thanks in advance for your guidances :)
Let $X$ be a topological space and let $\left\{ Y_{i}\right\} _{i=1}^{\infty}$ be a descending chain of closed connected subsets of $X$. I know from reading elsewhere that ${\displaystyle \bigcap_{i=1}^{\infty}Y_{i}}$ is not necessarily a connected subspace of $X$ but I have no counter example and I haven't managed to come up with one. There is a counter example to the same question while also assuming $X$ is compact. However, it uses the quotient topology which I haven't studied about so I would prefer a different counterexample that does not use the quotient topology. Help would be appreciated!
Note: This is for a physics project, so please don't just give me the answer... Say we have a cup that is 3/4 full with water. We place that cup (with the water in it) upside down on a smooth table. Why doesn't the water fall out? This is my understanding... The cup on the table has created an air tight seal that does not allow water to leak out nor any air to enter the cup. Also, as water gets deeper, the pressure increases. Therefore, there is a greater force of water pushing down on the table which the cup contains. But, wouldn't this cause the water to escape the cup? Also, there would be an area of low pressure in the "top" of the cup, but I'm unsure how that has anything to do with the water not escaping the cup... Any insight would be great!
When I was in high school, my teacher did an experiment to show the power of atmospheric pressure. Experiment: Prepare a glass bottle, fill with water, put a glass plate on the bottle, make sure there is no air in the bottle, just water. Hold the glass bottle and plate, and invert them. Slowly, release the hand which hold the plate. Because the atmospheric pressure, the glass plate will not fall down. Question 1: As we know, if we didn't put water into the glass bottle, just air in the glass bottle the glass plate will fall down. So, If we use other liquid instead of water, this liquid has smaller density than water, like alcohol, the plate will not fall down. But, if we continue to chose the smaller density liquid until the liquid has density like air the plate will fall down. So, if there is a threshold density of liquid make the plate between falling down and not falling down? Question 2: If we put the bottle and plate into water slowly, when the plate and part of bottle are in the water but part of the bottle still above the water, will the plate fall down? Question 3: Continuing question 2, when both bottle and plate are in the water I know the plate will fall down. So, how does the pressure of water and atmosphere change? Is there a good description of this phenomena? Why does the trick continue to work with lower density fluids and why does placing the plate in the water cause it to fall?
Audits which are potentially duplicates have a "Duplicate" tab at the top allowing you to see what it's been marked as a duplicate of: When you get test audits which include or duplicate, however, no duplicate tab is displayed. This makes it somewhat obvious that it's a test audit: For reference, here is the audit this was from: (the question itself isn't actually closed as duplicate anyway!)
I recently started filtering to duplicates in the close votes queue and I've noticed that every review will always have a Duplicate tab allowing you to tab between the question and proposed duplicate. Whenever presented with an audit, I know immediately because the duplicate tab disappears. Upon searching for information regarding audit filtering I found which told me that audits are not filtered but the tags are faked such that a user could not just watch the tags and only pay attention if their filtered tags do not show up, this doesn't help with this situation though. As far as I can tell, you can currently robo-review the close votes queue indefinitely without ever reading a question: Assuming I am not mistaken, should something be done about this? Related (outdated?) but not duplicate:
Scripts on command line offer a wide range of parameters types. Often parameters can be passed to the script via "--[parameter]" or "-[parameter]". But what is the difference? Why do some parameters have a double "-" and some only a single "-" prefix? Is there a convention of a technical reason behind this? Example of possible git parameters. (See --exec-path[=<path>] vs. -c name=value) git [--version] [--help] [-C <path>] [-c name=value] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p | --paginate | --no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] <command> [<args>]
Where did the convention of using single dashes for letters and doubles dashes for words come from and why is continued to be used? For example if I type in ls --help, you see: -a, --all do not ignore entries starting with . -A, --almost-all do not list implied . and .. --author with -l, print the author of each file -b, --escape print octal escapes for nongraphic characters --block-size=SIZE use SIZE-byte blocks -B, --ignore-backups do not list implied entries ending with ~ ... I tried googling - and -- convention even with quotes with little success.
Right now I'm almost tormented by answering the following question: "How do we handle our errors and issues in an agile environment?" Scrum is a framework that does not directly dictate how to handle errors. The direct answer would be to treat bugs as Product Backlog Items that should be included in the Product Backlog. If the Product Owner rates their priority as very high, then they will be considered by the development team at the next sprint. Questions: But is this the only or the right way? So how should you deal with the mistakes in an agile development?
When reporting a defect, we are setting the priority and severity of the defect. How this works with agile development? Is there any specific way ? How bug prioritization works in agile projects vs non agile.? Is there any other way of measuring the priority of a bug in agile projects?
I have a pound of hamburger meat that has not been opened yet. The sell by date was on may 23 2013. Is it ok to eat?
How do I know if a given food or ingredient I have is still good, or if I should discard it? How can I best preserve a food or ingredient? This broad question is intended as a "general reference" question to quickly answer many how long will food keep for? questions. Please feel free to edit this question to expand and clarify as needed.
As the title says. If a user tries u upload a file with ' in title it throws error(it won't connect to server). Should I replace that sign during upload or something else. It just simple connecting to database $b = "select * from doc"; $rez1 = mysql_query($b) or die("<span>error</span>");
If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')"); That's because the user can input something like value'); DROP TABLE table;--, and the query becomes: INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--') What can be done to prevent this from happening?
I have been searching for a while trying to find a way to get an OS onto a USB. I have searched this and I have only found how to make a ubuntu live USB. I don't want to dual boot. I want to be able to have the operating system on the USB so that I can plug it into other computers and boot my desktop. I have no idea where to look on how to do this so some help would be nice. I have a windows 8.1 laptop and a 16GB USB.
If you are hurrying to reply, System → Administration → StartUp Disk Creator -- no, that's not what I'm talking about. I want to try Ubuntu 11.04's Unity without touching my existing Ubuntu install. To do this, I need to install the nVidia drivers first (sigh). To do this, I need changes to persist a reboot. To do this, I need to really install Ubuntu on a USB key. How do you do that? What I tried I tried to make a USB key from , then boot from it, then choose "Install Ubuntu." The installer refused to install to the installation media itself. I tried, from my installed copy of Ubuntu: sudo kvm /dev/sdb --cdrom .cache/testdrive/iso/ubuntu_natty-desktop-i386.iso ...but the installer didn't detect the disk properly.
I'm meant to prove the statement above and I chose to do so by thinking about the equation modulo $4$ and residue classes. My simplified process is below: $c^2$ is either the residue class $1$ (if odd) or $0$ (if even). After being multiplied by $3$, it is either the residue class $3$ or $0$. Similarly, $a^2$ and $b^2$ are either the residue classes $1$ (if odd) or $0$ (if even). Because of this, $a^2+b^2$ can never equal $3$ (which is $3c^2$'s residue class if it's odd), meaning that $a^2$ and $b^2$ must both be even so that $0 + 0 = 0$. Where I'm lost is where to go from here. My instinct is to say that, since we ignoring the cases where $a$, $b$ and $c$ are zero, then the case above is invalid because $0$ is part of the residue class $0$, but that doesn't seem correct to me. Does anyone have any advice on where to go from here (or if I missed something in my proof?)
Show that the curve $x^2+y^2-3=0$ has no rational points, that is, no points $(x,y)$ with $x,y\in \mathbb{Q}$. Update: Thanks for all the input! I've done my best to incorporate your suggestions and write up the proof. My explanation of why $\gcd(a,b,q)=1$ is a bit verbose, but I couldn't figure out how to put it more concisely with clear notation. Proof: Suppose for the sake of contradiction that there exists a point $P=(x,y)$, such that $x^2+y^2-3=0$, with $x,y\in\mathbb{Q}$. Then we can express $x$ and $y$ as irreducible fractions and write $(\frac{n_x}{d_x})^2+(\frac{n_y}{d_y})^2-3=0$, with $n_x, d_x, n_y, d_y\in\mathbb{Z}$, and $\gcd(n_x,d_x)=\gcd(n_y,d_y)=1$. Let $q$ equal the lowest common multiple of $d_x$ and $d_y$. So $q=d_xc_x$ and $q=d_yc_y$ for the mutually prime integers $c_x$ and $c_y$ (if they weren't mutually prime, then $q$ wouldn't be the lowest common multiple). If we set $a=n_xc_x$ and $b=n_yc_y$, we can write the original equation as $(a/q)^2+(b/q^2)-3=0$, and equivalently, $a^2+b^2=3q^2$. In order to determine the greatest common divisor shared by $a$, $b$, and $q$, we first consider the prime factors of $a$. Since $a=n_xc_x$, we can group them into the factors of $n_x$ and those of $c_x$. Similarly, $b$'s prime factors can be separated into those of $n_y$ and those of $c_y$. We know that $c_x$ and $c_y$ don't share any factors, as they're mutually prime, so any shared factor of $a$ and $b$ must be a factor of $n_x$ and $n_y$. Furthermore, $q=d_xc_x=d_yc_y$, so it's prime factors can either be grouped into those of $d_x$ and those of $c_x$, or those of $d_y$ and those of $c_y$. As we've already eliminated $c_x$ and $c_y$ as sources of shared factors, we know that any shared factor of $a$, $b$, and $q$ must be a factor of $n_x$, $n_y$, and either $d_x$ or $d_y$. But since $n_x/d_x$ is an irreducible fraction, $n_x$ and $d_x$ share no prime factors. Similarly, $n_y$ and $d_y$ share no prime factors. Thus $a$, $b$, and $q$ share no prime factors, and their greatest common divisor must be $1$. Now consider an integer $m$ such that $3\nmid m$. Then, either $m\equiv 1\pmod{3}$, or $m\equiv 2\pmod{3}$. If $m\equiv 1\pmod{3}$, then $m=3k+1$ for some integer $k$, and $m^2=9k^2+6k+1=3(3k^2+2k)+1\equiv 1\pmod{3}$. Similarly, if $m\equiv 2\pmod{3}$, then $m^2=3(3k^2+4k+1)+1\equiv 1\pmod{3}$. Since that exhausts all cases, we see that $3\nmid m \implies m^2\equiv 1\pmod{3}$ for $m\in\mathbb{Z}$. Notice that $a^2+b^2=3q^2$ implies that $3\mid (a^2+b^2)$. If $3$ doesn't divide both of $a$ and $b$, then $(a^2+b^2)$ will be either $1\pmod{3}$ or $2\pmod{3}$, and thus not divisible by $3$. So we can deduce that both $a$ and $b$ must be divisible by $3$. We can therefore write $a=3u$ $\land$ $b=3v$ for some integers $u$ and $v$. Thus, $9u^2+9v^2=3q^2$, and equivalently, $3(u^2+v^2)=q^2$. So $3$ divides $q^2$, and must therefore divide $q$ as well. Thus, $3$ is a factor of $a,b,$ and $q$, but this contradicts the fact that $\gcd(a,b,q)=1$, and falsifies our supposition that such a point $P=(x,y)$ exists.
I'd like to minimize/maximize any generic window in all 4 directions. How do I accomplish this? More specifically, I'd like to do this for iterm, but it would be nice if the solution is generic.
Before Mavericks, I could maximise a window while holding shift key, and the window would always fill up the entire screen without needing any third party tools or changes. It no longer works in Mavericks, is there a workaround or hidden setting to revert to the old behavior?
Is "Listen up" a complete sentence or is it just a fragment?
seems to indirectly ask the question, but the upvoted answer says "the actual sentence is...". So my question is this: Are commands considered to be grammatically sound, complete sentences in the English language? Some examples: Go. Add a note. Do work.
I have a array of objects , take the below code as a example: Let Data = [ { "helptext": "streetAddress_description_text", "name": "addressLine1", "label": "streetAddress_label", "placeholder": "streetAddress_sample", "type": "text", "required": true }, { "helptext": "streetAddress2_descriptor_text", "name": "addressLine2", "label": "streetAddress2_label", "placeholder": "streetAddress2_sample", "type": "text", "required": false }, { "name": "city", "label": "city_label", "placeholder": "city_sample", "type": "text", "required": true } ] Here i need to add a unique value in the objects that is present inside the array.Example id [ { "helptext": "streetAddress_description_text", "name": "addressLine1", "label": "streetAddress_label", "placeholder": "streetAddress_sample", "type": "text", "required": true, "id":1 }, { "helptext": "streetAddress2_descriptor_text", "name": "addressLine2", "label": "streetAddress2_label", "placeholder": "streetAddress2_sample", "type": "text", "required": false, "id":2 }, { "name": "city", "label": "city_label", "placeholder": "city_sample", "type": "text", "required": true, "id":3 } ] And i am using the above object for some operation. Take an example i am rearranging the object position. Eg: [ { "name": "city", "label": "city_label", "placeholder": "city_sample", "type": "text", "required": true, "id":3 }, { "helptext": "streetAddress2_descriptor_text", "name": "addressLine2", "label": "streetAddress2_label", "placeholder": "streetAddress2_sample", "type": "text", "required": false, "id":2 }, { "helptext": "streetAddress_description_text", "name": "addressLine1", "label": "streetAddress_label", "placeholder": "streetAddress_sample", "type": "text", "required": true, "id":1 } ] After this process, i need to removed the id which we have added in the first process. And sumbiting the value to the server. Is there any way to achieve this. Please help me with this. Thanks in advance
Say I create an object as follows: let myObject = { "ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*" }; How should I remove the property regex to end up with new myObject as follows? let myObject = { "ircEvent": "PRIVMSG", "method": "newURI" };
Some times I come accross an answer that is super good, and I know I will need to look at this again.. I usually upvote such questions/answers.. but, some times it is hard to find them again (unless I do something as oldfashion as bookmark it), so I would like to "save" it... for myself.. so that later I can look at my own "saved" answers, and this is a much smaller subset of all the answers out there (think reddit save funtion).
I browse Stack Overflow quite frequently and I often find that when I come across a helpful answer I want to be able to save the best answer for later. It would be nice if I could save those snippets/answers to my account so later I can quickly find what I was looking for.
I am trying to prove that the uncertainty of the equation $$Q = xy$$ is equal to $$\frac{\Delta Q}{Q_0} = \frac{\Delta x}{x} + \frac{\Delta y}{y}.$$ However what I am getting is $$\Delta Q =\sqrt{(y\Delta X)^ 2 + (x \Delta y)^²} $$ and I am stuck there.. How to continue to prove that it is equal to the second equation that I have written?
I'm in doubt with one thing: let's imagine that we have $n+1$ quantities, $n$ of them being directly measured, and the other one being related to the first $n$ by a function $f : \mathbb{R}^n \to \mathbb{R}$. If the $x_i$ is one of the quantities being directly measured and if $\Delta x_i$ is it's uncertainty, then I've learned that the uncertainty of the quantity $y = f(x_1, \dots x_n)$ is given by: $$\Delta y=\sum_{i=1}^{n}{\frac{\partial f}{\partial x_i}\Delta x_i}$$ My problem in understanding this is: well, if $f$ is such a function, it's derivative is the linear transformation $df : \mathbb{R}^n \to \mathbb{R}$ given by: $$df=\sum_{i=1}^{n}\frac{\partial f}{\partial x_i}dx_i$$ Where $dx_i : \mathbb{R}^n \to \mathbb{R}$ is given by $dx_i(a_1 \dots a_n) = a_i$. Hence, what we are saying, is that $\Delta y = df ( \Delta x_1, \dots \Delta x_n)$, in other words, we are saying that the uncertainty of $y$ is given by a linear function of the vector of uncertainties of the quantities $x_i$. Why should that be true? I mean, what's the reasoning behind this? I really didn't get the point, my teacher just gave the equation without justifying or anything like that. Any help and reference is appreciated.
Many times a precise definition of something in physics is not available but yet there exist some rough definitions that guide us through. I need the same rough (if not precise) definition of physical laws. The reason being that we would consider $\mathbf a= \frac {d \mathbf v}{dt}$ as a mere definition but $\mathbf F =m \mathbf a$ as a law (as it is called as Newton's second law of motion). But to me it seem to be more inclined towards being as definitions rather than laws. I mean contrasting Newton's laws of motion to the law of conservation of energy (momentum, etc) it seem to be an attempt to define forces ( though I might be wrong at this (but I don't know reason for such)). So what is the definition of a physical law that can encapsulated it's entirety?
Some basic Physics books are often misguiding in the sense that they don't make clear whether something is a primitive concept, a law, a definition or a theorem. This is often a little confusing. I've asked here some moments ago if there's a definition of force, and I've been redirected to a question about whether Newton's Laws are laws or definitions of mass and force. This is just an example, but there are many others, like for instance, the conservation of energy, which some books present as a theorem, and some places says that this is a law of Physics. Time on the other hand, is something that according to Feynman's lectures on Physics, cannot be defined, so we just say how to measure it and leave it as a primitive concept. In this context: how in general can we identify whether something is a primitive concept, a fundamental law of Physics, a definition or a theorem?
I have an Account hierarchy. I have a formula on my Account that returns the ID of the Account at the top of the hierarchy. Due to formula size restraints, I can't use CASESAFEID in the formula, so it only returns the 15 character ID. Return type of the formula is Text (String). My use case is given one Account, return all the Accounts in its hierarchy. The problem is, I have a 15 character ID from the formula and SOQL is not case sensitive. So if I do something like this: Account a = [SELECT Id, Ultimate_Parent_Id__c FROM Account LIMIT 1]; String parentId = a.Ultimate_Parent_Id__c; String query = 'SELECT Id, ' + Util.GetDynamicQueryString() + ' FROM Account WHERE Ultimate_Parent_Id__c =: parentId'; List<Account> results = Database.query(query); This won't work because theoretically there could be multiple Accounts with that 15-character ID when it is processed case-insensitive. Since SOQL can't compare the String values in a case sensitive manner, the only way I can think to do this is to write a trigger to stamp the 18 character ID of the ultimate parent on create or reparent. Has anyone figured out a way around this?
Can anyone confirm this: in a SOQL Where clause, when comparing an ID field to a 15-character string variable, the comparison works. I didn't expect it to work, but it does and I am surprised. I can't find any documentation to confirm it. I thought 18-character ID was always in effect, and comparing 18-char ID to 15-char string would fail. Example (Country__c is a lookup field): String tmpID = 'a1he0000000EkAi'; Account acct = [select ID from Account where Country__c = :tmpID];
Using \bibliographystyle{unsrtnat} and bib files, with pdfLaTeX. I would like to include in the body of the text or perhaps in a footnote -- certainly not in the reference section -- only the abstract of an article contained in the bib file. By way of analogy, this is what \citeyear{bibitem} does with the publication year. The nearest to this that I could find are: seems to output each entry, while I would like to do it for a single citation at a time; : this extends the citation with the abstract, but I would like to have just the abstract.
I want to extract specific fields from a natbib/bibtex bibliographic file to construct a table similar to: title ------------------------------------------------- authors ------------------------------------------------- journal, year, volume ------------------------------------------------- abstract ------------------------------------------------- is there a way to do this in latex? Thanks Jorge
I have a class like this: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WindowsFormsApplication1 { public class MyList<T> : List<T> { public int SelectedIndex { get; set; } public T CurrentItem { get { if (this.SelectedIndex > this.Count) return null; return this[this.SelectedIndex]; } } } } I am creating a class that derive from list and create a property for getting the current item. If SelectedIndex is a wrong value, I am returning null but it has an error Cannot convert null to type parameter 'T' because it could be a non-nullable value type. Consider using 'default(T)' instead. I want the return value to be null not default(T). what should I do?
I have a generic method with this (dummy) code (yes I'm aware IList has predicates, but my code is not using IList but some other collection, anyway this is irrelevant for the question...) static T FindThing<T>(IList collection, int id) where T : IThing, new() { foreach T thing in collecion { if (thing.Id == id) return thing; } return null; // ERROR: Cannot convert null to type parameter 'T' because it could be a value type. Consider using 'default(T)' instead. } This gives me a build error "Cannot convert null to type parameter 'T' because it could be a value type. Consider using 'default(T)' instead." Can I avoid this error?
Problem I just went to use Property List Editor to look at a .plist file and it no longer works in Sierra   My Setup Mid-2010 15" MBP macOS Sierra 10.12   Crucial Comment I do not want to use Xcode to open .plist files, it's too much for such a simple task. The Property List Editor was perfect.   What I have Found As of 2016-09-13 The Apple Developer website describes Xcode as the only option to edit .plist files (search for: About Information Property List Files) Apple mentions using Xcode to generate and work with .plist files but there has to be another way.   Is the Property List Editor App done in macOS Sierra? If so, other than Xcode, are there any simple programs like the Property List Editor that people recommend?   Thank you for your responses!   UPDATE This is not a "duplicate" question. This question is specifically for those who are used to using Property List Editor and have lost it as an option when upgrading to macOS Sierra. So keeping this question thread will help others with the specific issue, especially if they are not a fan of using Xcode to work with plist files and/or do not know how to work with plist files through terminal. The solution linked in the "claimed" duplicate thread can be useful to those familiar with terminal. Those familiar with terminal, you can also use rlwrap and PlistBuddy, which IS currently working in macOS Sierra. See: Those not familiar with terminal who want to avoid Xcode: sorry, I haven't found a solution for you but I'll keep looking into it. If anyone else has a suggestion please add it. If there are other *exchange posts with software recommendations please feel free to link them for other users in the future.
From Finder, I can preview a plist file without any difficulties. For example, using Quick Look with ~/Library/Preferences/com.apple.Safari.RSS.plist I get a nice preview of its contents: However, if I then try to open the file, either with TextEdit, or any other editor (I've tried SublimeText, TextMate, Vim, Nano, and Coda 2 so far), the encoding appears to be off: bplist00Ò_"FixedRefreshesInBackgroundSettings_(com.apple.PreferenceSync.ExcludeSyncKeys ¡ 2]^����������������������������` Here's what it looks like if I open it with TextEdit: I've tried changing the encoding in Sublime Text and other apps, but that doesn't help. Any thoughts? I'm running 10.8.4.
Is there a way to get List of Files or FileName which a Process is writing (if possible writing/reading/appending) ,from C# ,which means im talking about Windows (NT,Vista,XP,7).
How do I get the list of open file handles by process id in C#? I'm interested in digging down and getting the file names as well. Looking for the programmatic equivalent of what process explorer does. Most likely this will require interop. Considering adding a bounty on this, the implementation is nasty complicated.
I am building a module on drupal 8 to make a redirection after a form is submitted function form_redirect_form_alter(&$form, FormStateInterface $form_state, $form_id) { $form['actions']['submit']['#submit'][] = 'ptt_contact_form_blocks_submit'; } function ptt_contact_form_blocks_submit($form, FormStateInterface $form_state) { $form_state->setRedirect($route_name); } but for the setRedirect, it needs to have the route name. Like if i want to redirect to node/24, then how can i find the route name of the node? Thanks!
I created a custom module, It generate a custom Form in a page. When I submit my form, I create a new node. So, I am redirect to the form page but I would like be redirect to the new node page. I add this line at the end of my submitForm function : $form_state->setRedirect('node/'.$mynewnode->id()); But when I submit my form from the website, I get the empty-white-screen-of-the-death. My apache log : ... Uncaught PHP Exception Symfony\\Component\\Routing\\Exception\\RouteNotFoundException: "Route "node/153" does not exist. ... And then, when I go manually to the node/153 page, there isn't any problem. The page work well. My question : where is my mistake ? How can I set the redirection after create the new node ? Is it possible from the submitForm function ?
Hi math people in my last question I asked the question $X,Y$ are independent, identical distributed with $$P(X=k) = P(Y=k)=\frac{1}{2^k} \,\,\,\,\,\,\,\,\,\,\,\, (k=1,2,...,n,...)$$ Calculate the probabilities $P(\min\left\{X,Y\right\} \leq x)$ I calculate it correct, here is calculation: $$\begin{split}F_M(x) &= P(\min\left\{X,Y\right\} \leq x) \\ &= 1-P(x<\min\left\{X,Y\right\} ) \\ &= 1-P(x<X, x<Y) \\ & = 1-P(X>x)\,P(Y>x)\\ & = 1-(1-P(X \leq x))\,(1-P(Y \leq x))\\ & = 1-(1-F_X(x))\,(1-F_Y(x))\end{split}$$ But now how calculate expected value of random variable $Z=\min\left\{X,Y\right\}$ So we have $Z = 1-(1-F_X(x))\,(1-F_Y(x))$ Then $$E(Z) = \int_{0}^{\infty}\left(1-(1-F_X(x))\,(1-F_Y(x))\right) \,\,dx$$ Is it good like this?
$X,Y$ are independent, identical distributed with $$P(X=k) = P(Y=k)=\frac{1}{2^k} \,\,\,\,\,\,\,\,\,\,\,\, (k=1,2,...,n,...)$$ Calculate the probabilities $P(\min\left\{X,Y\right\} \leq x)$ and $P(\max\left\{X,Y\right\} \leq x)$ For the minimum I do like this: $$\begin{split}F_M(x) &= P(\min\left\{X,Y\right\} \leq x) \\ &= 1-P(x<\min\left\{X,Y\right\} ) \\ &= 1-P(x<X, x<Y) \\ & = 1-P(X>x)\,P(Y>x)\\ & = 1-(1-P(X \leq x))\,(1-P(Y \leq x))\\ & = 1-(1-F_X(x))\,(1-F_Y(x))\end{split}$$ Is this correct for minimum? I'm not sure how do it for $\max$? Maybe I do it too complicated because they are equal these $P(X=k)=P(Y=k)$ maybe you can do it more elegant? But I don't know how?
how can i aggregate text from different sources for example char * a , * b,* c, *d; a = argv[1] ; b = "something"; c = "another text"; d=b&a&c; //this what i want to know printf("%s",d); output : somethingTESTanother text
I'm working in C, and I have to concatenate a few things. Right now I have this: message = strcat("TEXT ", var); message2 = strcat(strcat("TEXT ", foo), strcat(" TEXT ", bar)); Now if you have experience in C I'm sure you realize that this gives you a segmentation fault when you try to run it. So how do I work around that?
-- in a title is collapsed to —. This probably isn't so great if the title . Is this intended behavior? Running this query on data.stackexchange (I don't claim to be good at SQL): SELECT sum(case when Title LIKE '% -- %' then 1 else 0 end) AS [mdash], sum(case when Title LIKE '% <!-- %' then 1 else 0 end) AS [comment], sum(case when Title LIKE '%[a-z0-9]-- %' then 1 else 0 end) AS [decrement], sum(case when Title LIKE '% --[a-z0-9]%' then 1 else 0 end) AS [increment], sum(case when (Title LIKE '%-- %' OR Title LIKE '%--- %') and Title NOT LIKE '% -- %' and Title NOT LIKE '% <!-- %' and Title NOT LIKE '%[a-z0-9]-- %' and Title NOT LIKE '% --[a-z0-9]%' then 1 else 0 end) AS [uncategorized] FROM Posts I get the following results: mdash comment decrement increment uncategorized 7665 34 368 1752 472 The vast majority of valid uses cases would be unaffected by Tim Stone's proposal
Consider this question: Unfortunately, the question title is displayed on SO as: is `x— > 0 && array[x]` well defined behavior in c++? There are two issues here: Less severe, the backticks are displayed verbatim and don’t delimit a code span. Not very nice but bearable. On the other hand, MathOverflow has this really nice math mode even in titles – why not also introduce this on SO for code? The -- operator is transformed into an em-dash. This is slightly misleading and simply unnecessary. I am all in favour of using SmartyPants (or whatever SO uses) to glam up the question title typography. But this shouldn’t go at the cost of correctness. So I suggest allowing limited Markdown in titles (e.g. as in comments?) or at least fixing the formatting bug.
If I had a XBox One, and a friend of mine had a Playstation 4, would we be able to play GTA Online together?
Grand Theft Auto Online exists on five different platforms: XBox 360, PS3, XBox One, PS4, and PC. Do any of these play on the same servers, allowing people on differing platforms to play together?
How would you monitor a directory on a Linux machine to check if there was a user (or someone from the network) who attempted to access it?
Is there any way in unix to find out who accessed certain file in last 1 week? It may be user or some script ftp it to some other place. Can I get a list of user name who accessed certain file? How can I find out who is accessing particular file??
Apologies if this is a duplicate (or just common knowledge) but I found it hard coming up with a way to search for this succinctly enough to get a definitive answer and I haven't really played a spellcaster before. If I have a warlock level 5, the warlock has slots of 3rd level. If I then put my next level into a sorcerer. Can I select sorcerer spells of up to level 3, or can I only select sorcerer spells of up to level 1 (i.e. the sorcerer level). I understand how spell slots are added between classes etc, I'm just not sure of this one thing. I had a look at the multi-classing section but either didn't see it or didn't understand it when I did see it.
The "Your Spellbook" sidebar for the wizard includes the following line: Copying a Spell into the Book. When you find a wizard spell of 1st level or higher, you can add it to your spellbook if it is of a level for which you have spell slots and if you can spare the time to decipher and copy it. Does this mean that a Wizard 1/Cleric 19 can copy any wizard spell they find into their spellbook? Is there anything preventing them from casting these spells?
method to remove non alphanumerics in a string and display it in a list. public static list<string> s(){ String stg = 'ABC,DEF,GHI,JKL'; List<String> lst = stg.split(','); System.debug('test'+lst); }
In order to store results in the newly released (Winter 16') Platform Cache, I need an alphanumeric string, but currently have a String with the report name that I'm attempting to store, some of which have spaces, hyphens, parenthesis, etc. (i.e. "Sales - Actual Results (TY)"). I'm not sure in APEX how I would strip all these unwanted characters from the string to convert it into the alphanumeric key that I need. Please & Thank you!
How would I go about proving this? Let $X$ be a compact metric space. Let $(f_n)$ be a sequence in $C(X)$. If $(f_n)$ is uniformly convergent, show that $(f_n)$ is both uniformly bounded and equicontinuous.
Let $X$ be a metric space and let $\{ f_n \}_{n \geq 1}$ be a sequence in $C(X)$. Show that if $\{ f_n \}_{n \geq 1}$ converges uniformly on $X$ then $\{ f_n \}_{n \geq 1}$ is both uniformly bounded and equicontinuous. Could I get a hint?
How is the quantity of views a question has received calculated by Stack Overflow? Does the site always check the user's IP Address in the database?
I saw it's not just a page views number, because, if I press F5 several times, it won't increase the number of views. They could store my IP address in a table, but wouldn't that make it slow? They would need to query a database one more time for each request.
When I go to the admin profile in Wordpress, I don't see a place to edit the photo for the admin. Would anyone be able to please suggest to me how to navigate to the place where I can change the admin/user profile photo? Thank you!
Is there a way o changing user's avatar without plugins? Why there's no "Avatar Upload" section in Users > Your Profile? I can't use a plugin. Am I blind or being forced to use Gravatar? ;/
stat -c '%B' * reports the same number 512 for each file. What does %B mean? I don't understand the manual: %B - The size in bytes of each block reported by ‘%b’ Is it related to my block size: $ sudo blockdev --getbsz /dev/sda1 4096 Thanks.
I've noticed that when I do a: ls -ls file It provides block count, say 8 blocks. When I do: stat file I notice that the block count is 16, twice the number given by ls. The block size on my file system is 4096. I learned that the arbitrary unit for blocks used by ls is 1024. Is it correct to say that stat uses an arbitrary unit of 512 bytes when reporting blocks? If so, is there a reason for the inconsistency? I'm running Ubuntu 11.10 on an ext4 file system.
Let $(X, \mathcal{T})$ be a topological space. Suppose $A \in \mathcal{T}$. We define the interior of $A$, the closure of $A$ and the boundary of $A$ as follows: $\operatorname{int}A=\lbrace x \in A\mid A \in \gamma(x) \rbrace$, where $\gamma(x)$ denotes the neighborhood filter of $x$. $\operatorname{cl}A=\lbrace x \in X\mid \forall V \in \gamma(x): V \cap A \neq \emptyset \rbrace$ $\partial A= \operatorname{cl}A \cap \operatorname{cl}(X\setminus A)$ How do you prove that $\operatorname{int}(\partial A) = \emptyset$? I already have that $\operatorname{int}(\partial A)=\operatorname{int}(\operatorname{cl}A \setminus A)$, but how do you continue from this point?
Suppose X is a Metric Space Let S $\subset X$ Prove that if S is Closed then, the Interior of the Boundary of S is Empty Totally stuck on how to solve this.
After seeing both Einstein's theory of relativity ($E=mc^2$) and the formula of kinetic energy (K.E=$\frac{mv^2}{2}$), I noticed that that they are mostly the same, with the only difference that Einstein's theory uses a specific speed, namely of light, while the kinetic formula uses the object's speed. Is the similarity a coincidence, like with density [mass/volume] and concentration [mass of solute/volume of solution]? Was one derived from the other?
The simplest equation expressing mass–energy equivalence is the famous $E=mc^2$ where $c$ represents the speed of light. Compare this with $E_K = \frac{1}{2}mv^2$. Since $E=mc^2$ can be applied to rest mass ($m_0$) and rest energy ($E_0$) to show their proportionality as $E_0=m_0c^2$, I ask whether this resemblance is just a coincidence created by the need of any equation to be homogeneous for units, or are the two equations fundamentally related? I know about but I could not find the answer I'm looking for there.
I know this question has been asked multiple times. I've looked around a lot, but I can't seem to find an answer. I did find this code . But it will not compile, and all the other answers I've seen have been about how to get a single processes cpu/ram usage.
I once had the task of determining the following performance parameters from inside a running application: Total virtual memory available Virtual memory currently used Virtual memory currently used by my process Total RAM available RAM currently used RAM currently used by my process % CPU currently used % CPU currently used by my process The code had to run on Windows and Linux. Even though this seems to be a standard task, finding the necessary information in the manuals (WIN32 API, GNU docs) as well as on the Internet took me several days, because there's so much incomplete/incorrect/outdated information on this topic to be found out there. In order to save others from going through the same trouble, I thought it would be a good idea to collect all the scattered information plus what I found by trial and error here in one place.
I am graduated from mathematics but my degree did not contain any statistics courses. What kind of road map would one suggest to learn statistics if my next goal would be to learn statistics so well that I could help bachelor thesis writers to do the data analysis? For example, is it enough to study the books Methods and Applications of Linear Models: Regression and the Analysis of Variance, Statistical Inference and Introduction to Practice of Statistics?
I know people love to close duplicates so I am not asking for a reference to start learning statistics (as ). I have a doctorate in mathematics but never learned statistics. What is the shortest route to the equivalent knowledge to a top notch BS statistics degree and how do I measure when I have achieved that. If a list of books would suffice (assuming I do the exercises lets say), that's terrific. Yes, I expect working out problems to be an implicit part of learning it but I want to fast track as much as realistically possible. I am not looking for an insanely rigorous treatment unless that is part of what statistical majors generally learn.
I have a piece of code resembling the following (other details omitted for brevity): template <uint First, uint Second, typename T> struct Thing { std::shared_ptr<T> asdf; uint get() const { this->asdf->get_value<First,Second>(); } }; ... producing the following error in GCC 7: error: expected primary-expression before ')' token uint get() const { this->asdf->get_value<First,Second>(); } ^ Clang 4.0.1 reports no warnings with -Weverything (excepting very pedantic things like c++98 compatibility warnings); same thing with GCC 7 and -W{all,extra,effc++,pedantic}. I was previously unaware of ; while the answer to my problem is certainly outlined there, the error message didn't make it plain that was the problem. Supposing I deleted this question and its associated answer, other people searching for this error message will only run across the questions I found -- that is, the ones indicating the problem was caused by passing a type as a function argument instead of passing a value.
In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway? I have the following code: template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail { // ... template<typename U> struct inUnion { // Q: where to add typename/template here? typedef Tail::inUnion<U> dummy; }; template< > struct inUnion<T> { }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> { // ... template<typename U> struct inUnion { char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U }; template< > struct inUnion<T> { }; }; The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?
Android 4.4 comes with an app button in the bottom panel. If it gets deleted, how do I get it back?
I have a Samsung Galaxy S2, running the latest CM10.1. I lost the app drawer icon on my Dock; I must have deleted it. The app drawer icon lets you go to the app list, and the widget list. How do I get the app drawer icon back? The icon looks like a circle with 6 dots inside it.
I am running lubuntu (actually kodibuntu) as my server. whilst attempting to add a package there was an error in the sourceslist. config rendering synaptic package manager useless. I cant change the file as a have no text editor installed (and no way to install one it seems); (I really only have chrome browser that is gui). What is the simplest way to either edit the file in the command line or remove it. I have enabled the root account but am not 100% confident that i will not do something stupid such as make root the owner of my home directory without having gksu nautilus installed. is there a command to undo a change in sources list? I could boot a live cd and edit the file but again this would have me tapping commands in as root and probably break the whole system. if somebody could point me in the right direction it would be appreciated, even just some way to install a text editor. would nano be installed? thanks
I have unistalled and reinstalled the Ubuntu Software Center as per info I found in a similar thread and I got the same response about line 91 or something like that. I just tried to upload a screen shot but since I'm new it won't allow me to. I also can not figure out how to cut and paste anything so I have to hand type what the error screen says, both when I attempt to open the software center and nothing happens, when I try to enter commands into the terminal to uninstall, reinstall, whatever I get the same following: COULD NOT INTITIALIZE THE PACKAGE INFORMATION An unresolvable problem occured while initializing the package information Please report t:his bug against the 'update-manager' package and include the following error message: 'E: Malformed line 91 in source list/etc/apt/sources.list (dist parse) E: The list of sources could not be read., E: The package list of status file could not be parsed or opened. How do I report bugs? What can be done about this. I have searched and everything everyone says to do leads me back to the same line error message. So, I don't know how to get to line 91 in the source list; to tell you what it says. Sorry, I'm really new to this. That is what I need is to find out how to get there and fix what it says. I would really like to NOT have to re partition my hard drive and start from scratch, so I'm really looking forward to getting this problem solved. I need to be able to install new software.
I have an audio file on my Linux system. Let's say a 2 second .wav file. I want to copy the same audio file 50 times into a new b.wav such that the duration of b.wav will be 100 seconds. I tried like this: for i in {1..50}; do cat a.wav >> b.wav; done But it's not working. Please suggest a solution.
The only command line solution for gapless playback I found so far (working with ALSA and JACK) is moc (»music on console«). While I'm still searching for a simpler way I was wondering if it is possible to loop an audio file into a new file for a given number of times? Something like: loop-audio infile.flac --loop 32 outfile.flac for repeating infile.flac 32 times into outfile.flac
How to remove character '\' in NSString IOS For example, NSString *abc = @"bmcvn\nmsf; I have tried: NSString *stri = @"\rdffsdf"; NSString *str = [stri stringByReplacingOccurrencesOfString:@"\\" withString:@"123"]; NSLog(str); but it didn't replace
How to replace a character is a string in Objective-C?
I have two ppa added to my Ubuntu 16.04 installation and would like to freeze the current release that I have thoroughly tested. add-apt-repository ppa:certbot/certbot add-apt-repository ppa:freeradius/stable-3.0 Is there any way to freeze the current version, so that future unattended upgrades don't get the latest which may break the production system? This is how I have setup my unattended upgrades. sed -r \ -e 's|^//Unattended-Upgrade::MinimalSteps "true";$|Unattended-Upgrade::MinimalSteps "true";|' \ -e 's|^//Unattended-Upgrade::Mail "root";$|Unattended-Upgrade::Mail "root";|' \ -e 's|^//Unattended-Upgrade::Automatic-Reboot "false";$|Unattended-Upgrade::Automatic-Reboot "true";|' \ -e 's|^//Unattended-Upgrade::Remove-Unused-Dependencies "false";|Unattended-Upgrade::Remove-Unused-Dependencies "true";|' \ -e 's|^//Unattended-Upgrade::Automatic-Reboot-Time "02:00";$|Unattended-Upgrade::Automatic-Reboot-Time "03:00";|' \ -i /etc/apt/apt.conf.d/50unattended-upgrades echo 'APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Download-Upgradeable-Packages "1"; APT::Periodic::AutocleanInterval "7"; APT::Periodic::Unattended-Upgrade "1"; ' > /etc/apt/apt.conf.d/10periodic service unattended-upgrades restart Ideally, I could test this first on a test system, and when I'm sure that it all works, I could unfreeze the ppa on production to upgrade to the latest and then freeze it again. Is this possible?
How do I limit the updates that are installed to those from a specific set of repositories? Is this at all possible?
Compare $2019^{2020}$ and $2020^{2019}$. I know that $2019^{2020}$ is greater than $2020^{2019}$ but I couldn't prove it. I tried proving $(\frac{2019}{2020})^{2019}.2019>1$ but without success.
Is there any rule for powers so that i can compare which one is greater without actually calculating? For example 54^53 and 53^54 23^26 and 26^23 3^4 and 4^3 (very simple but how without actually calculating)
I have a data like this: 1 0000100101000000 1 0000010100000000 2 1110000001000000 2 1111000000001000 3 0000000111111111 3 1111111100000000 and I want to sum up the values within eachtwo rows with the same row number: output: 1 0000110201000000 2 2221000001001000 3 1111111211111111 any suggestion please? my real dat had 8000 rows with 45000 digit in each line
I have a data like this: input.txt 1 0000100101000000 1 0000010100000000 2 1110000001000000 2 1111000000001000 3 0000000111111111 3 1111111100000000 4 8888345500000000 4 0000000000000000 and I want to sum up the values within eachtwo rows with the same row number: output: output.txt 1 0000110201000000 2 2221000001001000 3 1111111211111111 4 8888345500000000 any suggestion please? my real dat had 8000 rows with 45000 digit in each line
So I'm trying to find a solution for the equation $$(65!)^2\equiv x\:(\text{mod}\: 131)$$ I'm given the hint to use Wilson's Theorem which states, that for a prime $p$ we have $(p-1)!\equiv -1\:(\text{mod}\:p)$. The only thing I've managed to so far is insert my number in Wilson's Theorem: So I get $(130!)\equiv -1\:(\text{mod}\: 131)$. From here on I have no idea what to do. Any help would be appreciated. Apologies for any english errors.
Suppose that $p$ is a prime. Suppose further that $h$ and $k$ are non-negative integers such that $h + k = p − 1$. I want to prove that $h!k! + (−1)^h \equiv 0 \pmod{p}$ My first thought is that by Wilson's theorem, $(p-1)! \equiv -1 \pmod{p}$, and $h!k!$ divides $(p-1)!$ (definition of a binomial). Where would I go from here?
Is there a global timer for Stack Overflow?
What time zone do Stack Overflow's servers operate in? I noticed that it couldn't be my time zone, or the ones before me (I'm in North American Eastern Time), because I logged into SO earlier today (around 12 pm), then I logged in just a few minutes ago (around 8 pm), then about a minute later I got the Fanatic badge (yay me!).
I'm trying to find the title of a sci-fi short story I either read or saw on TV - the plot is generally about possibly invisible (I might be wrong about that) people who build the future by re-creating our surroundings in boxcars on a train.
Does anyone know a SF TV short story in which there were blue men who helped "stage" our world- at least the parts we saw, on a minute by minute basis. So, at each minute, everyone would be in the "world" that was built for that minute, then they would go on to the next "minute world". The blue men were in the future minutes building most of reality, but only the parts that would be looked at at that minute (to save work, I think - why build something that will not every be "used") And they were in the past tearing down all the previously lived minutes. It was kind of a behind the scenes look at why when you set your keys down and come back to them, they aren't there. Then you look again a few minutes later and they are there. The reason in the show was that the blue men building that minute forgot to include your keys, but the next group got it right. Years later, my wife and I still refer back to that show, so I would like to find out what it was and see if I can find a copy somewhere. .
I'm having trouble showing procedural textures (Checker Texture in particular) in 3d View. I can see it in render, but neither Material/Texture/Solid viewport shading helps to see in 3D :( is a screenshot with my issue. Please help.
So I'm trying to learn, but I have a really hard time understanding the relation between materials, textures, UV maps and so on. So right now I have the following problem: I'm trying to make a simple red texture be a bit grainy using a noise texture. The node setup can be seen in the screenshots below. It works fine if I view it in rendered mode (I'm using the cycles engine) or export a screenshot, but the object appears completely black in material mode: So this is probably a very stupid question, but do you mind telling me how I can fix this? Thanks!
I am a psychology student. My GPA is quite low: 3.6 for first 3 years but 2.8 for last 3 years ( I spent 6 years in undergrad because I transferred and lost 2 years of credits). However, I will have a publication in psychology and strong letters of recommendation from professors. The low GPA is my major weakness... I am wondering if a good score in GRE sub (like 95 percentile and above) would compensate for my GPA? Thanks in advance!
When applying to a PhD program in the US, how does the admissions process work? If an applicant is weak in a particular area, is it possible to offset that by being strong in a different area? Note that this question originated from this . Please feel free to edit the question to improve it.
Let $a,b$ and $c$ be the lengths of the sides of a triangle. Prove that $a^2b(a-b)+b^2c(b-c)+c^2a(c-a)\ge 0$. Determine when equality occurs. We know that if $a,b,c $ are the sides of a triangle then we can let $a=x+y$,$b=y+z$,$c=z+x$. After that I put the values of $a,b,c$ in the given expression and I found $2(xy^3+yz^3+zx^3)-2(x^2yz+xy^2z+xyz^2)$. So my target is to prove this expression is greater equal to $0$
For any triangle with sides $a$, $b$, $c$, prove the inequality $$a^2b(a-b)+b^2c(b-c)+c^2a(c-a)\ge 0 .$$ This is IMO 1983 problem 6. I tried substituting $a=x+y$, $b=y+z$, $c=z+x$ but well it doesn't help in any sense except wasting 3 pages that lead to nothing (please don't mind the joke). Using $a=2R\sin A$, $b=2R\sin B$, $c=2R\sin C$ also didn't lead to anything for me. Could you give me a hint for finding the proper substitution?
I don't understand why I can't print the address of the pointer. I know it's pretty fundamental to understand pointers, so any help is appreciated. void printp(int& test) { cout << test << endl; } int main() { int *p = new int; *p = 1; int np = 0; // printp(p); // why doesn't this print the address of p? // printp(&p); // why doesn't this print the address of p? printp(*p); // prints 1 printp(np); // prints 0 return 0; } I get the below error when I try using 'printp(p)'. test.cpp: In function ‘int main()’: test.cpp:17:10: error: invalid conversion from ‘int*’ to ‘int’ [-fpermissive] printp(p); // why doesn't this print the address of p? ^ test.cpp:5:6: note: initializing argument 1 of ‘void printp(int&)’ void printp(int& test) ^~~~~~ test.cpp:17:10: error: cannot bind rvalue ‘(int)p’ to ‘int&’ printp(p); // why doesn't this print the address of p?
I know references are syntactic sugar, so code is easier to read and write. But what is the difference between a pointer variable and a reference variable?
I have build a Drupal site on my local development server and I am preparing to move it to my test server and eventually my live server. I know where to find the database settings in my settings.php file, but there only appears to be one set of database configurations. I would like to know if there is a good way to include three different database settings in my settings.php file, one for my development environment, one for my test server and one for my live server. I could simply add a settings section to the file for each and simply comment out the ones that I am not using, but I would like to use an automatic solution, one that can either allow me to specify a setting for all three locations, or tries each setting until it finds a setting that works.
Basically, one of the greatest questions of all time: What are some ways you're using settings.php in your development/staging workflow? Right now, I have my settings.php file set up like the following, and I base my development on the server's $HOST directive—meaning I can work on dev.example.com for the development (shared) server, local.example.com for my local computer (and other dev's local code checkouts), and www.example.com (or just example.com) for the live site. (This code is in the 'Database settings' section of settings.php): $host = $_SERVER['HTTP_HOST']; $base_url = 'http://'.$host; $cookie_domain = $host; switch($host) { case 'example.com': # Production server $db_url = 'mysqli://prod_sql_user:[email protected]/prod_db'; $update_free_access = FALSE; $conf = array ( // Set production config options here... 'example_setting' => 0, ); break; case 'dev.example.com': # Development server $db_url = 'mysqli://dev_sql_user:[email protected]/dev_db'; $update_free_access = FALSE; $conf = array ( // Set production config options here... 'example_setting' => 0, ); break; case 'local.example.com': # Local server $db_url = 'mysqli://local_sql_user:[email protected]/local_db'; $update_free_access = FALSE; $conf = array ( // Set production config options here... 'example_setting' => 0, // Turn off most core caching. 'cache_inc' => 'includes/cache.inc', 'cache' => CACHE_DISABLED, ); break; } ?> This works pretty well for most purposes, but it means we have a lot of extraneous code sitting around in our shared settings.php file... is there a better way?
Seonaid! I often use your It is very helpful. Now I need your personal help. Please can you help me? I am an English teacher and I have a question about something, which I don't know/ understand. This is a sentence from a test: Complete the sentence with the correct form of the verb. Don't you wish you ....................... a year off before going to university? (take) The correct answer is had taken, according to the test key. My question: How do we know, that here we speak about past situation? Otherwise we could use also took. This is form English in Mind, book 4, entry test, Cambridge, by Sarah Ackroyd. I live and work in Bulgaria, in a small town. If my students ask me this question I do not know what to say. Please, write me soon. Krasimira Kuzeva facebook: Krasimira Kuzeva Kripadhara
Another read I come across in which a guy has written, "I wish you could see that young restless orphan who has no house to live in, none to get food from, whose pshychological centre has been damaged to the hilt. I wish you could see the pain of that abandoned girl on road who has set huge ambitions, but not priviliged enough to reach them, whose each tear drop brings earthquakes in the place on which it has fallen. I wish some magic happens and brings back all your lost senses and you start loving each and every human being going through hardships. Is this at all correct to say happens after wish as the author has written above? The writer is Indian. Not native.
Is there any problem in mathematics that is proved not independent of ZFC but the problem itself is not proved yet?
We know there are statements that are undecidable/independent of ZFC. Can there be a statement S, such that (ZFC $\not\vdash$ S and ZFC $\not\vdash$ ~S) is undecidable?
If I have a RAID 1 and some bits on one hard disk flip due to error, how does the raid controller know which of the two disks contains the correct bits?
I've built a RAID 1 array of 2 disks, A and B. That means that every bit on A is equal to a bit on B. If one disk fails, I can safely retrieve my data from the other disk. But then I started wondering: How true is this? Let's say a bit 1 on A reads 0, but 1 on B. How would the RAID controller be able to tell, which one is corrupted and which one is not? Is this based on what the so called "S.M.A.R.T." technology reports, and is that really worth anything, or would I be just as well of with a non-RAID solution? I can see why this is not a problem on RAID 5, so I'm planning to upgrade.
Blender's default behavior makes it easy to select a mesh element without the need to hover the mouse cursor exactly over it. Sometimes it's really helpful, sometimes not. I wish I could either adjust that "hotspot" distance between my mouse cursor and the mesh element I want to select or disable it altogether. Thank you.
When selecting components, is there a way to control the "selection distance/area"? I don't want to select a component, even if I click ~20 pixels away from it. Thanks in advance!
I have been using this to set up a mailserver and webmail for my company. I have followed all official instructions in order to avoid emails ending in spam-folders: SpamAssassin validates my emails SPF (my server xx.xx.xx is authorized to use the mail-address) DKIM signature is valid Message parsed DMARC test Reverse proxy is working Mails from my server scores a solid 10/10 on Problem: Emails send by my server ends up in spam-folders, tested on Yahoo and Hotmail (works on gmail). My test looks like this: Question: What can I do to avoid ending up in spam-folders? Please note: Even though similar questions has been asked on serverfault, I have not found a solution to this problem.
This is a about how to handle email sent from your server being misclassified as spam. For additional information you may find these similar questions helpful: Sometimes I want to send newsletters to my customers. The problem is, that some of the emails get caught as spam messages. Mostly by Outlook at the client (even in my own Outlook 2007). Now I want to know what should be done to create "good" emails. I know about reverse lookup etc., but (for example), what about a unsubscribe link with an unique ID? Does that increase a spam rating?
I came up with this when trying to prove embeddings of $L^p(0,1)$ spaces. Suppose $U =(0,1)$ (or more generally a bounded subset in $\Re^n$). Is the mapping $\phi = p \mapsto \|f\|_{L^p(U)}, \phi: [1,q] \rightarrow \Re$ continuous? Any ideas or counter examples? Edit: This is not a duplicate with because of different assumption on $f$!
Suppose that $\|f\|_p &lt \infty$ for all $1\leq p &lt p'$, I want to know if the the following is true and in that case how to show it $p \mapsto \|f\|_p$ is continuous on $[1,p')$ Or maybe we need to impose some more constraints such as finite measure space. In case of finite measure space, I tried to use .
I'm stuck on Ubuntu 15.04, i followed some outdated guide on Reddit to update from 15.04 to 15.10 and screwed up my /etc/apt/sources.list, i get a bunch of the following when trying to update: W: Failed to fetch http://mirror.cogentco.com/pub/linux/ubuntu/dists/wily-updates/multiverse/binary-i386/Packages 404 Not Found So how do i update from 15.04 to 15.10 and eventually to 16.04? My dedicated server provider only offers 14.04, 14.10 and 15.04 on prebuilt servers so i cant freshly install it.
Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found: $ sudo apt-get install vlc Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package vlc
I can't get a div #buttonwrap to center on my site. I have tried every option that is suggested in . But it still doesn't work. And what is strange is that #backgroundwrap works fine with the same code. I have linted my CSS and HTML markup, but no help. Hope someone can help me solve this issue, it has been driving me crazy and delete nearly all my code! The full code is online here: .buttonwrap { margin: 0 auto; position: relative; width: 100%; display: block; float: none; } /* parent */ #container { width: 100%; height: 100%; }
How can I horizontally center a <div> within another <div> using CSS? <div id="outer"> <div id="inner">Foo foo</div> </div>
I have two functions of very similar construction. The first creates a 3D list of dicts and adds data (the data consisting of the values of the three iterators used to construct the list). The second simply displays the dict data. The issue is that data displayed by the second function is wrong. Instead of showing values of the iterators increasing as expected: (0, 9, 19) (0, 9, 20) (0, 10, 0) (0, 10, 1) (0, 10, 2) I end up with the maximum value of the iterators being displayed: (0, 12, 20) (0, 12, 20) (0, 12, 20) (0, 12, 20) (0, 12, 20) Code as follows: xCount = 13 yCount = 21 numPages = 1 skip = [[4, 7], [4, 13], [8, 7], [8, 13]] def createFrames(): frameData = {'textFrameName': ''} framesData = [[[frameData for y in range(yCount)] for x in range(xCount)] for p in range(numPages)] for p in range(numPages): for x in range(xCount): for y in range(yCount): skipFrame = False for entry in skip: if entry[0] == x and entry[1] == y: skipFrame = True if skipFrame == False: framesData[p][x][y]['textFrameName'] = str(p) + ', ' + str(x) + ', ' + str(y) print(framesData[p][x][y]['textFrameName']) # shows p, x, y incrementing return framesData def displayData(framesData): for p in range(numPages): for x in range(xCount): for y in range(yCount): skipFrame = False for entry in skip: if entry[0] == x and entry[1] == y: skipFrame = True if skipFrame == False: print(framesData[p][x][y]['textFrameName']) # shows 0, 12, 20 only # Create text frames. framesData = createFrames() # Add data to dictionaries. displayData(framesData) Using python 2.7.16.
I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3 The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] Then I changed one of the innermost values: my_list[0][0] = 5 Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?
I need to have a form with the normal questions, in addition to having respondents attach or download a file. Is this possible?
I need to make a Google Doc Form, in which the users need to upload a Word file. Is it possible to do so using Google Docs form? If yes, then how?
I am reading the book: Inequalities by Hardy, Littlewood and Polya. There are two inequalities at the page number 32: (1) $(a_1+a_2+\cdots+a_n)^r\le a_1^r+ a_2^r+\cdots+a_n^r$ where each $a_i>0$ and $0<r<1$. (2) $(a_1+a_2+\cdots+a_n)^r\ge a_1^r+ a_2^r+\cdots+a_n^r$ where each $a_i>0$ and $r>1$. How can we prove these inequalities. ? Many thanks for your help.
I am looking for a proof that this inequality: $$(W_1+W_2+\cdots+W_n)^a \leq W_1^a +\cdots + W_n^a$$ is valid. I have a power function $f(W)=W^a$ where $a$ is a real number, constant but usually $0\lt a\lt 1$. The $W_i$ are real positive numbers. Then I want to check if $\left(\sum W_i\right)^a \leq \sum(W_i^a)$ For example for $n=2$ : $(x+y)^a \leq x^a + y^a$. Thanks.