I have looked all over the internet and have not seen someone really in detail describe what about circles give them the properties of pi. It is obvious to see why a square's area is the side length squared (a square with a side length of two has 2 rows of two square units giving it an area of 4) but not with circles. Why is pi the "magic number" of circumference/diameter? Why does it narrow down to that specific number for all circles? I know there are other articles on this page about this but none of them seemed to answer the question. They just said that if you rotated a wheel all the way around it travels pi times its radius. It didn't explain why this was so.

Is there a proof that the ratio of a circle's diameter and the circumference is the same for all circles, that doesn't involve some kind of limiting process, e.g. a direct geometrical proof?


don't get mad at how bad this looks, I'm trying my best. Anyways, I was looking at the definition of $e$, you know like: $$\lim_{x\to\infty}\left(1+\frac1 x\right)^x$$  but if I use the properties of limits I can take the exponent outside the limit $$\left(\lim_{x\to\infty}1+\frac1 x\right)^x$$  then if I use direct substitution, the limit of $1/x$ as $x$ approaches infinity is $0$ and the limit of $1$ as $x$ approaches infinity is just $1$ so now the limit is:  $$1^\infty$$  and that just equals $1$, so now it seems like $e$ just equals $1$. What's wrong with my math or with what I just did?

Given $\lim \limits_{x\to\infty}(1+\frac{1}{x})^{x}$, why can't you reduce it to $\lim \limits_{x\to\infty}(1+0)^{x}$, making the result "$1$"?  Obviously, it's wrong, as the true value is $e$.  Is it because the $\frac{1}{x}$ is still something even though it's really small?  Then why is $$\lim_{x\to\infty}\left(\frac{1}{x}\right) = 0\text{?}$$  What is the proper way of calculating the limit in this case?


Options are   n/2 cosx- 1sin(nx)/2sinx . cos(n+2)x n/2.sinx-1/2sin(nx) n/2.cosx - cos(n+2)x sinx +sin(nx)

How can we sum up $\sin$ and $\cos$ series when the angles are in arithmetic progression? For example here is the sum of $\cos$ series:  $$\sum_{k=0}^{n-1}\cos (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \cos \biggl( \frac{ 2 a + (n-1)\cdot d}{2}\biggr)$$  There is a slight difference in case of $\sin$, which is: $$\sum_{k=0}^{n-1}\sin (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \sin\biggl( \frac{2  a + (n-1)\cdot d}{2}\biggr)$$   How do we prove the above two identities?


I have 20 lines on one layer, and many of them overlap like a grid.  I have currently used the following:  [%'ROUTE #' || CASE WHEN $id = $atlasfeatureid THEN "Route #" END%]   When I use the atlas function to zoom to a specific line, it will still show the other lines within the zoom extent.  I only want the line that the atlas function is zooming to to be visible, but still allow me to flick through all 20 lines/atlas pages.  Is there any way to do this?

I have a layer that contains counties within the state of Washington.    I need to build one map (jpg) for each county.  For that specific map all counties will show as light grey, but the specific county will be green, and the file name will be the county name.


I am practically clueless on how to prove the triangle inequality here. The case is evident when $|z|≤|x|$ and $|z|≤|y|$. But how do I prove it in general?   Any hint/answer would be much appreciated.

Show that $(X,d)$ is a metric space where $X =\Bbb C $ and the distance function is defined as:   $$d(x,y) = \frac {2|x-y|}{\sqrt {1+|x|^2} +  \sqrt {1 + |y|^2}}, \text{ for } x,y \in \Bbb C.$$   I have done the proof of the first two propositions for being a metric, but I'm having a problem in proving the triangle inequality.


I have a gold badge on some tag, which apparently lets me decide all by myself that a question is a .   However - I don't always want to do that. In fact, I usually want to, at first, mark it as “maybe-a-dupe” and see what others think. Can I do this?

According to  , gold badge holders can now unilaterally close questions as duplicates. I hold seven gold badges for tags on SO, which means I can, on my own, close questions as duplicates for those tagged questions.  Simply put: DO NOT WANT.  However, I do not see any ability in SO (the only SE site I spend much time in) to opt out of any privileges, let alone this one.  Is there a spot that I'm just not seeing that allows me to turn off this new privilege?


I'm trying to validate the date and month in below format:  MM/dd   And now, I'm using this regex to validate:  (0[1-9]|1[0-2])\/(3[0-1]|2[0-9]|1[0-9]|0[1-9])   And the regex successfully validate these formats:      //Below are valid dates         09/05     01/01     12/30     10/30     //Below are invalid dates     11/31     09/31   How to modify the regex so that it also checks the days in month?


All I can remember is the end and a lost astronaut on the moon uses a rat on a key ring to decide which way to go to find his ship.

I'm trying to find out the name of a movie (I think 80s) in which an astronaut is lost on the Moon (can't remember why) and needs to go to a different space module that happens to have a red light flashing over it.  In the last scene of the film, when the astronaut has already consumed all oxygen in his tank and thinks he's dead, he looks at his wrist clock and sees the reflection of the red light on it, and goes to the module.


Question: Let $p$ be a prime. Consider the sequence  $1^1, 2^2, 3^3, 4^4, 5^5,\cdots $  modulo $p$. Prove that the resulting sequence is periodic with the smallest period $p(p-1)$.  This means that $p(p - 1)$ is the least among all positive integers $L$ with the property that whenever$ n ≡ m\mod L$, we have $n^n ≡ m^m \mod p$. So, you have to prove that  (i) $n ≡ m \mod p(p - 1)$ implies that $n^n ≡ m^m \mod p$ and,  (ii) if $L \geq 2$ has the property that whenever $n ≡ m \mod L$, we have $n^n ≡ m^m \mod p$, then $p(p - 1) \leq L$.

Let $p$ be prime. Consider the sequence: $1, 2^2, 3^3, 4^4, 5^5, 6^6 \cdots \pmod p$. Prove the sequence is periodic with smallest period $p(p-1).$ This means that $p(p-1)$ is the least among all positive integers $l$ with the property that whenever $n ≡ m (mod ~l),$ we have $n^n ≡ m^m (mod ~p)$ Prove that: (a). $n \equiv m \pmod {p (p-1)}$ implies that $n^n ≡ m^m \pmod p$ $(b).$ If $l ≥ 2$ has the property that whenever $n ≡ m \pmod l,$ we have $n^n\equiv m^m \pmod p,$ then $p(p-1) \leq l.$


If you have a Linear Diophantine Equation, $ax + by = c$, such that $a, b, c$ are constants is there an efficient way to check that there exists some pair $X, Y \in \mathbb N$?   I recognize that I could find every integer solution and then check for every pair if $(X, Y)$ are natural numbers, but this is very indirect and inefficient; I was wondering if there is a more direct and efficient manner to determine the existence of such a solution.

I want to find a set of integer solutions of Diophantine equation: $ax + by = c$, and apparently $\gcd(a,b)|c$. Then by what formula can I use to find $x$ and $y$ ?   I tried to play around with it: $x = (c - by)/a$, hence $a|(c - by)$.     $a$, $c$ and $b$ are known. So to obtain integer solution for $a$, then $c - by = ak$, and I lost from here, because $y = (c - ak)/b$. I kept repeating this routine and could not find a way to get rid of it? Any hint?  Thanks, Chan


I find a shortcut Alt+PrtSc+b which can let my ubuntu reboot,  but what is the really function of the shortcut?

In win7, when I want to restart computer via keyboard until my operating system hasn't been loaded yet, I press Ctrl+Alt+Del.  What is equivalent to this command in Ubuntu?  (Note that I'm not asking for Task manager).  I wish to restart it if, for example, I pressed F10 but BIOS didn't load successfully so I have to reboot it. I really don't like brute way (using physical shutdown button).


I'm not sure what is the right answer:     I'm looking forward to him/his visiting me next week.   Many thanks.

I assume that the following sentences are grammatically correct:   He resents your being more popular than he is. Most of the members paid their dues without my asking them. They objected to the youngest girl's being given the command position. What do you think about his buying such an expensive car? We were all sorry about Jane's losing her parents like that.   I'm still getting used to this possessive gerund structure. It sounded so weird to me at first. Is the structure used in both formal and informal contexts? Are there any alternative structures that result in the same meaning and are more frequently used? (Examples taken from )


There is MySQL DB with latin1 encoding. There is no ability to convert DB encoding to UTF8. Assume it is a fact. Some data in one table contains Cyrillic that was inserted using the form and stored as latin1. Here is its representation: Ð¿Ð¾Ð´Ñ‚Ð²ÐµÑ€Ð¶Ð´ÐµÐ½Ð¸Ðµ Ñ€ÐµÐ³Ð¸ÑÑ‚Ñ€Ð°Ñ†Ð¸Ð¸ - ÑÑ‡Ñ‘Ñ‚ Ð·Ð° ÐºÐ¾Ð¼Ð¼ÑƒÐ½Ð°Ð»ÑŒÐ½Ñ‹Ðµ ÑƒÑÐ»ÑƒÐ  When data extracted from db with php it is somehow represented as: $string =  "подтверждение регистрации - счёт за коммунальные услу�" When  I do mb_convert_encoding($string, "latin1", "latin1")  I got the same value as currently $string variable has. How can Unicode symbol display in latin1 string? The problem is to remove UNICODE replacement symbol � from the string. I tried: preg_replace('@\x{FFFD}@u', '', $string)  But the result is null. If I convert it to Unicode I got the same result as db representation utf8_encode($string) // Ð¿Ð¾Ð´ÑÐ²ÐµÑÐ¶Ð´ÐµÐ½Ð¸Ðµ ÑÐµÐ³Ð¸ÑÑÑÐ°ÑÐ¸Ð¸ - ÑÑÑÑ Ð·Ð° ÐºÐ¾Ð¼Ð¼ÑÐ½Ð°Ð»ÑÐ½ÑÐµ ÑÑÐ»ÑÐ  So I want to convert it to utf by saving Cyrillic representation and to remove Unicode replacement symbol. I tried many conversion, but nothing helped. If you'll try to remove black diamond question mark with preg_replace - it will work, because the value was copied from xdebug and it is no longer the same as I have. I think maybe this string is broken. But have no ideas how to fix it. At the end I can say, that I read tons of stackoverflow questions regarding to latin1 Cyrillic to utf8 conversion. None of them helps in this case. Maybe the string is really broken. Still think that there is a way to fix it. Any help appreciated. Thanks

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


ok so thats what ive got  jTextField1.setBounds(136, 24, 17, 17); jTextField1.setEditable(false); jTextField1.setText("x"); jTextField1.setBorder(javax.swing.BorderFactory.createEmptyBorder()); jTextField1.setHorizontalAlignment(SwingConstants.CENTER); jTextField1.setFont(new Font("Dialog", Font.PLAIN, 16)); jTextField1.setBackground(Color.WHITE); jTextField1.setOpaque(false); cp.add(jTextField1);   [...]  public void actionPerformed(ActionEvent e) { if (e.getActionCommand() == "+") { plus = true; // [...]   If e.getActionCommand() = + i want to change the text of the jTextField. Is that possible? What alternatives are there? thx in advance

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


Within my ajax success function, I have the following code:  $('#searchButton').on('click',function(){ //ajax call //within that ajax call's success function: $.ajax({       type: 'POST',       url: 'search.php',             data: {x:x},               success:function(dataReturn){                        $('#returnThree').html(         "<img id='expandThree' class='expandThree' src='../../img/expand.png'>"         );   I have another function that I want to be called when the user clicks on this image, but I can't figure out where to put the code as nothing seems to work:  $("#expandThree").click(function() {   console.log('hi');   });   I've tried putting it both inside and outside of the $('#searchButton').on('click',function(){, but it's not calling.  What am I doing wrong?

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


Are wizards able to cast different spells or repeated spells without saying the spell incantation and just by thought and wand movement. For example when Mrs. Weasly  defeated Bellatrix.

From my memory of the last Harry Potter movie I saw, I've seen many wizards cast spells without saying the spell at all.  During the final battle in Hogwarts, many wizards just swung their wands and their enemies were knocked out. I am 100% sure about this!  The most remarkable spells were the ones that emit a green or red beam in the final battle of Harry Potter against Voldemort when they pushed their beams towards each other.  So, the question is, are they cheating? Because, unless there are wordless spells, they must say the words for a spell.


The story was about people living on another planet (for whatever reason) that was always dark and cold except for one day every 100+ years or so when the sun shone on the planet for only a few hours. It focused specifically on a classroom of children. As the teacher and children prepared to go outside to experience sunlight for the only time in their lives one child was accidentally(?) locked in a closet (broom or cloak) and was left behind. The story told of how everyone had fun outside in the sun, being able to take off their coats and feel the warmth of sunlight, except that one child, who was found crying in the closet when everyone came back inside after it became dark again. This story could also be part of a longer story, I don't know.

I read this short story about 20 years ago, and I'd love to find the title and author. This is what I can recall about the story:   It takes place in a classroom full of kids (around 10 years old?) The planet always gets rain The kids lock the main character (a girl, I think) in the closet during the very rare occurrence of sunlight and she misses the entire event.    I know it's not much to go on, but I hope it rings a bell for someone!


I am looking for a CV template to reproduce (more or less) the following style:

If you have a TeX'ed resume, did you use a template or make your own? Are there any useful packages? What looks the most professional? How about special considerations for different areas of work (e.g. in academia)?


Hi Is it ok to make mozzarella from milk bought at Spar or any other supermarkets? If not, how could I buy 5l non-pasteurised milk? I live in Hermanus, Western Cape. Thanks Ian le Chéf

I have this recipe for cheese curds that I want to try: , but it specifically calls for raw milk which is near to impossible to get here. I make yogurt with pasteurized milk and it works no problem, but does cheese somehow work differently?


Is there a word (or a few words) that accurately describes someone with the "like disease" (or the many other unnecessary words or small phrases spread throughout most sentences, such as "um") in "proper" English?  I often find having a conversation which such a person very distracting, even annoying, and it makes it difficult to concentrate on the intent of their conversation when I constantly here like x, like y, like z, ...  if such a "word" describes this too, even better.

What is a word for someone who uses a word excessively in conversation? For example, using the same swear word in every sentence.


I applied for a visa at the German consulate but was refused for the following reasons, but I am not sure what they mean:   The information submitted regarding the purpose and conditions of the intended stay was not reliable. Their intention to travel outside the territory of the Member States before the expiration of the visa could not be determined.

Schengen refusal formulae can be difficult to understand sometimes.  Sometimes an applicant receives a refusal with:       Justification for the purpose and conditions of the intended stay was not reliable.     often accompanied by:       Your intention to leave the territory of the Member States before the expiry of the visa applied for could not be ascertained.   What is meant by this refusal reason?  What are they trying to say?


Let $f\colon [a,b] \to \mathbb R$ be continuous. Define $g\colon [a,b] \to \mathbb R$ by $g(x)=\max \{f(y); a\le y\le x\}$. Prove that $g$ is continuous on $(a,b)$.     I know $g(x)$ will continuous on $(a,b)$ but I do'nt know how to prove.. well. My ideais that While $f$ is non increasing, $g$ will be constant in that interval and when $f$ is increasing, $g$ is increasing too following $f$ and because constant function and $f$ are continuous, if we show that in critical point $g$ is also continuous, then the proof.will be.finished..?  I think that I am not used to proving with epsilon delta.. Anyway I want to know the proof with using epsilon delta or other

Suppose $f(x)$ is continuous on the closed interval $[a,b]$. Define $m(x)=\max_{a\leq s\leq x}\, f(s)$, $a\leq x\leq b$. Is $m(x)$ continuous necessarily? Thank you.


In both jungles I heard there are special places between the trees that you can put your ward in order to block the neutral camps, and the ward is placed in a place where is difficult to access without skills or items that cut trees. These spots are known as magic bushes as far as I remember.  Can anyone point where are these spots? Pictures are desired, but not needed.

I finally got my DotA 2 Beta invite. Now to learn the game I read it's a good start to play support heros (like I already loved to do in League of Legends). Even though I'm still pretty new to the game I suspect it's mostly the supports job to buy and set up wards.  I am therefore interested in learning how to ward effectively.   What are good/important spots for wards? How do I time wards? When should I leave the lane? And if there there different types of wards like in LoL: when to use which one?


I'm having a problem removing empty or undefined elements from an array.  I tried with this:  function clean(item) {     for (var i = 0; i < item.length; i++) {         if (item[i] === undefined || item[i] == "") {             item.splice(i, 1);             i--;         }     }      return item; };   I don't have any result.  This is example of my array:

How do I remove empty elements from an array in JavaScript?   Is there a straightforward way, or do I need to loop through it and remove them manually?


I've looked around for a good desktop rig to suit a 2K budget computer focused on graphic design/ rendering  capabilities, but I'm have trouble finding exactly the type of setup that I'm looking for. If anyone is a hardware guru and has a great understanding of how to extract the very best GPU power and Display quality from a budget, and don't mind throwing it into a new egg wish list for me, I'd truly be grateful. Here is the setup I'm looking for:   Triple, high quality monitor display Performance based on the idea that I'll need to handle high resolution and many layered images within photoshop Performance based on the idea that I'll be using Blender to render 3-D Designs, which is able to use GPU to render 3D models.  Performance based on the idea that I will likely have 30+ browser tabs open, be running text editors in the background, and be doing all of these things at once, and need the setup to be able to handle it all with no sweat.    I have a TB of external memory, so that should save some cash on memory that doesn't need to be accessed with a great amount of speed, but the 2K does need to cover the three high quality monitors, a large tower with room for upgrade, a disk drive, a mouse, keyboard, and USB ports.   *Edit:  I think the builds suggested here will be helpful many users seeking rendering machine setup suggestions. I hope this fit's the format, and of course, isn't a duplicate question. I've looked and not found a satisfactory answer anywhere on StackOverflow! I thank you all ahead of time for your suggestions!  New: Thanks for the suggestion to move this to superuser.com! I reposted it here:   Thank you for your answers everyone, I was able to change the terms of what I needed to search for to meet the 2K budget thanks to all of your helpful advisories. The user-base here is far beyond the quality and knowledge level of any website in the world, in my opinion. Thanks again!

I've had my MacBook Pro since 2007 and I'm starting to think about what the next system might look like. I'm not made of money, but if upgrading a component helps to make me a more efficient worker for 5+ years, that's worth something to me. Point being, I don't want to just max out every category; I want to be smart about it.  So, what bits of hardware matter the most to a designer? Is a dedicated graphics card overkill for a Creative Suite power user? If not, how fast should a GPU be to handle Photoshop and cutting-edge Web technologies? How much of a difference would four cores make over two when I run a script in Illustrator? Does the usage of design software mean that my system would need more RAM? Two small monitors or one big one?  I know storage space is a big deal, so straight solid state probably isn't viable...but having OS and Creative Suite on a smaller drive and throwing in a 1TB drive might work really well. That's the kind of thinking I'm trying to have.  Along the same lines, has anyone gone to the desktop to save some bucks and regretted it later? Can a desktop plus a tablet fill in well enough for a laptop?


I write an application that has an icon in the upper right corner in the notification area, so there is no need to put its icon in the launcher.  But it is automatically put there. How do I disable that (in code, not X)? I write this in python with Qt, PyQt4.

How can I skip the unity launcher for a (Py)Qt-app?  As you see when running the code below, there is an icon in the launcher. I don't need that icon because I manage the windows of that application by a menu in the unity top panel.  I could of course use devilspie and set skip_taskbar, but than I can't show the window again after it has been minimized.  Moreover, I know a Gtk-application that works as intended, but in contrast to my application, its GUI is generated by an .ui-file. There it is done by  <property name=”skip_taskbar_hint”> False < /property >. I need this in PyQt.  import sys from PyQt4.QtGui import QMainWindow, QApplication  class MyApp(QMainWindow):     def __init__(self, parent, title):         super(QMainWindow, self).__init__(parent)         self.show()  if __name__ == "__main__":     app = QApplication(sys.argv)     myapp = MyApp(None, "App")     app.exec_()   EDIT: Qt.X11BypassWindowManagerHint does remove the icon from the launcher, but makes the window always stay on top regardless if Qt.WindowStaysOnTopHint is set or not. So as a 2nd solution, does anyone know how to fix that? I guess because X11 is now bypassed, no Flag will work.


So I switched my camera to use quaternions and the first thing I noticed is that things started to 'roll' even though I'm not using any roll values. I looked it up and I found that people suggest that using rotation = horizontal * rotation * vertical solves the issues instead of rotation = rotation * horizontal * vertical which I thought was the more intuitive thing from doing matrix multiplication. The explanations I read as to why one works and the other doesn't were pretty vague and unclear.  My question is: why does it work this way? what's wrong with 'rotation * h * v`?  Sample code:  float Horizontal = 0; float Vertical = 0;  if (Keys['W'] == Key_Held) {     Camera->Position += Camera->Forward() * CamMovSpeed * DeltaTime; } if (Keys['S'] == Key_Held) {     Camera->Position -= Camera->Forward() * CamMovSpeed * DeltaTime; } if (Keys['A'] == Key_Held) {     Camera->Position -= Camera->Right() * CamMovSpeed * DeltaTime; } if (Keys['D'] == Key_Held) {     Camera->Position += Camera->Right() * CamMovSpeed * DeltaTime; } if (Keys['E'] == Key_Held) {     Camera->Position += vec_Up * CamMovSpeed * DeltaTime; } if (Keys['F'] == Key_Held) {     Camera->Position -= vec_Up * CamMovSpeed * DeltaTime; }  // mouse int dx = Mouse->x - Mouse->LastX; Mouse->LastX = Mouse->x; int dy = Mouse->LastY - Mouse->y; Mouse->LastY = Mouse->y; if (Mouse->MMB == Key_Held) // pan {     Camera->Position -= (Camera->Up()*dy + Camera->Right()*dx) * SpeedMul/2 * DeltaTime; } if (Mouse->RMB == Key_Held) // orbit {     Horizontal += dx * SpeedMul*10 * DeltaTime;     Vertical += dy * SpeedMul*10 * DeltaTime; } if (Mouse->Wheel) // zoom {     Camera->Position += Camera->Forward() * Mouse->Wheel * SpeedMul*10 * DeltaTime; }  if (Horizontal != 0 || Vertical != 0) {     quat QVertical(vec_Right, -Vertical);     quat QHorizontal(vec_Up, Horizontal);     Camera->Rotation = QHorizontal * Camera->Rotation * QVertical; // this works     //Camera->Rotation = Camera->Rotation * QHorizontal * QVertical; // this doesn't     Camera->Rotation.Normalize(); }

I see questions come up quite often that have this underlying issue, but they're all caught up in the particulars of a given feature or tool. Here's an attempt to create a canonical answer we can refer users to when this comes up - with lots of animated examples! :)    Let's say we're making a first-person camera. The basic idea is it should yaw to look left & right, and pitch to look up & down. So we write a bit of code like this (using Unity as an example):  void Update() {     float speed = lookSpeed * Time.deltaTime;      // Yaw around the y axis using the player's horizontal input.             transform.Rotate(0f, Input.GetAxis("Horizontal") * speed, 0f);      // Pitch around the x axis using the player's vertical input.     transform.Rotate(-Input.GetAxis("Vertical") * speed,  0f, 0f); }   or maybe  // Construct a quaternion or a matrix representing incremental camera rotation. Quaternion rotation = Quaternion.Euler(                         -Input.GetAxis("Vertical") * speed,                          Input.GetAxis("Horizontal") * speed,                          0);  // Fold this change into the camera's current rotation. transform.rotation *= rotation;   And it mostly works, but over time the view starts to get crooked. The camera seems to be turning on its roll axis (z) even though we only told it to rotate on the x and y!    This can also happen if we're trying to manipulate an object in front of the camera - say it's a globe we want to turn to look around:    The same problem - after a while the North pole starts to wander away to the left or right. We're giving input on two axes but we're getting this confusing rotation on a third. And it happens whether we apply all our rotations around the object's local axes or the world's global axes.  In many engines you'll also see this in the inspector - rotate the object in the world, and suddenly numbers change on an axis we didn't even touch!    So, is this an engine bug? How do we tell the program we don't want it adding extra rotation?  Does it have something to do with Euler angles? Should I use Quaternions or Rotation Matrices or Basis Vectors instead?


Below is my sample code, where I overrided the delete operator for derived class.  My aim is I want to delete the object for both base and derived class in delete operator. Basically I want to hold the address of both class till delete operator get called.  Right now I am using atomic operation to synchronize, basically my destructor didn't get called, when I am executing some functionality of class. Now, I want to get ride of that atomic operation. So, I will catch the object address and hold there in delete operator till it is safe to do. Destructor will be called by others.  So, which is the correct place for delete operator, base class or derived class? When I used delete operator in both class only derived delete operator get called.  #include <iostream> using namespace std;  class base {     public:      int l;      base() {cout << " base const" << endl;}      ~base() { cout << " base descr" << endl;} };  class derived: public base { public:  int k;  derived() {cout << " derived const" << endl;}  ~derived() { cout << " derived descr" << endl;}  static void operator delete (void *p) {       return delete[] static_cast<char*>(p);   }  };  int main () {   derived *p = new derived;   p->k = 7;   p->l = 8;   cout << p <<" " << p->k << " " <<p->l << endl;   delete p }

I have a solid understanding of most OOP theory but the one thing that confuses me a lot is virtual destructors. I thought that the destructor always gets called no matter what and for every object in the chain. When are you meant to make them virtual and why?


Consider all $1000$–element subsets of $\{1,2,3,4,\dots 2015\}$. From each such subset select least element. Find Arithmetic Mean of all these elements.  I easily managed the trick but my approach got me a lengthy answer. I selected leaste numbers and multiplied them by their number of subsets possible such as; for $1$, number of subsets possible$=1016$, for $2$, $1015$ and so on. By adding this in series($1\times 1016 + 2\times 1015 + \dots 1016\times 1$) we would get the answer but it got to be a lengthy one.

IMO/1981 Let $1\le p \le n$ and consider all of the subsets of $p$ elements of the set $\{1, 2, 3,..., n\}$. Each of these subsets has a minimum element. Let $F(n, p)$ be the arithmetic average of these minimum elements. Prove that $F(n, p) = \frac {n+1}{p+1}$ My attempt: So i initialy tried to think about how many subsets can you have given a minimum value $k_m$, such that $k_m \in \{1, 2,..., n\}$ obviously, but also such that $k \le n - p$, because otherwise that would mean the set can't have a minimum value of $k_m$ and $p$ elements, because that would mean you have less options to construct the set from ( $n - k_m  - 1$)  than you are needed ($p-1$). So i figured that if i fix a $k_m$ i have ${n - k_m - 1} \choose{p - 1}$ different sets in which this fixed element is the minimum, so the arithmetic average asked in the question is equal to: $$F(n, p)=\frac{\sum_{k=1}^{n-p} k \binom{n - k - 1}{p - 1}}{\sum_{k=1}^{n-p} \binom{n - k - 1}{p - 1}}$$ So i need to prove that: $$\frac{\sum_{k=1}^{n-p} k \binom{n - k - 1}{p - 1}}{\sum_{k=1}^{n-p} \binom{n - k - 1}{p - 1}}=\frac{n+1}{p+1}$$ But i'm struggling to effectively attack this proof simply because this sum is unlike any other one i've proven before, so i'd like to know: If my reasoning has been correct so far (and if not, why not?) , and also some ideas on how to prove that huge sum.


If an alien of a certain species is shown (but never named, or does anything) in Star Wars movie, and then given a name/backstory/whatnot in a C-level book, is that alien species (and the facts about it) considered a G-level canon or a C-level canon?   Or is it nuanced? (e.g. the existance is G-level but any details are still C-level)?

For all types of derivative works, namely:   Movies Novels Comic books Other written works (including RPG materials) Cartoons Video games Derivative movies (such as the infamous Ewok movies and even more infamous )   According to what rules does something become "canon" and who is responsible for the evaluation of a published work?


I’m using Git in Android Studio 4.0.1 for the first time since I have learned Git. Initially I have 2 branches (master and dev) First I made a commit in master. Then I created a new dev branch and checkout in dev, I added a new file without committing it When I switch to master I expect not to see the new file created in dev inside the Android project view of the master branch. Seems that if I commit in dev then correctly isn’t in master. Why I continue to see it before committing ? Thanks all.

I am working on a git repository with a master branch and another topic branch. I have switched to topic branch and modified a file. Now, if I switched to master branch that same file is shown as modified.   For example:  git status in git-build branch:  # On branch git-build # Changes to be committed: #   (use "git reset HEAD <file>..." to unstage) # #       modified:   cvsup_current #   Switch to master branch  [root@redbull builder_scripts (git-build)]# git co master M       builder_scripts/cvsup_current Switched to branch "master"   git status in master branch  [root@redbull builder_scripts (master)]# git status # On branch master # Changes to be committed: #   (use "git reset HEAD <file>..." to unstage) # #       modified:   cvsup_current #   Why is that the file is shown as modified in master branch even though it was modified in git-build branch?   My understanding was that the branches are independent of each other and when I change from one branch to another the changes do not "spill over" from one branch to another. So I am obviously missing some thing here.   Anyone got a clue stick?


One sensor output gives voltage range within 5mv to 50v..I need to give this to an adc (analog to digital converter )..however the adc available is upto 10v.i need to stepdown hight voltage to low voltage(50v to 10V, 25V to 5V like this linear) to give it within adc input range..Any standard circuitry for this to reduce this high voltage dc?

I would like to monitor relatively higher voltages (up to 160V) using an ADC type DAQ.  Most DAQs that I come across can handle around 5-10V of analog input, requiring the voltage to be divided.  Here is one I like  .  I was planning on running a simple voltage divider to an op-amp buffer (voltage follower) and finally into the input of the DAQ.  My thought is to use something like 3.3 MOhm (R1) and 105 kOhm  (R2) to divide the 160V by ~32 (~5V).  Then run that output to an op-amp voltage follower and finally into the input of the DAQ.  I'm not sure how to size the resistors since the op-amp buffer should be high impedance and limit the current draw.  I sized them so big to ensure I'm not drawing much current.  Since I am monitoring the voltage, I do not want to load down the source.  I want to know if this is a good way to do it, and if there are any better ways.


I want to restrict the values that someone can assign to a variable in my function call. For e.g. say my function is  function myFunction ($carType, $isOld , $something) {     //do what is required }   I want that I should be able to restrict $carType, $isOld have only certain values, say from given arrays:  $carTypeValues = array ("car1", "car2", "car3"); $isOldValues = array (true,false);   I am aware that I can restrict the parameter variable to be of a certain class type.  I have tried to find a way to do this, but I am not able to find anything that addresses exactly what I want. I know I can check the value once I actually execute the function call, however I am looking for something that will allow the user to preferably be able to use selectors like:  myFunction (carType::car1, isOld::car2 , $something);   I am not sure, this maybe:  myFunction (carType.car1, isOld.car2 , $something);   Thanks for reading this

I know that PHP doesn't yet have native Enumerations. But I have become accustomed to them from the Java world. I would love to use enums as a way to give predefined values which IDEs' auto-completion features could understand. Constants do the trick, but there's the namespace collision problem and (or actually because) they're global. Arrays don't have the namespace problem, but they're too vague, they can be overwritten at runtime and IDEs rarely know how to autofill their keys without additional static analysis annotations or attributes. Are there any solutions/workarounds you commonly use? Does anyone recall whether the PHP guys have had any thoughts or decisions around enumerations?


Could you give me some hint to prove this assertion? I've found a proof when the closed subset doesn't have isolated points:  If $X$ is a separable space, then it admits a numerable dense basis. Now consider the internal points of a closed subset $C$, since it is open, it is a numerable union of elements of the numerable basis. Now, let we consider $C$ a closed subset of $X$; $C$ doesn't have isolated points, so the closure of the interior of $C$ is the closure of $C$, since we can write the interior of $C$ like a numerable union of elements in the numerable basis, there exists a subset of $C$ with cardinality $\leq \aleph_0$ such that its closure is all $C$, so $C$ is separable.  Another approach to prove the assertion is make the projection of $N$ (the numerable dense subset of $X$ whose closure is all $X$), in the closed subset $C$, but I doubt this thing will works in Hilbert spaces only, because in a Banach space I don't know if $\forall m\in N$ $\arg\inf_{c\in C}{d(m,c)}$ is unique.  -The problem is that I can't visualize how $\mathbb{R}\setminus\mathbb{Q} $ is a separable space... who is its numerable dense subset whose closure is all $\mathbb{R}\setminus\mathbb{Q} $?-

The problem statement, all variables and given/known data: Show that if $X$ is a subset of $M$ and $(M,d)$ is separable, then $(X,d)$ is separable. [This may be a little bit trickier than it looks - $E$ may be a countable dense subset of $M$ with $X\cap E = \varnothing$.]  Definitions Per our book:  A metric space $(M,d)$ is separable if there exists a countable dense $E$ contained in $M$.   $E$ contained in $M$ is dense if $\forall m\in M$, $\forall ε>0\in\mathbb R$, $\exists e\in E$ s.t. $d(m,e) < ε$   The attempt at a solution  My best attempt was doomed from the start, because I don't quite understand the hint. My thought process went as follows:  Since $X$ is a subset of $M$, $\forall x\in X, x\in M$. Thus, since $E$ is dense in $M$,  $\forall x\in X$, and ε > 0, $\exists e\in E$ st $d(x,e)<ε $.   At this point, I was done, because the set of $e$'s satisfying the above, is a subset of $E$, a countable set. So a subset of a countable set is dense in $X$, and $X$ is separable. This is incorrect, but I cannot see why.  Any help clearing up the confusion would be greatly appreciated. Thanks!  Edit: I wish I could upvote all of you for your help! I really appreciate the speedy replies and attempts to make this information clear to me.


$a$ and $b$ are randomly chosen real numbers in the interval $[0, 1]$, that is both $a$ and $b$ are standard uniform random variables. Find the probability that the quadratic equation $x^2 + ax + b = 0 $ has real solutions?

Consider the quadratic equation $x^2+bx+c=0$, where $b$ and $c$ are   $Uni∼[0,1]$. Let $p(b)$ represent the probability that the given   equation has a real solution for a fixed value of$ b$.       What is $p(1/2)$?      What is the probability that$ x^2+bx+c=0$ has a real solution ?   $p(1/2)$ = prob $x^2+bx+c=0$ has a real solution)  now $x^2+bx+c=0$ has a real solution if discriminant $≥0$  i.e., $1−16c≥0$ which   is same as $c≤1/16$. since $C∼UNI[0,1]$ the $p(c)≤1/16=1/16$  Is this correct and how to do the second part?


I am currently staying in eastern/northern Iceland and am trying to spot the northern lights. Do you have any tips to see them and/or can tell me how likely it is to spot them in the next week?  The  shows aurora activity around 2 (moderate) on a scale from 0 to 9.

I'm wondering what time of year is best, and what locations might be best, for catching the aurora.  I'm currently thinking of February up at Sweden's ice hotel, but since the whole point of the trip is so that my wife can see the Aurora, I want to pick a location that affords the best chances to see one.  Edit: Just adding a link so you can see realtime aurora activity in the northern hemisphere    I know this is anecdotal, but I ended up going to Iceland in late february during the new moon and saw the aurora 3 out of 6 nights I was there.  There was activity every single night but the biggest problem was weather.  It was cloudy almost every single night.


Let $A$ be a local noetherian ring and $\mathcal{M}$ is maximal ideal of $A$. Then $A/\mathcal{M}^n$ is artinian.    How can I prove this?

Say I have a commutative ring $R$ with a maximal ideal $m$. Then $m/m^k$ is a maximal ideal in $R/m^k$ for any $k$. Is it the only maximal ideal, i.e. is $R/m^k$ a local ring?    This is a well known result for $k = 1$, as $R/m$ is a field. It seems to be true in other cases, e.g. $p\mathbb{Z}\subset \mathbb{Z}$ for prime $p$ and for $(x,y) \subset \mathbb{F}[x,y]$, the maximal ideal generated by $x$ and $y$ in a polynomial ring over the field $\mathbb{F}$.   Equivalently, if an element $x\notin m$, is $x + m^k$ an invertible element in $R/m^k$?


I know that Exchange Information Store (store.exe) is indeed a memory hog. So much so that it doesn't always seem to respectively release memory when other applications need it - causing the machine to be sluggish.  This is SBS 2011 Standard SP1 with Exchange 2010. There are about 30 computers on our network, most of which use Outlook to connect to Exchange. We also utilize SharePoint. There are 3 SQL Server instances, and I know SQL Server can also use up a lot of RAM - but they're already capped at 2GB, and don't even reach that limit. All 3 SQL Server instances combined use about 2.5GB.  What is very strange though is our SharePoint site gets extremely sluggish, and when I check it out, there's only a sliver of memory available (like under 1GB). This was with 12GB of RAM. So we just upgraded it to 32GB of RAM - but now Exchange uses about 20GB of it. We still have the issue where everything gets sluggish after it's been running for a while.  What I understand is that there's no option to put any cap on what memory Exchange uses. But with 32GB of RAM available to the machine, surely it shouldn't really need 20 of it. It's still leaving under 1GB available. Is there another way I can prevent Exchange from basically taking over the memory?  PS - this is a virtual machine on HyperV via Server 2012.

We have a SBS 2011 server with 16GB memory that runs Exchange, WSUS and File Sharing for approx 20 users. The server also gives 2GB memory to a virtual machine running in Hyper-V so 14GB left for the rest.  When the server first boots Store.exe consumes about 500MB memory, WSUS and IIS consume some as well, but we generally are only at 60% capacity. During the course of the working day Store.exe consumes 8GB memory and the server sits at approx 97% capacity.  This makes using the server very slow, logging on via RDP is slow, general server admin is slowed down.  Is this normal? I have read that Exchange will consume lots of memory that it does not neccessarily need and then releases it back to other applications that need it. I have also checked that all mailboxes are opened in cached mode. We do have some external uses who connect via Outlook Anywhere or OWA.  If it's deemed to be "normal" is there some way I can restrict it using ALL available memory and leave a little bit for SBS to use for server admin? I have seen some articles regarding setting a high and low memory flag but rumours that this does not work with update rollup 5 which we have installed.  Am I expecting a single server to do to much with only 14GB memory?  Thanks


The C# highlighter (and possibly others) chokes on non-ASCII characters in class names, as can be seen in this post:      EDIT: .

I noticed that sometimes my code gets highlighted in different colors when rendered.   What is syntax highlighting? How does it work? Why isn't my code being highlighted correctly? How do I report a bug or request a new language? How do I use syntax highlighting? What languages are currently available on Stack Exchange?


Use mathematical induction to show that for all integers, any price equal or greater than $8$, can be paid for by $3c$ and $5c$ coins.

Prove that any amount of more that $7$ cents can be represented by $3$ and $5$ cent coins. (Assume $3$ cent coins exist.)  Let P(n) be true if we can find $n$ cents with $3$ and $5$ cent coins.  My basis step is:  $P(8)$ is true since $3 + 5 = 8$  Would this be correct?  As for the inductive step, I'm not sure how to show it.  I've looked around online and it seems to be:   $P(k) = 8 ≤ k ≤ n$  How would I prove this to be true?


I get stuck in the follow problem:  Let $A \in R^{m \times n}$ and $\operatorname{rank}(A)=n$ (It's not written but I think $m \geq n$). Show that $\left\lVert{A(A^TA)^{-1}A^T}\right\rVert_2 = 1$ where $B \in R^{m \times n} \Rightarrow \left \lVert {B}\right \rVert_2 = \sup_{||x||=1}\left \lVert {Bx}\right \rVert_2$   My try:  I've decided look to $\left \lVert{A(A^TA)^{-1}A^T}\right\rVert_2^2$  And I get the following expression:  $\left \lVert{A(A^TA)^{-1}A^T}\right\rVert_2^2 = \sup_{||x||=1} ({x^TA(A^TA)^{-1}A^Tx})$  If we call $A(A^TA)^{-1}A^T=B$ then we have  $\left \lVert{A(A^TA)^{-1}A^T}\right\rVert_2^2 = \sup_{||x||=1} <x,Bx>$ ???  And here I get stuck, any suggestion?  Thank you!

So far, I've deduced that if the rank of A is n, then all the columns of A are linearly independent since A has n columns. As a result, m must be greater than or equal to n.  In the case that m = n, then A is a square matrix and we can just use matrix operations to distribute the inverse operation over the parenthesis; then we can apply the associative property and compute A*A-1 and AT-1 * AT first, eventually giving that the expression inside the norm is just the identity matrix, where the 2-norm of the identity matrix is obviously 1.  I'm having trouble for the case where m > n. I've identified that the expression inside the norm is actually the matrix of orthogonal projection, but I'm not sure if that will help me with the proof. Help is greatly appreciated, thanks.  This problem is from the text of "Matrix Computations" 3rd edition by Golub after covering a section on orthogonality and SVDs for some background.


On other operating systems, there are ways to see what process or event woke them from suspend. I leave my laptop often for multiple days in suspend, sometimes to find that it has woken itself up and is heating whatever surface it is resting on :)  Is there a way to find out what woke it up so that I can prevent that thing from happening again? On Ubuntu 12.04 (elementary Luna).

I'm having a problem with my notebook suspending, but then waking up when I don't want it to (either immediately, or much later when in the bag - I may have two issues to solve here). But for the moment this question is about troubleshooting: is there a command I can run that will tell me what the trigger was for the last resume action? E.g. whether a key was pressed, or the power button, whether it was a wake-on-lan signal, whether it was switching from AC power to batter, etc, etc.  It appears that on Windows you can type powercfg -lastwake to find this out. So I'm looking for the Linux equivalent of that command.  If there is no such command, what do I need to look for, in which log file?  (Mint 16, xfce, Lenova Thinkpad, kernel 3.11.0-12-generic)


So I was trying to install wine 5.0 in Ubuntu 18.04 but it got unmet dependencies, used aptitude but couldn't install neither, but now i have broken packages. I looked in many forums but still can't find a solution, please i need help i'm not much of an expert in linux

After upgrading from 10.04 to 12.04 I am trying to install different packages.  For instance ia32-libs and skype (4.0).  When trying to install these, I am getting the 'Unable to correct problems, you have held broken packages' error message.   Output of commands:  sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.   After running this:  sudo dpkg --configure -a foo@foo:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


I am working on a "Candy Shop" assignment project for OOP with C++ and compiler complains about my code again :) I found a similar named topic in forum but it points to some other issue than I have... So, I got a base class to derive some products ( candy, cookie, vs.) and a template for shopping class as follows:  class productBase{ protected:     string name;     double amount;     double ppAmount; public:     productBase(){}     productBase(string na, double am, double pp){          name = na;          amount = am;          ppAmount = pp;      }         string getName() const;     double getAmount() const;     double getppAmount() const;     //virtual double getCost() const = 0;        // make it abstract ? };  //  Templete for shopping template <typename shopType> class Shop { private:     int noi;                        //  number of items     double totalcost;        shopType * sTptr; public:     Shop();     Shop(shopType);     ~Shop() { delete[] sTptr; }      void add(shopType &);     void setDiscount(const double);         friend ostream& operator<<(ostream&, const Shop<shopType> &);         shopType operator[](int); };   And one of my product class is like this:  class Cookie: public productBase { private:     const double taxRate; public:     Cookie() :taxRate(8) {}     Cookie(string nm, double am, double pp) :productBase(nm, am, pp), taxRate(8) {}     ~Cookie() {}         double getCost() const;         friend ostream& operator<<(ostream &, Cookie &);     };   In the program, I need to hold my products in a dynamic array which is first created and expands with adding new instances as follows:  int main() { .....     Cookie cookie1("Chocolate Chip Cookies", 10, 180);       Cookie cookie2("Cake Mix Cookies", 16, 210);      Shop<Cookie> cookieShop(cookie1);       // << this is where I am gettin error     cookieShop.add(cookie2); .....   and this where I am getting error from the compiler  Error  LNK2019 unresolved external symbol "public: __thiscall Shop::Shop(class Cookie)" (??0?$Shop@VCookie@@@@QAE@VCookie@@@Z) referenced in function _main     I thought that it is caused by the constructor of my template and tried to fix it by going over some examples like passing by reference and using base class pointer or even not using a base class at all, but i feel like the problem is something else like a missing parameter or misusage of something but can't figure it out :(  So these are the methods of my template class where I am looking for the cause...  template<typename shopType> Shop<shopType>::Shop() {     noi = 0;     totalcost = 0;     sTptr = NULL; }  template<typename shopType>  Shop<shopType>::Shop(shopType sT)           // I guess the problem is here {     sTptr = sT;     noi++;     totalcost = sT.getCost();        }  template<typename shopType> void Shop<shopType>::add(shopType & toAdd) {     if (noi == 0) {         sTptr = new shopType;         sTptr = toAdd;         totalcost = toAdd.getCost();         noi++;     }     else {         shopType * ptr = new shopType[noi + 1];         for (int a = 0; a < noi; a++) {             ptr[a] = sTptr[a];         }             delete[] sTptr;                  sTptr = ptr;         sTptr[noi++] = toAdd;           totalcost += toAdd.getCost();     } }   This template usage is confusing me; I would be already done without using it, but I need to learn it on the other hand :) So what might be I am missing out of sight?   Thanks in advance for any guidance or assistance.

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


I am using Dell vostro 1550 laptop. It has intel i3 2nd gen processor and 2gb RAM and running Windows 7 64 bit. Can I install Ubuntu 14.04 LTS 64 bit on my laptop?

For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and  such as:    with a lighter desktop than the usual Gnome and Unity  with the even lighter LXDE desktop   Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements?


Let $\operatorname{ad}_x:L\rightarrow GL(L)$ be the adjoint representation. In Humphreys "Introduction the Lie-Algebras and representation theory" one can find  where $x,y$ and $h$ are defined . (The first picture can be find on page 6 and the second one on page 22).  I would like to understand how one can compute $\operatorname{ad}_x$. Hopefully someone can help me :)

For a lie algebra $\mathbb{g}  $ we can define the adjoint representation as:  $ ad: \mathbb{g} \rightarrow End(\mathbb{g}) $ as the map such that $ad_x(y)=[x, y] $ for all $\in \mathbb{g} $  I am wondering how to we compute adjoint matrices with respect to a given basis?     For example, let the lie algebra be $ \mathbb{g}=sl_2(\mathbb{C}) $ with the basis as follows: $X=\begin{bmatrix} 0&1\\0& 0 \end{bmatrix}$,$Y=\begin{bmatrix} 0&0\\1& 0 \end{bmatrix}$ and $H=\begin{bmatrix} 1&0\\0& -1 \end{bmatrix}$  Let $ ad: \mathbb{g} \rightarrow End(\mathbb{g})  $ be the adjoint representation  How would I compute the matrices $ ad_X $, $ ad_Y $ and $ ad_Z$ relative to the above matrices?


From reading various books, I am under the impression that managements usually dislike it when their stock price gets too low. I am not sure why. So my questions are:   Given that the job of management is to manage the operations of the company, why are they concerned about the stock price at all? Is there any disadvantage to the management when stock prices are very low?   The only reason I can think of is that it would be hard to acquire other companies using stock when the stock price is low. However, if management has no intention to do mergers and acquisitions, I don't see why they would care about the stock price at all. I don't see how stock prices can affect regular company operations in any way.

After a company has issued shares, why should it care if the value of the shares fluctuate? Since the shares are now publicly traded, if the value fluctuates, that is strictly a transaction between buyer and seller, none of whom are directly related to the company. E.g. if I sell X an iPhone for $100, why should I care if X is selling the iPhone to Y for 1 dollar or 1000 dollars? I have got my $100, so I need not bother. No?


I wondered if theres a way to do rotational style completion in bash similar to the behavoir on cmd.exe, I've found it speeds me up in regard to entering commands

I use bash on both my Mac and as my cygwin shell. Overall, I'm quite pleased with it.  My one complaint however is that its TAB completion isn't as good as Windows Command Line TAB completion.   For example, if there are two files with the same prefix, then bash just beeps at me when I try to TAB complete. If I keep nailing TAB, then it will eventually show me a list of potential files.  I definately prefer how Windows will cycle through potential files right on the command line.   Is there a way to get bash to operate similar to Windows Command Line in this regard?  If there isn't (I do not want to switch shells), am I missing something about TAB completion in bash? Is there a more efficient way to use it?


I was recently speaking with a non-native English speaker and they asked me a question as to when we use the word 'the'.  EX: I will see you in the class vs I will see you in class. Is there a rule as to why the latter sounds more natural.

I decided to make sure that I know this important difference between American and British English, so I wrote what I have found out so far and I would be grateful to anyone who reads this and tells me whether I am wrong, or not.  In British English when people say  to hospital or in hospital when  talking  about somebody being there as a patient they don't use the definite article : "I had to go to hospital", "She spent two weeks in hospital". And the meaning is that somebody was there as a patient.   If then for some other reasons British English speakers  will use the definite article which will change the meaning itself, I noticed that, in American English, native speakers often use the  the and if they need to show that somebody is in church to pray,  in school as a student, in hospital as a patient, in prison as a prisoner, they use 'in' and not 'at'. Do American English speakers use 'at' like British English speakers use 'the' to give the sentences a different meaning?    Are my sentences correct? Do they show American English usage?   He is in the school. (enrolled as a student) He is at the school. (for some different reasons) He is in the hospital. (as a patient) He is at the hospital. (visiting somebody) He is in the church. (to pray) He is at the church. (for some different reasons) He is in the university. (as a student) He is at the university. (not as a student) He is in the college. (as a student) He is at the college. (Not as a student) He is in the prison. (as a prisoner) He is at the prison. (not as a prisoner)


We have to design our own HashSet class. (not using the JAVA api).  I implemented it, but I have a problem with printing it.  I think there is a problem with the iteration constructor. any advice?  Hash set:  package CountWords;  import java.util.Iterator;  public class HashWordSet implements WordSet  {      private int size = 0;                         private Node[] buckets = new Node[8];          public class Node {      Word value;     Node next = null;      public Node (Word w) { value = w; }     }      private class HashWordIterator implements Iterator<Word> {          private int pos, index = 0;         private Word[] words = new Word[size];         private Node node;          public HashWordIterator()         {             for(int i=0; i<words.length;i++){             words[index++]=node.value;             node = node.next;             }         }          public boolean hasNext() {             if (size > pos)//root != null && root.next != null)                 return true;              return false;         }          public Word next() {             return words[pos++];         }          @Override         public void remove() {             // TODO Auto-generated method stub         }     }      @Override     public int size() {         return size;     }      @Override     public void add(Word word) {         int pos = (word.hashCode() % buckets.length);                 Node node = buckets[pos];          while (node != null) {             if (node.value.equals(word))                 return;             else             node = node.next;         }          node = new Node(word);         node.next = buckets[pos];         size++;             if (size == buckets.length)             rehash();         }         }      private void rehash() {         Node[] tmp = buckets;         buckets = new Node[2*tmp.length];                             size = 0;                  for (Node n : tmp) {             if (n == null) continue;             while (n != null) {                 add(n.value);                 n = n.next;             }         }     }      @Override     public boolean contains(Word word) {         int pos = (word.hashCode() % buckets.length); //         Node n = buckets[pos];          while (n != null) {             if (n.value.equals(word))                 return true;             else                 n = n.next; // stega fram i listan         }         return false;     }      public String toString () {         StringBuffer sb = new StringBuffer();          for (int i = 0; i < buckets.length; i++) {             sb.append(buckets[i].value.toString());         }          return sb.toString();     }      @Override     public Iterator<Word> iterator() {         return new HashWordIterator() ;     }  }   Main:  package CountWords;  import java.io.File; import java.io.FileNotFoundException; import java.util.Arrays; import java.util.Iterator; import java.util.Scanner;   public class WordCount2Main {      public static void main(String[] args) {         File file = new File("/Users/sa/Documents/workspace/1DV007/src/CountWords/Words.txt");          HashWordSet  Hset = new HashWordSet ();         //TreeSet<Object> Tset = new TreeSet<Object>();         TreeWordSet Tset = new TreeWordSet();         Scanner Scan;         int i=0;         try {             Scan = new Scanner(file);              while (Scan.hasNext()) {                 String text = Scan.next();                 Word Y=new Word(text);                 Hset.add(Y);                 i++;             }              System.out.println("TreeSet: " + "\n");         } catch (FileNotFoundException e) {             e.printStackTrace();         }          System.out.println();         Iterator<Word> iter2 = Hset.iterator();          while(iter2.hasNext()) {             Object o2 = iter2.next();             System.out.print(o2 + " ");         }           System.out.println(Hset.size() + " Hash set:: "+Hset );     } }

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


Today, I install Ubuntu 14.04 version. And I want to connect my wifi. But the system cannot find my wifi card in the additional drivers, by the way my additional drivers window is empty. How to solve this problem?  lspci -nn | grep 0280   shows ...  Realtek Semiconduct Co., ltd. RTL8192EE PCI e wireless Neteork Adapter[10ec:818b]

I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible.   What are the steps to install Broadcom wireless drivers for a BCM43xx card?  I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc.    lspci -vnn | grep Network showed:   Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b]      iwconfig showed:  lo        no wireless extensions. eth0      no wireless extensions.   NOTE: Answer below is updated every time new information is added and confirmed working.


I had a problem with installing Octave. Now I am unable to close it once it is opened. And I am unable to shutdown the computer. What path should I set, what /etc/environment should I set? I had used these commands to install: $ sudo apt-add-repository ppa:octave/stable $ sudo apt-get update $ sudo apt-get install octave $ octave

When updating, I get the following error message:   W: The repository 'http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial Release' does not have a Release file.   Here, I find another statement on this error:   This recommends removing certain PPAs; and, I'm not sure if I should do that since it might mean not getting the updates that I need.    Is this what I should do?


I want to put a HDRI Image in background of my scene, and in this project the HDRI and Images will be shown only in 1 color. Creating a new blender file and adding the HDRI works fine. Only in this project not. I'm wondering if somebody knows why. Thanks a lot

I have added a background image to the world settings. However, it has disappeared from my 3D view and only shows when I view the scene from the camera. Does anyone know if there is something I can do to make it reappear?


I'm thinking specifically about . If I get them to exile 4 cards ie. , and allow them to draw 4 on my turn does that mean they can draw on their turn and do not have to discard until the end of their next turn?

If my opponent has a full hand of 7 cards and I cast , what happens?  Do they discard the two cards they draw and then discard four more for a total of six cards discarded?


I was solving a mathematical olympiad problem, which reads as follows:     How many positive integer solution pair $(x, y)$ are there for the   equation $y^2=\frac{x^5-1}{x-1}$, where $x\ne1$?   My first act was to simplify the equation to this:  $$y^2=x^4+x^3+x^2+x+1$$  Seeing that this did no good, I hit on the idea that this problem was actually very simple. A good, little trick would do it.  I decided to work with the first five integers (excluding $1$, of course). By trial and error, I discovered that there was only one integer solution pair i.e. $(3, 11)$ that satisfies the equation. This was as I suspected before. I also build a C program to confirm this; I was right.   But...     if I were to solve another such problem that doesn't involve tricks, then what? There should be a formula for calculating total number of solution pairs to equations of that kind. Is there? Could I solve this very problem using a formula?   Please answer bearing in mind that I'm only 12 years and a 7th grader.    How my question isn't a duplicate of any other question?  At first look, my question might seem to be the exact duplicate of this: . However, it isn't.   First of all, it's obvious that I didn't notice that question before posting this question.   The main difference lies in the question content and purpose. The other question was solely based on how to solve this particular problem. But, my question isn't that. I have solved the problem. My question is:     is there a formula in general to find out the number of rational solutions of a diophantine equation?   My question has a much more wider purpose. These reasons should be enough to convince you that this question isn't a duplicate of the question at all.

My question is this:      $y^2 = \frac{x^5 - 1}{x-1}$ & $x,y \in \mathbb{Z}$     Source: BdMO 2016 Regionals Set 1 Question 3.   I think this is the exact same question. Actually I didn't get the solution in the link. Please don't mark as duplicate.  I tried solving this same problem by writing code; there seems to be $6$ solution pairs to this equation. How do I get the $6$ solutions mathematically? I indeed need a full solution. Please help.


I am attempting to use JFileChooser to obtain the system path to a spreadsheet. The code below will then modify the spreadsheet, and output a new, modified sheet.  I thought that I could use toString() to store the directory, but I guess it's not actually storing the string? The error I get is a java.lang.NullPointerException. It initially occurs on my line 24, which is where I set the directory as fc1.path.  I have done a lot of research today on this with little luck. The code runs fine without using the file chooser, so there's something up with fc1.path.  The following is the code for the main program function.. My FileChooser4.java that it pulls from is further down..  App(.java):      public class App {      private static final int[] URL_COLUMNS = {0,4,9}; // Columns A, E, J     public static void main(final String[] args) throws Exception {          FileChooser4 fc1 = new FileChooser4();          Workbook originalWorkbook = Workbook.getWorkbook(new File(fc1.path));         WritableWorkbook workbook = Workbook.createWorkbook(new File("C:/Users/Shadow/Desktop/updated.xls"), originalWorkbook);         originalWorkbook.close();         WritableSheet sheet = workbook.getSheet(0);         Cell cell;          for (int i = 0; i < URL_COLUMNS.length; i++) {             int currentRow = 1;             while (!(cell = sheet.getCell(URL_COLUMNS[i], currentRow)).getType().equals(CellType.EMPTY)) {                  String url = cell.getContents();                 System.out.println("Checking URL: " + url);                 if (url.contains("scrapingsite1.com")) {                     String Price = ScrapingSite1(url);                     System.out.println("Scraping Site1's Price: " + Price);                     // save price into the next column                     Label cellWithPrice = new Label(URL_COLUMNS[i] + 1, currentRow, Price);                     sheet.addCell(cellWithPrice);                 }                 currentRow++;             }         }          workbook.write();         workbook.close();     }      private static String ScrapingSite1(String url) throws IOException {         Document doc = null;         for (int i = 1; i <= 6; i++) {             try {                 doc = Jsoup.connect(url).userAgent("Mozilla/5.0").timeout(6000).validateTLSCertificates(false).get();                 break;             } catch (IOException e) {                 System.out.println("Jsoup issue occurred " + i + " time(s).");             }         }         if (doc == null) {             return null;         } else {             return doc.select("p.price").text();         }     } }   FileChooser4(.java):  import javax.swing.JFileChooser; import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.filechooser.FileSystemView;  public class FileChooser4 {      public String path;      public void main(String[] args) {          JFileChooser jfc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory().getPath());         jfc.setDialogTitle("Select a sheet");         jfc.setAcceptAllFileFilterUsed(false);         FileNameExtensionFilter filter = new FileNameExtensionFilter("Choose a '.xls' file...", "xls");         jfc.addChoosableFileFilter(filter);          int returnValue = jfc.showOpenDialog(null);         if (returnValue == JFileChooser.APPROVE_OPTION) {             path = jfc.getSelectedFile().getAbsolutePath();             System.out.println(path + " selected.");         }     }  }


Some years ago, I published some papers that I'm not particularly proud of. They aren't in prestigious or widely known venues in my field, and I'm sure that few if any people in my field have seen these papers. When I apply for a job, am I permitted to omit these publications from my CV? Or am I, for some reason, obligated to list all prior publications?

I'm a Masters Student who has an old paper. I wrote a paper years ago with a research group in my old school. However, it's a really simple idea and was published in a not very reputed journal (Impact Factor 0.3). It was a long time ago, and honestly I would rather not be affiliated with it.  International Journal of Advanced Trends in Computer Science and Engineering  Should this be included in my CV?    It's relevant to what I'm doing now but just not very important and I consider it a not very good use of my time


I have a bar chart that looks like this:    Here is the code that I used to generate the plot:  \begin{tikzpicture} \begin{axis}[     enlarge x limits=0.03,     every axis plot post/.style={/pgf/number format/fixed},     ybar=1pt,     ylabel=F1 Score,      xlabel=objects,     bar width=10pt,     x=0.45cm,     ymin=0,     axis on top,     ymax=1,     xtick= \empty,     xticklabel style={rotate=-90,  xshift=0.2cm},    symbolic x coords={barkely hide bones, cherokee easy tee-shirt, clorox utility brush,  cloud b plush bear, command hooks, cool shot glue sticks,                 crayola 24 ct,                         creativity chenille stems ,             dasani water bottle,                  dove beauty bar,                       dr browns bottle brush,               easter turtle sippy cup ,             elmers washable no run school glue ,    expo dry erase board eraser ,          fiskars scissors red,                fitness gear 3lb dumbbell,         folgers classic roast coffee, hanes tube socks,                       i am a bunny book,       jane eyre dvd,                    kleenex paper towels,  kleenex tissue box, kyjen squeakin eggs plush puppies, laugh out loud joke book, oral b toothbrush green, oral b toothbrush red, peva shower curtain liner, platinum pets dog bowl, rawlings baseball, rolodex jumbo pencil cup, safety first outlet plugs, scotch bubble mailer, scotch duct tape, soft white lightbulb, staples index cards, ticonderoga 12 pencils, up glucose bottle, womens knit gloves, woods extension cord  },     visualization depends on=rawy\as\rawy, % Save the unclipped values     after end axis/.code={ % Draw line indicating break             \draw [ultra thick, white, decoration={snake, amplitude=2pt}, decorate] (rel axis cs:0,1.05) -- (rel axis cs:1,1.05);         },     nodes near coords={%             \pgfmathprintnumber{\rawy}% Print unclipped values         }, every node near coord/.append style={font=\tiny, inner sep=1pt,rotate=90,xshift=0.3cm},     axis lines*=left,     clip=false     ] \addplot coordinates { (barkely hide bones,0.8780) (cherokee easy tee-shirt,0.8210) (clorox utility brush,0.8210) (cloud b plush bear,0.8360) (command hooks,0.8770)  (cool shot glue sticks,0.7930)                  (crayola 24 ct,0.8110)                          (creativity chenille stems ,0.7610)              (dasani water bottle,0.7960)                   (dove beauty bar,0.7400)                        (dr browns bottle brush,0.9400)                (easter turtle sippy cup ,0.8790)              (elmers washable no run school glue ,0.8380)     (expo dry erase board eraser ,0.8240)           (fiskars scissors red,0.4780)                 (fitness gear 3lb dumbbell,0.7630)          (folgers classic roast coffee,0.8980)  (hanes tube socks,0.8890)                        (i am a bunny book,0.9060)        (jane eyre dvd,0.8930)                     (kleenex paper towels,0.8880) (kleenex tissue box,0.9420)  (kyjen squeakin eggs plush puppies,0.8600)  (laugh out loud joke book,0.8940)  (oral b toothbrush green,0.7460)  (oral b toothbrush red,0.6790)  (peva shower curtain liner,0.9160)  (platinum pets dog bowl,0.9170)  (rawlings baseball,0.8580)  (rolodex jumbo pencil cup,0.9260)  (safety first outlet plugs,0.8340)  (scotch bubble mailer,0.8940)  (scotch duct tape,0.8100)  (soft white lightbulb,0.8410)  (staples index cards,0.8470)  (ticonderoga 12 pencils,0.9500)  (up glucose bottle,0.7860)  (womens knit gloves,0.8870)  (woods extension cord,0.8880) };  \end{axis} \end{tikzpicture}   I want the bars to be sorted automatically based on the y value. Could someone please help in figuring this out?

I am using a tikzpicture for plotting. the values I want to plot are typical (X,Y) pairs. The x-value is an uninteresting id-value. I want to order the bins ascending/descending according to the y-value, but how do I do that? The figure seems to automatically take the x-values for ordering, how can I override that? (I am not particularly fixed to tikzpicture - its just the first thing that actually worked and displayed the plot....) Following minimal-working example, how could I achieve a reordering according to the y-value?  \documentclass{article} \usepackage[english]{babel} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{relsize} \usepackage{times} \usepackage{url} \usepackage{latexsym} \usepackage{graphicx} \usepackage{colortbl} \usepackage{color} \usepackage{caption} \usepackage{pgfplots, pgfplotstable} \usetikzlibrary{arrows} \usepackage{amsmath} \usepackage{multirow} \usepackage{booktabs}  \usepackage{filecontents} \definecolor{OgAns}{rgb}{0, 0.8, 0.4}  \begin{filecontents}{testdata.dat} 1   30 2   44 4   26 3   39 \end{filecontents}  \begin{document} \begin{figure} \begin{tikzpicture}         \begin{axis}[                ybar stacked,             ymin=0,             ymax=100,             bar width=5pt,             legend style={at={(0.35, -0.4)},anchor=south west},             legend columns=-1                       ]           \addplot[ybar,fill=OgAns]  file {testdata.dat};          \end{axis}     \end{tikzpicture} \end{figure}   \end{document}


if $E = [0,1] \bigcap \mathbb{Q}$ to show that the outer measure $m^*(E) = 0 $ , I've used the fact that E is numerable so it can be found the sequence of rationals in E: $x_1,x_2,\ldots,x_n$. Taken an $\varepsilon >0$ I constructed the intervals: $I_1$ of length $\varepsilon/2$ containing $x_1$, $I_2$ of length  $\varepsilon/4$ containing $x_2$, and so on to have $I_k$ of length $\varepsilon/2^k$  ontaining $x_k$. By the definition of outer measure:  $m^\ast(E):= \inf_P m(P)$  where $P = \bigcup_k I_k$  if my reasoning is right $m^*(E) = 0 $, because $\varepsilon/2^k$ goes to 0 and represents the infimum.  By similar arguments I'd like to obtain the outer measure of the irrationals set $E^c$: $m^*(E^c)$ which I know should be 1, but I am not figuring out how could I cover this set.

if $E = [0,1] \bigcap \mathbb{Q} $, what is $E^\complement$  with respect to $[0,1]$ and its outer measure $m^\ast(E^\complement)$?  The outer measure is defined thus:  $m^\ast(E^\complement):= \inf_P m(P)$  where $P$ ranges over the set of multi-intervals containing $E$: $E \subseteq P$


I'm curious, what if a question has 4 votes, 2 for one reason, 2 for other, and the fifth person chooses a third... what is the official close reason?

What would happen/How would close votes appear in case of    1 too localised vote 2 not a real question votes 2 not constructive votes   How would message about closing look like?


I am trying to connect to an external system via REST API. The below is the JSON response. {"coord":{"lon":-0.1257,"lat":51.5085}, "weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}], "base":"stations", "main:{"temp":292.86,"feels_like":287.94,"temp_min":292.04,"temp_max":293.71,"pressure":1027,"humidity":45}, "visibility":10000,"wind":{"speed":6.17,"deg":260},"clouds":{"all":23},"dt":1617027097,"sys":{"type":1,"id":1414,"country":"GB","sunrise":1616996538,"sunset":1617042474},"timezone":3600,"id":2643743,"name":"London","cod":200}  I am parsing it in the below manner but I would like to know if there is any standard method of parsing data. Right now, I somehow feel the below method is inefficient since the JSON string is a mix of list, array of list and objects. Could you please suggest me best practice while parsing the JSON string>         Http http = new Http();         HttpRequest request = new HttpRequest();         request.setEndpoint('http://api.openweathermap.org/data/2.5/weather?q=London,uk&APPID=8ce9a754cab8e60ec7891a776bab165e');         request.setMethod('GET');         HttpResponse response = http.send(request);         system.debug(response.getBody());         system.debug(response.getStatusCode());                  //Parse the JSON String into a Map         Map<String, Object> jsonParse = (Map<String, Object>)Json.deserializeUntyped(response.getbody());         system.debug('jsonMap'+jsonParse);                  //Get the weather information - array of list         List<Object> listObject = (List<Object>)jsonParse.get('weather');                 for(Object o: listObject){             Map<String, Object> weatherMap = (Map<String, Object>)o;             system.debug('weatherMap '+ weatherMap.get('description'));             system.debug('weatherMap '+ weatherMap.get('id'));             system.debug('weatherMap '+ weatherMap.get('main'));             system.debug('weatherMap '+ weatherMap.get('icon'));         }                  String base = (String)jsonParse.get('base');         system.debug('base' + base);                  Map<String,Object> main = (Map<String,Object>)jsonParse.get('main');         Decimal temperature = (Decimal)main.get('temp');         Decimal pressure = (Decimal)main.get('pressure');         Decimal humidity = (Decimal)main.get('humidity');         system.debug('temperature '+ temperature);         system.debug('pressure '+ pressure);         system.debug('humidity '+ humidity);                  Map<String,Object> coord = (Map<String,Object>)jsonParse.get('coord');         Decimal latitude = (Decimal)coord.get('lat');         Decimal Longitude = (Decimal)coord.get('lon');         system.debug('latitude '+ latitude);         system.debug('longitude '+ longitude);

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, navigate to the  tag.  This question and answer is owned by the community! If you can improve it and make it more useful, you're welcome to edit it.  I have a specific JSON structure in mind. I need to either deserialize this structure that's coming in from a web service, or I need to serialize data into this structure to transmit it to another system. How should I get started on this project in Apex?


It's written in many resources that if we consider only finite sets, that choice axiom can be skipped and be proven from other ZF axioms.  I remember I've read the following explanation. If $A$ is a finite set, there is exists some natural $n, |A|=n$, therefore exists some bijection $f:\{1,\cdots,n\}\to A$. And we can choose an element from $A$ by choosing $f(1)$  But there is a problem with this explanation.  Actually there are $n!$ of such bijections. So how can we choose one $f$ of them without this axiom of choice?!  UPD: actually I can simplify my question heavily.  Let's consider one-point set $A, |A|=1$. How can I get an element from this set without using axiom of choice? We know that $A=\{x\}$ for some $x$. But we don't know how to obtain it. What allows us to just say Let's pick $x$ from $A$?

So I am relatively familiar with the Axiom of Choice and a few of its equivalent forms (Zorn's Lemma, Surjective implies right invertible, etc.) but I have never actually taken a set theory course.  I know there are times when an explicit way of choosing some elements may not be provided, and instead we call upon the Axiom of Choice to do it for us. But one thing has always bothered me.  I have heard that for a finite set we do not need the Axiom of Choice to choose an element. I find this a little confusing. How is choosing an element from a finite set any different than choosing from an infinite set? I have heard before "since the set it finite, there are finitely many orders, so order the set and choose the first element in the order." But how does one choose what order to use? This involves picking an element from a finite set, i.e. it presumes the conclusion.  I'm guessing there is a good reason why everyone keeps insisting that the Axiom of Choice in not needed to choose from finite sets, so could someone please explain it to me?  Edit: There seems to be confusion on what exactly I am asking. I know that we need the Axiom of Choice, sometimes, to make infinitely many choices, from finite or infinite sets. This is not what is confusing me. Allow me to be more precise:     Suppose $S$ is a nonempty finite set. I want to pick one element from $S$. Does choosing one element from $S$ require the Axiom of Choice? If not, how can the choice be made without the Axiom of Choice?   Saying $S$ is not empty, therefore there is an $x \in S$, does not suffice. How do I choose such an $x$? There is one, but how do I describe it without any information about the set, other than the fact that it nonempty and finite?  Another clarification: I am not asking about using "Let ... be given" as a proof technique.


I am using the isSandbox() method outlined in the article , to determine whether my current org. is a Sandbox. Sample code from the article: public Static Boolean isSandbox(){          String host = URL.getSalesforceBaseUrl().getHost();         String server = host.substring(0,host.indexOf('.'));          // It's easiest to check for 'my domain' sandboxes first          // even though that will be rare         if(server.contains('--'))             return true;          // tapp0 is a unique "non-cs" server so we check it now         if(server == 'tapp0')             return true;          // If server is 'cs' followed by a number it's a sandbox         if(server.length()>2){             if(server.substring(0,2)=='cs'){                 try{                     Integer.valueOf(server.substring(2,server.length()));                 }                 catch(exception e){                     //started with cs, but not followed by a number                     return false;                 }                  //cs followed by a number, that's a hit                 return true;             }         }          // If we made it here it's a production box         return false;     } }  My org. uses custom subdomain. When I attempt to create a unit test class for this method, it returns success at the first branch, i.e. if(server.contains('--'))     return true;  and skips the rest of the method. This is leading to only 33.33% code coverage. I'm looking for pointers on what strategy can I take here to ensure the whole method is tested? Thanks.

I am checking for sandbox with help of query select Id from Organization where IsSandbox =true limit 1  but now in production and developer org my code coverage is going down to 33%  as this query is not getting satisfied.  How should i increase this code coverage?


I purchased a MacBook Pro 6,2 (15" mid 2010) running macOS High Sierra  How I can install macOS Mojave in this Mac?  Several time I tried to install Mojave in this Mac, but it gives an error message that version is not compatible with this Mac.  Would you please help for solve my problem?

As per Apple support document, :     1. Check compatibility      You can upgrade to macOS Mojave from OS X Mountain Lion or later on   any of the following Mac models. Your Mac also needs at least 2GB of   memory and 12.5GB of available storage space, or up to 18.5GB of   storage space when upgrading from OS X Yosemite or earlier.         MacBook introduced in early 2015 or later   MacBook Air introduced in mid 2012 or later   MacBook Pro introduced in mid 2012 or later   Mac mini introduced in late 2012 or later   iMac introduced in late 2012 or later   iMac Pro (all models)   Mac Pro introduced in late 2013, plus mid-2010 or mid-2012 models with a recommended Metal-capable graphics card.      I am currently running macOS High Sierra on my Early 2011 MacBook Pro.  What does Apple's requirements mean for my ability to install Mojave? Is it possible or worthwhile to do so?


I sometimes accidentally change the behaviour of the view port navigation. I don't know how I do it, nor how to reset it.  The behaviour is different insofar that if I press the middle mouse button and move the mouse, the view does not rotate around a point that lies somewhere where I'm looking at but more like around a point in the "camera" of the view port.  It's like looking around in a first person shooter.  What mode is this and how do I change it back?

I often find that I can zoom in to a point, but then cannot zoom any more, even when there is a lot of room to zoom to the meshes on the scene.   This is particularly annoying in the following scenario:  I often land up left clicking on the scene and the 3D cursor shifts there. I use Shift+C to shift the 3D cursor back to the origin. However, this also centers the view on the cursor and shifts the view to show all objects, and sometimes this zooms things way out – at this point, if I try to zoom in, I can zoom in to a point (using the pinch/zoom on trackpad), but then it stops zooming in.   How do I zoom in after that? Is there anything else I am doing wrong in this case?


I find that the "you have gone fullscreen" popup in Chrome (see it for yourself by pressing F11) is extremely annoying, and I really want to get rid of it. After Googling for a while, I've come up short.  Is there any way, perhaps through an extension or registry setting, to remove this message?

Every time I switch into Full Screen (F11) in chrome it says "You've gone full screen. Exit Full Screen (F11)".   Can I disable this from showing up? I know how to exit full screen.


How do I report that a question should be moved to a different site (from stackoverflow.com to superuser.com, in example)?

I posted a question which was closed as off-topic and it seems like it could fit on another site in the network. How can I go about moving it there?   What is migration? When can a question be migrated, and who can migrate it? When should I consider migration, and when is it inappropriate? What causes a migration to be blocked and what happens after? What causes a migration to be rejected and what happens after? Anything else I should know about migration?


Why do words that begin with the letters "DE" have different ways of pronouncing?   Example: decide(dɪˈsaɪd) and decoy(diː.kɔɪ)  Does the english language has some sort of rule to help with this?

It’s hard for me to guess how to pronounce words beginning with re- correctly.   Sometimes it is /rɛ/ as in reference, but sometimes it is /ri/ as in report.  Is there any rule about this?


When I type (Eq.\ref{eq.15}) The output is     Obviously the spacing between "Eq." and "1.15" is too closed. But when I type (adding a space) (Eq. \ref{eq.15})  The output is:    Obviously the spacing between "Eq." and "1.15" is too wide!  My question is how I can get appropriate spacing.

gained a reputation of painting red the draft dissertations of his students, taking particular note of incidents when they omitted a non-breaking space that should have been included.  I have this list of places where you have to place non-breaking space:   before \cite before \ref before inlined equation   But, I am not sure if I got the rules right; is a non-breaking space mandatory  before all inline equations? How about numbers which occur in the text? And what if I refer to a program variable, or to program text, for example,  The 371 programmers who read, on 11 different occasions, the Java program in Figure~\ref{Program:Example}  noticed that it is peculiar since parameter \texttt{i} is never read by functions \texttt{f()} and \texttt{thisLongFuncgtionName()}...   Do I have to write The 371 programmers or The~371 programmers? on 11 different occasions or on~11 different occasions?  Do I need to write parameter~\texttt{i}? I think I should. What about functions~\texttt{f()}? And should I write and~\texttt{thisLongFuncgtionName()}? How about citations that use author, year convention?  In short, I think have an idea, but no exact definition of when you should add non-breaking space.


Sophisticated, wheelchair-bound pollster/ad man discovers voters have been grouped in residential neighborhoods by behavior type for easy manipulation.  Triggered by smells, sounds, etc., they converge/attack & he barely escapes, using every tool built into his high-tech conveyance. It’s 40+ years since I read this.  I have no recollection of title or author, but my memories of the story theme have been especially vivid through the Trump era.

So I read this short story a few years back in an anthology I found in a university library. The anthology was titled "Best American Sci-fi" or "Greatest Works of Science Fiction" or something along those lines. I think the story was from the 70s but I have no idea who the author was or what the title is.  It was pretty short. The main character is a man who has a large assistant/bodyguard with him. The man gets out of a van, unloads a wheelchair, and then talks about how he's nervous about the situation. He talks for a bit about he modified the chair in order to protect himself. I don't remember it being in first person but you could hear the main character's thoughts.  The main character then injects himself with a blue liquid. He slumps in the chair and loses most of his motor functions but his senses and processing skills become extremely powerful. The main character and his bodyguard then go around this normal suburban neighborhood, which has been explained as under the control of this corrupt congressman.  The story doesn't really explain what the congressman does other than use a new field of science to manipulate his constituents. I don't remember what it's called, but the main character is also using it. The field is what developed the drug he's using and it's also how he deters people from attacking him--it has to do with a lot of psychology.  The main character continues driving around this neighborhood, analyzing people, until they start to get suspicious. A crowd gathers around him and threatens to hurt him, so he releases a scent-bomb that messes with the psyche of all of the people around him. I think the bodyguard gets knifed or killed.  The story ends with him loading back into the van, thinking about the corrupt congressman and how he almost died. The drug wears off and he's a normal human again.


Caption over picture of Owen and his dad..."Owen and I"   is this correct grammatically ?

Possible Duplicates:                When identifying people in a photo—for instance,      John, Valencia, and (I or me).   should I use ”I” or “me”? Which one is grammatically correct?


sudo apt install gksu -y Reading package lists... Done Building dependency tree        Reading state information... Done Package gksu is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'gksu' has no installation candidate

I downloaded the Upwork desktop App on ubuntu 18.04. When I open it with Gdebi package installer I saw this error:    I tried to install gksu manually via sudo apt install gksu but I got this error  Building dependency tree        Reading state information... Done Package gksu is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'gksu' has no installation candidate   How can I install this software on ubuntu 18.04 (I download it yesturday so it is the most recent version on upwork website) ?


I recently bought a cast iron wok and attempted to season twice.  The first time i seasoned it i think i overheated the wok and it started to smoke when i added oil and some shiny black stains which looks like patina formed.  I tried seasoning a second time but after seasoning, it didn't seem that non stick to me.  Here are the steps i took to season the wok.  1) Scrub thoroughly with hot water and soap  2) on low to medium heat evaporate all the water   3) add in oil and stir fry some onions (some videos say it gets rid of the initial metallic taste)  4) after 5-10 mins i took it off the heat and let it cool  5) i rinsed it with water after and applied a thin layer of oil  This is the first time i'm seasoning a wok and i have no idea if is working out but i noticed that everytime i wipe it with some tissue paper, the tissue paper turns black! I'm considering throwing it away and any help would be appreciated.

I have a small cast iron pan which I am working with, trying to make sure I understand seasoning/cleaning before moving on to a larger one. I seasoned with flaxseed oil (4 light coats, hour in the oven), and have cooked a few things - I made some Ghee, fried some onions, stuff like that. After each I washed with hot water (no soap), heated until dry on the stove and coated with a thin layer of canola oil.  Now, when I take a dry paper towel and rub it on the pan, a black residue shows up on the paper towel. I can't feel anything with my fingers and I haven't noticed anything cooking with it. I'm fairly confident this occurred after the initial seasoning - although I'm not sure I did this exact test with the paper towel.  Is this a) normal, or b) what is wrong and c) how can I fix it?  There are quite a few questions (and good answers!) regarding cast iron cookware on this site but I haven't been able to find one that deals with this specific issue.


I was playing Terraria in hard mode, then a slime attacked me. I killed it, and it dropped a "Soul of Night." What kind of souls are are there, and what creatures can you get them from?

A lot of the cool new recipes in patch 1.1 I've found out via asking the Guide require some sort of Soul, of which there appear to be numerous different types. For example:   Soul of Light Soul of Night Soul of Might Soul of Fright   I've played for a couple hours, and I've yet to find a single one of any type of Soul. How do I get them? Do I maybe need a special item to extract them from slain monsters?


I am trying to make multiple linear regression models for multiple crops where my dependent variable is Yield of crops for ex. Yield of Wheat, Rice, etc. I have data set in which each row represent a district and for each district there are multiple variable such as climatic variables such as soil type, rainfall, topography etc and aggricultural input variables such as fertilizers, labors etc, and also there are distinct columns for yield of each crop. i am thinking of including fertilizer cost in RS/hectare which is for whole district, not specific to any one crop, so i am not sure about it, can i include this variable in my multiple regression model for single crop model. link for the data ->   EDIT  this is not duplicate of the any thread on stack exchange, my question is not about which variable are significant or not significant and on which basis choose them, i have not even run the model, right now i am trying to formulate the structure of model and therefor choosing which variable i can choose? please read the above paragrpah of question carefully  THIS IS NOT DUPLICATE ANY OF THEM, PLEASE GUYS DON'T JUST TAG THIS WITHOUT EVEN READING THE QUESTION STATEMENT! THIS IS VERY DISAPPOINTING!

I am currently working to build a model using a multiple linear regression. After fiddling around with my model, I am unsure how to best determine which variables to keep and which to remove.  My model started with 10 predictors for the DV. When using all 10 predictors, four were considered significant. If I remove only some of the obviously-incorrect predictors, some of my predictors that were not initially significant become significant. Which leads me to my question: How does one go about determining which predictors to include in their model? It seemed to me you should run the model once with all predictors, remove those that are not significant, and then rerun. But if removing only some of those predictors makes others significant, I am left wondering if I am taking the wrong approach to all this.  I believe that  thread is similar to my question, but I am unsure I am interpreting the discussion correctly. Perhaps this is more of an experimental design topic, but maybe someone has some experience they can share.