– Schematic created using   Hi, usual apologies here, total enthusiastic amateur noob, etc.  The situation is: a Common Collector NPN transistor.  Question: Is it okay to omit the resistor R2?  (that is, R2 = 0 Ohms)?  The way I understand it, when the switch is closed, the voltage at the Emitter (as indicated) would be 5V – 0.7V = 4.3V. The reason for that is that both the Collector and the Base are connected directly to 5V, and that VBE must be 0.7 V for silicon-based transistors. Therefore the voltage drop from the Collector to the Emitter will 0.7 V rather than the normal 0.05 to 0.10 V.  But if that is the case, if I want to calculate the value of R2, the total voltage drop is the same, irrespective of whether I calculate it through the loop containing the switch, or going through the transistor form the Collector to the Emitter. Therefore IR = 0 for the Base resistor so that R2 must be 0 Ohms.  Elsewhere I came across the injunction: “Do NOT omit the Base Resistor!” so now I’m uncertain.  (I’m really trying to design a circuit to drive an PWM input to an H-bridge from an Intel Edison, so the above is not my complete circuit – it just crystallises one of the many current conceptual difficulties I have. This particular part has to do with an AND gate, so there will at least be another transistor and a pull-down resistor, and so on.)

I have a 74HC595 shift register that I shift bits into from an 5v Arduino. The pins on the shift register is connected to the base of 2N3904 BJT's through a 4.7kOhm resistor. I have noticed that if I include the base resistor, my current to the base is 12.8uA and if I don't the base current is 13.1uA.  Since the figures are so small, do I even need a base resistor?  I should mention that I am trying to build a circuit for one of those fancy . On the schematics are shown 2 diodes, but that will be expanded to 8 LEDs for each shift register.         – Schematic created using


I want to know the width of the actual text in the input box, not the input box. Is there an equivalent of   $('#mybox').val().width();   that measures exactly how many pixels the text takes up? (This code obviously would not work.)

I'd like to use JavaScript to calculate the width of a string. Is this possible without having to use a monospace typeface?  If it's not built-in, my only idea is to create a table of widths for each character, but this is pretty unreasonable especially supporting  and different type sizes (and all browsers for that matter).


I want to delete all duplicates from a linked list. I know there is an exact program on GeeksForGeeks which is very similar to mine and I could use that, but I want to understand why mine is not working. Code: class Node {     public:         int data;         Node *next;   };  void removeDuplicatesAlpha(Node* start) {     Node* ptr1 = start;     Node* ptr2 = NULL;     Node* dup = NULL;     int i = 0;      /* Pick elements one by one */     while (ptr1 != NULL && ptr1->next != NULL)     {         ptr2 = ptr1->next;         //0 1 2 3 4         /* Compare the picked element with rest            of the elements */         while (ptr2 != NULL && ptr2->next != NULL)         {             cout << i;             i++;              /* If duplicate then delete it */             if (ptr1->data == ptr2->data)             {                 /* sequence of steps is important here */                 dup = ptr2;                 ptr2 = ptr2->next;                 delete(dup);             }             else /* This is tricky */                 ptr2 = ptr2->next;         }         ptr1 = ptr1->next;     } }  int main() {     Node* head = NULL;      push(&head, 3);     push(&head, 3);     push(&head, 20);     push(&head, 14);     push(&head, 9);     push(&head, 20);     push(&head, 20);      printList(head);      //removeDuplicates(head);     removeDuplicatesAlpha(head);      printList(head);      deleteList(&head);      return 0; }  The last i printed is 4. This is the error: Exception thrown: read access violation. ptr2 was 0xDDDDDDDD. I'm so sorry if this is a dumb question but I just started working with Data Structures in C++.

I know that the compiler will sometimes initialize memory with certain patterns such as 0xCD and 0xDD.  What I want to know is when and why this happens.  When  Is this specific to the compiler used?  Do malloc/new and free/delete work in the same way with regard to this?  Is it platform specific?  Will it occur on other operating systems, such as Linux or VxWorks?  Why  My understanding is this only occurs in Win32 debug configuration, and it is used to detect memory overruns and to help the compiler catch exceptions.  Can you give any practical examples as to how this initialization is useful?  I remember reading something (maybe in Code Complete 2) saying that it is good to initialize memory to a known pattern when allocating it, and certain patterns will trigger interrupts in Win32 which will result in exceptions showing in the debugger.  How portable is this?


I have a USB stick which has no drive letter assigned because its only partition is encrypted with . Before removing the stick from my computer physically, of course I first dismount the volume in VeraCrypt. Now since the device has no drive letter assigned, there is no entry for it in the removable media list that pops up when clicking the corresponding tray icon. However, you can select "Open Devices and Printers", select the device there and remove it. I have two questions:   Do I need to remove it this way after having dismounted it in VeraCrypt? I need to make as certain as possible that this device does not have incomplete data written to it or becomes otherwise corrupted. Therefore, so far I have always removed it via "Devices and Printers" before actually pulling it out of the slot. To remove the stick via "Devices and Printers", administrative privileges are required. Is there a way around this other than giving the device a drive letter? I would like to be able to do this without elevation, but I also do not want to give the drive a letter because Windows becomes eerily keen on formatting any drive that doesn't look familiar.

Since I removed the USBs drive letter for the raw partition per the instructions , Windows 7s "Safely Remove Hardware..." taskbar icon no longer detects my USB. So, how should I safely remove my USB?  There doesn't seem to be anything on this problem in the TrueCrypt .


How to derive the formula for the uncertainty of opposite in TOA? (let the opposite be h and the adjacent be x)

As a lab assignment I have to replicate experiment with spring oscillations, and eventually calculate spring constant. The measurements I took are: spring displacement from equilibrium $x$, mass of weights $m$, and period $T$. And presumed uncertainties: $\Delta_\alpha(x)=1[mm]$, $\Delta_e(x)=2[mm]$,  $\Delta_\alpha(t)=0.1[s]$,  $\Delta_e(t)=1[s]$. Where $\alpha$ stands for uncertainty of used equipment, and $e$ is readings uncertainty made by me.  I calculated the standard uncertainty using this formula: $$\sqrt\frac{\Delta_\alpha(x)^2+\Delta_e(x)^2}{3}$$ Which produced $u(x)=1.29[mm]$. Then using the following substitutions:  $$F=kx$$ $$mg=kx$$ $$x=\frac{g}{k}m$$ I assert that:  $$tan(a)=\frac{g}{k}$$  Because in this part of experiment I plotted $x=f(m)$, using excel's linest, I get the slope $s$  $$tan(a)=\frac{g}{k}=s$$  Now, my question is, since I had uncertainty for $x$ introduced, and it is used to compute $tan(a)$, then the latter is affected and should have uncertainty of itself? How in this case should I go about propagating uncertainty to $tan(a)$?


If an electron is independent, it is an individual electron, i.e. not in the orbit of the atom. Is it able to emit light or does the orbit have to do with the production of light?

As simple as in the title.. I would like to know also some mathematics about it!


I would like to change the appearance of the caption of a code snippet that I have created with minted and listing. However, using \captionsetup[listing]{<options>} does not change anything. Does someone know how to change the caption setup in a listing/minted environment so that the caption is closer to the code?  Here is a working example:   \documentclass[a4paper,oneside,11pt]{report} \usepackage{listing} \usepackage[chapter]{minted} \usepackage{caption} \usepackage{hyperref} \usepackage{blindtext}  \setminted{frame=single}  \captionsetup[listing]{belowskip=-10pt} % --> is not working  \begin{document}  \blindtext  \begin{listing}[!h]     \begin{minted}{c}     int main() {     printf("hello, world");     return 0;     }     \end{minted} \caption{test code 2} \label{code:2} \end{listing}  \blindtext  \end{document}

This question is in regards to customizing the format of the list of listings produced with the minted package. In particular, I want to replicate the formatting produced via the tocloft for Figures:      Despite being related to the following two questions:   (1) ;  (2) ,   I have been unable to replicate the formatting of the list of figures for list of listings from minted. This question differs from these two examples in that minted uses the float package to create the list of listings, whereas the above two questions address the algorithm and listing packages, respectively.    An attempt to produce a similar result follows.   \documentclass{report} \usepackage{minted} \usepackage[titles]{tocloft}   \makeatletter \begingroup   \let\newcounter\@gobble   \let\setcounter\@gobbletwo   \globaldefs\@ne   \let\c@loadepth\@ne   \newlistof{listings}{lol}{\listoflistingscaption} \endgroup \let\l@listings\l@listing \makeatother    \renewcommand{\cftfigpresnum}{Figure } \cftsetindents{fig}{0em}{5em}  \renewcommand{\listoflistingscaption}{List of Listings} \renewcommand{\cftlistingspresnum}{Listing } \cftsetindents{listings}{0em}{5em}   \begin{document}  \listoffigures \listoflistings \clearpage  A minted environment:   \begin{listing} \begin{minted}{java} // Java class \end{minted}     \caption{A Java Class.} \end{listing}   A Figure:   \begin{figure}[h] \centering  \rule{1cm}{1cm} \caption{A Figure} \end{figure}  \end{document}   This approach yields the unsatisfactory list:     Any suggestions would be greatly appreciated.


I have a laptop with a 128GB SSD and a 1TB HDD. But i don't know how to setup ubuntu to work properly with them. Any tips or tutorial ? thanks in advance.

I have an SSD with 64 GB and a 6 GB/s 1 Terabyte hard drive. I want to use the SSD only as a boot device and maybe for swap storage. On the 1 Terabyte hard drive, I want to have the main file system. As in Windows, I liked to have at least 2-3 Partitions example for music games programs and so on. Which partition layout do you recommend to me?


My problem is that every time I press "esc" button on my site it refreshed the page to the base root (without me even requesting it to happen). I have no idea what causes that and which event of keyup/keydown is registered.  My question is:  How can I see what events are currently registered on my site so I can track this issue?

I have a page where some event listeners are attached to input boxes and select boxes. Is there a way to find out which event listeners are observing a particular DOM node and for what event?  Events are attached using:    Event.observe; DOM's addEventListener; As element attribute element.onclick.


Show that $\cot{142\frac{1}{2} ^\circ} = \sqrt2 + \sqrt3 - 2 - \sqrt6$.   What I have tried: Let $\theta = 142\frac{1}{2}^\circ \text{ and }  2\theta = 285^\circ$. $$\cos 285^\circ = \cos 75^\circ$$ $$\cos 75^\circ = \frac{\sqrt3 - 1}{2\sqrt2}$$ $$\cot \theta = \sqrt{\frac{1 + \cos 2\theta}{1 - \cos 2\theta}}$$ From here, pls help me proceed further. Thank you :)

I have seen a few solutions but I can't apply them to this particular question. The question is:   Prove that $\cot 142.5° = \sqrt{2} + \sqrt{3} - 2 -  \sqrt{6}$  Help would be really appreciated.


I have the following language: Let $A = \{a,e,i,o,u\} , S = \{l\}, \Sigma = A \cup S$. Then $L \in \Sigma^*$ is defined by the rules:  $\alpha \in A \Rightarrow \alpha \in L$  $X_1, \dots, X_n \in L \Rightarrow lX_1 \dots X_nl \in L$  A string in $\Sigma^*$ is in $L$ if and only if it can be obtained by finitely many applications of the previous rules   I'm asked to prove or disprove (I'm trying to prove it since I'm convinced it holds) that this language has a unique writing for words, that is, if a word in $L$ has length greater than $1$, then there is a unique construction chain (up to permutation) for it, In other words, if $lX_1\dots X_nl = lY_1 \dots Y_kl$ then $n = k$ and for all $i$, $X_i = Y_i$ My strategy for proving this was: Prove that no initial section of a word (except for the word itself) can be a word. Then using a property that says that since $X_1$ and $Y_1$ are initial segments of the same expression I must have (without loss of generality) $Y_1 = X_1E$ for some expression $E$. If $E$ is not empty, then $X_1$ can't be a word since it is a nontrivial initial segment of the word $Y_1$. Then inductively it follows that all words on both sides are equal However, I'm struggling to prove this. Any help is appreciated

Let $\Sigma = \{0,1,*\}$ be a finite alphabet and let $\mathcal{L}\subseteq \Sigma^*$ be a formal language defined as follows  $\{0,1\}\subseteq \mathcal{L}$. If $w_1,\dots,w_n\in\mathcal{L}$ then $*w_1w_2\dots w_n*\in\mathcal{L}$ Nothing more is a an element of $\mathcal{L}$.  I want to prove that  If $*w_1w_2\dots w_n*=*v_1v_2\dots v_m*$ where $w_i, v_j \in \mathcal{L}$ then $n=m$ and $w_i=v_i$ for all $i$.  I was trying to use the fact that every element of $\mathcal{L}$ has an even number of $*$ but maybe I am missing something.


Below is the source code of List<T> : public class List<T> : IList<T>, IList, IReadOnlyList<T> {   // List doen't implement IDisposable     ...    public Enumerator GetEnumerator() {       return new Enumerator(this);    }     // List<T> contains a nested enumerator    public struct Enumerator : IEnumerator<T>, System.Collections.IEnumerator {  // note that IEnumerator<T> implement IDisposable       private List<T> list;       ...       public void Dispose() { }  // does nothing, looks redundant       ...    } }  My question is, why Enumerator (or IEnumerator<T> to be to be precise) needs to implement IDisposable?Enumerator itself is a struct, not containing any unmanaged resource. If it means T could be a type that deal with unmanaged resource, then you should delegate the dispose method to List<T>, so when you you remove an item from the list, List will call the removed item's Dispose method, but List<T> doesn't have any Dispose method.

I noticed that the generic IEnumerator<T> inherits from IDisposable, but the non-generic interface IEnumerator does not. Why is it designed in this way?  Usually, we use foreach statement to go through a IEnumerator<T> instance. The generated code of foreach actually has try-finally block that invokes Dispose() in finally.


I want to create default permissions on the schema and automatically assign these permissions to newly created tables. For this purpose, I've created a role and assign a user. Afterward, I've created default permission with the following statements. But there are no default permissions in the newly created tables. How can I manage users and roles on the newly created tables? CREATE SCHEMA ${db_schema};  #for create read only role CREATE ROLE readonly; GRANT CONNECT ON DATABASE ${db_name} TO readonly; GRANT USAGE ON SCHEMA  ${db_schema} to readonly; GRANT SELECT ON ALL SEQUENCES IN SCHEMA ${db_schema} TO readonly; GRANT SELECT ON ALL TABLES IN SCHEMA ${db_schema} TO readonly; ALTER DEFAULT PRIVILEGES IN SCHEMA ${db_schema} GRANT SELECT ON TABLES TO readonly;  #for create read write role CREATE ROLE readwrite; GRANT CONNECT ON DATABASE ${db_name} TO readwrite; GRANT USAGE, CREATE ON SCHEMA ${db_schema} TO readwrite; GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA ${db_schema} TO readwrite; ALTER DEFAULT PRIVILEGES IN SCHEMA ${db_schema} GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO readwrite; GRANT USAGE ON ALL SEQUENCES IN SCHEMA ${db_schema} TO readwrite; grant readwrite to ${db_user_name} ALTER DEFAULT PRIVILEGES IN SCHEMA ${db_schema} GRANT USAGE ON SEQUENCES TO readwrite;  # create a user and assign read-write role create user appuser with password 'secret_password' grant readwrite to appuser  # create a user and assign read-write role create user reportuser with password 'secret_password' grant readonly to reportuser  # create a table with appuser who has the read-write permission CREATE TABLE usertestscehema.accounts ( username VARCHAR ( 50 ) UNIQUE NOT NULL ); insert into accounts (username) values ('test');  # select table with reportuser who has the read-only permission select * from accounts  Finally, I got the below error;  SQL Error [42501]: ERROR: permission denied for table accounts  Afterward, I examined the permissions with the following statement and I didn't see any permission related to reportuser who has my readonly user. SELECT grantee, privilege_type  FROM information_schema.role_table_grants  WHERE table_name='accounts'  Where am I missing about this problem?

I have a problem with ALTER DEFAULT PRIVILEGES. I grant the permission:  ALTER DEFAULT PRIVILEGES      FOR USER user_name     IN SCHEMA schema_name     GRANT SELECT ON TABLES TO user_name;   in next step I create a table  create table schema_name.a (q int);   Now, I connect to dabasabe using conn_user and try to read the data in the new table.   select * from schema_name.a   and I receive the error:  SQL Error [42501]: ERROR: permission denied for relation a   org.postgresql.util.PSQLException: ERROR: permission denied for relation a   Do you have any ideas why the error appears?


I measured (using a software) the fundamental frequency produced in an open ended tube of different lengths. Does the diameter of an open ended (both ends) tube affect the fundamental frequency?

I am confused a bit does the frequency of a organ pipe have relation with its diameter or not.


So, I'm making a free op minecraft server. I don't want everyone being able to stop the server or ban anyone, so should I set the op level to 2? SuperOP will be able to ban, so obviously level 3. Owner will be level 4.

In the new server.properties file, there is a line called op-permission-level, which is set to 4 by default. What does it do?


Is a comma needed in the phrases '30-day, money-back guarantee' and '90-day, no-risk trial'?  If so, why? If not, why not?  I see them written both ways -- that is, with and without the comma -- but certainly one way has to be more correct than the other way.  Thanks for any feedback.

Is a comma needed in the following phrases?     30-day, money-back guarantee   90-day, no-risk trial   If so, why? If not, why not?  I've seen them written both ways — with and without the comma — but certainly one way has to be more correct than the other.


So learning the concept of gravitational potential energy, my professor says that when lifting an object without any acceleration, the force we exert on the object to lift it is the same as the force of gravity pulling it down. For some reason my mind is having trouble understanding that.   If the force pushing up on it is the same as the force pushing down on it, then how can we be lifting the object?   I understand that we want it to have no velocity so that none of the energy is converted into kinetic energy and so that we only have potential energy and that's how we come up with $mgh$. I just don't understand how we are able to lift the object to give it the potential energy in the first place if the net force is zero?

Consider there is a box of mass $m$ at rest on the floor. Most books give an example that we need to do a work of $mgh$ to lift the box $h$ upward.  If we analyze this work done, the external force acting on the box by us should be equal to the weight of the box. Therefore the net force is zero which in turn there is no acceleration. If there is no acceleration and the initial velocity of the box is also zero, how can the box move upward?


So, as I know, there's 3 warp zones at worlds 1-2 and 4-2. I was visiting one website, namely  and at their page they mention about 5-1 warp zone:  When you get to the first pipe, walk back about 10 steps, then jump, revealing an invisible block. Jump onto this block, then hit the block on your right. A beanstalk should then appear. Climb the beanstalk to find a world full of coins with a warp zone at the end allowing you to warp to World 6, 7 or 8.  I tried to find by myself but failed. I also couldn't no such data for any vines or pipes that would lead you to a warp zone. So, is there a way to access this warp zone?

In which levels are the Warp Zones located in Super Mario Bros. and how do you get to them?


I have heard that cooking  with salt can lead to increased cooking time compared to cooking it without salt.So i used to add salt just before serving the curry.Other pulses like green gram are cooked with salt without any noticeable similar problems of delayed softening. Is this problem about bengal gram or chickpea is true?If so why is it so?

I have heard opinions on both sides of this.  The the latest  quoted Cooks Illustrated (I can't see the article, but I trust CI), while another .  In case is varies by bean, I'm interested in:   Kidney Beans Black Beans Small Red Beans   So which is it? Inquiring Minds want to know.


I have an android background . I want to learn XCode . Now i want to understand what does the Appdelegate.h and Appdelegate.m do?  As in Android Manifest.xml is the mainFile which launches other Activities . permissions, feature ,broadcast service etc are written in it.  Now can some one explain me the importance of AppDelegate file and explain its component and benefits ?  And where to include permission or Service or BroadCast in app.   I have created an app in Android . Now i am creating it in IPhone which requires permission and services...  Thanks in Advance..  Edit..  According to my study and knowledge. AppDelegate is a controller, it doesn't visually present data (a view) nor does it represent the actual data (a model) but it does determine what view controllers to show etc and manage other views (status bar etc) at the start of the application .it is the launcher class where the first class launches . it consist of some predefined function didFinishLauching and other functions. Is there any detail explanation.

I'm just beginning to work on iPhone apps.  How do I know when I should be putting stuff in AppDelegate versus a custom class?  Is there a rule or any type of analogy with another programming language like Python or PHP that uses an AppDelegate like pattern?


Any hint would be appreciated.   Is this also true for finite fields?

A nonsingular matrix is one which is invertible, and hence the determinant is not equal to $0$. So at first I thought about having $\det(A_{1})+\det(A_{2})=\det(A_{1}+A_{2})$ and then the resulting sum being a invertible matrix, but this is not generally the case.  Then I thought about eigenvalues, as the determinant is the product of the eigenvalues and that using that I could showing that the spectrum of the sum is equal to the sum of the spectrums.   Is that a better way?


I have Iphone 5s and I want to have access to my photos, videos, music from Ubuntu laptop 16.04 LTS  I tried these 4 answers which are in this question and it did not work

I'm new to Ubuntu, and I don't know how to mount my iPhone.   I would like to download iTunes, but I saw that USB doesn't work, but I just need to access to all my files and APP because would like to transfer APP from pc to iPhone.


I have run into a problem that I see has been posted previously, but none of the posted solutions seem to solve my problem.  I have:   A shapefile (with geometry) with a single row for many counties. A CSV file (without geometry) that has multiple rows (representative of different time points) for each county.      Each of these files has an identifier in common “CQID”, which is unique to the county. As such, the shapefile has 1 of each CQID. The CSV has nine of each of the CQID’s (since I have nine time points).  I would like to join the CSV file into the shapefile. So far, I have tried and failed, to solve this problem doing the following:   Using the Join Feature in the Layer Property of the shapefile. Creating a “Relation” of the two files, via Project properties   I expect to look at the attribute table of my shapefile, and see that where I had a single line for each county, there are now nine lines for each.    How do I achieve this is QGIS?   Alternatively, is it easier to do so in ArcMap? Any good tutorials for that?

I'm trying to create a join/relate in QGIS where I have a shapefile of buildings and to that I would like to join a non-spatial table (.csv-file) containing people who work in each building. So I have multiple records in my table that I would like to be able to join to my single features in my shapefile. I can only run a join in QGIS where the first record is joined to the shapefile feature (ie building) but subsequent records get removed. Could someone let me know how to complete this join/relate in QGIS?


I am running Ubuntu 16.04 and decided today to install the 18.04 version. I followed the instructions here:  After about 30-45 minutes I get to a phase of the installation where it is asking if my previously configured dotfiles should be overwritten with fresh ones from the upgraded packages. During one of them I select to view the diff, but then cannot find out how to exit the view. ESC, q, etc. don't work, so I try Ctrl-C, which results in a complete abort of the process. I'm afraid I now have a half-baked installation going. For example, System Settings only have about 7 entries, where the old version had about 20 or so. Also the Software & Updates part of the system settings looks completely wrong. Running the command sudo do-release-upgrade results in a message that no new release is found. Is there any way to resume the configuration or re-run the installation? Edit: I have tried looking into other posts here and their solutions, but my problem is that dpkg is locked. For instance when I try sudo apt-get install -f I get:  E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?  Edit 2: I came closer to what the problem really was. I restarted by mistake a found myself unable to log back in. I have a dual boot with Windows and use Grub to handle it. The standard Ubuntu option resulted in just a purple screen. Going to the Advanced options for Ubuntu, the first option resulted in the same error described here . Not sure how the boot problem arose from the aborted OS upgrade, but here we are.

I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu.   How can I get Ubuntu back?


I set up different models: always same dependent variable and dataset, only the independent variable changes. All model assumptions are fullfilled. Now i do a model selection with the AIC. I look at the model with an independent variable without and with a log transformation. The model with the log transformed dependend variable a has a lower AIC. Then i look at variable b and here the untransformed variable has a lower AIC. In total i  look at 14 independend variables and the log transformation shows lower AIC for 6 of them. My question is if i should use only log transformed or only not transformed data or just decide it for each variable after looking at the AIC?

Can you use AIC/BIC to compare models on untransformed data with models on transformed data (such as log, inverse hyperbolic sine, etc.)? I.e. if a model using logged data gives an AIC = 53.62 and a model using the the non-logged data gives an AIC = 150.6, can you say that the logged model is better even though the scale of the data is different between the two models?


The full question states: Let $p$ be a prime. Let $f(x) = 3x+1$ and $g(x) = 6x+1$. Show that: if there exists $x\in \Bbb N$ such that $f(x) = p$, then there exists $y\in \Bbb N$ $g(y) = p$.    My attempt at this was quite simple. I said that as $p$ is prime, and cannot equal 2, as $3x + 1 \not= 2$, $p$ must be odd, therefore $x$ is even. I've got a proof for that as well, but I'm quite confident that that's fine.   Thus, $x$ can be written as $2y$. $$3(2y) + 1 = p$$ $$6y + 1 =p$$ Thus, if $f(x) = p$, then $g(y) =p$.  I'm just not sure if this is a reasonable proof.

What is given?  $$\text{Let P be a prime}$$ $$\text{Let} \space f(x)= 3x+1$$ $$\text{Let} \space g(x)= 6x+1$$  Show that: If there exists $x \in \mathbb{N}$ such that $f(x) = P $ , then there exists a $y \in \mathbb{N}$ , such that $g(y) = P$  What have I tried?   Given the question says 'show that', that leads me to believe I need to do a proof of sorts. I'm guessing it might be a proof by either strong induction, or just induction (or maybe just a direct proof?).  I don't even know how to set this up If $f(x) =$ $3x + 1 = $ prime...for any integer $x$, then there exists an integer $y$ such that $g(y) = 6y + 1 = $ prime?   Any hints or starting points would be greatly appreciated.   $$\text{Thanks in advance!}$$


Can I use the same var name when passing a value to a function in Python, like this?:  def function(i):     z=i+1     print (z)  for i in range (0,100):     function(i)   Or should I do it like this:  def function(x):     z=x+1     print (z)  for i in range (0,100):     function(i)   what is the best practice?

What exactly are the Python scoping rules?  If I have some code:  code1 class Foo:    code2    def spam.....       code3       for code4..:        code5        x()   Where is x found?  Some possible choices include the list below:   In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop   Also there is the context during execution, when the function spam is passed somewhere else. And maybe  pass a bit differently?  There must be a simple reference or algorithm somewhere.  It's a confusing world for intermediate Python programmers.


I want to center textarea element, but margin: 0 auto doesn't work properly.  Also I tried to wrap element in div which has margin: 0 auto style.  <div style="margin: 0 auto;">     <textarea rows="4" cols"100"></textare> </div>

How can I horizontally center a
 within another
 using CSS?

Foo foo


I need to use $|a+b| \leq |a|+|b|$ to show that $||a|-|b|| \leq |a-b|$ .   I have tried to represent  $||a|-|b||$ as  $||a|+(-|b|)|$ , and then get $||a|+(-|b|)| \leq |a|+|-|b||$ , but that isn't leading me anywhere given $|a-b| \leq |a|+|b|$.


I am currently writing my thesis and I am trying to properly structure the naming of labels. For instance, I use  \label{fig:abc:def:ghi}   for labeling a figure in my main chapter "abc", on some topic "def" with a certain name "ghi". I realize that this results in pretty long labels. On the other hand, I realize that I mostly reference figures only within a chapter.   Hence, I am wondering, how to simplify this.   Do you have suggestions on how I     could automate adding the first part of the label (here: "fig") to the actual label based on the environment?  could just use a reference to the type and the last part of the label (here: "fig:ghi") to reference things lying within my chapter and only have to use the long form ("fig:abc:def:ghi") if referencing outside the chapter

I am beginning to write more and more reports which are ever growing in size, typically about 60-100 pages, containing multiple sections, appendices, etc. However, I am finding my current system/style for labeling my figures, sections, etc., is not ideal and isn't scaling that well. Soon I will be writing my PhD thesis and want to ensure that the style I decide to use will scale well and I won't regret it or try to change it further down the line.   Currently my referencing style is something along the lines of:  \documentclass{article} \begin{document} \section{Introduction} \label{sec:introduction} \subsection{Referencing} \label{subsec:referencing} \subsubsection{Too many nested references} \label{subsubsec:too_many_nested_references} Some equations, figures, tables, pseudo code, code implementations, referenced by: %\label{eqt:equation_scaling} %\label{fig:growth_in_labels} %\label{tab:results_of_scaling} %\label{algo:producing_labels} %\label{code:python:producing_labels} \appendix \section{Alternatives} \label{app:sec:alternatives} Here we list some alternatives to appending \verb|app:| to everything. \end{document}   With this approach I frequently find I would like a labeling syntax which has a bit more detail than the minimal \label{environment:brief_description}, but would benefit from something along the lines of \label{topic/section:environment:brief_description}. However, I am fearful of trying to include section info in the labels in the event I try to move things or re-structure the document during editing. (Often I will move a proof or discussion from one section to another).  If anybody has experience with this style of issue, or has recommended guides that address this then that would be much appreciated.


When developing urban planning documentation (f.e. a master plan of a territory) each scheme or plan must be collected in a file in .mxd format. Does QGIS software generate a .mxd file?

I recently tried to use QGIS and I wondered if you can convert a draft ArcGIS map (*.mxd file) into a QGIS project (*.qgs file).   This would avoid thematize the entire project.


Imagine you have a box full of a gas. It is at thermodynamic equilibrium.  The entropy of the gas in the box is proportional to the logarithm of the number of available microstates.  The number of microstates is proportional to the number of oscillators (abstractly speaking) times the number of available states per oscillator.  Let's limit ourselves to the translational case. In the ideal particle-in-box model, we know that the possible momenta of the particles is quantized, due to the boundary conditions imposed by the sides of the box.   If we were to put a divider in the middle of the box, half of the possible momentum states would now be disallowed. Previously, wavefunctions corresponding to each particle were allowed to have an antinode in the middle of the box ("odd solutions") but now can only have wavefunctions with a node in the middle of the box ("even solution"). There are now fewer translational microstates, so entropy should be reduced.  However, as far as I know, putting a divider in a box does not change the entropy.  A possible solution here is that perfectly rigid dividers and boxes don't exist; a particle can impart momentum into the divider, which can then be imparted to particles on the other side, etc., which would increase the effective number of microstates. However, we should still expect some reduction in available microstates, and this cannot be a complete explanation because we know that if we have two different gasses separated by a divider, by removing the divider we increase total entropy. This, and the fact that increasing volume increases entropy, is nicely explained by the fact that there are more available momentum states in a larger box. However, I cannot reconcile this with the "divider inserted into an equilibrium gas" example I gave above.  Edit: The proposed solution does not address the question in terms of additional momentum state density. I wouldn't even say it actually answers the question at all. "because the thin membrane doesn't materially change the system and carries a tiny entropy by itself. " is not an explanation, just a tautological re-statement of the question.

The Gibbs paradox deals with the fact that for an ideal gas with $N$ molecules in a volume $V$ seperated by a diaphragm into two subvolumes $V_1,V_2$ with $N_1,N_2$ particles in each subvolume, removing the diaphragm gives a nonzero change in entropy, but the change should be zero.  I don't understand why (conceptually) the change of entropy in this situation is supposed to be zero. Why isn't it positive - after all, removing the diaphragm gives the particles more freedom and thus increases the 'disorder' of the system and with entropy being a measure of this 'disorder' it should too increase. Conversely, if I put more and more diaphragms into the container, I could potentially isolate each particle in its own subvolume and leading the system to be very ordered, so the entropy should be very small.  What is wrong with this way of thinking?


I was recently issued a B1/B2 visa with an annotation that i am going there to sit for an exam on 5th feb in Atlanta.  my visa has an issue date of october. I am planning on going to the US in early January. Does my port of entry have to be Atlanta or may i go to some other place like chicago and later go to atlanta for my exam .

I am a girl in my early twenties traveling to USA from India and in my visa application I have provided the contact address for a relative in San Francisco, and their invitation letter. I would like to visit LA first. Will I face problems during immigration if I land in LA (with an immediate on wards ticket to SF)? I dont plan to get on the flight from LA to SFO.  Initially I was planning to fly to SFO from India and then fly to LA immediately after completing immigration at SFO airport.


How do I install Rigs of Rods on Ubuntu 14.04? I do not want to use wine, but when trying to install from the PPA, it said the package was not found.

How do I install  (open source vehicle simulator based on soft-body physics)?  I have compiled applications before like Gedit, Handbrake, XBMC but I can't seem to install/compile Rigs of Rods (and some of its dependencies). This proves to be quite the challenge for me.   I also read  on how to compile in Linux but no luck. I am using Ubuntu 12.04 64-bit.


I have a class Box, and in Box there is an Map<Integer, ArrayList<String>> smallBoxArr = new HashMap<>();  If I want to store Strings in the smallBox, I use put(boxId, "store String");  Now in my Main Class, I want to get the length of a specific smallBox.  My code in Main:  Box box = new Box(); int boxId = 5; System.out.println(box.smallBoxArr.get(boxId).size());   But I always get a NullPointerException.

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


I found some old frozen ground lamb in the back of the freezer.  It is vacuum sealed, and was placed in the freezer after a couple days of being fresh.  It has been in the freezer for a little over 4 years.  Is it safe to eat?

How do I know if a given food or ingredient I have is still good, or if I should discard it?  How can I best preserve a food or ingredient?     This broad question is intended as a "general reference" question to quickly answer many how long will food keep for? questions. Please feel free to edit this question to expand and clarify as needed.


How many $n$-words from the alphabet $A=${$a,b,c,d$} are there such that $a$ and $b$ are never neighbors.  $\\$ Source : Problem Solving Strategies by Arthur Engel$\\$ The solution given in the book is related to, forming Recurrence relations. The problem is, I am a bit unfamiliar and to Recurrences so is it possible to solve this problem without using Recurrences ?$\\$ Any help would be appreciated. Thanks !!

Question:How many n-words from the alphabet {a,b,c,d} are such that a and b are never neighbors?   1.There are $4^n$ ways to arrange the four letters.  2.There are $(n-1)$$2^{n-1}$ ways of arranging a and b together.(is it so?)  3.Hence,the required number is $4^n$-$(n-1)$$2^{n-1}$.  Have I counted the right number of things?  I am looking for a very beautiful Combinatoric proof.     Edit:I realized I had incorrectly assumed that a and b occurred only once in the sequence.


The names for Winter Bash hats are often puns or refer to something. This year, several of the hats are named as some number, which is a little more opaque. Why are numbers so popular this year?  What do they refer to for each hat? Here are the number-named hats for reference: Secret hats: 180°   Presumably a 180-degree turn / U-turn   8,243,721   6   Regular hats: 011 collect 11 hats   Presumably the "11" is for collecting 11 hats, but why the leading "0"?   925 earn a silver badge   24 earn a gold badge   Presumably 24-carat (pure) gold

Continuing the tradition of asking for the meanings of .  Hats like  can be deciphered easily as related to . However, hats like  are difficult to .   bluefeet has already mentioned about the number-only hats .   Hence the question is: can we have a list of what inspired each of the (secret and non-secret) hats?


What should I write if I mean the time before and after 1900 (summa summarum about 30 years). I am not a native speaker that's why I am not able to decide which expression is right. My ideas are: - at/around the turn of the 19th to the 20th century - at/around the turn of the 19th - 20th century - at/around the turn of the 20th century Thank you in advance for your help!

If I wanted to write about 1899, would I call it the turn of the 19th century or the turn of the 20th century? Basically: does 'turn of the century' refer to the beginning or end of a century?


I was thinking that I don't really understand why $$\int_{|z|=1}\frac{dz}{z}=2\pi i$$  I do understand how to calculate it and it's importance for residues, Cauchy etc... The question is that, if $f(z)=z^{-1}$, then $f(z)=\overline{z}$ when $|z|=1$, somehow there must be an asymmetry in $f(z)$ along $|z|=1$ in order for the integral to be $2\pi$ units up in the imaginary axis. If $C$ is the unit circle traversed in the natural (anticlockwise) direction at "1 m/s speed"(i.e. $e^{i\theta}$ for $\theta\in[0,2\pi]$) then $f(C)$ is again the unit circle traversed at "1 m/s" speed but in a clockwise manner. Then again, I don't see any asymmetry: you will pass both by $z$ and $-z$ and those should cancel giving $0$ as the value of the integral.  I tried to think of the line integral in terms of area: $ie^{i\theta}$ is the tangent vector to the curve at $z=e^{i\theta}$ and an infinitesimal triangle (or circle sector) should have area $\frac{1}{2}ie^{i\theta}e^{i\theta}$. Couldn't get any further because what meaning does "complex number value area" mean? Is there some interpretation? I am not convinced that the $\gamma'(t)$ factor appearing in the calculations really makes the difference (or how it would). Just to add to my controversy, the function $f(z)=z^{-2}$ takes the unit circle into the unit circle but "changes speeds" by which I mean that it gives somehow "more weight" to some points (it stretches the upper semicircle into the whole circle)  Maybe the question sounds stupid and I hope it does have a simple explanation.  Thanks!

Cauchy's Integral theorem: Let $U$ be a convex open set and suppose $f$ is a function which is analytic on $U$, except possibly at one point, where it is at least continuous. Then $$\int_{\gamma} f(z) dz=0$$ for every closed path in $U$.   Let $\gamma$ trace the unit circle centered at $0+0i$ in the anticlockwise direction on the set $\mathbb{C}$.   Then, $\int_{\gamma} \frac{1}{z^2} dz = 0$, which makes sense.   But then why does $\int_{\gamma} \frac{1}{z} dz = 2\pi i$?   Both $\frac{1}{z}$ and $\frac{1}{z^2}$ are not defined at $z=0$, but then how does Cauchy's theorem only apply to the latter?


Theoretically the maximum wavelength of sun radiation is approximately 500 nm. Then we should see the sun as green. But why do we see sun as yellow, orange or red?

The spectrum of the Sun as seen at sea level can be seen at  so we can see that wavelengths around green to yellow are the ones that are the most present. The human eye seems to be more sensitive to green wavelengths (around 555 nm which is plain green) compared to others: see .  However the Sun appears mostly white/yellowish.  I don't understand why. The human eye sensitivity for orange/yellow/blue is lesser than for green. Much lesser in case of red wavelength. So even though the spectrum is a continum of all these wavelengths why is the eye fooled toward white?  And why more toward yellow than green?  Thanks.


Suppose you met a guy in a party one month ago. You went out together for two-three times. Even you've exchanged some facts about your lives and know some details of your private lives. Now everyone can call you "friends", though you are “not close friends yet”. Moreover, you have been in his house for one or possibly two times so far. Also you have invited him to your house two or three times. This time when you invite him to your house you begin a discussion about something. The more you discuss about that topic, the more you feel uncomfortable because your girlfriend sits beside you and your friend is talking to you about some issues, which you prefer to be said when you are alone together or you do not want to be said that openly at all. For example he starts speaking about his private affairs with his ex-girlfriend, and subsequently opens some discussions about their private relationship (not merely "very" sexual affairs.) You feel shy beside your girlfriend just because of her being beside you at that moment. Nevertheless you are not going to offend your friend too! First because he is your guest, secondly because you think he is your friend and finally because though his words sound out of place at that specific moment, but if you both had been alone together, you would have listened to his words and perhaps you would participate in that discussion too. Having these all said, now you feel shy and you are going to change the topic or give him a hint that you'd better correct the way you are speaking (because my girlfriend has sat here and of course in an indirect way and with a smile on your lips to avoid him to be upset or feel out of place etc.) Then what would you say? I think for example "Hey David, don't be too forward" OR “don’t be this forward” (having a smile on your lips) Does it sound a natural statement at this moment? Any other native’s suggestion would be welcome. :)

Let’s suppose someone is behaving in a very impolite and perhaps rude way with you and you dislike his manners toward yourself. In such a condition, do the following sentences mean the same and can they be used under these circumstances?      Don’t seem too forward.    Don’t seem overly friendly.   I wonder if you clarify the meaning of each one.


I thought apt is just a new software which works exactly like apt-get. I always used them interchangeably. But it seems they are different, at least in the autoremove function. I ran sudo apt autoremove which didn't remove anything but then I ran sudo apt-get autoremove and it removed a lot of packages. Is there something inherently different between the two?

I read about the new fancy progress bar which was added to apt 1.0 in  and how to enable it . However on running sudo apt-get update, I did not see the fancy progress bars. On reading the second link again, the solution explicitly requires you to use sudo apt update.  Hence my question is the difference between apt and apt-get. I thought they were one and the same.


I have following simple html block:   By list   Then, I have following js-code:  $(document).ready(function() {     $('.show-list').click(function() {         console.log('qwe');     }); });   When I click on it - nothing happens. But when I paste this js-code to Google Chrome JS console, it works perfectly. JS works fine on my site, I can make other JQuery actions. I also tried to write $('.change_ordering.show-list') and $('span.change_ordering.show-list') and $('span.show-list'), but still no progress. What I'm missing?  EDIT: This element is not drowing by ajax. I don't understand why it's duplicate.

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


On specialized  (other than SO), responses take usually much longer time. Users can watch and compare question visits, but this is not very helpful for guessing when an answer in a specific topic probably will arrive... User profiles contain a seen time, which means user activity is tracked by the site software, users are also connected to tags, just as questions are. Would a direct way to estimate activity (maybe based on users and/or tags)? a valuable improvement?  Edit-Summary I reworked this question heavily, because it focused to much on looking at most recent users. I'm not interested in another "user ranking". And my question hasn't found its answer at .

It would be nice to see what users have recently been active. This is somewhat standard with many forum-style websites, showing how active the site has been in the last n-minutes or so. As a functional advantage, this also serves to let you know when is a good time to get a question in.


I have a question. I don't know this makes any sense but i really need an answer  when i use "==" as  Integer i1 =10; Integer i2 = 10; if(i1 == i2) {System.out.println("same object")}   output = same object  However , if i use "=="  String obj1 = new String("xyz");  String obj2 = new String("xyz");  if(obj1 == obj2)    System.out.println("obj1==obj2 is TRUE"); else   System.out.println("obj1==obj2 is FALSE");   output = FALSE  I know that "==" operator looks for the memory location of the object. But what happened in first example; i1 and i2 are not a different objects?

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


If $G$ is a group and $G'$ is generated by $\{xyx^{-1}y^{-1}|x,y\in G\}$, then $G'\trianglelefteq G$ and  $G/G'$ is Abelian.  At first, I thought this is easy because I thought $g[x,y]g^{-1}=[gxg^{-1},gyg^{-1}]$. But it was a mistake. I could not prove that it is also subgroup of G and $G/G'$ is abelian. I need help.

Trying to get my head around the commutator subgroup. This is an excercise from Artin's Algebra:  Let $C$ be the commutator subgroup of $G$. Prove that $G/C$ is abelian.  Here is what I've done:  Let $xC,yC \in G/C$ then $xyx^{-1}y^{-1}C = C$ since $xyx^{-1}y^{-1}$ is a commutator hence belongs to $C$. But then $xyC = yxC$ so $xC$ and $yC$ commute in $G/C$. This can be done for any elements, so $G/C$ is abelian.  This seems somewhat surprisingly short. Is that all there is to it?   Regards


I was wondering if today's modern compilers like MS cc, gcc, clang, icc, newer versions were built with the current version of the same compiler?  Because of course of this risk:    I'm sure everyone involved with the afore-mentioned compilers' development knows about this issue, whereby code is injected into the compiler by an earlier version of itself and propagates invisibly.  Now the real problem, is not really one of backdoors, but much more about code generation correctness isn't it ? How about if somewhere in the build chain some pervert twist was introduced by pure mistake, and today's compiler generate incorrect code, even if the compiler's source look OK, because of the Ken Thompson's flaw?  So if they are built with themselves, how do they protect themselves?

I've heard of the idea of bootstrapping a language, that is, writing a compiler/interpreter for the language in itself.  I was wondering how this could be accomplished and looked around a bit, and saw someone say that it could only be done by either   writing an initial compiler in a different language. hand-coding an initial compiler in Assembly, which seems like a special case of the first   To me, neither of these seem to actually be bootstrapping a language in the sense that they both require outside support.  Is there a way to actually write a compiler in its own language?


Before the  a set $A$ was defined to be measurable iff the inner and outer measure of it coincide $\lambda_*(A)=\lambda^*(A)$. Caratheodory found a definition for measurable sets which only uses the outer measure: $A$ is measurable iff for each set $B$ we have $\lambda^*(B)=\lambda^*(B\cap A) + \lambda^*(B\cap A^C)$.     What is the intuition behind the criterion of Caratheodory? Why is the property $\forall B: \lambda^*(B)=\lambda^*(B\cap A) + \lambda^*(B\cap A^C)$ equivalent to $\lambda_*(A)=\lambda^*(A)$?   Background of my question: This is a follow up of an  given by  in my question  With his answer I can provide an answer for my question for $A\subseteq B$ and $B$ being a set higher dimensional interval $[a,b)^n$ (or another set for which we already have define its measure). However I do not find a proof that $\lambda^*(B)=\lambda^*(B\cap A) + \lambda^*(B\cap A^C)$ leads to $\lambda_*(A)=\lambda^*(A)$ for $A\not\subseteq B$.

This week I saw the definition of a measurable set for an outer measure.     Let $\mu^*$ be an outer measure on a set $X$. We call $A \subseteq X$ measurable if $$\mu^*(E) = \mu^*(A\cap E) + \mu^*(A^c\cap E)$$ for every $E \subseteq X$.   This is not the first time I've seen this definition. Unlike most other things in mathematics, over time I have gained absolutely no intuition as to why this is the definition.   The only explanation I've ever seen is that a set is measurable if it 'breaks up' other sets in the way you'd want. I don't really see why this is the motivation though. One reason I am not comfortable with it is that you require a measurable set to break up sets which, according to this definition, are non-measurable; why would you require that? Of course, you can't say what a non-measurable set is without first defining what it means to be measurable so I suppose no matter what your condition is, it will have to apply to all subsets of $X$.     Is there an intuitive way to think about the definition of measurable sets? Is there a good reason why we should use this definition, aside from "it works"?


I am currently having some trouble on one of my assignments. I want to use a scanner to read the input file and put each number in the file into a int array. I found an answer through .  But when I used this code it returned something weird. Below is my input, code, and output.   20401 11087 62176 70095 20947 20098 90914 53475 51251 20065  Scanner s = new Scanner(new File(fileName));     int[] list = new int[10];     int i = 0;     while(s.hasNextInt())     {         list[i] = s.nextInt();         i++;     }     s.close();     System.out.print(list);   The output is [I@42a57993. Can someone please explain what I might be doing wrong.   Soultion: System.out.println(Arrays.toString(list)); Returns it properly. Thanks

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]


I am using a Nikon D3200 and I think there is a mismatch between the image seen on the view-finder and the image which appears on the CCD array. I have never been able to achieve the sharp focus as one would expect. The image on the screen is sharp but the actual photos are poor. Any reason for this problem?

I use a Canon EOS Rebel T3i (600D) with the kit lens. I have experimented a lot with different settings and modes, but I feel like I have wasted many good shots that could have looked amazing, if only they were a little bit sharper.  I use auto-focus on most of my pictures and make sure to choose the right focus point, but all of my photos are still a little bit out of focus. When I zoom in, I can see that the pixels are not very crisp or well-aligned.  I am not sure if this issue is caused by my equipment or skills.


How do I fix this error:     E: The package ubuntu-advantage-tools needs to be reinstalled, but I   can't find an archive for it.   I'm trying to reinstall ubuntu-advantage-tools and I used these commands:   i did      aptitude remove ubuntu-advantage-tools     sudo apt update     sudo apt install ubuntu-advantage-tools   But it didn't work   I found this website   then i download the pack for server but i dont know how to install there is no .sh to do it

Running Synaptic I get the following error message:  E: The package hl1440lpr needs to be reinstalled, but I can't find an archive for it. E: Internal error opening cache (1). Please report.   Upon accepting the message, Synaptic quits.


Many times i get confused whether i should use 's with a noun or not. For example:   Engine parts or Engine's parts Human brain or Human's brain Wordpress plugin or Wordpress' plugin Computer program or Computer's program etc.   I want to know why and when we use one or the other. What do you call such a group of words? Is it a phrase? It should be noted that English is not my native language so pardon my ignorance.

I would like to know what the rule is to explain why we do not use the genitive construction hotel's room. Instead, we say "a hotel room".  Other examples:      a hospital bed   a bike stand   Would it suffice to ask "What kind of..."?


We have our sitemap submitted to WMT. But we have a lot of Orphan pages on our website, and it seems that they do not rank or do not appear on search, therefore, hardly have any traffic or no traffic at all.   My theory: why would Google rank the pages that the own website do not link towards them. So we should add at least one link to each of those pages. (Because they are relevant pages to our website)  But how does it really work? Is it enough to submit a sitemap to WMT to have orphan pages indexed and ranked?

We use a  on Stack Overflow, but I have mixed feelings about it.  Web crawlers usually discover pages from links within the site and from other sites. Sitemaps supplement this data to allow crawlers that support Sitemaps to pick up all URLs in the Sitemap and learn about those URLs using the associated metadata. Using the Sitemap  does not guarantee that web pages are included in search engines, but provides hints for web crawlers to do a better job of crawling your site.  Based on our two years' experience with sitemaps, there's something fundamentally paradoxical about the sitemap:  Sitemaps are intended for sites that are hard to crawl properly. If Google can't successfully crawl your site to find a link, but is able to find it in the sitemap it gives the sitemap link no weight and will not index it!  That's the sitemap paradox -- if your site isn't being properly crawled (for whatever reason), using a sitemap will not help you! Google goes out of their way to make :  "We cannot make any predictions or guarantees about when or if your URLs will be crawled or added to our index"  "We don't guarantee that we'll crawl or index all of your URLs. For example, we won't crawl or index image URLs contained in your Sitemap."  "submitting a Sitemap doesn't guarantee that all pages of your site will be crawled or included in our search results"   Given that links found in sitemaps are merely recommendations, whereas links found on your own website proper are considered canonical ... it seems the only logical thing to do is avoid having a sitemap and make damn sure that Google and any other search engine can properly spider your site using the plain old standard web pages everyone else sees. By the time you have done that, and are getting spidered nice and thoroughly so Google can see that your own site links to these pages, and would be willing to crawl the links -- uh, why do we need a sitemap, again? The sitemap can be actively harmful, because it distracts you from ensuring that search engine spiders are able to successfully crawl your whole site. "Oh, it doesn't matter if the crawler can see it, we'll just slap those links in the sitemap!" Reality is quite the opposite in our experience. That seems more than a little ironic considering sitemaps were intended for sites that have a very deep collection of links or complex UI that may be hard to spider. In our experience, the sitemap does not help, because if Google can't find the link on your site proper, it won't index it from the sitemap anyway. We've seen this proven time and time again with Stack Overflow questions. Am I wrong? Do sitemaps make sense, and we're somehow just using them incorrectly?


I have installed the 32 bit version of ubuntu while I should have installed the 64-bit version of ubuntu. I am trying to have a daul boot between windows 8 and linux. The  problem comes when I am trying to run boot-repair on the 32 bit version of ubuntu and it complains by saying that I need to have a 64-bit version of ubuntu to support the efi system.When I try to download the 64 bit version on my computer, the archive manager stops and claims that there is an error, how do I work around this.

I've got a 32-bit Ubuntu installation running on 64-bit hardware. Now that , I would like to switch to 64-bit without having to reinstall the OS.  This is one of the :  Shawn installed his system using the 32-bit version of Ubuntu, but his hardware is 64-bit and he wants to switch over. He manually installs the amd64 versions of dpkg and apt, replacing the i386 versions and changing which architecture is used as the default; then he installs the amd64 ubuntu-minimal package; then he installs the amd64 ubuntu-desktop package. Over time the remaining i386 packages are replaced automatically on upgrade.  However, when trying to follow the instructions in there, I cannot find any 64-bit version of dpkg or apt.  Did this user story got implemented in a different way in the final spec, or do I need to do something differently?  In short, how can I switch my 32-bit installation to 64-bit?


Why is the word "welcome" spelled with one "l"?  Somewhere in the answers I found a good explanation of the meaning of " welcome".   Example: "You have done well to come to me; I am pleased to do it"  According to this meaning, "welcome" should be spelled with two L  Where in the history did the change take place?

In , simplification is stated as one reason for spelling variations in American English. But unlike in color and favorite, the number of letters to spell the word in fulfil increases in American English.  Other than for "creating a distinct" variant, is there any reason for the change? Going by  the ideal spelling should be fullfill, so even that may be not a motivation.


There seems to be a "follow" button in other people's posts that I can click on and receive notifications from. However, I seem to always receive notifications for my own questions without the ability to unfollow them. (The "follow" button is replaced by a "delete" button respectively.)  As a comparison, on GitHub, you can watch/unwatch a repository (which determines whether you receive notifications from that repository). You are initially watching your own repository, but you have the ability to unwatch your repository.  Given that I don't want to receive any notifications from my own questions, what should I do? (This isn't necessarily disassociation, I need to be able to receive reputation from upvotes/people need to know that it was me who posted this question.)

Say I asked a question that gained some attention but also want to not be connected to the question in case my workplace stumbles upon it since it questions the company I'm working for.   How can I remove my connection to this question?


How could you achieve this look (simple, 90s 3D with minimal lighting and shading) in Blender? Rendering it at a small size is a given. Any other ways to make it look like this?

I just finished the doughnut tutorial series and wanted to know what I need to learn next. I was wondering whether anyone has any advice about how to make the shading and water/fire simulations/particles look more like 90s oldschool animation (like ,  or ). It would really help me. Thanks a bunch!


Because of the the Hubble red shift pattern, Cosmologist generally assume that space is expanding. They assume this is a fact because of the observed redshifts and GR says it can be so. But how can we tell the difference between two objects receding from:   sitting "stationary" in expanding space, or moving apart through space?

Given 2 objects moving at some velocity $v$ relative to one another, is it possible to determine whether they are moving or whether the space between them is expanding?


I am interested to know, after the death of Durin's bane by Gandalf, were there any Balrogs left in Middle-earth, or was it the last Balrog?

Is any reference made anywhere in Tolkien's novels about the number of Balrogs in existence after the demise of the Balrog of Moria? Since Balrogs are described as powerful magical entities that even Gandalf feared, I am assuming that they were created specifically by Morgoth, rather than being a natural species that extend their existence via procreation.   Is there any documentation of a specific number of Balrogs in existence at any one time or any details as to what they specifically are?


First I tried to use integration: $$y=\lim_{n\to\infty}\frac{a^n}{n!}=\lim_{n\to\infty}\frac{a}{1}\cdot\frac{a}{2}\cdot\frac{a}{3}\cdots\frac{a}{n}$$ $$\log y=\lim_{n\to\infty}\sum_{r=1}^n\log\frac{a}{r}$$ But I could not express it as a riemann integral. Now I am thinking about sandwich theorem.  $$\frac{a}{n!}=\frac{a}{1}\cdot\frac{a}{2}\cdot\frac{a}{3}\cdots\frac{a}{t} \cdot\frac{a}{t+1}\cdot\frac{a}{t+2}\cdots\frac{a}{n}=\frac{a}{t!}\cdot\frac{a}{t+1}\cdot\frac{a}{t+2}\cdots\frac{a}{n}$$ Since $\frac{a}{t+1}>\frac{a}{t+2}>\frac{a}{t+1}>\cdots>\frac{a}{n}$ $$\frac{a^n}{n!}<\frac{a^t}{t!}\cdot\big(\frac{a}{t+1}\big)^{n-t}$$ since $\frac{a}{t+1}<1$, $$\lim_{n\to\infty}\big(\frac{a}{t+1}\big)^{n-t}=0$$ Hence, $$\lim_{n\to\infty}\frac{a^t}{t!}\big(\frac{a}{t+1}\big)^{n-t}=0$$ And by using sandwich theorem, $y=0$. Is this correct?

I need to prove that :  $$\lim_{n \to \infty} \frac{x^n}{n!}=0$$  I tried to prove it using epsilon-delta, but I still haven't managed to prove it.  I think that maybe with sandwich theorem it possible to prove it.  Any help will be appreciated.


One principle in general relativity is that the wordlines of massless particles are null geodesics. It also seem to be a commonly stated fact (for instance see eq. (3.62) in Section 3.4 of Carroll's GR text) that one can parameterize the worldline of a massless particle as $x(\lambda)$ such that $$\frac{dx^{\mu}}{d\lambda} = p^{\mu}, \tag{1}$$ where $p^{\mu}$ is the four-momentum of the massless particle. To clarify what is meant by four-momentum, the energy of a particle with four-momentum $p$ as measured by an observer moving with four-velocity $U$ is $-p_\mu U^\mu$.  Now I understand why one could pick a parameterization that satisfies (1) at a particular point. But why must such a parameterization satisfy (1) globally?  The only argument I have is that such a parameterization always exists for the world-line of a particle with mass, and taking the limit to light speed suggests that such a parameterization should also hold for the world-lines of massless particles.  My question is: what are some other arguments for why the parameterization should exist?

I am following Carroll's GR book. He explain that it is convention to parameterize geodesics of photons by a parameter $\lambda$ such that  $$p^\mu ~=~ \frac{d x^{\mu}}{d \lambda}.\tag{3.62}$$  But this is the definition of 4-velocity for a massive particle in the case of $\lambda=\tau$ equal to proper time. My question then, is $$u^\mu = p^\mu$$ for all massless particles? I ask because it's well-known that proper time $\tau$ freezes for massless particles.


I need to split a list into halves such that if it has an odd length the middle element is ignored entirely, I have a function for this, but it's quite slow for what I'm trying to do.  My function (variables renamed because they make no sense out of context):  def splitList(array):     half = len(array)/2     if len(array)%2==0:         return array[:half], array[half:]     else:         return array[:half], array[half+1:]   This function has to be called about 17 million times if my estimations are correct, so it has to be rather faster. Since I'm new to this though, if you could explain why your answer works faster, that would be perfect :)  last-minute thingy: it's for a small part of a projectEuler challenge if you were wondering, you're supposed to be able to get an answer in under a minute is why it has to be so fast.

I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question:


I want to prove following:     Suppose $p$ and $q$ are distinct primes. Then there is no simple group of order $pq^2$.   If $|G|=pq^2$, then there are two Sylow subgroups of order $p$ and $q$. Then I think I need to use third Sylow theorem. Third Sylow theorem implies that $n_p\mid q$. Thus $n_p=1$ or $n_p=q$. When $n_p=1$ we are done. So suppose $n_p=q$. Then how do I proceed the proof?

Suppose that I have a group $G$ of order $p^{2}q$ for two distinct primes $p$ and $q$.  I need to first show that one of its Sylow subgroups is normal.  I start by letting $H$ be a Sylow $p$-subgroup and $K$ be a Sylow $q$-subgroup.  If $K$ is not normal, then letting $r$ denote the number of Sylow $q$-subgroups, I have that $r|p^{2}$ and $r\equiv 1$(mod $q$).  I also have by the second Sylow theorem that $r\neq 1$.  So $r = p$ or $p^{2}$.  If $r = p^{2}$, I can write out the Sylow $q$-subgroups, and count their combined elements to show that $H$ is uniquely determined and then again imply Sylow number $2$ to obtain that $H$ is normal.  But if $r = p$, then I cannot see how to proceed.  Can anyone give any advice?  Thank you.  ( I am happy to provide more detail for the $r = p^{2}$ case if it is desired or appropriate. )


Not sure what I'm doing wrong.  Here's my work:  Expressing the first part $A \setminus (B\setminus C)$ using logical symbols:  $A \land \neg(B \land \neg C)$ becomes  $A \land \neg B\lor C$ (De Morgan's law)  While the second expression $(A \setminus B) \cup (A \cap C)$ is   $(A \land \neg B) \lor (A \land C)$ which becomes  $A \land \neg B \lor A \land C$ (Associative Law)  or $A \land \neg B \land C$  How are these two expressions similar? Thanks for any help in advance!

Show that  $A \setminus ( B \setminus C ) \equiv ( A \setminus B) \cup ( A \cap C )$  This is an exercise I was trying to do ( not homework ) and I got stuck as follows:  Working from $A \setminus ( B \setminus C )$:  $x \in A \wedge x \notin ( B \setminus C )$ $x \in A \wedge ((x \in B \wedge x \in C) \vee (x \notin B \wedge x \in C) \vee (x \notin B \wedge x \notin C) )$  At this point I'm not sure how to proceed.  Working from the other side $ ( A \setminus B) \cup ( A \cap C ) $:  $ x \in ( A \setminus B) \cup ( A \cap C ) $  $ x \in ( A \setminus B) \vee x \in ( A \cap C ) $  $ ( x \in A \wedge x \notin B ) \vee ( x \in A \wedge x \notin C ) $  $ x \in A \wedge (x \notin B \vee x \notin C ) $  $ x \in A \wedge x \notin ( B \cap C ) $  $ A \setminus ( B \cap C ) $  I could also use some formating tips like how display logical not and how to get the lines to display properly without blank lines inbetween. :-)


I have the following files and directories configuration:  -Parent_dir     |-delme_dir     |-delme_file     |-aFile     |-sub_dir         |-delme_dir         |-delme_file         |-aFile         |-sub_dir             |-delme_dir             |-delme_file             |-aFile     |-sub_dir2         |-delme_dir         |-delme_file         |-aFile   Is there a command that I can use from the Parent_dir to recursively remove all the delme_dir directories and the delme_file files ?

How do I safely delete all files with a specific extension (e.g. .bak) from current directory and all subfolders using one command-line? Simply, I'm afraid to use rm since I used it wrong once and now I need advice.


I have a windows 2008 r2 server on my companies network which is locked down and only allows certain ports through for specific ip addresses. so a simple tracert will not work for what I need since it does not allow for specifying a port.  is there any applications out there that will provide similar results as tracert but allow you to specify port?  I am being told that the issue I am experiencing is outside of our network when I am almost certain it is inside our network but only way to prove it is with a trace to show where the packets are being dropped at.

I'm trying to determine where connectivity to an external host using a specific TCP port is being blocked. Traceroute for Windows only uses ICMP, and telnet will only tell me that the port is blocked and not where. Does anyone know of a Windows utility similar to traceroute that will achieve this?


I would like to know how to bind the methods used by the "Connect" button which retrieve services capabilities through the OWSConnect to correctly build the URL with paramas (or QgsDataSourceURI) from each layer capacity without opening the dialog or request the GetCapabilities URL by myself.  I'm looking for a "pure" PyQGIS solution, not using a dependency like OWSLib because I need parse ArcGIS Server services (Map and Features).  Any idea?    I'm interested in PyQGIS 2.18.x and 3.x.

How would one save a WMS view to a local raster from the python command line?  I've seen the answer to  and that works for me but I'd like to know how to replicate that process exactly from the console.  ie How to progamatically set the layer, the extent to save, and then save that extent for that layer to a tif?  All of the searches I did threw up lots of results of people suggesting that downloading via wfs was the best solution. Or the linked solution via the gui. But none pointed me to the OWSLib solution.    Here is the working code I made on the back of the answer from @nmtoken I got.  from owslib.wms import WebMapService from osgeo import gdal, osr import processing  url='http://<mapserverurl>/MapServer/WMSServer?service=WMS' folder = '~/output' wms = WebMapService(url, version='1.1.1') wms_layers= list(wms.contents)   for layerno in range(0,len(wms_layers)):     raw_tiff=os.path.join(folder,'_raw'+str(layerno)+'.tif')     georeferenced_tiff=os.path.join(folder,'_georeferenced'+str(layerno)+'.tif')     defaultepsg=4326      #Note that available epsgs can be determined with:     print wms[wms_layers[0]].crsOptions     srs_string='EPSG:'+str(defaultepsg)     lonmin=1     lonmax=2     latmin=4     latmax=5     Xpix=400     Ypix=300     #Note output options can be determined with:     print wms.getOperationByName('GetMap').formatOptions     img = wms.getmap( layers=[wms_layers[layerno]], styles=['default'], srs=srs_string, bbox=( lonmin,latmin , lonmax,latmax), size=(Xpix, Ypix), format='image/tiff' )     out = open(raw_tiff, 'wb')     out.write(img.read())     out.close()     out = None      #Georeferencing     src_ds = gdal.Open(raw_tiff)     format = "GTiff"     driver = gdal.GetDriverByName(format)     dst_ds = driver.CreateCopy(georeferenced_tiff, src_ds, 0)     gt = [lonmin, (lonmax-lonmin)/Xpix, 0, latmax, 0, -(latmax-latmin)/Ypix]     dst_ds.SetGeoTransform(gt)     srs = osr.SpatialReference()     srs.ImportFromEPSG(defaultepsg)     dest_wkt = srs.ExportToWkt()     dst_ds.SetProjection(dest_wkt)     dst_ds = None     src_ds = None


i have a ps4 and want to play gta with someone who has a ps3. i know you can’t crossplay those, but what if i bought gta for ps3 and played it on my ps4? could we play together then? or is it still different servers?

Grand Theft Auto Online exists on five different platforms: XBox 360, PS3, XBox One, PS4, and PC. Do any of these play on the same servers, allowing people on differing platforms to play together?


Eddington once gave the following quote:  The law that entropy always increases, holds, I think, the supreme position among the laws of Nature. If someone points out to you that your pet theory of the universe is in disagreement with Maxwell's equations—then so much the worse for Maxwell's equations. If it is found to be contradicted by observation—well, these experimentalists do bungle things sometimes. But if your theory is found to be against the second law of thermodynamics, I can give you no hope; there is nothing for it but to collapse in deepest humiliation.  What did Eddington mean by this?  Why did he give a special status to the Second Law of Thermodynamics?

Eddington wrote     The law that entropy always increases holds, I think, the supreme position among the laws of Nature. If someone points out to you that your pet theory of the universe is in disagreement with Maxwell's equations — then so much the worse for Maxwell's equations. If it is found to be contradicted by observation — well, these experimentalists do bungle things sometimes. But if your theory is found to be against the second law of thermodynamics I can give you no hope; there is nothing for it but to collapse in deepest humiliation.   and Einstein wrote     [classical thermodynamics] is the only physical theory of universal content which I am convinced will never be overthrown, within the framework of applicability of its basic concepts.   Why did they say that? Is it a very deep insight they had, or is it something one can be convinced of quite easily? Or even, is it trivial?


I have found a this  with the following piece of code:   CompletableFuture<T> completable = new CompletableFuture<T>() {       @Override       public boolean cancel(boolean mayInterruptIfRunning) {           // propagate cancel to the listenable future           boolean result = listenableFuture.cancel(mayInterruptIfRunning);           super.cancel(mayInterruptIfRunning);           return result;       }   };     What does this syntax means? Is this method overriding a method in the class without extending it?

What is the use of anonymous classes in Java? Can we say that usage of anonymous class is one of the advantages of Java?


Let $A = \{1,2,3,\ldots,99\}$. Let $S$ be a subset of $A$ with $10$ elements. Show that there exist two disjoint subsets of $S$ such that sum of their elements is the same.  Example: $S = \{1,4,7,9,67,70,83,85,90,97\}$ and we can choose $\{7,90\}$ and $\{97\}$ as two subsets of $S$ with sum of elements the same.

Let  $$S_X = \sum_{x\in X}x$$  and  $$Z = \{1,2,3,...,106\}$$  Prove that, for all subsets $A$ of $Z$ of cardinality $10$, there exist distinct subsets $B,C$ of $A$ such that $S_B=S_C$. Then prove that there exist disjoint subsets $B$ and $C$ of $A$ with that property.  (I have no idea why the problem decided to choose that set instead of, say, $\mathbf N\backslash\{0\}$, but it makes me think it might start failing for larger numbers.)


When you're designing a document and you have to place a bunch of logo endorsements in the document, how do you make all the logos seem the same size?   Is there a more mathematical or scientific way of matching logo sizes other than using your eye?  I am contemplating on using the area size of each logo, but Adobe Illustrator has no way to resize logos according to their area size, you can only resize logos according to their width or height dimensions. The actual area size has to be calculated and it becomes messy and complicated.

A regular challenge that I face is balancing two (or more) logos. Whether they need to be equal or one needs to be given priority. Some logos however might be squares, others rectangles, circles, etc...   As a quick sample I snagged a nice high resolution photo from  and pretend its going to be an advertisement that needs to show some footwear brand logos on it. In this case I used Adidas and Saucony.  This is certainly not balanced even though they're height is the same:    Likewise this is not balanced even though they're width is the same:    So then the question becomes when are they in balance, is this balance:    Maybe a little more adjustment, is this balance:    And in these examples I'm only working with two Black Logos. Factor in color and it can get even more difficult to balance. Another issue being when there's tiny text as part of the logo.  So the question is, other than estimating / eye-balling it, what tips, methods or even tools are there to balance different sized logos?


I understand that naming conventions for code have an element of personal preference, and can be subjective and argumentative, which isn't the goal of these sites.  But, I'm really looking for feedback on demonstrating that some current naming conventions I'm forced to use hurt readability and do more harm than good.  Where should I ask this question? Stack Overflow? Or does this belong on the  site?

I just got a question closed because it was rendered subjective by the moderators. The question is important to me and I believe other people would benefit. So, I ask the following non subjective question: on which site of the Stack Exchange ecosystem should I post  question?


When using Nautilus, sometimes I want to jump do a directory (or a file) that I know is in there, but I don't want to visually look for it.  The easy way to do that in Windows (and, for what I can remember, in previous versions of Ubuntu) is to simply type the element's name and the window manager will browse the displayed element in order to find it.  Right after that, you just have to hit enter to open it.  For instance, if I'm in my home folder and want to access the dev folder, I just type de, enter and I'm in it.    Instead of that, in Ubuntu 13.04, when you free type while you're in Nautilus, it will run a search (I don't know in which scope: the whole folder you're in, I suppose).    Is it possible to disable this mechanism and restore the previous one ?

Until now I was using a "traditional" version of Nautilus: that that comes with Ubuntu 10.10. Now I'm using 3.6.3, included with Ubuntu 13.04 (most likely any recent version is equivalent for the scope of my question, anyway).  One major difference between the two is the search-as-you-type behavior: in classic versions of Nautilus, when you typed an input, the file with the closest alphabetical match would become the selected one, the eligible files/folders being restricted to the current directory.  The new behavior is to perform an optionally-global search instead.  Can one configure Nautilus to provide the previous functionality ?


I have my controller class as:   public class Empty_pageController implements Initializable,Runnable{   Which declares all IDs as:  @FXML  private TextField IDno; @FXML  private TextField branch; ...   Now these is my clear() function to clear the FXML form:  public void clear(ActionEvent Event){     IDno.clear();     branch.clear();     bookname.clear();     ID.clear();     author.clear();     address.clear();     name.clear();     year.clear(); }   Then I have another class (in same package) that calls these clear():  new Empty_pageController().clear(null);   These gives me following error:  Exception in thread "Thread-4" java.lang.NullPointerException at library.Empty_pageController.clear(Empty_pageController.java:147) at library.server.doInBackground(server.java:45) at library.Empty_pageController.run(Empty_pageController.java:84) at java.lang.Thread.run(Thread.java:748)   What I tried after seeing some solutions here: I passed the object of contructor class by following code:  s.doInBackground(this);   and then made changes accordingly in the other class's method:  public void doInBackground(Empty_pageController E) throws InterruptedException {   Then I Called using these statement:  E.clear(null);   I got the same error Don't Know where I'm going wrong....?  EDIT:MY FXML file

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


We're developing a number of banking products to help our users save more money. More importantly, we'd like our users to develop money-saving habits. I'm pretty aware that lots of people have made pretty big lifestyle changes with the help of an app. People can be motivated to get out of the house to get in shape or to drive cars. According to  about changing user behavior, three elements have to be present at the same time: motivation, ability and triggers. Take an uber driver as an example:    Motivation - "I want to make some extra money" Ability - "I have a car" Triggers - Uber sends out notifications of events in the area, surge pricing maps, and driver rewards (gas card, insurance discounts, phone plans), and achievement badges.   I've also looked into some ways that fitness apps cause  (I've looked at more, but I can only post two links).  My question is this: There are countless ways to inspire a user to do something. How do we get users to not do something? How do we get users to not spend money?  The idea I'm toying with is to have a badge/achievement system that rewards frugal behaviors like using coupons, not eating out, comparing them to how they were a month earlier, and other methods that don't rely on a dollar amount in a savings account.

For our banking app, our team is trying to encourage our users to keep more money in their savings account. Specifically, to prevent more than 6 transfers per month, of any amount, from savings to checking.  The current (bad) method is to have a message before the "Submit" button with a paragraph of legal jargon that nobody reads.  My current plan is to have a natural-language message that tells the user that there are methods to save more money easily (citing some loss-aversion research), and maybe a call to action that brings them to another savings service. That's the idea I just came up with, and I'd like to have more.  We're just looking for a good way to help people spend less money, which I'm relatively new to.


How Can I Make Extension Method For System.IO.Path Class what i mean that i need something like below:  Path.GetExtension(sFilePath)    i want to make method:  Path.GetMimeType(sFilePath)   Extension Method:  public static string GetMIMEType(this Path sPath,string sFilePath) {         string sExtension = Path.GetExtension(sFilePath).ToLowerInvariant();          if (sExtension.Length > 0 && dicMIMETypes.ContainsKey(sExtension.Remove(0, 1)))         {             return dicMIMETypes[sExtension.Remove(0, 1)];         }         return "unknown/unknown"; }   but when compile above code method get error ('System.IO.Path': static types cannot be used as parameters).  Thanks All,

I'm a fan of extension methods in C#, but haven't had any success adding an extension method to a static class, such as Console.  For example, if I want to add an extension to Console, called 'WriteBlueLine', so that I can go:  Console.WriteBlueLine("This text is blue");   I tried this by adding a local, public static method, with Console as a 'this' parameter... but no dice!      public static class Helpers {     public static void WriteBlueLine(this Console c, string text)     {         Console.ForegroundColor = ConsoleColor.Blue;         Console.WriteLine(text);         Console.ResetColor();     } }   This didn't add a 'WriteBlueLine' method to Console... am I doing it wrong? Or asking for the impossible?


A single photon, passing through a beamsplitter (BS), ends up in the state $\frac{1}{\sqrt2}(a_1^\dagger + a_2^\dagger)\lvert\operatorname{vac}\rangle$, which is a coherent superposition of the two possible spatial modes. Let us consider its momentum.  When the photon goes straight its momentum doesn't change. However, when the photon gets deflected, some amount of momentum must have been transferred to the BS, which therefore acquires some (small) amount of momentum in the opposite direction of the photon (see image below). This new tiny momentum will correspond to some phononic excitation of the BS crystalline structure, or something like that.     Because the photon ends up in a superposition of the two output modes, the complete output state must be something of the form: $$ \frac{1}{\sqrt2} \Big(\lvert\text{photon up}\rangle\lvert\text{BS steady}\rangle+\lvert\text{photon right}\rangle\lvert\text{BS momentum changed}\rangle \Big).$$ However, we do not care about the final state of the BS, so that the final state of the photon will be obtained by partial tracing over the BS degree of freedom.  And here comes the catch: a naive calculation would now lead to the conclusion that, after partial tracing, the final state of the photon is $$ \frac{1}{2} \Big(   \lvert\text{photon up}\rangle\langle\text{photon up}\rvert +   \lvert\text{photon right}\rangle\langle\text{photon right}\rvert \Big). $$ This is a completely mixed state, which means that the photon is not in a coherent superposition of the output modes.  Now, we know very well that this is not actually the case, as the fact that the photon does end up in a coherent superposition is easily tested and well enstablished. So what did we get wrong? The only logical conclusion (that I can see) is that $\lvert\text{BS steady}\rangle$ and $\lvert\text{BS momentum changed}\rangle$ are not orthogonal states, so that partial tracing does not lead to a totally mixed state for the photon.  So here comes the question: why are the two final states of the BS not orthogonal? Is there a clean way to see this?  Moreover, given that these two states are also necessarily not the same, this means that partial tracing will always lead to some small amount of mixedness in the final photon state. Does this mean that there is a fundamental limit in the purity of the final photon state?

In many experiments in quantum mechanics, a single photon is sent to a mirror which it passes through or bounces off with 50% probability, then the same for some more similar mirrors, and at the end we get interference between the various paths. This is fairly easy to observe in the laboratory.  The interference means there is no which-path information stored anywhere in the mirrors. The mirrors are made of 10^20-something atoms, they aren't necessarily ultra-pure crystals, and they're at room temperature. Nonetheless, they act on the photons as very simple unitary operators. Why is it that the mirrors retain no or very little trace of the photon's path, so that very little decoherence occurs?  In general, how do I look at a physical situation and predict when there will be enough noisy interaction with the environment for a quantum state to decohere?


My question is this: should passive or active perception be used for spotting traps? If you use passive, then the DM knows ahead of time whether or not a PC will spot a trap as no die roll is involved (eg. if the highest passive perception is 13, and the DM makes the spot trap DC 14, the PCs will not see it). I would like to avoid railroading PCs by knowing ahead of time which traps they will see and which they will or won't see. Another problem with passive perception is that you have a 50% chance of getting lower than your passive perception every time you make an active perception check, so you are actually better off never looking for things, and just hoping you notice them. In summary, when should I use passive perception and when should I use active perception?

So, I'm trying to figure out how to run the scene from the beginning of Lost Mine of Phandelver (5e starter set) where the party is ambushed by goblins and I'm really confused as to how Passive Wisdom (Perception) works.  The included rulebook mentions on page 6 :     When you hide, there’s a chance someone will notice you even if they aren’t searching. To determine whether such a creature notices you, the DM compares your Dexterity (Stealth) check with that creature’s passive Wisdom (Perception) score, which equals 10 + the creature’s Wisdom modifier, as well as any other bonuses or penalties. If the creature has advantage, add 5. For disadvantage, subtract 5. For example, if a 1st-level character (with a proficiency bonus of +2) has a Wisdom of 15 (a +2 modifier) and proficiency in Perception, he or she has a passive Wisdom (Perception) of 14.   So the party is being ambushed by goblins and at that point the DM guide mentions on page 7 :     Check to see who, if anyone, is surprised. [...] Make a Dexterity (Stealth) check for the goblins, rolling once for all of them. Roll a d20, add the goblins' Stealth skill modifier (+6) to the roll and compare the result to the characters' Passive Wisdom (Perception) scores.   So to me this reads like I should roll 1d20+6 for the goblins and compare that to the static Passive Wisdom (Perception) score on the character sheet of a PC. The PCs don't get to roll anything as they're not actively looking for enemies, even though they are investigating the dead horses.  I would also think that if the characters were supposed to roll, the DM guide would clearly instruct so, given that this is the starter set.  However, watching  at around 8:01 I notice that the DM is explicitly asking his party for a perception roll. And the same thing happens on a couple of other videos where people are running the Lost Mine adventure. The DM always requests a roll.  So what gives? Shall I take it that the DMs ask for the roll because they consider the party to be actively seeking for hidden foes? Or am I just misreading the rulebook and the DM guide?


I need voltage regulator to convert high range of Vin 20-60V to fixed 5 or 12V and the maximum output current is 200mA. What could be the efficient way to do this?

I am using a 36 V battey pack (10s 2.5 A each cell 3.6V.) Its maximum voltage is 42 V. I am using a STM32 microcontroller whose input is 3.3 V.  I am designing a PCB in which the power supply is drawn from the battery pack (42 V.) I would like to power the STM32 microcontroller from the battery pack power supply.  I would like to regulate 42 to 3.3 V so that I can power my STM32 microcontroller.   Which method is best to convert it either using regulator or buck converter based on the pcb designing?  Battery Specification: 10s1p   Battery pack nominal voltage: 36 V Battery pack maximum voltage: 42 V Battery pack current: 2500 mAh   Microcontroller specfication: STM32F401RCT6   Supply voltage: 3.3 to 3.6 V Supply current: 100 to 160 mA     Which method or component is best to regulate 42 V so that I can power my microcontroller with 3.3 V?


I have looked at several pages and still am not getting clear instructions on how to download and install a .deb file. Specifically I would like to download this one:   How can I do this?

How can I install applications like Google Chrome on Ubuntu?  Are there any commands to install an application?    Index of answers:


I just built a PC and I have 2 hard drives. I'm currently booting off the SSD with Windows, and I want to install Ubuntu on the other HDD. I downloaded the ISO, now what? Can I install it without having to burn it onto a cd/USB Flash Drive or anything else?

I don't want to burn a CD, DVD or USB memory stick. And I don't care about saving the existing operating system (Linux Mint). I want to install Ubuntu (actually Kubuntu 12.04 LTS) to the computer directly from the ISO image. The image is for the Kubuntu Live DVD (3.5 GB).  The computer is now booted into Linux Mint. A set of command line steps would be satisfactory. In my mind, I simply need to trick the existing system into thinking I inserted a CD/DVD, right?  I know there is a similar question already but it does not have a good answer. The answer basically says, "see this link." I reviewed the link and I decided that StackExchange needs a good answer to this question. Furthermore, most answers at other places on the Internet assume the user is coming to Ubuntu from Windows. So I think this question is one that needs a good answer here. Thanks


This is what my achievements on all SE sites look like on Firefox 49.0.2 and Chrome 54.0.2840.99 m (64-bit):    But this is what it looks like on Microsoft Edge 38.14393.0.0:    If I recall correctly, the latter picture is how it used to be in all browsers.    It seems like the width of .achievements-dialog .message-text is too big:  .achievements-dialog .message-text {     margin-left: 2px;     width: 276px; }     Is this a  or ?

This is the achievements drop-down on Ask Ubuntu:    It doesn't look very good. The same happens on Meta SE - so it's a new and old top-bar issue.    Mac OS 10.12.6, Chrome 60.0.3112.113. Also happens in Safari 11.0 and Chrome incognito mode with no extensions, so is not a user-script issue. Zoom at 100%.  Does not happen with Chrome on Windows 10.


I found this post about implementing a hashmap in typescript, and I've got that working, except for removing something from the hashmap.    I add something by doing Input.keys[event.key] = event.keyCode; to add a key to my abstract Input class's keys field that is a hashmap. How can I remove something from it?

Say I create an object as follows: let myObject = {   "ircEvent": "PRIVMSG",   "method": "newURI",   "regex": "^http://.*" };  How should I remove the property regex to end up with new myObject as follows? let myObject = {   "ircEvent": "PRIVMSG",   "method": "newURI" };