Getting path of project, or layer file in PyQGIS?

I am generating new raster files from vector layers on a project. I would like to save them in the same directory as the project or layer files.   How do I find this path using PyQGIS?


Direct Speech: the subordinator "that" before the reported clause

I've been taught that in "Reported Speech", the subordinator "that" is a signature of "indirect speech". For example: He said, "I will be late." (Direct Speech) He said that he would be late. (Indirect Speech) But, it is wrong to say or write that: He said that, "I will be late." (Wrong!) However, I occasionally see counterexamples such as this Wikipedia Article:  In 2000, Robert Scheer created the website New Age Journal, which states that "We are not affiliated with any magazines printed on paper." ()  Is this a correct usage of the conjunction "that" in Direct Speech? Does it depend on the reporting verb and with some verbs, such as "to state", we can use the conjunction "that"?


How to refer to labels in other documents?

I have two documents file1.tex and file2.tex in two different folds fold1 and fold2, which are in the fold father.  In file1, I defined \label{file1:hello}, how do I use it in file2?


I read that if we take $f: \mathbb{R} \to (0, +\infty)$, such that for all $a \in \mathbb{R}$, $x \mapsto e^{ax}f(x)$ is convex then $f$ is log-convex (meaning $\log \circ f$ is convex). I did try to prove it, but I couldn't get to the result. However, I also read that if for all $a \in \mathbb{R}$, $x \mapsto e^{ax}f(x)$ is convex then $x \mapsto (f(x))^{a}$ is convex for all $a > 0$. I couldn't find a proof either ... But I managed to prove that if this last condition is verified, then $f$ is log convex. Therefore could you please help me prove one of these two statements (either the first one, which is in fact the result I want in the end, or the second one, which could lead me to the first result) ? Thank you.


Update a question or post a new question?

The question I posted earlier wasn't clear and I was myself un-aware of the exact problem so I didn't get any responses. After a while I was able to figure out the problem (but still looking for a solution) so I edited the question (it's almost a different question now) and I think the updated question makes much more sense for someone who could answer it.  This is the question:    But, I'm not sure whether updating a question is able to attract people's attention again. So, is it better to post a new one (and may be delete the old one?)


How to restore hundreds of GB database present on SQL Server 2014 to SQL Server 2008 R2

I know that this was not possible as a scenario for SQL Server 2012 -> 2008 but I wonder if MS made any changes here with the 2014 version.  We have SQL Server 2014 version with a fairly large database, We’d like to restore a backup of that database to SQL Server 2008 R2 because that physical machine has more space, RAM,…  I’m getting standard error message when I try to restore backup but I was wondering if there is something else in SQL Server 2014 that I might be missing.  Also, are there any tools like Redgate/SQLSentry that will be of any use while working with databases size of hundreds of GB size?


while creating a script I am facing currently a "strange" issue that so far I am unable to fix.  typeset -r SERVICE=\"ldap://localhost:10389\ ldaps://solsrv02.internal.vbox:10689\ ldaps://solsrv02.prod.internal.vbox:10689\" SLAPD="/usr/lib/slapd -u ${LDAPUSR} -g ${LDAPGRP} -h ${SERVICE} -F ${CONF_DIR}"   Currently the variable assignment is like above and when I echo the SLAPD it works like a charm. but when I execute the command : Echo output    /usr/lib/slapd -u openldap -g openldap -h "ldap://localhost:10389 ldaps://solsrv02.internal.vbox:10689 ldaps://solsrv02.prod.internal.vbox:10689" -F /etc/openldap/standalone   Debug output   + [[ ! -d /var/openldap/run ]] + /bin/rm -f /var/openldap/run/slapd.pid + /usr/lib/slapd -u openldap -g openldap -h '"ldap://localhost:10389' ldaps://solsrv02.internal.vbox:10689 'ldaps://solsrv02.prod.internal.vbox:10689"' -F /etc/openldap/standalone   So, my issue now, is that openldap command line forces me to have -h "URLs" and adding then to the variable it takes the variable as 3 parameters instead of a single as I wish.  I have tried to backspace the quotes but it expands to 3 single quotes. If I just copy the output of echo and paste it on the script it works. but this has the downside that I cannot customize using variables.  all the variables have been set with typeset -r  UPDATE 1  Based on the given answer by cas, I updated my code but still facing the same issue:     #!/usr/bin/bash echo $SHELL typeset -r SLAPD=/usr/lib/slapd typeset -r LDAPUSR=openldap typeset -r LDAPGRP=openldap typeset -r VARRUNDIR=/var/openldap/run typeset -r PIDFILE=${VARRUNDIR}/slapd.pid typeset -r CONF_DIR=/etc/openldap/standalone typeset -r SERVICE=(ldap://localhost:10389 ldaps://solsrv02.internal.vbox:10689 ldaps://solsrv02.prod.internal.vbox:10689) SLAPARGS=" -u ${LDAPUSR}" SLAPARGS+=" -g ${LDAPGRP}" SLAPARGS+=" -F ${CONF_DIR}" SLAPARGS+=" -h " SIZE=${#SERVICE[@]}  #for i in {1..${#SERVICE[@]}$}; do SLAPARGS+="'" for ((i=0;i<$SIZE;i=$i+1)); do         SLAPARGS+="${SERVICE[$i]} " done SLAPARGS+="'" [[ ! -d ${CONF_DIR} ]] && exit $SMF_EXIT_ERR_CONFIG  echo "$SLAPD $SLAPARGS" set -x $SLAPD $SLAPARGS 2>&1   the output is this:  /usr/bin/bash /usr/lib/slapd  -u openldap -g openldap -F /etc/openldap/standalone -h 'ldap://localhost:10389 ldaps://solsrv02.internal.vbox:10689 ldaps://solsrv02.prod.internal.vbox:10689 ' + [[ ! -d /var/openldap/run ]] + /bin/rm -f /var/openldap/run/slapd.pid + /usr/lib/slapd -u openldap -g openldap -F /etc/openldap/standalone -h ''\''ldap://localhost:10389' ldaps://solsrv02.internal.vbox:10689 ldaps://solsrv02.prod.internal.vbox:10689 ''\'''   Bash version is 4.1.17


Find the remainder of the division of 1112131 41516171819 by 99 . (b) Find the remainder 111213141516171819 by 101  For a) I think I just need to sum up two digit such as  135 mod 99 =36 b.) sum up three digit each such as 1971 mod 101 then can i sum 197+1 mod 101?   Is this right?


Safari web browser will NOT perform Asynchronous Automatic Refresh. Rather it will do a full page reload

I have added an announcement web App, to SP2013 my team site, and for the App part Ajax option I enabled the following:-   Enable Asynchronous Update Show Manual Refresh Button Enable Asynchronous Automatic Refresh Automatic Refreshing Interval (seconds) = 60.   But on Safari after 60 seconds or when the user manually clicks on the “Refresh” button,  the current web page will do a full reload and not an asynchronous reload. While on IE, FireFox and Chrome they will do asynchronous reload. can anyone advice ?


while run JUNit test in shows NullPointerException.. but my code is completely error free

java.lang.NullPointerException    at   com.Accounts.Account.deposit(Account.java:14)     at   feature.PrintStatementFeature.print_statement_containing_all_transactions(PrintStatementFeature.java:30)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at   sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)   at   sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)   at   java.lang.reflect.Method.invoke(Unknown Source)   at   org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)     at   org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)     at   org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)     at   org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)     at   org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)    at   org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)     at   org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)  at   org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)   at   org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)     at   org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)   at   org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)  at   org.junit.runners.ParentRunner.run(ParentRunner.java:363)     at   org.mockito.internal.runners.DefaultInternalRunner$1.run(DefaultInternalRunner.java:68)     at   org.mockito.internal.runners.DefaultInternalRunner.run(DefaultInternalRunner.java:74)     at   org.mockito.internal.runners.StrictRunner.run(StrictRunner.java:39)     at   org.mockito.junit.MockitoJUnitRunner.run(MockitoJUnitRunner.java:161)     at   org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)     at   org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)     at   org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)     at   org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)     at   org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)     at   org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)   My Code is this package feature;  @RunWith(MockitoJUnitRunner.class) public class PrintStatementFeature {      @Mock Console console;       private Account account;      @Before      public void initialise() {         TransactionRepository transactionRepository = new TransactionRepository();         account = new Account(transactionRepository); //now create its local variable.     }      @Test public void        print_statement_containing_all_transactions ()     {         account.deposit(1000);         account.withdraw(100);         account.deposit(500);          account.printStatement();          InOrder inOrder = inOrder(console);          inOrder.verify(console).printLine("DATE.........|...AMOUNT...|...BALANCE... ");         inOrder.verify(console).printLine("17/04/2015...|....500.....|.....1400.... ");         inOrder.verify(console).printLine("15/04/2015...|...-100.....|.....1400.... ");         inOrder.verify(console).printLine("10/04/2015...|....1000....|.....1500.... ");     }   }


How do I go inside the locked building in Snowdin?

Is there a way to enter the locked building beside Sans' and Papyrus' house in Snowdin? If yes, how so?


Is there a way to hide a Folder on the Desktop without '.dot' naming?

I'm wondering if it's possible to hide a folder without renaming it with a dot on the Desktop.  Ubuntu 12.04  Thanks


Retrieving contacts from Android phone (Sony Xperia Z)

My Xperia Z recently suffered from a broken screen and is now not functional at all. YOu can see the screen, but the touch facility has completely gone. I can't even turn the thing off.  I have a really cheap alternate phone that I would like to use temporarily but I could do with getting the contacts from the Xperia, on to my SIM card, then in to this cheap phone.  This alternate phone I have has no functionality which will allow it to connect to a PC, so I need to get the contacts on to the SIM via other methods.  A couple of methods I have been thinking about, but don't know if they are possible or not are:   Connect the Xperia to my PC and some how manually move the contacts from the phone to the SIM (I am not even going to be able to enable USB Debugging so I doubt there will be a lot I can do with the phone connected to the PC except explore the files). Move the contacts from the phone on to the PC, then some how store the contacts on to my friend's phone (Samsung S3 Mini), and copy them to the original SIM from there? (I have no idea of how contacts are formatted so unsure whether or not they could just be moved from Sony to a Samsung so simply).   They are the 2 main thought processes I have - any feed back on whether these are possible would be greatly appreciated as there are some very important numbers on this Xperia that I need for work!  Thanks in advance (Apologies if this is in the wrong section, or doesn't necessarily class as an Android issue!)  UPDATE: Seems I can't use adb Shell due to USB debugging being disabled and Screencast is a no go due to the phone not being rooted.  I can see files within the Internal Storage such as .anchor, Alarms, Albums), is there a particular file within these subfolders which may contain the contacts which coul potentially be read? Even if I had to manually enter the numbers in to another phone, that wouldn't be so bad!


I'm trying to insert into a table that is joined in my c# program, I'm having an issue with the below SQL statement on SQL Server:  INSERT INTO DartBox (DartBoxNumber, ReturnDate, Comments, SerialSDD) VALUES (1, 2, 3, 4)  SELECT d.DartBoxNumber, d.ReturnDate, d.Comments, s.SerialSDD FROM DartBox d  LEFT JOIN DartBoxSerials s ON d.DartBoxID = s.DartBoxReturnID   I want to insert data into two tables at once, there is a relationship between DartBox and DartBoxSerials (there can be many serials in the dartbox)  When I try and run the query in SQL I get:     Invalid column name 'SerialSDD'.   It does exist in the joined output though.  Any assistance would be great?  This worked using the link below and this is how to do it: (I've removed the date bit due to a type mismatch)  BEGIN TRANSACTION DECLARE @DataID int; INSERT INTO DartBox (DartBoxNumber, Comments) VALUES (1, 3) SELECT @DataID = scope_identity(); INSERT INTO DartBoxSerials (DartBoxReturnID, SerialSDD) VALUES (@DataID, 4); COMMIT


How do I gradient shade the background of a beamer section/subsection in head/foot?

Here is a reduced example of my code.  I am attempting to restyle the background of the section in head/foot and subsection in head/foot in the CambridgeUS theme to a gradient background colour.  Right now the gradient background works if I were to specify say beamer@frametitleshade in my pgf declaration.  I can't find and can't guess the correct keywords to get this to affect the background of the section in head/foot nor the subsection in head/foot, I've tried things like sectioninheadfootshade and variants.    \documentclass[hyperref={pdftex}]{beamer} \useoutertheme{shadow} \definecolor {Burgandy}{HTML}{660033} \definecolor {Crimson}{HTML}{990033} \definecolor {Orange}{HTML}{ff9933}  \usetheme{CambridgeUS}  \colorlet{titleleft}{Burgandy} \colorlet{titlemiddle}{Crimson} \colorlet{titleright}{Orange}  \pgfdeclarehorizontalshading[titleleft,titlemiddle,titleright]       {beamer@frametitleshade}{\paperheight}{     color(0pt)=(titleleft);     color(0.6\paperwidth)=(titlemiddle);     color(\paperwidth)=(titleright)   }  \title[Short Title]{Long title} \subtitle{Sub title} \date{\today}  \begin{document}     \begin{titlepage}     \end{titlepage}      \begin{frame}{Slide 1}           Content     \end{frame} \end{document}


Use of the singular/plural in "there is a multitude"

I understand that "multitude" expresses a collective noun. While writing the sentence:  There is a multitude of articles and blog posts written on the topic,  the Google doc spellcheck flagged that I should instead use "there are a multitude" which seems wrong to me, given the word "multitude" is singular. However, I am not a native English speaker and I know I've stumbled onto counterintuitive things in the past about this topic (e.g. "the police are"), so I'm asking for the wisdom of the crowd.


How can I find the number of the shortest paths between two points on a 2D lattice grid?

How do you find the number of the shortest distances between two points on a grid where you can only move one unit up, down, left, or right? Is there a formula for this?  Eg. The shortest path between $(0,0)$ and $(1,1)$ can be $(0,0)\to (0,1)\to (1,1)$ or $(0,0)\to(1,0)\to(1,1)$, so there are two shortest paths.


I have a need to turn USB power off (and on) using a script or a piece of software. Ideally it should be possible to turn each port off/on separately, but also turning power off/on from all ports at once is sufficient. The machine I am using is Mac Mini. Anyone has a solution for this?  By USB power I mean Vbus, the 5V/500mA connection. I understand that the data connection is also turned down and it is fine, but it is not enough for me that the data connection is down and Vbus remains powered. This need comes from the need to keep mobile phones constantly connected for automatic testing. Some device/battery combinations do not like to be constantly connected and batteries start swelling in less than a year.  I recognize that multiple variations of this question are around. So far no solution that I could use. I'll list here my findings so far:   it is possible to accomplish this by using external self powered USB HUB and controlling it's power. However, this is not an option for me (even quality hubs have caused other problems in my use). it is possible to disable USB by removing .kext files. Among other sources it is explained in OS X . However this requires reboot and I am not sure if it really disables USB power or just data. there are many claims that it just is not possible. However, OS X itself does it when it detects a device that consumes too much power, so there is at least hardware support. This error message is copied from /System/Library/Extension/IOUSBFamily.kext/Contents/Resources/English.lproj/Localizable.strings: "Unplug the device using too much power to re-enable USB devices." (of course I don't know if the disabling is done by turning off USB power, but I would assume it is natural action for the device that consumes too much of it).  it seems that on macbook the USB ports are normally powered even when the laptop is sleeping. While  is not solving my issue, it is kind of related.   The reason why I need this is that I have a test system where multiple devices are plugged in to a mac mini. The devices also charge over USB. It has turned out that if the device is connected all the time to a charger, it's battery is swollen in about a year, which makes the device unusable, insecure and potentially dangerous. Turning the power off when not needed, would significantly extend devices life.


How do I calculate if two power adapters will output the same energy if they have different voltages?

I often face this question. A friend gives me a lot of used modems and routers, but they usually don't come with a power adapter.  Currently, I'm trying to use a router that is specified to work with a 12VDC/0.5A, but the only power supply I have that fits it is 5VDC/0.85A. And of course I could look for an appropriate adapter, but since I got a lot of 5V adapters, I'd like to try.  Thanks


So I know umask can restrict privileged users, using this format umask ugo.  I understand that the read = 4, write = 2, and exec = 1. However, when I type umask, it returns 4 digits which is 0022 or 0073. I have no understanding of how does this work now because there is an extra digit. What is that extra digit and what does 0022 mean?


Show that for all positive x $\in$ $\mathbb{R}$ the inequality $x+\frac {1} {x}\geq 2$ holds. (Hint?)

Show that for all positive x $\in$ $\mathbb{R}$ the inequality $x+\dfrac {1} {x}\geq 2$ holds. Can you give me a hint?


Generic Element of Compositum of Two Fields

I'm interested in understanding compositum of general fields better. Assume we have $\Omega/K/F$ and $\Omega/L/F$ field extensions, and consider the composite $KL$.   It seems to me that every $a \in KL$, exists $n_1,n_2 \in \mathbb{N}$, $ \left \lbrace k_i \right \rbrace_{i=1}^{n_1}, \left \lbrace k'_i \right \rbrace_{i=1}^{n_2} \subseteq K$ and $ \left \lbrace l_i \right \rbrace_{i=1}^{n_1}, \left \lbrace l'_i \right \rbrace_{i=1}^{n_2} \subseteq L$ such that: $$ a = \frac{\sum_{i=1}^{n_1} k_i l_i}{\sum_{j=1}^{n_2} k'_j l'_j} $$  (That is since the family of all such sums is closed under addition, multiplication, and distribution because of the abelian nature of fields, therefore all numbers of this form are subfields that contain both K and L)  Is it a correct way to refer to a compositum of fields? When is it correct that the general item of an extension is $a = \sum_{i=1}^{n} k_i l_i$?


Field of Fractions $F$ is a finitely generated $R$-module iff $F$ is equal to its integral domain

Given $R$ an integral domain with field of fractions $F$, I want to prove $F$ is a finitely generated $R$-module if and only if $R = F$.   For $(\Rightarrow)$: I tried to first define a generating set based on the definition i.e. finitely many $m_1,\dots,m_n$ such that $\sum_i Rm_i  = M$. Then somehow show every element in $R$ is invertible. From where $D=F$ but how...  For $(\Leftarrow)$: If $R = F$, I am not sure, but I know by definition, the embedding of $R$ in $F$ maps each $n \in R$ to the fraction $\frac{an}{a}$ for nonzero $a$ in $R$. In further details, I am a bit lost though.


Query Parent Accounts with its child accounts

How to find Accounts with no child Accounts? I tried Aggregate Query but its not returning proper result and inner query isn't supported for Self-Relation. Thoughts?


I attempt to write my edit summaries with the utmost care, but on occasion, I'll be moving to fix something else, and I'll end up with a messed up summary.  I have found that if I re-edit within a certain time frame, I can change the summary.  However, I'm wondering if there is a way that I'm not aware of to edit the editing summary without having to make any additional changes.  If there is, or if this feature could be added, the readers of millions of future "fixed spe" messages would thank you.  I did search a bit on this, but searching "editing of edits of edit summaries" confounded the works.


I am trying to down load to a memory stick ubuntu 12.04 32 bit version but only seem to be able to get the 13.10 version. I think I am following the make a bootable stick instructions correctly but the page that comes up is not like the screen shots in the instructions.


Can Current move without potential difference?

Consider the circuit given below, At the lower left corner of the circuit assume potential to be $0\ V$ , Now at the upper left corner current should be $9\ V$ and similarly at the upper right corner, According to Ohm's Law, as potential difference is $= 0$, there shouldn't be any flow of current, yet there exists conventional current in the circuit equal to $0.09$ Ampere , What is this fallacy? Please Highlight the fault in my approach.


What was that Sci-fi book mixing classic art and book excerpts to build a timeline of the universe?

I was 12 years old in 1988 and, that year, I spent most of my savings on a large format hardcover book where the authors attempted to tell the story of mankind's expansion in the universe.  They did that by taking characters, settings, technologies and plot devices from famous novels or pulps and juxtapose it with more or less random cover art. The result was extremelly well put together and -- at least to my young mind -- very convincing.  Needless to say, this book has been a kind of gateway drug for me.  Unfortunately, I lost this book about 15 years ago. I have no idea who were the author(s) or the editor(s).  Here is what I remember:   the book was written in French but I kind of remember that it was translated from the American the book measured about 30 cm x 40 cm it had one of those removable jacket that I lost quickly so I have no idea what it looked like the actual covers were blue-gray and off-white and represented a two tone space scene with no title all the art was in full colour most of the art came from sci-fi books but there was also Conan-type fantasy when they needed to illustrate a planet returned to barbary or whatever   That's it.  Do you know this book?


Finding predictors of upper level of a variable

I am analyzing data on a health variable and its relation to age, gender, height etc. I am more interested in 90th percentile of the health variable, which can be called upper limit of 'normal'. How will this analysis be different from regular analysis where one is trying to find out factors predicting the value of health variable?


Suppose that when $n=k$  $(k\geq4)$, we have that $k!>2^k$.  Now, we have to prove that $(k+1)!\geq2^{k+1}$ when $n=(k+1)$ $(k\geq4)$.  $$(k+1)! = (k+1)k! > (k+1)2^k  \text{ (since }k!>2^k)$$  That implies $(k+1)!>2^k2$, since $(k+1)>2$ because of $k$ is greater than or equal to 4.  Therefore $(k+1)!>2^{k+1}$  Finally  we may conclude that $n!>2^n$ for all integers $n\geq4$    Solved, thank you!


Writing a test class for an invocable method that combines the UTC dates of the beginning of the year and the current time

I built an apex class for an invocable method that runs from a flow to generate a link to authenticate a user to a community. The apex class updates a field on the contact record when the contact (a partner portal user) clicks the flow button and is linked then to a website. The class generates a code from the calculation of midnight at the start of the year, with the current time in GMT/UTC format. It's my first time in a while writing a test class so wanted to gather so insights.   global class PassKeyInvocable {   @invocableVariable(required=true)   global List<Contact> contactId;    //Gather the contact record Id from the user record. Just the first and only one. @InvocableMethod(label='The Users Contact Id' description='Get the users contact id')   global static void PassKey(List<Id> contactIds) {  id contactId = contactIds[0];      //calculate the passkey (an unique variable the vendor wants) by comparing the current  date/time with Janurary 1st of the current year in GMT // STATIC VALUES PROVIDED BY THE VENDOR Integer Offset = 43994; Integer Multiplier = 3290;           //Get the current time zone and establish the time zone offset      //Get the first day of the year in GMT DateTime oFirstYear = dateTime.newInstanceGMT(dateTime.now().year(), 1, 1, 0, 0, 0);           // get current GMT Time in UTC date/time DateTime oUTCDate = DateTime.newInstance(                                             System.now().year(),                                             System.now().month(),                                             System.now().day(),                                             System.now().hour(),                                             System.now().minute(),                                             System.now().second());      //get # hours elapsed since the start of the year   Long firstOfTheYear  = oFirstYear.getTime();   Long currentDateTime = oUTCDate.getTime();   Long milliseconds    = currentDateTime - firstOfTheYear;   Long seconds         = milliseconds/1000;   Long minutes         = seconds/60;   Long hours           = minutes/60;    Long Calculate = (Offset + hours) * Multiplier; String Passkey = String.valueOf(calculate);             //Gather contact Id from the user record (Invocable Flow requires a collection) and just          get the first value [0].        //Pass the passkey to the user's contact record, which the flow will append to the          destination url.     List<Contact> contactRecord = [Select Id FROM Contact WHERE Id =:contactId];      contact c = contactRecord[0];          c.Passkey__c = Passkey;     update c;     }              }


Two differently colored curves for CPU usage in Windows 10 Task Manager?

The windows 10 task manager suddenly shows two curves for CPU utilization, one light colored and one darker blue colored:   As far as I remember, it always used to show just one curve for current CPU utilization. What do the two curves mean? Which one should I trust to be correctly describing the resources spent on the current task?


How can I tell *tex commands from TeX Live 2013 that they should stop and exit when they detect an error instead of opening a command prompt?


In eclipse, if you have a .exe file in the package how would you run it? I know if it is outside you would just add in the path, but what would the path be for something inside the project?


I am developing an application in C and it must accept characters from every language. I am targeting Linux/Windows. What is the best way to implementing this, considering that performance is important in this case?


What is the maximum RAM that I can install on my Dell Inspiron One 2320

I have a Dell Inspiron One 2320 Machine whose owners manual officially states it can support a maximum of 8GB RAM. That information is also confirmed at the official Dell forum  My Computer Details OS I am running Windows 10 Pro Version 1607 x64 bit. Processor Intel(R) Core(TM) i5-2400S CPU @ 2.50GHz Code Name Sandy Bridge  Motherboard Dell Model 0XW3KG BIOS Dell A10 09/17/2012  Memory 2 x 4GB Kingston 800.0 MHz (DDR3-1600 / PC3-12800)   Graphics Card Intel HD Graphics 2000 Sandy Bridge GT1 and NVIDIA GeForce GT 525M GF108M Discrepancy Running this command in the terminal I get 32GB support C:\Windows\system32>wmic memphysical get maxcapacity MaxCapacity 33554432 => 32 GB   Therefore I'm suspicious. I've scoured the internet and other super user questions and what I have gathered is that maximum ram capacity practically possible not only is dependent on the manufacturer's specification or output of the command but on various other factors like motherboard, processor etc therefore I have provided all the details above. I cannot come to any conclusion based on my research. I have not ordered any RAM hitherto but would love to upgrade if I can/possible because it is a definite need for me as I'm struggling with 8GB ( Hint -> I produce video content ) Please help. Thank you in advance for your time.


Best way to prevent Google from indexing a directory

I've researched many methods on how to prevent Google/other search engines from crawling a specific directory. The two most popular ones I've seen are:   Adding it into the robots.txt file: Disallow: /directory/  Adding a meta tag: <meta name="robots" content="noindex, nofollow">   Which method would work the best? I want this directory to remain "invisible" from search engines so it does not affect any of my site's ranking.  In other words, I want this directory to be neutral/invisible and "just there." I don't want it to affect any ranking. Which method would be the best to achieve this?


Is it possible to play Minecraft Java edition with someone from a different area on a private server?

I'm trying to invite an online friend of mine to my private server, and they couldn't join while they're screen says "Unknown Host". Does it have to do with distance or am I doing something wrong?


How do I get a list of installed files from a package?

I want to know where I can find my installed application when I installed it on Ubuntu using package manager.  I installed RabbitMQ and ran locate rabbitmq which gave me following result:  /home/anupamg/.m2/repository/com/rabbitmq /home/anupamg/.m2/repository/com/rabbitmq/amqp-client /home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2 /home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/_maven.repositories /home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/amqp-client-1.7.2.jar /home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/amqp-client-1.7.2.jar.lastUpdated /home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/amqp-client-1.7.2.jar.sha1 /home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/amqp-client-1.7.2.pom /home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/amqp-client-1.7.2.pom.lastUpdated /home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/amqp-client-1.7.2.pom.sha1 /home/anupamg/Downloads/rabbitmq-server-generic-unix-2.4.0.tar.gz


Is there any possibility that gender is determined by Temperature?

One day I was watching TV show. It was based on Fire Dragon. They stated that if the dragon provide greater warmth to the egg, then a male Dragon will hatch. And if the Dragon provide less warmth to the egg it will be female Dragon.  This was totally Science Fiction!!   But is there any possibility that, the Temperature decides the Gender of progeny.


Evaluating the sum of $\sum_{k=0}^n \binom{n}{k}^2$

I don't know if this question is trivial but let me put it in the first place.  I'm trying to find the sum of $\binom{n}{0}^2+\binom{n}{1}^2+\binom{n}{2}^2+\cdots+\binom{n}{n-1}^2+\binom{n}{n}^2$ or equivalently $\displaystyle \sum_{k=0}^n \binom{n}{k}^2$.  How would you proceed?


I am trying to implement my own use of bit flags in C/C++. I have three functions: getBool, setBool, and printBools. All of my current code except one part: I can't set bits to false. They set to true just fine, they read back just fine, but I can't set true bits to false. Here is my code:  #include <iostream>  #define uint unsigned int #define BIT1 1 #define BIT2 2 #define BIT3 4 #define BIT4 8 #define TRUE 1 #define true 1 #define FALSE 0 #define false 0  int getBool(uint boolSet, uint bit){     return ((boolSet&bit)==bit); }  void setBool(uint &boolSet, uint bit, short tf){     if(getBool(boolSet, bit)) return;     else if(tf == 1) boolSet += bit;     else if(tf == 0) boolSet -= bit; }  void printBools(uint boolSet, uint j){     uint i = 1, count = 1;     while(count <= j){         std::cout<<"Bool "<<count<<": "<<getBool(boolSet, i)<<std::endl;         i*=2;         count++;     } }  int main(){     uint boolSet = 0;     printBools(boolSet, 4); //make sure bits are false     setBool(boolSet, BIT1, 1); //set bit 1 to true     setBool(boolSet, BIT3, 1); //set bit 3 to true     printBools(boolSet, 4); //check set bits     setBool(boolSet, BIT3, 0); //set bit 3 to false     setBool(boolSet, BIT4, 1); //set bit 4 to true     printBools(boolSet, 4); //check set bits }   Additionally, if you would like to see the output really quickly, here is a link:  Thank you for your help!


How can I overcome the issue I'm having with the chart below:    \begin{figure}[h!] \centering \caption{\label{tab:kdd99chartProt}Attack representation per protocol within     KDD99 10\% dataset}  \begin{tikzpicture} \begin{axis}[ ybar stacked, ymin=0,   bar shift=0pt, ymajorgrids, bar width=30pt, ylabel=Representation in \%, width=250pt, symbolic x coords={TCP,UDP,ICMP}, legend pos=outer north east, xtick=data, ymax=85, nodes near coords={\pgfmathprintnumber\pgfplotspointmeta \%} ]  \addplot [black,fill=bblue,mark=none] coordinates { ({TCP},23) ({UDP},0.2) ({ICMP},57)};  \addplot [black,fill=rred,mark=none] coordinates { ({TCP},16) ({UDP},4) ({ICMP},0.2)}; \legend{Attack,Normal} \end{axis} \end{tikzpicture} \end{figure}


$U$ is convex, $f\in H(U)$ and $|f'(z)-1|<1, \forall z\in U$ then $f $ is one-one function

The hint is to use Fundamental theorem of calculus to the function, $1-(f'(z)-1)$. Can someone help me to solve this using this hint?


I'm new to Visual Studio C# and I've created my first DLL. I'm referencing this DLL within a web application.  In my code throughout numerous classes within the DLL and even in the controller classes of my web application, I make use of Console.WriteLine(...) to help with troubleshooting.  I fully expected those messages to be output to the console at runtime, but they aren't showing up.  For example here is some code from a class that is attempting to access a MySQL database, and before I execute the query, I attempt to write the query string to the console:  MySqlCommand cmd = null; MySqlDataReader rdr = null; MySqlCommand cmd2 = null;          try{         Console.WriteLine("query: " + query.ToString());         cmd = new MySqlCommand(query.ToString(), conn);         rdr = cmd.ExecuteReader();          ... }   In Visual Studio, during project execution time, I've looked at the Immediate Window, the Output, Locals, Call Stack windows.    Where are my writeline messages?


What's the difference in meaning between infinitive and gerund?

(1) They love to walk in the woods.   (Angela Downing, English Grammar: A University Course)        (2) They love walking in the woods.   She says (1) will be interpreted as potential, while a gerund means actual or habitual. But, in fact, they seem to be very similar. How do I understand the difference in meaning?


Proper ideal containing power of maximal ideal is primary?

In Eisenbud's Commutative Algebra, Chapter 3.9, it says,  "If $P$ is a maximal ideal of $R$ and $I$ is any proper ideal containing a power of $P$, then $I$ is $P$-primary: For in this case $P$ is the only prime containing the annihilator $I$ of $R/I$."  If the power $n$ is 1, it's trivial by definition, but for $n>1$ I don't see why this is true. First why $P^n\subseteq I$  implies $I\subseteq P$? And since $R$ is not necessarily local ring, why it's not possible that there is another maximal ideal $Q$ so that $P^n\subseteq I \subseteq Q$ for $n>1$?


I recently purchased a Pipo m8 Pro () and would like to know if i can install ubuntu for tab.   If i can, can you also advice how i should install it.   thanks,  Faazil


Null Object Reference error when adding refresh listener to SwipeRefreshLayout for a WebView

When I add this line of code   swipeLayout.setOnRefreshListener(this);   I get this error  void android.support.v4.widget.SwipeRefreshLayout.setOnRefreshListener (android.support.v4.widget.SwipeRefreshLayout$OnRefreshListener)' on a null object reference   MainActivity  import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.view.KeyEvent; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.support.v4.widget.SwipeRefreshLayout;  public class MainActivity extends Activity implements SwipeRefreshLayout.OnRefreshListener {     private WebView mWebView;     private SwipeRefreshLayout swipeLayout;      @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         getWindow().requestFeature(Window.FEATURE_NO_TITLE);         setContentView(R.layout.main);         mWebView = new WebView(this);          mWebView.loadUrl("https://secure.tickspot.com");         mWebView.setWebViewClient(new WebViewClient() {             @Override             public boolean shouldOverrideUrlLoading(WebView view, String url) {                 view.loadUrl(url);                 return true;             }         });          WebSettings webSettings = mWebView.getSettings();         webSettings.setJavaScriptEnabled(true);          swipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container);         swipeLayout.setOnRefreshListener(this);     }      @Override     public boolean onKeyDown(final int keyCode, final KeyEvent event) {         if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {             mWebView.goBack();             return true;         }         return super.onKeyDown(keyCode, event);     }      @Override     public void onRefresh() {         mWebView.reload();         new Handler().postDelayed(new Runnable() {             @Override             public void run() {                 swipeLayout.setRefreshing(false);             }         }, 1000);     }  }   AndroidManifest.xml  <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.mkyong.android"     android:versionCode="1"     android:versionName="1.0" >     <uses-sdk android:minSdkVersion="12" />     <uses-permission android:name="android.permission.INTERNET" />     <application         android:hardwareAccelerated="true"         android:icon="@drawable/ic_launcher"         android:label="@string/app_name" >         <activity             android:label="@string/app_name"             android:id="@+id/main_activity"             android:name=".MainActivity" >             <intent-filter >                 <action android:name="android.intent.action.MAIN" />                 <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>     </application> </manifest>   Im new to android development and am having trouble understanding the error messages. HELP! If I'm doing anything else wrong, I would love that feedback too :)  EDIT  I moved the swipe refresh layout code to   layout/main.xml  <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/swipe_container"     android:layout_width="fill_parent"     android:layout_height="fill_parent" > </android.support.v4.widget.SwipeRefreshLayout>


I need help understanding how these put options work!

I purchased seven May 8th $83 put contracts  for 88 cents each for a cost of $616. The current market value is $88. From what I understand, that is out-of-the-money and I would not want to sell because I would be losing money, correct?   Do I just let them expire? Is my premium the $616 that I will be out at expiration? Should I sell it before it expires?   Can I be forced to pay the full price of $58k for all 700 shares?  If not,  what is the worst case scenario?   I did not understand what I was getting into when I bought this so lesson learned the hard way.


which of these two phrases is correct?  A - The man, WHOM from now on we will refer to as Jim, approaches the table and stands next to the lady.   B - The man, WHO from now on we will refer to as Jim, approaches the table and stands next to the lady.   None of my native English speaker friends do not agree on which one is correct.  Thanks.


What is correct sentence to ask, How much money or how many money?

What is correct sentence to ask,    How much money How many money  How many dollars   In case of singular noun we use much, but is money singular? I'm a bit confused need help here.


I have just finished my second all grain brew.  I failed to mash out and went straight from the mash to boil.  What difference will this make to my beer?


where to submit feature ideas when brainstorm.ubuntu. is dead

I had an idea/feature suggest to make for Ubuntu. But, as I found out, the site is dead. See: .  Question: Where can i make a feature suggest/idea now that brainstorm.ubuntu is no more.


The "Birthday Problem" generalized to continuous time rather than days

In the original “Birthday Problem”, the year is divided into 365 discrete days, and a “collision” is defined as being born on the same calendar day. Using this definition, two people can be born two minutes apart, but this will not be called a collision because one was born before midnight and the other after midnight. My question is: If we define a collision as being born less than 24 hours apart (possibly in different years), what is the probability of no collisions in a group of m people? I am assuming that the time of birth T (measured in days) is a continuous random variable with a uniform distribution between 0 and 366 (366 is actually 0 for the next year). Clearly an upper limit on this probability is the classic solution for the birthday problem. Can a lower limit be found? Maybe an approximation? Of course I can try simulation, but an analytic solution is better since it can be applied to several engineering problems such as the occurrence of defects on a camera sensor, which cause the picture to be blurred if they happen to be too close together (this is actually the problem I am interested in solving – if there are m randomly distributed defects, what is the probability that no two are close together).


Check if internet connection is providing a dynamic or static IP in OSX

Is there a way to check if my internet connection is with a dynamic or static IP? I'm running OSX.


Does javascript pass functions by value or by reference?

Javascript passes primitive values by value and objects by value or reference (depends). So how does javascript pass functions around?  mercury=()=>{  console.log("eleven") } let eleven = mercury eleven();   so when i pass the function mercury to eleven, is the function passed by value or by reference?


Is 'the' necessary when a noun is explained in a same sentence?

I know that definite article is used when a noun is already known in the context.  But I'm not sure with the usage of definite article when I described something explicitly but it hasn't been mentioned before.  So here's my example.  'I believe children are used to listening to the type of music that celebrities promote their life styles'  In the sentence, 'the type of music' was not mentioned before, however I described what type of music it is in the sentence. Also it sounds more comfortable with the article.  Is the article used right? or should it be just 'a type of music'?  Thanks for reading my question.


What is the difference between:  ./script.sh "$VARIABLE"   and  ./script.sh ${VARIABLE}   Is there any?


Help I screwed up APFS Mojave partition FFFFFF error

Apologies for the photo but I couldn't copy/paste because my mac is in recovery mode  Basically what I did was have Windows and Debian installed alongside encrypted OSX but this morning I was desperate for space and the other operating systems were hardly used on this machine so I used the bootcamp tool to try and delete windows and regain the extra space. The tool then gave an error but it looked liked windows had been removed so I went to the disk utility and  deleted any other partitions including the linux swap with the intent of merging them all manually. I then rebooted the machine to find the question mark folder so I went into internet recovery mode but it looks like it can't detect the encrypted OSX partition and repair the bootloader I am unsure what to do next as I need the files on this machine Any help would be appreciated


Covariance of products of dependent random variables

I have four random variables, A, B, C, D, with known mean and variance. As well:   Cov(A,B) is known and non-zero  Cov(C,D) is known and non-zero  A and C are independent   A and D are independent  B and C are independent   B and D are independent   I then create two new random variables:   X = A*C Y = B*D   Is there any way to determine Cov(X,Y) or Var(X+Y)?   If not exactly, is there any way to estimate it? What if I could determine the distributions of A and B and C and D?


Similar questions list is messy on the Ask a Question page

I am facing below issue while creating a question for all Stack Exchange sites. Please have a look. Screenshot:


I have equations inside an environment which has a larger left-margin than the main text (analogous to an enumerate/itemize environment, implemented with the changepage package's adjustwidth environment). Just as equations in enumerate/itemize behave, the equations are centered with respect to the entire text, rather than just the width of the container environment. I want the latter behavior.  I'm trying to accomplish this by wrapping all display-math in minipages. Namely, I'm modifying the mathdisplay environment in amsmath.sty as follows:  \makeatletter \let\oldmd\mathdisplay \def\mathdisplay#1{%   \newline   \begin{minipage}{\textwidth-\@totalleftmargin}%     \oldmd{#1}% } \let\oldendmd\endmathdisplay \def\endmathdisplay#1{%   \oldendmd{#1}%   \end{minipage} } \makeatother   This is almost working, but there are some issues with spacing which I don't understand how to fix. Here's how the the normal \[ ... \] and numbered \begin{equation} ... \end{equation} look with the above modification:      My main confusion is why the numbered version is behaving so differently from the unnumbered. But all in all I want to fix this so that the spacing above and below is even as it usually is. Any help is appreciated, thanks.  Edit: Here's a compilable example:  \documentclass{amsart}  \usepackage{lipsum} \usepackage{calc} \usepackage{changepage}  \makeatletter \let\oldmd\mathdisplay \def\mathdisplay#1{%   \newline   \begin{minipage}{\textwidth-\@totalleftmargin}%     \oldmd{#1}% } \let\oldendmd\endmathdisplay \def\endmathdisplay#1{%   \oldendmd{#1}%   \end{minipage} } \makeatother  \setlength{\parindent}{0pt}  \begin{document}  \lipsum[1]  \begin{adjustwidth}{20pt}{} \lipsum[2] \[ x \mapsto \hom(-,x) \]  \lipsum[3] \begin{equation}   y \mapsto \hom(y,-) \end{equation} \lipsum[4] \end{adjustwidth}  \lipsum[5]  \end{document}


What is the best way to solve an Objective-C namespace collision?

Objective-C has no namespaces; it's much like C, everything is within one global namespace. Common practice is to prefix classes with initials, e.g. if you are working at IBM, you could prefix them with "IBM"; if you work for Microsoft, you could use "MS"; and so on. Sometimes the initials refer to the project, e.g. Adium prefixes classes with "AI" (as there is no company behind it of that you could take the initials). Apple prefixes classes with NS and says this prefix is reserved for Apple only. So far so well. But appending 2 to 4 letters to a class name in front is a very, very limited namespace. E.g. MS or AI could have an entirely different meanings (AI could be Artificial Intelligence for example) and some other developer might decide to use them and create an equally named class. Bang, namespace collision. Okay, if this is a collision between one of your own classes and one of an external framework you are using, you can easily change the naming of your class, no big deal. But what if you use two external frameworks, both frameworks that you don't have the source to and that you can't change? Your application links with both of them and you get name conflicts. How would you go about solving these? What is the best way to work around them in such a way that you can still use both classes? In C you can work around these by not linking directly to the library, instead you load the library at runtime, using dlopen(), then find the symbol you are looking for using dlsym() and assign it to a global symbol (that you can name any way you like) and then access it through this global symbol. E.g. if you have a conflict because some C library has a function named open(), you could define a variable named myOpen and have it point to the open() function of the library, thus when you want to use the system open(), you just use open() and when you want to use the other one, you access it via the myOpen identifier. Is something similar possible in Objective-C and if not, is there any other clever, tricky solution you can use resolve namespace conflicts? Any ideas?  Update: Just to clarify this: answers that suggest how to avoid namespace collisions in advance or how to create a better namespace are certainly welcome; however, I will not accept them as the answer since they don't solve my problem. I have two libraries and their class names collide. I can't change them; I don't have the source of either one. The collision is already there and tips on how it could have been avoided in advance won't help anymore. I can forward them to the developers of these frameworks and hope they choose a better namespace in the future, but for the time being I'm searching a solution to work with the frameworks right now within a single application. Any solutions to make this possible?


$x\sim y\iff x^2\equiv y^2\pmod{\!6}$ is an equivalence relation.

Question 1: Let $x,y \in S$ such that $x\sim y$ if $x^2 =y^2\pmod6 $. Show that $\sim$ is an equivalence relation.    This is what I tried: Reflexive: $x^2\pmod6 = x^2$  implying $x\sim x$ Symmetry: suppose $x\sim y$, then  $x^2 =y^2\pmod6$ Operating by inverse of $x^2$ both sides we have $e=(x^2)^{-1} y^2\pmod6$ Then I have $y^2=x^2\pmod6$, hence $y\sim x$ I would like to get some corrections up to here because am not sure with this     Question 2. Find the orbits of the given permutation:    $$v:\mathbb{Z}\to\mathbb{Z}\quad\text{ defined by }\quad v(n)=n+3$$   Here is my solution which I would also want somebody to correct me! Let the relation $\sim$ be defined on $\mathbb{Z}$ by $a\sim b$ if $b=a+3$ I consider that the orbits of $v$ are the classes of $\mathbb{Z}$ with respect to $\sim$ given by  $\{b\mid b=a+3\}$. Thus I get only three orbits which are $\{1,4,7,10,…,3n-2\mid n\in \mathbb{Z}\}$, $\{2,5,8,…,3n-1\mid n\in \mathbb{Z}\}$, and $\{3,6,9,…,3n \mid n\in \mathbb{Z}\}$.


Why are plural pronouns used for a singular third person?

My initial concept was:     One should finish one's meal.   When a user logs in to his/her email...   A person bought a cake for his/her work.   However, in the recent (8-10) years, I have been seeing more and more references like these:     One should finish their meal.   When a user logs in to their email...   A person bought a cake for their work.   Which of the two approaches above is correct? Do they have to do something with the difference between British and American English?


Including additional variable, the variable of interest becomes insignificant

I am examining BMI effect on wage. I have included a lot of explanatory variables in the regression and all (most) coefficients were significant, but once I add ability which correlates with education (already in regression) slightly (34%) BMI measures turn insignificant.   Here is the question, what does it mean if BMI turns insignificant once we add another variable in the regression?   Estimated by OLS, cross sectional. Adj R  0.60, F=160.   PS: I added a variable and variable of interest turned insignificant, not vice versa.  Thank you for all the examples below, they address the same topic, but different issue.


Which is the best way to log an error/debug logs in Production enviornment (Salesforce/apex)?


We have Windows Server 2008 installed. We need to take backup of folder from a desktop on LAN. The Folder is not shared. Is there any tool or software or   Schedule can be made which should automatically take the backup of that folder date-wise & make a copy on server?  Can we do it through the "Schedule Tasks option"? The desktops have Windows   Vista/Window 7.


Difference of Disjoint and Independence in Probability

Given the following definitions:   Disjoint means if event A occur ,B cannot possibly occur. Draw in the Venn Diagram, it should not contain any intersection. Hence, mathematically,   P(A,B) = 0. However, for independence, it says if we know that A occurs, it tells us nothing whatsoever about what B occurs. Does it mean it does have intersection?? Come to think of it. If A and B are independent,   P(A n B) = P(A)P(B).    Mathematically speaking, if A and B are disjoint, then   P(AnB) = 0 /= P(A)P(B)   If      P(AnB) = P(A)P(B),  then      it means there should be an intersection???


I am working with an interceptor (extended from RealProxy) which interacts with our caching service. I supply the key and am returned a JSON payload. The return type is reflected from the calling function (MethodInfo.ReturnType) and is used to cast the returned object as needed.  public object Get(string key, Type type) {     string value = cache[key];     return JsonConvert.DeserializeObject(value, type); }   Out of curiosity I wanted to make use of generics to accomplish this. I know you cannot specify a generic type from a Type variable. Is there any way to accomplish the following?  public T Get<T>(string key) {     string value = cache[key];     return JsonConvert.DeserializeObject<T>(value); }   The calling code is (simplified):  Type returnType = methodInfo.ReturnType; object cachedValue = cacheService.Get(key, returnType);  if (cachedValue != null) {     // return cached value } else {     // continue running }   The reason I am interested in doing this is I would like to use a different caching provider (redis, in particular StackExchange.Redis.Extensions.Newtonsoft) and our current method of caching/retrieving won't plug in quite so simply with calls like this:  User cachedUser = cacheClient.Get<User>("my cache key");


How to change 'quick-reply' buttons in Mail notifications on macOS?

I wonder whether instead of 'Reply' and 'Close' I can have other options like 'Trash' or 'Archive' or 'Mark as Read' in notifications coming from the Mail app on macOS.


Illustrator scaling custom pattern, can see vertical lines from the pattern box

I've created a repeating pattern, added to swatches, filled a square with it at 100% pattern scale and exported the square as PNG - that worked fine. Then, I scaled the same pattern in the same shape to 200%, it looked good in Ai. When exported as PNG, however, this time I can see the hairline lines that are coming from the pattern no fill/no stroke box. Interestingly, I can see only vertical lines and not horizontal. The pattern box is no fill/no stroke, full int dimensions (252 x 252px). Any idea why that might be happening and what can I do to fix the issue? Thank you!


Retrieving HTTP status code from loaded iframe with Javascript

I used the jQuery Form plugin for asynchronous form submission. For forms that contain files, it copies the form to a hidden iframe, submits it, and copies back the iframe's contents. The problem is that I can't figure out how to find what HTTP status code was returned by the server. For example, if the server returns 404, the data from the iframe will be copied as normal and treated as a regular response.  I've tried poking around in the iframe objects looking for some sort of status_code attribute, but haven't been able to find anything like that.    The $.ajax() function can't be used, because it does not support uploading files. The only way to asynchronously upload files that I know of is using the hidden iframe method.


I know that amounts of money are followed by a singular verb. But l am not sure if we can use a singular or plural verb in the following sentence:  Thirty dollars is/are found in the drawer.  I guess we can use "are" because we are talking about a number of dollars. But what if the speaker was talking about an amount of money?   Any help?


How to make "Theorem 1" and not "Theorem 0.1"

It includes the command \newtheorem{teo}{Theorem}[section] in my code, but theorem 0.1 appears when I do \begin{teo}, how to change?


Converting GeoPDF to vector format like CAD or shapefile?

I want to convert a GeoPDF that has vectors entity in it to a vector format and preserve the real coordinates of these vectors. The GeoPDF has been exported from ArcMap and has layers in it.  I have try GDAL, but it rasterize the PDF before exporting it. Which is not good for me. Also I don't want a solution that would convert this image back to vectors, too complicated for the data I have.  Is someone aware of any tool that can do that? The resulting format can be a CAD file or a shapefile or anything that is a vector format.


What does the human body use oxygen for besides the final electron acceptor in the electron transport chain?

My biology teachers never explained why animals need to breathe oxygen, just that we organisms die if we don't get oxygen for too long. Maybe one of them happened to mention that its used to make ATP. Now in my AP Biology class we finally learned the specifics of how oxygen is used in the  due to its high electronegativity. But I assume this probably isn't the only reason we need oxygen.   What other purposes does the oxygen we take in through respiration serve? Does oxygen deprivation result in death just due to the halting of ATP production, or is there some other reason as well? What percentage of the oxygen we take in through respiration is expelled later through the breath as carbon dioxide?


I'm just getting started with Postgres. Reading  I came across this query:  SELECT title, ts_rank_cd(textsearch, query) AS rank FROM apod, to_tsquery('neutrino|(dark & matter)') query WHERE query @@ textsearch ORDER BY rank DESC LIMIT 10;   I can understand everything in this query, except for this: FROM apod, ....  What does this , mean? I'm used to joins but not to multiple FROM statements separated by a comma.  I searched the net for no avail. After looking at it and thinking, it seems to me that it's declaring a variable called query so it can use it multiple times. But if this is true, what does it have to do with FROM?


Beginner's question. I see a lot of @XXXXX s in our code base. So I would like to know what is the significance of this syntax. Below is a snippet of our code and example   @Process      public Message loadManifest(Message message) {   How can we relate this to JBoss AS Pipeline?


Ejecting a USB 3.0 drive connected to USB 3.0 port reconnects immediately

I have an external HDD with a USB 3.0 connection. When I connect it to the USB 3.0 port on my laptop, it works fine but when I eject it, it gets remounted immediately.  This doesn't happen when I connect the same drive to a USB 2.0 port.  At the moment I'm unmounting (clicking the "eject" button in Nautilus) instead.   Is there a way to avoid this issue?


Explanation of something related to solving $\phi(x) =m$

Let $\phi(x)=m$, where $\phi(x)$ is Euler’s phi function, And $x=\prod_{i=1}^{n}p_i^{a_i}$ Thus: $$\phi(x)=\phi\left(\prod_{i=1}^{n}p_i^{a_i}\right)= \prod_{i=1}^{n}p_i^{a_i}-p_i^{a_i-1} =m$$ $$\iff m= \prod_{i=1}^{n}p_i^{a_i-1}\left(p_i-1\right) $$ Now let $d_i=p_i-1$: $$m =\prod_{i=1}^{n}p_i^{a_i-1}d_i= \prod_{i=1}^{n}\frac{p_i^{a_i}}{p_i}d_i= \prod_{i=1}^{n}p_i^{a_i}\frac{d_i}{p_i} $$ $$\iff m=x \prod_{i=1}^{n} \frac{d_i}{p_i} \iff x= \frac{m}{\prod_{i=1}^{n}d_i}\prod_{i=1}^{n}p_i$$ I think that this is the solution to the equation $\phi(x)=m$, but how can i use this result to solve it?


Query String param and value removed when accessing Lighting App Page

As part of a custom OAuth2 flow, the user is being redirected back to a Lightning App Page with URL: https://x-dev-ed.lightning.force.com/lightning/n/namespace__Page_Name?state=q765wYYgnvzVAsod&code=c1BF-iddZNkD1aMxVYp8p5smeAQUxITQUesC3Q_ggYHyNJzm With a few query string params state and code. But the page does a refresh before it loads, and the query string params are removed. I want to access the values in state and code from the custom LWC component on the page? I have tried looking in CurrentPageReference: import { CurrentPageReference } from "lightning/navigation";  Using: @wire(CurrentPageReference) currentPageReference;  connectedCallback() {     console.log("state is: " + JSON.stringify(this.currentPageReference.state)); }  But the state object is empty {} And, I've tried getting the value from the URL: connectedCallback() {     const param = "code";     const paramValue = this.getUrlParamValue(window.location.href, param);     console.log(param + ": " + paramValue); }  getUrlParamValue(url, key) {     return new URL(url).searchParams.get(key); }  But nothing. How can I access the values in state and code from the custom LWC component on the page?


How should I state a 'PhD dropout' in my CV?

I was a final year PhD student (into the last quarter of year 4) in cancer research (passed my qualifying 2 yrs back) but was let go thereafter due to 'unsatisfactory progress' as my data is not sufficient for a PhD thesis. I have to admit here that I've gradually lost my enthusiasm in the project and kinda burnt up after year 3. I've completed all required modules with a decent GPA (4/5). My supervisor was lenient enough to recommend me to graduate with a MSc instead but am facing some 'cross-deparmental red tape' at the moment to say the least (no news of my MSc transfer after 2.5mths of appeal). I'm in the midst of preparing my CV for future job hunt but decided I should just state my current qualification as a 'BSc'. How should I address this 'failure/ 4-yr gap' in my CV?  I have no intention of applying for any academic research jobs but felt it's best that I stay in a relevant field (bio/pharma?). Any advise given would be greatly appreciated. Thank you!


What is the purpose of the "window" icon in the menu bar in Windows 8 on hover?

What is this icon in the menu bar when I hover? I can't click on it. It appears to do nothing.


If $a,b,c$ are positive, then $(a+b+c)(1/a+1/b+1/c)\ge 9$

The question asks to prove that if  "$x_1,x_2,x_3$ are positive numbers show that: $$(x_1+x_2+x_3) \left(\frac{1}{x_1}+\frac{1}{x_2}+\frac{1}{x_3} \right)\ge 9$$  I've tried to use the fact that the arithmetic mean is greater than the harmonic mean since it looks like it's kind of in that form but it doesn't seem to work. I tried expanding it too and simplifying a little to get: $$ x_1^2(x_2+x_3)+x_2^2(x_1+x_3)+x_3^2(x_1+x_2)\ge 6 x_1x_2x_3$$  but I can't seem to see anyway to further get it into a form that easily proves the required inequality. Any hints as to a way to do this?


F is a field $\Rightarrow$ $F\left[ x\right]$ is a PIR

F is a field $\Rightarrow$ $F\left[ x\right]$ is a principal ideal ring. How to proof? Second question F have to be field?(why)


I'm having trouble finding packages or source for the btnx service, it looks like the ollisalonen.com site that hosted btnx is no longer available. I also cannot find any btnx packages in apt or on the Ubuntu software center.   Does anyone know how to get btnx these days?


Right use of prepositions in, on, under in relation to water

The dictionaries do not provide good enough answers for the right use of these prepositions in the following context:   The man is IN  the water. The man is under the water. The man is below the water.   Besides, which of one of these it is correct and why?   A: The boat is ON the water. B: The boat is IN the water.


/index.php/ appearing in generated clean URIs

I have a Drupal 8 site with clean URLs. Recently, URLs are similar to example.com/index.php/page-url-alias. The page still loads correctly, but I don't want the index.php part to be indexed.  If I empty the cache, the URLs are shown correctly.  How can I force Drupal not to add index.php in the URLs it generates?


QGIS Atlas web layer rendering - how can I slow it down?

I cannot get Atlas to export maps with web layers correctly.   When I look at the preview within composer everything works fine. When I export an atlas the first page renders ok but for subsequent pages only a couple of tiles are usually generated.  My suspicion is that QGIS is rendering faster than the web layers can be downloaded.  I suggest that if it is possible to slow down the rendering process this will allow time for tiles to download.  I have no idea how to do this but maybe a developer can tell me how to slow down the Atlas rendering process to allow for tile downloads?   A similar question has been raised before on the GIS SE as .   My question is not the same because I am looking for a way to either test out my hypothesis or for somebody to tell me that my hypothesis completely wrong.


How can I know which is the source of an specific standard shared libraries?

How can I get access to the source code of standard shared libraries?


How to install Code:Blocks IDE 17.12 on Ubuntu Desktop 18.04?

How to compile sources from sourceforge and install it step by step? Is there another way? I have read this page  but solution not found.


Import coordinates from CSV and create sphere at each position

I have a CSV containing x,y, and z coordinates. The CSV also has a fourth column containing information on sphere diameter. I need to create a sphere at each coordinate, having the corresponding diameter. Can someone provide me a basic Python script that performs this task? My actual task is much more involved, but I think I can solve it if I have the basics in place.


Where to submit a question about a simple problem of multi-feature Bayesian classification

The problem comes from §3.1.2 in the "Temporal Data Mining" book by Theophano Mitsa  I'm looking for help to calculate the value of the marginal distribution and the exact posterior distribution (the book does not give these values since they are not needed for classification)  Where would you submit this?  this is not really a computer science question


how to loop a switch statement using letters. eg. "f" or "b". i have tried everything but am unable to resolve this issue

Below is my code. I have tried to use numbers as cases instead of letters and it worked. however i would like to use letters instead. this is where i get issues. Please help me . Thanks   public class Hello {     public static void main(String[] args) throws IOException {          String input = "input";         Scanner scanner = new Scanner(System.in);         switch (scanner.next()) {           case "f" :         case "F" :         case "Forward" :         case "forward" :              while (input == "f");             System.out.println("You Have Chosen Forward");             System.out.println("Enter a speed and duration");              else                 System.out.println("the values you have written are out of range");             break;      case "b" :         case "B" :`enter code here`         case "Backward" :         case "backward" :              while (input == "b");             System.out.println("You Have Chosen backward");             System.out.println("Enter a speed and duration");              else                 System.out.println("the values you have written are out of range");             break;          case "Q":             System.out.println("Goodbye!");             System.exit(0);         }  }   }


I read this sentence in a description to a podcast from      Batter, “batter,” when we talk about cooking is a liquid, made usually   with eggs, and flower, and perhaps milk, and you combine these things   together and you get a thick liquid, which we call batter   Why do I need to use a before liquid? What makes liquid countable?


Why $\mathbb{R}$ is a subset of $\mathbb{C}$?

Let us define $\mathbb{C}$ by $$\mathbb{C} = \mathbb{R}^2.$$ Real elements of $\mathbb{C}$ are tuples $(x, 0)$. But $x \neq (x, 0)$, so $\mathbb{R}$ cannot be a subset of $\mathbb{C}$.  I also read the following definition. Let $$\mathbb{C} = \{ a + bi \mid a, b \in \mathbb{R},\ i^2 = -1 \}.$$ But there is no $i \in \mathbb{R}$ such that $i^2 = -1$, so where does $i$ come from? If $i \in \mathbb{C}$ then we are using $\mathbb{C}$ in definition of $\mathbb{C}$.  NOTE: Apparently, there are similar questions on MSE but I think that lhf's answer is the best and most concise. Also, title "R is a subset of C?" is much easier to google than "Is a+0i in every way equal to just a?" I don't want readers to be redirected.


Prove $r^2+r_1^2+r_2^2+r_3^2=16R^2-a^2-b^2-c^2$ for a triangle with sides $a$, $b$, $c$, circumradius $R$, inradius $r$, exradii $r_1$, $r_2$, $r_3$

From SL Loney Trigonometry:     Prove that   $$r^2+r_1^2+r_2^2+r_3^2=16R^2-a^2-b^2-c^2$$   for a triangle with sides $a$, $b$, $c$, circumradius $R$, inradius $r$, and exradii $r_1$, $r_2$, $r_3$.   This one is a really dirty question.   I have tried a lot of stuff like $r=4R\times \Pi(\sin\frac{A}{2}$) and  $r_1=4R\times\sin\frac{A}{2}\cos\frac{B}2\cos\frac{C}2$ etc..  There are other ways like $-r+r_1+r_2+r_3=4R$,  but all these are way too cumbersome or clumsy.   Anything more intuitive?


Will repeatedly applying a hash function to the prior result visit all possible hashes?

If one were to take a message, say "Hello world!", and compute the MD5 hash: 86fb269d190d2c85f6e0468ceca42a20 Then, taking the MD5 hash of this, and repeating that procedure: d522231cf8bd5bd3bceb31c640bcab9a  64bb07c8a424dbb918495fa428702998  ed64b3e94672013dd88c415b8575dede  95119774bf93c232892b4f3071348abd  0d1fff8e1426591625a888451ed893c2  3e858eba431292825240db61628a817a  055609b11d0a06b46eff40bcb52eca09  8860c0fbffff97c16f1aa617e3b243e5  518ca0b27a1990b5bac51799c2c1b636  b62fd7e949b2995312b9fbddccd6b19f  b1d831a1d1c6ed8a81e4cb908f5aa36e  dd4e0883a48b1fd3a3a08e26cbc6adc4  3f4a12f0cdc506141badd00bf498dbad  be536872dde5b558975fd3a7dfec4884  402b32bb6839f17028deb13e60dd32ad  ... Given an infinite number of repetitions of the above, is it possible that all possible hashes will be computed an infinite number of times? Is it possible that given some initial message, there may be a revisiting of the initial hash just shortly after the start of the procedure, ie. if the MD5 of 402b32bb6839f17028deb13e60dd32ad was 86fb269d190d2c85f6e0468ceca42a20 again.


Finding a solution $x \in \mathbb{N}$ of $x^{125} \equiv 7 \ (\mathrm{mod} \ 39)$

I want to find a solution $x \in \mathbb{N}$ of $x^{125} \equiv 7 \ (\mathrm{mod} \ 39)$ by using Ender Wiggin's method   My steps are:  $x^{125} \equiv 7 \ (\mathrm{mod} \ 39) \Rightarrow x^{125}=7+39 \cdot n,\ n \in \mathbb{N}$  $\Rightarrow \mathrm{gcd}(x,39)=1$  It's $\varphi(39)=\varphi(3)\cdot\varphi(13)=24$  So $x^{24} \equiv 1 \ (\mathrm{mod} \ 39)$  Since $x^{125} \equiv 7 \ (\mathrm{mod} \ 3)$ and $x^{125} \equiv 7 \ (\mathrm{mod} \ 13)$ it follows that   $x^{\varphi(3)}=x^2 \equiv 1  \ (\mathrm{mod} \ 3)$ and $x^{\varphi(13)}=x^{12} \equiv 1  \ (\mathrm{mod} \ 13)$.   Now I don't know what to do next.   I tried with $x=4$ and it works, but how to show it properly?  What has to be done now?


Unity Tweak Tools missing schema in 14.04

When I try to start up Unity Tweak Tool in 14.04, it throws up a window that says:  "The following schema is missing:  com.canonical.unity.webapps  In order to work properly, Unity Tweak Tool recommends you install the necessary packages."  I have no removed this package, I only turned them off in the Privacy settings.  However, looking in Synaptic doesn't show these to even try to reinstall them.  I have no idea why these would be missing.  Any help would be greatly appreciated.


I already  but i but i cant able to understand, so if you explain for below example, it will help me to understand clearly.....  for example, If an order came from Government to people     Education is Compulsory up to age 15.   or      Education is Mandatory up to age 15.   what is the exact difference?   which order has the highest order priority to people?


Let $a_1, a_2, a_3, \dots , a_n$ be positive real numbers whose sum is $1$. Prove that $$\frac{a_1^2}{a_1+a_2}+\frac{a_2^2}{a_2+a_3}+ \ldots +\frac{a_n^2}{a_n+a_1} \geq \frac12\,.$$  I thought maybe the Cauchy and QM inequalities would be helpful. But I can't see how to apply it. Another thought (might be unhelpful) is that the sum of the denominators on the left hand side is $2$ (the denominator on the right hand side). I would really appreciate any hints.


In the context of Quantum mechanics, what is $(-1)^{\left(\frac{-1}{2}\right)}$ really, $i$ or $-i$?

I was doing a Quantum Mechanics problem and came across the quantity $(-1)^{(-{1\over2})}$ within an infinite square well wavefuntion of $\Psi(x,t)=\Psi_1+e^{i\phi}\Psi_2$  and asked to analyze its mathematical behavior when $\phi=0,\pi,\pi/2$, and $\pi/2$ in my $\Psi_2$ presented the problem. I can't find any resources in my textbook or online about this quantity, except for , which didn't totally address my concern. How should complex numbers be treated in such a situation? It seems almost dependent on an order of operation, but there are two possible results: $i$ and $-i$. $$(-1)^{(-{1\over2})} = {(-1)^{{(-1)^{({1\over2})}}}} = \left({1\over-1}\right)^{({1\over2})} = \left({1\cdot(-1)\over(-1)\cdot(-1)}\right)^{({1\over2})} = (-1)^{({1\over2})} = i$$ or omission of the num & denom multiplication of $(-1)$ could result in the same output as below: $$(-1)^{(-{1\over2})} = {(-1)^{{({1\over2})^{(-1)}}}} = (i)^{(-1)} = \left({1\over i}\right) = \left({1\cdot i\over i\cdot i}\right) = \left({i \over -1}\right) = \left({i\cdot(-1)\over(-1)\cdot(-1)}\right) = -i$$ As the other post mentioned, online calculators favor the second result, but I couldn't glean whether there was a reason for that bias. Between these two (or something else), is there a more correct or conventional result, especially in Quantum Mechanics? I know that square roots yield both positive and negative results, but I beleive that only applies to real numbers, and I haven't yet learned enough complex analysis to know how they're treated in complex spaces. Any help would be appreciated!


I lie in the bed feeling sorry for myself and start to feel guilty. I could have been nicer to Ellie. I never even kissed her goodbye. Michael never kissed me goodbye either but then again, he doesn't love and he doesn't care about me.  Source: Catherine Barry: "The Twenty-Eights Day". In Irish Girls About Town, 2004, p. 45.   I would like to ask for the explanation for the usage of the word "never" in that sentence. The context is as follows: The sentece is comment of the narrator of one short story on one particular event that occured some hours in the past. Just one morning she did not kiss her child goodbye. The word "never" indicats after all the present perfect which in this case would mean that she has never kissed her child goodbye.   P. S. There could be raised an objection that this is an duplicate of a question that was resolved here: . But I do not think so. I understand the usage of "never" in a sentence like this: "I lived in Europe in the 90s, but the entire time I never visited Italy". I think that my sentence – given the context – tells that the narrator did not kiss her daughter goodbye just in one particular morning. And that is the reason why she feels ashamed. So this behaviour was an exception from the rule. Normally – when she does not suffer from the mental instability – she kissed her goodbye. Just exactly from this reason I am puzzled by the usage of "never" in that sentence.


Uncountability of basis of $\mathbb R^{\mathbb N}$

Given vector space $V$ over $\mathbb R$ such that the elements of $V$ are infinite-tuples. How to show that any basis of it is uncountable?


How to install Python 3.5.1 on Wily Werewolf 15.10?

came out on December 7th 2015 and as a beginning Python coder I would like to try the very latest version on my Ubuntu installation. At the moment Wily Werewolf 15.10 ships version 3.4 and there are some great improvements in the newest version.  I am currently running Wily Werewolf and I would be keen to hear some methods to update Python to 3.5.1.


Mathematical induction $\sum_{i=0}^{n}{n \choose i} = 2^n $

Prove by mathematical induction:  $\sum_{i=0}^{n}{n \choose i} = 2^n ; n \ge 0$  Step 1: n = 0  ${0 \choose 0}=2^0$  Step 2:  for n = k   $\sum_{i=0}^{k}{k \choose i} = 2^k$  assumption: for n = k+1   $\sum_{i=0}^{k+1}{k+1 \choose i} = 2^{k+1}$  Step 3:  $\sum_{i=0}^{k+1}{k+1 \choose i} = \sum_{i=0}^{k}{k \choose i} + {k+1 \choose k+1} = 2^k+1$  Assumption:  $2^{k+1}$   Result of mathematical induction:  $2^k+1$  Is that correct or is somewhere the mistake ?


Am I remembering incorrectly, or did Java, once upon a time, provide a Pair class as part of its API?


I want to know if it would be possible to connect my laptop to my tablet with a mini display port to HDMI cable and use the tablet to capture the video stream from the laptop i.e. record the screen. Anything else I would need besides a cable (hopefully no capture card bs)?


How to backup the Android calendar file (is there such a file)?

Does anybody know which files I need to save in order to have a simple backup?   Reason for my question is, that my Galaxy Android smartphone lost all calendar data without any interaction. I found tons of apps, tons of sync stuff, but NO simple list of files to save. I do NOT want to save my data remotely on Google.  There must be at least one local file (database?) on my phone containing the synced calendar file (on my server, using ICSSync)


How do I hide / remove a partition from the Nautilus left panel?

I have a luks setup with encrypted partition. And I don't want everyone on my computer to see that I have such partition. Unfortunately it shows up in the nautilus "devices" panel as "Encrypted partition".  Is there a way to prevent it from showing there? I managed to setup authentication with usb key and I don't want the encrypted partition show in the panel.


Is is possible to say that "Above" means "over" and "Under" means"below", but not the opposite?  According to my grammar:  Over - In a higher position (close or touching) Above - In a higher position  Under - In a lower position (close or touching) Below - In a lower position  Example:     There's a helicopter flying round above / over the school.   I would interpret this sentence as "above" meaning almost touching the school or not. And If I hear "over", the helicopter is almost touching school.  This makes me think about "over" and "on". "On" means that something is touching something, but if "over" can mean also "touch".Well, I would never use "over" to mean "touching something", I would use "on" instead.


Is it possible to run three versions of Google Chrome?

How might I run 3+ versions of google chrome so I can log into to 3 different google accounts.  More specifically I am looking to have separate icons in the dock for the 3 separate running applications.  How might I run duplicate and or copy versions of the same application.  The following  by Mark works for a lot of applications but not for Google Chrome.  It appears the following might work .


$A,B$ are two real positive matrices then $\det (A+B) > \max(\det A , \det B)$

Let $A,B$ two square-real-positive matrices. Prove that $\det (A+B) > \max(\det A , \det B)$  So I found this solution:   Basically, if $A=I_n$ and $B$ is diagonal then the proof is immediate.    Now, I know that if $M$ is positive-symmetric then:     $M$ is conjugate to $I_n$. $M$ is conjugate to $\text{Diag}(c_1,\ldots,c_n)$ where $c_i > 0$.   but as far as I understand it doesn't have to be the same $P$. Anyhow, how do I utilize it in order to prove the inequality?   Thanks.


Why are there separate terms for the numbers 11 to 19?

Why are they not ten-one, ten-two, ten-three, .... just like twenty-one, twenty-two, twenty-three?  What I'm asking for is a reason for breaking the pattern, less interested in the origins of the words coming from other languages. Even if they did originate from other languages, why don't we change and adapt a uniform pattern?


Etihad airlines didnt ask passport details when booking flight tickets, why?

I recently booked Etihad flight tickets from USA to INDIA and it didnt ask my passport details.


I've just added a couple of more WFS backed vector layers to a map and the performance has dropped.  Whilst debugging this I've noticed that openlayers is considering every feature in the visible layers when rendering.  If I'm zoomed right in so there are a only couple of features from a few layers and then say pan the map up a small amount.  I'd expect openlayers to use a spatial index to identify which features need to be rendered and only render those.  However, I'm seeing my context based styles being asked for symbolizer info for every feature in every layer.  E.g. my externalGraphic function is been called for features that are on the other side of the country!    externalGraphic: function(f) {       return map.zoom < switchZoom ? icon : "/grails-app/feature/image/" + f.fid;   }   When zoomed out my layers are not visible but when zoomed in there are suddenly 1000s of feature being considered.  Is there a way to get openlayers to use some filter when rendering?  I had thought about adding map zoom/pan event handlers to map features in and out of layers using a spatial filter but I'm pretty sure I shouldn't have to do that.  I don't believe that the fact that my data originally comes from a WFS source is the issue here.  My app also runs offline, the data, once retrieved is stored locally, the retrieval and resources needed to hold these in memory is fine.  There must be a way of getting OL to apply some intelligence when rendering vector features when zoomed in, it shouldn't be even considering rendering features that are hundreds of miles away from the current bounds, this is triggering retrieval of images from either the local file system or the server when I the zoom level switches from a generic icon to a more detailed device specific image.  In total I have about 5000 features, this should be a trivial amount.  I've worked around this by handling move/zoom events and mapping my features in and out of the layers using a quad tree from the bespoke library I wrote years ago and want to move away from.  This is an ugly hack that I find it hard to believe that that there is not a more elegant way to handle, I'd expect to provide the map with my vectors and let it manage them.


How do I blend/average N amount of frames as opposed to only 2?

To average two frames in FFmpeg, one can use something like "tblend=all_mode=average,framestep=2". However, this only supports blending two frames at a time. Daisy chaining them only allows you to blend 2^N frames. What if I want to blend 3 frames, 5 frames, 6, 7, 9, and so on?  For my project in particular, I need to average 5 video frames into one. The source footage is 120fps, so this conversion would effectively reduce the framerate to 24. With tblend, this just won't be possible. How else can I go about this?


whenever i try to render this image i get the pixie dust kind of thing near the glass cup, can anyone explain why this is happening?  i have tried changing the roughness of the glass cup but it has no effect i didn't have this problem when i rendered only the plate


How do me and my friends join each other's worlds on iPhone?

We are all on the same wi-fi in the same room. And we all have the same version of minecraft. We press play and it won't show that we have any friends playing.


how to set environment variables from a shell script?

I'm trying to set environment variable through a shell script. Here is the script with various techniques:  #!/bin/sh echo "export SOMEPATH=/root/some" >> /root/.bash_profile echo "export PATH=$PATH:$SOMEPATH/bin" >> /root/.bash_profile SOMEPATH=/root/some export SOMEPATH source /root/.bash_profile   I run the script a.sh with sh a.sh   Then if I check the env variable it doesn't show up.  echo $SOMEPATH returns nothing. I expected to get SOMEPATH returned


Which method performs better: .Any() vs .Count() > 0?

in the System.Linq namespace, we can now extend our  to have the  and  extension methods.  I was told recently that if i want to check that a collection contains 1 or more items inside it, I should use the .Any() extension method instead of the .Count() > 0 extension method because the .Count() extension method has to iterate through all the items.  Secondly, some collections have a property (not an extension method) that is Count or Length. Would it be better to use those, instead of .Any() or .Count() ?  yea / nae ?


If I have an ESTA and I apply for visa and the visa is denied, is my ESTA still valid?


What is the black arrow in top right corner on top of all windows?

I think I've got this weird arrow since I installed Ubuntu 18.04. It is annoying, because I can't click a tab in a browser which is under this arrow. And I am just worried, what that is. It is always there


I'm building a UI where a user can click on an item in an 'Options' list and add it to a 'Selected' list.   The items on the 'Selected' list have a remove button to send it back to the 'Options' list. I just can't get the remove button to work. I have limited the action of the remove button to a simple alert for troubleshooting purposes.  Can anyone see what I'm doing wrong?  PS. My question has been marked as a duplicate: Event binding on dynamically created elements? I have read that question and I'm trying to apply it. I'm looking for specific help on what I'm doing wrong in my code.     $(document).ready(function(){  var a = []; $(".remove").click(function(){     alert("Remove Clicked"); });  $(".select").click(function(){     var cList = $('ul.mylist');     $('ul.mylist').empty();     $('ui-menu-item').empty();     a.push($(this).next("span").text());     $(this).closest("li").hide();     $( "#s" ).text( a.join( " " ));          $.each(a, function(i){      var li = $('
')             .addClass('ui-menu-item-'+a[i])             .attr('role', 'menuitem')             .appendTo(cList);         var aaa = $('')             .addClass('ui-all')             .text(a[i])             .appendTo(li);         var $input = $('<button class="remove">Remove</button>');             $input.prependTo($("li.ui-menu-item-"+a[i]));    }); });    });    <!doctype html>   <meta charset="utf-8"> <title>Selector</title>
List of Options

<button class="select">Select</button>One

<button class="select">Select</button>Two

<button class="select">Select</button>Three

<button class="select">Select</button>Four

List of Selections

Array of Selected Items to Sent to DB:


How to download and use any other kernel than the one which is installed by default

Supposing I am using Ubuntu 12.04(LTS), and it uses the 3.5.0-37 kernel.  If i wanted to use the 3.9.6 kernel, how could i use it? I dont want to upgrade to 13.04  Would I have to manually download this kernel, compile it and make its initrd, or could I fetch it using apt-get install by enabling some repository?  Please Help.


Caml query to filter by two columns of a sharepoint

Below CAML query is working for filtering the list items with one column, I have tried to add another column to filter it but facing some errors.  "<View Scope='RecursiveAll'><Query><Where><In><FieldRef Name="OID" /><Values><Value Type="Text">749</Value><Value Type="Text">748</Value><Value Type="Text">598</Value><Value Type="Text">106</Value></Values></In></Where></Query></View>"  I want to filter it again with one more column with some values.


Why Constructor is not Calling with Function call Operators

Sorry I was unable to find any keyword to search for this problem. My code is below  #include <iostream> using namespace std; class Name {     public:         Name() {             cout << "Asif";         } };  int main() {     Name obj(); // why Constructor not calling here?      return 0; }   If it's not calling the constructor then what process is running in this code?


How do I create a desktop wallpaper slideshow?

How do  I create a desktop wallpaper slideshow with my own set of images?   With the images coming from a pictures folder, or pre-selected With the images displayed in order, or randomly With the images changing every few minutes, or after random periods of time


How to calc an item property in a list with java?

I'm working on a restful api that manage a backpack inventory just for learning. But I'm struggling with the creation feature wich is responsible to persist a new inventory. So every time that I make a POST request to my api, I receive an list of itens to my new inventory, than I have to process the quantity of each item and with that I get the value for an atribue of the item object called "points".  The json object that my api receive is something like this:  {     "inventory": [         {             "name": "Meat",             "quantity": 4         },         {             "name": "Water",             "quantity": 1         },         {             "name": "Wood",             "quantity": 7         },         {             "name": "Iron",             "quantity": 3         }     ] }   The system has just four type of items, for each type I get a specific amount of points.  Example:  Meat - 6 points Water - 7 points Wood - 3 points Iron - 2 points   Now I have to process the quantity of each item to got my points. The problem is my java method don't verify my item name properly. Because that, the method give null into my points property when I persist the new inventory.  My Item class looks like this one:  public class Item {     private String name;     private Integer quantity;     private Integer points;      //get and set omitted; }   My Backpack class look like this:  public class Backpack{     private List<Item> inventory;      //get and set ommited; }   The method responsible to receive and process my points looks like this  @PostMapping() public void createInventory(@RequestBody Backpack backpack) {      backpack.getInventory().stream().forEach(i -> i.setPoints(calcPoints(i)));      backpackDao.persistInventory(backpack);  }  public Integer calcPoints(Item item) {      if (item.getName().toLowerCase() == "meat")         return item.getQuantity * 6;      if (item.getName().toLowerCase() == "water")         return item.getQuantity * 7;      if (item.getName().toLowerCase() == "wood")         return item.getQuantity * 3;      if (item.getName().toLowerCase() == "iron")         return item.getQuantity * 2;      return null; }   I set the item name to lower case just to make the conditional check a little easy. In case someone could try to persist with up case string. If I try print each item after my stream operation I can got my item name and item quantity but with points with null. I've tryed print a simple log to know if my method calcPoints is calling, and it is. But for some reason the conditionals are not working. I'd like some advice or suggestions about how I can solve this. I think that maybe is something simple but I'm really don't see it yet.


Are antiparticles just particle-shaped holes?

If particles are simply regions of space where certain quantum fields have non-zero divergence, are anti-particles simply the corresponding regions of opposite divergence?    This seems like the intuitive answer, especially when considering the process of annihilation.  I have heard before that anti-particles are analogous to particles moving through time in reverse, which seems to indicate that an annihilation event is just a point of symmetry in that (arguably, single) particle's history.  This analogy breaks down, however, when it comes to gravitation, since there seems to be no evidence of a negative-mass particle.    So what then is the meaning of an anti-particle, when their symmetry is preserved across certain fields, but not other?


How to drive a 6v relay using 74ls08 output?

Im using a 74ls08 and gate ic, and I cant drive a 6v relay by using the output of the 74ls08. In what way can I drive the relay?


iPhone on my account, but activation locked to another account

I've had a secondhand iPhone for three years, using it with my iCloud account. Just now I tried to wipe it with an iTunes restore. The first step was to disable Find My iPhone. Doing so, I received a confirmation email that the phone is now unlocked. To my surprise, upon reset, it went into activation lock mode and asked for the previous owner's login.  The phone is listed in my iCloud Settings. Should I try to track down the previous owner, or will removing it from my own iCloud Settings page free it? (But removing it will also wipe the last evidence that the phone is mine.)  Another way of looking at the question: Can a single phone be listed in several iCloud accounts?


Prove that for the Fibonacci sequence $(F_n)$, $F_n$ divides $F_{2n}$.

I have a seemingly simple question to solve by induction. The question says $F_n$ divides $F_{2n}$ in the Fibonacci sequence.  My thoughts on this.   First,since the n-th term of the Fibonacci sequence is given as the sum of the two previous terms, simple induction won't suffice. So I should try composite induction.   That is, supposing that $F_k$ divides $F_{2k}$ for all $k<n$, I must prove $F_{n}$ divides $F_{2n}$. Is this approach valid?  Doesn't seem to work. If I write $F_{2n}=F_{2n-1}+F_{2n-2}$ then by the inductive hypothesis, $F_{n-1}$ divides $F_{2n-2}$ but this does not help me assert that $F_n$ divides $F_{2n}$. Am I doing this wrong?


Can I say that two different quantities are zero?

I started to learn basics of physics in a university. I know that it is wrong to compare for example pressure and length, like $2\mbox{ Pa}\ne 2\mbox{ m}$. But from algebra I know that $0=0\cdot 2\mbox{ Pa}=0\cdot 2\mbox{ m}$. So if I have the situation that I can choose the zero levels of pressure and height at certain area $A$, am I allowed to write $p_A=h_A=0$?  For example: The equation for the pressure in a fluid of uniform density is of the form $p_2-p_1=-\rho g(y_2-y_1)$. If we choose $p_1=y_1=0$, we get the equation $p_2=-\rho gy_2$.


how to convert particular time into UTC timestamp

I'm having a time in this format like   var time = "22:00:00"   I need to convert this into UTC time format like 1567890764 I'm using this one to convert time into UTC.  Math.floor(new Date().getTime() / 1000) //it return current UTC timestamp   how to pass the "time" variable and get UTC timestamp for that particular time?


Electric Potential, Work Done by Electric Field & External Force

I did lot of searching but couldn't find any textbook nor any webpage which could clarify my doubt. Maybe my doubt is insanely stupid and I was dumb for not realizing it at the first place.  The negative of the work done by the electrostatic field in bringing a charge from infinity to a point is called electric potential.   Let us assume that there is a positive charge at the origin. Let work done by the external force to bring a positive from infinity to a point P close to the origin be W. And hence work done by the field to bring a positive charge from infinity to the point P will be -W.  If I did work W to bring the charge from infinity or if the field brought the charge from infinity, either way the change in potential energy will be same.  In case of work done by the field, we say that the work done is stored in the form of electrostatic potential energy.  In case of work done by the external force, we say that the work done was positive and the energy was taken by some external source.  In the above case, I did work W in bringing it & the field did work -W on the charge trying to push it away so I did positive work of W & the field did negative work of W. We can say that the work done by the field was stored as potential energy.   Where did the work done by the external force (me) go?  I can summarize the whole doubt in the following line: I did work W to bring an charge towards another unlike charge, and therefore the field also did work -W, the net work done on the charge is 0. But there is still a change in potential energy. Why did the potential energy change? Isn't conservation of energy being violated here?  Please clarify my doubt (I do understand that there is a horrible conceptual error in one of my arguments but I do not know which one it is). If I am not wrong this has nothing to do with electrostatics rather has to deal with field theory/inverse square law. I believe I will be encountering the same problem again when I would be studying another force, maybe gravitational, which obeys inverse square law.  Thank You


In fact, our university recommends us to use 2.5cm in the top of pages to redact a thesis. for the text is good but when it comes to chapters they are a little bit in the middle which doesn't respect the requirements. I know latex gives good representation and I like it but the requirement are the requirement. So here is the code:  \documentclass[12pt]{report} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{setspace} \usepackage{mathptmx} \usepackage[a4paper,right=20mm,left=25mm,top=25mm, bottom=25mm]{geometry} \title {title} \begin{document} \doublespacing \maketitle \tableofcontents \chapter*{A} \chapter*{B} \chapter*{C} \chapter*{General Introduction}  Blablabla....  \chapter{I} \chapter{II} \chapter{III} \appendix  \end{document}