So I'm understanding that the bid is the price buyers are willing to pay for a stock, and ask is the price sellers are willing to sell for.  But what if there are no limit orders... only market orders.  So buyers and sellers haven't set any limits on what they're buying or selling for. What is the bid and ask in this situation and what happens? Thanks in advance.

Note: This question is erroneously marked as a duplicate. It concerns a very specific situation with unfulfillable market orders in very illiquid markets, one that no other discussion here has covered. Related questions are addressed at the end.  TL;DR This is the entire order book:  __________________________________________________ |___________Buy__________|__________Sell__________| |  Time |  Price | Quant |  Time |  Price | Quant | |       |        |       | 10:05 | market |   1   | |       |        |       | 10:00 | $10.00 |   1   | |_______|________|_______|_______|________|_______|   There's an incoming buy order for 1 share, limit price $11. Which order gets matched and at what price?    With the above order book, if someone came in and placed a buy order for 1 share at limit price $9, I assume it matches the market order and trade is executed at $9. Straightforward. If instead the buyer placed a buy order with limit price $11, would it match the limit order or the market order?  Answering by determining "price" of unfulfilled market order  When the incoming order is a market order and there are only limit orders on the books, it's clear how to price it: based on the best bid or ask. But that doesn't help us here.  One option is that if we can figure out what to consider as the "price" for the unfulfilled market order on the books, we can decide based on price/time priority.  The possibilities are:   Price market order at best ask: $10. Now we have two orders at the same price, so the earlier-placed one gets it: the limit order. But this seems unfair. The trader placing the market order is clearly willing to go below $10, so they should get the trade! Price market order at best bid: $11 or undefined? On the one hand, the incoming buy order is at $11, but on the other hand, by definition an incoming order isn't on the books yet, so there is no "best ask". If it were $11, the buy order would be matched with the $10 limit order, even if the market order had been placed first! Seems unfair that an earlier-placed market order would lose out to a limit order. Price market order at last traded price: let's say $11. Again the market order would unfairly lose out to the limit order here. Price market order at $0.01 better than best ask: $9.99. Okay, this works. But we can't simply treat it as limit price $9.99 because this market order would match an incoming buy order with limit price $9.   Always matching market orders first  As @Dheer's answer suggests, one approach is to simply match market orders first no matter what. This makes a lot of sense, though we still need to figure out at what price does the trade executes. Clearly not the buyer's limit price of $11, because they'd get a worse deal than the limit order on the books. So, $10? $9.99? Last trade price, or opening price (but no more than $10)?  What if the incoming buyer placed a market order instead. At what price do you match two market orders - same as the answer to the above?  I guess this comes down to specifications for individual exchanges, but I'm wondering if there's a standard here or a way to approach it from basic rules that clears up all these situations.    Edit: Some specifics of how limit orders are matched is discussed at  This question is not a duplicate of that - my question is specifically about how an incoming limit order is matched when the other side of the order book has an unfulfilled market order. This case is not discussed at all by various existing questions, which only discuss matching incoming orders when there are sufficient limit orders already on the books.  Other relevant discussions that don't directly address these questions but are good background reading:         Another edit:  According to this answer , some or all markets will reject incoming market orders if there are no orders on the books to match it to, so the situation I describe in this question wouldn't be possible in the first place. I don't have any sources to back this up but if someone can confirm or contradict this we can probably settle this question.


Sorry for the format, but im trying to do this on my smartphone since my ubuntu is down lol. I am trying to run the command sudo apt-get purge nvidia-current in the root shell prompt but I am getting a few errors since I'm not in write mode. How do I fix this? My computer keeps booting to a blank screen right before asking for my login after I recently tried updating my nivida drivers.

When booting to the graphical desktop fails we sometimes are recommended to boot into a "root shell" or to boot in "recovery mode".  How do I do that?


Let $X$ be a random variable on a probability space $(\Omega,\mathscr F, P)$. Define a new probability measure $$\tilde P(A) =  E[1_A X]$$ for all $A\in\mathscr F$. Let $\tilde E$ be expectation taken with respect to the new measure $\tilde{P}$.  Suppose now that $Y$ is also a random variable $(\Omega,\mathscr F)$. Then intuitively the expectation should be computed as $$ \tilde E [1_A Y] = E[1_A YX], $$ but I'm not sure how to prove this rigorously using the definition.

How do I prove the following? I don't know where to start.     If $X$ is a random variable with $E^{\mathbb P}[X] = \mathbb P(X>0)=1$   and $ \mathbb Q$ is the  probability measure defined by $ \mathbb Q(A)=E^{\mathbb Q}[X1_A] $ then $E^{\mathbb Q}[Y]=E^{\mathbb P}[XY]$


While reviewing a suggested edit on , I noticed that the question's title has a long, non-breakable word in it (specifically, com.example.accountproject.models.interfaces.MemberSv, a fully qualified Java class name). This causes the text of the two side-by-side posts to overlap:

In the suggested edit review queue, it seems if the title of a question contains a very long word it will overflow into the right column. This is the .  Using Windows 10, Firefox 87.0 (64-bit), 1920x1080.


I have seen a few questions which have been marked as duplicate although they the questions have been asked before the question they are marked duplicate of.  For eg,   (I will call this as Q1) has been marked duplicate of  (I will call it Q2). But as you can see that Q1 is asked a year before Q2, then how can it be flagged as a duplicate?  Another example -    and  and the Q1 has been asked 2 years before Q2.  Isn't it necessary that the time of asking should be considered before marking a question as duplicate.  But also what I can see is that the newer question has better answers than the older ones. But this is unfair to the asker.  How should StackOverflow deal to such problems?   One solution of which I could think of is merging questions. I know that moderators have merging question permission but it's hardly used and according to me, it should be done on every question marked as duplicate.  So instead a marking a question as duplicate and closing it, merge the questions together. Older reputations earned by the question should be retained by the user while newer ones earned after merging the question should be retained by the person who asked the question earlier. This might probably work on all the questions marked as duplicate, so when a user clicks on link of question which is marked as duplicate, he should be redirected to the original question (message of redirection could be shown). Answers should be merged too.  This will prevent users from earning free reputation by rephrasing a question.

I have seen this many times, a question is being asked because a previous, duplicate question was asked and answered a few years ago and has no longer relevant answers.  The  is to edit the old question, or add new answers to it, but it is not always happening.  I was wondering, should I still mark it as duplicate and vote to close it? Or just leave it as is?


Can you run 4.15 kernel on Ubuntu 16.04? The broader question is what is the relationship between kernel versioning and OS versioning? When do you need to upgrade your OS to run a new kernel? I am pretty sure I'm running kernel 4.15 on Ubuntu 16.04 but that doesn't make sense to me since Ubuntu 18.04 uses Kernel 4.15 also.

I see the  package as part of the kernels you can install in Ubuntu.  What is hardware enablement (HWE)?


I have an ASUS 11.6 laptop and the processor is Intel Celeron N4020. Will it work on the newest version of Ubuntu?

I have a device on which I would like to install Ubuntu. How do I find out if Ubuntu will work on it?


If I have two of the same Pokemon but with different CP but the same progress on their CP bars and I decide to evolve both, do they both receive the same CP boost directly from the evolution or does it vary by it's original CP?

I was just wondering if there is a set amount of CP gained by evolving a Pokémon or is it based on their level? Your level? Or random?  I just wanted to know if for example it made sense to evolve a Pidgey (CP 150) to a Pidgeotto then a Pidgeot.  To maximize my CP or should I just evolve my Pidgeotto  (CP162) to a Pidgeot.  Just looking for other insight on it.


I am using AES/CBC to encrypt my http cookie. I never encrypt the same cookie value twice so my understanding is I don't need to use a random initial vector - using a fixed initial vector is fine for this case. A random initial vector is needed if we may encrypt the same message more than one. Is my understanding correct for my case?

I have a need to encrypt credentials for a third-party app used by a secured internal app. Over on ITSec.SE, I was helpfully shown a scheme to encrypt the third-party credentials based on a hash of the credentials for the internal app.   I picked AES as the encryption algorithm, but the problem is that the password-based scheme doesn't produce a "secret" IV. So, the IV must at least be known to an attacker (stored alongside the encrypted data). A hash value used for password verification could work, or I could just generate a pseudorandom byte array and drop it in the DB as a new column. I was further considering, for simplicity, to use a constant IV.   What adverse effect will either of these choices have on the security of the encryption? Does AES depend, as many block ciphers do, on an unpredictable IV? Does it matter if the IV is stored as unencrypted plaintext?


In my differential equations book, we are trying to prove the linear dependence of a set of $3$ functions. We start with   $$c_1x^2+c_2x^3+\dfrac {c_3}{x}=0$$  Then the book says to differentiate twice, and get the following two equations  $$2c_1x+3c_2x^2-\dfrac{c_3}{x^2}=0$$  $$2c_1+6c_2x+\dfrac{c_3}{2x^3}=0$$  We set $x=1$ and go on to solver for $c_1, c_2, c_3$ and show that they all must be $0$.  However, why are we allowed to differentiate equations containing only one variable? If I have the equation $2x=5$ and differentiate both sides, I get $2=0$. The only way out I can see is if we temporarily consider $c_1, c_2, c_3$ as variables, but if that were the case then why aren't we seeing any $\dfrac {dc_1}{dx}$?

Let's say we have $x^2=25$ So we have two real roots ie $+5$ and $-5$.  But if we were to differentiate on both sides with respect to $x$ we'll have the equation $2x=0$ which gives us the only root as $x=0$.  So does differentiating on both sides of an equation alter it? If it does, then how do we conveniently do it in Integration by substitutions? If not then what exactly is going on here ?


I've just installed Ubuntu 19.04 and I'm installing all my normal sofware.  I've noticed that many apps have mutilple versions/sources.  How would I tell which ones are official?  Some are from ubuntu-disco-universe and others from Snap Store.  Some have a developer listed and others don't.  Some packages have different developers for each version.  For example I have these two options for kdenlive:  kdenlive   - Version: 16.12   - Developer: j-b-m   - Source: Snap Store   kdenlive  - Version: 4:18.12.3a-0ubuntu1  - Developer: ...BLANK...  - Source: ubuntu-disco-universe   Edit:  I'm specifically trying to avoid potential malware or trusted software.

When I search for Chromium in Ubuntu Software on Ubuntu 16.04, There are 2 options.    Which one should I select?    The same can be observed with , ,  etc.


rise: wages: an increase in wages(= raise American English)  raise: an increase in the money you earn(= rise British English)  I have extracted those from Longman.  So, are the bold terms are interchangeable in this situation?

I am wondering if there is any difference between the bold parts? these are extracted from Longman:  rise:  increase:  to increase in number, amount, or value [= go up; ≠ fall] raise: increase   to increase an amount, number, or level [≠ lower]:


Link:  What I'd like to do is make it so the text that appears on top in the dark green bar would appear vertically aligned to the image, and not this weird alignment that I can't figure how I've made... Here is the html:   @media screen and (max-width: 425px){   #message{font-size:10px;}   .shippingimage{display:none;} } .ShowHide {   overflow: hidden;   background-color: #2a4735;   color: white; } #left-showing {   overflow: hidden; } #right-showing {   float: right;   width: 30px;   text-align: center; } .ShowHide a {    color: white;    text-decoration: none; } .ShowHide a:hover {    text-decoration:underline; }

     X

I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS needed for this to work on all common browsers?

testing...


There is an alignment issue in the search result screen. The term     results found containing "search criteria"   is not aligned properly. For sample search with .  Screenshot for reference:    When compared with Stack Overflow due to the following CSS class absence, the alignment issue occurred.  .container #content {     padding: 24px 15px; }

Search for ,        ,                        and you will see that "results found containing __" is just a little too close to the header. It's not like there isn't  to have it be a little lower, closer to "Search":          The UI has been updated since I took the above screenshots, and the text you search for is  (which fixes another design issue but not the one in this question):


Einstein theorized that gravity is a phenomena manifested by the curvature of spacetime, in effect it IS the curvature of spacetime.  If this is so, why do we need a graviton to convey the force of gravity? If I have mis-understood Einstein then I would appreciate a little help in grasping the relationship between warped space and gravity.

What I am interested to see are specific examples/reasons why gravity should be quantized. Something more than "well, everything else is, so why not gravity too". For example, isn't it possible that a quantum field theory on curved space-time would be the way treat QFT and gravity in questions where the effects of neither can be ignored?


This problem is an updated version of  and I found it interesting for myself I would like no if the following limit exists or not. $$ \lim_{x\to a^-}(x-a)\left\lfloor \frac{1}{x-a}\right\rfloor $$ Here the interesting fact is that we have the singularity at $x =a$ which not the case  Any idea,?

Does $\lim_{x \to 0+} \left(x\lfloor \frac{a}{x} \rfloor\right)=a?$   I'm going to say this statement is false, and try to use the properties of limits  $$\lim_{x \to 0+} \left(x\lfloor \frac{a}{x} \rfloor\right)=\lim_{x \to 0+} x.\lim_{x \to 0+}\lfloor \frac{a}{x}\rfloor$$ =$0.\infty$ which is undefined.  Or is it $\infty $ because x ends up being a little bigger than 0?


I am trying to generate random integers over the range (-32768, 32767) of the primitive data type short. The java Random object only generates positive numbers. How would I go about randomly creating numbers on that interval? Thanks.

How do I generate a random int value in a specific range? I have tried the following, but those do not work: Attempt 1: randomNum = minimum + (int)(Math.random() * maximum);  Bug: randomNum can be bigger than maximum. Attempt 2: Random rn = new Random(); int n = maximum - minimum + 1; int i = rn.nextInt() % n; randomNum =  minimum + i;  Bug: randomNum can be smaller than minimum.


I already watched the 1995 movie before thinking about deciding on an order since that movie started it all (in the anime part, of course the manga came first) but in which order should I continue viewing them?

As the title suggests, I want to start watching Ghost in the Shell. But I have seen many different ones and dont know if they're all part of the same series etc.  What are some suggestions for where to start the series?


This site has many issues. Even though they have very good things for asking a good question / good answering, but here are some experts who have gained some privileges to ban any person.   This is not good. There are some people who do this very constantly, so experts, I can say, if you have knowledge, share and correct question of users. Users can ask anything, don't forget you were on same stage when you say to the user, what kind of question is this, or downvote the question or ban it.  So take it easy and let users ask the questions they need.  I have seen this, I asked one question and I was banned, same question was asked by another person and his was answered.   So help with this all, especially for ColdFusion developers.

If you are reading this, you may have been affected by one of our post quality bans. If so, it is important that you  to understand what has happened and how to regain the permissions that you lost. While trying to ask a question, one could see:  We are no longer accepting questions from this account. See  to learn more.  Likewise, for answers:  We are no longer accepting answers from this account. See  to learn more.   Why am I getting this message? Are deleted posts taken into account too? Is a question/answer ban the same as a suspension? How do I avoid getting a question ban? How long do I have to wait before I can post again? What can I do to release the ban? How can I reactivate my account? Can I simply create a new account? I'll just ask somewhere else on the SE network, and they'll migrate my question to the correct site! Will a ban on one Stack Exchange site affect my standing on other sites in the network? Does this apply to meta sites too? My account is in good standing. Why am I still blocked?


I am a Physics major interested in logic, but I cannot seem to find how to put the rules together for a proof. I am reading a book that uses a tree-style!

Allowed inference rules: ∨-I, ∨-E, ∧-I, ∧-E, →-I, →-E, ¬-I, ¬-E  I tried to prove a contradiction by assuming $¬ ((P → Q) ∨ (Q → P))$ but got stuck, or am I doing it in the wrong way?  Edit:  My proof attempt  $1.\qquad¬ ((P → Q) ∨ (Q → P))\qquad \qquad\qquad\qquad\qquad\qquad\qquad \qquad\qquad Assum$  $2.\qquad P → Q\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad\  Assum$  $3.\qquad(P → Q) ∨ (Q → P)\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad\; ∨-I(2)$  $4.\qquad(¬ ((P → Q) ∨ (Q → P))) ∧ ((P → Q) ∨ (Q → P))\qquad\qquad\qquad\; ∧-I(1,3)$  $5.\qquad  ¬ (P → Q)\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad\;\;\; ¬-I(2,4)$  $6.\qquad  Q → P\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad \qquad\qquad\qquad\quad\; Assum$  $7.\qquad  (P → Q) ∨ (Q → P)\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad\;\; ∨-I(6)$  $8.\qquad  (¬ ((P → Q) ∨ (Q → P))) ∧ ((P → Q) ∨ (Q → P))\qquad\qquad\qquad\;\; ∧-I(1,7)$  $9.\qquad  ¬ (Q → P)\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\; ¬-I(6,8)$  $10.\qquad ¬ (P → Q) ∧ ¬ (Q → P)\qquad\qquad\qquad\qquad\qquad\qquad\;\qquad\qquad\quad\;\;\, ∧-I(5,9)$  Stuck at this line, can't spot any contradiction to line 1


Is it possible to search every field of particular table for a list of values in Oracle.The requirement is to extract all details from table that matches against the list in any column of the table.The table holds huge amount of data and I require to extract the data for a period of 6 months

Is it possible to search every field of every table for a particular value in Oracle?  There are hundreds of tables with thousands of rows in some tables so I know this could take a very long time to query. But the only thing I know is that a value for the field I would like to query against is 1/22/2008P09RR8. <  I've tried using this statement below to find an appropriate column based on what I think it should be named but it returned no results.  SELECT * from dba_objects  WHERE object_name like '%DTN%'   There is absolutely no documentation on this database and I have no idea where this field is being pulled from.  Any thoughts?


I've just finished my fourth year (out of 5) of biology studies in one of European universities. I have some experience in research and my grades are quite ok (in US scale it would be 3.75, which means I'm in 5% of the best students in my university). This year I'm starting my master thesis and I expect it to be rather successful - I have interesting topic and good supervisor, with whom I have good contact. This year I'm also starting new studies in electrical engineering and I would love to work in biomedical engineering.  There are several PhD programmes I would like to join abroad (mainly US, UK and Germany). However, I have just got my grade for a research project from spring semester, which is really bad (C+). It is my only grade lower than B, but since it's in research (actually, it's my only grade in research), I'm afraid that it might be a big obstacle in admission process. I'm not a kind of person who blames everyone for my failures, but this time I cannot explain it in any other way than bad supervisor who didn't like me. I've learnt many methods during this project and I've done the worst job for the research group. I've also learn a lot about research in general by seeing my supervisor's mistakes. That is why I'm really happy about this experience, but it doesn't change my grade.  My question is: is there anything I can do to make this grade seem less important or to explain it to admission committee? I'm pretty sure that "Supervisor didn't like me" is not what they want to hear.

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.


I asked a question on SO:  and got an answer that, while good, I thought could be improved with a minor edit:   After a little while, a comment on the answer showed me that I was wrong to have edited the answer.  How do I undo it?

Edits made by users who do not have edit privileges are placed in a queue until it is peer reviewed.  E.g., I edited someone else's answer. but changed my mind. If I'd edited my own question/answer, there would be a "Rollback" button, but there's no such button in the scenario I'm describing (at least none that I can see).  This is more relevant today because users can only have at most five edits waiting in the queue, and allowing one to cancel an edit would permit them to free up one of their five pending edits for something else.  Is there a way to remove one's edit from the peer review queue?


I prepared following SQL statement: SELECT tasks.name, profiles.email, types.specification,     tasks.description, tasks.attachment_link, tasks.priority,     assigned_tasks.progress_details, assigned_tasks.activation_date,     assigned_tasks.expired_date   FROM profiles, types, tasks, assigned_tasks  WHERE profiles.id = assigned_tasks.profile_id  AND assigned_tasks.task_id = tasks.id  AND types.id = tasks.type_id ORDER BY tasks.name;  I want show in view gruped tasks with assigned email. Something like this:   I see records with single assignments, task names are duplicated. I want to show e-mail list in owner cell in table - it is possible? Python return touples: ('Backend', 'agnieszka.lasota1@gmail.com', 'Database managment', 'Create serwer full backend and copy data to SSD 1TB', 'NULL', 2, 'to do - 0% progress', datetime.datetime(2021, 6, 1, 10, 18, 36), None) ('call to customer', 'wolnygosc@interia.pl', 'IT online support', 'answer for questions about cloud', 'https://dianet.pl/cloud/index.html', 1, 'TO DO', datetime.datetime(2021, 6, 1, 14, 57, 23), None)  I want something like that: ('Backend', ('agnieszka.lasota1@gmail.com', 'wolnygosc@interia.pl'), 'Database managment', 'Create serwer full backend and copy data to SSD 1TB', 'NULL', 2, 'to do - 0% progress', datetime.datetime(2021, 6, 1, 10, 18, 36), None)  Two users might be assign to one task I want show it in HTML table. How split records ?

We have a question related to a DB query :   CREATE TABLE `Action` (   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,   `emp_Id` int(10) unsigned NOT NULL,   `name` varchar(60) NOT NULL,   `updated_action_at` datetime(3) DEFAULT NULL,   `created_At` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,   `notes` varchar(400) DEFAULT NULL,   PRIMARY KEY (`id`),    KEY `action_empId_fk` (`emp_Id`),    CONSTRAINT `action_empId_fk` FOREIGN KEY (`emp_Id`) REFERENCES `Employee` (`id`) ON DELETE CASCADE,  ) ENGINE=InnoDB AUTO_INCREMENT=502004 DEFAULT CHARSET=latin1   CREATE TABLE `ActionAssignedTo` (   `action_Id` int(10) unsigned DEFAULT NULL,   `emp_Id` int(10) unsigned DEFAULT NULL,   KEY `actionassignedto_emp_id_foreign` (`emp_Id`),   KEY `actionassignedto_action_id_foreign` (`action_Id`),   CONSTRAINT `ActionAssignedTo_ibfk_1` FOREIGN KEY (`emp_Id`) REFERENCES `Employee` (`id`) ON DELETE CASCADE,   CONSTRAINT `ActionAssignedTo_ibfk_2` FOREIGN KEY (`action_Id`) REFERENCES `Action` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=latin1  CREATE TABLE `Employee` (   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,   `vendor_Id` int(10) unsigned DEFAULT NULL,   `name` varchar(40) NOT NULL,   `mobile_Number` varchar(15) NOT NULL,   `active` tinyint(1) DEFAULT '1',   `updated_At` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,   `created_At` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,   PRIMARY KEY (`id`),   KEY `employee_vendor_id_foreign` (`vendor_Id`),   CONSTRAINT `employee_vendor_id_foreign` FOREIGN KEY (`vendor_Id`) REFERENCES `Vendor` (`vendor_Id`) ) ENGINE=InnoDB AUTO_INCREMENT=511 DEFAULT CHARSET=latin1   We want to find the action created by employee with Action.empId = 4 along with the list of Assignee (an action can be assigned to multiple people)  We have the following query :   Select     notes,             Action.id,             AssigneeName.name,             ActionAssignedTo.emp_Id  from       Employee inner join Action  on         (Action.emp_Id = Employee.id  and        Action.emp_Id in (select Employee.id                               from Employee                               where Employee.vendor_Id = 1)) inner      join ActionAssignedTo  on         Action.id =  ActionAssignedTo.action_Id inner join Employee as AssigneeName  on         ActionAssignedTo.emp_Id =  AssigneeName.id where      Action.emp_Id = 4   Now, lets say if Action with id = 10 was assigned to 2 people : John (empId : 2) And Jack (empId : 5) --> the above query returns following results :  (columns from the query)  notes                       | Action.id | AssigneeName.name | ActionAssignedTo.emp_Id 1. Finish Designing Queries | 10        | John              | 2 2. Finish Designing Queries | 10        | Jack              | 5   If we observe the above results the first 2 columns get repeated for the Assignees for SAME ACTION ID  --> is there a way we can merge them something like   1. Finish Designing Queries |10         | { John : 2  , Jack  : 5}   Basically records being merged into one.


the package I use is {graphicx}. and the code is following:  \includegraphics[width=6.5cm]{/Users/Joy/Desktop/my graph/SSE Ari&Geo.png}   How can I delete the address of picture under the graph?  Thank you

I want to import graphics into my main input file using the macro \includegraphics. It does not work if the filename contains spaces.   also discusses this subject, but there is no solution there.  My compilation routine is latex->dvips->ps2pdf (because of PSTricks).


What if I notice I accidentally have made a duplicate post. Should I delete my post or should I link to the original/earlier post? If so, how can I do this?  Edit:  After reading this  it is clear I should not delete my duplicate posts. Though, now how do I report duplicate posts?

Is there any value to NOT deleting my own questions closed as duplicates?  Does anyone benefit from me leaving these questions there dangling in infinity?


I'm running Ubuntu 16.04 And when I try to use eog to open images on windows 10 While using SSH it says:  Failed to connect to Mir: Failed to connect to server socket: no such file or directory Unable to init server: Could not connect: Connection refused (eog:4461): Gtk-WARNING **: cannot open display: :1   Any Help?

I'm going to accessing my ubuntu machine remotely from my windows machine through putty. Are there any suggestions for possible ways to get an X server running on my windows machine?  Thanks.


Followed  to install wine.  After adding repository installed wine using:   sudo apt-get install wine1.7  But I get the following error:  The following packages have unmet dependencies:  wine1.7 : Depends: wine1.7-i386 (= 1:1.7.34-0ubuntu1~ppa1) but it is not installable E: Unable to correct problems, you have held broken packages.   So I tried:  sudo apt-get install wine1.7-i386   But it did not work.  Can someone help me please?

I upgraded on a fresh install to Ubuntu 12.10, and I've tried installing wine many times, but I always get this:  This error could be caused by required additional software packages which are missing or not installable.  Furthermore there could be a conflict between software packages which are not allowed to be installed at the same time. The following packages have unmet dependencies:  wine:   It won't let me install the dependencies either it says it needs another set of dependencies to install them. Using Asus KJ50 64bit OS, dual boot with Windows 7  sudo apt-get install wine1.5 Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  wine1.5 : Depends: wine1.5-i386 (= 1.5.15-0ubuntu1) but it is not installable            Recommends: gnome-exe-thumbnailer but it is not going to be installed or                        kde-runtime but it is not going to be installed            Recommends: ttf-droid            Recommends: ttf-mscorefonts-installer but it is not going to be installed            Recommends: ttf-umefont but it is not going to be installed            Recommends: ttf-unfonts-core but it is not going to be installed            Recommends: winbind but it is not going to be installed            Recommends: winetricks but it is not going to be installed E: Unable to correct problems, you have held broken packages.


I created python script with one function that connect to mysql db, retrieves non spatial data, creates features and saves them into new layer. Below is the pseuodo code:  ###mysql_select.py def create_features (mysql_connection)     layer = QgsVectorLayer(xxx)     provider = layer.dataProvider()     QgsMapLayerRegistry.instance().addMapLayer(layer)     fields = provider.fields()     features = []      mysql_connection.cursor.execute("select * from tables")      for res1,res2,re3 in mysql_connection.cursor.fetchall():     #store results to a layer attributes      provider.addFeatures(features)     _writer = QgsVectorFileWriter.writeAsVectorFormat(layer, path_to_shape_file)  ###my_main_script.py #import mysql_select myConnection = MySQLdb.connect(db_credentials) create_features(myConnection) myConnection.close()   It works fine. But I want to divide all stuff to modules located in different .py files to get more comfortable development. I modified the code above to mysql_select.py and my_main_script.py according to the marks ### above. But I get the error "NameError: global name 'QgsVectorLayer' is not defined".  What is the problem? How to send layer variable to the external module? What is the best method to divide the code into different modules in this case? I have to make four sql selects and create 4 new layers, so to put all that stuff in one script seems not versatile to develop.  I`ve tried to put from qgis.core import QgsVectorLayer in the mysql_select.py and in the my_main_script.py but unsuccessful.

I'm making a plugin were i want to get the min and max value of a raster. When i tried the following code in the qgis python console it worked fine but in my plugin code i get the following error   ver = provider.hasStatistics(1, QgsRasterBandStats.All)  NameError: global name 'QgsRasterBandStats' is not defined   The code i m using is:      layer = self.iface.activeLayer()     renderer = layer.renderer()     provider = layer.dataProvider()     extent = layer.extent()      ver = provider.hasStatistics(1, QgsRasterBandStats.All)      stats = provider.bandStatistics(1, QgsRasterBandStats.All,extent, 0)      minum= stats.minimumValue     maxim = stats.maximumValue      self.dlg.lineEdit.addItems(minum)      self.dlg.lineEdit_2.addItems(maxim)       It look like QgsRasterBandStats isn't included in my python plugin. How can i include this?


I'm trying to understand why printing to a closed PrintStream does not display a stream closed exception, the way FileOutputStream does.   For example, the following code does not display an exception on Eclipse's console:  public class Try {     public static void main(String[] args) {         try {             PrintStream printStream = new PrintStream(System.out);             printStream.close();             printStream.println("ABC");         } catch (Throwable t) {             System.err.println("Throwable caught");         }     } }   Is it because the exception is happening on a separate thread?  Or perhaps is PrintStream.Println defined not to throw an exception?  Edit: Non of PrintStream's methods do. Even the ones inherited from FileOutputStream, which do throw exceptions. Possibly a violation of LSP.

Some days ago I realized that  (as well as ) never throw an IOException when writing, flushing or closing.  Instead it sets an internal flag (trouble=true) when an error occurs. It's not possible to get the exact exception, but only if there was some exception ().  My question is: why would one want to have such behavior? Isn't that bad API design?


I noticed that scientists are one of the most hermetic societies around. Does anybody know how can some "nobody" safely publish an interesting idea, at least, interesting for that someone?  I think that there are plenty of people that have regular jobs and didn't make it through to the scientist/researcher career to be able to present a paper or the like.  Edit: Your question has been identified as a possible duplicate of another . I think it differs in that I'm not asking how to make a paper and what kind of ideas are suitable. I'm asking how to publish it after I wrote it hopefully accomplishing a paper's requirements.

Sometimes I have simple ideas that can be useful. They could be obvious or not, or it is possible that no one ever considered them the way I did.  For example:  To gather information about the statistics of the unemployed in a city or state, I suggest to build a website in which unemployed people register and enter their information. This information is very useful for decisionmakers on unemployment. But, after a while these statistics are not valid. On the other hand, unemployed people are very reluctant to update their employment status via the Internet or they don't have access to it. To solve this problem, we can send an SMS to them and they answer with 1 (as employed) and 0 (as still unemployed), then we integrate these answers to the central database. This way, we have up-to-date information in periods.  The idea was that simple, however maybe no one in our country implemented it. Could it be a paper? If yes, what can it include? Because it is as short as the above. Should I, for example, explain how we integrate the SMSs to the database (however, it may be simple too or the subject of other tools or papers). If I implement the system, should I provide the statistics of unemployment in a city or the percentage who contribute the plan? Totally, I don't know what else such a paper should cover.  For another example, suppose that I am the first one who invented the sliced bread. How long could my paper be and on what would I probably argue?    However it was just an example and after some research I may realize it is not workable, but I should say I actually built the website for an organization in my city one year ago (However not the SMS and updating part), then I was thinking if I can make a paper out of it. Maybe I could use some parts of the real data I gained in such paper, for example the people who registered (which was more than 80% of all the unemployed ranging from 20 to 40 years old) and those who had a cell phone (which was more than 98% of them), this topic shed some lights on my way.


I came across this problem while studying for a midterm and I'm having a tough time proving the first implication:     Let $n\in\Bbb Z$. Prove that $n$ is a multiple of both $5$ and $9$ if and only if it is a multiple of $45.$   I know that:  If n is a multiple of $45, n = 45a,$ where $a \in\Bbb Z.$ Then, $n = 5(9a) = 5b$, where $b = 9a$. Thus, $n$ is a multiple of $5$.   Likewise, $n = 45a = 9(5a) = 9c$, where $c = 5a$. Thus, n is also a multiple of $9$.  Where I have trouble is proving that if $5$ and $9$ divide $n$, $45$ also divides $n.$  $n = 5a$ and $n = 9b$, where $a,b \in\Bbb Z.$  I'm pretty lost as to what my next step here should be. Anyone have a hint to point me in the right direction?

If $\gcd(a,b) = 1$ and $a,b\mid x$ then $ab\mid x$.  My attempt at answering the question:  \begin{align*} x &\equiv 0 \pmod{a}\\\ &\Longrightarrow x\text{ is divisible by $a$}\\\ &\Longrightarrow x = ma\text{ for some integer $m$}\\\ \ \\\ x &\equiv 0 \pmod{b}\\\ &\Longrightarrow  x\text{ is divisible by $b$}\\\ &\Longrightarrow x = mb\text{ for some integer $m$}\\\ \ \\\ x^2 &= (ma)(mb)\\\ x^2 &= (m^2)(ab)\\\ x &= \sqrt{m^2ab}\\\ x &= m\sqrt{a}\sqrt{b} \end{align*} Let $m$ be $k\sqrt{a}\sqrt{b}$. Then \begin{align*} x &= kab\\\ &\Longrightarrow x \equiv 0 \pmod{ab} \end{align*}  Is this correct, if not can someone point me in the right direction?


Does anyone know how to upload 100's of sample points or coordinates from the  to a computer?  Does anyone also know the steps to create beeps or alarms when we approach these points in field?

I'm pretty new to using QGIS and I'm curious about how to import and export GPS points created in QGIS. I have QGIS 2.0.1 Dufour on Windows XP and a Garmin 62s. Any suggested walk throughs would be great.


Assume that $G$ is an abelian group, I read somewhere that it can be derived from Lagrange's theorem that it has a number of subgroups that is equal to the number of $G$'s divisors.  Why does it hold? I'm confused...

Let $G$ be a finite abelian group, then $G$ has a subgroup of order $n$ if and only if $n\mid G$.  Proof: by Lagrange if $H\leq G$ then $|H|$ divides $|G|$ so this proves one of the implications.  We prove the other implication by strong induction on the order of $G$, for primes this is just Cauchy, so we can take these like base cases. Now let $n$ be a proper divisor of $|G|$, take $p$ a prime in the factorization of $|G|$ (instead of $|G|$ is should be $n$, I had made a mistake when typing the first time), then by cauchy there is an element $x$ of $G$ of order $p$, since $G$ is abelian $\langle x\rangle$ is normal in $G$ so we can look at the quotient group $G/\langle x\rangle$, this group has order $\frac{|G|}{p}$, now take a prime $p_1$ in the factorization of $\frac{|G|}{n}$. By induction the quotient group has a subgroup $E$ of order $G/pp_1$ now look at the preimage of $E$ under the natural homomorphism from $G$ to $G/\langle x\rangle$, it is easy to see this is a subgroup of $G$, we call it $I$, consider the restriction of the natural projection to $I$, this is a surjective homomorphism from $I$ to $E$ with kernel $\langle x\rangle$ so by the first isomorphism theorem $I/x\cong E$ so $\frac{|I|}{|\langle  x\rangle|}=|E|\implies  |I|=\frac{|G|}{pp_1}{p}=\frac{|G|}{p_1}$ Notice $\frac{|G|}{p_1}$ is a multiple of $n$ since $p_1$ was in the fatorization of $\frac{|G|}{n}$. So by induction $I$ has a subgroup of order $n$ which is also a subgroup of $G$.


Is there a result along the lines of :     For any $x \in \mathbb{R}$ for all $q \in \mathbb{N}$, there exists a $\frac{p}{q} \in \mathbb{Q} : |x-\frac{p}{q}|< \frac{1}{q^2}$.   Thanks for any help!

This appears on problem 1 of chapter 1 in Stein & Shakarchi's Real Analysis:     Given an irrational $x$, one can show (using the pigeon-hole principle, for example) that there are infinitely many fractions $p/q$, with relatively prime integers $p$ and $q$ such that $$\left|x-\frac{p}{q}\right|\leq\frac{1}{q^2}.$$   However, prove that the set of all $x\in\mathbb R$ such that there exist infinitely many fractions $p/q$, with relatively prime integers $p$ and $q$ such that $$\left|x-\frac{p}{q}\right|\leq\frac{1}{q^{3}} \text{ (or} \leq 1/q^{\epsilon+2})$$ is a set of measure zero.   The last part of the exercise is easy using the Borel-Cantelli theorem. However I have no idea why the first part is true.


There are a lot of questions here about people being able to see their own deleted posts.  This is not that.  Sometimes when I ask a question on a site where I don't have 10k rep, I'll get a notification of an answer, go to read it -- and find nothing, because it was deleted.  Often that means the community deleted it as low-quality or spam, but sometimes it's for some other reason -- self-deleted, or it was good information but not an answer, for example.  Sometimes the OP asks about this ().  I've been asked occasionally about my self-deletions, and as a moderator I'm asked somewhat frequently about deleted answers.  We all have an interest in the question but the OP has a bigger interest.  Could we allow the OP to see deleted answers to his question regardless of his rep?  The interface would be exactly the same as for 10k users.  Some behaviors are already different for the OP (for example, commenting on all answers), so it seems feasible to check not just reputation but post ownership.  If that's too expensive, though, then maybe we could add some sort of "click to see deleted answers" for the OP if there are deleted answers?  I'm looking for a way to satisfy the OP's curiosity without having to ask 10k users or moderators about it.

On a few occasions, some of the answers to my questions were deleted after they were posted, leaving me with no way to access them. Some of the deleted answers were actually useful to me,  so I'm not happy to see them go. Can we have a way for Stack Overflow users to view the deleted answers that were posted on their own questions, even if they are below the reputation threshold for viewing deleted questions?  , although it appears that it still doesn't allow users to view answers that were given to their own question. I'm still looking forward to seeing the now-deleted answers that have been posted on my own questions.


If $$y = \sqrt{x + \sqrt{x+\sqrt{x+\ldots}}}$$  prove that $$\frac{dy}{dx}=\frac{1}{2y-1}$$  Please help me to solve this problem.

let $ y=\displaystyle \sqrt{x+\sqrt{{x}+\sqrt{x+\cdots}}}$, i'm really interesting to know how do I find :  $\displaystyle \frac{dy}{dx}$ ?.  Note: I have used the definition of derivative of the square root function but i don't succed .  Thank you for any help


My younger brother, who is 15, is going to visit me in the UK with my dad as the adult accompanying him. But my dad is only going for two weeks and my brother will go back 2 weeks after him. They are coming from Indonesia.  My question is, will they let him board the plane to go back to Indonesia? Since there will be no immigration exiting the UK, I presume that there won't be any problem?   I will be sending him off to the airport until he gets on the plane.

My daughter who is just under 18 has a child accompanied visa to the UK. I am traveling with her to the UK for a few days. We return from UK on the same day except that she returns to India and I am heading to San Francisco an hour later on the same day.   Is that okay or will we have an issue at immigration into the United Kingdom?


I lost my phone and with that the email account I created to play with a second CoC profile. Since I only created the email account to play with a second CoC profile, I don't remember the details for the account.  Is there another way to recover my village?

I unintentionally and stupidly wiped my Clash of Clans game data. I went to Application Manager on my Android and clicked 'Clear data'. (I used this for fixes before and it never started a new game.)   Now, my level 60 or so base has been wiped as if was to start a new game. Have I doomed myself to starting again or is there a way in which I can retrieve my old game save? Maybe by contacting Supercell? I have a snapshot of my base.


i am really new to java and netbeans... i want to send the data from jtable to database.after referring lot of codes i managed to come up with following code.  but when i run it , it gives me the error: java.lang.NullPointerException. i really can't find where the error is.  this is my code,  try{             int rows = jTable2.getRowCount();         //int cols = jTable2.getColumnCount();         String myUrl = "jdbc:mySql://localhost:3306/hospital";         Connection con = DriverManager.getConnection(myUrl,"root","");         con.setAutoCommit(false);           String query = "insert into invoice (In_id,Admission_A_id,Hospital_Charges,Doctor_Charges,Doctor_visit_charge,Medicine_charge,Food_charge,Total) values (?,?,?,?,?,?,?,?)";          PreparedStatement pst = con.prepareStatement(query);         for(int row=0; row<rows; row++){                  String st1 = jTable2.getValueAt(row, 0).toString();                 int HosCharge = Integer.parseInt(st1);                 String st2 = jTable2.getValueAt(row, 1).toString();                 int DocCharge = Integer.parseInt(st2);                 String st3 = jTable2.getValueAt(row, 2).toString();                 int DocVisitCharge = Integer.parseInt(st3);                 String st4 = jTable2.getValueAt(row, 3).toString();                 int MedCharge = Integer.parseInt(st4);                 String st5 = jTable2.getValueAt(row, 4).toString();                 int FoodCharge = Integer.parseInt(st5);                 String st6 = jTable2.getValueAt(row, 5).toString();                 int Total = Integer.parseInt(st6);                 pst.setInt(1,Integer.parseInt(tt1.getText()));             pst.setInt(2, Integer.parseInt(tt2.getText()));             pst.setInt(3,HosCharge);             pst.setInt(4,DocCharge);             pst.setInt(5, DocVisitCharge);             pst.setInt(6,MedCharge);             pst.setInt(7,FoodCharge);             pst.setInt(8,Total);              pst.addBatch();            }         pst.executeBatch();         con.commit();         con.close();       }      catch(Exception e){         e.printStackTrace();     }// TODO add your handling code here:   please help me to solve this.

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


              <title>{% block title %}{% endblock %}</title>
{% block title %}{% endblock %}
         This is my template, more or less. The h1 heading is always the same as the title tag. The above snippet of code is not valid because there can't be two blocks with the same name. How do I handle this without repeating myself?    edit to clarify: I have a ton of child templates which are inherited from this one template, and so making a new {{title}} variable for each template is not a very good solution. Previously I had it set up like this:  base.html:  <title>{% block title %}{% endblock %}</title>   then in base_view.html (extending base.html):
{% block title %}{% endblock %}
   then in base_object.html (extending base_view.html):  {% block title %}my title goes here{% endblock %}   and it just worked somehow. I refactored my templates so theres just base.html, and base_object.html How can I get this functionality back?

I want to use the same {% block %} twice in the same django template. I want this block to appear more than once in my base template:  # base.html <html>     <head>         <title>{% block title %}My Cool Website{% endblock %}</title>     </head>     <body>         <h1>{% block title %}My Cool Website{% endblock %}</h1>     </body> </html>   And then extend it:  # blog.html {% extends 'base.html' %} {% block title %}My Blog{% endblock %}  # pictures.html {% extends 'base.html' %} {% block title %}My Pictures{% endblock %}  # cats.html {% extends 'base.html' %} {% block title %}My Cats{% endblock %}   I will get an exception, as Django wants the block to appear only once:     TemplateSyntaxError at /      'block' tag with name 'title' appears   more than once   A quick and dirty solution would be duplicating the block title into title1 and title2:  # blog.html {% extends 'base.html' %} {% block title1 %}My Blog{% endblock %} {% block title2 %}My Blog{% endblock %}   But this is a violation of the  principle. It would be very difficult as I have a lot of inheriting templates, and also because I don't wanna go to hell ;-)  Is there any trick or work-around to this problem? How can I repeat the same block in my template, without duplicating all the code?


I am worried that some people just want to misuse the site, just like a lot of other sites. It is possible that some people might be interested in making people lose massive amounts of reputation for their entertainment. If six or more banded up, each patrolling through questions and each casting one spam/offensive flag on each question/answer, it could cause some users to lose hundreds of reputation relatively quickly. Could this mean an end or something on a similar scale to the stack exchange where it takes place? If not, then about how much trouble could such troll armies cause? Have moderators or other such people considered this possibility and accounted for it?

From the guidance on spam and offensive flags:     Additionally, any answer that accumulates enough offensive or spam flags will be automatically deleted.   What if a bunch of lunatics simply cast offensive flags for fun and random posts get automatically deleted? Does SE have some mechanism to prevent this situation?


If someone knows where apps (downloaded) from google play store can be found, thanks. Could it be not viewable on Samsung files?

I have a rooted android phone. I am trying to pull the applications from /system/app/. However this simply does not copy the apk. What I have tried.      adb shell     su     cd data     cd app     ls   A lot of applications are shown. However when I try to pull it it says   adb pull /data/app test  pull: building file list... 0 files pulled. 0 files skipped.   When I try to pull it from the system/app it pulls it but no file is created on my computer. I have specified the file name, tried with it and without it. Could someone please tell me what I am doing wrong?  I have also tried it individually with specific apks. But that doesnt work either.


When I try to compile some TeX code from a few years ago that relies on the  package, I get the following error: ! LaTeX3 Error: Mismatched LaTeX support files detected. (LaTeX3)        Loading 'expl3.sty' aborted! (LaTeX3)         (LaTeX3)        The L3 programming layer in the LaTeX format (LaTeX3)        is dated 2021-02-18, but in your TeX tree the files require (LaTeX3)        at least 2021-05-11.  For immediate help type H <return>.  ...                                                                                l.77      \ExplLoaderFileDate{expl3.sty}}                                          %  The code itself is not relevant; the error can be reproduced by compiling, say, the following MWE: \documentclass{article}  \usepackage{siunitx}  \begin{document}  \SI{1}{\s}  \end{document}  I have just updated my TeX Live 2021 distribution and furthermore I haven't encountered this error before. How do I fix this?

Background I updated my TeX Live installation on my Mac a while ago and got the error LaTeX3 Error: Mismatched LaTeX support files detected. I found a solution at .  As far as I understand it (which isn't very far), there are system formats and local formats, and TeX Live is updating the wrong one.  The fix is to update the formats. Using fmtutil-user --all worked for me.  It spewed out a load of stuff, then output fmtutil [INFO]: log file copied to: /Users/<user>/Library/texlive/2020/texmf-var/web2c/luatex/dvilualatex.log fmtutil [INFO]: /Users/<user>/Library/texlive/2020/texmf-var/web2c/luatex/dvilualatex.fmt installed.  I don't know what this tells me, but my TeX Live preferences has TeX programs set at /Library/TeX/texbin, which seems to be a link to /usr/local/texlive/2020/bin. Problem Every time I update TeX Live, I have to apply the solution again. Question Is there a way to make TeX Live use the correct formats permanently so that I don't have to keep running fmtutil-user --all after every TeX Live update?  Extra information  to  check if you have some local formats around which hide the system formats. (with eg kpsewhich --all --engine=pdftex pdflatex.fmt)  When I did that, it output /Users/<user>/Library/texlive/2020/texmf-var/web2c/pdftex/pdflatex.fmt /usr/local/texlive/2020/texmf-var/web2c/pdftex/pdflatex.fmt  but I don't know what that's telling me.


That's right, I want to close a bunch of stuff using my alt-tab window, quickly.  Let's say I have a bunch of windows open in an image editing program, for example:    I'd like to have a hotkey (e.g., CTRL+W) I can press while the alt-tab menu is up that will close the currently selected window.  Is a hotkey for this?

Is it possible to quit applications while switching through them with Alt+Tab? When I used a Mac many years ago and you were switching through open applications with (let's say Command+Tab) you could let go off tab and then hit Q to quit the app.  How can I do this same thing in Ubuntu 14.04?


I currently use Latex for a simple paper that's based on the extbook class. My source code looks like this: \documentclass[10pt, twoside]{extbook} \usepackage[german]{babel} \usepackage{blindtext} \setlength{\parindent}{0pt} \usepackage[paperheight = 18cm, paperwidth = 11.5cm, outer=1.5cm, inner = 1.5cm, top = 1.3cm, bottom=2cm]{geometry} \usepackage{titlesec} \titleformat{\chapter}[display]   {\normalfont\huge\bfseries}{{\chaptertitlename\ \thechapter}}{20pt}{\large} \usepackage{fancyhdr} \fancypagestyle{wholeBook}{ \fancyhf{} \renewcommand{\headrulewidth}{0pt} \fancyfoot[RO, LE]{\thepage} \fancyfoot[C]{}  }  \pagestyle{wholeBook} \begin{document} \sloppy \input{Chapters/Chapter1.tex} \input{Chapters/Chapter2.tex} ... etc \end{document}  This is meant to produce a page number on the left side of every even page and on the right of every odd page. Oddly enough, it produces unexpected output: For every first page of a chapter, the page number appears in the middle of the page. I don't want this, yet I have no clue how to disable it. Does anybody here have a solution?

I am working on a long document in LaTeX with documentclass book. I need the page number to always be in the upper right corner of each page, even if that page is the first page of a chapter (right now on 1st pages of chapters, the page number is bottom-centered, on all other pages it's top-right).  I control the position of the page number with fancyhdr:  \usepackage{fancyhdr} \pagestyle{fancy} \lhead{} \chead{} \rhead{\thepage} \lfoot{} \cfoot{} \rfoot{} \renewcommand{\headrulewidth}{0pt}   Also, I don't know if the problem is related but my chapters do not start from the top of the page. There is a white area, then comes chapter X, then a newline with the chapter line. What I also want is the chapter to start from the top of the page.  The main question here is how I can get the page number to always appear in the upper right corner, I mention the thing with the chapter title position only in case that might be related.


I have a tif file of 7378 X 6923(widthXheight) resolution. I resized it to 1200 X 1200 pixels using Image class in python.   img = Image.open('path to tif file')  img = img.resize((1200,1200))   But after resizing, the pixel values show unusual values. Before resizing, a certain pixel's value was 125.28. Now, after resizing, that pixel's value has turned to 1123715645. I am reading the pixel value with:   with rasterio.open('path to tif file') as dataset:     band = dataset.read(1)     print(type(band))     value_of_interest = band[row_of_interest, column_of_interest]     print(value_of_interest)   Why does this happen?  How can I preserve the height values in same pixel position?

I have a TIFF file of 7378x6923 (widthXheight) resolution. I resized it to 1200x1200 pixels using  module in Python.  img = Image.open('path to tif file') img = img.resize((1200,1200))   But after resizing, the pixel values show unusual values. Before resizing, a certain pixel's value was 125.28. Now, after resizing, that pixel's value has turned to 1123715645. I am reading the pixel value with:  with rasterio.open('path to tif file') as dataset:     band = dataset.read(1)     print(type(band))     value_of_interest = band[row_of_interest, column_of_interest]     print(value_of_interest)   Why does this happen?  How can I preserve the height values in same pixel position?


Looking for an animated show/movie. It's about a tribe that live on a tether between two planets, made up of something like tree roots.   The story is about one of them wanting to know more about the place they live and what is beyond their village.

I watched this film on Cartoon Network India sometime between 2005-10.   The society, situated amidst a jungle of sorts, has a recurring ritual to offer their produce to the god(s). It is very taxing on them but still they decide to do it due to fear of divine vengeance.   A teen girl refuses to accept it as a way of life and questions the whole enterprise. The rest of the story, IIRC, is about the tumultuous fight of girl vs god. There might even be human sacrifice involved but I'm not sure about that. The whole thing was CGI, no traditional animation. I recall a fight between the girl and a giant basilisk(?) near the end.  I looked up programming of CN India and other CN channels as well on Wikipedia and this movie failed to show up. Since I watched the Hindi dub, I'm not sure what the original language of the film was.   It'd be great if somebody could help me remember what it was.


I am interested in plotting my own function with pgfplots in combination with the math library from TikZ&PGF. This function is something I would use many times in my document.  Something like this:  \documentclass[10pt, a4paper]{article}  \begin{document} % Defining the function \usetikzlibrary{math} \tikzmath{      function my_fun(\a, \b, \c) { return \a * exp(\b * \c); % <<< This is my function }; % Plotting the function \begin{tikzpicture}     \begin{axis}         \addplot { my_fun{\x, 1, 0} }; % <<< This is obviously wrong     \end{axis} \end{tikzpicture} \end{document}   Is this even possible? If not, what would you recommend as the best approach to creating a function that would be plotted (with different arguments) several times?  I would like to avoid the approach of using a series of \def's with #-type arguments if at all possible.

I need to plot several functions in PGFPlots, and each function I plot is actually the same main function minus the function evaluated at some point x. Instead of hard-coding the value of the function for each x, I was wondering if there's a way to define a function, and then evaluate such function at x. So far the code I have is:  \documentclass{article} \usepackage[usenames,dvipsnames,svgnames,table]{xcolor} \usepackage{amsmath} \usepackage{mathptmx} % Use the Adobe Times Roman as the default text font together with math symbols from the Symbol, Chancery and Computer Modern fonts  \usepackage{tikz} % Required for drawing custom shapes \usepackage{pgfplots} \usetikzlibrary{plotmarks, calc, spy, pgfplots.polar, external} \usepgflibrary{shapes.geometric}  \begin{document}  % add and edit tikz figure here:  \begin{tikzpicture}[scale=1]     \begin{axis}  \addplot + [mark=none, domain=0:2, samples=70] { (x^0.65 + sin(1.5*pi*x)))/2}; \addplot + [mark=none, domain=0:4, samples=70] { (x^0.65 + sin(1.5*pi*x)) - (2^0.65 + sin(1.5*pi*2))))/2}; \addplot + [mark=none, domain=2:6, samples=70] { (x^0.65 + sin(1.5*pi*x)) - (4^0.65 + sin(1.5*pi*4))))/2}; \addplot + [mark=none, domain=4:8, samples=70] { (x^0.65 + sin(1.5*pi*x)) - (6^0.65 + sin(1.5*pi*6))))/2}; \addplot + [mark=none, domain=6:10, samples=70] { (x^0.65 + sin(1.5*pi*x)) - (8^0.65 + sin(1.5*pi*8))))/2}; \addplot + [mark=none, domain=8:12, samples=70] { (x^0.65 + sin(1.5*pi*x)) - (10^0.65 + sin(1.5*pi*10)))/2}; \addplot + [mark=none, domain=10:13, samples=70] { (x^0.65 + sin(1.5*pi*x)) - (12^0.65 + sin(1.5*pi*12))))/2};      \end{axis} \end{tikzpicture} \end{document}


I want to make a program in python (windows computer) that can transmit Morse code. If i press 'b' in python shell i want a the computer to respond directly with a long beep. The same when i press 'n', then the program should give a short beep. I can do this with raw_input but then i have to press enter each time i press 'b' or 'n'. How can i do this without having to press enter each time and just get a instant respond with a beep?  I have already tried this:  def Transmit():      c = 1     while c == 1:         a = raw_input("Press key: ")         if a == "b":             winsound.Beep(1000, int(1000*x))         if a == "n":             winsound.Beep(1000, int(3000*x))   And the function msvcrt.getch doesn't seem to be wroking in my python shell..

Is there a way of reading one single character from the user input? For instance, they press one key at the terminal and it is returned (sort of like getch()). I know there's a function in Windows for it, but I'd like something that is cross-platform.


I'm playing D&D 5e, and I'm not sure what ability score applies to firearm attack rolls. (Using the stats from the DM's Guide.)

Is the damage of firearms computed like other ranged weapon attacks? The attacker adds his Dexterity modifier to the damage?


The action of a relativistic point particle is its negative rest energy along its worldline, the parameter being its own proper time. $$ S = - mc^2 \int d\tau $$    Is there a particular reason why the action is considered to be negative?

In the special relativistic action for a massive point particle, $$S=\int_{t_i}^{t_f}\mathcal {L}dt,$$ why is the Lagrangian $$\mathcal {L}=-E_o\gamma^{-1}$$ a negative number?


I am aware of Gödel's second incompleteness theorem, the proven existence of several unprovable statements (in ZFC), and the possibility that a formal system may include statements that are unprovably unprovable, that is, that there are statements in them which cannot be proven by them, but additionally, they cannot even be proven to be unprovable by them.  My question is this:  Can the existence of unprovably unprovable statements be proven/disproven in ZFC or a (not necessarily conservative) extension like TG or MK?  (I am aware of a similar question which asks if there can be unprovably unprovable statements in formal systems, however this asks if the existence of such statements is provable in ZFC, which is a different matter)

I was just thinking about unprovability. I just wanted to know if it is possible to make a concrete boundary between provable problems and unprovable problems in a certain axiomatic system.   We know that there is a statement that is true yet unprovable. Then is it possible that a statement is true and unprovable, but the unprovability is unprovable?  We can extend it to a question of "unprovability of unprovability of unprovability", or any finite number of times, or even $\omega$ times....  I have no clue. Has there been any research on this kind of topic?


what the result suggests of the order of the ARMA model?

Having a bit of difficulty identifying the appropriate ARIMA model by looking at ACF/PACFs.   I know that AR(1) models, the ACF has a geometric progression from its highest value at lag 1 and the PACF has a spike at lag 1 and then then cuts off afterwards.   Could someone possibly explain how I identify the rest? AR and MA please?!?


Jawaharlal Nehru was the first prime minister of India. Below is a quote from his autobiography.     Many a Congressman was a communalist under his national cloak   I am sure this sentence is grammatically correct but somehow I find it quite unnatural, particularly the "many a congressman was" part. Shouldn't this sentence be simply written as:     Many congressmen were communalist under their national cloak   Can someone please explain the above quote and maybe give some common examples of similar usage?

Can someone please elucidate the difference between "many" and "many a"? In what context of usage should we add an extra "a" beside the word "many"?  For example:         Many times, I had seen that . . . .   Many a times, I had seen that . . . .      I do not know if the example is accurate enough to support my question, but I would like to know the difference between how they are used.


Where is the best place to show validation/error messages in a form?   Beside a field? underneath a field? Reserve an area on the top/bottom of the page, and show any error/successful message there?

I've seen quite a lot of research on form design, but so far, I haven't come across any studies on error message design best practices. The only piece of advice seems to be that each error should clearly be associated with the invalid form field that it aims to correct. Has there been any research on this?  I have some specific issues I'm trying to work through and would appreciate any insight or resources.  Error message location  When you have live form validation, where should an error (or success) message appear in relation to the form element?  Some options:    To the right of the input         – Wireframes created with     To the right of the label            Above the label            Below the label            Below the input            There are some thorny issues that also need to be taken into account regarding location:   How are errors displayed for radio or checkbox groups? How wide is the error message? Is the error message multi-line?   Error message visibility  Besides location, I'm also interested in how the visibility of the error message affects its usability. Does it matter or is it strictly a aesthetic decision?  Consider the following 3 options:          Edit: There have been some excellent points on accessibility in some of the answers so far, as well as some interesting examples. However, I really would like to see some data from actual studies, if possible. Also, none of the answers so far have really addressed the two questions I had above:   Where should the error be located in relation to the input and label? How does the design and visibility of the error message itself affect its usability?   Regarding the accessibility of the forms, it seems to me as if there might be two potentially conflicting use cases, live validation and server-side validation (which would require reloading the page). If the page is reloaded and the user again starts at the top of the form, an error summary makes sense, especially from an accessibility perspective. However, in the case of live validation, the error summary at the top makes much less sense, both for form design and for accessibility purposes.   Consider how a user would actually use a form with live validation:  The validation occurs on the blur event. Usually, the focus of will be on the next form element, not the list at the top. As I understand screen readers, there wouldn't be any reason to return to the top of the form to read the error list. For users not using screen readers, the error list at the top pushes the entire form down, doubly so if the error takes up vertical space near the form field as well. In longer forms, this is a usability issue as the error summary may not be visible. In shorter forms that have per-field errors, like a login, the error summary just looks like overkill. For all forms, the interface would be pushed down, making a poor user experience.  For live validation, if you really want to make the form errors accessible, I think using  might be the preferred solution.


When I add Subdivision Surface I just simply can't sculpt anymore, but...it works with multiresolution...any ideas why is that?  Thanks

I am creating a pillow for my couch.  But when I click on my base, it just deforms it like this:     Does somebody know how to fix it?   After ticking dyntopo it looks like that...


If I flip a fair 6-sided die I win the amount of money equivalent to the number that shows up. I can play a maximum of three times but have to decide whether to stop or continue with each throw and would win that particular throws face value. How much should I be willing to pay for this game?  Thanks

There's a question in my Olympiad questions book which I can't seem to solve:     You have the option to throw a die up to three times.  You will earn   the face value of the die.  You have the option to stop after each   throw and walk away with the money earned. The earnings are not additive. What is the expected payoff of this game?   I found a solution  but I don't understand it.


I want to place a file in an FTP users directory (a readme) and make it so they cannot delete it.  I've got /home/user/iso/readme.txt uploaded as root, permissions set to 0444 - (r--r--r--) Yet when I log in as a normal user I can delete it.  How can I prevent this?

From the post  I understand that rm just needs write permission on directory to remove the file. But I find it hard to digest the behaviour where we can easily delete a file who owner and group different.  I tried the following  mtk : my username abc : created a new user  $ ls -l file -rw-rw-r-- 1 mtk mtk       0 Aug 31 15:40 file $ sudo chown abc file $ sudo chgrp abc file $ ls -l file -rw-rw-r-- 1 abc abc       0 Aug 31 15:40 file $ rm file $ ls -l file <deleted>   I was thinking this shouldn't have been allowed. A user should be able to delete only files under his ownership? Can someone shed light on why this is permitted? and what is the way to avoid this? I can think only restricting the write permission of the parent directory to dis-allow surprised deletes of file.


I want something like if i click on the login then pop window should open where in i should able to enter my Id and password to login, as as of now i tried with modules like          above module i just installed and enabled.  But no luck can anyone tell me how to achieve this?

When menu item "Login" is clicked, I want to display the login form as a popup. How can I achieve this?  I have looked into the following but with little luck. (Let me know if the answer is below and I am missing it.)   modules: Overlay paths, Popup, Ajax login/register Code: hook_admin_paths_alter()   Any help will be great. I am looking for a clean pop up option that I can theme too.


I have a string like this:    17, the day is beautiful , day  .  And I want to split this string in the first ','. For example I want to take 2 strings. one for 17 and two for the day is beautiful , day

I'm trying to iterate over the words of a string.  The string can be assumed to be composed of words separated by whitespace.  Note that I'm not interested in C string functions or that kind of character manipulation/access. Also, please give precedence to elegance over efficiency in your answer.  The best solution I have right now is:  #include <iostream> #include <sstream> #include <string>  using namespace std;  int main() {     string s = "Somewhere down the road";     istringstream iss(s);      do     {         string subs;         iss >> subs;         cout << "Substring: " << subs << endl;     } while (iss); }   Is there a more elegant way to do this?


I want implement like this at terminal A, open a new terminal B, run command in B, leave B runing, and back to terminal A, run other command.   I have following script, but not what I expected  #!/bin/bash konsole -e 'sh -c "./tel"' echo test   The problem is, echo test command won't run, until I close terminal B.  terminal A output      "failed to get the current screen resources   QXcbConnection: XCB error: 170 (Unknown), sequence: 170, resource id: 90, major code: 146 (Unknown), minor code: 20"   and wait for terminal B close. after I close terminal B, terminal A output "test".  Is there a way to solve the problem?

On the CLI, sometimes a command I type takes a while to complete, and sometimes I know when that's about to happen. I'm a bit confused on "backgrounding" and such in Linux.  What is the most common (or user-friendly way) of telling the CLI that I don't want to wait, please give me back my prompt immediately. And if it could give me a progress bar or just busy-spinner, that would be great!


So I am trying to make a glassy transparent cup according to a tutorial but I seem to have misclicked something and now every default material when I change the viewport into preview material is the default forest one that comes with BLENDER 2.90. However, when I render the object with the camera it shows the way I want it. I have tried removing the material from the cup or the liquid and adding a new one with the default white color. when I turn the Transparency to 1 and Roughness to 0 it becomes the forest HDRI again. This is what I mean  blend file:

When using Eevee, an object with a glass material (in this case: Principled BSDF, trasmission set to 1.0) doesn't seem like it can be looked through: it's completely opaque.  See for instance the material for the blue cube in this scene:    How can I get my glass material to be transparent?


ISTM that a Stack Overflow-based setup would work great in many work environments. There are questions that can be answered internally, but you don't know who it is that may have the answer. Questions specific to a certain company or department, that wouldn't fit on Stack Overflow, or in cases where it's hard to be specific about your code when asking questions on Stack Overflow because thereby you might divulge too much of your company's secrets and possibly future directions/projects, etc.  I guess what I'm really asking is if there is such a thing as a "Stack Overflow in a box" or an Open Source Stack Overflow-esque framework that can be deployed for an internal work group? If not, what is the closest thing to it?

Since the source code for this site isn't available for purchase or external use, I'm looking for software that can run a Q&A environment similar to Stack Exchange. Are there any such pieces of software available?


Finding $\lim\limits_{n\to \infty}\left({1\over n+1}+{1\over n+2}+\dots+{1\over n+n}\right)$. I tried many things but it would work out. I am now studying calculus 2 (In my country the first calculus course is split, and I saw a solution while studying calculus 1.)  However, I understood that questions with sum are usually solved like that: For example,  $$ \lim_{n\to \infty}{1\over n^{k+1}}({1^k+2^k+ \ldots +n^k})= \ldots =\lim_{n\to \infty}{1\over n}{\sum_{j=1}^{n}\Bigl({j\over n}\Bigr)^k}=\int_{0}^{1}{x^k}\,dx $$  but now I can't bring it to that form. I also can't verify my answer because I can't find other answers for it. I would really appreciate your help. Please don't mark my question is a duplicate before making sure that either the origin involves integrals or that it cannot be solved with integrals.

Let we have the following sequence $(a_n)$ such that $$a_n=\sum_{k=1}^n\frac{1}{n+k}$$ How can I prove that $(a_n)$ is increasing bounded sequence, then prove it is convergent and find its limit?


I mean like :    They aren't linked to any account.

What are the System Users for Chat and what are the point of those users? They always seem to have negative user IDs.  I've been able to find 9 current System Users for Chat:             Do these users differ at all from the Feeds user that runs feeds you add to a room, or are they specialized users? How are new users created? Eg. One for your favourite SE site so it can be invited into the room.


I want to create an array of lights contained within a space. There appears to be no way to apply an Array Modifier to a light object -- why not? Is there a non-Python way perhaps to create and space light objects without Python?

Following .  Since you can't use an array modifier on lamps, how can you create an array so that all lights are clones of the same original and can be edited as one?


Using ubuntu 17.10, how can I write umlaut and other non a-z characters, like ö, in xfig?

Currently I use the character palette applet in gnome panel to put special characters into text.  This is okay, but I have to stop typing, select the character I want from the applet and then copy and paste.  Is there a way to simply type special characters with different key combinations? If so, how do I do it?


I downloaded a Sims 3 3D model mesh to make custom clothes for the game Sims 3.  but I noticed all the parts of the models body were separated including the eyes, head, and feet. So I tried to merge all the separated meshes together by pressing the join key but  I got the error no mesh data to join.  I don't why or  how to solve this issue and its really makes things harder for me. If you know a solution to this problem,  please let me know. I must be doing something wrong.  Here is the blend file of the model:

I have created two meshes as separate objects and I want to create a face joining them. However, since they are two different objects, I can not edit them to add the face.  Is it possible to join them into one mesh?


I tried to set views to Enabled(false), but it keeps giving me this error:  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setEnabled(boolean)' on a null object reference   Something I don't understand is that the error didn't occur at ccl_stage11[][] but occured at vtl_stage11 and hrl_stage11[][] even though they're using same for in the same way.  I tried to unroll the 'for' loop at the setEnabled part, but it didn't work.  Can anyone help me to solve this problem? Here is the code related to this error.  public class Stage1Activity1 extends AppCompatActivity {      Button[][] ccl_stage11 = new Button[4][4];     Button[][] hrl_stage11 = new Button[4][4];     Button[][] vtl_stage11 = new Button[4][4];        @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_stage11);           buttonSettings(); }  protected void buttonSettings() {           int k = 0;         for (int i = 1; i <= 3; i++) {             for (int j = 1; j <= 3; j++) {                 ccl_stage11[i][j] = findViewById(R.id.ccl_stage11_11 + k);                 ccl_stage11[i][j].setEnabled(false);                 k++;             }         }         for (int i = 0; i <= 3; i++) {             for (int j = 0; j <= 3; j++) {                 vtl_stage11[i][j] = findViewById(R.id.vtl_stage11_00 + k);                 hrl_stage11[i][j] = findViewById(R.id.hrl_stage11_00 + k);                 k++;             }         }         for(int i=0;i<=3;i++){             for (int j =0;j<=3;j++){                 vtl_stage11[i][j].setEnabled(false);                 hrl_stage11[i][j].setEnabled(false);             }         }         ccl_stage11[1][3].setEnabled(true);         ccl_stage11[3][1].setEnabled(true);       }   The error occurs at   for(int i=0;i<=3;i++){     for (int j =0;j<=3;j++){         vtl_stage11[i][j].setEnabled(false);         hrl_stage11[i][j].setEnabled(false);     } }

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


When I am running yum install getting following error.  root@datanode# yum list  CRITICAL:yum.cli:Config Error: Error accessing file for config file:///etc/yum.conf   root@datanode# rpm -ev yum           error: Failed dependencies:         yum >= 3.0 is needed by (installed) yum-fastestmirror-1.1.16-21.el5.centos.noarch         yum >= 3.2.18 is needed by (installed) yum-security-1.1.16-21.el5.centos.noarch         yum >= 3.2.22 is needed by (installed) yum-updatesd-0.9-6.el5_10.noarch   root@datanode# cd /etc/yum.repos.d   root@datanode:/etc/yum.repos.d# ll  total 36 -rw-r--r-- 1 root root 1926 Oct  7  2013 CentOS-Base.repo  -rw-r--r-- 1 root root  636 Oct  7  2013 CentOS-Debuginfo.repo  -rw-r--r-- 1 root root  626 Oct  7  2013 CentOS-Media.repo  -rw-r--r-- 1 root root 7574 Oct  7  2013 CentOS-Vault.repo   root@datanode12.h2.dev.bigdata.sv2.247-inc.net:/etc/yum.repos.d# cat /etc/yum.conf.FCS   [main] proxy=http://cache.backside.sv2.tellme.com:3128/  cachedir=/var/cache/yum keepcache=0 debuglevel=2  logfile=/var/log/yum.log distroverpkg=redhat-release tolerant=1  exactarch=1 obsoletes=1 gpgcheck=1 plugins=1  bugtracker_url=http://bugs.centos.org/yum5bug  # Note: yum-RHN-plugin doesn't honor this. metadata_expire=1h  installonly_limit = 5  # PUT YOUR REPOS HERE OR IN separate files named file.repo  # in /etc/yum.repos.d

I can't run a yum command on my server without getting this:   CRITICAL:yum.cli:Config Error: Error accessing file for config file:///etc/yum.conf   This is what my yum.conf looks like:  # This is the fedorafaq.org yum.conf for Fedora Core 5. # # Note that you also need the rest of the configuration # as described at http://www.fedorafaq.org/#yumconf  [main] cachedir=/var/cache/yum keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 metadata_expire=1800  # PUT YOUR REPOS HERE OR IN separate files named file.repo # in /etc/yum.repos.d   This is what my yum.repos.d looks like:  fedora.repo fedora-updates.repo fedora-updates-testing.repo   The permissions on those files are 0666 and it won't allow me to make them root:root


Formally, why is true that $$\int_0^\infty \int_{x}^\infty f(x,y)dy dx =\int_0^\infty \int_{0}^y f(x,y)dx dy $$ ?  I know and understand perfectly the geometric interpretation, and with that, I´m well satisfied that this is true, but, what about the formal explanation? is a merely use of change variables theorem? or Fubinni´s Theorem? or a use of both?

If $f(t)$ is a Probability density function of a positive RV.  $\int_0^\infty\int_x^{\infty}f(t)dtdx$ Using fubini theorem should become $\int_0^\infty\int_0^{t}f(t)dxdt$  But why? Surely the answer is very simple but I don't see it. Fubini theorem allows the change of the order of integration. So it should become $\int_0^\infty\int_x^{\infty}f(t)dxdt$  but then I don't understand what meaning could have $\int_x^{\infty}dx$


I want the code to be if entered "shoot" then it'll print "Nice, you killed the zombie" and if the user inputs "don't shoot" then it'll print "oh no, the zombie killed you" this is what I've done so far but it won't print out anything.     public static void main(String[] args) {         System.out.println("ZOMBIE AHEAD!");         Scanner kb = new Scanner(System.in);         String action1 = "shoot";         String action2 = "don't shoot";         String str = kb.nextLine();         if (str == action1) {             System.out.println("Nice, you killed the zombie!");         } else if (str == action2)  {             System.out.println("Oh no, the zombie killed you!");         }     } }

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?


Scenario: A method addList in class expects a List of Integer objects.  main method sends an ArrayList argument containing objects of multiple types, not just Integer.   Result: Call to method addList is successful and it is also possible to retrieve the objects stored in the ArrayList and print them.   Question: Should not we expect that on run-time when the list is received in the called method, its content will be validated and it will result in some exception?  However, in addList method, if I am trying to insert a non-Integer object in the ArrayList, it fails at compile time only.   Does this conclude that Diamond operator constraint is only while inserting the objects in a Collection?  Please note,  is different question and doesn't provide answer to this question.   package com.rnd.nirav;  import java.util.ArrayList; import java.util.List;  public class OverRidingTest {  public static void main(String[] args) {      List list = new ArrayList<>();     list.add(Integer.valueOf(1));     list.add("Nirav");     list.add(Float.valueOf(1.1f));      addList(list);  }  public static void addList(List<Integer> list) {     list.add("Khandhedia"); // This fails as expected.     System.out.println("List size = " + list.size());     Iterator itr = list.iterator();     while(itr.hasNext())     {         System.out.println("Element is " + itr.next());     } }  }

What is the concept of erasure in generics in Java?


How can I prove that there is an infinite amount of irreducible polynomials $\pmod 2$?

I can intuitively understand that there are infinitely many irreducible polynomials in $\Bbb{F}_p[X]$, where $p$ is a prime number, but I'm having a hard time actually proving it. What proof strategy should I take for this?


I have the following input   [a:xxxx] [b:yyy] [z:ddd]   I would like to extract using regex the values: a,b,c.   I tried using   Pattern tm = Pattern.compile("\\[(.*?):.*\\]",Pattern.CASE_INSENSITIVE |  Pattern.UNICODE_CASE);    Matcher m = tm.matcher(inputString); ArrayList<String> res= new ArrayList<String>(); while (m.find())       res.add(m.group(1));   However what I get is only a.  Any suggestions?   Thanks.

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


Is there any bonus to do all the bounties in all the five acts ?   I know there is a bonus (more blood shards) for 2 acts, but if I do the three others is there some kind bonus to have done all the bounties ?

Compared to, for example, completing 5 bounties in each of 5 different games.


A brick (1 Kg) is placed on a surface that is stationary, relatively to a non-spinning black hole. The escape velocity at this level is 1/2 of the speed of light. Can we compute the weight of the brick (or the force of support) or the weight of the brick depends on the mass of the black hole? If so, will a heavier black hole result in higher weight or vice versa? Update: I am not a physics major and I want to get a feel of the relationship of the mass of the source of gravity and the mass/weight ratio at the level of a given escape velocity. While the formulas from the related question are likely relevant I will not be able to derive the function for this question.

The gravitational force on your body, called your weight, pushes you down onto the floor. $$W=mg$$ So, what is the weight equation through general relativity?


Why does the friction of a solid sphere (while rotating and moving) has to be static and not kinetic ,not to slide?

During analysis of , why do we consider coefficient of friction as that of static friction and not kinetic friction?


This would be the part where I do the readings  do {     res=0;     res += fscanf(in , "%50s",recs[n].city);      res += fscanf(in , "%d.%d.%d ", &recs[n].d.d , &recs[n].d.m , &recs[n].d.y);     res += fscanf(in , "%f", &recs[n].t );     recs = realloc(recs, (n+2)*68);     if(!recs){         printf("Error for second recs");         return 0;     }     n++;         }while(res == 5);   My input file :  Germany 8.01.2020 54.24 Romania 1.2.2019 34.55 Banat 5.1.1999 41.66 Region 4.5.2023 51.71 Idk 12.11.1967 91.981   My output :   Germany 8 1 2020 54.240002  Romania 1 2 2019 34.549999  Banat 5 1 1999 41.660000  Region 4 5 2023 51.709999  Idk 12 11 1967 91.981003      So basically my question is why does fscanf reads 51.709999 instead of 51.71 for example.

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


Using scipy, I noticed that I am allowed to use only Euclidean distance for Ward's method.  Is it because Ward's uses Error Sum of Squared?  What if I use Ward's method with cosine similarity?  Cosine similarity seems still work so, but maybe not perfectly.  What might be the difference?

I am using hierarchical clustering to analyze time series data. My code is implemented using the Mathematica function DirectAgglomerate[...], which generates hierarchical clusters given the following inputs:   a distance matrix D the name of the method used to determine inter-cluster linkage.   I have calculated the distance matrix D using Manhattan distance:  $$d(x,y) = \sum_i|x_i - y_i|$$  where $i = 1,\cdots, n$ and $n \approx 150$ is the number of data points in my time series.  My question is, is it ok to use Ward's inter-cluster linkage with a Manhattan distance matrix?  Some sources suggest that Ward's linkage should only be used with Euclidean distance.  Note that DirectAgglomerate[...] calculates Ward's linkage using the distance matrix only, not the original observations.  Unfortunately, I am unsure how Mathematica modifies Ward's original algorithm, which (from my understanding) worked by minimizing the error sum of squares of the observations, calculated with respect to the cluster mean.  For example, for a cluster $c$ consisting of a vector of univariate observations, Ward formulated the error sum of squares as:  $$(\sum_j||c_j - mean(c)||_2)^2$$  (Other software tools such as Matlab and R also implement Ward's clustering using just a distance matrix so the question isn't specific to Mathematica.)


I'm trying to understand other person's code written in C++, but there is a strange use of constructor  I've never seen. The code looks like this:  A* a = new A(some initial values...); ... B* b = new (a) B(some initial values...);   When initializing variable b there is (a) between new and B(...). What does this mean?

Has anyone here ever used C++'s "placement new"? If so, what for? It looks to me like it would only be useful on memory-mapped hardware.


I set up an administrator account for myself when I set up a new Ubuntu system. Somewhere along the line I did something wrong, and my account is now a standard account. I no longer have sudo privileges; when I try to use sudo, it asks for the root password rather than my password. I never set up a root password. Is there a default setting for that password? I can't fix anything without that password, because I need root access to make the fix.  My best guess is that what went wrong may have been due to the following sequence of events: I used addgroup to create a group named family. I used adduser to add an account for my wife, and usermod to put her in the family group. I then used usermod to put myself in the family group. Might I have accidentally removed myself from the sudoers list that way?  I needed two additional pieces of information to solve my problem:   By booting in recovery mode, and selecting "root" from the menu, I could operate as root without knowing root's password, even if logging in as root has been disabled by not giving it a password.   When booting in recovery mode, the root partition defaults to read-only mode. I needed to use mount -rw -o remount / in order to make it writable, before I could make any changes.

In /etc/sudoers I see this:  # Allow members of group sudo to execute any command after they have # provided their password # (Note that later entries override this, so you might need to move # it further down) %sudo ALL=(ALL) ALL   So how do I add a user to that sudo group?


Entrepreneurs try to delay taking money from investors as long as possible.   Entrepreneurs try delaying taking money from investors as long as possible.       Assuming (2) is correct, is there any difference in meaning between the two sentences?  ELL contributors have already answered a  about the difference in meaning between "try to open," and "try opening," but I'm not sure if it applies to the two sentences in my question because why would one try to delay taking money for its own sake (not to achieve something else)? And why, for that matter, would one try to open a door if not to achieve something else (to leave a building, to see what's behind the door ...)?

I tried to open the door. I tried opening the door   We can use both infinitive and gerund with verb "try" as used in above sentences. Does it change the meaning of the  sentence if use gerund or infinitive?.(here i don't know if the meaning of sentences is changed.)     The same confusion arise in these two sentences.  1.I stopped seeing him. 2. I stopped to see him.(But in case of these two sentence i know the meaning is changed but don't know exactly what the change is).


Could any one please explain the difference between Splitting and Allocation a IP address block.  Say if I have 10.0.0.0/24 (254 hosts) available. My requirement is to get a /25.  Could anyone explain how Splitting and Allocation works?  Thanks a lot.

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