I am trying to implement IDisposable in a sample program. If I use SqlConnection class inside a using block statement, it will automatically dispose it.  public int testCon() {     using (SqlConnection conn = new SqlConnection("Conn string"))     {         using (SqlCommand cmd = conn.CreateCommand())         {             conn.Open();             cmd.CommandText = "SELECT COUNT(1) FROM Carsd";              return (int)cmd.ExecuteScalar();         }     } }   I have created a class and implemented IDisposable. I have created a new instance inside a using block statement.   class Program  {     static void Main(string[] args)     {         testDispose objTestDispose;          using (objTestDispose = new testDispose())         {             objTestDispose.UserName = "testUser";             objTestDispose.PassWord = "testPassword";                                         }          Console.WriteLine("Check obj of testDispose Class" + objTestDispose.UserName);         Console.WriteLine("Check obj of testDispose Class" + objTestDispose.PassWord);         Console.ReadLine();      }         }  public class testDispose : IDisposable {     public string UserName { get; set; }     public string PassWord { get; set; }      public void Dispose()     { }               }   I believe, using block automatically call dispose method. So, if I am create a new instance in using block, it would be dispose after existing using block. But, still I am able to access objTestDispose object outside of the using block.WHY?   Please suggest.  UDPATE   Mr.BWA..Thank you for the making my question duplicate. but you should know I am a student and learning. I have this question in my mind so I have asked here.  **You can not say that IDisposable interface only for unmanaged resources.**I can also remove managed resources. It depends on the situation. As per the below  -      What if your object has allocated a 250MB System.Drawing.Bitmap (i.e. the .NET managed Bitmap class) as some sort of frame buffer? Sure, this is a managed .NET object, and the garbage collector will free it. But do you really want to leave 250MB of memory just sitting there – waiting for the garbage collector to eventually come along and free it? What if there's an open database connection? Surely we don't want that connection sitting open, waiting for the GC to finalize the object.      If the user has called Dispose() (meaning they no longer plan to use   the object) why not get rid of those wasteful bitmaps and database   connections?      So now we will:      get rid of unmanaged resources (because we have to), and get rid of   managed resources (because we want to be helpful)


How to solve the pde $f u-{xx} − 3u_{xt} − 4u_{tt} = 0$?

On factorizing the pde we get:  $$(∂_x − 4∂_t)(∂_x + ∂_t)u = 0.$$  If we let $w=u_x+u_t$ then $$w_x-4w_t=0$$ and so $w(x,t)=f(t+4x)$ and so  $$f(t+4x)= u_x+u_t.$$ What do I do after this step?


My question is short and concise. Here it goes -  In my book the definition of a set is given as a well defined collection of things and in mathematicse they are well defined collection of mathematical objects. Then why is $\emptyset$ which has nothing is even considered as a set. Is it merely a mathematica convention or is it that it has a special significance ?   Though it is pretty general, I want to know the reason behind it. Thanks for your help .


So I have this computer Hp pavilion dv5220 and I can't use it it's stuck with one user and I don't have that password all I can use is the guest account and I can basically do nothing as a guest it's on 14.04 software and I can't run and updates or anything without an actual account and I no wifi


Why is a large cavity with a small hole at constant temperature approximated as a black body?

I can't understand how a large cavity maintained at a constant inner surface temperature T, with a small opening on its surface behaves like a black body. How is it a perfect emitter and a perfect absorber? Please explain in as simple terms as possible.


How can you get any version of Linux to see the 2018 MacBook Pro SSD?

I have tried      nvme_load=yes in place of      quiet --- with Ubuntu 18.04.1 and Xubuntu 18.04. df -h results in only the system generated mounts and the installation media. The weekly live including firmware image of Debian also fails to discover the ssd.  I have located more information on the SSD. I found this information in the system profiler on OS X High Sierra.   Apple SSD Controller: APPLE SSD AP1024M: Capacity:   1 TB (1,000,555,581,440 bytes) TRIM Support:   Yes Model:  APPLE SSD AP1024M Revision:   177.77.7 Serial Number:  C02829600M9JPD216 Link Width: x4 Link Speed: 8.0 GT/s Detachable Drive:   No BSD Name:   disk0 Partition Map Type: GPT (GUID Partition Table) .  Removable Media:    No S.M.A.R.T. status:  Verified    lsblk from a xubuntu 18.04.1 live installer does not show any pcie or nvme devices.  Note: the installer and Gparted fail to list it. Typically these both require an unmounted drive to work with. So, it simply does not see the SSD. I read that this system uses a PCIE SSD , though im not sure how to send a kernel module to allow use of it.


Making "java -jar OSBuddy.jar" an icon I can execute on my desktop?

Title says it all. I'm really really new with Linux stuff. Using Xfce/Crouton/Ubuntu etc.  If you can be as specific as possible, or linking me to a guide that breaks everything down step by step that would be great. Thanks!


Problem with unexact font sizes in memoir

I have to typeset a thesis and although nobody knows why I have to set it in 12pt with one and a half line spacing, I have to do it. The strange thing is that in the resulting PDF file the font looks smaller, and when I measure the font's size in the PDF file I get the result of: 11.96pt. What could cause that?  Here the example:  \documentclass[a4paper,12pt,oneside]{memoir}  \usepackage{polyglossia}  \usepackage{blindtext}   \newcommand*{\setasuspacing}[1]{% \let\AsuSpacing#1 \AsuSpacing} \setasuspacing{\OnehalfSpacing}  \begin{document} \tableofcontents* \chapter{Test, nothing else – Don't wast you time reading this! It has to have two lines} \section{Don't wast you time reading this! It has to have two lines. It has to have two lines} \Blindtext \footnote{\blindtext} \blindtext \section{Test124} \Blindtext \chapter{Test2} \Blindtext \Blindtext \Blindtext  \end{document}


A issue with htmlspecialchars() and mysql_query()

I have looked at a bunch of different sites and I really don't want to spam y'all. But I'm really desperate and have nowhere else to turn. So here goes...  I am trying to let people post things on my website. And the tutorial I watched told me to use htmlspecialchars() so that people can post things such as greater/less than signs and special symbols and such without breaking anything. But whenever my mysql_query() encounters a single or double quote it throws this error:  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't do this. I won' at line 1   Here is my corresponding code:  $sql = mysql_query("INSERT INTO stories (title, content, username, date_posted) VALUES ('$title', '$content', '$un', now())") or die(mysql_error());   And here's where I used the htmlspecialchars():  $content = $_POST['content']; $content = nl2br(htmlspecialchars($content));   What am I supposed to do to fix this? Please help me.  -Sam


"Search Before Asking": A Four Year Update

A recent downvote drew my attention to my  four years ago to . I edited the answer to update the links and to (very slightly) change the tone of the answer. I was in a very bad mood at the time of the answer.  Still, reading the comments, I think I was largely correct: it's better for the site if we encourage people to do a little research before posting. Maybe even just the "two minutes of searching" that I refer to in the answer.  I was considering deleting the answer, but decided to bring the old debate back to Meta, instead.  "Was I right, or was I right?"


How do I block all ports except 22 and 80 in Fedora's iptables?

I am trying to only allow port 22 TCP/UDP and port 80 TCP/UDP from anywhere using Fedora 15 iptables, and all the rest will be never accessible nor scannable from a public network.   But it never works for me, at the end I turned it off because I am scared it will block me to access even the port 22 myself.  So, my question is, how can I do this in Fedora 15? Block all except for 22, 80 TCP/UDP?  iptables -P INPUT ACCEPT  # Fresh start iptables -F # Localhost/ethernet 0 / yum installation allow iptables -A INPUT -i lo -j ACCEPT iptables -A INPUT -i eth0 -j ACCEPT iptables -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT  # SSH iptables -A INPUT -p tcp –dport 22 -j ACCEPT #iptables -A INPUT -s aa.bb.aa.bb -d xx.yy.xx.yy -p tcp -m tcp –dport 22 -j ACCEPT iptables -A INPUT -d xx.yy.xx.yy -p tcp -m tcp –dport 22 -j ACCEPT  # other iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT ACCEPT  # show iptables -L -v


A single-variable continuous function that is irrational if and only if its argument is rational

I wonder if it is possible to construct a continuous $f : \mathbb R \to \mathbb R$ such that for each $x \in \mathbb R$, $f(x)$ is irrational if and only if $x$ is rational?  my attempt  Sadly, I pretty much don't know where to start with this one. Intuitively I feel this is impossible. But I just can't see what could go wrong. Any help would be appreciated. Thanks!


Everyone! I faced this strange behaviour of Java arrays. I cannot figure out why sampleArray is changing along with class' array? I find this unnatural.  public class Runner {     public static void main(String[] args) {              int sampleArray[] = new int[]{5, -1, 9 ,7 ,3 ,2 ,11 ,0 ,-7 ,6 , 10 ,9};             SortArray testArray = new SortArray(sampleArray);             System.out.println("Initial array is:");             System.out.println(testArray.toString());              testArray.sortArray();             System.out.println("Sorted by Bubbles method array is:");             System.out.println(testArray.toString());             System.out.println("Initial array is");             for (int i = 0; i<sampleArray.length; i++) {                     System.out.print(sampleArray[i]+ " ");             }   }  public class SortArray {     private int anArray[];      SortArray (int inputArray[]) {          this.anArray = inputArray;     }      // Classic Bubbles sorting     public void sortArray () {             int arrayLength = this.anArray.length;             for (int i = arrayLength; i > 0; i--) {                     for (int j = 0; j < i-1; j++) {                             if (anArray[j+1]<anArray[j]) {                                     int tempVariable = anArray[j];                                     anArray[j] = anArray[j+1];                                     anArray[j+1] = tempVariable;                             }                     }             }     }      @Override     public String toString() {             String arrayString = "";             for (int i = 0; i<anArray.length; i++) {                     arrayString = arrayString + anArray[i]+" ";             }             return arrayString;     }   }  After all I keep getting:  Initial array is: 5 -1 9 7 3 2 11 0 -7 6 10 9  Sorted by Bubbles method array is: -7 -1 0 2 3 5 6 7 9 9 10 11  Initial array is -7 -1 0 2 3 5 6 7 9 9 10 11  Process finished with exit code 0   So we see that initial array is changing as well. Why is this happening? It seems to be illogical as I never assign sampeArray another sequence and never change it directly in the code. But it's true. What to do in order to keep the initial array unaffected?


Random r = new Random(); int i1 = r.nextInt(max - min + 1) + min;   I've tried it and it is working but still confuse about the logic used, I want to know that why we add min value to random number in end?


It has been repeatedly explained to me that from the perspective of an outside observer a particle takes "infinite time" to cross the event horizon of a black hole. Also, according to these explanations there is no information inside the black hole because nothing gets inside. Then I read answers to the contrary. Whether or not a particle can cross a horizon does not seem to be answerable when an "infinity" is used to describe events in time. I am not trying to make any statements by this question. I am asking for knowledge that is not conflicting because I also see many questions on this website (with answers) that deal with particles hitting a singularity, inner horizons and how an observer would feel when crossing the horizon for different size black holes (for examples) I hope no-one minds me splitting this question into two parts because I need to do so...  1) Does space-time curvature actually reach infinite curvature at the event horizon boundary?  and therefore...  2) Does anything cross the event horizon?


Image hosting for Stack Overflow answers?

I'm sure this has been asked before but a quick search on Stack Overflow didn't turn up any result.    I've put images on my own site for now but it's quite possible I'll restructure or move hosts at some time and the images would be lost to the community. Is there any recognized free host for storing images referenced in questions and answers on Stack Overflow?


How to have private variables by using closures

I am new to Javascript and I am currently trying to understand the closure of it and it's use after going through many sites and w3schools which says "It makes it possible for a function to have "private" variables."  , I am trying to understand it's use , I have found some links but I did not understand it still I do not understand how closure achieves private access like c++. When you explain please explain in details as I am a beginner


Primary Decomposition of $\mathbb{R^n}$ under T

I have a question related to the Primary Decomposition Theorem for a vector space under a linear transformation.  The following question is a direct corollary of this theorem.  However, I wish to prove it without calling upon theorem.  I am currently studying for a comprehensive exam and ran across this question.  I never really felt comfortable with the proof I saw of the Primary Decomposition Theorem so I hoping with your help with this problem I will understand this particular problem and better understand that proof as I believe their proofs will be essentially the same techniques.   Question:  Suppose we have a linear transformation $T: \mathbb{R^n}\to \mathbb{R^n}$ with minimal polynomial $m(x)=f(x)g(x)$ and $f(x),g(x)$ are relatively prime.  Show that we can write $\mathbb{R^n}=M\oplus N$ where $M$ and $N$ are $T$-invariant subspaces s.t $f(x)$ is the minimal polynomial for $T|_M$ and $g(x)$ is the minimal polynomial for $T|_N$.   So I know that I want to use $M=ker(f(T))$ and $N=ker(g(T))$ but after that I really don't have much.  Since this isn't a homework problem for a class I am essentially looking for someone to present me a proof of this simpler question and walk me through their logic so that I can hopefully understand the general theorem and its proof.  Thanks in advance for the help!


I´m making a GIS-Portal with GeoNode 2.6 (running in ubuntu 16.04 server) and I want to change the look of the home page following this instructions:  (I´m a beginner at this). I have copied the "site_index.html" and "site_base.html" from  /usr/local/lib/python2.7/dist-packages/geonode/contrib/geosites/site_template/templates/ to /etc/geonode/templates/ I edited both html files. Then I run the collectstatic command and restart apache2, but i see no changes in the homepage.  in local_settings.py is set:  TEMPLATE_DIRS = (     '/etc/geonode/templates',     os.path.join(GEONODE_ROOT, 'templates')  Any ideas of what i´m missing to make it work?  I also tried editing the index.html file without any luck. It only changes when editing /usr/local/lib/python2.7/dist-packages/geonode/templates/index.html


I have installed Ubuntu 18.04.2 alongside windows 10 on my XPS13 (9380) and I am having problems with the wifi where it sometimes disconnects and when I go into the settings it doesn't show any of the wifi options and to contact my software vendor. I have tried updating to the latest kernel and the latest wifi driver (my wifi module is the Qualcomm QCA6174), restarting the network-manager, disabling wifi power saving. If I don't try to turn the wifi off the system behaves almost normally, except any sudo commands hang (do not ask for the password). Trying to turn the wifi off results in the system freezing and becoming completely unresponsive (can only be hard reset, alt+prtscr+REISUB does not work). After being reset it continues to work without any issues until the wifi disconnects again (this happened as often as every hour to as rarely as once a day). Any suggestions on how to fix or debug this? Using ubuntu has become basically impossible, thank you for any suggestions.  EDIT: I have tried updating the firmware as suggested in other posts, and updating the kernel again, but the wifi remains unstable. Apparently the wifi card (QCA6174) does not have a great reputation but it being soldered onto the motherboard there is not much I can do about it. Dell sells this same laptop (same hardware) with ubuntu pre installed, so they must have tested it for stability. If anyone has the Developer edition of the dell XPS 13 (9380) could they tell me what ath10k driver and kernel version the system was running out of the box? Thank you


How to force a redirect (override the destination query string in the URL)

I have a custom form submit callback to redirect users to a specific page:  function MYMODULE_authfrontpageredirect_callback(array &$form, FormStateInterface &$form_state) {   $url = \Drupal::service('path.validator')->getUrlIfValid('node/16');   $form_state->setRedirect($url->getRouteName(), $url->getRouteParameters()); }   This works correctly unless the url has a destination query string, such as /node/add/mynode?destination=/user  In this case, the user will be redirected based on the query string (to /user) instead of my submit handler destination (node/16).  How do I forcibly override the destination query string content for this submit handler?  This question is similar to this  but since Drupal 8 has the Symfony routing system the answers there did not help me.


Do native speakers of English use verbs in the plural form when speaking about one company? I've come across such use by supposed natives.   Don't you think that it is ungrammatical to use verbs in plural,mentioning one company? Maybe when you speak about one company you imply that it is a team or staff or a group of thousands people working in one place.     Fujitsu send newsletter to all subscribers once a month.    I've made up the above example. It is not a quote.


Algorithm to implement for batch processing in ArcMAP modelbuilder

I have a directory with about 10 polygon shapefiles. I need ArcMAP to take all these shapefiles and union them all into one layer using the model builder. I know I need to use some sort of iterator, however the basic one does not successfully union them all, but rather only the last one. What am I doing wrong here? Here is the model:


I have linux installed on my macbook and i need to create a windows usb

I have linux installed as my only OS on my macbook pro retina version and i need to create a installation usb that will boot on the usb...this has been frustrating for me and i need some help with this :/(internet recovery to get bootcamp IS NOT an option,the download is too long and my internet will cut off before it can install fully.)  Thanks in advance


Let $A$ be a $3 \times 3$ matrix with real entries such that....

I came across the following problem that says: Let $A$ be a $3 \times 3$ matrix with real entries.If $A$ commutes with all $3 \times 3$ matrices with real entries,then the number of distinct eigenvalues of $A$  is which of the following:       $ 0,1,2,3$ or none of these.     I do not know how to progress with this particular problem. Can someone point me in the right direction? Thanks in advance for your time.   EDIT:  Even though the question has been asked few months ago and I got some nice explanations ,I revisited the problem and I am little confused about the conclusion of the problem. The scalar matrices of the form $\lambda I$ satisfies the property. So what should be the number of distinct eigenvalues? Here all eigenvalues will be $1$. So,what is the conclusion? Is the answer  $1$ or $0$? Can someone comment on it?


Can Spirit Guardians affect enemies through walls?

We just had a scenario where the enemy set up a 'death trap' with arrow slits covering a corridor, allowing them to pop in, shoot, then pop out -- all without actually entering the corridor.  Which was fine in and of itself, until my cleric ran through the corridor at top speed, with Spirit Guardians up.  The DM and I discussed it, and as far as we can tell the spell doesn't require a line of sight and isn't blocked by walls -- just being 'in range' gets you the damage.  So I wiped out an entire encounter with one well placed third level spell.  In and of itself, that doesn't seem too OP -- at level 5/6 a third level spell is a pretty big investment!  But it still seems a bit odd that I can do it without even LOS.  Are there any rules I'm missing?


I need to add 2nd CPU to my server running ESXi5.1, will it need to upgrade the licence too?

I have a server running with Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz cpu, the main board have more PCI slots which I needed to use but it only works with a second CPU. here is the 2 important questions - should the new CPU be like the running one exactly?  - will I need to upgrade the Esxi licence too? now it is only for 1 physical CPU with any number of virtual CPUs.  thanks


In order to be able to find an antiderivative, I have been taught to decompose fractions by first observing an identity, like $$\frac{2x+1}{(3x-2)(x+1)} \equiv \frac{A}{3x-2}+\frac{B}{x+1}$$ wherever the function is defined.  Then I would expand and substitute, like so: $$A(x+1)+B(3x-2) \equiv 2x+1$$ letting $x=-1$: $$-5B=-1 \implies B=\frac{1}{5}$$ and then letting $x=\frac{2}{3}$: $$\frac{5}{3}A=\frac{7}{3} \implies A= \frac{7}{5}$$  Why are these substitutions justified? In both cases the original function is undefined for these $x$ values as the denominator would be zero - does this mean my claim "wherever the function is defined" is unnecessary? I can't see why this gives the right answer, but it does (as I can verify by matching coefficients instead of substituting)!


Undefined reference in debug, but OK in release

I've encountered a weird problem. My code works perfectly in Release build, but fails to compile in Debug. Quite the opposite to the problems one usually have. :)  in *.h file I have a constant:  class OBDenrChrg : public OBChargeModel { public:   bool ComputeCharges(OBMol &mol); // blah-blah-blah private:   static const float c = 0.05; };   in *.cpp file I use this constant:  bool OBDenrChrg::ComputeCharges(OBMol &mol) { // blah-blah-blah   Eigen::VectorXf a0 = L*EN*c;   Eigen::SparseMatrix<float> A = L*HRD*c + I; // blah-blah-blah }   The built is controlled by cmake. The Release target builds and works well. The Debug says:  CMakeFiles/plugin_charges.dir/charges/denr.o:  In function `OpenBabel::OBDenrChrg::ComputeCharges(OpenBabel::OBMol&)': /home/titov/openbabel-2.3.2/src/charges/denr.cpp:181: undefined reference to `OpenBabel::OBDenrChrg::c' /home/titov/openbabel-2.3.2/src/charges/denr.cpp:182: undefined reference to `OpenBabel::OBDenrChrg::c'   I have no #ifdef DEBUG or similar switches in these files.   Any ideas on how to fix the problem and what may cause it?  Edit:  Thanks everyone for the help.  The problem was in the abscence of c's definition, since declaration of a static member inside of class' definition does not define the static member. What a mess...


C#: What is the difference between CompareTo(String) and Equals(String)?

I would like to know, when comparing string in C#? which method is suitable to use and why?  CompareTo() or Equals()?


Least squares problem with constraint on the unit sphere

It is easy to find the minimum of $\|Ax-b\|_2$, when $A$ has full column rank. But how is the case when we add the constraint $\|x\|_2=1$? Or, to be explicit,  $$\min_{\|x\|_2=1}\|Ax-b\|_2=?$$  My idea is to construct the corresponding Lagrange function  $$L(x,\lambda) = (Ax-b)^T(Ax-b) + \lambda(x^T x - 1)$$  Differentiate the function with respect to $x,\lambda$, we have  $$A^T A x - A^T b + \lambda x = 0$$  $$x^T x=1$$  However, I find it hard to move forward to get the answer. Could anyone help me? Thanks a lot!


Book about two alien castes, alien hand modification

I remember reading a book in high school where a group of people travel to an alien planet where they discover an alien civilization separated into 2 castes. they are then made slaves to the taller class of aliens and one man has the flesh removed from his hands to make his fingers appear longer.


Alternative to Group_concat in MS SQL Server

I have a simple query that does group concat very well in SQL workbench.   id hobby  1 dance  1 sing  2 play  2 sing   Expected output:   id hobby 1 dance,sing 2 play,sing   How can I get this output using MS SQL Server?


Why is 24.0000 not equal to 24.0000 in MATLAB?

I am writing a program where I need to delete duplicate points stored in a matrix. The problem is that when it comes to check whether those points are in the matrix, MATLAB can't recognize them in the matrix although they exist.  In the following code, intersections function gets the intersection points:  [points(:,1), points(:,2)] = intersections(...     obj.modifiedVGVertices(1,:), obj.modifiedVGVertices(2,:), ...     [vertex1(1) vertex2(1)], [vertex1(2) vertex2(2)]);   The result:  >> points points =    12.0000   15.0000    33.0000   24.0000    33.0000   24.0000  >> vertex1 vertex1 =     12     15  >> vertex2     vertex2 =     33     24   Two points (vertex1 and vertex2) should be eliminated from the result. It should be done by the below commands:  points = points((points(:,1) ~= vertex1(1)) | (points(:,2) ~= vertex1(2)), :); points = points((points(:,1) ~= vertex2(1)) | (points(:,2) ~= vertex2(2)), :);   After doing that, we have this unexpected outcome:  >> points points =    33.0000   24.0000   The outcome should be an empty matrix. As you can see, the first (or second?) pair of [33.0000 24.0000] has been eliminated, but not the second one.  Then I checked these two expressions:  >> points(1) ~= vertex2(1) ans =      0 >> points(2) ~= vertex2(2) ans =      1   % <-- It means 24.0000 is not equal to 24.0000?   What is the problem?    More surprisingly, I made a new script that has only these commands:  points = [12.0000   15.0000           33.0000   24.0000           33.0000   24.0000];  vertex1 = [12 ;  15]; vertex2 = [33 ;  24];  points = points((points(:,1) ~= vertex1(1)) | (points(:,2) ~= vertex1(2)), :); points = points((points(:,1) ~= vertex2(1)) | (points(:,2) ~= vertex2(2)), :);   The result as expected:  >> points points =      Empty matrix: 0-by-2


How can I repair a ceiling fan that hums, but doesn't turn?

The ceiling fan/light has power. The lights work, but the fan doesn't turn even though it hums.  Why is this, and how can I fix it?


Why is it hard for a neural network to learn the identity function?

I wanted to see if a neural network could learn the identity function using the MNIST handwritten dataset.  Here is the full code  import keras from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense from keras.optimizers import RMSprop  batch_size = 128 epochs = 20 (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train = x_train.reshape(60000, 784) x_test = x_test.reshape(10000, 784)  model = Sequential() model.add(Dense(784, activation='relu', input_shape=(784,))) model.add(Dense(784, activation='relu')) model.add(Dense(784, activation='relu')) model.add(Dense(784, activation='relu')) model.summary() model.compile(loss='mean_squared_error',             optimizer=RMSprop(),             metrics=['mean_absolute_percentage_error'])  history = model.fit(x_train, x_train,                     batch_size=batch_size,                     epochs=epochs,                     verbose=1,                     validation_data=(x_test, x_test)) score = model.evaluate(x_test, x_test, verbose=0) print('Test loss:', score[0]) print('Test MAPE:', score[1])   and the output  **4 dense layers** Epoch 20/20 60000/60000 [==============================] - 50s 840us/step - loss: 456.7581 - mean_absolute_percentage_error: 351097677.7045 - val_loss: 523.7151 - val_mean_absolute_percentage_error: 504905991.0656 Test loss: 523.7150838867187 Test MAPE: 504905988.5056   What I can't quite get my head around is why training cannot find the perfect solution to the problem and why it takes so long to even get close to it? Even with one dense layer the exact solution cannot be found:  **1 dense layer** Epoch 20/20 60000/60000 [==============================] - 16s 268us/step - loss: 180.6187 - mean_absolute_percentage_error: 209296481.2373 - val_loss: 167.9543 - val_mean_absolute_percentage_error: 192590419.9936 Test loss: 167.954341796875 Test MAPE: 192590420.1984   Conceptually I can see that there is a solution space (not just the exact identity function) as it is likely there are some pixels that have the same value as each other in all the images which could be swapped in the training set at no loss (0's around the edge for example). With the knowledge that this is a local minimum can I learn anything from this to guide me out rather than playing with hyperparameters until I find something better?


What does this symbol mean in logic (rotated up-tick)?

What does this symbol mean in logic?    P.S.: up tick would mean contradiction (always-false logic constant), but this is not up-tick (falsum).  Is this synonym for implication (material condition -> ) ?


Why a punctuation is used in this sentence?

I'm puzzled on why a comma is used in this sentence.   "He showed admirable restraint, and refused to be provoked."  Independent and Dependent clause logic doesn't work here. I saw this on Cambridge online dictionary for the word "restraint".


Is it legal for me to ride a bicycle on the pavement (sidewalk)?

UK only, just wanted to check if it's actually legal. The area I'm living on is deadly on the roads, so want to know about riding on pavements (sidewalk/pedestrian walkways) instead where there is no bike lane (half of the roads have bike lanes around here and suddenly they disappear...).


I don't fully understand this algorithm to solve ax + by = gcd(a,b)

An exercise in my number theory book asks to implement the following algorithm to solve $ax + by = gcd(a,b)$:  Set $x = 1$, $g = a$, $v = 0$, and $w = b$ If $w = 0$, set $y = \frac{g-ax}{b}$ and return $(g,x,y)$ Divide $g$ by $w$ with remainder, $g = qw + t$, with $0\leq t < w$ Set $s = x - qv$ Set $(x,g) = (v,w)$ Set $(v,w) = (s,t)$ Go to step 2.  Initially, I didn't even understand how it could work. Then I implemented it blindly in Python and it worked right off the bat. I tried to use the algorithm to manually solve some simple equations, and now I do see that it basically goes through $a$, $b$, and all subsequent remainders of the divisions in the Euclidian algorithm until it hits zero, but all the value swapping confuses me. The book also asks to prove that the algorithm does return the gcd as well as a solution to the equation, but I can't because I don't quite understand what it is doing. I think I kind of see that it is using $s$ to keep track of possible values of the solution, but the rest is foggy. Could you help me understand what it is doing? Note: yes, as it is the algorithm goes bonkers if $b = 0$. The books asks you to fix that and I did, but it's not relevant here.


Populate lists with all possible permutations of one or all elements of a list

How is possible to populate lists, of fixed length, using all possible permutations of one or all elements of a list?  For instance, I want to populate lists of 3 elements containing all possible permutations of one or all numbers [1,2,3]. All ways of creating lists of length 3, with these 3 numbers, are:  arranging = [[1,1,1], [1,1,2], [1,2,2], [2,2,2], [1,1,3], [1,2,3], [2,2,3], [1,3,3], [2,3,3], [3,3,3]]  To find the possible permutations of each one of this lists I would use:  populating = [set(itertools.permutations(i, 3)) for i in arranging]  Which is equal to:  populating == [{(1, 1, 1)}, {(1, 2, 1), (2, 1, 1), (1, 1, 2)}, {(1, 2, 2), (2, 2, 1), (2, 1, 2)}, {(2, 2, 2)}, {(1, 1, 3), (1, 3, 1), (3, 1, 1)}, {(3, 1, 2), (1, 3, 2), (3, 2, 1), (2, 3, 1), (1, 2, 3), (2, 1, 3)}, {(2, 2, 3), (3, 2, 2), (2, 3, 2)}, {(3, 1, 3), (3, 3, 1), (1, 3, 3)}, {(3, 2, 3), (2, 3, 3), (3, 3, 2)}, {(3, 3, 3)}]  How would you create the list arranging (sorry for the terrible name)? Is there any other better solution?


Quick question - if $A$ and $B$ are independent continuous random variables, does that imply $A$ and $\cos B$ are also independent?


Please help with below requirement.  attached 2 image, one is Data and another one is requirement.  Data= we are getting data in this format Requirement= i have to convert date in this format.  Please help with VA on priority.


Deriving effective potential energy from the Lagrangian of a two-body system

I'm having some issues understanding how the effective potential energy of a two-body system is derived from the Lagrangian of the system. Specifically my issue is with one step...   Suppose we are analyzing the system in the centre of mass frame with a reduced mass $\mu$, radial separation $r$, and angular speed $\dot{\phi}$. Then the Lagrangian can be expressed as:  $$\mathscr{L}= \frac{1}{2}\mu(\dot{r}^2+r^2\dot{\phi}^2)-U(r)$$ I understand that $\phi$ is a cyclic coordinate, since $\frac{\partial \mathscr{L}}{\partial \phi}=0$ , and thus the angular momentum $l$ is conserved. Since  $l=\mu r^2 \dot{\phi}$ , we can use this to substitute in for  $\dot{\phi}$  and make the Lagrangian one-dimensional.   My problem is this: if we substitute in the  $\dot{\phi}$  before using the Euler-Lagrange equation to derive the equation of motion, we get the wrong result. There is a minus sign where there shouldn't be! $$\begin{align} \mathscr{L} &= \frac{1}{2}\mu\dot{r}^2+\frac{1}{2}\mu r^2 \biggl(\frac{l}{\mu r^2}\biggr)^2-U(r) \\ &= \frac{1}{2}\mu\dot{r}^2+\frac{l^2}{2\mu r^2}-U(r) \ \Rightarrow \ U_{eff}(r) = U(r) - \frac{l^2}{2\mu r^2} \end{align}\\  \frac{d}{dt} \frac{\partial \mathscr{L}}{\partial \dot{r}}=\frac{\partial \mathscr{L}}{\partial r} \ \Rightarrow\ \ \mu\ddot{r}=\color{red}{-}\frac{l^2}{\mu r^3}-U'(r)$$  Whereas if we reverse the order of these steps, we get the correct result. $$\mathscr{L}= \frac{1}{2}\mu\dot{r}^2+\frac{1}{2}\mu r^2\dot{\phi}^2-U(r) \\  \begin{align}\frac{d}{dt} \frac{\partial \mathscr{L}}{\partial \dot{r}}=\frac{\partial \mathscr{L}}{\partial r} \Rightarrow\mu\ddot{r} &= \mu r \dot{\phi}^2 -U'(r)\\ &= \mu r \biggl(\frac{l}{\mu r^2}\biggr)^2 -U'(r)\\ &= \frac{l^2}{\mu r^3} -U'(r)\\ \end{align}$$ What's going on here? Why does the order of these operations matter and what does this mean physically?  POST-EDIT:   In response to being marked as a duplicate of: . I did not fully understand the answer to this question as it is beyond the scope of what I've learned (as an undergraduate sophomore).  As for: , the title isn't very descriptive of what's being asked, so I didn't find this post. However, the accepted answer is very succinct and given with less advanced theory. Thank you for bringing it to my attention!


How could a highly destructive character contribute to gameplay?

I play small role playing activities and games with some friends of mine, and one of them always has highly destructive and somewhat unpredictable characters. He will consistently attempt to kill other PCs, interesting people he comes across, or entire ecosystems if he gets the power, and will sometimes just do really random stuff like trying to cast spells to make people look like Eragon. This comes across a lot more childish in writing than it does in person. He's quite aware of what he does and sometimes makes more intelligent decisions when prompted to. Right now I have to keep preventing him from killing everything, which isn't very fun for him (although he enjoys the attempt), and the other players get a bit tired of his constant violence and strangeness (although mostly they laugh at the absurdity of his ideas and the nature of his failures).  So, how could I put this behavior to good use? I've had a few ideas, but they tend to center around him being a villain, which will inevitably end up in being defeated all the time, which is too much like the problem I have now. I would like to let him be destructive, and somehow use that for the benefit of the other players on adventure or leading kingdoms or whatever.  To answer some comments: He's not actually being very detrimental to the game play. He tries to kill some random guy, other people react to him accordingly, and the story moves on. He takes it surprisingly well and seems to mostly have fun in the attempt at violence or weirdness, although he also likes to succeed sometimes. We've never run into "my guy" syndrome because... well, everyone already knows that's what his guy would do, including him. Fortunately his plans aren't well thought out and usually when they succeed it's more by chance than design. I'm seeking ideas for how I could use this to benefit game play.  We don't use any systems but my own little designs, which are usually simple. Our stories go everywhere from building worlds to figuring out what happened in an abandoned near-future city. I do plan to start using official systems soon, and at that point it will become crucial to know what to do with this player.


Trying to understand "==" & "===" operator behavior in certain scenarios

console.log([2] == 2) //returns true  console.log([2,3] == 2) //returns false  console.log([2] === 2) //returns false  console.log([2,3] === 2) //returns false   Can someone tell me what is happening behind the scenes in the above lines of code,how JavaScript Engine is performing these tasks


Proving that sequence ${a_n}$ is unbounded as $a_{n+1} = 1/{a_n} + {a_n}$

Let ${a_1} > 0$ and ${a_n}$ be a sequence so that for any natural number  $a_{n+1} = 1/{a_n} + {a_n}$  Prove that sequence ${a_n}$ is unbounded.  How should I prove that? Can you give me any ideas ...


Is there a way to truly revive the dead?

According to the .     Whilst it is possible to create Inferi, these are mindless creatures with no soul or intelligence, despite possessing human corpses and hence are not truly "raised" persons. Therefore, Necromancy does not work in this respect and it is indeed known to be impossible to truly resurrect the dead.   However, I am not fully sold on the legitimacy of this article. It seems under developed to me. It also fails to mention any ways besides magic (creatures, items, magical plants) to revive the dead.   Is there any canonical information that has been mentioned either by Rowling or the Harry Potter Universe that either eliminates the possibility, leaves it undetermined, or confirmed it?   *Note: Please do not use the wiki as the main reference in an answer, as I have already looked at that source and feel that it does not answer the question fully.  *Note: I do not feel that this is a duplicate of the other necromancy question. The answer that were given to that were more reanimated dead - zombie oriented, I want dead people becoming living again.


why must I earn separate reputation on all stack sites?

How many stack exchange sites are there and why is reputation not universal. It sucks having to earn reputation for every separate site. it is really annoying actually. It makes zero logical sense honestly.  Can anyone give a good logical explanation of this?


Differential form of Gauss's law from Coulomb's law in spherical coordinates

Coulomb's law for the static electric field of a point charge is given by $$\overrightarrow{E}=\frac{1}{4\pi\epsilon_0}\frac{q}{r^2}\hat{r}$$ Now if we take the divergence of both sides of the above equation we will get $$\overrightarrow{\nabla}\cdot \overrightarrow{E}=\frac{q}{4\pi\epsilon_0}\left\{\frac{1}{r^2}\frac{\partial}{\partial r}\left(r^2\frac{1}{r^2}\right)\right\}$$ $$\Rightarrow \overrightarrow{\nabla}\cdot \overrightarrow{E}=0$$ But according to the differential form of Gauss's law $\overrightarrow{\nabla}\cdot \overrightarrow{E}$ should be equals to $\frac{\rho}{\epsilon_0}$; where $\rho$ is volume charge density. In this condition I can not understand where I have made mistakes or where I am logically wrong. So can any one please help me to get rid from this conceptual dilemma?


Spells cast using Pact Magic slots recovery

If a wizard 4/warlock 2 were to cast Shield using a warlock spell slot. Would the character regain the ability to cast it again on a long rest or short?


What's the deal with "thank you kindly"?

on this site have established that kindly can be used as a sort of please.  This usage was in my mind when someone said "Thank you kindly" to me, but "thank you please" doesn't make sense.  However, characterizing one's own thanks as kind also sounds unlikely.  The actual usage appears to be the sixth definition by :     kindly   6. cordially or heartily: We thank you kindly.   However, I still have questions.  Is this usage of kindly only used with thank you?  How did this usage occur?


Is it advisable to use the Extra Virgin Olive oil for Indian cooking, and baking?

I use this oil for baking cup cakes, and I add this oil to the whole wheat dough meant for preparing parathas on the gas stove?  My mother uses it for frying vegetables on the gas stove.  Hence the question in the title. Should I be vary of anything here?


Call a generic method and set the generic type at runtime

In the example bellow, is it possible to set the Classname type parameter dynamically?  UpdateAndSave<Classname>>().Execute(sql)


Let $G=H\times K$ (a direct product of $H , K$) where $H$ is an abelian 2-group and $K$ is a non-abelian simple group. Is $G$ solvable? why?  These three answers are true, and I thought so. But in a book I found a remark that made me confused: T.M. Gagen, Topics in Finite Groups, London Math. Soc. Lecture Note Ser., vol. 16, Cambridge Univ. Press, Cambridge, 1976, Remark, Theorem A on p. $40 $ and Definition $11.3$ on p. $39$. Please see it and say me your ideas.


Connection is not private when viewing per site meta over HTTPS

I discovered the problem on this thread:   In the comments, another user posted a link to another part of the site. I followed the link.  Here is the worrying message I got:     Your connection is not private   Attackers might be trying to steal your information from meta.worldbuilding.stackexchange.com (for example, passwords, messages, or credit cards). NET::ERR_CERT_COMMON_NAME_INVALID     The link is:   https://meta.worldbuilding.stackexchange.com/questions/2654/questions-about-single-individual-actions    What is happening? Is Stack Exchange compromised?


HPLIP correctly installed but hp-setup will not run - asks me to install hplip

I am using Ubuntu 16.04. I have installed HPLIP from the Ubuntu repository using the command sudo apt install hplip hplip-gui as recommended in . However, when I run hp-setup I am told to install HPLIP. The program 'hp-setup' is currently not installed. You can install it by typing: sudo apt install hplip  This is circular since I have HPLIP already installed. Can anyone suggest what I should do next? Output of sudo apt install hplip: Reading package lists... Done Building dependency tree        Reading state information... Done hplip is already the newest version (3.16.3+repack0-1). 0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.  The output confirms it is installed. Output of dpkg -l hplip: Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name                        Version            Architecture       Description +++-===========================-==================-==================-=========================================================== ii  hplip                       3.16.3+repack0-1   amd64              HP Linux Printing and Imaging System (HPLIP)


Why is the function continuous, if it is defined only on integers?

Why is a function f continuous, if it is defined only on integers?   It seems very trivial but I could not find the words to describe the reason. Can smo(someone) give me a hint?  Note: there is no function. This is a verbal question. No equation exists for the function   Thanks


I have just started special theory of relativity. The limiting speed known as speed of light fascinated me most. I asked my teacher:      Consider two massless objects moving in the same direction at the speed of light. What would be their relative velocity w.r.t each other?   My teacher tells me that their relative velocity would be zero. But then the speed of light is universal constant regardless of the motion of its frame of reference, so shouldn't their relative velocity be $c$? What is their relative velocity and how? Do objects moving at the speed of light obey law of addition of velocities?


What are the constructional differences between a macro and a regular lens?

I understand that to reduce minimum focusing distances, macro lens design must focus on maintaining certain distances between the lens and the sensor.   However, is the placement of the lens and its elements the only difference between a macro and a prime or any other regular lens? OR are there other structural differences as well?  There are quite a few posts that address the differences but none that really bring out the "physical" differences.


I wrote this code as a test to implement it later in the script I'm working on. The concept is simple, sorting a dictionary in different ways based on the user's choice.  "a" is the default order (the order of data entry in the dictionary). "b" is the default order but reversed. "c" is the default order, but in alphabetical order (A-Z). "d" is the order of "c" but reversed (Z-A).  a = {"pfdee": 100, "pafeeg": 1000, "ddsds": 999, "gfgfgh": 10} b = {i: a[i] for i in reversed(list(a.keys()))} c = {i: a[i] for i in sorted(list(a.keys()))} d = {i: a[i] for i in sorted(list(a.keys()), reverse=True)}  print("a: " + str(a)) print("b: " + str(b)) print("c: " + str(c)) print("d: " + str(d))   Now, I would like to add two further orders, that is related to the quantity of each single object (so "e" should be from the smallest to the largest, "f" should be from the largest to the smallest). I did several tests, but unfortunately they were unsuccessful. I could do it in a normal for loop, but I'd like to keep the dictionary comprehensions if possible. So I ask for advice on how I should proceed, to have a better understanding.  I specify that I am using Python 3.7


Cannot launch synaptic package manager on Ubuntu 17.10, gcc:7.2.0

I'm quite new to Ubuntu. I've installed synaptic using the command:   sudo apt-get install synaptic   and this is the concluding line of the output:   synaptic is already the newest version (0.84.2). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.   But seems the synaptic application package refuses to launch upon prompting for authentication of password.  What's the problem and how can I fix it?


Index of a maximal subgroup in a finite group

My question is very simple and maybe trivial. Here it is.  Is the index of a maximal subgroup in a finite group always a prime number?  Thanks in advance.


Is it possible to counter-act centrifugal force by moving at the same speed in the anti-spin direction?

I've recently been contemplating things like artificial gravity in a rotating space ship (for example, the ) and learning about the Coralis effect and other interesting fictitious forces that appear in rotating reference frames.  It occurred to me that, if you were living on a space station spun for artificial gravity, it might be possible to become weightless in such an environment by travelling fast enough against the spin of the ship. My friend, who I was discussing this with, thinks otherwise, that you would actually be under more g's as you tried to gain the speed to lift off from the inner edge of the ship.  In terms of concrete numbers, say the ship is 4 kilometers in radius (as an O'Neill Cylinder would). At this size, the rate of rotation to generate 1g in centrifugal force (the artificial gravity) is under 0.5 rpm. If a vehicle travels on the inside of the cylinder against the spin fast enough, eventually the vehicle would cease moving when looked at from a static reference frame. I would think at this point, the vehicle could simply push off from the edge of the cylinder and float towards the center of the station. Is this correct?  Furthermore, would this method of "getting into air", as it were, be easier than it would be to counteract real gravity on Earth (with things like planes that generate lift with their wings)?


Why do answers need to be copy-pasted from other sites?

With regards to:   The link fully answered the question right from the boost documentation. What is wrong with it?


How do I download the b1.7.3 server file?

I really want to play b1.7.3 with my friends (it was the first version of Minecraft I ever played!) but I cannot find where/how to download it. I've tried mcversions.net but server files are not included for beta versions.


Select and copy all the elements inside Code tag using Jquery

I am looking for a way to copy the entire code block using jquery, I already have a script for copy to the clipboard which utilizes the select() method. But according to the jquery docs select event is limited to  fields and  boxes.  So I am seeking for a standalone solution to copy all the elements inside the codeblock at once.  This is how my HTML looks like.
'core/base.html' #some more html
' <button type="button" class="btn btn-primary btnFloat" id="copybutton"></button>   Script     $(document).ready(function () {                     $("#copybutton").click(function () {                 console.log("clicked");                  $("#texttocopy").select();                 document.execCommand("copy"); })


Officials are waiting on autopsy results for Oscar-winning actor Philip Seymour Hoffman. New York police suspect a drug overdose, possibly heroin.   I am curious about the preposition on in the sentence, because I usually say "wait for" instead of "wait on". Does it still have the same meaning if I change on to for? Just as follows:     Officials are waiting for autopsy results for Oscar-winning actor Philip Seymour Hoffman. New York police suspect a drug overdose, possibly heroin.


Lubuntu 14.04 Wifi on Laptop with Broadcom BCM4322

I'm preparing for a trip where I can't bring my desktop, so I recently broke out my trusty old laptop (Dell Latitude E4300) to get it ready for the trip. Previously, I had Ubuntu 12.04 LTS on the machine and there were no problems with wifi or the computer in general. My original problem came when I tried to upgrade to Ubuntu 14.04, which failed halfway through and long story short: I couldn't get it to work. I then installed Lubuntu 14.04 (It's a moderately old laptop and I had never tried Lubuntu, so why not) and it's going great, except, I can't connect to my wifi and since this will be my only method of access on my vacation, I really need to fix it. I'm kinda at a cross roads since I've never had this problem with this laptop. Any help would be great.   The output of "lspci -nvn | grep -i net" Says the wifi card is a "Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b] (rev 01)"  I have looked at many other similar questions, but they're all very old and none have helped. Sorry if you guys get this a lot.  EDIT: Here is the link to the requested diagnostics (See comment by user "wild man"_


How to let the user insert stuff without pressing enter

I'm sorry for the weird title but i really don't know how to say this. Look: std::array<std::string, 2> names = { "chloe", "tom" };     std::string choice;      std::cout << "Type a name.";     std::getline(std::cin, choice);      std::for_each(choice.begin(), choice.end(), [](char& c) {         c = ::tolower(c);         });      for (int i = 0; i < names.size(); i++) {         if (choice == names[i]) {             std::cout << choice;         }     }  This code lets the user input a name and if the name is inside the names array it gets printed. What i want to do is that as soon as the user types a correct name (chloe for example), even without having to press enter the program recognizes it as correct and proceeds.


Can a Pakistani with a US permanent resident card exit Heathrow, London during a 13hr layover?

I am traveling to Pakistan from Washington DC and have about 13 hours of stay in London Heathrow on both outbound and inbound trips. I have a passport from Pakistan but a PR card from the US that was issued after 1998 requirements. I think I can visit London i.e. go out of the airport and come back.  Is this so?


So I have the following Oracle SQL Database table:  create table Customer (customerID char(25) not null,  name char(50),  address char(100),  dateRegistered DATE,  noOfDvdHiring int,  primary key (customerID));   And I have the following query: List the unique numbers and names of all customers who are hiring more DVDs than the average number of DVDs currently hired by all customers.  I'm sure this should involve a nested query but I am unsure where to start?  I have tried:  SELECT customerID, name FROM Customer WHERE noOfDvdHire > AVG(noOfDvdHire);   But receive this error message:     ORA-00934: group function is not allowed here


Why are there so few high quality APS-C telephoto lenses?

Neither Canon nor Nikon nor Sony nor Pentax (did I forget someone?) seem to be particularly concerned to offer such lenses. Even third party makers don't seem to be really interested in anything beyond inexpensive 70-300 zoom lenses. Meanwhile, other applications such as wide angle and the standard zoom range seems to be covered well with lenses specifically made for APS-C  Is there any particular reason for this? For instance, when asking new owners of the 7DII what lenses they use on their bodies, it's almost always a full frame lens (Canon L or 3rd party).  I could come up with a few possible reasons myself but none of them seem to be genuinely convincing.


In GKP's Concrete Mathematics, there is a useful and interesting feature I would like to see in more books. The bibliography entries include:   a - the page numbers where the book or article is cited in the document. b - a few lines of review of the cited work.   It is a kind of mix between bibliography, index and review.  Are there stable LaTeX packages/BibTeX styles to do (a) and (b) ?  EDIT: I wrote (b) initially as "comments about the work cited". It could be understood as "gathering comments made in the book about the work and reproducing them in the bibliography".  This is not what I meant but this could be something useful for others.


Unjustified claim in Kittel about Bloch functions

In Kittel's Solid state physics, on page 171. He claimes     If one particular wavevector $k$ is contained in a $\psi$, then all other wavevectors in the Fourier expansion of this $\psi$ will have the form $k+G$, where $G$ is any reciprocal lattice vector.    He then continues with stating that a wavefunction labeled as $\psi_k$ may equally well be labeled as $\psi_{k+G}$ because if $k$ enters in the Fourier expansion, then $k+G$ may enter.   I am really wondering what is the proper argument for justifying this. Although I may have overlooked it when reading the text, I cannot find a good explaination.   His first statement is that  $$ \psi = \sum_{k} C(k) e^{ikx},$$ but after discussing that all wavevectors have the form $k+G$, and deriving the central equation, he is able to rewrite this into  $$ \psi_k = \sum_{G} C(k-G) e^{i(k-G)x} = \left( \sum_{G} C(k-G) e^{-iGx} \right) e^{ikx}, $$  which proves Bloch's theorem. Justifying the quoted claim therefore seems essential to proving the desired result. If this is not the case, I don't think I see the connection between the first and second expression for $\psi$ and would really like a explaination of the two expressions and their relation.


What do codes "O", "T", "X", and "N" mean on Wal-Mart receipts?

What do the four individual Walmart receipt codes of "O", "T", "X", and "N" denote?


System freezes completely with Intel Bay Trail

My system freezes completely at random, frequent intervals. I started to have the same problem in Ubuntu 14.04 but after recent upgrade to 16.04 there is no improvement, in fact it seems worse.  When it happens, it's impossible to do anything. I've tried everything in this thread:  but nothing works, I have to hard reset. I have read all the system logs and journalctl but there is never any information that could help diagnose the problem.  This is a dual-boot system with Windows 10 and there's no problem there, so it's not defective hardware.  My laptop has an Intel Bay Trail processor (Pentium N3540)


Display only the penultimate (second last) row of a text

I have a poem with an unknown number of rows and I want to display only the penultimate one. What command should I use?


A non-zero function satisfying $g(x+y) = g(x)g(y)$ must be positive everywhere

Let $g: \mathbf R \to \mathbf R$ be a function which is not identically zero and which satisfies the equation $$ g(x+y)=g(x)g(y) \quad\text{for all } x,y \in \mathbf{R}. $$ Show that $g(x)\gt0$ for all $x \in \mathbf{R}$.


I have an odd error that I have been unable to find anything on this. I wanted to change the user comment with the following command.  $ sudo usermod -c "New Comment" user   This will work while logged onto a server but I want to automate it across 20+ servers. Usually I am able to use a list and loop through the servers and run a command but in this case I get a error.  $ for i in `cat servlist` ; do echo $i ; ssh $i sudo usermod -c "New Comment" user ; done  serv1 Usage: usermod [options] LOGIN  Options: lists usermod options  serv2 Usage: usermod [options] LOGIN  Options: lists usermod options . . .   When I run this loop it throws back an error like I am using the command incorrectly but it will run just fine on a single server.  Looking through the ssh man pages I did try -t and -t -t flags but those did not work.  I have successfully used perl -p -i -e within a similar loop to edit files.  Does anyone know a reason I am unable to loop this?


Any way to play Windows Games on Ubuntu?

I was wondering if I can play Windows Games on Ubuntu through software so I can play games like Wildstar (MMO), Steam/Origin Games etc.  Personally I don't want to use Windows, I've always disliked it but to play the latest games you need it so I've always felt "forced" so to speak.  Thank you in advance  Dean


I'm tired of writing out the phrase "himself or herself". What are my options?

Because of English's lack of a gender neutral third person singular possessive pronoun, whenever the need for such a referent presents itself in the course of writing, we seem to be left with alternatives that are either cumbersome or otherwise awkward. There is the informal gender neutral "himself", and the informal singular "themself", and of course there is the more formal "himself or herself" which is both grammatically and politically correct but has the disadvantage of being incredibly annoying to write very quickly.  Are there any other ways to truncate this expression, particularly (but not limited to) ways that stay within the bounds of standard correct English usage and grammar?  For example, I thought of shortening it to "his or herself", but upon second thought this feels akin to what mathematicians would call can .


What to check when buying used and old film bodies?

I saw an ad on a local site for a Minolta XD11, seemingly body only. The listing claims manual exposure works but battery operation has not been tested. The price is dirt cheap. What do I check for, assuming I meet the seller?


I noticed on Wikipedia there's always a 'The' before 'Ohio State University' but nothing before 'Arizona State University'. My findings were mirrored by search results of a corpus that includes articles of authoritative news outlets such as CNN, The Economist, BBC.  How come the use of the definite article is inconsistent between these two state universities?  Edit: My question is different from the one re [without THE] X University vs THE University of X. My question is: why for the same pattern ie X State University, it's THE Ohio State University and [without THE] Arizona State University? Does it mean the use of 'THE' can be arbitrary and prescriptive?


Prove that $(0)$ is a radical ideal in $\mathbb{Z}/n\mathbb{Z}$ iff $n$ is square free

Let $n>1$ be an integer. Prove that $0$ is a radical ideal in $\mathbb{Z}/n\mathbb{Z}$ if and only if $n$ is a product of distinct primes to the ﬁrst power (i.e., $n$ is square free). Deduce that $(n)$ is a radical of $\mathbb{Z}$ if and only if $n$ is a product of distinct primes in $\mathbb{Z}$.  I don't really get it. For example, $8$ is not a square-free integer; so take $\mathbb{Z}/8\mathbb{Z}$. Why is $0$ not a radical ideal in this ring but is in $\mathbb{Z}/6\mathbb{Z}$?


How to change shortkey for terminal to kill process

I want to change the shortkey Ctrl+C which is used to kill process in terminal. Could you please give me some clue or directions to do this? Thank you so much. Here is the background I use some simulation with other tasks in terminal. However, I am habitual to use Ctrl+C to copy stuff and then paste it. Same thing happened with me in terminal and I accidentally killed the simulation. How can I change the shortkey for killing the process?


I need basic electronics books  (diodes,transistors,current.. etc) as I am just starting out with electronics and want to have something to read over the holiday.  Any suggestions of good beginners' books?


What happens if you don't return a value in C++?

Yesterday, I found myself writing code like this:  SomeStruct getSomeStruct() {     SomeStruct input;      cin >> input.x;     cin >> input.y; }   Of course forgetting to actually return the struct I just created.  Oddly enough, the values in the struct that was returned by this function got initialized to zero (when compiled using g++ that is).  Is this just a coincidence or did another SomeStruct get created and initialized somewhere implicitly?


I am trying to make a landing page for a company that provides grooming services (for females, like makeup artists, hairdressers etc). I am struggling to find a cover photo for the page due to copyright issues. I need help in finding, if there is a specific website/forum where I can find, images relative to my page.  I am relatively new in this field (designing websites and landing pages). I am looking for something that will describe the service. I am trying to copy a template using different pictures, colour schemes and layout.


Twitter account still logged in on friend's phone

I just changed my password, but one time I used my friend's mobile phone to access my account using the add account feature. Sometimes she uses my account to write or read something, and she still accesses my account from her phone.   Can I log myself out of all instances of the account?


Deduce that if $G$ is a finite $p$-group, the number of subgroups of $G$ that are not normal is divisible by $p$

Given: Let $G$ be a group, and let $\mathcal{S}$ be the set of subgroups of $G$. For $g\in G$ and $H\in S$, let $g\cdot H=gHg^{-1}$  Question: Deduce that if $G$ is a finite $p$-group, for some prime $p$, the number of subgroups of $G$ that are not normal is divisible by $p$.  Comments:    The subgroups of $G$ that are normal have the property that $g\cdot H=gHg^{-1}=H$ The question is equivalent to showing $p$ divides $\left|G\right|-\left|\{H\in S\vert gHg^{-1}\neq H\}\right|$ $p$-group: $\forall g\in G,|g|=p^k$ for $k\in\mathbb{N}^+$ I don't know where to start with this problem, been thinking about it for a while to no avail, I feel that there are too many definitions for me to consider when finding a solution. My problems I have considered and not been able to answer are: what is the order of $|G|$? I think it must be of order that is divisible by $p$, hence the question becomes show $p$ divides the order of $\left|\{H\in S\vert gHg^{-1}\neq H\}\right|$. How do you compute the order of this set? It seems like quite a standard problem, so I would really appreciate it if I could be directed to more information about whatever problem it is.


Mathematica 10.2 - Window not responding

I have Ubuntu 14.04 with Gnome-Shell running and use Mathematica 10.2. Whenever I open a mathematica file and select some lines in it, I get a message from the system that mathematica is not responding. You may choose to wait a short while for it to continue or force the application to quit entirely. This problem is also described at . However, it is stated there, that they cannot do anything about it. Now there is a statement at the  that one only has to change one line in the delete.c file from mutter, to deactivate the whole message. This hack would be a sufficient solution for me.   The question now is, how do I implement the proposed change in the file? I cannot find a delete.c file on my computer. Do I have to compile mutter myself?  diff --git a/src/core/delete.c b/src/core/delete.c index 141cd49..d8a126e 100644 --- a/src/core/delete.c +++ b/src/core/delete.c @@ -98,6 +98,8 @@ show_delete_dialog (MetaWindow *window,                "Got delete ping timeout for %s\n",                window->desc);  +  return; +    if (window->dialog_pid >= 0)      {        present_existing_delete_dialog (window, timestamp);


Why is a purple light/texture appearing in rendered view?

I'm rendering a low-poly building/skyscraper for a city that I am creating. I have been following this   on YouTube and my models and textures have been looking great, but now when I go to render cycles is appearing weird with a black background and a pink shading. Here's a screenshot: I understand that my lighting isn't great yet, but I don't understand the pink colors.  Thanks ahead of time.


Are these resistors in parallel? A question is asked to find the equivalent resistance between X1 and X2; to my knowledge, these resistors are like parallel connections. But the choices are given as:   A. 2 Ohms B. 4 Ohms C. 8 Ohms D. 12 Ohms


Rent a car in UK with an EU driving permit (Germany) less than 1 year old

I failed to find a rental company that allows me to rent a car in the UK with a German license that is less than one year old.  Is there a solution? Are there any rental companies allowing a less than 1 year old licensee to rent a car in London?


Dynamic Cast fails on stack variables but not heap, why?

So I have a simple snippet of code: class Base { public:     virtual void print() {cout<<"Base print"<<endl;} };  class Derived: public Base { public:     virtual void print() {cout<<"Derived print"<<endl;} };  now in my main.cpp, when I downcast a Base class that is instantiated as Derived, I can only downcast if it's a heap variable and not a stack variable, any idea why? This seems like a simple issue, but I can't find an answer online for it. Works int main() {          Base* x = new Derived();     Derived* d = dynamic_cast<Derived*>(x);          if (d){         d->print(); // This line executes     } else {         cout<<"Cast failed"<<endl;     }      return 0; }  Doesn't Work: int main() {          Base x = Derived();     Derived* d = dynamic_cast<Derived*>(&x);          if (d){         d->print();      } else {         cout<<"Cast failed"<<endl; // This line executes     }      return 0; }


Until a few weeks ago, the style worked perfectly and this was the result:    But recently it has stopped working without any modification and I have no idea why, now it produces:   How can I recover that style? Or how can I make one equal.  the code is  \documentclass{report}  \usepackage{color,lmodern,titlesec}  \newcommand\chptitle[1]{\parbox[b]{\dimexpr\textwidth-87pt}{\raggedright#1}}  \newcommand{\hsp}{\hspace{12pt}}  \titleformat{\chapter}[hang]{\huge\bfseries}{{     \fontsize{4.1em}{4.1em}\selectfont\color{black}%      \thechapter}\hsp\textcolor{blue}{\vrule height 2.7em width 1pt}\hsp}{0pt}{\Huge\bfseries\chptitle}   \begin{document}    \chapter{Aaaa bbbb}     aa     \chapter{Aaaa bbbb Aaaa bbbb Aaaa bbbb}     bb     \end{document}   The list of files generated by \listfiles in the log file is   *File List*   report.cls    2014/09/29 v1.4h Standard LaTeX document class   size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)    color.sty    2016/01/03 v1.1b Standard LaTeX Color (DPC)    color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive   pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)  ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)  lmodern.sty    2009/10/30 v1.6 Latin Modern Fonts titlesec.sty    2016/03/15 v2.10.1 Sectioning titles   ot1lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern supp-pdf.mkii  ***********


I made a file in php with asian characters on ubuntu server and after I saved the file the asian characters are replaced by "?" marks.  How i do solve this problem?


What are complex numbers, actually? You can prove $1=-1$ and a complex cosine function can have value greater than $1$ and so on, there are many unexpected results when we use complex numbers. So, what are they actually? Do, they have any physical meaning or are they just a method in mathematics to manipulate numbers?


Reading keystrokes from a keyboard and using if statement in Java

I am learning how to program in Java. I wrote the following code but, I can't get the if statements to work when the variable inputName is compared to a string and the statement is true. Does anyone have any tips on how to fix this?    import java.util.Scanner; public class HelloWorld {    public static void main(String[] args) {     String x = ("Hello type in your first name.");     System.out.println(x);     Scanner keyboard = new Scanner(System.in);     String inputName = keyboard.next();       if (inputName == "erick") {       System.out.println("Hi");     }     String v = "victor";     if (inputName == v) {       System.out.println("Hi");     }     String c = "christy";     if (inputName == c) {       System.out.println("Hi");     }      keyboard.close();   } }


I'm trying to shorten the environment  \begin{align}     \begin{aligned}          %equation      \end{aligned}  \end{align}   by using the \newenvironment command as follows  \newenvironment{eqq}     {\begin{align}\begin{aligned}}     {\end{aligned}\end{align}}   But when I use this new environment like  \begin{eqq}     %equation \end{eqq}   it gives me a bunch of error messages:     ! Paragraph ended before \align was complete.\par       ! Missing $ inserted.$       ! Missing \endgroup inserted.\endgroup       ! Display math should end with $$.\par       ! LaTeX Error: \begin{align} on input line 163 ended by   \end{document}.See the LaTeX manual or LaTeX Companion for   explanation.Type H  for immediate help.... \end{document}   I used \equation instead of \align, but this gives me a weird indent within the pdf.


We're getting very close to releasing our iOS app on the App Store.  Since the , we have taken on hundreds of users, fixed a lot of bugs, and we have approached feature completion for v1.0.  We're still working on finishing touches and fixing crashes - but there aren't too many of those these days.  We believe we'll have this out in .    Current Alpha Testers:  We want to extend to you a huge thank you for using our app and giving us feedback.  We've made a ton of improvements that filtered through  here on meta.  We're pretty greedy, though, and we want more of your feedback as we get close to beta.  If you've been using the app, please leave an answer to tell us how you think we've done so far.  Don't go easy on us - we want to get this as right as we can before hitting the App Store.  You might even consider telling us how many stars you would give us if we were in the store.  Also, we created a room called  for more casual discussion about the app.  Everyone Else:  The alpha will continue in the interim, and we still .  The invitations are sent out once a week (usually), so if you don't get an invite right away, don't panic.  We'll get to you.  Bugs or feature requests should be reported here on meta and tagged .  Update, 5/1/2014    As of today, the app is submitted for review.  A great big thanks to all our alpha testers!  Your feedback has been invaluable and has truly helped us make the app much better than it would have been without you.  So what now?  Well, we intend to keep the alpha test group around, except now we're considering it the "beta channel".  It's still important to us, particularly since the update cycle through the AppStore is slow.  We'll still roll out updates in the same way that we have been.  We will also from time ask for targeted feedback on specific features.  And, lastly, if you're just now getting here and wished you had signed up for the alpha, feel free to sign up now anyway.  The form is still there, and we may still let in additional users to the beta channel depending on what our "active users" count looks like.


How do I override a \configure statement in html4.4t - tex4ht

This question is a narrowing of one  of the questions I asked in . html4.4t contains this statement:  \Configure{float}    {\ifOption{refcaption}{}{\csname par\endcsname\ShowPar \leavevmode}}    {\:xhtml{\IgnorePar\EndP}\HCode{

}}    {\ifvmode \IgnorePar \fi\EndP     \HCode{

}\csname par\endcsname\ShowPar}   I tried copying this code into my .cfg file, removing the hr tags. This created an error "Missing $ inserted" right before the \begin{center} when I run tex4t. I then just pasted this verbatim into my .cfg file, but still get the error.   Here's all it takes to see this problem:  \documentclass{book} \begin{document} \chapter{Simple Example} \begin{table} \begin{center} \hbox{ \begin{tabular}{|l|c|c|}\hline entry1&entry2&entry3\\ entry4&entry5&entry6\\ \hline \end{tabular}} \end{center} \caption{a caption} \end{table} \end{document}   How do I override this Configure statement to remove the hr tag?


Why won't Stack Exchange show Google Adsense ads?

Stack Exchange network sites are extremely successful, and they have obviously a huge future.  We all know the story of Google Adsense and how much frankly they pay publishers. Google Adsense shows ads automatically from the content and keywords of the page, no coding required, they will pay monthly.  Stack Exchange sites can make literally millions of dollars monthly from small, non-disturbing Adsense ads, why don't they show them?


Does an electromagnet have a magnetism limit?

I came across a question asking whether there is a limit to the magnetism of an electromagnet.


When are the sum of the digits of $2^n$ and $2^{n+1}$ equal and for what value of n? Stuck on this problem!

For $a \in Z$, let $p(a)$ be the sum of the digits of $2^a$. For instance, $2^5 =32$ and $p(5)=3+2$. For what values of $a$ is $p(a)=p(a+1)$. How do I go about doing this? I know that the last digits of $2^a$ end in 2,4,6, or 8. I tried writing equations to represent the digits but nothing is working so far.


In a finite group, show that the number of nonidentity elements that satisfy the equation $x^5=e$ is a multiple of 4.

I am new to abstract algebra, group theory. So, its difficult for me to solve this question. Kindly, please help me.


UserControl owner of a DialogBox, is it possible?

I need to use a DialogBox called by a UserControl. Is it any possibility to call a DialogBox and return the result to the UserControl?  private void Button_Click_1(object sender, RoutedEventArgs e) {             bool? result;              Dialog1 dlg = new Dialog1();             dlg.Owner = this;             dlg.ShowDialog();             //dlg.Show();              result = dlg.DialogResult; }   Supose that this button click event is inside a wpf UserControl. In this case I can't use "dlg.Owner = this;" to return the result to the caller.


I am trying to call a method that is located in a Fragment from a class. Now I am getting the error: Non-static method checkWriteStoragePermission() cannot be referenced from a static content. I'm really out of ideas. I am googling for about 2 days now without any result.  The class where I am trying to call the method:  public class MyFirebaseMessagingService extends FirebaseMessagingService {  public static String sRecordDate;  public void onMessageReceived(RemoteMessage remoteMessage) {      Intent intent = new Intent(this,MainActivity.class);     intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);     PendingIntent pendingIntent = PendingIntent.getActivity(this,0,intent,PendingIntent.FLAG_ONE_SHOT);     NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this);     notificationBuilder.setContentTitle("FCM NOTIFICATION");     notificationBuilder.setContentText(remoteMessage.getNotification().getBody());     notificationBuilder.setAutoCancel(true);     notificationBuilder.setSmallIcon(R.mipmap.ic_launcher);     notificationBuilder.setContentIntent(pendingIntent);     NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);     notificationManager.notify(0,notificationBuilder.build());      for (Map.Entry<String, String> entry : remoteMessage.getData().entrySet()) {         String key = entry.getKey();         String value = entry.getValue();          Log.d(":", "key, " + key + " value " + value);          sRecordDate = value;          RecordingMode.checkWriteStoragePermission(); //HERE I AM GETIING THE ERROR     } }   The method in the Fragment class:      public void checkWriteStoragePermission() {     if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {         if(ContextCompat.checkSelfPermission(getActivity(), android.Manifest.permission.WRITE_EXTERNAL_STORAGE)                 == PackageManager.PERMISSION_GRANTED) {             mIsRecording = true;             try {                 createVideoFileName();             } catch (IOException e) {                 e.printStackTrace();             }             startRecord();             mMediaRecorder.start();             mChronometer.setBase(SystemClock.elapsedRealtime());             mChronometer.setVisibility(View.VISIBLE);             mChronometer.start();         } else {             if(shouldShowRequestPermissionRationale(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)) {                 Toast.makeText(getActivity(), "app needs to be able to save videos", Toast.LENGTH_SHORT).show();             }             requestPermissions(new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_WRITE_EXTERNAL_STORAGE_PERMISSION_RESULT);         }     } else {         mIsRecording = true;         try {             createVideoFileName();         } catch (IOException e) {             e.printStackTrace();         }         startRecord();         mMediaRecorder.start();         mChronometer.setBase(SystemClock.elapsedRealtime());         mChronometer.setVisibility(View.VISIBLE);         mChronometer.start();     } }   How can I fix this easily? As I cannot convert this into a static method.  Kind regards,


MySQL 5.7 No directory, logging in with HOME=/

I'm sorry if this question has already been asked, but I can't find any solution to this (maybe small) issue:  I just made a fresh install of mysql-server 5.7 on a 14.04 server. Every time the MySQL service starts, I get this error:  root@xxx:/etc/mysql# service mysql restart  * Stopping MySQL Community Server 5.7.11 ...  * MySQL Community Server 5.7.11 is stopped  * Re-starting MySQL Community Server 5.7.11 No directory, logging in with HOME=/ ..  * MySQL Community Server 5.7.11 is started   What does that mean? Do I have to set a home directory to the user "mysql"? (and if so, what is the best choice? /home/mysql??) Now it's to /nonexistent:  mysql:x:110:106:MySQL Server,,,:/nonexistent:/bin/false   but I have another machine with the same /nonexistent, and it doesn't show any error...


How to transfer files between two servers with a server in the middle?

I'm usually used to scp but this time to access the source server I need to ssh to a first machine then do another ssh from this server to access a local machine. How to transfer files from this machine to my machine? because it's not directly accessible. Can I use the machine in the middle as a "proxy" for my transfers?


Is there a way to install Unity or Gnome Shell along with Lubuntu?

I'm using Lubuntu for a while now, but found a couple of details that I wanted to view with Unity (that's another story).  Ok, the thing is: I've tried on a VM with Lubuntu to install Unity (sudo apt-get install unity) When the installation is over. I selected in the Lubuntu login Unity/Unity2D but did not work.  Right now I'm installing ubuntu-desktop, I am presuming that will work, but also it will change my login for example.  Is there a way to do a "clean" installation of Unity but not make major changes on my Lubuntu?  I would prefer Gnome-Shell instead of Unity.


What happens if you call erase() on a map element while iterating from begin to end?

In the following code I loop through a map and test if an element needs to be erased.  Is it safe to erase the element and keep iterating or do I need to collect the keys in another container and do a second loop to call the erase()?  map<string, SerialdMsg::SerialFunction_t>::iterator pm_it; for (pm_it = port_map.begin(); pm_it != port_map.end(); pm_it++) {     if (pm_it->second == delete_this_id) {         port_map.erase(pm_it->first);     } }   UPDATE: Of course, I then  which I didn't think would be related but answers my question.


Beginner math books for Machine Learning

I'm a Computer Science engineer with no background in statistics or advanced math.  I'm studying the book  by Raschka and Mirjalili, but when I tried to understand the math of the Machine Learning, I wasn't able to understand the great book that a friend suggest me .  Do you know any easier statistics and math books for Machine Learning? If you don't, how should I move?


What's the best way to generate a UML diagram from Python source code?

A colleague is looking to generate UML class diagrams from heaps of Python source code.  He's primarily interested in the inheritance relationships, and mildly interested in compositional relationships, and doesn't care much about class attributes that are just Python primitives.  The source code is pretty straightforward and not tremendously evil--it doesn't do any fancy metaclass magic, for example.  (It's mostly from the days of Python 1.5.2, with some sprinklings of "modern" 2.3ish stuff.)    What's the best existing solution to recommend?


I have searched the forum and found various options for Static and normal variable. But i am still not able to figure out this: -   When i am executing this program given below, i am getting the desired output, but if i delete the "static" key word which is in front of String college, it also gives me the same output.    static String college ="ITS"; // Same output  String college ="ITS";// Same output   So whats the use of using the static keyword??  class Student{      int rollno;      String name;         static String college ="ITS";     Student(int r,String n){      rollno = r;      name = n;      }    void display (){System.out.println(rollno+" "+name+" "+college);}     public static void main(String args[]){    Student s1 = new Student (111,"Karan");    Student s2 = new Student (222,"Aryan");     s1.display();    s2.display();    }   }


A natural-language format for time and date

I'm looking for an easy-to-read way to format time and date. The time and date will be displayed in a piece of software, and will be used to tell when an event occurred. For example,      "A temperature spike occurred at [t&d]".    Shorter versions of the time and date will be displayed where appropriate. They will use the format YYYY/MM/DD HH:MM:SS UTC±HH:MM.  Given the software user might be in a different timezone, I feel that using natural language (and saying an event occurred 'Yesterday' or 'Last week') is not ideal. I would like to know what other formats of time and date are standard. Currently I hypothesize that the two formats will be:    "Commonwealth" format: DAY, DD MON YYYY at HH:MM:SS (UTC±HH:MM) eg.      Tue, 30th July 2013 at 15:42 (UTC+13)  US format: DAY, MON DD YYYY at HH:MM:SS (UTC±HH:MM) eg.      Tue, July 30th 2013 at 15:42 (UTC+13)    DAY is a 3-letter abbreviation for the day  MON is a 3-letter abbreviation for the month unless the month has 4 letters in which case, just use that  The year is optional and will default to the current year if not specified    Are my date formats correct and good natural language? Or are there better ones?  Thanks in advance!


why need overloading in java in simple real life?

I'm struggling to know why method overloading and overriding needed in java?  I have read some articles regarding this but not able to catch why it's needed practically?  i realize after so much searching that  suppose  we want to load a truck with many types of vegetables(potato and tomato). our simply target is to load these in truck.now there is two way for loads these vegetables in truck.   1.  one 'बोरी(sack) we full it by potato and in other we full it by tomato.  2. in one sack we can full it by tomato & potato both and in 2nd sack we can full it by also potato & tomato.  in both condition we are just load vegetables.  if vegetables are larger in the compare of truck's loading capacity then all knows that we use one more truck for loading rest of vegetables.  In whole time our target is just load these vegetables either it will come in one truck or more than one truck.  so how we can say that this is overloading.  Because on every sites of google and in every videos(example : watch video from 0:12 in given link below) everywhere overloading means to overload anything.  So my question is why overloading needed and according to my example what is difference between in overloading or loading?


JsonResult return field DateTime wrong format

Picture below is View display datetime wrong format.  This is code Controller public JsonResult LoadData() {   List<ABC> list = new List<ABC>();   foreach (var data in datas)   {     list.Add(data);   }    return Json(list, JsonRequestBehavior.AllowGet); }  What wrong with my code and How to fix?


How does this circuit given with diode works different from the standard current mirror circuit or will it work in the same way?

This question had already been asked here by someone else few years ago but I could not see any satisfactory answer so I am asking it again.  All I can see relevant in that post was the image attached here. Now I want to know how the circuit with diode are working. I am attaching the link of that thread so you can reach there and see the answer given there.


Can my MacBook Pro (Retina, 15-inch, Mid 2014) support 4k at 60Hz through Thunderbolt 2? If so, what adapter do I need?


Story where a space ship uses copper wire for fuel?

There was a story about a space traveler who ran out of fuel and got stranded on a strange planet. The fuel he needed was a roll of copper wire, which he eventually took from the laboratory of an indeterminate living being who created other beautiful life forms. As our mythical spaceman escaped, the "creator" went to the equivalent of a file cabinet and noted something on the order of "... the experiment on sol 3 was moderately successful...".


Who was the rightful owner of the Sword of Gryffindor?     ‘So where is it?’ Harry asked suspiciously.   ‘Unfortunately,’ said Scrimgeour, ‘that sword was not Dumbledore’s to give away. The sword of Godric Gryffindor is an important historical artefact, and as such, belongs –’   ‘It belongs to Harry!’ said Hermione hotly. ‘It chose him, he was the one who found it, it came to him out of the Sorting Hat –’   ‘According to reliable historical sources, the sword may present itself to any worthy Gryffindor,’ said Scrimgeour. ‘That does not make it the exclusive property of Mr Potter.’   Deathly Hallows - page 109 - Bloomsbury - chapter seven - The Will of Albus Dumbledore   Scrimgeour doesn't go on to say the Sword of Gryffindor belongs to the Ministry, although he does say it does not belong to Harry. Even so, I'm sceptical enough of the Ministry's motives to conclude that a case could probably be made for Harry being the sword's rightful owner. But was he?  Is there a canon answer to this question? If not a direct answer from the books, a speculative answer in the spirit of canon is welcome.   Who was the rightful owner of the Sword of Gryffindor?


What SciFi series(?) of books features humans time traveling into prehistory where an alien race is already in residence?

There is no return for the humans. I seem to remember that the humans and aliens find a way to get on, or I could be wrong. A small house in the Camargue of France is the link between the present and the past.


Do I use my druid's own proficiency bonus for the attacks of their wildshape?

Let's consider this example: A lvl 12 Druid has a +4 proficiency bonus. They proceed to wild shape into an ape, whose attacks have a +5 bonus to attack rolls, easily calculated to be +3 from its Strength and a +2 proficiency modifier. Does the wildshaped druid attack at +5, or at +7? I've seen the first interpretation to be more common but I'd like to know the reasoning for such.


2nd generation Intel Processor vs newer gen?

I'm interested in getting a gaming computer by buying an HP Z210 for $210 which is actually pretty decent with 4 gigs of 1333 ram and a quad core i5 running at 3.2 or something like that and slapping a $200 graphics card in it, but there has to be a place that cut corners.  My question is, since I know that it's using a sandy bridge (2nd generation processor), is there that significant of a difference between the different generations, such as the difference between AMD and Intel (sorta like how 2 ghz on an i3 matches a 3 ghz quad core amd processor? Will it render worse?) (btw I'm not just using it for gaming, but am planning on using photoshop, illustrator, word processing all for school and blender to create modded weapons for CoD WaW Zombie maps, so will it also render that program worse than a newer gen?)


Here is my flagging summary on SU:   Your flagging history   32 posts flagged as requiring moderator attention    2 are waiting for review   3 were marked valid   1 were marked invalid   (older flags were not recorded valid/invalid)    2 posts marked as spam    It is too complicated to look for invalid flags. Would it be possible to make filters on the top of the page (like on favorites for example) with:  By date, By type (off-topic, spam, dupes), By status (accepted, pending, rejected)  It would make it easier for reviewers to check their flagging and eventually know what to improve on.  Or is there another easy way to audit this?


How can I download and save all the images shown in a web page?

I want to download the images shown in a web page, for example , (the ones under the All Artworks tab), and store them in a folder (e.g. /home/boomer/GH/A_nou/).  How can I achieve this?  I can use wget or curl for that, but sadly I have no idea of what to do with them.  Also I don't want the intermediate images, (banners, logos, etc.), only full size images for everything under the artwork section.


Can I defeat an opponent with their own commander?

I know that if I gain control of my opponent's commander, it won't lose the status of commander. How is the commander damage calculated in this case? Can I do the 21 commander damage with the stolen commander to win the game? Does the damage add to the damage of my own commander?


How much electronics and other valuables can I bring duty-free when going to India?

I am planning to travel to India (COK airport, Kerala) from United States. I want to take my laptop as well as my tablet (iPad). Am I allowed to take both in my backpack with my documents related my work. I think I am allowed to take only one computer as per the rule. Will the customs consider my iPad as a computer?  What all I can take?   One of my friends took 2 laptops (1 work and 1 personal) and had trouble at the airport.  Also I am planning to take some wristwatches (7 of them, each avg price is 45 $). I read in a website that I can take stuff up to max 35000 INR. Is that true? In that case, how will I manage my stuff?


Attack with two keywords versus resistance with one of them

I had the following situation last night. A creature attacked with a Fire and Poison attack. My character has resist 5 Poison. does the resistance apply or do I need to resist 5 fire as well?


Generic solution to prevent a long cron job from running in parallel?

I am looking for a simple and generic solution that would allow you to execute any script or application in crontab and prevent it from running twice.  The solution should be independent on the executed command.  I assume it should look like lock && (command ; unlock) where lock will return false if there was another lock.  The second part would be like if it acquired the lock, run command and unlock after command is executed, even if it returns error.


I'm given a joint pdf  $f_{X,Y}(x,y)=2e^{-x-y}, 0<x<y, 0<y $  and asked to compute $P(Y<3X)$. To do this, I let $Y=3X$ (the boundary) and found that the region of integration is under this line.  To find $P(Y<3X)$, it seems to me that the integral for this region be written as   $P(Y<3X)=\int_0^\infty \int_0^{3x} 2e^{-x-y} dy dx  $  However this isn't right, as the boundaries are actually   $P(Y<3X)=\int_0^\infty \int_x^{3x} 2e^{-x-y} dy dx  $  Why is this? I'm having a hard time seeing how to construct these boundaries (especially the fact that the $y$ boundary goes from $x$ to $3x$ instead of $0$ to $3x$)  Thank you.


Custom logout is not logging out of session completly in Salesforce Community

I have configured a Custom Logout button on the header component on my Community using the below code. Clicking on it, it would then redirect to a page(I call it as Logout screen). But it is not logging out of the session completely. The user session is not killed and I can still access the community from other windows and tabs.
                             <svg class="slds-icon slds-icon-text-default slds-icon--cust1" aria-hidden="true" style="">               <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/support/resource/14/svg/symbols.svg#logout">               </use>             </svg>


I want to draw this graph in overleaf.  I tried Many times but I am unable to do so. Kindly help me out how to draw this graph. Thanks


What's the difference between LTS and Normal releases?

In the download section I see choices for versions 13.10 and 12.04. Also, I notice that 13.10 will be supported for 9 months and 12.04 LTS has support until year 2017. I have read information in this forum explaining Ubuntu support and I guess I have an idea about what all this means.   The following is the conclusion I have:   If I install a short-term support version then it is a good idea to replace it as soon as a new version comes out. If I install a long-term support version then I can keep it until the end of it. Support will be available for bugs, new hardware, new software, etc.   Am I correct?


Why are the 'color-neutral' gluons confined?

What makes the two 'color-neutral' gluons $(r\bar r−b\bar b)/\sqrt2$ and $(r\bar r+b\bar b −2g\bar g )/\sqrt6$ different from the pure $r\bar r +b\bar b +g\bar g $ ?  Why don't they result in long range (photon-like) interactions?


How accurate is the location detection on the iPhone's Find My iPhone app

How accurate is the GPS on the iPhone's Find My iPhone app?  I used Find My iPhone app to track a friend. The first 3 stops were dead on but when it refreshed it showed them to be several streets over from actual location. What could cause that?


Question about Rachel Posner and Doug Stamper

Why did Doug Stamper murder Rachel Posner?  And why was Frank Underwood pleased with this?  What did she know about Frank?


WE are planning to shoot LARGE SIZE CARPETS ( 5m /10 m ) with High Quality Resolution for professional Usage , ( LARGE PRINTING , MUSEUM CONSERVATION..ect ) Please can you advise the best camera  , Lenses and Required Lighting. we want to build a studio to take high quality images of  CARPET / RUGS.  few people suggest me to use  " Gig Pan " ..  i need your valuable suggestions to choose the right equipment.  with best regards


I tried to plug my GameCube into my HDTV, but it displays in black and white. I could still play and hear everything. I have all the original cables for my GameCube, and it only does it with the Vizio TV I have. How do I fix this?


Can screw-on macro lenses produce decent results?

I was browsing Amazon looking at a few items and came across :     4-piece Close-Up Macro Lens Kit   - Included are +1, +2, +4 and +10 Close- Up Lenses.   High-Quality lenses are diopters for close up photography. They shorten the close focusing distance of the lens, this allows the lens to go closer to the subject and achieves a larger image scale. Lenses may be used individually or in combination for a greater effect.   from what I can tell these screw onto a lens. I do not do macro work but I might want to play around some with macro photography and the price is decent. Are these really worth anything or they junk?  Please Note: I am an amateur and just getting into DSLR World and not a professional.


Why does my C: drive, under MS Windows 8.1 keep filling up with garbage?  Parameters: 228GB SSD hiberfile: 26.8GB pagefile: 19.9GB swapfile: 16.8Megabytes    I searched for large system files but only found hiberfile and pagefile. Is there another hidden location for the remaining 181 GB?  Why does this not show up on any searches? In search, I enter size:>1gb but nothing shows! No hiberfile, pagefile, or swapfile. Do system files show up in searches?  So where is the other 181.3GB and why can't I see it?