I am doing indoor multi-floor routing using pgRouting.  At the moment, I have a dummy network system created to analyze shortest routes between locations with the results served as a WMS layer in GeoServer.  My initial test of the system only included a simple network created on the same z-plane, and everything works perfectly.   At that point, I created some mock interior floor plans to create indoor networks on two separate floors.  For simplicity, I simply assigned the z-elevation of the bottom floor as ‘0’ and the upper floor as ‘10’.  I then created the vertical corridors (e.g. elevators and stairs) in ArcScene to make sure the vertical connections existed, resulting in a fully-connected 3D network.    Using the SQL code found here , I created the modified pgr_createTopology3d and pgr_pointToIdZ functions to build topology on the 3D network.  Following that, I followed normal procedure for building the SQL View to serve the queried results as a layer to GeoServer.    Now that I have the 3D network in the routing system, I tried running some test queries across different floors to ensure that it routes appropriately; unfortunately it does not.  Instead, the system continues to operate on the same z-plane, and seems to ignore the z-values in the vertices, meaning a route is returned, but only on the plane with z-levels assigned as ‘0’.  I’m guessing this has to do with the SQL Statement that’s entered when creating the SQL View in GeoServer.  Right now, the statement is as follows:  SELECT ST_MakeLine(route.geom) FROM (     SELECT geom FROM pgr_fromatob('ways', %x1%, %y1%, %x2%, %y2% ) ORDER BY seq) AS route   That statement above is passing to/from lat/longs to the table ‘ways’ to produce the resulting shortest path; however, there’s nothing in there to give the query any sort of z-information.    Is that where things are going wrong and not correctly routing across multiple floors?   If so, can anyone provide insight on how to correct the SQL Statement to consider z-values?    I’m no SQL expert and been trying a number of different modifications, but nothing working as of yet.

have an issue with pgRouting that I've modified to consider multi-floor indoor areas. I've created a mock floor plan of any typical hotel. I copied the floor plan and assigned a different z-value to essentially mirror the floor plan, with one positioned directly above the other.  I then made vertical connections between the floors for elevators and stairs to create a complete 3D network.    Using the SQL code found here , I created the modified pgr_createTopology3d and pgr_pointToIdZ functions to build topology on the 3D network. Following that, I followed normal procedure for building the SQL View to serve the queried results as a layer to GeoServer  When constructing the SQL View, I used a modified version of pgr_fromAtoB to consider z-values.  I modified as follows (see  to ):  -- Find nearest node EXECUTE 'SELECT id::integer FROM ways_vertices_pgr      ORDER BY the_geom <-> ST_GeometryFromText(''POINT('      || x1 || ' ' || y1 || ' ' || z1 || ')'',4326) LIMIT 1' INTO rec; source := rec.id;  EXECUTE 'SELECT id::integer FROM ways_vertices_pgr      ORDER BY the_geom <-> ST_GeometryFromText(''POINT('      || x2 || ' ' || y2 || ' ' || z2 || ')'',4326) LIMIT 1' INTO rec; target := rec.id;   However, it doesn't appear that the z-value is being considered.  For example, I have nodes lying exactly on top of each other with the same lat/long, but with differing z-values. I can issue the ST_GeometryFromText command and limit the results to 2 and see the both of the nodes are being returned at the lat/long I've specified.  However, the z-value for the bottom node is 0 and the upper node is 1.  No matter what z-value I specify in the request, the upper node is always returned as the top result.   Does anyone know why?    How can I get it to return the bottom node if I specify the z-value as 0?


Is it possible to pre-select the regional settings , Language, Time Zone etc on OEM based custom install image? So when user boots machine first time they get regional settings an simply move to USER ACCOUNTS options.

I would like to customize Ubuntu live CD by installing some additional packages. I have followed   but it doesn't seems to work. Can anyone provide clear instructions?   Note: I do not prefer Remastersys, manual way will be appreciated.  Customization  Packages that I want to install:   Thunderbird    Samba    SSH       Changes that I need:   Remove Games menu from the Application menu Firefox shortcut on Desktop Radiance as the default Theme Different default Ubuntu Wallpaper   Configuration file changes   I want the panel to be placed at the bottom I want to paste my Samba configuration file instead of default Samba configuration I have few Firefox shortcuts and folders I would like to show that in Desktop Also it will be nice if you say me how to change the icon sets   Recent Updates   I have customized Ubuntu 10.10 with Firefox shortcuts and few folders on desktops. Everything went smooth. But the installer gets crashes after choosing the timezone. How do i fix this issue? Also setting wallpaper affects the login screen. The wallpaper which i set is displayed on the login screen also. I just want the default one for the login screen.


I have downloaded some original fonts from Adobe (Helvetica, Times and others), they are all otf, I installed them on Windows and I can use them with no problem with Indesign and other softwares. However I am now trying to use them in LaTeX (I am a beginner) with no success.  In particular I load the package helvet for example, but it is used a font that resembles helvetica, but is not helvetica. Since I have the original one, I'd like to use it.  So, how to make LaTeX recognize and use my otf? Do I have to set them up manually or is there a package that can do it?

The standard font packages make global changes to the fonts in my document. What if I want to use a particular font for just a portion of my text?   How do I find the right name of the font? How do I select the font? How do I restrict the scope of the font change?     There are separate answers for different flavors of TeX (quick links):


Is there a way to make sure that my keystrokes (for passwords) are not being tracked?  I need to change my passwords and was wondering if there is a way to make it so that my keystrokes are not being recorded.

I've always had a problem typing my passwords in on computers I don't trust (think non-technical friends computers) and although I can usually avoid doing it, there are times when I still need to use them. My main concern is having my passwords stolen by a keystroke logger.  So my question is - is there a reliable way to detect keystroke loggers?   I know of hardware keystroke loggers like  but I'm mostly interested in software based ones.


I assume the question pertains to electromagnetic waves in general, but I am at the moment interested in visible light. Our capacity -- both human and device -- for discerning wavelengths of light is limited. But is the spectrum really continuous and is it also practically so (ie. which are the objects that actually emit an infinite compendium of wavelengths of visible light)? For example, assuming a wave with wavelength of 500 nm, can you have a wave with wavelength 500,123456 nm [of course you can], and can you just go on and on (assuming you have equipment sensitive enough to measure it) to measure waves with wavelengths of, say, 500,123123123123123123123123123123123123123123123123 nm wavelength, or does this break down at some point (barring sensitivity of measuring equipment)? I looked at some questions, like:  but that didn't seem to answer my question.

The electromagnetic spectrum is a continuum of wavelengths of light, and we have labels for some ranges of these and numerical measurements for many.  Question: Is the EM spectrum continuous such that between two given wavelengths (e.g. 200nm and 201nm) there is an infinite number of distincts wavelengths of light?  Or is there some cut-off of precision with which light might exist (e.g. can light only have wavelengths of whole number when measured in nanometers, etc.)?


I'm using Ubuntu 18.04.5 LTS (Bionic Beaver). I'm trying to run VS Code using these commands: >> sudo -s # mkdir ../user-data-dir # cd <project_path> <project_path># code . --userdata-dir ../user-data-dir <project_path>#  I used to launch VS Code using these commands as root before, but now it is not working. I get no errors in the command line. code . does open VS Code if I'm not running as root. Help please?

I recently installed Visual Studio Code editor. I downloaded the 32bit .deb package. Installed and run normally, but when i tried to save a file in my project folder, it returns permission denied. So, i re-run code with  sudo code .   and it returns  It is recommended to start vscode as a normal user. To run as root, you must specify an alternate user data directory with the --user-data-dir argument.   I looked for how to specify an alternate user data directory with the --user-data-dir argument but I didn't find much.  So, how do I run Visual Studio Code as root in Ubuntu 16.04?  edit: I would prefer a solution that avoids changing directory permissions.   edit2: project directory: /var/www/project (I'm using Apache with vhost)


That was thw refusal letter i got .. been traveling to the uk since 2011 and all through my travel history have never stayed this long.. i own my company an i stayed dis long cause of marital issues.. came bach home as soon as everything was ok. pls house kindly advice on what to do. thanks in anticipation

I plan to attach my 2014 and 2015 annual leave letters to prove I was on leave, and a letter from my sales manager who was in charge of the business during my vacation.  I intend to explain all my sources of income in additional letter because the ECO calculations of my income were different from mine.   How else can I improve my new application?


Can someone explain the differences in how an emdash is rendered by LuaLaTex from this code?  \documentclass{article} \usepackage{fontspec} \setmainfont{TeX Gyre Pagella} \begin{document} Lorem ipsum---dolor---sit amet. Lorem ipsum—dolor—sit amet. \end{document}     Why is the first dash in the first line shorter? I have read through what seem to be related questions:        but I'm not sure whether this is quite the same question, and these discussions are fairly old.  Emdashes in the  don't seem to have this issue, but I can't find the .tex file that generated the documentation to see what commands are being used.  Simply put, my question is what is causing these to be rendered differently, and can I change it to make it consistent?

LuaLaTeX is not inserting em dashes unless there is space around the triple dash. It works fine when using a unicode em dash, or explicitly using the \textemdash macro.  Here is a MWE:  \documentclass{article}  \begin{document}  \begin{enumerate}   \item en--dash   \item em---dash   \item em --- dash space \end{enumerate} \begin{enumerate}   \item en–dash unicode   \item em—dash unicode   \item em — dash space unicode \end{enumerate} \begin{enumerate}   \item en\textendash{}dash macro   \item em\textemdash{}dash macro   \item em \textemdash{} dash space macro \end{enumerate}  \end{document}   Which produces:    Compiled using LuaTeX, Version 1.07.0 (TeX Live 2018)  The question is:   I would like to know why em dash ligatures without surrounding spaces are not rendered as em dashes in the PDF output. It seems like a bug to me. how can I fix it?


I got green ghost-like lights.    Where do they come from?  How could I avoid them while shooting? How can I remove it in post processing?   I tried using Lightroom chromatic aberration correction feature but it didn't help. Actually, I think this is not chromatic aberration, because this aberration always seemed to appear on the borders of highly contrasting objects (dark fly on white background).  I shot this with Canon EOS 1000D and Canon 50mm f/1.4 lens at ISO 1600 and f/5.6.

I've purchased a Canon EF 50mm f/1.8 II. But I'm really disappointed in the results, especially when using it for night photography. :(  In my night shots a lot of lens flare appears in my photos. I've tried to change the angle and position of the camera to no avail. Also I cannot do any night photo without directing my camera to direct light like in street photography!  This photo was taken with my Canon 650D and 50mm 1.8 Lens in a long exposure night shot, and as you notice there is a bunch of lens flare in it. Some people suggested I remove the UV filter. This decreased the lens flare a little but there is still some flare in the photo .    I want to know if there is a problem with the lens? Or is this normal for a $100 lens? Does anyone else have a similar experience with this lens?


I generated ssl certificate with:  openssl genrsa -out key.pem 2048 openssl req -new -sha256 -key key.pem -out csr.csr openssl req -x509 -sha256 -days 12775 -key key.pem -in csr.csr -out certificate.pem   but after checking my openssl server with ssllab I got the following invalid message:   How to fix this issue?

As of Chrome 58 it no longer accepts self-signed certs that rely on Common Name: $3ACanary%7Csort:relevance%7Cspell:false  Instead it requires using Subject Alt Name. I have been previously following this guide on how to generate a self-signed cert:  which worked great because I required the server.crt and server.key files for what I'm doing. I now need to generate new certs that include the SAN however all of my attempts to do so have not worked with Chrome 58.  Here is what I've done:  I followed the steps on the above mentioned Heroku article to generate the key. I then wrote a new OpenSSL config file:  [ req ] default_bits        = 2048 distinguished_name  = req_distinguished_name req_extensions      = san extensions          = san [ req_distinguished_name ] countryName         = US stateOrProvinceName = Massachusetts localityName        = Boston organizationName    = MyCompany [ san ] subjectAltName      = DNS:dev.mycompany.com   Then generated the server.crt with the following command:  openssl req \ -new \ -key server.key \ -out server.csr \ -config config.cnf \ -sha256 \ -days 3650   I'm on a Mac, so I opened the server.crt file with Keychain, added it to my System Certificates. I then set it to Always Trust.  With the exception of the config file to set the SAN value these were similar steps I used in prior versions of Chrome to generate and trust the self-signed cert.  However, after this I still get the ERR_CERT_COMMON_NAME_INVALID in Chrome 58.


I have a mostly hollow, small clear plastic ball. Inside the ball is a weight stuck to the edge but the weight is smaller than the ball so the ball will always come to rest with the weight at the bottom when placed on a smooth surface.  I've been spinning it on my desk with the weight at the top, it spins well despite it being top heavy, I assume like a gyroscope. If I spin it with the weight at the bottom however, it loses stability and it very quickly slows down until it regains stability with the weight at the top again, with further experimentation I found that wherever the weight is, once the ball starts spinning it stabilises with the weight at the top.  What causes the rotational energy to transform into gravitational potential energy?  Any why is the ball more stable with the weight at the top axis than with it at the bottom axis?

When you spin an asymmetrically weighted, 2D disk-shaped top, the heavy part actually rises to the top. Why is this?        In the second video it shows that this is because of friction but trying this on a frictionless surface won't do much: The disk will go up and down and still the heavy part will be on the top.


I followed the discussion of the use of "Most" and it is evident that if the noun is plural, the verb takes the plural. Most companies are .... But in the example above "Most information and knowledge are false" sounds wrong.

Which of the following sentences is correct:        There is a lot of food and fruit in the supermarket.   There are a lot of food and fruit in the supermarket.


What would happen if 'The One' died before fulfilling the prophecy?  I understand that in the Matrix 'The One' seems to be for all accounts immortal, but what I am curious to is if he were to say die in an accident in Zion or maybe he was murdered by someone, like agent smith was trying to do. We know he can die as he did when fight the last battle, so he is in that respect the same as everyone else in the real world.  Being that the Matrix needs the anomaly to restore balance,     The Architect: As I was saying, she stumbled upon a solution whereby   nearly ninety-nine percent of the test subjects accepted the program   provided they were given a choice - even if they were only aware of it   at a near-unconscious level. While this solution worked, it was   fundamentally flawed, creating the otherwise contradictory systemic   anomaly, that, if left unchecked, might threaten the system itself.   Ergo, those who refused the program, while a minority, would   constitute an escalating probability of disaster.       Neo: This is about Zion.        Neo: Why am I here?       The Architect: Your life is the sum of a   remainder of an unbalanced equation inherent to the programming of the   matrix. You are the eventuality of an anomaly, which despite my   sincerest efforts I have been unable to eliminate from what is   otherwise a harmony of mathematical precision. While it remains a   burden assiduously avoided, it is not unexpected, and thus not beyond   a measure of control. Which has led you, inexorably, here.       Neo: You haven't answered my question.        The Architect: Quite right. Interesting. That was quicker than the others.         The Architect: The function of the One is now to return to the source,   allowing a temporary dissemination of the code you carry, reinserting   the prime program. After which you will be required to select from the   matrix 23 individuals, 16 female, 7 male, to rebuild Zion. Failure to   comply with this process will result in a cataclysmic system crash   killing everyone connected to the matrix, which coupled with the   extermination of Zion will ultimately result in the extinction of the   entire human race.      Neo: You won't let it happen, you can't. You need   human beings to survive.      The Architect: There are levels of survival   we are prepared to accept.   So the systemic anomaly manifests and is produced when the time is right, so if that person was to die like I said earlier, would another anomaly be born, or would 'The One's' powers be transferred to what you would call a backup? Which I would not think would be far from the truth, as there are all those kids at the Oracle's residence waiting to see if they were 'The One' due to the powers that had???  Was there anything mentioned in a back story or something like that?

If Neo defies his fate and refuses to be removed from the Matrix (by taking the blue pill) what happens next?   Would another "The One" get selected by The Architect or The Oracle and is there anything to suggest that the current instance of The Matrix actually could have multiple "The One"'s (perhaps one of the 'potentials') in the event that the Chosen One manages to get himself killed or simply refuses to play ball?


I'm working with a WPF ListBox and inside the ItemTemplate I have a StackPanel.  I'm trying to bind the width of the StackPanel to the ViewportWidth of the ListBox but I'm not able to find a way to do so.  If I bind the ActualWidth it's close, but since the vertical scrollbar is included in the ActualWidth I still end up with things hidden behind it and a horizonal scroll bar.  Please see the XAML below:  <ListBox x:Name="MessagesGrid" Grid.Column="2" HorizontalContentAlignment="Stretch"> <ListBox.ItemTemplate>     <DataTemplate>         <Grid Width="{Binding Path=ActualWidth, ElementName=MessagesGrid}" HorizontalAlignment="Stretch">             <StackPanel Name="ToMe"  HorizontalAlignment="Stretch" Visibility="{Binding IsFromMe, Converter={StaticResource BooleanToHiddenConverter}}">                 <TextBlock Text="{Binding Date}" FontSize="8" TextWrapping="Wrap" Padding="0,0,60,0"/>                 <TextBlock Text="{Binding Text}" FontSize="12" TextWrapping="Wrap" Padding="0,0,60,0"/>             </StackPanel>             <StackPanel Name="FromMe" HorizontalAlignment="Stretch" Visibility="{Binding IsFromMe, Converter={StaticResource BooleanToVisibleConverter}}">                 <TextBlock Text="{Binding Date}" HorizontalAlignment="Right" FontSize="8" TextWrapping="Wrap" Padding="60,0,0,0"/>                 <TextBlock Text="{Binding Text}" HorizontalAlignment="Right"  FontSize="12" TextWrapping="Wrap" Padding="60,0,0,0"/>             </StackPanel>         </Grid>     </DataTemplate> </ListBox.ItemTemplate> </ListBox>

I have a ListBox DataTemplate in WPF. I want one item to be tight against the left side of the ListBox and another item to be tight against the right side, but I can't figure out how to do this.  So far I have a Grid with three columns, the left and right ones have content and the center is a placeholder with it's width set to "*". Where am I going wrong?  Here is the code:  <DataTemplate x:Key="SmallCustomerListItem">     <Grid HorizontalAlignment="Stretch">         <Grid.RowDefinitions>             <RowDefinition/>         </Grid.RowDefinitions>         <Grid.ColumnDefinitions>             <ColumnDefinition/>             <ColumnDefinition Width="*"/>             <ColumnDefinition/>         </Grid.ColumnDefinitions>         <WrapPanel HorizontalAlignment="Stretch" Margin="0">             <!--Some content here-->             <TextBlock Text="{Binding Path=LastName}" TextWrapping="Wrap" FontSize="24"/>             <TextBlock Text=", " TextWrapping="Wrap" FontSize="24"/>             <TextBlock Text="{Binding Path=FirstName}" TextWrapping="Wrap" FontSize="24"/>          </WrapPanel>         <ListBox ItemsSource="{Binding Path=PhoneNumbers}" Grid.Column="2" d:DesignWidth="100" d:DesignHeight="50"      Margin="8,0" Background="Transparent" BorderBrush="Transparent" IsHitTestVisible="False" HorizontalAlignment="Stretch"/>     </Grid> </DataTemplate>


Is there anything one could say about in what region a prime number is guaranteed to be in? A general equation for $a$ and $b$, dependent on $n$, in $a<p_n<b$?

In  I have found that the bounds for $n$-th prime is given by, $$n(\ln n+\ln \ln n)>p_n>n(\ln n+\ln \ln n-1)$$ for all $n\ge6$. Are there even stronger bounds for the $n$-th prime?   If possible (of course if the answer is affirmative) in the answer (or comment) please give the link of the paper in which it first appears.


Why do we just take the highest degree of polynomial for Big Oh notation. I understand that we can drop the constants as they won't matter for a very high value of 'n'.    But, say an algorithm takes (nlogn + n) time, then why do we ignore 'n' in this case. And the big Oh comes out to be O(nlogn). Big Oh has to be the upper bound of time taken by the algorithm. So, shouldn't it be (nlogn + n), even for very high values of n?

I'd prefer as little formal definition as possible and simple mathematics.


I know this question has been posed many times already, but I've had several people (some even professional editors) who cannot decide on the correct form in this sentence.     Three men, one demon, one minority—on a quest to kill the guy who/whom   Domino’s parents love more than him.   Please tell me which is correct. Who or whom?  I myself am unsure (regardless of other answers) in this situation, because a few people and both my developmental and copy editor have differing opinions, so I have no idea which one is right, since both have their own opinions and arguments for this. One editor says "who" is correct here because the person in question is the subject in this sentence (although I'm not sure whether they are right or wrong about that), but the other editor said I need to follow the "he/him" rule. Thus, I don't know which rule to follow.

A friend needs help with his who and whom Right on the heels of my recent  regarding why 'who' and 'whom' present difficulties for so many native and non-native learners, comes another complex case of ‘who’ and ‘whom’. The language of a friend's report is bureaucratically complicated and his Supervising Teacher, is very pedantic that the English should be absolutely grammatically correct, which includes the prescriptive use of ‘who’ and ‘whom’. This means that the excellent generic advice  “use who in every case and always avoid whom”  cannot, unfortunately, be applied here. Many grammatically pedantic non-native teachers in my country insist on the proper use of 'whom', especially in official reports and dissertations. My friend therefore needs a reliable practical approach (that can be applied in any given case) to decide whether 'who' or 'whom' should be employed in a particular situation.  When does it get complicated? Problems arise when the sentence does not obviously require a subject pronoun, and the concerned verb is moreover not obviously transitive, making it difficult to decide whether it needs an object pronoun. Again, when the sentence has multiple verbs and clauses, where does one look for an indication as to whether it needs a subject pronoun or an object pronoun?  Appendix: Example sentences from my friend's report I have extracted one relevant passage to better illustrate the problem. N.B this is not a request for proofreading.  "A study of employee expectations regarding future confirmation in Government service, with special emphasis on the ethical aspects in the subjects' claim that long-term provisional employment is a virtual promise of future confirmation":   This special short project conducted a detailed case study of 5 typical auxiliary health care workers who(m) the Government has instructed Heads of Department to terminate from long-standing provisional employment.   The Department of Public Health had allotted special allowances for all subjects who(m) the Supervising Teacher considered deserving of compensatory remuneration for their time and effort spent participating in this project.   Mr.A, who(m) the academic committee had originally advised against, was however selected as the 5th subject due to a lack of other 'typical' cases.   The Supervising Teacher Mrs.B later raised an objection regarding payment of the special allowance to Mr.A, who(m) she had expressed reservations about in writing, leading to his initial disqualification by the academic committee, although he was subsequently selected and did actually participate as a subject of the study.   The Head of the Accounts Department delivered the official opinion that a person who(m) the Supervising Teacher had specifically shown a reluctance towards nominating as a subject of the study could not be considered for the award of any special allowance.


Suppose I raise a ball (with my hand) to some height. I am doing some work against gravity and storing potential energy in the ball. However, once I loosen my grip, or just sweep my hand away from under the ball, the ball falls down. As long as the force existed, the work done and hence the potential energy gained existed. Force gone, work gone. I know, I know. When the ball fell down it released the PE into KE. But read on. I try pushing a wall. It doesn't move. Physicists come to the spot and shout, HAHA LOSER. No work done. Why did I sweat then? What did I invest my energy into? I mean it gotta go somewhere. I can predict that I may have wasted my energy into heat. But just that? On the other hand, the wall stood still without investing any energy at all. Because of chemical forces. Chemical bonds that held it firm. So only "human" or non-natural forces do work that only exists till they themselves exist? As soon as they withdraw, the work done transforms? Is work supposedly be this kind of a retentive investment? One that an agent is supposed to keep maintaining? Aren't we just supposed to do a work and come back and relax knowing that it'll stay the way it is? Why do states of work done change for non-natural processes whereas it resides in equilibrium for natural ones? Naturally, would it be too unrealistic for one to state that energy is not an investment that persists, but a labour that has to be retained continually? I know also that a possible answer to all my questions would be entropy. Just find which process or pathway maximises universal entropy. Nature chooses that. But then, on a more metaphysical note, why are we, life, even exisiting? It's against naturality...

I read the definition of  as  $$W ~=~ \vec{F} \cdot \vec{d}$$  $$\text{ Work  =  (Force) $\cdot$ (Distance)}.$$ If a book is there on the table, no work is done as no distance is covered. If I hold up a book in my hand and my arm is stretched, if no work is being done, where is my energy going?


I am trying to get the difference between the content of two different cells. For example:           A           B             C (Result of formula) 1   ABCDE        ABCDEFGH         FGH 2   ABCDEFGH     ABCFGH           DE 3   AB 123 CDE   CDE 345 AB       345   Can anyone recommend how I can achieve this?

If cell A1 = abcd, cell B1 = abcdefg, then what formula to use in order to get the text difference efg?


I have a problem getting this started. Can anyone help?     Let $A$ be an $n \times n$ matrix for which $A^k=0$ for some $k>n$. Show that $A^n=0$.

$A$ is a $n\times n$ matrix such that $ A^m = 0 $ for some positive integer $m$.   Show that $A^n = 0$.   My attempt: For $n > m$, it's obvious since matrix multiplication is associative.  For $n < m$, $A^n\times A^{m-n} = 0$; not sure what to do next. Also I know that $\det A = 0$.


Prove $$\int_{0}^{1}\frac{1}{\sqrt{1-x^2}}\arctan\left(\frac{88\sqrt{21}}{36x^2+215}\right)dx=\frac{\pi^2}{6}.\tag1$$   My attempts are as follows.   We define for $a,b>0$ $$f(a,b)=\int_0^1\frac{\arctan(ax^2+b)}{\sqrt{1-x^2}}dx,\tag2$$ so that  $$\int_0^1\frac{1}{\sqrt{1-x^2}}\arctan\left(\frac1{ax^2+b}\right)dx=\frac{\pi^2}{4}-f(a,b).$$  The only sensible thing I could think to do was substitute $t=ax^2+b$ so that $f(a,b)=r(b,a+b)$, where $$r(p,q)=\int_{p}^{q}\frac{\arctan x}{\sqrt{(x-p)(q-x)}}dx,$$ which seems only slightly more manageable. I decided to give this approach up and return to $f(a,b)$. We see that $$\frac1{\sqrt{1-x^2}}=\frac12\sqrt{\frac{1-x}{1+x}}+\frac12\sqrt{\frac{1+x}{1-x}},\tag3$$ so that $$f(a,b)=\frac12\int_{-1}^{1}\sqrt{\frac{1-x}{1+x}}\arctan(ax^2+b)dx,\tag4$$ as we can split up $(2)$ into two integrals using $(3)$, preform the change of variable $x\mapsto-x$ in the second, then add the two integrals back together. As it stands, $(4)$ may be the easiest form of the integral to work with, but I am not sure. Another idea is to set $t=\sqrt{\frac{1-x}{1+x}}$ in $(4)$ so that  $$f(a,b)=2\int_0^\infty \frac{x^2}{(1+x^2)^2}\arctan(ax+b)dx.\tag5$$ From $ax+b\mapsto x$ followed by integration by parts with $u=\arctan x$, we have $$f(a,b)=\frac{\pi^2}{4a^2}-\frac2a\int_b^\infty \left[\frac1a\arctan\left(\frac{x-b}{a}\right)-\frac{x-b}{(x-b)^2+a^2}\right]\frac{dx}{1+x^2}.\tag6$$ The first integral  $$J_1(a,b)=\int_b^\infty \frac{\arctan\left(\frac{x-b}{a}\right)}{x^2+1}dx$$ does not seem very easy at all and I do not know how to go about evaluating it. However, the second integral $$J_2(a,b)=\int_b^\infty \frac{x-b}{(x-b)^2+a^2}\frac{dx}{1+x^2}$$ can be evaluated explicitly as $$J_2(a,b)=M\pi b(a^2+b^2+2a+1)-M\left[(a^2-b^2-1)\ln\frac{a^2}{b^2+1}+2b(a^2+b^2+1)\arctan b\right],$$ where $$M=-\frac{1}{2(a^2+(b-i)^2)(a^2+(b+i)^2)}.$$ I feel, however, that there is an easy way to evaluate the integral $f(a,b)$, but as of now it is beyond me. Any help is appreciated.

Does the following equality hold?  $$\large \int_0^1 \frac{\tan^{-1}{\left(\frac{88\sqrt{21}}{215+36x^2}\right)}}{\sqrt{1-x^2}} \, \text{d}x = \frac{\pi^2}{6}$$  The supposed equality holds to 61 decimal places in Mathematica, which fails to numerically evaluate it after anything greater than 71 digits of working precision. I am unsure of it's correctness, and I struggle to prove it's correctness.  The only progress I have in solving this is the following identity, which holds for all real $x$:  $$\tan^{-1}{\left( \frac{11+6x}{4\sqrt{21}} \right )} + \tan^{-1}{\left( \frac{11-6x}{4\sqrt{21}} \right )} \equiv \tan^{-1}{\left(\frac{88\sqrt{21}}{215+36x^2}\right)}$$  I also tried the Euler Substitution $t^2 = \frac{1-x}{1+x}$ but it looks horrible.  Addition: Is there some kind of general form to this integral?  Side thoughts: Perhaps this is transformable into the Generalised Ahmed's Integral, or something similar.


[root@localhost opt]# cat cfg key = value [root@localhost opt]# grep 'key\s*=\s*.+' cfg [root@localhost opt]#    My intent is: the = sign may be followed by zero or more spaces, but must be followed one or more non-space characters.  Why doesn't it output the line key = value?

I wrote a regular expression which works well in a certain program (grep, sed, awk, perl, python, ruby, ksh, bash, zsh, find, emacs, vi, vim, gedit, …). But when I use it in a different program (or on a different unix variant), it stops matching. Why?


If someone already flagged a question as duplicate and there is already the auto-generated "possible duplicate" comment visible, like for example:      possible duplicate of How to compare Strings in Java   Is upvoting this duplicate-comment considered as a flag-as-duplicate or should I also flag the question?  For the case the upvote of the dupl-comment is not considered as a flag-as-duplicate: Maybe it should? It would be more convenient than clicking through the flagging menus. Also I think an upvote of the dupl-comment is a pretty clear expression already that the user agrees that it is a duplicate.  see also the related question here:

When a question is initially flagged as a duplicate, there is a comment. If the duplicate flag gets enough votes, the question is closed as a duplicate, and the comment is deleted.  Does upvoting the duplicate comment count as a close vote? Does it do anything at all?


I didn't have the empty space early this day. What happened? I've already  ticked "hide side bar...".   Can I remove it again with settings?

The same issue as  has arisen again.     The bug was initially fixed, but it seems to have regressed. I'm posting again because SE generally prefers we file new bug reports if a fixed bug comes up again, rather than removing the  tag on the older one. Again, I really don't like it there. It's eye-catching and extremely distracting for me.


I am solving a problem about probability and I need to show this inequality: $$p^2q+q^2r+r^2p+pq^2+qr^2+rp^2\geq 6pqr,$$ where $p,q,r\in[0,1].$  I tried writing it as  $$p^2(q+r)+p((q+r)^2-8qr)+qr(q+r)\geq 0,$$ or equivalently, $$p^2(q+r)+p(q+r-2\sqrt{2qr})(q+r+2\sqrt{2qr})+qr(q+r)\geq 0.$$ Since $p,q,r\in[0,1]$, the only thing that remains to check is that $q+r-2\sqrt{2qr}$ is non-negative, but this need not be true.  I then tried a second approach:  I tried using multivariable calculus to find the minimum of  $$f(p,q,r)=p^2q+q^2r+r^2p+pq^2+qr^2+rp^2-6pqr,$$ but then I get $$Jf(p,q,r)=\begin{pmatrix}q^2+r^2+2p(q+r)-6qr\\ p^2+r^2+2q(p+r)-6pr\\ p^2+q^2+2r(p+q)-6pq\end{pmatrix},$$ and solving $Jf=\mathbf{0}$ seems quite difficult too.   Question: Can anyone help with either of the above approaches, or if not, give a hint on how to solve this problem?

Let $a, b$ and $c$ be positive real numbers. Prove that   $$a^2 b + b^2 c + c^2 a + ab^2 + bc^2 + ca^2 \ge 6abc$$   I have tried factoring with no success for the better part of an hour or so.  How can I go about this?


If $\mathfrak{g}$ is a semisimple Lie algebra, is it true that $$ [\mathfrak{g}, \mathfrak{g}] = \mathfrak{g}.$$  Obviously the derived ideals must stabilize somewhere, but I don't see why $D^{1}(\mathfrak{g}) = \mathfrak{g}$. It seemed my professor was stating this result as a consequence of Weyl's Theorem, but I am not sure why this should follow (or even if this is true).

Can anyone explain why a semi-simple finite dimensional Lie algebra $\mathfrak{g}$ has to be perfect ?   The natural way to prove something like that would be to look to the algebra generated by the Lie brackets, which when $\mathfrak{g}$ is not perfect would be expected to be solvable. But it doesn't seem to work.


To keep this from being voted as a duplicate of , let me clarify. The other question asks for DM tactics to battle chokepoints. Its answers are all focused on fighting at these choke-points. I ask for ways to avoid PCs creating/using choke-points. I want my PCs to jump into the boss room which I've designed, and explore it during the match. I want them to enter rooms and not stand in the corridors during the entire dungeon.  Many classic dungeon maps are modular corridors and rooms, where PCs are expected to gradually progress through. Examples include the , , or the . Advanced DMs can bring a stronger sense of an actual lair filled with enemies, when they start mixing  enemies from multiple rooms, but mostly the books describe each room independently, and as far as I've experienced, unless something makes a particularly strong noise, fights are usually contained to the enemies in each separate room. The Problem Now, as both a player and as a DM, I've experienced the choke-point strategy. Boss rooms are a prime example, but this works in many situations. Players are faced against the next room, riddled with enemies. The DM reads their campaign book,  Yeah, you have 4 undead zombies, 2 living suits of armor, and a weakened Lich looking at you once you open the door. Roll initiative!  Ok, so PCs at the door, a long corridor behind them, and enemies within the room. The frontliners now simply stand in front of the doorway (effectively blocking it) and the nukers blast from behind and drop massive AoEs on the room while enemies do their best to  break the front-line teleport / run-away with some hidden exit spam the party with AoE back attack the backliners with ranged attacks suffering from cover issues (thanks to the frontliners)  (This literally happened in my last session. The Bard dropped his  in the room, Druid dropped a , and while the Lich teleported out and tried his best to mess the party up, all the minions inside the room died while slightly bothering our Cleric.) With specific enemies, breaking the party is somewhat easy. If you have on-going AoEs, if you can teleport, if you can protect yourself from the party's on-going spells. But most often, your group of enemies are just a bunch of martial enemies, and they have no way of splitting up the party. As you can see from the maps, rooms are usually very different. They have platforms, and pillars, and parts with difficult terrain, and this all should be something for the party to take advantage of. But its so much easier to just use the doorway as a choke-point, that rooms are basically just used after everything is dead, when searching for loot. How can I incentivize my players to enter rooms and take strategic advantage of each room's layout, when using the door as a choke-point is such an easy and effective strategy in many published adventures? Specifically, I want players to want to enter rooms and fight there, not just stand at the doors. When I design dungeons/enemies from scratch, there are some ways of handling this. However, when using official content, it's gets harder to adapt the environment or enemies, and still keep true to the written content. We don't play in AL, but for example, we're doing Tales of the Yawning Portal, so strategies that also work in such published and mapped out dungeons are preferable.

As a new DM I'm still learning how to control the monsters in a battle. A situation came up last game and although it was fine and fun, I wonder if there are better strategies for a DM to avoid a bottleneck in a doorway.  Scenario: PCs were up against a door deciding whether they should go in. Hobgoblins on the other side of the door open it and an encounter ensues. However, the encounter is basically the PC at the door trading blows with the NPC at the door, while their respective allies in the back try to shoot over their friends' heads. Although you can move through an ally's space, you can't occupy an ally's square. This leads me to assume that you can't move in to an ally's square, attack from it, and move back out of the square (though please correct me if I'm wrong).  This scenario and understanding of the rules brings me to my question.  What tactics can a DM use in a combat scenario like the one above to make sure that the NPCs are all contributing to the battle? Especially if they have no ranged weapons, is there a way that they can all try to attack?


How can i convert my Ubuntu 15.10 64 bit Vanilla Unity installation to Ubuntu GNOME Edition. Is it just installing Gnome Shell and uninstalling Unity. However i dont think this will be enough. Am I right, and if so, how can i convert to Ubuntu Gnome Edition?

Note : My question itself answers how to install GNOME  I want to install Gnome desktop in my 64-bit Ubuntu 14.04 I just googled and I found two ways to install GNOME. I also read other answers on Ask Ubuntu and googled but can't find what is difference between this both!  1st method to install is :  sudo apt-get install gnome-shell sudo apt-get install ubuntu-gnome-desktop   2nd method  sudo add-apt-repository ppa:gnome3-team/gnome3-staging sudo add-apt-repository ppa:gnome3-team/gnome3 sudo apt-get update sudo apt-get dist-upgrade   If I try installing using first way, it shows following errors:  The following packages have unmet dependencies: gnome-shell : Depends: gnome-settings-daemon (>= 3.4.0) but it is not                        going to be installed               Recommends: gnome-control-center but it is not going to be installed ubuntu-gnome-desktop : Depends: gdm but it is not going to be installed                        Depends: gnome-control-center but it is not going to be installed                        Depends: gnome-session but it is not going to be installed                        Depends: gnome-settings-daemon but it is not going to be installed                        Depends: gnome-shell-extensions but it is not going to be installed E: Unable to correct problems, you have held broken packages.   And If I try installing 2nd way, after entering sudo apt-get dist-upgrade command it tells me that 299Mb space will be used and I just aborted it pressing n.  What is right way to install Gnome desktop in Ubuntu 14.04.  And one more thing, as there are two methods available to install Gnome, which is best? Up to I know using 1st method I can switch to Gnome desktop by logging out from Unity and choosing GNOME.   What would happen if I install Gnome using 2nd method? Will it remove Unity from my computer or I will be able to use both Unity by logging out?


I am a Pure Mathematics senior undergraduate student at the university, and I am planning to change my major for master's degree, and one of my alternatives is Cosmology. The problem is that I do not have any background in Physics in general and in Cosmology in particular. In this regard, I have some questions:  $1-$ Is it vital for me to hold a bachelor's in Physics or I can manage the essential courses on my own?  $2-$ Which topics in Physics should I be familiar with to start master's degree is Cosmology?  $3-$ Approximately, How much time does learning these topics take?  $4-$ Which books do you recommend for starting with? and which books do you recommend for gaining further knowledge? (PS: as I can get all of these books out of our university, the price of them is not a factor)  I would really appreciate it if someone could possibly help me find my way!

I have finished Carroll's general relativity book, Spacetime and Geometry. I am specifically interested in cosmology, so is there any book which goes more in depth into cosmology? I prefer a mathematically rigorous book, which goes beyond the cosmology chapter in Carroll's book. The Big Bang and inflation theory should be dealt with in depth.


I am reading  which says (p. 7)     A sequent is an expression      $(Γ \vdash ψ)$      where $ψ$ is a statement and $Γ$ is a set of statements. The   sequent $(Γ \vdash ψ)$ means      (2.2) There is a proof whose conclusion is $ψ$ and whose undischarged assumptions are all in the set $Γ$.      When (2.2) is true, we say that the sequent is correct.   Why are the authors using 'true' and 'correct' instead of just 'true'? Is there some difference between the meaning of the two words?

In Chiswell and Hodges Mathematical Logic the authors define a sequent as such      "A sequent is an expression   (Γ ⊢ ψ) (or Γ ⊢ ψ when there is no ambiguity)   where ψ is a statement (the conclusion of the sequent) and Γ is a set of statements (the assumptions of the sequent) ...There is a proof whose conclusion is ψ and whose undischarged assumptions are all in the set Γ.".   They then go on to provide the axiom as follows:     Sequent Rule (Axiom Rule) If ψ ∈ Γ then the sequent (Γ ⊢ ψ) is correct.   Upon further reading about what exactly it means to be a sequent  I understand that for $\psi$ to be satisfied or "correct", every element of   $\Gamma$ must be true as their all linked by AND conjunctions.    What confuses me is that suppose that there is an element in $\Gamma$ which is false then the whole antecedent is false according to the wikipedia definition by conjunction and then even though $\psi$ exists and is true in $\Gamma$ ultimately $\psi$ would be false. Could someone please explain to me and help clarify how the axiom and the definition can both be true. Thank you for all of your help.


Any possibility to align the fractions (units in general) too?  Wobei: \begin{flalign*} \noindent \tab \rho _{KOH} & = 2.04 \frac{g}{cm^3} &\\ M_{KOH} & = 56.10 \frac{g}{mol} &\\ c_{KOH} & = 0.05 \frac{mol}{L} &\\ \end{flalign*}   If I add another & they end up completely at the right.

I'm trying to add this expression to my work:   I understand that the best way to achieve this is using the alignat environment within the amsmath package, so I tried the following:  \begin{alignat*}{3} m && \text{módulo} && m>0\\ a && \text{multiplicador} && 0<a<m\\ c && \text{constante aditiva} && 0\leq c<m\\ x_0 && \text{valor inicial} && 0\leq x_0 <m \end{alignat*}   But the spacing I'm getting is really weird, I have read the amsmath documentation but I can't figure out what's the problem.  This was I'm getting:   My version is in spanish and I'm using polyglossia, but I don't think that's relevant. Anyway I'm using xelatex, and the book class.  I also wanted to know if there is a way to write the whole equation in the same environment with the middle text, or do I need to make another math environment for the centered equation at the end.


I went to an interview last month the interviewer asked an interesting question: Can we write linked list using class not using structure? I said yes and also I wrote something like the code below. Can anyone explain whether it is right or wrong?  class list {     public:        int a;      class *list;  };

In what scenarios is it better to use a struct vs a class in C++?


Consider I have an array of dates eg:  abc = [new Date("2015-03-01"),new Date("2015-03-02"),new Date("2015-03-03"),new Date("2015-03-04")]   output:  [Sun Mar 01 2015 05:30:00 GMT+0530 (India Standard Time), Mon Mar 02 2015 05:30:00 GMT+0530 (India Standard Time), Tue Mar 03 2015 05:30:00 GMT+0530 (India Standard Time), Wed Mar 04 2015 05:30:00 GMT+0530 (India Standard Time)]   I'm trying to push the difference between two dates and trying to store the data in a new array. Here is what I have tried,  var arr = []; abc = [new Date("2015-03-01"),new Date("2015-03-01"),new Date("2015-03-02"),new Date("2015-03-03"),new Date("2015-03-04")];  for (let i = 0; i < abc.length-1; i++){     arr.push((abc[i+1].getDate() - abc[i].getDate())+1) }   And the output I'm getting is:   [1,2, 2, 2]   But I needed the output something like   [1,2,3,4]    I need to append plus one to each date difference. How can I achieve that?

How do I get the number of days between two dates in JavaScript? For example, given two dates in input boxes:  <input id="first" value="1/1/2000"/> <input id="second" value="1/1/2001"/>  <script>   alert(datediff("day", first, second)); // what goes here? </script>


I am struggling with following problem:  In my app I want to check whether a current datetime from LocalDateTime.now() is in range of some specific days of week, let's say between Friday and Sunday.   Example:  Datetime window is from Friday 20:00 to Sunday 20:00. When I check current date on Thursday at 22:00*, answer should be false but when I check it on **Saturday at 8:00, answer should be true.  I can sort of achieve this with DayOfWeek class in java.time API using compareTo() method and comparing hours and minutes separately but I would like to know if there is any better way to do it  and especially when the range of days spans over two weeks (e.g. Friday to Monday of the next week)?  Thanks in advance for any advice or help.

Given two date ranges, what is the simplest or most efficient way to determine whether the two date ranges overlap?  As an example, suppose we have ranges denoted by DateTime variables StartDate1 to EndDate1 and StartDate2 to EndDate2.


In "The Red-Headed League", one of Sir Arthur Conan Doyle's Sherlock Holmes stories, a character named Jabez Wilson remarks, "It was a pretty expensive joke for them, for it cost them two and thirty pounds." This [singles place]-and-[tens] place construction occurs frequently in these stories, and is employed by the uneducated and tradesmen such as Mr Wilson as well as by the better educated, better heeled Holmes and Watson. As far as I can tell, however, no one today employs this construction; doing so would sound extremely strange. Around what time did this usage disappear from common parlance, and why? It seems to me that it is more efficient to say, "thirty-two" than it is to say, "two and thirty"; but if this is really the explanation, why did such a construction ever enjoy currency to begin with?

19th century English texts occasionally use Germanic-style number words, such as "four-and-twenty", but the same text would also have the modern "twenty-four" in places (see e.g. Conan-Doyle for several examples).   How did the usage of germanic-style numbers change historically? When did the Germanic forms fall out of use?   (I have asked this question previously on  (German) and got a short , but would appreciate any additional input.)


I have the following server block defined:  server {   server_name jsonip.com www.jsonip.com ipv4.jsonip.com ipv6.jsonip.com;   add_header x-domain-name "$server_name $http_host $host" always; }   I'm setting the 'x-domain-name' header simply as a way to test what nginx is seeing and reflecting it back to the browser.  The issue I'm having is that if I access , then $server_name is matching 'jsonip.com' rather than 'ipv4.jsonip.com'.  Conversely, both $http_host and $host are matching the domains correctly.  Is there a different way to configure the server_name domains in the server block to get $server_name to match correctly?

What is the difference between the three Nginx variables $host, $http_host, and $server_name?  I have a rewrite rule where I'm not sure which one I should be using:  location = /vb/showthread.php {     # /vb/showthread.php?50271-What-s-happening&p=846039     if ($arg_p) {         return 301 $scheme://$host/forum/index.php?posts/$arg_p/;         }   I'm looking for an answer that doesn't just say 'use ___ variable in your rewrite rule' but also explains the theoretical differences between them.


The following question was asked in a master's exam for which I am studying.  Suppose that $f(z)$ is analytic in the disk $|z|\leq R$ and let $$ A(r)= \max_{|z|=r} \text{Re}\,f(z). $$ Prove that, for $r<R$, $$\max_{|z|=r} \frac{ |f^{(n)} (z) | } { n!} \leq \frac{2^{n+2} R }{ (R-r)^{n+1} }\big\{A(r)+|f(0)|\big\}.$$  I am confused on which result I should use to prove this. $\max_{|z|=r} \frac{ |f^{(n)} z | } { n!} $ will have terms from both the real and imaginary parts of $f$. I thought of using Cauchy Integral formula but it will only esitmate value at $f(0)$. I need you to just outline the result that should be used. I will complete it myself.

Suppose that $f(z)$ is analytic function in the disk $|z|\le R$ and $A(r)=\max_{|z|=r}Re(z)$ then prove that $r<R$  $$\max_{|z|=r}\left|\frac{f^n(z)}{n!}\right|\le \frac{2^{n+2}R}{(R-r)^{n+1}}\{A(r)+|f(0)|\}$$  MY attempt   Using Cauchy generalized integral formula   $f^{(n)}(z_0)=\frac{n!}{2\pi i}\int _c\frac{f(z)dz}{(z-z_0)^{n+1}}$  then $\max_{|z|=r}\left|\frac{f^n(z)}{n!}\right|=\left|\max_{|z|=r} \frac{1}{2\pi i}\int _c\frac{f(z)dz}{(z-z_0)^{n+1}}\right|$  and i think we can solve by using Borel caratheodory theorem  Let $f(z)$ be holomorphic function on $|z|\le R$ and let $M(r)=\max_{|z|=r}|f(z)|$ and $A(r)=\max_{|z|=r}Re f(z)$ then  for $0<r<R$  $$ M(r)\le \frac{2r}{R-r}A(R)+\frac{R+r}{R-r}|f(0)|$$  from here how to processed ?


I understand that eigenvalues measure variance along the principal components.  Questions   How are eigenvalues and variance same for PCA?  What is the intuition behind this being the same?  What is the mathematical proof behind this theory?

I've read a lot about PCA, including various tutorials and questions (such as , , , and ).   The geometric problem that PCA is trying to optimize is clear to me: PCA tries to find the first principal component by minimizing the reconstruction (projection) error, which simultaneously maximizes the variance of the projected data.    When I first read that, I immediately thought of something like linear regression; maybe you can solve it using gradient descent if needed.  However, then my mind was blown when I read that the optimization problem is solved by using linear algebra and finding eigenvectors and eigenvalues. I simply do not understand how this use of linear algebra comes into play.  So my question is: How can PCA turn from a geometric optimization problem to a linear algebra problem? Can someone provide an intuitive explanation?  I am not looking for an answer like  that says "When you solve the mathematical problem of PCA, it ends up being equivalent to finding the eigenvalues and eigenvectors of the covariance matrix." Please explain why eigenvectors come out to be the principal components and why the eigenvalues come out to be variance of the data projected onto them  I am a software engineer and not a mathematician, by the way.  Note: the figure above was taken and modified from .


axises for SE account show wrong values after zooming.  Initially (looks fine):        After zoom Y-axis has wrong values (e.g. 10k is lower than 6k):        After reseting zoom I expect to see same graph as initially, but see overlapped values on X-axis and weird ordering for Y-axis (5 - 7.5 - 12 - 10 - 15):

If I zoom in somewhere and then press the "reset zoom" button, it places some of the markers completely out of place:  What it's supposed to look like:   Browser: Safari, iOS 10.1.1


A linear functions $f$ is a function that has the following two properties:   $c\cdot f(x) = f(cx)$ $f(x+y) = f(x) + f(y)$   But does $c\cdot f(x) = f(cx) \implies f$ is linear? Can we assume property $2$ above, if we have a function $f$ satisfying property $1$?

Suppose $cf(x)=f(cx)$ and $f:\mathbb{R}\to\mathbb{R}$. I believe it follows that $f(x+y)=f(x)+f(y)$.   Proof: There is some $c$ such that $y=cx$. Then  $$f(x+y)=f\left((1+c)x\right)=(1+c)f(x)=f(x)+cf(x)=f(x)+f(cx)=f(x)+f(y)$$  QED.  I wonder if the same thing holds for when $f:\mathbb{R}^n\to\mathbb{R}^n$? I can't use the same trick, because all vectors are not scalar multiples.  I tried thinking of it in terms of basis units, but didn't get anywhere.


Are there any good approximations of the absolute value function which are $C^2$ or at least $C^1$? I've thought about working with exponentials and then adding in more terms to keep the function from growing too fast away from zero, but I was hoping to find something a bit neater.

I am trying to get the derivative of $|x|$, and I want that derivative function, say $g(x)$, to be a function of x.   So it really needs the |x| to be smooth (ex. $x^2$); I am wondering what is the best way to approximate |x| with something smooth?  I propose $\sqrt{x^2 + \epsilon}$, where $\epsilon = 10^{-10}$, but there should be something better? Perhaps Taylor expansion?  Sorry for any confusion. I should add some additional information here:  I want to use $|x|$ as part of an object function $J(x)$ which I want to minimize. So it would be nice to approximate $|x|$ with some smooth function so that I can get the analytic form of the first-order derivative of $J(x)$.  Thanks a lot.


Googling for some question I saw this result on first page, on clicking it, the UI is exactly same as Stack Overflow. Hovering over the links show nothing unusual, but clicking on any link opens up 2-3 ads windows.    It seems someone is making money, but duplicating the UI and content of Stack Overflow.

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?


Should this:     We believed the issues which would be on the agenda were too problematic at the time"   Be like this?     We believed the issues that would be on the agenda were too problematic at the time.

When is it appropriate to use that as opposed to which with relative clauses?


So I accidentally left my defrosting turky in sink of cold water in my cold garage for 24hrs as a work emergency came up. I am wondering if it will still be safe to cook? it feels cold. Ugh..I have nothing else for dinner today.

If I left food out of the refrigerator for some period of time, is it still safe? If I left it out too long, can I salvage it by cooking it more?


I am using following code for theming..  theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('class' => 'view-all-frame')));   is the above format right? Can 'attributes' be written above inside array? Can I use theme_table() instead of theme()?   theme_table(array('header' => $header, 'rows' => $rows, 'attributes' => array('class' => 'view-all-frame')));   If they are same then does it affect the execution or anything related to it?  Similarly for theme('item_list', array()) and theme_item_list();

Why should you use theme(), rather than calling the theme functions directly?   theme('box', $title, drupal_get_form('comment_form', $edit, $title));   Why doesn't the code call the theme function directly, as in the following code?  theme_box($title, drupal_get_form('comment_form', $edit, $title));


I have this object var Obj={  name:"Joe",  cars:[   {    name:"Fiat",    year:"2011"   },   {    name:"Opel",    year:"2018"   }  ] }  How to deep copy Obj to copyObj without mutate cars property? For example: copyObj.cars[0].name="Audi" console.log(Obj.cars[0].name) //I expect it to still be "Fiat"

What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but . I've done things like obj = JSON.parse(JSON.stringify(o)); but question the efficiency.  I've also seen recursive copying functions with various flaws.  I'm surprised no canonical solution exists.


I have a single 12V 2A power supply which is powering 4 CCTV cameras which require a 12V 1A power supply each in addition to an illuminator lamp which requires 12V 2A supply.  At the moment everything is working fine. Is that arrangement ok into the future?  If not please advise me on what single power supply is needed to meet the needs of the 4 cameras and the illuminator lamp.

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


I have noticed something peculiar on my Nikon D5200.  If I take a set of images and remove them from the card, the next batch will start again at DSC_0001.  My older non DSLR camera would continue to increase the number over time and not reset.  Is there a way to keep the numbers from resetting when the images are removed?

I have a Nikon D3100. When I unload the pictures from the camera to the computer, the numbering of the file names goes back to zero.  Sometimes, when they are still about the same event, I would prefer if it kept going where it left off. Is there a way to tweak those settings?  Thanks


What are the pros and cons of importing a Python module and/or function inside of a function, with respect to efficiency of speed and of memory?  Does it re-import every time the function is run, or perhaps just once at the beginning whether or not the function is run?

states:  Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants.  However if the class/method/function that I am importing is only used in rare cases, surely it is more efficient to do the import when it is needed? Isn't this: class SomeClass(object):      def not_often_called(self)         from datetime import datetime         self.datetime = datetime.now()  more efficient than this? from datetime import datetime  class SomeClass(object):      def not_often_called(self)         self.datetime = datetime.now()


I have a hall light with the only switch by the front door. The light fixture is ~3 meter from the door. At the foot of the hall stair, about 2 meters away from the door in the other direction, is an existing switch panel for the landing light. I want to add an additional switch to that panel, which will be a 2nd switch for the hall light. Question 1: Assuming that I want the "normal" version of a 2-switch light (i.e. flipping either switch will change the light's state, irrespective of the other switch's position) ... am I right in thinking this can't be achieved without digging out the all of the existing run from the front door to the light fixture. (which is in the wall/ceiling)?  Question 2: Suppose I were willing to put up with "both switches have to be in the 'on' position for the light to work" (i.e. either switch can turn the hall light off on it's own, but you'd sometimes have to flip both switches to turn the light on). Now can this be done without digging out the existing run?  Question 3: On the assumption that Q1 is "Yes, you have to dig it out" and Q2 is "Yes, you can install that without going back to the front door switch". Would it be possible to install "Q2" in such a way that in the future, I can come back and convert to Q1, without having to redo this 2nd spur? i.e. can I "Do Q2 with the extra run setup up to support 2 switches, and then see how palatable that set up is. And if it's too annoying then come back and fix the existing run to properly support both switches, without having to redo the new run"  All of this has to be standard electrical wiring. WiFi or "smart" switches are (alas) completely out of the question.

I have a switch that controls the top and bottom of an outlet.  I would like to make the outlet hot all the time.  Additionally I would like to install a light fixture, convert the existing single switch to a 3 way and install a new 3 way switch on a different wall.  @tester101 explained to me how to do something similar yesterday, but without the 3 way switches.  What is the best/easiest way to accomplish this? EDIT  Switch  Back of the switch  Outlet Back of outlet


I just update my OS to 17.10, and I am using two displays. I just set up the workspaces, so now when I move from one workspace to another one, the windows open on the second display not moving, Its stays on all workspaces? On previous version it was working, when I switch to workspaces its switch the all windows in both displays.

Gnome-shell seems to like to leave one monitor as "fixed" when you switch workspaces.  Additionally, there is no preview in the Activities view of my secondary monitor.  Also, on the second monitor, where there should be either empty desktop space, or a copy of the panel, I just have a white bar.  How can I get gnome-shell to treat my secondary monitor like the primary one?


So few days ago I dual booted my system with Ubuntu 18.04 and during the partition process it seems that I made some wrong partitions such that now by default windows open in automatic repair mode and gives error C:\recovery\windowsre\winre.wim\system32\logfiles\srt\srttrail.txt Partition is as follows:  Someone out there please help as major amount of data is on risk. Thank you.

I have a Toshiba satellite A-200 laptop with a Vista OS on it with 4 NTFS partitions  (C:) Vista  (D:) Entertainment  (E:) Work  (F:) Sources   and I wanted to start using Ubuntu instead. So I tried it first from the live CD and everything was OK and all the partitions were shown and working and so I decided to install Ubuntu to replace Vista on the (C:) drive. After I did that I can no longer find my folders and files on the (D:), (E:), (F:) partitions and the only file system that is shown is one 198 GB although my HDD is 320 GB.  I can't access the lost data on the remaining 120 GB which I hope is still there and not totally lost  I am now working from the live CD but I am unable to install testdisk. Can I recover the Vista partitions by the product recovery CD to get my laptop back to the factory settings? Can I recover the NTFS partitions using a recovery program for Windows or will that make the problem worse?   I need these data badly as I don't have a backup for them.


Does PSY attribute his fashion to his district Gangnam? I've been hearing people nowadays going 'I have the Gangnam Style'. Are they meaning they have adopted the cultures of Korea, Gangnam?

How can a district be combined with "Style"? Does this show a significance in the district's style?


I'm really interested in creating a package in python. To do so, I watched and read several tutorials but there is always something that doesn't want to work. What I'm doing I created a folder package__tutorial in which I have another folder which corresponds to the name of my package - mypackage. Folder mypackage contains two files:  __init__.py - file which indicates where the package is functions.py - file which contains functions to be included into the package  In functions.py have some one basic function: def average(x,y):     return (x+y)/2  To summarize - my file structure is the following package__tutorial containing mypackage containing __init__.py and functions.py. Now - to load my package I just need to use: from mypackage import functions  Then to use function average from this package we just need to use: functions.average(2, 8)  However importing a file containing functions it's not so convenient for me. Is there any possibility to make this import in a standard way as to other packages ? For example - import numpy as np np.linspace()  I would prefer to have exactly the same: import mypackage as mp  mp.average()  Is there any possibility to do so ? To do not import specific file containing functions, but just a package. EDIT I read the post you have given me, and in __init__.py I included: from .functions import *  and it solved the issue. Thanks!

What is __init__.py for in a Python source directory?


Are there ways to reduce the Windows 10 taskbar width when it's positioned on the sides ?  It can be resized but the minimum width is very wide. It seems to have a minimum width to fit the date.

I have 14" 16:9 notebook and would like my Windows 10 taskbar have on the (left) side. Unfortunately, although I set it to small icons the bar is pretty wide. Do not you know how to make it thinner?  This is how I would like to have it:


I just witnessed a question from someone on Stack Overflow that, for some unknown reason, posted what appeared to be an array containing usernames, encrypted passwords, email addresses, phone numbers, , etc., asking for help handling the array. Fortunately, the author removed the question, but not before dozens or hundreds of users saw this question and perhaps got indexed by search engines.  Besides flagging this question, are there any steps for Stack Exchange users to pursue in such a situation? If I were a client of this person, I'd want someone to tell me that they are incompetent and leaked some of my information.  Edit: Thanks for the responses.  While I viewed the duplicate question, I feel these answers and comments are more appropriate, especially given the website changes over the past year.  It was more a question of what can I do than what should I do.  The answers and comments here also gave me some insight over attitudes of this kind of situation in an ethical and legal light.

I've observed several incidents where users inadvertently posted detailed, sensitive information. For example, a Server Fault user who posted a question with working login credentials to his actual production server, or the Stack Overflow user who posted actual medical records as example data for his question.   What should be the procedure for handling such cases?


As in the title I have to construct a metric $d$ on $\mathbb{R} \setminus \mathbb{Z}$ s.t. $( \mathbb{R} \setminus \mathbb{Z}, d)$ is complete and homeomorphic to $ \mathbb{R} \times \mathbb{Z}$.  I don't know how to proceed!

Good evening!  I had topology exam yesterday and I had a question that gave me problems.  Lets consider $\mathrm{G} = \mathbb{R} \setminus \mathbb{Z} $ , i.e. real line without integrals, where $\rho$ is natural metric on $\mathrm{G}$. Find metric $d$ equivalent to  $\rho$, where $(\mathrm{G},d)$ is complete metric space.    It is obvious that $(\mathrm{G},\rho)$ is not complete, but I don't know how to construct $d$. Can I do something like get rid of Cauchy's property only in integral points of real line and maintain in the other ones?


I do not want to install Ubuntu desktop to my windows computer, but I want to install on a new hard drive on a separate computer.  How do I create an install disk without messing with my current computer.

How do I make an Bootable Ubuntu USB containing the the latest version of Ubuntu?  For completeness, how would I be able to do this on Ubuntu, Windows, OS X or another Linux distro?


Is there a portable way or best practice to access a version number for a schema at runtime?  Rationale: you have multiple systems (development, QA, etc.) where you push schema changes from one system to the next. Say you're not sure if you already have the latest schema on the QA system, how can you find out the version of the current schema (preferably automated with a script)?  I could imagine having   a convention on using a table comment (COMMENT ON TABLE with Oracle, is that a standard?) to version every table a special table in the schema storing version information   How do you do this? Is there a best practice?

What version control methodologies help teams of people track database schema changes?


From Finan:  Let $\sigma\in{S_n}$, define the $\mathbf{order}$ of $\sigma$ to be the smallest positive integer such that $\sigma^m=(1)$.  Prove that if $\sigma$ has order $m$ then $\tau\sigma\tau^{-1}$ has order $m$ for all $\tau\in{S_n}$.  So $\tau$ can have its own order, so let $order(\tau)=p$.  Thus $\tau^p=(1)$.  If $(m,p)=1$, then $order(\tau\sigma)=mp$.  But doesn't $order(\tau^{-1})=p$?  Thus $order(\tau\sigma\tau^{-1})=pmp$.  So them this implies $(\tau\sigma\tau^{-1})^{pmp}$...  Not sure where to go with this.

I dont understand the following very simple statement:  If $\tau \in S_n$ has order $m$, then $\sigma \tau\sigma^{-1}$ has also order $m$.  The proof is:  Suppose $\tau$ has order $m$.   $(\sigma \tau \sigma^{-1})^{m} = \sigma \tau^{m}\sigma^{-1}= (1)$  Then (using  exercise 17) they say that the order of $\sigma\tau\sigma^{-1}$ cannot be less than $n$ (remember we are in $S_n$), since $(\sigma\tau\sigma^{-1})^k=1 $ implies $\sigma\tau^k\sigma^{-1} =(1)$, and then $\tau^k=\sigma^{-1} \sigma = (1)$  I don't understand the last part.... Who can help me?


You know, we all have inflation. You can buy less on your USD, Euros and RUBs today than year before. I was advised to buy gold if I do not want my money be eaten by inflation. Gold is advised for long-term savings. However, I look at the goldprice.org    The price of gold is roughly constant. I ignore the 2008 spike. The constant means that you can buy as much gold per your dollar as you could a year ago. Yet, the dollar is cheaper today, so, the gram of gold must also be cheaper. The plot shows me that gold loses its value as much as the dollar and other printed currencies, it is subject to inflation. It shows that the gold value is eaten at the printed money inflation rate or gold is mined exponentially with time at money doubling rate. Is my observation right?

I always assumed that physical gold is inflation-proof, but my advisor at my bank claimed it is not — unfortunately without going into details. Now I wonder what he meant.  My assumption was: If I buy gold now for $100 and that inflation reduces the value of the Dollar by 50%, I will be able to sell my gold for $200. The $200 are worth the same as my $100 before deflation.  Conclusion: Gold is inflation-proof. But by this simple logic every physical entity that does not lose intrinsic value over time is inflation-proof.  Am I wrong here or is it really that simple?


Two particles with initial positions and velocities $r_1,v_1$ and $r_2,v_2$ are interacting by the inverse square law (with G=1), so that  $$ {d^2r_1\over dt^2} = - { m_2(r_1-r_2)\over |r_1-r_2|^3} $$ $$ {d^2r_2\over dt^2} = - { m_1(r_2-r_1)\over |r_1-r_2|^3} $$  (the inverse square law along the line of separation). What is the complete solution of these differential equations? What is the position of the two objects as a function of time?  After reading a lot on Wikipedia, I've come to the definition of center of mass and relative coordinates:   $$R(t) ~=~ \frac{m_1 r_1 + m_2 r_2}{m_1+m_2}$$  $$\ddot{r}(t) r(t)^2 ~=~ (m_1+m_2)G$$  Where $R$ is the center of mass, and $r$ is the displacement between the particles... Is this correct? How do I proceed to solve the differential equation?

The common understanding is that, setting air resistance aside, all objects dropped to Earth fall at the same rate. This is often demonstrated through the thought experiment of cutting a large object in half. The halves clearly can't then fall more slowly just by being sliced in two.  However, I believe the answer is that when two objects fall together, attached or not, they do "fall" faster than an object of less mass alone does. This is because not only does the Earth accelerate the objects toward itself but the objects also accelerate the Earth toward themselves. Considering the formula: $$ F_{\text{g}} = \frac{G m_1 m_2}{d^2} $$  Given $F = ma$ thus $a = F/m$, we note that the mass of the small object doesn't seem to matter as when calculating acceleration the force is divided by the $m$ term, its mass. However, this overlooks that the force is actually applied to both objects, not just to the smaller one. The acceleration on the second, larger object is found by dividing $F$, in turn, by the larger object's mass. The two objects' acceleration vectors are exactly opposite, so closing acceleration is the sum of the two:  $$ a_{\text{closing}} = \frac{F}{m_1} + \frac{F}{m_2} $$  Since the Earth is extremely massive compared to everyday objects, the acceleration imparted on the object by the Earth will radically dominate the equation. As the Earth is $\sim 5.972 \times {10}^{24} \, \mathrm{kg} ,$ a falling object of $5.972 \, \mathrm{kg}$ (just over 13 pounds) would accelerate the Earth about $\frac{1}{{10}^{24}}$ as much, which is one part in a trillion trillion.  Of course in everyday situations, we can for all practical purposes treat objects as falling at the same rate because of this negligible difference—which our instruments probably couldn't even detect. But I'm hoping not for a discussion of practicality or what's measurable or observable, but what we think is actually happening.  Am I right or wrong?  What really clinched this for me was considering dropping a small Moon-massed object close to the Earth and a small Earth-massed object close to the Moon. This made me realize that falling isn't one object moving toward some fixed frame of reference, but that the Earth is just another object, and thus "falling" consists of multiple objects mutually attracting in space.


I face infinite loop issue in my quick sort algorithm, this thing happen in right sub array partition, so if I only partition the left sub array it works great like this code.  #include <stdio.h> int list[] = {8, 1, 3, 4, 2, 10, 4, 6}; //int list[] = {2, 1, 10, 4, 5, 11, 12, 6}; //int list[] = {1, 2, 4,  5, 6, 11, 12, 10}; int main(int argc, char **argv) {      printf("Unsorted list is: ");     printArray(list);     quickSort(list, 0, 7);     //partition(list, 5, 7);     printf("Sorted list is: ");     printArray(list);      return 0; }  void printArray(int list[]){     int i;     for(i = 0; i < 8; i++){         printf(" %d ", list[i]);     }        printf("\n\n"); }  void quickSort(int list[], int low, int high){      int pIndex = partition(list, low, high);      if(pIndex <= 0){         return;     }      //quick sort left sub array     quickSort(list, low, pIndex-1);      //quick sort right sub array //  quickSort(list, pIndex+1, high);      printf("pIndex is %d\n", pIndex); }  int partition(int list[], int low, int high){     int pivot = list[high];       int i;     int j = high - 1; //  int j = high;       while( 1 ){         //less than pivot         for(i = 0; list[i] < pivot; i++){             printf("for %d (index %dth) < %d\n", list[i], i, pivot);             //do nothing         }         printf("less than stop at index %d which is %d\n", i, list[i]);          //more than pivot         for(j = j; j > 0 && pivot < list[j]; j--){             printf("for %d < %d (index %dth)\n", pivot, list[j], j);         }         printf("greater than stop at index %d which is %d\n", j, list[j]);          if(i >= j){         printf("low index %d >= %d then swap pivot\n", i, j);         printf("swap index %dth which is %d, with index pivot %d which is %d\n", i, list[i], high, list[high]);         swap(list, i, high);          printf("Temporary list is: ");         printArray(list);          printf("then return last position index pivot %d which is %d\n", i, list[i]);         return i;         break;         }          //tukarPosisi, sehingga yang kecil di sebelah kiri, yang besar di sebelah kanan.         printf("swap index %dth which is %d, with index %dth, which is %d\n", i, list[i], j, list[j]);         swap(list, i, j);          printf("Temporary list is: ");         printArray(list);       } }  void swap(int list[], int i, int j){     //variabel sementara untuk menampung i     int temporary = list[i];      //tukar posisi, sehingga yg kecil di kiri, yg besar di kanan.     list[i] = list[j];     list[j] = temporary; }   I have already print much debug but still can't figure out why this thing happen. So where is the logic wrong and how to fix it?  Any help will be appreciated

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


Some programs can have an infinite runtime and produce infinite output. When used in a pipe with a command that finish, how does the pipeline knows when to stop ?  For instance, take yes (infinite output) with head:   yes | head -n 5   It will only yield 5 y.  Is the first command that end the one that stop the other processes input/output ? How does it works ?

According to its documentation, bash waits until all commands in a pipeline have finished running before continuing     The shell waits for all commands in the pipeline to terminate before returning a value.   So why does the command yes | true finish immediately? Shouldn't the yes loop forever and cause the pipeline to never return?    And a subquestion: according to the , shell pipelines may choose to either return after the last command finishes or wait until all the commands finish. Do common shells have different behavior in this sense? Are there any shells where yes | true will loop forever?


I was voting on a question but I was just spamming the vote (on and off) just to see if there was a bug. Actually there is. After spamming the vote on and off for about 10 seconds, stop and watch the score change like crazy (not due to someone else doing the same thing). When the craziness stops, the score will return to normal.   So can we fix this crazy bug?  Steps to reproduce:   Select your victim question Repeat the following as fast as you can for 10 seconds:   Click the vote button Click again to undo vote  Watch the mayhem that happens to the score Cast vote if needed

I was just on this question (), using OSX 10.7/ Chrome 19, and the vote numbers kept 'flickering' to different numbers 4-6 times a second, usually within +/-2 votes from what it started at. There was no change in the expanded vote count, and this happened with the questions vote count and some of the answers vote count as well.  Just for clarity's sake, the question's vote count changed from 2->3->4->3->4->2->3 every second, for 1-3 seconds. Even after refreshing the page, this still occurs. It starts intermittenly in the first minute or so of page load


I always thought it meant sarcasm when someone wrapped quotation marks around a word.     "Thank you" for coming over...   That thank you now was said sarcastically and was a passive-aggressive way of saying that the writer wasn't truly thankful.   This morning I got a email sent to the entire office from my boss as such:     "Thank You" for your commitment, dedication and the support    Does it mean sarcasm or emphasis?

For example, is putting scare quotes around "scare quotes" appropriate?   says the term means usage of quote marks "to indicate that [a word or phrase] does not signify its literal or conventional meaning," which seems a bit off the mark.  Further on, the entry says "scare quotes may indicate that the writer does not accept the usage of the phrase (or the phrase itself), that the writer feels its use is potentially ironic, or that the writer feels it is a misnomer. This meaning may serve to distance the writer from the quoted content."  Better, but still offers minimal guidance on usage.    The question arose in my mind today when reading this phrase in the : "...said Vint Cerf, Google vice president and "'chief internet evangelist.'"  I'll admit the title is a bit odd, but it's official (even capitalized) .  In this case the usage of scare quotes seems off base.


I am using a similar format for a trigger and helper class.  Can anyone help me with a test class? Trigger Trigger TestOrders on Order (Before Insert)  {     IF(Trigger.IsBefore)     {         IF(Trigger.IsInsert)         {             OrderTriggerHelper.UpdateAccount(Trigger.New);         }     } }    Trigger Class Public Class OrderTriggerHelper {     Public Static Void UpdateAccount(List<Order> OrderIds)     {         List<Account> AccList = [Select Id,Ship_To_Code__c from Account where Ship_To_Code__c != NULL];          IF(AccList != NULL)         {             FOR(Account A : AccList)             {                 FOR(Order O : OrderIds)                 {                     //To check the Case-sensitivity.                     String S1 = A.Ship_To_Code__c;                     String S2 = O.Ship_to_code_del__c;                     IF(S1.Equals(S2))                     {                         O.SFDC_Account_Name__c = A.Id;                     }                 }             }         }     } }

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How do I start writing my first unit test?  How do I unit test this code?  I need help writing this unit test.   Salesforce Stack Exchange looks for detailed, specific questions that the community can help you with, and can't write tests on your behalf. We feel that working with the resources below can help you get started, and we encourage you to make an attempt to write your test and return to SFSE with your specific questions when you encounter challenges you can't resolve.


While studying linear transformations I came across the term dual space. I do understand what it is, but I don't understand why is it named so. Can somebody explain why it's called dual space?

Basically, why is a dual vector space called as such? Is the reason for the term "dual" simply because the two vector spaces are related by a one-to-one mapping, or is there something more to it?  Sorry for such a basic question, but I've never been able to find a definitive answer so far.


I need a float or integer, not exactly generated but picked randomly.   Do I need to use and import math.random class?  For example I have 3 integers : 1, 6 and 3. I want one of them to be picked randomly.

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


How do I make this map remove those lines and just view the map as one?   What I mean is I wanted to remove those lines so that the outcome will just be a plain map without those lines.

In the past I have just manually matched the color of the border to the color of the fill, but this can be time consuming.   I am wondering, is there any way to have the program automatically match the border color to that of the fill?   The fill color is being assigned through the styling tab in layer properties.  Using QGIS 2.8.6


I'm having difficulty with specifying PS1 on Ubuntu 18.04.5. I use the following code in my .bashrc file and the result looks exactly as it should. export PS1=$'\e[38;5;046m \u00AB\D{%y-%m-%d}\u00BB-[\D{%H:%M:%S}]-{\W}\e[1m\e[38;5;196m>\e[38;5;226m>\e[38;5;046m>\e[38;5;255m\e[0m '   The problem is that my cursor is at the beginning of the command line and not after the >>>. Curiously, if I set my terminal to full screen, the cursor appears where it should. Is there an obvious error in my PS1 definition?

I have an issue where if I type in very long commands in bash the terminal will not render what I'm typing correctly. I'd expect that if I had a command like the following:  username@someserver ~/somepath $ ssh -i /path/to/private/key myusername@something.someserver.com  The command should render on two lines. Instead it will often wrap around and start writing over the top of my prompt, somewhat like this:  myreallylongusername@something.somelongserver.comh -i /path/to/private/key  If I decide to go back and change some argument there's no telling where the cursor will show up, sometimes in the middle of the prompt, but usually on the line above where I'm typing.   Additional fun happens when when I Up to a previous command. I've tried this in both gnome-terminal and terminator and on i3 and Cinnamon. Someone suggested it was my prompt, so here that is:  \[\033[01;32m\]\u:\[\033[01;34m\] \W\033[01;34m \$\[\033[00m\]  Ctrll, reset, and clear all do what they say, but when I type the command back in or Up the same things happens.  I checked and checkwinsize is enabled in bash. This happens on 80x24 and other window sizes.  Is this just something I learn to live with? Is there some piece of magic which I should know? I've settled for just using a really short prompt, but that doesn't fix the issue.


I'm testing an application which opens its own ports (acts as a server for these ports, hence listens at that ports) and where the same application connects to ports bound by other applications (acts as client for these ports).  I would like to get an overview as to which ports the application creates and to which applications and ports it connects to.  How can I do this?

I'd like to be able to find out which process is currently using a certain port in Linux. Is there any way to do this?


I want to create a presentation in beamer. Like  question, I want to have two logos in opposite side on beamer, but my template have sidebar too. I also used  question to prevent logo from title page in beamer class. But the problem is one of the logos goes out of the slide.  I tried \centering command then add space between logos, so they get set on opposite sides but it didn't help. I think one possible solution is using PGF package, but that is my last resort.  \documentclass{beamer} \usetheme{Berkeley}  \logo{%   \makebox[0.2\paperwidth]{%     \includegraphics[width=1cm,keepaspectratio]{example-image-a}%     \hfill%     \includegraphics[width=1cm,keepaspectratio]{example-image-b}%   }% }  \title{The Title} \author{The Author} \institute{The Institute}  \begin{document}  { \setbeamertemplate{logo}{} \begin{frame} \maketitle \end{frame} }  \begin{frame} test \end{frame}  \end{document}   What I want is something like this.

I have a beamer presentation and use the PaloAlto theme. As you can see in the code sample I have two logos over each other. I'd like to place one on the left hand and the other on the right side. Would please help?  \logo{\includegraphics[height=0.8cm]{images/city_magazine_custom_logo}\hspace{-60pt}   \includegraphics[height=0.8cm]{images/ses50}\hspace{-10pt}   }


Let $X,Y$ be some invertible positive definite matrices such that $X>Y>0$, how do we prove that $Y^{-1}>X^{-1}>0$?  Any hint is greatly appreciated! I just need some initial directions.  Thanks a lot!!

Assume that $\mathbf{A}$, $\mathbf{B}$, and $\mathbf{A-B}$ are all positive definite Hermitian symmetric matrices of same dimensions. Prove that $\mathbf{B}^{-1}-\mathbf{A}^{-1}$ is positive definite.


I have this entry in bibtex:  @misc{ GNUCFLOW,    author = {{GNU cflow}},    title = "GNU cflow Documentation",    year = "2014",    howpublished = "http://www.gnu.org/software/cflow/"  }   I want to keep the title: "GNU cflow Documentation" as it on the pdf produce but this print:  [GNU cflow, 2014] GNU cflow (2014). Gnu cflow documentation. http ://www.gnu.org/software/cflow/.   It's possible to have this or not?

Titles of articles I'm about to cite contain upper case letters and when using BibTeX it converts them to lower case ones. This happens only in the title and only the first letter conserves its case. For example, when I cite an article about HF, the reader won't know if it is about Hafnium (Hf) or fluorine acid (HF).  I know that I can fix it manually in the .bbl file but I would like to avoid it, or fix it automatically.


I added an Image Field to my Node content type. Now, when I upload an image "image1.jpg" that is attached to a node mysite.com/note/123, I want the uploaded image's path to be mysite.com/node/123/image1.jpg. How do I achieve this? I've tried to change the subfolder of the image with a token. I used the token [current-page:path], but that doesn't return the node where I'm attaching to, but the last page that was visited. (Which might be the node edit form or something completely different with ajax, say)

how do I upload images (Media) to specific folders inside the default directory? I will have thousands of pictures and would like to have an organized structure of folders.  Thanks a lot.


I'm using Mail.app in Mac OS X 10.11 (Yosemite).  I would like for messages I compose to appear in the new, lovely, San Francisco font. I cannot seem to make that happen because neither "System Font" or "San Francisco" are available in the OS X Font chooser.  Is there a way to make this font available for message composition?

I thought the new Apple font was called San Francisco, but I cannot find it in the font list of the Keynote.app for my Mac. Is it called another way or it is not available for Keynote?  I am currently using OS X El Capitan.


Actually I'm facing the problem while I fetch data from my database on localhost. The database contain lines with special characters.  Such as - "You've done a Good Job".  But when I fetch the data using echo $row['lines']; it comes with "You?ve done a Good Job".  Anyone please help me how to overcome with this issue.

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


I would like to have very big (terabytes) drive, available both under Windows and Linux, readable, writable. I don't need permissions support on this drive.  How to do that? Which filesystem format satisfies these requirements?

What USB drive filesystem works out of the box on Windows, Linux, and OS X so that, when I give a 64GB USB drive to my dad, I don't have to tell him to first type in sudo apt-get install exfat-fuse exfat-utils ntfs-3g in the terminal, for example?


Is there any way to re-position the toolbar on the left of the screen to the right? (Sorry I don't know the official name, it looks like attached image) It seems it's possible in 2.83 according to this , but in 2.9 I can't find the "flip region" command. Any ideas?

When I bring up the Properties Shelf (hotkey N) in 2.8, it appears aligned to the left side of my 3d viewport. Youtube tutorial videos I am watching show the Properties Shelf on the right side of the 3d viewport.  I have searched the Blender documentation, Google, Blenderartists, and I cannot find anywhere that shows how to realign this shelf to the right side!    How do I move the Properties shelf to the right side of thew viewport?


I would like to confirm  my answers for these questions before carrying out with more studying--since there are no answers, and I'm worried I will be practicing incorrectly.  Let F(x)="x is friendly", T(x)="x is tall" and A(x)="x is angry" note: ~ = negation  Ex 1. Some people are not angry  My answer:  ∃x~A(x)  Ex 2. All tall people are friendly  My answer: ∀xT(x) -> F(x)  Ex 3. No friendly people are angry  My answer: ∀xF(x) -> ~ A(x)  I'm feel confident the answers are correct, but just in case.

suppose that the domain of variable x is the set of people, and f(x) = "x is friendly" , t(x)= "x is tall" and a(x) = "x is angry". Write the statement using these predicates and any needed quantifiers.  1) some people are not angry  2) all tall people are friendly  3) No friendly people are angry  My solutions:  1) $∃x\sim A(x)$  2) $∀xF(x)$  3) $\sim ∀x A(x)$  I'd like to know if my answers are right or wrong.


I have been testing the ionice command for a while and the idle (3) mode seems to be ignored in most cases.  My test is to run both command at the same time:   du <big folder> ionice -c 3 du <another big folder>   If I check both process in iotop I see no difference in the percentage of io utilization for each process.  To provide more information about the CFQ scheduler I'm using a 3.5.0 linux kernel.  I started doing this test because I'm experimenting a system lag each time a daily cron job updatedb.mlocate is executed in my Ubuntu 12.10 machine.  If you check the /etc/cron.daily/mlocate file you realize that the command is executed like:  /usr/bin/ionice -c3 /usr/bin/updatedb.mlocate  Also, the funny thing is that whenever my system for some reason starts using swap memory, the updatedb.mlocate io process is been scheduled faster than kswapd0 process, and then my system gets stuck.  Some suggestion?  References:

System is Ubuntu 10 LTS 64bit (2.6.35.31), I'm running on xen 4.0, no services active, cron stopped, scheduler is cfq for the disk /usr is mounted from:  time find /usr -exec stat {} \; > /dev/null 2>&1 &  giving  real    0m35.760s user    0m0.270s sys 0m3.910s   and  time ionice -c3 find /usr -exec stat {} \; > /dev/null 2>&1 &  giving  real    0m36.110s user    0m0.310s sys 0m4.100s   which is exactly as expected, now I run both at the same time:  time find /usr -exec stat {} \; > /dev/null 2>&1 & time ionice -c3 find /usr -exec stat {} \; > /dev/null 2>&1 &  where to my believe the ioniced version should be much slower while the straight version should be as fast as if running alone. but:  straight:  real    1m10.430s user    0m0.320s sys 0m3.940s   ioniced:  real    1m10.230s user    0m0.250s sys 0m4.020s   which implies that ionice did not work at all. Any hints?