I'm getting exception Cross-thread operation since i'm using ui var in a thread operation how should i handle it?

I have this progress changed event:  private void videosInsertRequest_ProgressChanged(IUploadProgress obj)         {                  toolStripStatusLabel1.Text = obj.Status.ToString();         }   And also this event:  private void videosInsertRequest_ResponseReceived(Video obj)         {             toolStripStatusLabel1.Text = obj.Status.UploadStatus;         }   And sometimes i'm getting the exception:  Cross-thread operation not valid: Control '' accessed from a thread other than the thread it was created on  Should i use a BeginInvoke over this control or to handle it in another place out of the event ?  This is where i register the event:  static Video video = null;         static ulong process = 0;         private void UploadVideo(string FileName, string VideoTitle, string VideoDescription)         {             UserCredential credential;             using (FileStream stream = new FileStream(@"D:\C-Sharp\Youtube-Manager\Youtube-Manager\Youtube-Manager\bin\Debug\client_secrets.json", FileMode.Open, FileAccess.Read))             {                 credential = GoogleWebAuthorizationBroker.AuthorizeAsync(                     GoogleClientSecrets.Load(stream).Secrets,                     new[] { YouTubeService.Scope.Youtube, YouTubeService.Scope.YoutubeUpload },                     "user",                     CancellationToken.None,                     new FileDataStore("YouTube.Auth.Store")).Result;             }             var youtubeService = new YouTubeService(new BaseClientService.Initializer()             {                 HttpClientInitializer = credential,                 ApplicationName = Assembly.GetExecutingAssembly().GetName().Name             });             video = new Video();             video.Snippet = new VideoSnippet();             video.Snippet.Title = VideoTitle;             video.Snippet.Description = VideoDescription;             video.Snippet.Tags = new string[] { "tag1", "tag2" };             comboBox1.BeginInvoke((Action)(() =>             {                 video.Snippet.CategoryId = (comboBox1.SelectedItem as ComboboxItem).Value.ToString();             }));             video.Status = new VideoStatus();             video.Status.PrivacyStatus = "public";              using (var fileStream = new FileStream(FileName, FileMode.Open))             {                  const int KB = 0x400;                 var minimumChunkSize = 256 * KB;                  var videosInsertRequest = youtubeService.Videos.Insert(video,                     "snippet,status", fileStream, "video/*");                 videosInsertRequest.ProgressChanged +=                     videosInsertRequest_ProgressChanged;                 videosInsertRequest.ResponseReceived +=                     videosInsertRequest_ResponseReceived;                 videosInsertRequest.ChunkSize = minimumChunkSize * 4;                                 videosInsertRequest.Upload();             }         }   And then i have a button click event where i start a backgroundworker runasync. And then in the DoWork event i'm doing:  private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)         {             UploadVideo(FileNameToUpload, uploadVideoTitleTxtBox.Text, uploadVideoDescriptionTxtBox.Text);         }   And now the backgroundworker progresschanged event is empty but somehow i should report to the backgroundworker form inside the two events in my top of my question.  Or maybe using BeginInvoke in this two events ?  I want to report to the toolStripStatusLabel1 and 2 from this events.


Show the following limit does not exist at $(0,0)$: $xy^2/(x^4 + y^2)$

This is a math question I'm supposed to do, I know the limit does not exist(it's mentioned in the question) but I can't find any 2 paths that gives me any other answer than 0. Please if you can answer this, help me out Thanks


How to delete recorded position of mesh on animation timeline?

I've got problem with my animation. I've got a sword in my scene, but I somehow animated it so that its handle starts falling down when I play through the timeline, and I don't know how to delete this.    Look at the picture, there's some orange line at timeline bar - that's what I want delete.


Regex pattern to match BODMAS rule in a mathematical expression

I have a mathematical expression (((a+b)(c+d))+p(q*2+r))/2 I am trying to write a C# code to match the groups as below  (((a+b)(c+d))+p(q*2+r)) ((a+b)(c+d)) (q*2+r)) (a+b) (c+d))  Unfortunately I am not able to find one. Can you please help me from this situation I have an expression "((.*?))" but this can match as below and it is not matching with my need  (((a+b) (c+d) (q*2+r)  NB: Expression can be changed. Looking for a generic regex pattern to parse any expression with BODMAS rule


Examples in which the light maximizes the optical path length

I posted a similar  about geodesics on Math.SE. Many sources ( for instance) claim that the light could maximize the optical path length in some cases. But I don't think it's actually true since between two points I can always imagine a path with arbitrary length. Therefore, or the light minimizes the optical length or it's stationary (neither maximum nor minimum). My question is: is the trajectory in red in the figure below a local minimum or a stationary curve?   If I'm wrong, please provide some examples which the light propagates in trajectory of maximum length.


I understand commands but I am fairly new to the 1.13 changes.  I am trying to make an AFK system within vanilla Minecraft.  I want to use the /execute command to execute once. I want to detect when a scoreboard objective is a certain value and print  [Player] has gone AFK   in the chat only once. This is my command at the moment,  execute as @a[scores={afk=1..}] at @s run tellraw @a {"text":"","color":"red","extra":[{"selector":"@s"},{"text":" has gone AFK.","color":"yellow"}]}   It keeps printing until the scoreboard value is reset.


Google Analytics Segments w/ Conditions: Boolean order of operations?

Using Google Analytics, I'm trying to create a "supported browsers" segment using the Conditions section, but the boolean order of operations isn't occurring as expected. A simple example is below.    AND usually takes precendence over OR, so I'd expect my segment above to be interpreted as (Safari AND v10) OR (Chrome AND v57), which would allow me to include a number of Browser/Version combinations.  However, it seems like that's not the case, here. I believe this because:   My results zero out with the segment configured as pictured, but if I remove either the first or fourth clause, I'll get results. This is consistent with my filters being interpreted as Safari AND (v10 OR Chrome) AND v57, such that Safari AND (v10 OR Chrome) and (v10 OR Chrome) AND v57 both return results. The horizontal line by each AND operator seems to divide the clauses as described above.   OR-precedence doesn't make any sense to me, since the "Add Filter" button already allows the user to add additional clauses which would be equivalent to an AND, allowing the user to choose OR-precedence if they needed to. As it is, there seems to be no way to construct an AND-precedent segment.


Playing Minecraft on Windows 10, owning a Xbox One disc

I own a Minecraft disc for an Xbox One, and would like to play on my PC (ultimately, playing with others who will be on the Xbox).  I'm not too familiar with the Xbox account ecosystem, and with dozen different Minecraft editions, I'm lost as to how I can do that.


How can I find out which cards are supported by the fglrx driver?

I want to know where I can find out which is the current fglrx-updates driver in the repo. I own a Radeon R9 270 and I need to know if it is supported since Trusty 14.04. Thanks! :)


I have ticked grid maps in Atlas composer. The problem is my maps don't have same scale to represent. Then, I would like to configure grid in such way that lines of grid  in different maps change automatically to each map  in order will have better fit line.  I think that data defined override can be fix it. But I haven't seen this options to interval grid.


What happens when I flag a posted answer as “not an answer”?

What happens when I flag a posted answer as not an answer? Is the answer put into a review queue? Or will it be deleted?


Nacelles: if two are better than one, then why are three not better than two?

In Star Trek, the vast majority of Starfleet vessels (and prior warp-capable Earth vessels) are equipped with two warp nacelles.  Those very familiar with the Star Trek universe need no convincing about this, but for those whose Trek awareness is a little more tangential, some examples include:  The Phoenix  (first warp-capable Earth vessel)    Enterprise NX-01    USS Enterprise NCC-1701    USS Reliant NCC-1864 (with one nacelle blown off)    USS Grissom NCC-638 (about to meet its end)    USS Enterprise NCC-1701-A    USS Excelsior NCC-2000    USS Enterprise NCC-1701-D    USS Voyager NCC-74656    USS Defiant NX-74205    Even shuttlecrafts and runabouts have two nacelles:    On occasion, we have seen one nacelle...    ...and three nacelles...    ...and even four nacelles...    ...but these instances are most definitely in the minority.  This leads to the question:  Why are two nacelles optimal?  Equivalently:  If two are better than one, then why are three not better than two?  For answering, I'd like to stay in-universe wherever possible.


Do I still need to modify PolKit in order to add a new Wifi connection without root?

After googling this problem, it appears (as of 7 YEARS ago) that the only way to allow users to connect to new WiFi networks is to modify PolKit (, ). Is this still the case with Ubuntu 20.04, without having to install further packages?  Hard to believe that Ubuntu hasn't made this more user-friendly yet over the last 7 years. Edit: What I'm wanting to do is allow standard users to simply connect to any WiFi network (new or known) without having to enter the root password.  That's it.  Currently, my Ubuntu desktop requires standard users to type in the root password in order to connect to a new WiFi network.  That seems a little silly since Windows and Mac allows standard users to connect to whatever WiFi network they want with admin privileges.


Is there some sort of clever hack of achieving that, because I did not find anything. I have a 27" Mac and everything is still kind of huge.


How to slap a text object on to a sphere

Newbie here. I've looked through the answers to similar questions and am both in awe and perplexed by what I see. While I am sure that once I get the lingo down (solidify, mesh, remesh) it will all make sense, however I find that I have an urgent requirement and I'm only part way through the learning flow.  I need to create a few atoms. Quite simple really as far as I can tell, but I'm not there yet in the learning. I need a sphere with "H" on it (I guess the secret of which element it is is out).   There's a really good answer, apparently, on a question about creating balloons with text, but the language (peel off the pelt etc) used is well beyond me. Is there a location I should be looking to learn how to slap text onto a sphere?


Neofetch says my shell is bash.  However, I was under the impression that i changed my default shell to zsh with the chsh command. Echo $0 shows zsh as my current shell, and echo $SHELL shows bash as my default shell. How do I get zsh to be the default, and will neofetch be able to reflect this?


Beamer and tikz globally and locally installed

I am using lyx and want to crate a Beamer presentation with flowcharts. But I want to make the aspect ratio to be 19:6. The last version of the Beamer package supports this, but older ones, not. In my system, the older one is installed. So, I have installed locally the newer one (along with all required packages, including pgf, that in turn includes tikz). This works fine and I can produce beamer presentations with 19:6 aspect ratio. But now, I want to add some flowcharts. For this purpose, I load the package tikz. But when I attempt to compile I get the following errors:  LaTeX Error: Command \pgfdeclareimage already defined. LaTeX Error: Command \pgfdeclaremask already defined. LaTeX Error: Command \pgfimage already defined.  And I think that Latex loads twice the pgf package. So, how could I prevent latex from loading the older (globally installed) packages without to delete them (I do not have root permissions). But it seems to work well when only the beamer package is loaded, which is also installed globally and locally). The latex code follows. I have generated it from lyx with Export->LaTeX(pdflatex), and get the same errors as within lyx when I run the file with pdflatex: %% LyX 2.1.4 created this file.  For more info, see http://www.lyx.org/. %% Do not edit unless you really know what you are doing. \documentclass[english,aspectratio=169]{beamer} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \setcounter{secnumdepth}{3} \setcounter{tocdepth}{3}  \makeatletter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.  % this default might be overridden by plain title style  \newcommand\makebeamertitle{\frame{\maketitle}}%  % (ERT) argument for the TOC  \AtBeginDocument{%    \let\origtableofcontents=\tableofcontents    \def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}    \def\gobbletableofcontents#1{\origtableofcontents}  }  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. \usepackage{tikz}  \makeatother  \usepackage{babel} \begin{document} This is a test \end{document}


In what order should Ghost in the shell franchise be viewed

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


If someone wins a match, that person is called a winner.  If someone loses a match, that person is called a loser or runner up.  But if the match is a draw, that is, no one has won or lost, what do you call them then?


Can "prefer" be used as a dynamic (non-stative) verb?

My friend had a homework exercise about stative verbs in their English class and asked me to help with it. The task was to mark sentences that were correct. There was one difficult sentence there:     I am preferring fish to meat.   In the other column, there was the same sentence in Present Simple:     I prefer fish to meat.   To me, it looks like the sentences are both correct. The latter means "I always/usually prefer fish to meat", the former means "Right now I am choosing fish, not meat, while I could usually prefer meat to fish.".   So, can I use "prefer" as a dynamic verb, meaning something along the lines of "choose", not "like"?


Can I possibly recover the Windows system partition that I deleted (100MB)?

After moving to SSD I deleted the System Partition (100MB) from my previous drive, causing mass destruction.  I tried to delete the System Partition which windows 7 creates (on my previous disc as I moved to SSD) and when I tried to extend the main partition size to include the new Unallocated Space it asked me if I wanted to convert the disc to Dynamic.  I simply pressed yes and the partition simply disappeared into unallocated space. All of my family pictures / videos lost.  After reading an article on Microsoft they said to recreate the partition with the same exact size, so I tried to do that but it didn't work. I did not format the drive at all when I created partitions.  How can I possibly recover the partitions?  Thanks!


I'm a little new to Blender. I've been trying to render this animation in Eevee. It's 18 seconds long, and includes two human models (only the heads). For some reason, it will not render. When I click render animation, it only shows the very first frame in the beginning. After that, the render is completely grey-transparent and it only gets to about 98%. This has never happened before. Any suggestions?


CDN virtual subdomain causes duplicated content

I have created a subdomain and a CNAME record which points to the domain root. The subdomain www.static.example.com is actually a copy of the entire website www.example.com and it is supposed to act as an CDN and serve static content in order to improve speed. However, all of my content can be accessed via subdomain aswell, so Google has indexed it all and now I am dealing with duplicated content.  How could I deny access to crawlers for the subdomain baring in mind that I do not have different subfolder for subdomain, so I can't create a separate robots.txt file?


What is the best way to say that something was done in teamwork?

In my resume, I'm describing several projects I've worked on in the past. Most of them were done in teamwork. What is the best way to say this?  Examples:  Together with XY, I built ... OR  In collaboration with XY, I built ... OR  XY and I built ...  Are the first two examples grammatically correct? I'm unsure since first I state that something has been done in collaboration with a second person, but then I use "I built ...".


Exercise on gauge invariance and global and local symmetry

The following Lagrangian density describes a charged scalar field. Determine the global U(1) symmetry. Make this global symmetry local, give the Lagrangian density and show that this is Gauge invariant. The Lagrangian density is given by: $$L = \partial_\mu \psi \partial^\mu \psi^* - \frac{1}{2}m^2|\psi|^2 - \frac{1}{4}\lambda|\psi|^2.$$  My first idea was to perform the following transformation (because it is mentioned we are dealing with U(1) invariance): $$\psi \rightarrow e^{i\theta}\psi$$ $$\psi^* \rightarrow e^{-i\theta}\psi^*$$ $$\partial_\mu \psi \rightarrow D_\mu \psi = (\partial_\mu + iqA_\mu)\psi$$ and $$\partial_\mu \psi^* \rightarrow D_\mu \psi^* = (\partial_\mu - iqA_\mu)\psi^*$$ However I think this is what you have to do to obtain a local symmetry out of the global one. I have no idea how to find the global one. In short my questions are:  How do you find the global U(1) symmetry for a given Lagrangian density? Is the way to determine the local symmetry out of the global U(1) symmetry achieved by transforming in the following way: $\psi \rightarrow e^{i\theta}\psi$, $\psi^* \rightarrow e^{-i\theta}\psi^*$, $\partial_\mu \psi \rightarrow D_\mu \psi = (\partial_\mu + iqA_\mu)\psi$ and $\partial_\mu \psi^* \rightarrow D_\mu \psi^* = (\partial_\mu - iqA_\mu)\psi^*$? Is every Lagrangian density where you performed the transformation given in 2. Gauge invariant? If not, how can you check whether the Lagrangian density is Gauge invariant?  Thanks in advance!


Absolute value of the difference of two independent standard uniform random variables

So $X_1$ and $X_2$ are two independent uniform random variables and I am looking for the PDF of $Y,$ where $Y = |X_1 − X_2|.$ I have to find the CDF of $Z = X_1 - X_2$ first, then find the CDF of $Y = |Z|,$ and then finally take the derivative to find the PDF of $Y.$. I know this:  $$F_Y(y) = P(Y ≤ y) = P(X_1 − X_2 ≤ y).$$  I found the answer to this first part here:  but I don't understand their bounds of integration.  I know this is a long question but any help would be appreciated. I've been staring at this problem for hours. A very detailed explanation would really help me. Apologies for not understanding how to type with MathJax.


LED lamp keeps glowing when dimmer is turned off

(I know this question has been asked before (), but I followed the advice recommended by the users in that thread to help remedy the problem, but the lights still glow.)  I recently bought dimmable LEDs for my house, and I've noticed that the lights glow a little bit even while the dimmer is turned off (I have illuminated light switches to DO NOT use the neutral wire). I suspect this is due to the wall switches using the light bulb itself as neutral. When the wall switch is on, the bulb gets full line voltage. When the wall switch is off, the bulb is the neutral for the light of the wall switch, causing a tiny current to flow through the bulb.  I replaced the dimmer with the Luron MACL-153M, a digital dimmer that is specifically made for LEDs/CFLs, but that problem still persists (note: this dimmer also DOES NOT use the neutral wire, and is illuminated with a small light).  I then replaced one room's dimmer with a smart WiFi switch that DOES use the neutral wire, and walla, no glow. Also, if I use a non-illuminated switch, the LEDs do no glow while the switch is turned off.  So I tried a solution that seems to work for the rest of the rooms where I don't want smart light switches. I added a 10k ohm resistor in between the load and the neutral (so in parallel), and it seems to "drain" that small electricity leak from the dimmer. When I did this, the LEDs did not glow when turned off.  Now, my question to the community is: Is there a safer way to do this? Of course I covered all exposed wires with electrical tape, and my resistor is rated at 200 volts (I live in the US). And theoretically, this resistor is acting just like another bulb on the circuit, but that does not emit light.  I looked around for a non-wifi/Bluetooth/etc. dimmer that uses the neutral wire, and the only one seems to be a Leviton one that costs $60--way too pricey. Adding a resistor in parallel makes sense and is much more cost-effective. Please let me know if this is ok/safe long term.


Area of a revolution surface : what's wrong here?

I want to compute the area of a revolution surface generated by $f(x)$, i.e. of the surface $(u, f(u)\cos(v), f(u)\sin(v))$. I know it's $$\mathcal A=\int_{x}^y f(z)\sqrt{1+f'(z)}dz.$$  But why is my argument below wrong :  We sum the area of the infinitesimal cylinder of radius $f(z)$ and altitude $dz$ that should give us $$\int_x^y 2\pi f(z) dz,$$ but this is wrong, so maybe the altitude is in fact $df$, and thus I get $$\int_x^y 2\pi f(z)df=\int_x^y 2\pi f(z)\frac{df}{dz}dz=\int_x^y 2\pi f(z)f'(z)dz,$$ but it still wrong and I don't understand what's wrong in theis logic to sum area of infinitesimal cylinder of radius $f(z)$ and altitude $dz$ or altitude $df$. Could someone explain me ?


How to skip "permission denied" errors when running find in Linux?

Possible Duplicate:          When I run this command in Linux (SuSE):  find / -name ant   I get many error messages of the form:  find: `/etc/cups/ssl': Permission denied   Does find take an argument to skip showing these errors and only try files that I have permission to access?


Just that. By good I mean something at the level of SolidWorks, AutoCAD, or similar. This is a complete limitation for me (and many others) to use Ubuntu.


Let $p$ be a prime number. Show that the congruence $x^{p-1} \equiv 1 \pmod {p^2}$ has precisely $p-1$ solutions modulo $p^2$  I know the statment above is true for modulo $p$, but how is this imply to modulo $p^2$


Removing all occurrences of '^' from a String

I have this sorta string = "^My Name Is Robert.^" I want to remove the occurrences of ^ from this string. I tried the replace method like : replyText.replace(/^/g, '');  But it hasn't any affect. Using the replace without the global works but only removes the first occurrence. Should I just make a loop and keep looping the string with replace till no more '^' are contained, or is there a better way?


Can we turn $\mathbb N_0$ or $\mathbb Z$ into a field?

I think that these two sets cannot be turned into fields by re-defining addition or multiplication (or both) but I am not sure how to prove this only from axioms of the field and (if needed) some elementary properties of fields that follow directly from axioms of the field.  My intuition is that $\mathbb N_0$ and $\mathbb Z$ are not "dense enough", as is, for example, $\mathbb Q$, to be able to become fields.  How would you prove that we can(or cannot) turn them into fields?


Difference between crawling and indexing

If a website is cached, does it mean that it has been indexed too?    In this snapshot cache date is shown as 18th may but when i did site search for this domain I found 0 pages were indexed by google last week.


My son, studying something equivalent to highschool, has to do a work about some topic in mathematics. The topic has to be some important and "fruitful" theorem (why is important, who stated it, who used it, what are the far reaching consequences...) I think is not far from the idea to choose this operation, the dot product, as it maintains the  point about the fruitful thing (I have not to explain the central rôle it has in elemental analitic geometry and in general all derived from its more abstact definition in algebraic structures)  But my question is about the origin or history of this useful tool, e.g. who put it into the vector spaces, what and when we can consider as the first use of it. Of course, any ideas not related to the history part will be welcome too.  Added  It'd be interesting too to know who extended this concept to other areas and when.   Thanks in advance.


Can someone help me calculate the following limits?  1) $ \displaystyle\lim _ {x \to 0 , y \to 0 } \frac{\sin(xy)}{\sqrt{x^2+y^2}} $ (it should equal zero, but I can't figure out how to compute it ) .   2) $\displaystyle\lim_ {(x,y)\to (0,\frac{\pi}{2} )} (1-\cos(x+y) ) ^{\tan(x+y)} $ (it should equal $1/e$).   3) $ \displaystyle\lim_{(x,y) \to (0,0) } \frac{x^2 y }{x^2 +  y^4 } $ (which should equal zero).   4) $\displaystyle \lim_{(x,y) \to (0,1) } (1+3x^2 y )^ \frac{1}{x^2 (1+y) } $ (which should equal $e^{3/2}$ ).   Any help would be great !   Thanks in advance !


I want to know different ways by which I can schedule a class in salesforce!? I know we can do it using Developer console and SetUp.. But what are other ways by which we can schedule a class?


If $S_n=(3+\sqrt{5})^n+(3-\sqrt{5})^n$ show that $S_n$ is integer and that $S_{n+1}=6S_n-4S_{n-1}$. Further deduce that the next integer greater than $(3+\sqrt{5})^n$ is divisible by $2^n$.  My work so far:  I have done part 1 using mathematical induction but it is part 2 of divisibility where I am stuck


I'm afraid that I already know the answer to my question, but I'll ask it anyway:  When there are two MySQL DB servers, can I access data that is stored on the other server?   In other words: Can I somehow do this:  INSERT INTO table (x, y, z)    SELECT x, y, x+y       FROM [otherserver].[database].[table]   Is the answer really as short as "No"?


If we consider two static charges in the space we know that they will experience a repulsion force according to Coulomb.  If the two particles are moving along the same direction at a fixed speed (like in a particle accelerator) the charges will start to produce a magnetic field that will attract each other. When the speed is relativistic enough, the two forces are almost compensated.  This is true in the frame of the lab, but what happens in the frame of the particles?  Two particles traveling at a fixed speed one next to the other do not see any magnetic field, only the electric, so how they justify the fact that the force disappear? In their frame the force is still present and they will not see it disappearing, but they will simply experience the usual Coulombian force. But when we do the change of coordinates between the laboratory frame and the particles frame the time will change according to the Lorentz transformations and it will slow down, slowing down also the effect of the electric force.  It is amazing that the time slows down at the same rate required by the magnetic field to compensate the electric field in the laboratory frame.  In other words we could say that the magnetic field is the expression of the time dilatation applied to the electric field. What do you think?


ODE Cauchy problem. Solution not unique?

Consider the following Cauchy problem: $$ \frac{\partial y}{\partial t} = \frac{-t + \sqrt{t^2+4y}}{2} \\  y(2) = -1 $$ I propose two valid solutions: $$ y_1(t) = 1 - t \\ y_2(t) = \frac{-t^2}{4} $$ Why does this not contradict the Existence and Uniqueness Theorem related to this kind of questions?


I have this database:     And I need to get the following data for each Client:   Client Name Contract Name(s) Project(s) Employees who logged hours to a project from the first day of the current month until the last day of the current month Total number of hours logged for each employee during the month Employee rate  Total Charges per employee (i.e. employee rate x employee hours worked) Billing contact(s) [name, address] for each contract   I have the following query so far, but I need to implement a MSSQL version of MySQL's GROUP_CONCAT( )  SELECT   Cl.LegalName AS ClientNames, Cr.ContractDesc AS ContractNames, P.ProjectName AS ProjectNames, ( E.FirstName + ' ' + E.LastName ) AS EmployeeNames, SUM( WH.HoursWorked ) AS TotalHours,  ( SUM( WH.HoursWorked ) * BR.Rate ) AS TotalCharges,  ( Ca.FirstName + Ca.LastName + ', ' + Ca.AddrLine1 ) AS BillingContacts  FROM Clients Cl JOIN Contracts Cr ON( Cl.ClientID = Cr.ClientID )  JOIN Projects P  ON( Cr.ContractID = P.ContractID )  JOIN EmployeesProjects EP ON( P.ProjectID = EP.ProjectID )  JOIN Employees E  ON( EP.EmpID = E.EmpID )  JOIN WorkHours WH ON( E.EmpID = WH.EmpID )  JOIN BillingRates BR ON( E.TitleID = BR.TitleID ) AND ( E.Level = BR.Level )  JOIN ContractsContacts CC ON( Cr.ContractID = CC.ContractID ) JOIN Contacts Ca ON( CC.ContactID = Ca.ContactID )  WHERE WH_Month = 4 AND WH_Year = 2013   When I started following  example, I got to here and stopped because I realized that I couldn't reference table aliases (Cr) from other subqueries (ProjectNames).  SELECT  Cl.LegalName AS ClientNames,  (     SELECT ContractDesc + ', '     FROM Contracts Cr     WHERE Cl.ClientID = Cr.ClientID      FOR XML PATH('') ) ContractNames, (     SELECT ProjectName + ', '     FROM Projects P     WHERE Cr.ContractID = P.ContractID     FOR XML PATH('') ) ProjectNames   FROM Clients Cl   How exactly do I go about doing this?


Issue with Object's Method when unmarshalling?

I would like to know why my unmarshalling process cause some troubles:   I save my java object in a xml file. I load my java object from the xml file   Once that's done, strange behaviour occurs in the method of my java object (ClassMain.java).  Indeed the method isLogin() returns false just before it returns true (ClassMain.java. Any ideas?  MainClass  public static void main(String[] args) {     Player p1 = new Player();     p1.setLogin("p1");     p1.setMdp("mdp1");           try {          //Test : verify that player's login is 'p1' (return true)         System.out.println(p1.isLogin("p1"));          marshaling(p1);          Player pfinal =unMarshaling();          //Test : verify that player's login is 'p1' (return False ?why?)         System.out.println(pfinal.isLogin("p1"));      } catch (JAXBException e) {         e.printStackTrace();     } } private static Player unMarshaling() throws JAXBException {     JAXBContext jaxbContext = JAXBContext.newInstance(Player.class);     Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();     Player player = (Player) jaxbUnmarshaller.unmarshal( new File("C:/Users/Public/player.xml") );     return player; }    private static void marshaling(Object o) throws JAXBException {     JAXBContext jaxbContext = JAXBContext.newInstance(Player.class);     Marshaller jaxbMarshaller = jaxbContext.createMarshaller();     jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);     jaxbMarshaller.marshal(o, new File("C:/Users/Public/player.xml")); }}   Player Class  @XmlRootElement(name = "joueur") @XmlAccessorType (XmlAccessType.FIELD) public class Player{  @XmlAttribute private String login;  public Player() { } public String getLogin() {     return this.login; } public void setLogin(String login) {     this.login = login; }  public boolean isLogin(String n){     if(this.login == n)         return true;     else          return false; } }


Prove that if $2^n - 1$ is prime, then $n$ is prime for $n$ being a natural number   I've looked at      It is known that $2^n-1$ can only be prime if $n$ is prime.  This is because if $jk=n$, $2^n-1=\sum_{i=0}^{n-1}2^i=\sum_{i=0}^{j-1} 2^i \sum_{i=0}^{k-1} 2^{ij}$ So they will only continue to alternate at twin primes.  In particular, $2^{6k+2}-1, 2^{6k+3}-1$ and $2^{6k+4}-1$ will all be composite   What I dont understand is how do I get:   $$\sum_{i=0}^{n-1}2^i=\sum_{i=0}^{j-1} 2^i \sum_{i=0}^{k-1} 2^{ij}$$  If I am looking at the wrong answer, how can I proof the above?     Then again, maybe I am indeed looking at the wrong thing?      In particular, $2^{6k+2}-1, 2^{6k+3}-1$ and $2^{6k+4}-1$ will all be composite   This doesnt say why $2^{6k+2}-1$ is composite?


concatenate strings together in objective c

how to i concatenate strings in objective c?   - (IBAction)emailButton:(id)sender { MFMailComposeViewController *mailContoller = [[MFMailComposeViewController alloc]init]; [mailContoller setMailComposeDelegate:self]; NSString *email = @"*******gmail.com"; NSString *email1 = @"*******@hotmail.co.uk"; NSArray *emailArray = [[NSArray alloc]initWithObjects:email, email1, nil]; NSString *message = [NSString stringWithFormat:@"%@\n%@\n%@", textField1.text, textField2.text, textField3.text]; [mailContoller setMessageBody:message isHTML:NO]; [mailContoller setToRecipients:emailArray]; [mailContoller setSubject:@"IT WORKS!"]; [self presentViewController:mailContoller animated:YES completion:nil]; }  -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [[self myTextView] resignFirstResponder]; }  -(void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error { [self dismissViewControllerAnimated:YES completion:nil]; } @end   any help on this will be greatly appreciated.  thank you


What makes a "portable app" categtorized as such?

In Windows there is a category of apps called "Portable Apps".  What makes these apps categorized as a "Portable App"?   Is it the fact that you don't need to install them to run them?


I am computer science graduate from India. My mathematical background in under-graduate was two semesters of multi-variable calculus. I worked as a researcher in a Data Mining firm where I worked on Algorithmic trading. During my Job, I, on the side, learned Linear Algebra, Probability, Statistics, Abstract Algebra and Topology and little of Advanced Number Theory. I am planning to apply for Phd in Economics. While applying for universities, in the application instructions the universities ask for mathematical proficiency in Linear Algebra, Probability, Statistics, Real Analysis, Abstract Algebra, etc., using the courses I have taken in my under-graduation. As my under-graduate degree never had such courses, I am stuck. Is there any way to show mathematical proficiency like online courses in Coursera/edX? I have not applied for masters as all universities take under-graduates directly into PhD programs provided they show mathematical proficiency and have decent GRE score, among other things. Please provide me a way to show the universities that I am mathematical proficient as I have aced every other criteria required by the universities. Are there any recognized standard tests that I can take to show my proficiency?  Edit: The universities I have contacted have categorically stated that GRE Math Subject test is not preferred.


Why can't I mine diamond, gold ore, or redstone ore?

Normal blocks I can mine fine, but when it comes to diamond and gold ores, the block just gets "destroyed" (as in you can't pick it up). I'm playing on multiplayer with no spawning monsters.


Which is the correct sentence using the word 'Let'?

In the following two sentences, I think that the first one is more precisely  correct:  (1) Let G be a graph with n vertices, and S be the set of all subgraphs of G.   (2) Let G be a graph with n vertices, and let S be the set of all subgraphs of G.


Non-existence of semi-simple Lie algebras with dimension $4$ or $5$

Is there a proof of the non-existence of semi-simple Lie algebras whose dimensions are, for example, $4$ or $5$?


Placement of labels on bent arrows in tikz-cd

I added labels to the arrows in an example of the tikz-cd manual:  \begin{tikzcd}   A \arrow[r, bend left=50, ""{name=U, below, draw=red}]   \arrow[r, bend right=50, ""{name=D, draw=red}]   & B   \arrow[Rightarrow, from=U, to=D] \end{tikzcd}   Which gives this:     Now simply setting A and B to lower case results in the following diagram, where the label of the upper arrow is off:    The reason seems to be that the upper-case letters A and B have the same height, whereas a is smaller than b. Anyone has an idea how to fix this?


Can a Python function remember its previous outputs?

Is there a way that a function can remember its previous output and use that value during the next call to the function? For instance, assume there is a function, runningTotal with a single argument x that returns x on the first call to runningTotal but x + prevOutput for every call after that.  Is there a way to write such a function in python?  I am aware that this could be easily achieved by using a global variable in the function or by saving the previous value to a new variable, but I would like to avoid these solutions if possible.  The reason I'm looking for an alternate solution is because this is one function in a program I'm working on with other people and I would like to avoid having to create more global variables than already established.


Android app forced close when Internet is not available

I am not sure why issues are being raised again when internet is not available. I have posted some issues regarding internet connectivity and some of them are already marked as .  Step to reproduce the issue:     Open any question   Make net connection off   Now do pull-to-refresh and get forced close :)    P.S. this question is posted by using Stack Exchange Android app :)


apt-get returns Err http://archive.ubuntu.com/ubuntu/ maverick/main b43-fwcutter i386 1:013-2 404 Not Found [IP: 91.189.92.201 80]

I'm new to the forum and I'm running a new install of Ubuntu 10.10 on my old Dell D610. Synaptic Manager will only download 117 of 142 packages, and when I try to download/install from there or a command line I get the same error below.  I need to get my wireless working, and the drivers that came with the ISO do not include the bcm4318 I need.  Thanks for any help!!!  dan@dan-Latitude-D610:~$ sudo apt-get install b43-fwcutter [sudo] password for dan:  Reading package lists... Done Building dependency tree        Reading state information... Done The following packages were automatically installed and are no longer required:   fakeroot libgif4 patch Use 'apt-get autoremove' to remove them. The following NEW packages will be installed:   b43-fwcutter 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 16.3kB of archives. After this operation, 81.9kB of additional disk space will be used. WARNING: The following packages cannot be authenticated!   b43-fwcutter Install these packages without verification [y/N]? y Err http://archive.ubuntu.com/ubuntu/ maverick/main b43-fwcutter i386 1:013-2   404  Not Found [IP: 91.189.92.201 80] Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/b/b43-fwcutter/b43-fwcutter_013-2_i386.deb  404  Not Found [IP: 91.189.92.201 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? dan@dan-Latitude-D610:~$


Problems in linux xterm/rxvt/console under SSH after migrating to UTF-8

I use bash and have been using Latin1 encoding my whole life, since I've always had problems when trying to migrate to the advised UTF-8. I finally gave up, and I am migrating everything to UTF-8. What a pain... I have a specific problem when doing SSH with all rxvt, urxvt and xterm. My remote prompt is set as:  PS1="\033[32m\[\h:\W> \]\033[0m"  This shows a nice green thing like  MyBox:~>   After migrating to utf-8 (all lang and locales from en_US to en_US.UTF-8), my UP, DOWN arrows (back/forward history), DEL and BS don't get track of the position in the line (destroying the prompt, deleting the wrong letters, etc). A mess. Example: Orion:~> ssh me@MyBox.mydomain... Last login: Sat Oct  3 13:47:42 2020 from NNN.NNN.NNN.NNN MyBox:~> ls amp/  ap/  bin/  phantomjs/  varios/ MyBox:~>   After hitting UP several times to go backwards in history, it reads: MyBox:~vi .basrc  instead of MyBox:~> vi .basrc  so some characters vanished. This makes a mess to edit a command line, for example. I tried fiddling with the ~/.inputrc file in the remote SSH machine without luck. It seems the shortcuts are correct. Any ideas?


C# SharpDevelop DataGridView in Mainform.Designer.cs....want to access in MainForm.cs but is getting a "cross thread error"

I'm using C# SharpDevelop. A DataGridView is created/initialized in Mainform Designer.cs and I want to access it (clear/add row) in MainForm.cs but is getting a "cross thread run time error" :     accessed from a thread other than the thread it was created on   Any simple ways around this?  Thanks.


How to handle SEO for pages with similar textual content?

I have 3 pages with similar text content. For example  /hardwell/top-songs/ /hardwell/latest-songs/ /hardwell/similar-djs/  The main text content of the page is the biography on the top. It is the same for all the 3 pages. But the main content of the page is different, even though it is not text-heavy. Would google penalize me for this? How should one handle the SEO in such a case? In general how should SEO be dealt with in cases where the website is not text-heavy, eg. a music discovery website?


I am trying to create a path with some text like this:    I have tried  \documentclass[tikz,border=10pt]{standalone}  \begin{document}  \begin{tikzpicture}     \draw (0,0) -- (2,0) -- (3,1) -- (5,1) -- (6,2) -- (8,2); \end{tikzpicture}  \end{document}   which produces    but I don't know how to place text at the appropriate places.  I can also draw the red line with the text at the right with  \draw [red] (0,0) -- (8,0) node [above, near end] {text};


Wifi dropping out for no particular reason

My wifi connection keeps dropping and I have no idea why. The only network related thing I have installed is ExpressVPN, but I have had it installed for a while and there has been no problems. I rarely use the VPN. I have reset PRAM and it is still happening. Not sure what else to do. Any help would be nice. My computer is.... MacBook Pro (16-inch 2019), 2.3 GHz 8-Core Intel Core i9, 16 GB 2667 MHz DDR4, Intel UHD Graphics 630 1536 MB. MacOS Big Sur 11.2.3


Sci Fi action movie where an elite group of people control business through a game they play online

I saw a movie where people are running from a group of powerful killers or a naughty company/organization.  A woman was hired to find the entity/company. A very overweight Asian man talks to them on line at one point. (When I say overweight, I mean 400 pounds plus)  He talks to a virtual dolphin and tells it he is sorry but he cannot play with the dolphin that day. Eventually, the people find the fat guy in real life. He is sitting on a Chinese style boat in a river (I think it was a river). (He is sitting in the rear of the boat. The boat is rather small. He is wearing a loin wrap like a sumo wrestler. In fact, I should most likely call him a sumo wrestler to describe the look.)  He had implants and wires coming out of his head like the Borg Queen did.  There is another part in the movie, where he replies to someones concern, saying, "I live a life of wonder..." (or something similar).  By the time the movie is over, the evil force has caused his death. A team of Yakuza style (might actually be the Yakuza) commandos tear through everything trying to stop the truth from being discovered. The huge Asian man ends up leaving little messages, like parts of himself, to guide the woman to the truth. The ending reveals the naughty company/organization is a group of elite power brokers that control business by playing a game. Corporations lose or gain ground over nothing more than the turn of a game. (Including totally going out of business or making a fortune from nothing.)  Do you have any idea what movie this was?


How to make Ubuntu shutdown when power lost?

My project requires that the power source for the laptop be switched on and off.  Is there a way to make Ubuntu shutdown properly when the external power is lost? It will run the shutdown on its internal battery.


I am very new to junit.I was reading a tutorial on  for spring mvc and I found a test class as below : 1.)       package springapp.web;      import org.springframework.web.servlet.ModelAndView;      import springapp.web.HelloController;      import junit.framework.TestCase;      public class HelloControllerTests extends TestCase {  public void testHandleRequestView() throws Exception{            HelloController controller = new HelloController();     ModelAndView modelAndView = controller.handleRequest(null, null);            assertEquals("hello.jsp", modelAndView.getViewName()); } }    I can not understand why I need to use TestCase of Junit as an extra burden when I can check the same by creating a simple test class.   public class TestStub {      public static void main(String[] args) {          HelloController controller = new HelloController();          ModelAndView modelAndView = controller.handleRequest(null, null);          if(modelAndView.getViewName().equals("hello.jsp")) {              ...          }       }  }     Again mentioning that I am a beginner.


I have seen solutions for bold lowercase greek, and lowercase sanserif, but have not seen the combination of all three.  What is the reliable way to generate lowercase, sanserif, bold math font?


I'm actually asking about my wife's MacBook Pro which I don't use very often. It's slowed down quite a bit recently and apparently before the update to El Capitan. Programs have started to take a long time to launch but once they have launched actually run fine. After booting up it will take about 45 seconds for Safari to even be usable. Spotlight also lags a lot and can't even keep up with typing, although it responds to 'escape' quickly.  I've watched the system monitor and even when programs are launching the CPU seems to be low with around 90% idle. It has 4GB of RAM and there always seems to be around 1.5Gb free.  I've attached the summary showing the hardware below. It doesn't have an SSD.  I've also run the Apple Hardware Test which took approximately an hour and nothing was reported from it.  From what I've read people have suggested upgrading the memory but since it doesn't seem to be running out of memory I would be surprised if this helped. There's also very little running and nothing user installed that is being launched in the Dock at start up.   Any help would be great and happy to provide any other stats needed.   Model Name:    MacBook Pro   Model Identifier:    MacBookPro9,2 Processor Name:  Intel Core i5 Processor Speed: 2.5 GHz Number of Processors:    1 Total Number of Cores:   2 L2 Cache (per Core): 256 KB L3 Cache:    3 MB Memory:   4 GB


May I get off in an intermediate city of my route during transfer?

I want to go from Panamá to Turkey. There're direct flights of Turkish Airlines that are expensive. And there're flights Panamá -> Istambul -> Baku there're cheaper 2 times of the same airline. The transfer in Istambul takes 6 hours.    Will it be a violation if I buy a ticket Panamá -> Istambul -> Baku and leave in Istambul?


My teacher told me that not only do we have to use the erf function to approximate error, but that it is proved impossible to integrate in real analysis (at least not Riemann-integrable). Is there a name for this proof, and can I have it? I am not a mathematician, but such a simple function has been around and it irks me terribly and need a detailed proof for closure.


Can Hogwarts headmasters only visit one other painting of themselves, and whence cometh it?

We learn very quickly that the headmaster's study has paintings of all former headmasters and headmistresses on the wall.  Eventually we learn that they can travel to at least one other painting of themselves.  When Dumbledore died, it seemed like his portrait magically appeared on the wall.  (Although I recall reading that Harry put Snape's picture up himself, can anyone reconcile those?)  Is there just one other painting of each headmaster that they can visit?  I get the idea this is the case or else there would be empty frames of headmaster paintings all over, as it seems they can only be in one frame at a time.    If it is just the pair, how does the second come to be? Does it just magically appear like Dumbledore's portrait did after he died?  Where might it appear?  There wasn't a second of Dumbledore mentioned when his main picture appeared after he died, but iirc the OoP ended up with the other end of him.  If it's multiple, how are they linked? An enchantment?  How close do they have to be in appearance? Could any magical child paint a stick figure of Albus Dumbledore and have their mommy make it a connection to the Headmaster's study? (It is things like that that make me think it must be just the two, tied portraits.)


Let's consider any circuit which contains a differential pair, for example a telescopic cascode single stage OTA:    In every circuit like this one, my professor and every book compute the small signal differential gain by assuming a perfect differential input couple of signals. Thus, as far as regards our example, we have:    and the small signal differential gain, exploiting the symmetry (i.e. the ac grounds on the nodes on the axis of symmetry which allow me to consider just half circuit), becomes:    This procedure is general: every time we have a circuit with a differential input pair, under the hypothesis of differential input signals, we can simplify the computation of the differential gain by exploiting symmetry (half circuit).  The question now is: why do we always compute the differential gain in the particular case of differential signals as input? In the most general case, indeed, we don't have differential signals. Consider for example this basic circuit:    In every book I've read, we pretend that the gain of the op-amp is the differential gain calculated before (i.e. assuming differential input signals). In other words: in order to use the previous expression of the differential gain, we should have the following situation in which the inverting and the non-inverting terminals of the op-amp receive differential signals (in red in the following picture):    But actually those red signals are not present: indeed the non-inverting terminal is fixed to ground, whereas (assuming large differential gain) the inverting terminal is almost zero.  In conclusion: why do we always calculate, in circuits containing a differential pair, the small signal differential gain assuming perfect differential signals as input? Why do we wrongly assume that the gain found in this way is also the differential gain of op-amps used in negative feedback?  Thank you


Can a mobile version of site be considered duplication by Google if the page is the same only the css is different?

Hearing about the problems with mobile browser detection I plan to add a button to my site which enables the users to switch manually between normal/mobile version of the site. The button sets a cookie and reloads the page and the PHP code on the server side seeing the cookie serves exactly the same page with only the CSS link pointing to the mobile stylesheet file.  I heard Google is able to follow javascript code too, so it may "push" the button and sees the mobile version of the site. Wouldn't it confuse Google that it sees exactly the same page (same URL, same content) with only a the CSS link replaced? Wouldn't it consider it duplicate content?


How to download a podcast without iTunes?

I just want the .mp3 file. I don't want any of the other crap that comes included. I intend to just listen to this on a burned audio cd in the car.    Thanks.  Edit: Even better if I don't have to download any software at all. I just want the MP3 files in a simple list.


I'm trying to find good ways to disinfect and reuse N95 respirators at home. From this article  it's apparently possible to disinfect in a microwave, using steam to kill viruses. My question is, would a food steamer also work?


Finding homomorphisms from $\mathbb Z_{12}$ to $\mathbb Z_{6}$.

Find all homomorphisms from $\mathbb Z_{12}$, the cyclic group of order $12$, to $\mathbb Z_6$. For each homomorphism $f\colon \mathbb Z_{12}\to \mathbb Z_6$, determine the kernel $\ker(f)$ and the image $f(\mathbb Z_{12})$.  I've already used the fact that the generators of $\mathbb Z_{12}$ are $\bar 1, \bar 5, \bar 7, \bar 11$ and the generators of $\mathbb Z_6$ are $\bar 1$ and $\bar 5$. To get the homomorphisms which lead to the $\mathbb Z_6$ outputs of $(\bar 0, \bar 5, \bar 4, \bar 3, \bar 2, \bar 1, \bar 0, \bar 5, \bar 4, \bar 3, \bar 2, \bar 1)$ and $(\bar 0, \bar 1, \bar 2, \bar 3, \bar 4, \bar 5, \bar 0, \bar 1, \bar 2, \bar 3, \bar 4, \bar 5)$ but I don't know where to go from here to obtain the rest.


User suggested great corrective edit to my answer, but the edit was rejected. What can I do to approve it?

A nice user suggested  to . The edit, though very good and desirable, was rejected. I do not understand the reasons, and I did not find a way to contact those people who rejected it. What can I do to re-approve the edit?


Proving that two summations are equivalent: $\sum_{i=1}^n i^3 = (\sum_{i=1}^n i)^2$

Give a constructive proof to show that for all $n \geq 1$ ,  $\sum\limits_{i=1}^n i^3 = (\sum\limits_{i=1}^n i)^2$  Observe that $(n+1)^4 - n^4 = 4n^3 + 6n^2 + 4n + 1$ .    Now, the two following equalities are obvious:  $\sum\limits_{i=1}^n i^3 = 1^3 + 2^3 + 3^3 + ... + n^3$  $(\sum\limits_{i=1}^n i)^2 = (1 + 2 + 3 + ... + n)^2$  And they are both obviously equivalent given the first few test cases:  $\sum\limits_{i=1}^n i^3 = A(n)$   $A(1) = 1^3 = 1$                 $A(2) = 1^3 + 2^3 = 1 + 8 = 9$ $A(3) = 1^3 + 2^3 + 3^3 = 9 + 27 = 36$   $(\sum\limits_{i=1}^n i)^2 = B(n)$   $B(1) = (1)^2 = 1$ $B(2) = (1 + 2)^2 =9 $ $B(3) = (1 + 2 + 3)^2 = 36$   Now, I am thinking of finding the closed-forms for both functions in the hopes that they are indeed the same. Then I would prove those closed forms to work by induction. But:   I don't know if that would be a sound way to do it. I don't know if this would even qualify as constructive, as the question requests.   As you may tell, I am no math major. I am a Computer Science major, though. This is a computing fundamentals class. I took discrete 1.5 years ago, so my knowledge is about as fresh as a litter box. I've been in quite a rut for a few hours over this.


So, I have a package "com", which consists of two sub-packages "Common" and "Model1". The Model1 contains a class Model which I am trying to import in the Servlet2 class, which resides in the Common package. I compile the Model class first which stays fine, but the Servlet2 class doesn't and comes up with an error saying "package com.Model1 doesn't exist"  Here's the Model class:   package com.Model1;     import java.util.*;    **public** class Model{         public ArrayList<String> getBrands(String color){             ArrayList<String> brands=new ArrayList<String>();             if(color.equals("amber")){                 brands.add("Jack Amber");                 brands.add("Red Moose");             }             else{                 brands.add("Jail Pale Ale");                 brands.add("Gout Stout");             }             return brands;         }     }   Here's the Servle2 class:  package com.Common; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; import com.Model1.Model; public class Servlet2 extends HttpServlet{     public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException{         res.setContentType("text/html");         PrintWriter out=res.getWriter();         out.println("Coffee selection advice
");         String c=req.getParameter("color");         Model m=new Model();         ArrayList result=m.getBrands(c);         out.println("
Got coffee color "+c);         Iterator it=result.iterator();         while(it.hasNext()){             out.println("
 Try: "+it.next());         }     } }   I just can't seem to figure out how to sort this out. Edit: Realised that default modifier is restrictive, but even making it public doesn't seem to work.  I am using notepad++ and I hope this works as the  Minimal, Complete, and Verifiable example:   package com.common; import com.model.*; public class TheClassIWantToImportInto { public static void main(String[] args){ System.out.println("Testing 1"); TheClassIwantToImport obj=new TheClassIWantToImportInto(); obj.testFunction(); } }   The second class:  package com.model; public class TheClassIWantToImport{ public void testFunction(){ System.out.println("testing function"); } }   Both the .java files are in the same folder "C:\Program Files\Java\jdk1.8.0_161\bin"   Using the following commands in this order: javac -d . TheClassIWantToImport.java (Works fine) javac -d . TheClassIWantToImportInto.java (Error: package com.model doesn't exist)


I am a new user to Linux. I have several files and documents in my directory and sometimes when I want to read or display data in these files, I do not know which command I need to type for this purpose. I would be appreciated if one helps me with that.


Prove $p(x) = x^3+x+1\in\mathbb{Z}_5[x]$ is irreducible over $\mathbb{Z}_5$

We have:  $$p(x) = x^3+x+1\in\mathbb{Z}_5[x]$$  First of all, I tried to prove that there are no roots in $\mathbb{Z}_5$, so I tried all of them:  $$p(0) = 1\\p(1) = 3\\p(2) = 1\\p(3) = 1\\p(4) = 4$$ So since there are no roots, I can't reduce this polynomial to a linear polynomial times a 2nd degree one. T


How to deduce Axiom Schema of Replacement from Axiom of Separation?

I have two questions regarding this issue.   In addition to Axiom Schema of Replacement, Which axioms do we need to deduce Axiom of Separation? How to deduce Axiom of Separation from Axiom Schema of Replacement?   Axiom of Separation: $\forall w \forall x \exists y \forall z [z \in y \iff  (z \in x \land \varphi(z, w, x ) )]$  Axiom Schema of Replacement:$\forall w \forall A [ (\forall x \in A \implies \exists ! y \varphi(x,y,w, A)) \implies (\exists B \forall x (x \in A \implies  \exists y \in B \varphi(x,y,w, A)))]$   Many thanks!


How can I get a history of running processes

I need to get a history of which processes have run on my Windows machine, and when they were run.  However, I cannot use any third-party software, as I cannot guarantee that it will always be running.  Is there any way to get this information only using Windows built-in functionality?


Without AC, it is consistent that there is a function with domain $\mathbb{R}$ whose range has cardinality strictly larger than that of $\mathbb{R}$?

I stumbled across this  earlier, and the top comment on the bottom answer asserts two claims: Without the Axiom of Choice,    It is consistent that there exists a function with domain $\mathbb{R}$ whose range has cardinality strictly larger than that of $\mathbb{R}$. It is consistent that there exist surjective maps $X\to Y$ but $|X|$ and $|Y|$ are incomparable.   I haven't studied set theory in years, but I find both these claims surprising and intriguing. I couldn't find any mention or proof of these facts online. Does anybody have a proof or reference to either of these? Thanks.


How to delete directories based on `find` output?

I issue the following command to find the .svn directories:  find . -name ".svn"   That gives me the following results:  ./toto/.svn ./toto/titi/.svn ./toto/tata/.svn   How could I process all these lines with rm -fr in order to delete the directories and their content?


I dropped my macbook air and the screen is like this since.    Does anyone know what exactly happened to it? Is it hardware or software?


Hey guys I have a div class="hello&world" for example.  How Can I use it on CSS file?  I tried that .hello&world{display: none} but I cant take & in that file.  Is there any way to do that?


I was reading something and found this line. I just want to know whether the word 'equal' should be 'equals' or 'equal'? Which sentence is grammatical?  At the time of settlement the cash value plus the amount at risk equal the death benefit.  OR  At the time of settlement the cash value plus the amount at risk equals the death benefit.


$A$ has only finitely many minimal prime ideals $\implies\ (0)$ is decomposable?

Let $A$ be a commutative ring with only finitely many minimal prime ideals.   Is the zero ideal $(0)$ decomposable?  [The converse implication is well known. Recall that an ideal is decomposable if it is a finite intersection of primary ideals.]


I'm very new to Java, and I want to make a very simple login Java-program. Don't think about security issues and such in this example, I just need help to get it right. My "Account informations" has to be stored in an Array.  This is my code: -- MAIN --  import java.util.Scanner; public class BATM {  public static void main(String[] args) {     Scanner input = new Scanner(System.in);      String username;     String password;      System.out.println("Log in:");     System.out.println("Indtast username: ");     username = input.nextLine();      System.out.println("Indtast password: ");     password = input.nextLine();      users check = new users(username, password);      if(check.auth())          System.out.println("You are logged in");    }  }   -- users ---  public class users { private String username; private String password; private String[][] accounts = {{"jesper", "abc123"},{"christian", "abc123"}};  public users(String user, String pass){     username = user;     password = pass; }  public boolean auth(){     if((username == accounts[0][0]) && (password == accounts[0][1]))         return true;     else         return false; }  }   I guess this should be a quite simple function, but for some reason the if-statment will never return "true".   What am I doing wrong?  Jesper.


How can I solve this differential eqution with IVP?

$$m\frac{d^2r}{dt^2}=-G\frac{Mm}{r^2},  \qquad r(0)=R ,\qquad \dot{r}=v_0>0$$  describes the free fall of an object of mass $m$. $r(t)$ is the distance of m to the center of the earth which is $R$ at $t=0$. $G$ is the gravitational constant.   I don't even know how to start with it. I thought about integrating it twice, but it was apparently wrong.  And once I get $r(t)$ I am supposed to find the velocity a rocket should have to escape the gravitational area of the earth, and  to do that I'm supposed to assume that the velocity of the rocket at $r(t)=\infty$ is zero.


There's a lot of posts with the pattern http://%20http ( an example search for Stack Overflow; the Stack Exchange multi-site search unfortunately does not grok this syntax) and by quick testing, I was able to repro by clicking the "insert link" icon in the post editor and pasting a URL with a space in front.    I can see no useful scenario where links would need to have whitespace at either the beginning or the end, and this causes rather inexplicable broken links in posts.  Could the editor please be fixed to trim leading and trailing whitespace before inserting the pasted address?


Can an integrated HDMI port work both ways?

Say I had a laptop [Correction: notebook, don't want my thighs medium rare], any OS, and it has an HDMI port built into the side. Would it be remotely possible to hack it into an input, provided it wasn't already designed for that? I would figure all video ports operate straight off the graphics chip, however, are there ways to override that functionality on the driver level? Driver hacks already exist for plenty of things such as the classic example: Bluetooth adapters (so we can play with our PS3 controllers and save a buck) However, is HDMI one of these tamperable interfaces? As far as the interface standard is concerned, are HDMI ports designed to be either way or are they Input/Output specific?


Is it valid to have a constructor call another constructor of the same class in its initialization list?

#include <iostream> #include <string>  class Data {     private:     int day, month, year;     public:     Data() : Data(0,0,0) {};     Data(int d, int m, int y) : day(d) , month(m), year(y) {}     void print() { std::cout << day << " " << month << " "<< year << std::endl; } };  int main() {     Data a;     a.print(); //ok - output: 0,0,0 and no compiler errors }   A constructor does not have a returning value, and a constructor is called when an object is created, meaning the data can be initialized, so when I call a constructor from another constructor, is this completely valid?  I've also noticed that Data() { Data(0,0,0); }; does NOT initialize the current class data members.   Why is it that Data() : Data(0,0,0) {}; works and Data() { Data(0,0,0); }; does not?


How do I know how many watt PSU I need to buy

soon I'm going to start a little company. It's a company/website where a customer can configure their own pc. I am very experienced pc builder, but I never knew what PSU to use best. How do I know what PSU I need to use? Where do I start looking at before buying a PSU for the build. The wattage of volts? or maybe other things


Can I install Ubuntu 16.04 on a Hp 14" chromebook?  It has a dual core 1.4 GHz Intel Celeron 2955U with intel graphics and 4 gb of ram.


As we know that it was Borden who sends Angier to Tesla when he asks the trick behind his magic.  So, How did Borden knew that Tesla's machine could create a replica?  Did he use Tesla's machine to create a replica(Fallon) or were they real time twin brothers?


I am trying to write a bash script for testing that takes a parameter and sends it through curl to web site.  I need to url encode the value to make sure that special characters are processed properly.  What is the best way to do this?    Here is my basic script so far:  #!/bin/bash host=${1:?'bad host'} value=$2 shift shift curl -v -d "param=${value}" http://${host}/somepath $@


Units in LaTeX without making an italic font

I wish to write a unit in LaTeX which should not be typeset in italics. My current code is Log Ejected Density $(\frac{g}{cm^{3}})$, which sets the unit italicized. Is there any package I can use to get a roman shape for the unit? I am using ShareLaTeX.


Self-plagiarism in Publication-based commentary PhD thesis?

I am writing a publication-based PhD thesis, and the thesis will not be publicly accessible once has been finished due to classified data included. The thesis is not the traditional sandwiched thesis, it is supposed to be a commentary on my own publications.  I will use three papers in my thesis, two have been published in journals and another one is still under review. I have obtained permission to reuse the content of the two published papers for my thesis. I have two questions:   Dose reuse mean that I can use exactly the same words? like I can copy and paste the content of the two published papers? or do I need to rephrase the content?  The third paper has not been published yet. If I use the data in my thesis, can I still publish it in a journal? if so, can I copy and paste the same content?


How to hack into a deceased person's Mac that is still running?

This is kind of an unusual question: a (non-technical) friend of mine (quite literally) on the other side of the world finds herself in the following situation:   A person died unexpectedly, their Mac is still running and displaying the Lock Screen, and nobody has the password nor any sort of technical expertise. They would like to get access to at least the data on the disk, maybe also the account. They are currently afraid to shut down the computer because it displays a warning about unsaved files.  Is there any chance they can get into the account from the Lock Screen? I guess not.  Failing that, what would be the easiest way to gain access to the data (after a forced reboot)? Single User Mode?


What can I do to minimize my Skyrim save game size?

Anyone who's played Skyrim for some time by now probably knows that some unpleasant things can happen when your game saves start to become too large.  One solution I've heard of is to wait for about a month, so that old dungeons clear out of the save data.  Aside from this, is there anything else that can be done to reduce the save size?  For example, if I reduce my inventory or the contents of my houses, would that help?


select distinct one column with all instances of another column in a second column

If I have a table with the following information:    ParentID | ChildID ---------+--------      6   |      6       6   |      7       6   |      8       6   |      9       6   |     10    I need to display the distinct parent with all instances of child in the second column possibly concatonated with a comma e.g.    ParentID | ChildID ---------+--------    6     |     6, 7, 8, 9, 10   Thanks in advance!


How do I display a decimal value to 2 decimal places?

When displaying the value of a decimal currently with .ToString(), it's accurate to like 15 decimal places, and since I'm using it to represent dollars and cents, I only want the output to be 2 decimal places.   Do I use a variation of .ToString() for this?


What is the rule for pronouncing the "a"?

While British people mostly seem to speak a hard "a", American people tend to make an "ae" in some cases. Here are some examples of what I mean, grouped by pattern:   glass/grass cast/past/vast/drastic mask dance/stance/glance can't/grant/plant   It seems like even local accents have an influence on that, but which confuses me most is the word pair "aunt" and "ant". Because it seems like British people pronounce "ant" different than "can't" even though just the first letter is missing. And American people seem to be unsure whether they should pronounce their "aunt" like they do their "can't" or like the Englishmen do.  I can see the rule when the "a" is followed by an "r" though: car/care, bar/bare, star/stare, tar/tare ... having said that "are" itself is different again. But I wonder where the rule (if any) in this is and I hope you can help me.


Can anyone see any errors in this code? I've checked to make sure the data has been written to the database. Every time I click the button it gives me the "Incorrect Password" text. It's probably something stupid that I'm overlooking. Any help is appreciated.  public void buttonWork() {     button_credCheck.setOnClickListener(new View.OnClickListener() {         String rpq = regPwdQuery().toString();         String passInputStr = editText_pwdInput.getText().toString();          @Override         public void onClick(View v) {             if (passInputStr == rpq) {                 Intent myIntent = new Intent(LogInActivity.this, FindInfoActivity.class);                 startActivity(myIntent);              } else {                 Toast.makeText(LogInActivity.this, "Incorrect Password", Toast.LENGTH_LONG).show();             }         }     }); }   EDIT: This is not a duplicate of the referenced question because changing == to equals() did not fix my problem.  EDIT 2: Thought maybe I should Include the cursor class for regPwdQuery   public Cursor regPwdQuery() {         String regPwdData = editText_pwdInput.getText().toString();         String regQuery = "SELECT * FROM UsrPass_table WHERE Pwrd ='" +   regPwdData + "'";         SQLiteDatabase uDB = usrDB.getReadableDatabase();         Cursor result = uDB.rawQuery(regQuery, null);         return result;


Rescaling and reoffsetting a point cloud with lidR?

I'm trying to analyse a a 3 x 3 metres scan derived from terrestrial photogrammetry (i.e. local coordinates, with 0,0 in the centre of the point cloud) to obtain a DSM.  Importing the file in lidR, I get the following warnings:  Warning messages: 1: Invalid header: X scale factors should be factor ten of 0.1 or 0.5 or 0.25 not 2.23339664936066e-09  2: Invalid header: Y scale factors should be factor ten of 0.1 or 0.5 or 0.25 not 2.33016455173492e-09  3: Invalid header: Z scale factors should be factor ten of 0.1 or 0.5 or 0.25 not 4.71837997436523e-10    I specified the scale to 0.001 using lasrescale (suggested  too).  Then, I tried using lasreoffset to shift the point cloud to the correct geographical coordinates ( a similar implementation using LAStools), but I get this error:  las = lasreoffset(las, xoffset = 1306977.096, yoffset = 5661354.023, zoffset=265.8018) #> Error: Incorrect xoffset: integer overflow.   When manually adding the offset to each point (e.g. las@data$X + 1306977.096, etc), the procedure works.  Finally, once I try to rasterize the point cloud using:  r = grid_canopy(las, res=0.01, dsmtin())   I get another error:  Error: Internal error in C_interpolate_delaunay: xy coordinates were not converted to integer. Scale factors are likely to be invalid.   It looks like I'm using the wrong tools for the purpose, or totally missing the point. Any suggestions?  Furthermore, can anybody help me understanding what does "integer overflow" refer to in this case?


What's the logic behind light's following the longest path according to Fermat's Principle?

In our textbook, it's written that light rays will follow the minimum or maximum distance after being reflected from the plane surface and thus the path will be fixed.  At somewhere, I read that light would follow all possible ways. But in this case, the probability of those unlikely paths gets cancelled. Maybe, it could be the selection of nature of Quantum Mechanics says something different but still I don't know. If we consider point '$A$' as the source of light, then at a point '$O$' (not mentioned in the following figure), light drops on the mirror and then is reflected towards point '$B$'. Then we can possibly notify the whole path as $AOB$ = $s$  Now Fermat's principle is saying that '$s$' would be the maximum or minimum for the light's trajectory showing the equation $$ \frac {ds}{dx} = 0$$ It seems a bit confusing to me because all I knew is that light follows the way it takes least time to travel. So, what's the logic behind the longest way? Can we lead any conclusion anyhow with the term $ \frac {ds}{dx} = 0$ for defining it?


If matrices $A$ and $B$ commute, $A$ with distinct eigenvalues, then $B$ is a polynomial in $A$

If $A\in M_{n}$ has $n$ distinct eigenvalues and if $A$ commutes with a given matrix $B\in M_{n}$, how can I show that $B$ is a polynomial in $A$ of degree at most $n-1$? I think first I need to show that $A$ and $B$ are simultaneously diagonalizable, but I don't know how to begin. Any advice is much appreciated.


Electric Field of an Infinite Sheet Using Gauss's Law in Differential Form $\nabla\cdot\text{E}=\frac{\rho}{\epsilon_0}$

I've been trying to calculate the electric field of an infinite sheet via the differential form, i.e. using \begin{align} \nabla\cdot\text{E}=\frac{\rho}{\epsilon_0}. \end{align} I am aware the answer is \begin{align} \text{E}=\frac{\sigma}{2\epsilon_0}\hat{n}, \end{align} as well as how to use Gauss's law to arrive at it, but I am having trouble matching it without Gauss's law. The charge distribution is \begin{align} \rho=\sigma\delta(z). \end{align} Since the sheet is infinite the electric field only points in the $z$ direction, \begin{align} \frac{\mathrm d\text{E}_z}{\mathrm dz}=\frac{\sigma}{\epsilon_0}\delta(z). \end{align} Integrating gives that \begin{align} \text{E}_z=\frac{\sigma}{\epsilon_0}. \end{align} Which is missing a factor of 1/2. Perhaps I am going wrong with my integration, as the delta function must be integrated around the point in order for it to output 1, \begin{align} \int_{a-\varepsilon}^{a+\varepsilon}\delta(z-a)\mathrm dz=1, \end{align} which makes me suspicious of my indefinite integration. Perhaps the correct methodology may lie in using Heaviside step function, as I believe H$(0)=1/2$ depending on who you ask, \begin{align} \rho&=\sigma\frac{\mathrm d}{\mathrm dz}\mathrm H(z)\\ \mathrm H(z)&=\int_{-\infty}^z\delta(s)\mathrm ds, \end{align} but when I try that I get \begin{align} \mathrm E_z=\frac{\sigma}{\epsilon_0}\mathrm H(z), \end{align} and I can't justify evaluating both sides at 0.


What is a best way to have ability to connect Bluetooth enabled PC and cellphone all over the house? Connection possible only in same room with PC, i want to extend now.  Does passive repeater (two antennas connected with coaxial one near the PC BT and other in remote room) helps? Or can i build BT network such as Multi-AP Roaming for Wi-Fi? Which hardware i need to use in that case as cheaper as possible?


"Summing" the series $\sin(x)+\dfrac{1}{2}\sin(2x)+\dfrac{1}{3}\sin(3x)+\dfrac{1}{4}\sin(4x)+...$ Pose $$S=\sin(x)+\dfrac{1}{2}\sin(2x)+\dfrac{1}{3}\sin(3x)+\dfrac{1}{4}\sin(4x)+...$$ $$C=\cos(x)+\dfrac{1}{2}\cos(2x)+\dfrac{1}{3}\cos(3x)+\dfrac{1}{4}\cos(4x)+...$$ $$C+iS = e^{ix}+\dfrac{1}{2}(e^{ix})^2+\dfrac{1}{3}(e^{ix})^3+\dfrac{1}{4}(e^{ix})^4+...$$ Let $t$ = $e^{ix}$ Then we have a series of $t+\dfrac{t}{2}+\dfrac{t}{3}+\dfrac{t}{4}+...=\log(1+t)$ Which is $-\log(1-e^{ix})=\log(1-\cos(x)-i\sin(x))$, use the formula $\log(A+iB)=\dfrac{1}{2}\log(A^2+B^2)+\arctan\left(\dfrac{B}{A}\right)$ $-\log([1-\cos(x)]-i\sin(x))=-\dfrac{1}{2}\log([1-\cos(x)]^2-i\sin^2(x))-i\arctan\left(-\dfrac{\sin(x)}{1-\cos(x)}\right))$. Since we are interested only in the imaginary part, we have the sum for $S$ is: $$-\arctan\left(-\dfrac{\sin(x)}{1-\cos(x)}\right)$$ Which is $-\arctan\left(-\cot(\dfrac{x}{2})\right)$ I don't know what to do next. The "sum" of this series should be $\dfrac{\pi-x}{2}$, according to Euler.


Convert datetime (e.g. 2016-01-01, 2016-01-11) to integer days (e.g. 0, 11) in Python

Is it possible to convert a timestamp object in the format "2016-01-01" (year month day) into number of days from new years?   I'm getting my timestamp object by str(pandas.to_datetime('today')).split(" ")[0]  I would put code that I used to get it started but I don't even know where to begin except by making a dictionary for how many days are in each month and then calculating it the long way.  Is there something built in that I can use for this?


Nailing it up on your Community Bulletin Board

#Community Bulletin was redesigned on June 23, 2014 More info on .   As some of you , there's a new feature on Stack Exchange:  The Community Bulletin box is a tool for the community to promote events and initiatives that are important to them. On-site activities like tag cleanup events, chat events, and weekly topic contests are some examples of things to promote in the community bulletin.  The origins of this yellow grab bag of information are a suggestion by iKnowKungFoo:  and another from Isaac Moses: . Both of these ended up approaching very similar problems from very different directions... Every community needs some public area to post notices of general interest. Meta works to a certain extent, but not everyone visits meta. We needed a fixed, visible place to display this stuff that would be easy to find but wouldn't intrude upon the normal content of the site (in the way that system messages do). So after a considerable amount of internal discussion, we came up with some fairly simple rules for displaying moderator elections, current events, blog posts,  meta posts and . (For the specific details, see: ) Note that this replaces the "Visit Meta" sidebar block, which had very similar rules for what got displayed... But didn't consistently show up anywhere itself! This makes it pretty easy for everyone to have at least some say in what gets shown there. Anyone can start a meta discussion. Moderators can feature them if they need some extra attention, and they can schedule events to promote chat discussion, contests, conferences, etc.  There are two missing pieces though:  It's not particularly functional for Stack Overflow, because there's no way to create per-tag events. Apart from things like  and major cleanup efforts, there aren't a lot of events that are worth intruding on every single reader's view.  The best part - scheduled events - is .   The reason for omitting both of these initially is to give y'all a chance to play with it a bit without getting too crazy. With no gatekeepers in place, a bulletin board quickly starts to look a bit... messy.  So for now, when you have something you'd like to announce, create a meta post describing the event and tag it   - you can then use this post to describe, discuss, and collect votes (for and against) the proposed event. If it gets sufficient activity, a moderator should then step in and add it to the site's calendar. Use it! Together with , this is your space to talk about yourselves, share important news and keep each other informed of what's going on. We're excited to see what you can come up with...


On the subject of "whoever" and "whomever", I was reading this but I am still confused:   What is the correct use of whoever/whomever in the following sentence?     I like your copy, congratulations, whoever is writing it.   Whoever? Whomever?   Is there a difference between US and UK English?


A site (or scraper) is copying content from Stack Exchange. What should I do?

of Stack Overflow, all content posted on Stack Exchange sites by their users (i.e. you wonderful people) has been provided to the whole universe under . For my fellow non-lawyers, that license basically means:   Anyone can use any Stack Exchange posts at any time without having to ask for permission Making money off of the copied content is permitted You don't even have to copy stuff from here verbatim; you can just use it as a starting point and make whatever edits you want There are just two rules you have to follow:   You have to provide . Simple links to the original post and author info are just fine. You have to  and allow other people to use your content, as long as they follow these very same rules. How meta!    (If you ever forget any of that, and want to refresh your memory, the license info is linked to in the footer of every page.)  There are, in fact, a lot of people who republish varying amounts of our content for assorted reasons. Unfortunately, there are some Stack Content Republishers Attributing Poorly and/or Excelling at Ranking (SCRAPERs, for short).  In this context, "attributing poorly" means any use that doesn't follow our attribution rules or make any other reasonable attempt at give credit. This can get pretty egregious; I've seen SCRAPERs that not only don't link back to SE originals, but also use fake author info and post dates to make it harder to find originals. By "excelling at ranking," I'm referring to copycat sites that end up higher in Google results than the original SE sites do for the same content. That's not necessarily wrong, but in some cases, it indicates inappropriate SEO hackery.  So, the question is: what can you do if you spot a SCRAPER?


If a Spacecraft Was To Launch From An Asteroid Would it Be Easier To Minimize The Required Escape Velocity By Launching At A 45 degree angle? Or Would It Be Better To Head Straight Up?


Use the if the country’s name includes a common noun. I know that we have to use "the" in front of some countries and USA is one of them. But it sounds odd to say "I like the USA". Please tell me which one is correct.


I've installed Ubuntu 18.04 Beta 1 on virtual machine and I was a little surprised when I checked the kernel version - it's 4.15.0-10-generic.  Kernel 4.14 is LTS, but kernel 4.15 is non-LTS  I'm new to Linux, but I read that on kernel.org.    So, will Ubuntu 18.04 finally have kernel 4.14 or 4.15?


Painting terrain with a selection circle

I don't mean putting a circle under a unit like done in an RTS, that's fairly simply done with a scenegraph(-like structure). What I'm referring to is selection circles for things like Area of Effects that are painted on the terrain.  It seems relatively simple until I think about it.   Here are some images for reference:     The first image gets the idea across, but not the full scope. Basically, the floor is painted with a decal detailing the region that will be affected by the spell.   The second image gets it across much better, it's not just a flat painted circle, it wraps along the mesh.  At first I figured to use some sort of object selection, and then in the vertex shader draw the texture on the correct vertices based on... some criteria that I'm still working out. Most likely based on distance and angle from the intersection point. The difficulty seems to come in that the methods wrap onto objects that seem to be completely different meshes.  I can't find an image that shows it (and don't play WoW anymore so I can't take a screenshot), but say you have a terrain mesh and a house on top of it and I select a point very close to the house's wall. Instead of continuing on the terrain mesh, the selection circle will go as far along the terrain mesh as it can, and then wrap up onto the wall of the house. It also ignores certain objects (players, etc), but that's pretty easy to ignore with correct collision tags/callbacks.  It's not so much that I can't think of a way to do this, but all the ways I can think of would probably lag your game out or turn your processor into slag. Somehow I have to:   Draw a texture With no breaks Wrapping on multiple objects according to the terrain Centered at a given point Completely dynamically (so no pre-baking it into a bunch of dummy textures) Quickly enough to be computed every frame   Is there a standard method for this? Am I just overthinking it?  My best guess is rather than do one ray cast and selecting that point as the "center" I do a bunch of casts and in each case select the nearest vertex and bind the appropriate UV coord to that vertex, but it seems messy and potentially performance heavy to select that many vertices that way at the CPU frame-by-frame level. Especially since ray casts in general are expensive, even with a good physics engine.  It also doesn't seem particularly portable to anything other than a selection circle. A similar case would be like drawing the movement arrow over the terrain in Total War games, a thick arrow is drawn between the unit and its destination (see here:  ), this would seem to be a very similar technique to the AOE selection circle, but the ray cast method I mentioned wouldn't really work for it. There are, of course, numerous other examples too (such as trajectory markers).


How to monitor temperature from the top panel in ubuntu 18.04 mate?

I want to show an icon with the temperature of the cpu in the upper panel of ubuntu mate, something like the icon of the Taskbar of Core Temp in Windows, any ideas?


How do I pass a "Raise ValueError" message in unittest (python)?

Essentially, I am writing test code for a short program and have put: except ValueError:     pass  I can see in my test that ValueError is raised, however the test fails with the message: FAILED (errors=1)  In the production code ValueError is raised like this: if n < 0:     raise ValueError  I'm not sure if the test code is correct as I believe the production code does throw a ValueError however my test failed.


Let $X$ be an infinite subset of $\mathbb{N}$. Prove that $|X| = |\mathbb{N}|$

To show that two sets are equipotent, we must find a bijection between the two. Proof $\mathbb{N}=\{1,2,3,4,...\}$ Let $X \subseteq \mathbb{N}$ with $|X|=\infty$. So, for some $x \in \mathbb{N}, X = \{x,x+1,x+2,x+3,...\}$ Define $f: \mathbb{N} \to X$  with $f(1)=$ min$(X)$ and for each $n \geq 2 \in \mathbb{N},$ let $f(n)=$ min$(X)+(n-1)$. One-to-one: Suppose $f(m)=f(n)$ min$(X)+m - 1 =$ min$(X) +n - 1$ $m-1=n-1$ $m=n$ Onto: Again, $f(n)=$ min$(X) + n - 1$ $n=f(n) -$ min$(X) +1 \in \mathbb{N}$ Note: since $X\subseteq \mathbb{N},$ min$(X) \geq$ min$\mathbb{(N)}$ for any chosen subset $X$. This clears up any issues regarding closure under subtraction when testing for surjectivity. Since $f$ is one-to-one and onto, $f$ is a bijeciton. $|X| = |\mathbb{N}|$ $\square$


Enthusiast/Fanatic Badge - Do We Need to Just Visit or Participate?

To obtain the Enthusiast or Fanatic badge, do we just need to visit while logged in each day or do we also have to have some activity (such as editing, answering, asking, commenting, etc.)?


What is the maximum probablility of survival?

Suppose you are a prisoner. The king gives you $100$ marbles, $50$ black and $50$ white. You have to put all the marbles into $2$ urns such that none of the urns is empty. The king will then choose an urn at random and from that a marble at random. If the marble is white, you will be set free, otherwise you will be sentenced to death. So you have to distribute the marbles in such a way so as to maximize the chance of survival. Basically you have to maximize the probability that the king chooses white marble. My attempt : Let there be $b$ black and $w$ white marbles in the 1st urn . Therefore, there will be $50-b$ black and $50-w$ white marbles in the 2nd urn. Therefore P(Survival) = P(Choosing white marble) = $\frac{1}{2}\cdot\frac{w}{w+b} +\frac{1}{2}\cdot\frac{50-w}{100-w-b}$ . Now I need to maximize the above equation but I don't know how. Any ideas?


Prove that the Tangent of 75 degrees equals 2 plus the square-root of 3

My (very simple) question to a friend was how do I prove the following using basic trig principles:  $\tan75^\circ = 2 + \sqrt{3}$  He gave this proof (via a text message!)  $1. \tan75^\circ$   $2. = \tan(60^\circ + (30/2)^\circ)$  $3. = (\tan60^\circ + \tan(30/2)^\circ) / (1 - \tan60^\circ \tan(30/2)^\circ) $  $4. \tan (30/2)^\circ = \dfrac{(1 - \cos30^\circ)}{ \sin30^\circ}$    Can this be explained more succinctly as I'm new to trigonometry and a little lost after (2.) ?    EDIT  Using the answers given I'm almost there:   $\tan75^\circ$    $\tan(45^\circ + 30^\circ)$   $\sin(45^\circ + 30^\circ) / \cos(45^\circ + 30^\circ)$   $(\sin30^\circ.\cos45^\circ + \sin45^\circ.\cos30^\circ) / (\cos30^\circ.\cos45^\circ - \sin45^\circ.\sin30^\circ)$    $\dfrac{(1/2\sqrt{2}) + (3/2\sqrt{2})}{(3/2\sqrt{2}) - (1/2\sqrt{2})}$   $\dfrac{(1 + \sqrt{3})}{(\sqrt{3}) - 1}$   multiply throughout by $(\sqrt{3}) + 1)$   Another alternative approach:   $\tan75^\circ$    $\tan(45^\circ + 30^\circ)$   $\dfrac{\tan45^\circ + \tan30^\circ}{1-\tan45^\circ.\tan30^\circ}$   $\dfrac{1 + 1/\sqrt{3}}{1-1/\sqrt{3}}$   at point 6 in above alternative


How to create a node out of a webform submission?

I'd like to be able to create a node out of a webform submission in Drupal 8. It can happen either on successful submission or as an additional task after the webform has been submitted. I've seen some info on creating content entities via REST/GET () and I know that you can post a webform submission to a URL with Webform (yamlform) using either x-www-form-urlencoded or JSON, but I'm not sure if this is even the right thing to be looking at.  The webform, submissions, and content type I'd like to use are all on the same site.  I know this question came up for Drupal 7 and the direction was to have them use a content type, but we're not able to allow the submitters to use content types at this time because of the way the site is setup.


Where a noun ends with the letter x, is it proper for the possessive form of the word to end with 's or simply ' ? Example 1:  "It is Xerox' position that it owns the patent." vs. "It is Xerox's position that it owns the patent."  Example 2:  "The ox's tail was short." vs. "The ox' tail was short."


merge two files, first line from first file followed by first line from second file

I have two files :  f1:                                      f2: ==============                         =============== some text line 1                       A1 some text line 2                       A2 some text line 3                       A3   can I quickly merge these two files to produce f3:  some text line 1 A1 some text line 2 A2 some text line 3  A3


Can you turn your camera on in Pokemon Go?

I can't seem to turn my camera on. I checked the box but I couldn't find any AR button. Can someone tell me how to turn my camera on?


Why can't we use the circumference of a circle to find arc lengths of polar curves?

To find the area in a polar curve, we use areas of sectors of tiny pie slices to figure out the area, to get $$A=\int_a^b\frac{1}{2}r^2\,d\theta$$ Why can't we use the circumference of the circle to figure out arc length of a polar curve? I tried and it went something like this: The arc length of a tiny pie slice is $r\theta$, where theta is in degrees and r is the radius. Adding up all the tiny pie slice arc lengths, we should get $$\int_a^b r\,d\theta$$ But that is clearly not correct! For example, for $1+cos\theta$, this 'formula' tells us that the arc length is $2\pi$, when the actual arc length is 8. What am I doing wrong? Am I assuming something wrong? Or is it just stupid mistakes?


I found a small amount of Albanian lekë from summer's visit there. Is there any place in Ireland / UK where I can change those back into EUR, GBP or Dollars??


What is the indefinite integration of zero?

I seem to think that it should be zero as well because being a constant zero can be taken outside the integral and whatever be the answer of the remaining constant integration it is finite. However my textbook implies that it is the arbitrary constant c.


I have a webserver running Ubuntu 14.04. we are running a number of websites on it. one of the websites requires to be run on https. I have configured the SSL certificate and https is working properly except when someone types http, its failing to redirect.  when I edited the www.**.com.conf in sites-enabled to add a redirect configuration, its affecting all the websites running on http, taking them to the website with https. Someone help with how I can configure to redirect http traffic to https for just one website without affecting the other websites.


How to vote on friends / colleagues ' questions (or answers)

Almost every time a colleague of mine asks a question, we have discussed this problem beforehand. Also, we sometimes meta-discuss the question for stackoverflow (why did I get the "this might be subjective" warning, is this understandable enough, etc). This is less so with answers, but I could believe for some groups this works the same. For now I'll stick to questions, but you could s/question/answer if you like. The resulting question is almost always  Interesting for me, and a problem I don't know the answer to. I probably would favorite it According to me a valid and good question (as we talked about it beforehand) I would probably want to upvote it.  Now I believe to read that "ring voting" is a thing, and I tried to find some questions about this, but didn't find many. I did find and read this blogpost from 2008:  . It reads to me that upvoting 'fraud' is more commonplace then downvoting and it might seem anomalous that I would upvote almost all questions from one user. If all colleagues would do this to their team, you'd get some mediocre questions getting a lot of votes, and some users getting a lot of attention, points etc from that. If you would -as seems to be done -, sort the amount of upvotes for my colleague, you'd get me being 'anomalous' in front of the crowd. On the other hand, as explained above, I do want to upvote almost all stuff some of my colleagues put on here for (I believe) the right reasons: they are questions I consider good and interesting. It's just that I know of all their questions (as they tell me about them), which obviously isn't the case for a random user. So what is the deal?  When is upvoting content from one user frowned upon? Would my usecase be in danger of being a (what I consider 'false') positive for the fraud-detection? (and would you agree with that or not) How to prevent this false positive (if you agree with me it is one, otherwise this is a moot question) -> As noted in the comments: I'm not looking for tricks, so an answer could be "don't vote for your colleagues". I agree that there should be no to 'tricks' around that could be used for real fraud of course


Matching physics properties for multiple objects

I have about a thousand cubes in my scene that all require the same physics settings. Is there a way to do this without having to change each mesh separately?  I wish I had added the physics first then duplicated but still it would be helpful if there was a way to add settings to multiple meshes at once.


Is it possible to call a function with a variable?

I want to call a function depending upon the data-value value of the  that is clicked. Is this possible? I tried [call](); and call();. Both return errors.    function a() {   alert("Hi"); }  function b() {   alert("Bye"); }  $(function() {   $("a").click(function() {     var call = $(this).attr('data-value');    [call]();   }); });  A B


I have a problem with proof of causality in Peskin & Schroeder, An Introduction to QFT, page 28. To avoid confusion I use three vectors notation, rewriting the Eq. (2.53) for $y=0$ as follows:  $[\phi(x,t),\phi(0,0)]=\int \frac{d^3p}{(2\pi)^3}\frac{1}{2\sqrt{p^2+m^2}}\left(e^{-i\mathrm{p}.\mathrm{x}-it\sqrt{p^2+m^2}}-e^{i\mathrm{p}.\mathrm{x}+it\sqrt{p^2+m^2}}\right)$  The book goes on about how the integrand being Lorentz invariant makes this integral zero for the x out of the light cone. But I (not being a special relativity expert) want to see it more rigorously:  after changing variables $p\to-p$ in the first term, the equation simplifies to:  $[\phi(x,t),\phi(0,0)]=\int \frac{d^3p}{(2\pi)^3}\frac{-2i}{2\sqrt{p^2+m^2}}e^{i\mathrm{p}.\mathrm{x}}\sin\left(t\sqrt{p^2+m^2}\right)$  using spherical coordinates:  $[\phi(x,t),\phi(0,0)]=\int \frac{dpd\phi d\theta p^2\sin\theta}{(2\pi)^3}\frac{-i}{\sqrt{p^2+m^2}}e^{ipx\cos\theta}\sin\left(t\sqrt{p^2+m^2}\right)\\ [\phi(x,t),\phi(0,0)]=\int_0^{\infty}\frac{dpp}{(2\pi)^2}\frac{-2i}{x\sqrt{p^2+m^2}}\sin (px)\sin\left(t\sqrt{p^2+m^2}\right)$  again after another change of variables $u=\sqrt{p^2+m^2}$,  $[\phi(x,t),\phi(0,0)]=\frac{-2i}{x}\int_m^{\infty}\frac{du}{(2\pi)^2}\sin (x\sqrt{u^2-m^2})\sin\left(tu\right)$  I cannot see how this integral should be zero for $x>t$ !!! Can somebody please explain this to me?


Conceptual understanding of deviation of light ray and change of speed in the phenomenon of refraction

I was wondering exactly why a ray of light changes direction when moving from one optical medium to another. I need a conceptual explanation of the above statement or why the Snell's Law is valid. I found some online explanations where the ray of light is considered analogous to a group of soldiers, swimmers, etc. This is perplexing as we know that light behaves as a wave when undergoing refraction, not as particles. I know that the frequency of the light ray remains constant while its speed and wavelength are varying. I request someone to please clarify this for me and provide a rigorous logical explanation of why exactly the light ray deviates or undergoes a change in angle. Why the ray of light undergoes a change in wavelength and how this affects other properties.