Sort Vector on one of MyClass's data members?

I would like to create a class, call it MyClass which has three data members- a, b and c. I then wish to put many MyClass objects in to a std::Vector<MyClass> and then sort the Vector according to the a data members.  Is there an elegant way of doing this using the STL? I didn't want to re-invent the wheel and I am sure this can't be a first. In Java I guess I would use a Comparator.


Type of questions in Meta Stack Exchange?

Can we get answers for general knowledge questions in Meta Stack Exchange or only tech related ones?


I am using qgis 2.14.17 with ubuntu16. Having as input data a DEM of the region and a river network. In the manual of qgis they suggest to use a toll of qgis: Catchment area (Parallel); I dont have this in my toolbox, anybody made the same experience and could tell me the reason for it and how to get it. It seems to offer the best solution for me.  Tools which are available are from GRASS7 and TauDEM, the latter need much more data it seems. And I am not sure if I am able to create these just out of a DEM? The GRASS7 has one tool r.water.outlet: but here one has to put the outlet coordinates, which clearly I could get out of the river network, but the idea is that they are generated by delineating the watersheds.  Somebody has an idea how to solve it?  I managed now to get SAGA run in the toolbox, nevertheless would be great if somebody could help me with the qgis tool, since it should appear?!


C# Multiple Generic List - Combining Them?

Scenario:  I have a generic list of Audits and a generic list of AuditImages. These two lists have been compiled from database tables. As a result of this, ONE AuditImage can have MANY Audits. As you will see below, the classes that the tables map to are joined by a foreign key relationship "ImageID" when they are in the database, however once the data is extracted to lists in code, there is no "PHYSICAL JOIN".  Classes That DB Tables Map To:  public class AuditImage {     public Guid ImageID { get; set; }     public string LowResUrl { get; set; } }  public class Audit {     public Guid AuditID { get; set; }     public Guid ImageID { get; set; }     public DateTime CreatedDate { get; set; }     public string CreatedBy { get; set; }     public string Comment { get; set; } }   The Problem:  I now want to compile a list of "Trail" objects by extracting the data from each list and combining it on "Audit.ImageID == AuditImage.ImageID", into a new list.  public class Trail {     public Guid ImageID { get; set; }     public DateTime CreatedDate { get; set; }     public string CreatedBy { get; set; }     public string Comment { get; set; }     public string LowResUrl { get; set; } }   (The above essentially combines the "LowResUrl" field with each Audit based on the ImageID being the same.)  The Question:  How should I go about doing this!? I had thought about using foreach loops and linq to create a new list of trail objects but I can't quite think of exactly how I would go about doing this?!  Help would be greatly appreciated.


Today I have replaced my chain with a kmc z8s. The rear cassette is Shimano acera 8 speed , and is not worn yet , so everything is OK with the cassette. But the problem is that the chain doesn't fit the cassette properly ,when I apply more power on the pedals the  chain starts sliding over the cassette (The lenght of the chain is OK too). What is the solution of this problem ?


What is wrong with my executable compiled with GCC?

This is my source file, base.c ...  #include "/usr/include/stdio.h" int main( int   argc, char *argv[] ) {     sprintf("%s\n", "woohoo");     return(0); }   I compile and execute with ...   jim@Pappy:~$ gcc base.c jim@Pappy:~$ a.out a.out: command not found jim@Pappy:~$ ll a.out -rwxrwxr-x 1 jim jim 7255 Jan 15 14:21 a.out*   So why is a.out not found?


Pls help by answering.Thank you.Need to understand before proceeding further

I have some doubts and confusion. Please clarify by explaining the science behind it. Thank you. I have no knowledge in electicity. Regardless what i put as voltage and current is just example, just want understanding on it. Hypothetically, a charger output 5V 2A, device input 5V 0.5A will it work? I read that if input is lower than output will work because device draws what it demand from charger and current is low so preventing cable and charger heating up which may lead to fire.  Everything should be fine because communication exists between charger and device due to the circuitry component thing of device and charger (please clarify). Device has a charging controller component in it and so do charger. Device can be phone, tablet, laptop, electric fly swatter, etc. whereas charger can be power bank and power brick or corded wall wart.  However, someone pointed despite working fine its damaging charger due to heat building up at charger and will die at point (please clarify) and  some say by charger will supply its stated current in this case 2A than the needed 0.5A it will cause battery to swollen (please clarify). Does this has to do with the circuitry thing?   On the other hand, if a charger has output 5V 2A, device input 5V 3A will it work? I read that if input is higher than output will not work because device draws what it demand from charger and current is high so it causes the charger to heat up and oversupply which may lead to fire in cable and charger and blown fuse in charger.  Everything should be fine because communication exists between charger and device due to the circuitry component thing of device and charger (please clarify) mentioned above because  I read charger will only supply up until its stated current output so no blown fuse and device just chargers slower? (please clarify)  What if the voltage and current output is different from required v and I input? Will it work? I read it should because regardless voltage higher or lower it wouldn't work cuz too high device swollen and heat up while too low device wont charger or work. (please clarify)  How about current how does current gets affected in this situation when voltage and current is different? I just know (no knowledge about it, just informed about the words) is depending on device and charger intelligence and the communication circuitry thing,are there more? Please clarify help understand things. Thank you.   I hope you understand what I'm talking about.


Reoccurring Bent Axles, any reasons or upgrades?

Earlier this month I had a issue with a broken axle.  It was the original that was sold with the bike and lasted around 5,000 miles.  I went to my LBS and bought a new axle (unbranded, labeled, etc, paid $13, came with cones, spacers, and hardware).  I did the install myself and had everything adjusted nicely.  The next time I rode it was on my commute to work, but I didn't get 4 miles into it when I found that I bent the axle.    I took the wheel to the shop but they wouldn't do anything about it since I didn't have them do the work.  However, I figured this was a fluke and asked them for a new axle and to true the wheel.  Once again I did the install of the axle and only got 15 miles out of it this time before bending it.  Before I got home I felt the wheel get stiff, but it stayed true.  The question is what will be a cause of bending 2 axles in 20 miles?    I think the guy at the shop said it was a cro-moly axle (while talking to another person today at the shop, these may not be), and he couldn't believe that I bent it.  If so, where would such an axle fall in the quality hierarchy?  Or is my hub toast?  While the wheel was being repaired, I swapped to a new original wheel for about 2 weeks.  I have not had any issues with it, but I wanted to keep it as new as possible.   Reading other questions I saw a comment that said not to use a hub where the bearing was catching.  I did have one in this wheel but I figured since it is a cheap wheel I would just burn it up and move on to a better one.  Besides, it has lasted 5k miles without issue to this point.  The bike in question is a 2008 Schwinn High Timber with Joytech freewheel hubs.  I do use a trailer with this bike using a Burley axle hitch.  While I had the hitch installed on both axles I bent, I did not have either trailer hooked up to them.  Something I would like to note is that when I removed the first bent axle (axle #2) that the cones on it had a wavy bearing track.  I didn't think too much of it, and I put them on axle #3.  Only having a few miles on them shouldn't have made a difference?


Why are questions with no close votes in the close review queue?

I have just been asked to review a few questions for closing that don’t seem to have any close votes,  e.g.


Dark Tower references in other works of Stephen King or vice versa

I recently started re-reading the Dark Tower saga (just finished part IV: Wizard and Glass, probably my favorite part in the series) and noticed some links with other work of Stephen King. For instance, in Wizard and Glass the Ka-Tet finds a note of a certain Abigail on the windshield of a car in Kansas. Although many years have passed since I read that book, I believe this is a nod to The Stand.  Now are there many connections like this? And then I mean proper connections and not just stuff like this:     19: The number nineteen is a magical number in the Dark Tower novels.   In Blockade Billy, it is Billy’s shirt number.   since those are not references that make not much impact in the work of King. It doesn't matter by the way if Dark Tower references other books or if other books references Dark Tower. I'm interested in both ways.  Note: since I'm thinking about reading the referenced works in the future, I would appreciate it if the answers only show the titles of the books. Further explanation is welcome ofcourse but please use spoiler tags.


Would I write this statement this way?   Would it be toward or towards?  "The puzzle piece shows how we fit together, working toward(s) a common goal."


Would it take more, or less than twice the force to inflate a balloon to a radius twice as big?

I'm making a set of exercises as part of a college project, aimed at 4th year middle school physics. In an exercise on spring constants, i used balloon inflation as a new example, i made the following graph:     where s denotes radius (perfect sphere). The sharp slope at the end is caused by the balloon exploding, hence no force remains. I'm unsure whether this graph is realistic however. I think the slope should actually increase, as the force has to be spread out over 2 directions, instead of 1 in a spring (straight diagonal line). So on that basis, this graph isn't realistic, right?  I don't want to make another graph however. So i was wondering whether I could justify it if i add that the rubber of the balloon gets weaker/thinner (or: the spring constant of the rubber decreases) as it stretches.  Or would the graph still make no sense then?  Edit: my main question: could this graph be realistic for a balloon being inflated. Here F is the force required by the person inflating the balloon, or more precisely the total force distributed over the balloon. Or should i really replace it with a quadratic shape (so graph^(-1))?


Why is there a space in the bowdlerised "L– ." in Jane Eyre?

I have been reading Jane Eyre recently and came across a sentence the other day: ...and away we rattled over the “stony street” of L— . There is a blank between "–" and the full stop, which made me quite confused. I know that the reason why the author used "L" instead of a concrete name is avoid to reveal someone's private information or be sued for libel, but this blank still perplexes me. Why is there a space before the full stop? Is it a typo? If not, what does it mean?


Latex real textwidth smaller than \textwidth in documentclass article but not in report

I am seeing a weird behavior in the textwidth in Latex. When I use \documentclass[a4paper]{article} the actual text width do not really all the \textwidth. I can see that if I use showframes in geometry. The problem does not occur in \documentclass[a4paper]{report}.  example 1:  \documentclass[a4paper]{article} % use larger type; default would be 10pt \usepackage[top=1in, bottom=1in, left=0.5in, right=0.5in,showframe]{geometry} % to change the page dimensions top=1in, bottom=1in, left=0.5in, right=0.5in, \usepackage{graphicx} \usepackage{lipsum} \usepackage{array}  \title{TEST} \author{?}  \begin{document} \maketitle \abstract{???} \tableofcontents \newpage   \section{Introduction}\label{sec:Introdu} \lipsum  \end{document}   example 2:  \documentclass[a4paper]{report} % use larger type; default would be 10pt \usepackage[top=1in, bottom=1in, left=0.5in, right=0.5in,showframe]{geometry} % to change the page dimensions top=1in, bottom=1in, left=0.5in, right=0.5in, \usepackage{graphicx} \usepackage{lipsum} \usepackage{array}  \title{TEST} \author{?}  \begin{document} \maketitle \abstract{???} \tableofcontents \newpage   \section{Introduction}\label{sec:Introdu} \lipsum  \end{document}


The first-ever image of a black hole released this week was taken with radio telescopes, suggesting that it is a  image and doesn't represent what a person would see in reality, or visible light. This seems to be confirmed by this , but I am perplexed as to why this is not widely mentioned, including the announcement on the telescope's  and Wikipedia (, ). Perhaps not mentioning it makes for better headlines, but it feels wrong.  What's going on here?


Tweak Election Rules for primary/election phases?

Some of you might have heard rumors, but right now, Science Fiction and Fantasy has  going on. We are currently at exactly 10 nominees with one day left in the nomination phase.  As it stands, if we get no more nominees, we jump right to the election phase. If we get one more nominee, we'll instead split between a primary and election phases. If we do go to a primary, it will probably be with just 11 nominees, and we will spend the next four days decided which one candidate gets eliminated.  Somehow, that seems a bit harsh on whomever that person is. While technically the primary is selecting the top 10 out of 11 candidates, the impression it gives is that we're picking "the worst" candidate.  Perhaps the rules could be tweaked such that the primary process isn't triggered by just having "one too many" candidate. For example, if there are more than X candidates, it triggers a primary where (.75 * X) candidates are selected. That is:   11 candidates -> no primary 12 candidates -> primary -> 9 candidate election


Why do we switch the denominator and numerator when we divide fractions?  I've been trying to find out why and I've asked several people and checked many websites but none that give me a good answer. Help?


Let $p$ be prime number ($p\gt2$) and $a,b\in\mathbb Z$ ,$a+b\neq0$ ,$\gcd(a,b)=1$ how to  prove that $$\gcd\left(a+b,\frac{a^p+b^p}{a+b}\right)=1~~\text{or}~~ p$$  Thanks in advance .


Please help me to input a symbol like >---<.   It is like \leftrightarrow but \leftrightarrow is <--->.


What's the etiquette on re-asking questions?

If I asked a question a long time ago that has yet to be answered, has stopped getting views, and has all activity has come to a stop, is it ever appropriate to re-ask the question with whatever new info you may have gathered elsewhere?


The question says -      Let $f(x) = x^x$, $x  \in (0,\infty)$ and let $g(x)$ be the inverse of $f(x)$, then $g'(x)$ must be?   I tried taking log on both sides of the given equation but I get stuck. I cannot find any other way to proceed. Try answering this question on a high school level.


How to capture everything (.*) inside tags, like e.g. [foo] Capture this [/foo] [foo] and this [/foo]

Inside my string there a one or more occurrences of a tag starting with [foo] and ending with [/foo]. So imagine a string like this:  string = "[foo] Text inside tags [/foo] Text between tags [foo] Text inside tags [/foo]"   I want to capture the text inside each occurrence. If there were just one occurrence my regex could simply be:  regex = /\[foo\](.*)\[\/foo\]/   As anything could be inside the tags I have to capture it with .*. However by doing that I end up capturing everything between the first [foo] and the last [/foo]:  < string.scan(regex) => [[" Text inside tags [/foo] Text between tags [foo] Text inside tags "]]     How do I avoid this?


How can I automatically forward Facebook messages to my email or phone?

I can create email addresses that forward to other email addresses.  Likewise, can I automatically forward Facebook messages to either my email or phone?


Converting tif to format for TIMESAT using BEAM VISAT or ERDAS IMAGINE?

How can I convert tif image into a format for TIMESAT software to create a time series?   I am using BEAM VISAT or ERDAS IMAGINE program.


Are there any primary structure sequences that strongly suggest b-sheet or alpha helix?

Is there a particular sequence of amino acids that we know will take on a beta-sheet or an alpha helix or is it essentially random?


How do I use the Mini View feature introduced in Windows 10 Creators update?

In , the Mini View feature is introduced:  I'm particularly interested in this feature, but I don't know how to get it to work. For example, in Groove music, I don't see an option for switching to mini view. So, how do I use this feature?  Attribution: Image appears to be copied from


Trying to center a  - is this related to clearfix?

I'm trying to center the div using css. No problem assigning the padding size in pixels, but can't get it work with "auto".

  This it the page I need help with: https://armadaled.org/luminarias_bombillas_reflectores_rd/ Using this CSS added via WP Additional CSS it partially solves the problem, but it loses responsiveness in sense of smaller desktop screens, meantime mobile looks good. It only works when applied to #main div. .page-id-6711 #main {     padding-top: 20px !important;     padding-right: auto !important;      padding-left: 150px !important;     width: 100% !important;     height: 100% !important; }  When logically I need to play with "primary" div's margins. What doesn't work. I just need this "primary" div to be centered horizontally for all resolutions... But padding-left (right): auto combinations have no effect at all. Is this related to clearfix? Just don't know where else to look for. I tried all possible combinations assigning the width in pixels.


sorry this seems to be a repeated question but it confused to why I can't get a drop-down box to differentiate between null and 0.  I have a drop-down box with some PHP which select a value from a database and assigns it to $user. The default value is null, but I then want to change it to a 0 or 2 (its for number of tickets, so null is I haven't assigned any, 0 is I don't want to give them any, and 2 is they get 2). Basically the code below doesn't distinguish between null and 0 and based on other posts I read I feel it should but obviously I'm missing something.    <option value="" <?php if( is_null($user)){ echo 'selected'; }?>>Not Set</option> <option value="0" <?php if($user === 0){ echo 'selected'; }?>>0</option> <option value="2" <?php if($user === 2){ echo 'selected'; }?>>2</option>   I have also tried  <option value="" <?php if($user === NULL){ echo 'selected'; }?>>Not Set</option> <option value="0" <?php if($user === 0){ echo 'selected'; }?>>0</option> <option value="2" <?php if($user === 2){ echo 'selected'; }?>>2</option>   and   <option value="" <?php if($user === ''){ echo 'selected'; }?>>Not Set</option> <option value="0" <?php if($user === 0){ echo 'selected'; }?>>0</option> <option value="2" <?php if($user === 2){ echo 'selected'; }?>>2</option>   Any help appreciated.  EDIT  var_dump($user) = string(1) "0"   This is the same where $user = NULL and $user = 0  on my local xampp  var_dump($user)=int(0) and var_dump($user)=NULL the same code is acting different on the live version.


Arduino analog input higher than reference but lower than 5v

I'm going to use a very precise potentiometer that can measure angles from 0 to 3600 degrees (10 rounds), but I only need the first 180 degrees or so in this project and I need it to be more precise than 3600/1024=3,52 degrees. I thought about connecting the pot to 5v and setting analog reference to INTERNAL (1.1V on Uno r3) so I can measure the first 1.1V with enough precision. My question is if this will damage my Arduino if the pot accidentally gives more than 1.1V. It will never increase 5V though. I have read multiple answers on the internet but I don't know who to trust. I want an answer of someone who knows what he's talking about. Will supplying up to 5V damage with analog reference set to 1.1V?


Orange link that used to be suggested edits is now all review

When I reached 2k reputation points (on Stack Overflow), I got an orange rectangle next to my profile link on the notification bar that links to the suggested edits review page and displays the number of pending edits.    Since I reached 10k, that link now displays a much bigger number and links to the whole review page, not just suggested edits.  I don't like that because I already have a link to the review page right next to it.  The suggested edits queue is my favorite thing to review, so I liked having a quick way of getting to it.  Now, it's two clicks: review; suggested edits.  I would like it if that link stayed the same as it was.


A problem about algebraic integers and roots of unity

Let $\lambda_1, \lambda_2,...,\lambda_n $ be roots of unity and let $z=\sum\lambda_i/n$ be an algebraic integer.  To show:     (a) Any conjugate of $z$ , say $z'$, is of the form $z'=\sum \lambda'_i/n$ where   $\lambda'_i$ are roots of unity.   Note: Conjugate of $z$ is any $z'$ such that the minimal polynomial of $z$ and $z'$ are the same.     (b) Is $z'$ an algebraic integer?   These problems are loosely based on a step in the proof of Burnside's theorem that I am trying to study from the , page $69$ lemma $A.19$. Any help will be appreciated.


I was surprised recently to find that it's possible to have a return statement in a finally block in Java.  It seems like lots of people think it's a bad thing to do as described in ''. Scratching a little deeper, I also found '' which shows some pretty horrible examples of other types of flow control in finally blocks.  So, my question is, can anyone give me an example where a return statement (or other flow control) in a finally block produces better / more readable code?


looking for the title of a sci-fi short story about odd object, 2 children and 4th or 5th dimension

looking for the name of a sci-fi short story, 1980's or before. the plot is somewhat like:  father gives kids odd object to play with. the kids play with the object. kids discover 4th of 5th dimension and disappear. father spends rest of his life trying to figure out the object. a quote is from father asking one the children about some pretty view or object and child answers to the effect of "it's not quite right".


Find all files based on a list of file names / patterns

Say I have a list of keywords:  $ cat filenames.txt  satin perdido savoy stockings april lullabye   I want to find all the files in some directory that contains those keywords.   I have tried something like:  find some_dir/ -type f "$(printf '-or -iname *%s* ' $(cat filenames.txt))"   But somehow I am not able to use printf to build the whole find command; I get:  -bash: printf: -o: invalid option


Tell me BEFORE I change my name that it has 30-day permanence

Consider Meta Stack Exchange question  I just went and changed my username on Mi Yodeya to Cnsersmoit (Scimonster scrambled). See comments:  and  However, I did so unaware that it would be stuck like that for the next 30 days. The moderators kindly offered to fix it for me, but I decided to leave it for now. But anyway, why wasn't I warned? Before clicking 'save', it should tell me that it'll be stuck.


I've tried a few examples below when trying to examine what's going on when creating (instantiating?) Java's built in data structures Works:         LinkedList<Integer> test1 = new LinkedList<Integer>();          List<Integer> test3 = new LinkedList<Integer>();          Queue<Integer> test5 = new LinkedList<Integer>();          Set<Integer> test6 = new HashSet<Integer>();  Doesn't work:         LinkedList<Integer> test2 = new List<Integer>();          Queue<Integer> test4 = new List<Integer>();   From digging around, I see that  LinkedList is it's own class that implements List HashSet is it's own class that implements Set List and Queue is an interface  So is it correct to say that the way this works is that you need to do the following? [Interface]<type> name = new [Class]<type>()' Is this saying you are creating an object of the Class but are going to be using the methods of the Interface? Is there a reason why this is the case? Does this have something to  do with polymorphism? I recently asked a question and not sure if they are related.


How to prove the equation $\sum^{N-r}_{x=0}\binom{N-x}r =\binom{N+1}{r+1}$

I was trying to solve a probabilistic problem and I found I had to use the equality $\displaystyle\sum^{N-r}_{x=0}\begin{pmatrix} N-x \\ r \end{pmatrix}=\begin{pmatrix} N+1 \\ r+1 \end{pmatrix}$ in an intermediate step. I verified it with Wolfram Alpha, but I really can't come up with a proof (I tried expanding everything out but find no clue in the end). I hope I can find a proof here and it is even more delighting if someone is willing to teach me some typical ways of proving equations involving combinations and permutations, which seem to be unmentioned in the textbook I am currently using.


"No such file" when running a 32-bit program on a 64-bit system

I downloaded a Chromium snapshot and unzipped it, like this:  michael@ubuntu:/opt/chrome-linux$ ls chrome                  libffmpegsumo.so                nacl_irt_x86_32.nexe chrome.1                libppGoogleNaClPluginChrome.so  product_logo_48.png chrome_100_percent.pak  locales                         resources chrome.pak              nacl_helper                     resources.pak chrome_sandbox          nacl_helper_bootstrap           xdg-mime chrome-wrapper          nacl_irt_srpc_x86_32.nexe       xdg-settings   But when I try to run chrome, it isn't there...  michael@ubuntu:/opt/chrome-linux$ ./chrome bash: ./chrome: No such file or directory   Does anyone know why it won't open? Running Xubuntu 12.10 AMD64.  michael@ubuntu:/opt/chrome-linux$ ldd /opt/chrome-linux/* | grep -i "not found" ldd: /opt/chrome-linux/locales: not regular file ldd: /opt/chrome-linux/resources: not regular file


Accidentally dropped boulder in wrong hole in the distortion world

In the part where you have to solve the boulder puzzle, I accidentally dropped the first boulder in to the wrong hole (the one to the left of the boulder). Is there any way I can undo this action? I do not have a savestate from before this happened.


My Camera model is Canon EOS 60D. I am using this last three years. How can I know the shutter count for my camera ?  Thanks in advance.  Jayanta P.


Calculate the sum $\sum_{n=0}^\infty\frac{1}{(4n)!}$

How to determine the sum $\sum_{n=0}^\infty\frac{1}{(4n)!}$ ? Do I need to somehow convert (4n)! to (2n)! or in tasks like this, should I get the (4n)! after some multiplying?  Thank you all for your time!


Title says it all. I can not add/change the material/color of ANYTHING.The entire page where materials should be is just completely blank.


Term for a more polite word used in place of a vulgar word

What is the term for a polite word or phrase that is used in place of a vulgar word or phrase?      "Prostitute" is a _____ for "hooker"


Purpose of #define-ing symbol as itself in C

I'm looking at some provided C headers for a microprocessor, and they contain code like:  #define TMR2 TMR2 extern volatile unsigned int   TMR2 __attribute__((section("sfrs")));   What is the purpose of this #define?


are my files stored in Ubuntu One secure from the American intelligence agency (NSA)? In which country are they stored? Is it better than using Dropbox or any other popular cloud?  Thanks in advance for your answers!


How is voltage exactly created in a citcuit?

I just began studying electricity and concept of voltage and this particular concept of voltage is so confusing. I have searched answer for this question everywhere and every answers stops short at saying that voltage is created by chemicals in a battery and nothing beyond this. You don't need to go deep into explaining chemistry but I just need an idea of how electric potential is created in batter and how it "forces" electrons in circuit to move. Like how is charges spearate in first place. If battery is not one to supply electrons in first place, then how come potential difference is created in battery which would then force electrons in wire to flow. If anyone can shine light on this, I really appreciate it.


There are two TextView, I want to check the equality of data in these textbox. I wrote one IF function, but the code is running incorrectly. Date time data, date and Time written in the test data I want to check the equality between textler.  TextView textView1 = (TextView) findViewById(R.id.current_time_view);                 String tarihsaatdata = textView1.getText().toString();                  String tarihvesaatText = (tarihTextView.getText().toString()) + " " + (saatTextView.getText().toString());                  if (tarihsaatdata == tarihvesaatText){                     if(aSwitch.isChecked()){                     Map<String, Object> newStatus = new HashMap<>();                     newStatus.put("001", true);                      ref.setValue(newStatus);                 }else{                         Map<String, Object> newStatus = new HashMap<>();                         newStatus.put("001", false);                          ref.setValue(newStatus);                     } }else{                  }              }         });


Prevent EarPod play/pause button from activating Siri on macOS Sierra

I have installed macOS Sierra.  I often work on my Mac while on the go, and then I play music using iTunes over my EarPods connected via the mini-Jack plug.  The button allows me to pause the music, but now in Sierra, every time I press it, I am asked whether I want to allow Siri.  Refusing will simply bring the window up again when I press the button.  I don't want to use Siri on Sierra.  At all.  How can I prevent it from trying to activate when I press play/pause on my EarPods?  Added after reading comments: When I enable Siri, Siri doesn't activate when I press the button, unless I press it really long.  But when I disable Siri entirely, it asks whether it's allowed to activate every time I press the button, even if it's just a short click.


why blender create holes in mesh when i go to sculpt mode?

So, I am doing the "blender guru" tutorial, and when it's time to sculpt, my "icing" object creates this holes, anyone knows how to solve it?


how to install a specific package version

I'm building my first debian package (django), which needs some dependencies, so I was wondering if it's possible to install a specific package version with apt-get.   For example instead of   pip install gunicorn==19.3.0  apt-get install gunicorn==19.3.0  (which obviously doesn't work, only apt-get install gunicorn works, however then it will install the latest version)   Ultimately, this is supposed into the Depends section of the control file.   Any ideas?


Permission denied to run git in mounted directories

So I freshly installed Ubuntu 18.04 alongside Windows 10. At installation I mounted C: and D: at home/drives/C - home/drives/D. I want to keep my working files in D therefore I am using git there, but every time I try running git status, git clone etc, the terminal wants me to use sudo.   Did I mount the volumes correctly? How can I get rid of the mounted volumes permissions?


Note: This post is discussing a specific example, which is different to the posts that just give some general rules which might not applicable here, such as some posts that just talk about event but don't even mention a word about building.  Is the Statue of Liberty a historic building, a historical building or both? I've gone through , which gives a general answer, that is, a historical building. I also went through , which is informative though doesn't answer the question directly.  Historic means ‘important or likely to be important in history’ ... Historical means ‘related to the study of things from the past’    The monument was expanded to also include Ellis Island in 1965. The following year, the Statue of Liberty and Ellis Island were jointly added to the National Register of Historic Places  Which seems to indicate that the Statue of Liberty is a historic building. Which one should I go with?


Installing 2 x 16Gb and 2 x 32Gb on an iMac 27"

Got a 2019 iMac 27" with 4 RAM slots. I have 2 x 16Gb and 2 x 32Gb RAM modules. This is how they are installed right now. Is this the most optimal way to install them, or the sequence does not matter?


should a list of tokens be called a "token list" or a "tokens list"

Possible Duplicate:          I ask because a list of tasks would usually be called a "task list". However a list or previous winners of a competition seems to be called a "winners list" rather than a "winner list". Thanks.


Proving inequality relation between two complex numbers and a positive real parameter.

Question:  Prove that: $$|z_1+z_2|^2 \le (1+c)|z_1|^2+(1+{1\over c})|z_2|^2$$ where $z_1,z_2$ are complex numbers and $c$ is a positive real parameter.  Solution:  We can write $$|z|^2=z\bar z$$ Same way $$(z_1+z_2)(\bar z_1+\bar z_2) \le (1+c)(z_1)(\bar z_1)+(1+{1\over c})(z_2)(\bar z_2)$$ which will yield $$z_2\bar z_1+z_1\bar z_2 \le cz_1\bar z_1+{1\over c}z_2\bar z_2$$  How to solve after this? Is this question correct? Am I doing correct? Post script: Offtopic  This maybe irrelevant with the question. If you want to answer it you may or you may not. As I'm quite new to the topic. Can anyone of you suggest a good book for a beginner as there is nothing left in the book I'm reading. It's just introduction with few problems. This is the last one. How to pronounce $\bar z$? Some pronounce z bar and some strictly prohibit saying the same. They rather say complex conjugate of z.  Thanks for answering any of these questions or providing any hints.


I am creating a game in ray lib and have a player header file with a struct of player to keep things organised. I get this error saying that there is multiple definition of the struct 'player'. Error: /usr/bin/ld: main.o:(.bss+0x0): multiple definition of `player'; player.o:(.bss+0x0): first defined here collect2: error: ld returned 1 exit status player.cpp: #include <raylib.h> #include "player.h"  void InitPlayer() {      player.x = 0;     player.y = 0;      player.tint = (Color)RAYWHITE;     player.Frame = 0;     player.FrameWidth = 16;     player.MaxFrames = 3;     player.animation_number = 0;     player.timer = 0.0f;          player.flip = 1;      //Load Texture2D     player.playerTexture = LoadTexture("Sprites/PlayerAll.png");  }  void UpdatePlayer() {  player.timer += GetFrameTime();      if(player.timer >= 0.2f){              player.timer = 0.0f;         player.Frame += 1;   }  if(IsKeyDown(KEY_S)) {         player.animation_number = 16;            player.y += 1;       }else if(IsKeyUp(KEY_S)){         player.animation_number = 0;     }               if(IsKeyDown(KEY_W)){         player.animation_number = 32;         player.y -= 1;     }          if(IsKeyDown(KEY_A)){         player.animation_number = 48;         player.x -= 1;'''     }              if(IsKeyDown(KEY_D)){         player.animation_number = 48;         player.x += 1;         player.flip = -1;     } else {         player.flip = 1;     }          //Clamp frame value     player.Frame = player.Frame % player.MaxFrames;  }  void DrawPlayer() {      DrawTexturePro(player.playerTexture,         Rectangle{player.FrameWidth*player.Frame,(float)player.animation_number,(float)player.flip*16,16},         Rectangle{(float)player.x,(float)player.y,16,16},         Vector2{0,0},0,player.tint); }  void UnloadPlayer() {          UnloadTexture(player.playerTexture); }  Player.cpp: #ifndef PLAYER_H #define PLAYER_H  typedef struct Player{          int x, y;     Color tint;       int Frame;     int FrameWidth;     int MaxFrames;     int animation_number;        float timer;          int flip;        Texture2D playerTexture;          }Player;  Player player;   void UnloadPlayer(); void InitPlayer(); void UpdatePlayer(); void DrawPlayer(); #endif  Main: The main.cpp' file basically calls the functions from the 'player.h' file. And I have included 'player.h' in 'main.cpp' Just for some extra information if needed: I have tried using 'extern' on 'player' but it requires me to compile the cpp files in a strange order. After compiling and linking both object 'player.o' and 'main.o', I change 'player.cpp' to have 'extern' on struct global variable 'player' and compile 'player.cpp' only without compiling 'main.cpp' and link both objects files with the 'main.o' being the old one.


What does this do: :(){ :|:& };:.  I was reading through encyclopedia dramatica and saw that command.  It just being above rm -rf / --a-flag-we-don't-mention-here makes me anxious about trying it out to see. Any insights on what it might be? I tried googling but to symboles make it impossible to search.


How to prove if 3 circles intersecting with each others the 3 common chords will cross the same point?

I’m watching this video  giving a smart proof. Check from 12:23 the question   And 15:50 the solution by promoting it to 3D :   But I’m not so convinced. Is there a more strict proof?


How to prove $( A \times B ) \cap ( C \times D ) = ( A \cap C ) \times ( B \cap D )$ ?


Is the ticking of a free spinning wheel related to its quality?

I have often noticed that, whenever a race bike is running with free wheel (so no active pedals movements), I can hear a distinct "tick tick tick tick" coming from the rear wheel, sounding more or less like a speedy clock.  That doesn't happen neither on my cheap city bike, nor on my more expensive tourism bike. Is it a matter of proper lubrication, or is it also an indirect index of how good the gear is?  I would guess that if I hear a sound, some energy is being spent to generate it, and that energy comes from the bike motion. Therefore I would assume that a better bike with lower resistance would be more silent.


Do I include small amounts of interest on my taxes if they didn't send a 1099-INT?

One of my bank accounts earned $1.50 for the entire year.  Because the amount is under $10 they did not send a 1099-INT form.   Is this bank policy or IRS policy?  Does that $1.50 need to be reported?  I'm not worried about the difference that this small amount makes on my taxes bur rather what is legally required.


Localisation : an example where $r's-rs'\neq 0$ but $(r,s)\sim(r',s')$

Let $R$ a commutative ring and $S\subset R$ a subset closed multiplicatively with $1\in S$. We say that $(r,s)\sim (r',s')$ if there is a $t\in s$ s.t. $t(r's-rs')=0$. The thing is I don't understand the presence of this $t$, and I don't find any example where it's important. I tried for example for $R=\mathbb Z/6\mathbb Z$ and $S=\{1, a\}$ where $a\in \{1,...,5\}$, then with $S=\{0,1,2,3\}$, but still, it doesn't work. What I thought was something like: $$\frac{2}{1}=\frac{6}{3}$$ but since $\frac{6}{3}=\frac{0}{1}$, we would have that $\frac{2}{1}=\frac{0}{1}$, but is there something around that ?  By the way, it's not precise in my course that $0\notin S$ (that's why I included it), but may be it can't be in $S$, no ?


Why the destructor has not called when using polymorphic behavior with pointer to interface?

I implemented a strategy design pattern, therefore I have a pointer to an interface in the Context class so I can use polymorphism. I want to call the subclass and base class destructor of Strategy classes when the object goes out of scope, nevertheless this not happen if I use a pointer to the interface.  I changed the pointer to the Abstract class in the Context class and everything works as expected, the destructors are being called when the instance goes out of scope. Also, I debugged the application and the smart pointers are releasing the allocated memory so I would expect the other destructors to be called.  I would like to know why the destructors are not called when the interface is pointed to and what is the right approach to keep the abstraction as high as possible. How the interface is different from the Abstract class that calling hierarchy is not respected.  I'm using:   gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0  Win10 x64 Intel Core i7 @2.7GHz 16 GB RAM   Here is the code I'm testing with:  #include <iostream> #include <string> #include <memory>  class StrategyInterface  { public:     virtual void print() = 0; };  class AbstractStrategy : public StrategyInterface { private:     int a; public:     AbstractStrategy();     virtual ~AbstractStrategy();     virtual void print() { std::cout << "Printing from Base\n"; } };  AbstractStrategy::AbstractStrategy() {     std::cout << "Calling base constructor\n" ; }  AbstractStrategy::~AbstractStrategy() {     std::cout << "Calling base destructor" ; }  class ConreteStrategy1 : public AbstractStrategy { public:     ConreteStrategy1()  { std::cout << "Hello from SubClass1 constructor \n"; }     ~ConreteStrategy1() { std::cout << "Hello from SubClass1 destructor \n"; } };  class ConreteStrategy2 : public AbstractStrategy { public:      ConreteStrategy2() { std::cout << "Hello from SubClass2 constructor \n"; }     ~ConreteStrategy2() { std::cout << "Hello from SubClass2 destructor \n"; } };  class Context { public:     Context(int a)      {         if (a)         {             t = std::make_unique<ConreteStrategy1>();              t->print();         }          else         {             t = std::make_unique<ConreteStrategy2>();             t->print();         }     }      ~Context() = default; private:      std::unique_ptr<StrategyInterface> t; };  void test() {     Context context(0); }  int main(int argc, char const *argv[]) {     test();     return 0; }   My expected output:  Calling base constructor Hello from SubClass2 constructor Printing from Base Hello from SubClass2 destructor Calling base destructor   Note: this works when I use this std::unique_ptr<AbstractStrategy> t; instead of std::unique_ptr<StrategyInterface> t;  My actual output:  Calling base constructor  Hello from SubClass2 constructor Printing from Base   As you can see the destructor is not being called when the object goes out of scope.


Finding functions such that $f(g(x)) = f(x)g(x)$

Let's assume the functions in question are continuously differentiable. If $f(g(x)) = f(x)g(x)$, then: $$f'(g(x))g'(x) = f'(x)g(x)+f(x)g'(x)$$ I attempted to find a particular solution by letting $g(x) = x$. Then, $$f'(x) = xf'(x) + f(x)$$ $$df = xdf + fdx$$ $$\frac{df}{f} = \frac{dx}{1-x}$$ $$\ln(f(x)) = -\ln(1-x)+C$$ $$f(x) = \frac {A}{1-x}$$ Where $A$ is a constant. This solution was fairly unsatisfying to me, and upon checking it, I see it doesn't actually work, as letting $g(x) = x$ leads to $f(x) = xf(x)$. I was wondering if there were better answers, or at least a less trivial way to go about the problem.


Finding a combinatorial argument for an interesting identity: $\sum_k \binom nk \binom{m+k}n = \sum_i \binom ni \binom mi 2^i$

Consider the following identity   $${{n}\choose{0} }{m\choose n} + {n\choose 1}{{m+1} \choose n}+ \cdots +{n\choose n}{{m+n} \choose n} =\sum_{i=0}^{\min (m ,n)} {n\choose i}{m\choose i}2^i$$  The right hand side looks really neat to me but I can't find any combinatorial argument to this.I'm totally stuck on how to approach. I'd like hints and not full solutions.  EDIT I guess asking for a hint was a bit too much for this question. Apologies.


Possible Duplicate:             In the itemize environment, how do I use the ampersand symbol & without LaTeX trying to use it as a command?


Many-year-old laptop batteries: safe in my closet? For how long?

I have laptop batteries that are a few years old and lost their charges, but which I've still kept "just in case"*. However, I've heard that letting them lose all of their charges can be dangerous. Does this mean they could burst into flames one day? How much longer can I keep them around?  *Note: Yes, I do realize they probably won't hold charge anymore, but that's not my quesiton. I'm only asking about their safety, not usefulness.


NullPointerException while Reading .tab file

I am trying to read a .tab file but getting a NullPointerException error.  Exception in thread "main" java.lang.NullPointerException     at project.FTAFileReader.<init>(FTAFileReader.java:37)     at project.FTAFileReader.main(FTAFileReader.java:103)   Please find the code below  public FTAFileReader(){      try {             BufferedReader buffer;             buffer = new BufferedReader(new FileReader("event_trace.tab"));                                  buffer.readLine(); //Skips the first line of the file.              String currentstr;             while((currentstr=buffer.readLine().trim()) != null){                 String[] column = currentstr.split("\\s+");                           if(column.length>0){                     //hostID.add(Long.parseLong(column[0]));                     eventID.add(Integer.parseInt(column[0]));                     componentID.add(Integer.parseInt(column[1]));                     nodeID.add(Integer.parseInt(column[2]));                     platformID.add(Integer.parseInt(column[3]));                     nodeName.add(Double.parseDouble(column[4]));                     eventType.add(Integer.parseInt(column[5]));                     eventStartTime.add(Long.parseLong(column[6]));                     eventStopTime.add(Long.parseLong(column[7]));                     eventEndReason.add(Integer.parseInt(column[8]));                                      }                             }         }          catch (IOException e) {             e.printStackTrace();             System.out.println("The simulation has been terminated due to an IO error");         }        }   Any help will be highly appreciable. Thanks in advance.  Yogesh Sharma


I found a sentence.      Please do not hesitate to contact me should you have any questions.   In this sentence the word 'should' has connected two sentences. I want to know the usage or the meaning and what this 'should' express in this sentence. Is equal to "if" ? If it is so, is it a way of more formal or awkward, unofficial ? *Please do not hesitate to contact me if ( instead of should) you have any questions.*    How can the word 'should' connect two sentences as above.


Proving $\mathbb{E}\max\{\xi^2,\eta^2\}\leq 1 + \sqrt{1-\rho^2}$

Let $\xi$ and $\eta$ be random variables and $\mathbb{E}\xi=\mathbb{E}\eta=0$ also $\mathbb{D}\xi=\mathbb{D}\eta=1$. Here $\rho=\rho(\xi,\eta)$ is a correlation coefficient. Need to show $$\mathbb{E}\max\{\xi^2,\eta^2\}\leq 1 + \sqrt{1-\rho^2}.$$  So, I know that $\rho=\rho(\xi,\eta)=\frac{\mathbb{E}(\xi-\mathbb{E}\xi)(\eta-\mathbb{E}\eta)} {\sqrt{\mathbb{D}\xi \mathbb{D}\eta}}$.  But how to start and what qualities to use?


Why does $\left(1+ 1/k\right)^k$ converge to $e$ as $k \to\infty$?

I came across this when learning about sequences and series. No one proved it to me tho! Is there a link anywhere? Or would it be beyond what I know? (First term of analysis)


I am writing a contributions page of my thesis and thus I would like to use the referencing system built into LaTeX to format a few journal entries. Is there anyway to place individual BibTeX entries mid document?   For example I would like to write a paragraph of text, followed by a full reference on its own line, followed by another paragraph of text.   Thanks.


I want to convert Date format from 2017-02-08 00:00:00.0 to dd/MM/yyyy(08/02/2017). I tried with the following code.            String dateInString  =bean.getDate();           Date date = null;           SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");            if (bean.getDate().matches("^[0-9]{2,4}(-[0-9]{1,2}){2}\\s[0-9]{1,2}(:[0-9]{1,2}){2}\\.[0-9]{1,}$")) {                 try {                     date = formatter.parse(dateInString);                 } catch (ParseException e) {                     e.printStackTrace();                 }           }    But I am getting NullPointerException in date = formatter.parse(dateInString); line.


Give two integers $m$ and $n$ such that $n^2$ is a multiple of $m$, $n$ is not a multiple of $m$ and $n > m$

Give two integers $m$ and $n$ such that $n^2$ is a multiple of $m$, $n$ is not a multiple of $m$ and $n > m.$   I think that such two integers don't exist, but even if that were true, I'm having trouble with proving that. I have found clear examples when I neglect the last condition ($n > m$).  Any help on this problem would be much appreciated. The observation that I did make is the fact that since $n^2$ is a multiple of $m$ we can write it as $k * m$, which means that $k$ has to be larger than $n$.  I think that could be a starting point of some sort, but I wasn't capable of going any further.


Are you able to load a lighting component within another lighting component

Question) How to put an existing lighting component, within another lighting component.


My While loop conditions are not working?

I have a few problems with my code.  After my input for Complete Name it goes to Gender loop right away. My while loop in gender is not working. It's not reading the conditions I have set. It doesn't read a hasNext or hasNextLine in my menu because it reads the nextInt right away. It doesn't read a hasNext or hasNextLine in my ob because it reads the nextDouble right away.  import java.time.LocalDate; import java.text.SimpleDateFormat; import java.util.Date;  public class BankAccountSystem extends Bank {     public static void main(String[] args)     {         Scanner ba = new Scanner(System.in);         Bank BankAccount = new Bank();         int menu = 0;         double ob = 0;         String name, address;         String gender = "";         LocalDate dateToday = LocalDate.now();         Date date = new Date();          System.out.print("\f");         do {             System.out.println("\nWhat are you looking for?"             +"\n1.) New Accounts"             +"\n2.) Deposit"             +"\n3.) Account Inquiry"             +"\n4.) Account Inquiry by Date"             +"\n5.) Inquiry by Status"             +"\n6.) Show All Accounts"             +"\n[Enter a num 1-6]");                          menu = ba.nextInt();             switch (menu)             {                 case 1: System.out.print("Enter complete name: ");                 while (ba.hasNextInt())                 {                     System.out.print("Enter a valid complete name: ");                     ba.next();                 }                 name = ba.nextLine();                 //gender loop                 System.out.print("Enter gender [M-Male or F-Female]: ");                 ba.next();                 while (!(gender == "M" && gender == "F") || ba.hasNextInt())                 {                     System.out.print("Wrong input. Try again."                     + "\nEnter gender [M-Male or F-Female]: ");                     ba.next();                 }                 gender = ba.next();                                  System.out.print("Enter Address: ");                 ba.next();                 address = ba.nextLine();                                  System.out.print("Enter opening balance [Min: 500]: ");                 while (ob < 500 && !ba.hasNextDouble())                 {                     System.out.print("Opening balance must be at least 500: ");                     ba.next();                 }                 ob = ba.nextDouble();                                  SimpleDateFormat timeNow = new SimpleDateFormat("hh:mm:ss a");                 System.out.println("\nAccount created successfully!"                                     +"\nBank Account Number: " + BankAccount.accountNum(111,999)                                     +"\nDate Opened: " + dateToday + " " + timeNow.format(date));                 break;             }         }while(menu != 0);     } }


How to apply texture to one face of an object in cycles render?

I can find dozen of tutorials on how to apply texture to one face of an object in Blender Render, but nothing for Cycles Render!  I selected the faces I wanted, added material, chose an image texture, brought up the uv editing screen, did the smart uv project, made sure the correct texture was selected.   Didn't work; the object is still 100% the first texture I had applied.  Any tips?


4 colors/corners gradient with Illustrator or Photoshop

I should create a vector rectangle filled with a gradient made of 4 colors, one for each corner. I could just find some very generic information about using live blends, but I am not sure that is the best tool and still I was not able to do this. How would you get that in Illustrator exactly? (And secondary in Photoshop?)


What is that port with a chain-like logo on my laptop?

I found this port on my new laptop (a LG Gram). It is small, about the size of a mini-USB, and has a logo that looks like a chain. I don't have the documentation with me right now.  A  returns nothing except "Gadget". I couldn't find anything with a normal Google search.  I also tried to look at several questions here but for some unknown reason, the pictures in the similar questions don't load (and I have no problem to see picture on SciFi.SE for example). They seem not to match my question.


Displaying two XML listings side by side.

I have two XML outputs from a program that I would like to include in a LaTeX document. I would like them to appear side-by-side each in its own box. So that a reader can compare the two outputs while reading the document. Can't seem to find a way to do this, without making images for each output and adding both as images/graphics. Could there be a better option?


I have been following this thread(Forgive me, I am new here and do not know how to reply to the existing thread):    I have a MacBook Pro (Retina, Mid 2012) 2.6Ghz Intel Core i7, 16GB DDR3 with the GeForce GT 650M 1GB and it has the Apple SSD SM512E.  I am running macOS High Sierra 10.13.3 and I want to put a Samsung EVO 960 NVMe 2TB in it. Can I do that. All the data in the thread I linked to is 2013 Macbooks or newer.


tolower() segfault's when trying to assign the returned value a char pointer

I'm trying to understand the black voodoo magic that are pointers and I can't get my head around the following cases. My understanding of the first parameter of getline() is clumsy, so I guess it all comes down to its type, which is different from the word in the second example. The following is an extract from a function that loads a file (a dictionary of words) and reads its content line by line. Why does tolower() work in this first example: int l; size_t len = 0; char *word = NULL;  while ((l = getline(&word, &len, fp)) != -1) {     for (char *p = word; *p; ++p) *p = tolower(*p);     // Irrelevant code below }  But segfaults in this second example, right after trying to assign the return of tolower() from the first char: char *word = "POTATO"; for (char *p = word; *p; ++p) *p = tolower(*p);


How to change text background color in PowerPoint 2013

I need to make presentation and paste there some code blocks from Visual Studio and preserve the text formating. Unfortunately when I paste it with keeping the format, the text has white background. Where can I change it to transparent?


(Javascript) Can a global function contain locally declared variables?

I'm currently working on a codewars kata (Convert RGB number (0-255) to hexadecimal) and came across something interesting when trying to improve the readability of my code. I want to construct a global function to work with local variables, but when I try to run the code it throws an undefined error on the "j" variable (and also presumably the "i" variable). Code below:  function rgb(r, g, b){   let x   let y   let z   function conversion(){     switch(j) {             case 10:               j = 'A'               break             case 11:               j = 'B'               break             case 12:               j = 'C'               break             case 13:               j = 'D'               break             case 14:               j = 'E'               break             case 15:               j = 'F'           }           switch(i) {             case 10:               i = 'A'               break             case 11:               i = 'B'               break             case 12:               i = 'C'               break             case 13:               i = 'D'               break             case 14:               i = 'E'               break             case 15:               i = 'F'           }   }   if (r <= 0) {     x = '00'   } else if (r >= 255) {       x = 'FF'     } else {         let i = Math.floor(r / 16)         let j = Math.floor(r - i * 16)         conversion()         x = i.toString() + j.toString()       }   if (g <= 0) {     y = '00'   } else if (g >= 255) {       y = 'FF'     } else {         let i = Math.floor(g / 16)         let j = Math.floor(g - i * 16)         conversion()         y = i.toString() + j.toString()       }   if (b <= 0) {     z = '00'   } else if (b >= 255) {       z = 'FF'     } else {         let i = Math.floor(b / 16)         let j = Math.floor(b - i * 16)         conversion()         z = i.toString() + j.toString()       }   return x + y + z }   So as you can see, it would be nicer to use the "conversion" function rather than copy paste all that code three times. Any ideas on this topic? Thanks in advance.


List all non-stop flights between any European city and city X?

My friend was asking "from which European cities can you fly non-stop to Mumbai?"  Similarly I'd like to know all cities in Europe with non-stops to Hong Kong.  (Note too that ideally it would be better to know "dailies"... since once a week etc kind of sucks.)  The only way I know to do this currently:if you go to the online live departures board for an airport, say Zurich, and if you look through a couple of day's worth, you will indeed, discover, pretty much all the non-stop flights from that city!  This is not ideal, so someone may have a better answer.  So, the best way to find this info?  All the non-stop possibilities from X to which European cities?


Can Blindsight "See" Through Walls, Floors, And Ceilings?

I am currently play-testing an Awakened Mystic character in D&D 5e, using the beta rules . As such, I have an ability that lets me choose between having Blindsight or Tremorsense.  BLINDSIGHT: ...[B]lindsight can perceive its surroundings without relying on sight, within a specific radius.... (Monster Manual p.8) TREMORSENSE: ...[T]remorsense can detect and pinpoint the origin of vibrations within a specific radius, provided that the [observer] and the source of the vibrations are in contact with the same ground or substance. Tremorsense can't be used to detect flying or incorporeal creatures.... (Monster Manual p.9)  I have been wondering what the difference is between these two, aside from the fact that Tremorsense requires contact with the ground and cannot detect flying or incorporeal creatures. Specifically, I want to know whether Blindsight cannot detect creatures through solid matter such as walls, floors, and ceilings, whereas Tremorsense can? Can Blindsight detect creatures on the other side of a dungeon wall, or on another floor of said dungeon? Are there monsters in 5th Edition that possess both Blindsight and Tremorsense, and if so, when and why would they use one as opposed to the other? I am aware of and appreciate  regarding Blingsight's capability to detect invisible creatures, but it doesn't exactly address my issue of whether solid matter effectively "blocks" Blindsight. I will gladly consider either rules-as-written or rules-as-interpreted answers. If there is a published game mechanic or a posted developer ruling I have overlooked, please include and cite them in your answer.


How to download multiple videos in one search?

I tried   youtube-dl 'ytsearch:football'   but this command downloads only the first video in the top of search results.  How to download the top 10 search result ?


Entire function. Prove that $f(\bar{z})=\overline{f(z)}, \forall z\in C$

Let $f$ a entire function: $f(R)\subset R.\;$ Prove that $f(\bar{z})=\overline{f(z)}, \forall z\in C$


what is the difference between binary and txt modes in C++

I began to use C++ recently,and this may seem to be a nieve queation but I couldn't find an answer for it. When creating an fstream object, I have two options for mode,  binary and txt. fstream f ("file.txt",ios::out|ios::binary); and fstream f ("file.txt,ios::out|ios::binary);  both write the same strings when use the overloaded operator << . my question what is the differwnce between the two modes and does it affect the number of bytes used to write characters to the stream, so you will need a diifferent seekg when you read data written with each fstream ?


I am iterating a list with size approx. 500.  On using For each loop it took approx 1ms to reach last record where as Stream API took approx more than 50ms to filter particular record.  Why should I use stream API and where its beneficial ?


Spoilers from the Season 7 finale of Game of Thrones, "The Dragon and the Wolf".  In one of the final scenes, Jaime and Cersei are discussing Jaime's future with them, at which point       Cersei nods her head, signaling the kill order for 'The Mountain', yet 'The Mountain' pulled out his sword but why didn't he kill Jaime?


Touchpad only starts working after suspend on Ubuntu 16.04 of Asus laptop

I have a weird problem with my ASUS K556UB laptop. When I start the computer, the touchpad doesn't work, it is shown in xinput output and in /proc/bus/input/devices.   Here's the weird part: it starts working when I wake the computer from suspend. So the driver is working. Anyone got any idea how I could get it working without suspending and waking? Here are the outputs from xinput, cat /proc/bus/input/devices and synclient, respectively:        As you can see, it's an Elantech touchpad, I've had a few laptops with Elantech touchpads and they worked perfectly. A mouse is also in the outputs, I had to attach it to use the computer. It had no effect on the touchpad.  Hardware: Asus laptop K556UB OS: Ubuntu 16.04 64 bit


Question : Is it considered ОК to copy-paste someone else's answer to an earlier question as your own, as long as you provide a link back to the original answer?  Background : A  has been posted this morning that happened to be a duplicate of  with a rather detailed code in the .  Within minutes, two answers ( and ) showed up, containing the exact copy of the code from the answer to the old question. The only difference between the two answers has been that the first one linked the source question, while the second one copy-pasted someone else's answer with no further explanations.  I flagged both answers for moderator's attention. The "plain" copy-paste flag got accepted, but the flag for the answer with the link got rejected. The only difference between the accepted and rejected flags was a link back to the copied original, prompting my question about the fair use.


I recently installed Ubuntu (32-bit) on my older computer and tried to play some games on it with steam. Once the launcher has been installed, it wouldn't launch, but I fixed it with the help of . Once it launched, it started updating. Once that was done, it closed, and would never open again. When I type steam in the terminal I get this:


Which version is be best for thin clients?

We have a handful of thin clients that are about 6 years old. We primarily use Citrix and Google apps.


How to get name of subclass from an instance of the superclass placed in another class?

for example in the code below I want to get "Dog" or "Cat". How do I do that?  public class Animal {     // insert code here }  public class Dog extends Animal {     // insert code here }  public class Cat extends Animal {     // insert code here }  public class test {     Animal animal = new Animal();     // how do I get the name of the subclass i.e. how to get that the      // animal is a dog if it is in fact a dog??! }


Wifi gone after latest Ubuntu 14.04 update on August 25, 2016

After an upgrade to my 32-bit Ubuntu 14.04.5 LTS today, my wireless card is no longer noticed. It is a Broadcom, using their driver.     09:00.0 Ethernet controller: Broadcom Corporation NetLink BCM5906M Fast Ethernet PCI Express (rev 02)      0c:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)   Ethernet still works.  Going back to a previous Ubuntu temporarily solves the problem.  My computer is an old (2008) Dell XPS laptop. I've never had any wireless problems until today.  Following the directions shown did not fix the problem:     WARNING: Security updates for your current Hardware Enablement   Stack ended on 2016-08-04:   *       There is a graphics stack installed on this system. An upgrade to a   configuration supported for the full lifetime of the LTS will become   available on 2016-07-21 and can be installed by running 'update-manager'   in the Dash.   Any thoughts? Thanks, Bill


I found == is little confusing for newbies, So I want someone to explain how it works.   For example -   new String("a") == "a" and "a" == new String("a") are both true. new String("a") == new String("a") is false.   Why?


Locking down a Windows 7 PC to just a browser

I have been tasked with building several PCs to act as secure kiosks that allow users to view and use an intranet site at my company.  Our LP staff will cover physical security, so that is not a concern. To prevent booting from a USB drive or walking with the HDD, I will be encrypting with BitLocker.  What I am having trouble with is deciding on a method to lock down Windows 7 in such a way that the only thing a user has access to is a browser (in this case, IE9) and limit the browser to specific URLs (or domains). I have considered doing this through Group Policy, but it seems there would be a substantial amount of research, development, and testing involved to get it right. With that said, does anyone know of a free or inexpensive piece of software that can accomplish this? Any recommendations would be appreciated.


Prove: the intersection of Fibonacci sequence and Mersenne sequence is just $\{1,3\}$

$$\frac{{{\varphi ^n} - {{(1 - \varphi )}^n}}}{{\sqrt 5 }} = {2^m} - 1 .$$ Here $\varphi  = \frac{{1 + \sqrt 5 }}{2}$ . This integer equation has no solution for $n>3$ and $m>2$. How to prove?


Is there a way to retrieve the oldMap of a trigger in a future method?

This could be quite a dumb question though, I would like to ask is there a way to retrieve the oldMap of a trigger in a @future method? In the below code please refer the collection "oldReportsMap", Can I refer the old map of the record Ids? BELOW CODE IS THE EXSISTING ONE AND NEED TO MAKE GENERIC FOR MULTIPLE OBJECTS /*  * Populate acount fields on creation of the Report record.  */ public class updateAccountFields implements Triggers.Handler {     public void run(){                  if (!(Trigger.isAfter && Trigger.isInsert)) { return; }                  List<Report__c> triggerReports = (List<Report__c>) Trigger.new;         Set<Id> reptIds = new Set<Id>();                  for (Report__c report: triggerNewReports) {              reptIds.add(report.id);         }          // process accounts fields         if (Test.IsRunningTest()) {             processUpdateAccountFields(reptIds);         } else {             processUpdateAccountFieldsFuture(reptIds);         }              } }  @future public static void processUpdateAccountFieldsFuture(Set<ID> reptIds) {     processUpdateAccountFields(reptIds); }  /*  * Populate account fields on creation of the Report record.  */ public static void processUpdateAccountFields(Set<ID> reptIds) {        Set<Id> acctIds = new Set<Id>();          Map<Id, Report__c> reports = new Map<Id, Report__c>([SELECT Id, ReceivedDate__c, DueDate__c, Account__c FROM Report__c WHERE id IN: reptIds]);          // retrieve the related accounts     for (Report__c report: reports) {          acctIds.add(report.Account__c);     }          Map<Id, Report__c> oldReportsMap = new Map<Id, Report__c>([SELECT Id, ReceivedDate__c, DueDate__c, Account__c FROM Report__c WHERE id IN: ????]);          for(Id reptId :  oldReportsMap.keyset()){         ... some more code...     }     .... Some more code/logic.... }  Thanks  UPDATE:  Unfortunately serialization doesn't work for me it takes considerable amount of time to serialize the old object, and I have an sObject which could be a standard object or a custom object depends on the sObjectType. eg: our account object has 943 fields at the moment. I do not want to serialize all account object's fields just to track one field change. so far what I could see is, according to my scenario, there is no way of accessing oldMap since it is not in the trigger context when at a future call.  I found that there is an idea to for an functionality for apex. please note that our org gets updates for multiple objects via webservice API and this could update considerable number of records at a one call, which leads to a timeout the service request due to above mention issue.  Thanks all for your support!


QGIS: Edit attribute values of GeoJSON file: toggle editing greyed out

I'm trying to edit the values of attributes in QGIS, but it does not work. I tried to google an answer, but couldn't find anything so far. This is what I'm doing:   Open QGIS. Drag in a GeoJSON file. It becomes a vector layer. Menu bar > Layer > Toggle Editing.   I cannot toggle editing. It is greyed out. Am I missing something (I'm relatively new to QGIS)?  QGGIS Version  QGIS version 2.10.1-Pisa QGIS code revision  Compiled against Qt 4.8.6 Running against Qt 4.8.6 Compiled against GDAL/OGR 1.11.2 Running against GDAL/OGR 1.11.2 Compiled against GEOS 3.4.2-CAPI-1.8.2 Running against GEOS 3.4.2-CAPI-1.8.2 r3921 PostgreSQL Client Version 9.4.4 SpatiaLite Version 4.2.0 QWT Version 6.0.2 PROJ.4 Version 491 QScintilla2 Version 2.9


In Pool... the only 2 balls remains what will happen if

If only the white and black balls remains, and I hit the black one and it’s get in pocket first.. and then the white one goes out the table I consider myself  won or lost


I am a beginner in photography and I don't have the right understanding for some things. As I understand, with the ISO the camera is more or less sensitive light, with a darker image, a higher ISO (Also changes the noise in the image)  Then we have aperture and shutter speed. More aperture, more light (and changes the deep perception) and more shutter speed, less light (also captures better the movement)  Can we not change shutter speed and aperture to capture better photos with different light, instead of the ISO? If its dark, we can make a wider aperture and/or change the shutter speed, if there is too much light we can close it and make the shutter faster  Why the ISO then? Is it only for the cases that we want an specific aperture for an specific deep perception? Or because with long time shutter speed we need something to make it the camera stable and not be blurry? Don't we add noise increasing the ISO? What am I missing?  The Question: Why use ISO instead of Aperture and Shutter speed?


Accepting a tenure track position if I know I won’t stay till tenure

I am currently a fixed-term faculty, with the hopes of a tenure-track position somewhere. The last two years I’ve bounced between fixed-term position, both in at least reasonable long-distance driving from where my fiancé and I live. Now a tenure track position has come available for next year still not close to us but again reasonable long distance driving (I've worked anywhere from 1.5-3 hours away).   I am hoping in the time it would take to get tenure at this new position, a tenure track position in our actual city will become available (pretty big metro). Would I be screwing myself to leave the long-distance tenure track position without tenure, if I got a tenure-track position in our local city? Would it be a red-flag that I’m even applying without tenure or could I explain location as the reason for the move in my cover letter?


How to monitor the progress of dd command in linux?

I am copying this .img file to my USB flash drive using dd command. How can I check its progress ?


I just installed gparted because I have a 135 GB flash drive that I want to use for bootables for different OSs.   After I installed gparted and opened it from the Dash, I got the prompt for my password, entered it, the window closed, cursor turned to the loading symbol, I waited, the cursor went back to normal, that was it.  I installed it with sudo apt-get install gparted.  The output from gksudo gparted is  Error copying '/home/amolith/.Xauthority' to '/tmp/libgksu-k9KFpI': No such file or directory   The output from gparted-pkexec is  Created symlink /run/systemd/system/-.mount → /dev/null. Created symlink /run/systemd/system/boot.mount → /dev/null. Created symlink /run/systemd/system/run-user-1000.mount → /dev/null. Created symlink /run/systemd/system/run-user-120.mount → /dev/null. Created symlink /run/systemd/system/snap-core-2381.mount → /dev/null.   Created symlink /run/systemd/system/tmp.mount → /dev/null. No protocol specified  (gpartedbin:6347): Gtk-WARNING **: cannot open display: :0 Removed /run/systemd/system/-.mount. Removed /run/systemd/system/boot.mount. Removed /run/systemd/system/run-user-1000.mount. Removed /run/systemd/system/run-user-120.mount. Removed /run/systemd/system/snap-core-2381.mount. Removed /run/systemd/system/tmp.mount.   Any help would be greatly appreciated.


I want to use eVis but cannot find it in the plugin manager. I know it was going to be merged into the core of QGIS. Has it changed name and location?


How can I keep an app open in the background?

As I was using an app on my iPhone, I accidentally hit the home button. I quickly reopened the app. But instead of it resuming where I left off, the app had to load all over again. (This was Clash of Clans and I was in a raid!)  Is there a way to keep an app open in the background?  Such a feature would also allow me to quickly check something and then return to the app that I was on.


I have a environment variable called NAME   export NAME="xyz"   and inside a file test.txt , I have a line   name=$NAME   I read the file and assigned the line to a variable y  y=`cat test.txt`   Now I am printing the variable y   echo $y   How can I get an output of name=xyz instead name=$NAME?


Soql query for retrieving images from notes and attachments

I want retrieve image from documents in not other notes like pdf,ext... please how to write soql query


Minecraft map spawnpoint for any player that joins

I am creating a minecraft 1.14 puzzle map. I would like to know how to set a spawnpoint for any player that downloads the map. Can anyone help me with this?


Do researchers actually read all of the papers they cite?

I am a PhD student (middle stage). I have read only 2-research papers from last six seven months. I have seen some research papers in which they have cited around 12-15 research papers and I think this is the case with every research paper. To me it seems unrealistic to read 12-15 research papers with the details I have read first two.     Question : What fraction of the cited papers has the typical author actually read?


Run Application from C# in a different context

I want to build a Mater-Slave structure with console applications.  In the root directory I have my main application. After the application started it starts the slaves which are located in a subdirectory of the root directory.  Not a problem so far. The real problem is that all applications are started like they are located in root directory. So I get all files that the slave application in the root directory and no files in the slave directory.  Is it somehow possible to start the application (preferrably using the Process class or similar ones) like you would do in windows explorer with double click?


list all the equivanlance relations in the set A={1,2,3,4)  so there should be 15 right? so what I got so far  (1 1) (22) (33) (44) (12) (13) (14) (21) (23) (24) (31) (32) (34) (41) (42) (43) these are 16 what did i do wrong


I'm trying to use the makemap hash command, but even as root it says Permission denied. Command i'm trying to run:  sudo makemap hash /etc/mail/authinfo/gmail-auth < /etc/mail/authinfo/gmail-auth -bash: /etc/mail/authinfo/gmail-auth: Permission denied


Can someone provide the correct order of watching the ova's and movies with the seasons


Consuming more memory instead of require?

I had install ubuntu 64 bit on my system (ubuntu 12.04 lts).  When I do free -m                total       used       free     shared    buffers     cached Mem:          5859       5284        574          0        251       4012 -/+ buffers/cache:       1021       4838 Swap:         6032          0       6032   I have total 6GB of RAM, now even I had just one application in used it show me 5284 are totally used, only 574 MB of memory is free.  What to do to resolved it or to debug it ?  Also when I fire TOP command, it show only few application running as in my system, but occupied memory are very much?


As of patch 1.5, I am completely unable to see underwater in Skyrim.  It's not even that it's murky or dark - it's just a solid grey or green screen.  I can still skim across the surface and see into deep waters, but if I go any deeper than that, nothing is visible.  I can still access items like chests underwater if I figure out their location first (by skimming across the surface) and then point my character there and hope really hard that it gets me to the right place.  I was never able to see much underwater, but I at least used to be able to see small things like wood floating near a shipwreck.  Now, there's just nothing. I am running the Steam version of Skyrim with graphics on Ultra High, with the high res textures DLC.  I've tried disabling the high res textures (along with all my other mods) and it still happens.  In case it's relevant, my GPU is a GTX 560 Ti.  Does anyone have any solutions to this?


Reposition Spotlight search bar to its default location in macOS Mojave

I accidentally dragged and moved the Spotlight search bar shown on pressing Command + Space. This is what it looks like now:    I want to re-center it, but I am not very sure how to do it precisely. Is there a way or a setting to move it back to its original location again?  I am using macOS Mojave 10.14.


Finding the integral of a function between 0 to 1

Let $f$ be a differentiable function such that $f(f(x)) = x \forall x \in [0,1]$. Suppose $f(0) = 1$. Determine the value of $\int_0^1 (x - f(x))^{2016} dx$.  I noticed that $f(x) = 1-x$ satisfies the properties, and putting $f(x) = 1-x$ and substituting $x - f(x) = z$ , I can calculate the integral. But is there any other way which does not require the assumption that $f(x)=1-x$?


Removing extra new lines with print() in python

I have written these lines in a file  AA BB CC   With the following python code  f = open("foo.txt",'r') for line in f:     print (line)   I see that there is a newline between each line that is reads from  AA  BB  CC  # terminal prompt   How can I remove those new lines?


Why is the polynomial ring of more than one variable not a PID?

Let $R$ be a field. Show that the polynomial ring $R[x_{1},...,x_{n}]$ is not a PID if $n>1$.    How do I show this?   So far, I've shown that $(2)+(x)$ wouldn't be principal in $\mathbb{Z}[x]$ so I was thinking of showing that $(x_1)+(x_2)$ would not be principal.


Using sed to delete everything between two words?

doesn't seem to work  The next example would delete everything between "ONE" and "TWO:"   #!/bin/sh sed ' /ONE/ { # append a line     N # search for TWO on the second line      /\n.*TWO/ { # found it - now edit making one line         s/ONE.*\n.*TWO/ONE TWO/     } }' file   i was expecting to delete everything between ONE and TWO.i tried with file where file contains.  [user5@mailserver ~]$ cat file ONE hello TWO   but the output come like   [user5@mailserver ~]$ ./test ONE hello TWO   I was expecting ONE TWO I am trying to make it correct but not able to do.


Proof by induction that $B\cup (\bigcap_{i=1}^n A_i)=\bigcap_{i=1}^n (B\cup A_i)$

$\displaystyle B\cup (\bigcap_{i=1}^n A_i)=\bigcap_{i=1}^n (B\cup A_i)$  I was able to prove this without using induction, however I am supposed to prove it using induction. How should I go about doing so?


Is Mirai Nikki OVA equal to the manga ending?

The final scene where Yuno breaks into his world is crucial for the ending, yet they saved it for the OVA. Many people I know haven't seen the OVA, and missed this final embrace.  I remember reading the final volume of the manga because the anime ending seemed inconclusive, until I realized the OVA had the final ending.  Why does the anime conclude seconds before the manga concludes?


Lost uk passport. Due to fly from Jersey to London and London to India tomorrow? How can I get a replacement passport?

I have looked at all info on gov website but although you can make an appointment for an express passport the option is not there if passport is lost. Also where should I go in London. Address please?


It is possible to dual boot Linux and Windows 10 with secure boot enabled?

Every single information I run across says that in order to dual boot, I need to disable secure boot. This is confusing because according to this  Ubuntu should work with secure boot. This wasn't the case for me. I had to disable it just to get grub showing.   At one point in time yesterday and today I decided to experiment with bcdedit to see if I could get Windows boot manager to handle the dual boot process instead and keep secure boot intact. That was a no go either.  So it it possible to dual boot Linux and Windows 10 with secure boot enabled?


I am beginner to using Tasks in C#. I am trying to create loop counter and pass it to function, that logs result. The loop looks like this: List<Task> levelGroupsTasks = new List<Task>(); foreach (TableWithLevel table in levelGroup.Value) {     counter++;          // Section for adding task into list }  await Task.WhenAll(levelGroupsTasks);  I tried this aproach: levelGroupsTasks.Add(Task.Run(() => DeleteTableFromDestination(table.TableName, count, counter)));  But the logged counter for each table was same value, for example starting at 238 index (1-269 expected) I tried add counter++ directly in Task.Run like this: levelGroupsTasks.Add(Task.Run(() => DeleteTableFromDestination(table.TableName, count, counter++)));  This logged correct values for each table from 1 - 269. I tried another aproach like this with new wrap function: levelGroupsTasks.Add(DeleteTableFromDestinationAsync(table.TableName, count, counter));  private async Task DeleteTableFromDestinationAsync(string tableName, int count, int counter) => await Task.Run(() => DeleteTableFromDestination(tableName, count, counter));  And the result was also correct. My question is, why the first aproach with passing Task.Run is not working and passing wrong values of counter?


Does the series $\sum_{n=1}^\infty$ ${\sqrt{n+1}-\sqrt{n}}\over n$ converge or diverge?

Does this series converge or diverge?  $$\sum_{n=1}^\infty\frac{\sqrt{n+1}-\sqrt{n}}{n}$$  I tried the comparsion test with $\sum_{n=1}^\infty$ $1 \over n$ but this does not help.  I also tried to simplify the series to $\sum_{n=1}^\infty \frac{1}{n (\sqrt{n+1}+\sqrt{n}{}{}{})}$ but this become harder.


As stated in , the SE network only allows one draft per site.   However, in the iOS app, there's a folder for 'Drafts,' in which you can save multiple drafts (for questions) for each site:    With multiple drafts:    Why don't we have this functionality on the regular website? Can we please copy this feature to the website?  Or, at the very least, can we make it so we can write multiple drafts for a SE site?


Classisthesis section numbers not showing

I am using classicthesis with the MWE below. When I compile locally, section numbers are not showing, but are included in the Table of Contents. However, compiling with Overleaf does show the section numbers, both in the ToC and in the document. So I think this is an issue with the version/compiler I am using to compile locally (pdflatex on Ubuntu-16.04). How can I check which version of classicthesis is being called locally by pdflatex? And if it is out of date, how can I update it? \documentclass{scrbook} \usepackage[parts,pdfspacing]{classicthesis}  \begin{document}     \tableofcontents     \chapter{First chapter}     \section{First section}         Hello, world          \section{Second section}  \end{document}  Here is an image of how it looks when compiled locally:  Thanks.


Network Analyst resolved route can't display properly on printed map

I have looked on the Internet but there are no updated answers. I am using ArcMap 10.2. I am trying to print the route resolved by network analyst but there is no way I can display overlapped generated route when printed.    This is an example where the encircled section is passed through three times. Please help with how I can show them separately.


How can I find posts with tags in the body?

Is there a way to find the posts with tags in the body (not the questions tagged with specific tags)? I mean when post body contains tags written in a form of [tag:tag-name] and displayed as a clickable element like this one . P.S. I don't tag this post with  since description of that tag doesn't fit the purposes of my question. BTW: answer from the linked post  not a full tag.


Find the number of 3 letter words that can be formed from the word 'SERIES'.

To find the number of three letter words that can be formed from the word 'SERIES', with or without meaning and without repetition.   The number of permutations if all letters were distinct  = $^{6}P_3$.    As 'S' and 'E' are repeating, the arrangement in which 'S' are interchanged are the same, so we divide by $2!$ for 'S' and likewise for 'E'.    Number of permutations $= \frac{^{6}P_3}{2!.2!} = 30$   Which isn't the correct answer. I would like to get some help here.


Story Identification: Humans Living Within a Comet?

I wish I could remember more of this book.  The overall premise was that there were humans living within a comet, possibly even Halley's Comet.  I don't remember how they got there, but it was not something like a lost offshoot of the race.  They were the result of a mission to the comet or they were refugees.  They had tunnels running throughout the comet and had adapted to the difficult living situations and I think they had even evolved.  In the story, I think the comet was making its first approach toward the Sun after many years (I think so many that it likely wasn't Halley's Comet, but it might have been).  My memory is very sketchy, but I think they had to deal with not only the issues of the destabilization of their world as it approached the Sun, but also with the rest of humans on the Earth either wanting to land on the comet or bring it in or something else -- I don't remember what, but there was either some kind of conflict with Earth or Earth was totally disinterested in helping them as they swung so close to the Sun.  It was definitely a hard science book and I think the author was well known, but I don't remember for sure on that last point.


Question:   To be quite honest, I have no idea how I would approach this question so I do not have anything for you guys to tell me to work off of. I was wondering if I could get a hint as to how I can start this? Thanks!  edit: I'm not sure if my title is accurate, I'm just assuming we would use FTOC II based of the upper limit.


Why is there no article in "We are Family"?

Sister Sledge - We Are Family - YouTube I've searched on YouTube a song named 'We are Family'   Why use the sentence without an article 'a' or 'the'?


birthday problem - expected number of collisions

There are many descriptions of the "birthday problem" on this site — the problem of finding the probability that in a group of $n$ people there will be any (= at least 2) sharing a birthday.  I am wondering how to find instead the expected number of people sharing a birthday in a group of $n$ people. I remember that expectation means the weighted sum of the probabilities of each outcome:  $$E[X]=\sum_{i=0}^{n-1}x_ip_i$$  And here $x$ must mean the number of collisions involving $i+1$ people, which is $n\choose i$. All $n$ people born on different days means no collisions, $i=0$; two people born on the same day means $n$ collisions, $i=1$; all $n$ people born on the same day means $n$ collisions, $i=n-1$.  Since the probabilities of three or more people with the same birthday are vanishingly small compared to two people with the same birthday, and decreases faster than $x$ increases, is it correct to say that this expectation can be approximated by  $$E[X]\approx {n\choose 0}p_{no\ collisions}+{n\choose 1}p_{one\ collision}$$  This doesn't look right to me and I'd appreciate some guidance.    Sorry - edited to change ${n\choose 1}$ to ${n\choose 0}$ in second equation. Sloppy of me.


How is it like to live in Helsinki?  What is it like to live in Helsinki?  How is living in Helsinki?  What are the differences between these three sentences and what is the common way to ask someone for their opinion about the city they live in?


Removing duplicate copy of OneDrive in Windows 10 File Explorer

How can I remove the two copies of OneDrive in the File Explorer? I'd like to avoid registry hacks, as I don't want to brick my new laptop. It is a small bug and troublesome, but it's very annoying.


Photoshop: How to edit a shape when select again in its layer

Maybe this question seems easily but I don't know why it doesn't obvious in my current Photoshop settings.   I select shape tool and draw somethings (such as circle, rectangle ...). I see at this step, I see properties panel for change shape attributes:       I select another layers (for doing some work, so I lost focus current shape). And then I choose again new created shape layer. After that I choose Move Tool to select shape. I cannot see shape toolbar again for editing. I just see this toolbar:      And here is my screen after I select Shape tool   My question is: How can I select again shape and show shape toolbar for editing purpose ?  Thanks :)


What is partition alignment and why whould I need it?

What is partition alignment and why? Does it have something to do with the 2048-sector gap between two logical partitions?


Can't find solution for CSS vertical align for Firefox

I have a problem with DIV vertical align in Firefox  The HTML code is:

   The CSS looks like:  .mess{  float:left; width:658px; border-top:1px solid #CCC;padding-top:5px; } .rpl{ position: relative;width:19px; float:left;top: 20%;display: table-cell;   vertical-  align: middle; padding-top:20px; } .pic{width:100px; float:left; padding-bottom:5px;margin-right:10px; }   I'm trying to put "rpl" DIV at the vertical middle of the "mess" DIV.  In IE it looks fine but I can't get it right in Firefox (always at the top of the "mess" div)  I tried with display: inline,display: table-cell for "rpl" DIV but with no effect in FF.  Is there any solution for vertical align for DIV in FF?


I am using Hp laptop with pre-installted Windows 8 operating system. I have upgraded my windows 8 to windows 8.1 recently. My question is can i install ubunutu in my laptop. Please replay and help me to find a soluton.


Ubuntu 19.10 emoji missing on google chrome

I have ubuntu 19.10 on my computer and I installed google-chrome as default browser. I noticed that chrome not display emoji on different sites.  I tried reinstall, remove all catalog google-chrome from .config directory. Nothing from these actions didn't help. I also noticed that on firefox this problem not existing. Below I put images which describe the problem.


There doesn't exists an epimorphism from $(\mathbb{R}, +)$ to $(\mathbb{Q}, +)$ proof verification.

Suppose that such epimorphism exists, and call it $f$.  For fixed $x\in\mathbb{R}$, take $N = \text{Ker}(f)$ and $S = x\mathbb{Q}$.  Apply the second theorem of isomorphisms, that is: $$(SN)/N\cong S/(S\cap N) $$ But $(SN)/N = \{\text{Ker}(f)\}$, so that $S/(S\cap N) = \{ x+S\cap N: x\in S\} = \{ S\cap N \}$, hence $S = S\cap N$. This means that $S\subset N$, from which follows that $$\mathbb{R} = \text{Ker}(f)$$So that $f(x) = 0$ for all $x\in \mathbb{R}$, hence $f$ is not an epimorphism, and contradiction proofs that such epimorphism cannot exists.  Is this proof correct? Did I miss anything? Can it be done easier? Thank you.  Edit: Sorry, I see now that this proof isn't correct. Clearly, $NS$ doesn't have to equal $N$, which I thought is true because of additive and multiplicative notation confusion.


Error "Media change: please insert disc labeled..." when installing an application

I've tried several times to install radio tray on my fresh ubuntu 11.10 installation but when I run ~$ sudo apt-get install radiotraythe following dialog pops up at the end of the script:  Media change: please insert the disc labeled  'Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012)' in the drive '/cdrom/' and press enter   I've performed previous installations of this app on another computer using the same repository and all went smooth. My Ubuntu Oneiric version was installed from a USB flash drive, so don't understand that request from apt-get.


I'm creating a messaging system with PHP and MySQL but am having problems when certain characters are entered. Particularly the Pound sign (£).  The form where users write their message is POSTed to a PHP script with the following functions:  $message = htmlspecialchars($message, ENT_QUOTES); $message = utf8_encode($message);   Then $message is INSERTed into a Database where it is stored in a Text Column.  However, when inputing a Pound sign no data appears in the database at all on my live server, but on my localhost (using MAMP) Â£ appears in the database.  Anybody know whats going on? And is there a way to encode £ as &pound;, I feel like that might solve my issue.


How were the colors for white balance chosen? Why is it specifically temperature going from blue to yellow and tint going from violet to green?


Symbol for multiply divide, equivalent of plus minus?

Is there a symbol for multiply or divide, which acts like the $\pm$ symbol?


I am starting a new project in c# and I am looking for a tool that helps me do mutation tests. I have previously done mutation testing in java using  and liked it very much. Now I am looking for such a tool for C# and the only ones i can find are either not updated for the past few years or still in alpha/beta ( , , ).  Are there any tools available that are reliable and can be used with tools that came out after 2010?  EDIT: Some might say this question is a duplicate of . Only that question is currently 8 years old and most of the tools discussed there are not usable since most of them haven't been updated in the last 6 to 8 years.


How to monitor an already running application in a new Bash Terminal window?

An application is already running without command output, only GUi.  How can I grab the application's command output from a new terminal window?  Another application is already running as CLi, but I would like to monitor that specific application from a different window or even remotely without affecting the application itself?


Java Help (possibly a glitch in eclipse)

import java.util.Scanner; import java.util.Random;    public class cominback{     public static void main(String args[]){       Scanner key = new Scanner(System.in);       System.out.println(" please enter a password:");       String x = key.nextLine();       System.out.println("Connfirm your password:");       String y = key.nextLine();       if ( x == null)           System.out.println("please restart the program:");       if (x != y)           System.out.println("wrong password");       if (x == y )           System.out.println("you are logged in");      } }   It always print out wrong password for even when the input is same passwords. how can i fix this problem? did i do something wrong or is it my eclipse glitching?


QGIS update from 2.14 to 2.16 failed on Ubuntu 14.04

Until yesterday my whole qgis and python-qgis worked fine with version 2.14 under Ubuntu 14.04. After a simple sudo apt-get update and sudo apt-get upgrade qgis failed to update... Several attempts to reinstall it with different versions failed.  Current error message (for version 2.14.3) goes like this:  qgis-providers (2.14.3+dfsg-2~trusty1) is configured ... /usr/lib/qgis/crssync: symbol lookup error: /usr/lib/libgdal.so.20: undefined symbol: GEOSDelaunayTriangulation_r   I also tried to reinstall all gdal libraries - not sure if I got all?!  Maybe it is somehow related to this one:  ?  UPDATE:  Trying to install version 2.16.0 it gives different but similar error:  /usr/lib/qgis/crssync: symbol lookup error: /usr/lib/libqgis_core.so.2.16.0: undefined symbol: GEOSNearestPoints_r   UPDATE Sources:  For version 2.16.0 there are these sources in /etc/apt/sources.list:  deb http://qgis.org/debian trusty main deb-src http://qgis.org/debian trusty main deb http://qgis.org/debian trusty main deb-src http://qgis.org/debian trusty main   which are all the same, right?   When I do apt-cache policy qgis it gives me:  qgis:   Installiert:           1:2.16.0+20trusty   Installationskandidat: 1:2.16.0+20trusty   Versionstabelle:  *** 1:2.16.0+20trusty 0         500 http://qgis.org/debian/ trusty/main amd64 Packages         100 /var/lib/dpkg/status      2.0.1-2build2 0         500 http://de.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages


Thinking about the idea of Elves having low numbers overall, got me to wondering: as far as Tolkien's writing, could elves ever have twins?  As a "yes" answer, I need an example of twins (any of JRRT work). They must be full on Elves, not half-Men. As a "no" answer, has to be an explicit statement in his work stating Elves ALWAYS had one child at a time. Anything else is a "maybe, we don't know".


How to mount and unmount hard drives under Windows (the unix way)

On my work computer I have two USB hard drives that I use rarely. They have a power save mode that sends them into sleep after a couple of minutes of them being idle.   Whenever I open a context menu on a file, the drives are woken up (most likely caused by the "send to" handler).  So I eject the drive, but I can't find a way to get it back, other than unplugging and replugging it in.  Is there a way to unmount the drives, and then remount them only when I actually need them? (On Windows 7 Ultimate.)