My Ubuntu 16.04 is suddenly started booting in to the tty1 mode. I'm not able to use gui by pressing ctrl+alt+f7. When I login in tty mode it says  -bash: /usr/bin/lesspipe: /bin/sh: bad interpreter: No such file or directory   I also tried startx and got this error  -bash: /usr/bin/startx: /bin/sh: bad interpreter: No such file or directory   How could I solve this problem and Why this happened suddenly?

I searched and read all possible pages here but I could not find the exact problem.  When I open my terminal I am getting:  bash: /usr/bin/lesspipe: /bin/sh: bad interpreter: No such file or directory   then when I use apt-get update I am getting following errors.  Fetched 39,9 MB in 53s (747 kB/s)                                               Reading package lists. . .  Done W: GPG error: http://archive. canonical.com/ubuntu xenial InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?) W: The repository 'http://archive.canonical.com/ubuntu xenial InRelease' is not signed.  N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.  N: See apt-secure(8) manpage for repository creation and user configuration details.  W: GPG error: http://ppa.launchpad.net/nijel/phpmyadmin/ubuntu xenial InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?) ....... W: The repository 'http://us.archive.ubuntu.com/ubuntu xenial-security InRelease' is not signed.  N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.  N: See apt-secure(8) manpage for repository creation and user configuration details.  E: Problem executing scripts APT::Update::Post-Invoke-Success 'touch /var/lib/apt/periodic/update-success-stamp 2>/dev/null || true' E: Sub-process returned an error code     $ namei -lx /bin/sh f: /bin/sh Drwxr-xr-x root root / drwxr-xr-x root root bin                      sh - No such file or directory   Does any one know why this error occurred and how can I solve it?


So I'm making a small game with C#. And in this game you can save and load.  I use an XML file  to store a player's data. But an XML file can be easily edited by any text editor.  So is there a way to encrypt or encode the XML file, and when i load it into my program, it returns back to normal XML code?  or will i have to make my own encryption ?  I have tried searching for a solution, but i did not find an understandable one.  Thanks very much.

How can I encrypt and decrypt a string in C#?


function validateemail($email) { $v = "/[a-zA-Z0-9_-.+]+@[a-zA-Z0-9-]+.[a-zA-Z]+/";  return (bool)preg_match($v, $email); } // check e-mail address, to see if it's a valid phone number if ($validateemail($email)) { $error = true; echo 'Invalid phone number!'; }   I'm trying to check if an e-mail address is valid by the function validateemail, if it's an invalid phone number a message is displayed and $error is set to true. However I can't seem to get this code to work, there are no syntax errors as far as I know. Any advice would be appreciated.  BTW - I know there are other ways to validate e-mail addresses, this is for a college project and for that purpose we have to use regex.   Thanks in advance!

Over the years I have slowly developed a  that validates MOST email addresses correctly, assuming they don't use an IP address as the server part.  I use it in several PHP programs, and it works most of the time.  However, from time to time I get contacted by someone that is having trouble with a site that uses it, and I end up having to make some adjustment (most recently I realized that I wasn't allowing 4-character TLDs).  What is the best regular expression you have or have seen for validating emails?  I've seen several solutions that use functions that use several shorter expressions, but I'd rather have one long complex expression in a simple function instead of several short expression in a more complex function.


This is the code i'm working with  gameWindow = [] print("Detecting Game Window..") def callback(hwnd, extra):     rect = win32gui.GetWindowRect(hwnd)     x1 = rect[0]     y1 = rect[1]     x2 = rect[2]     y2 = rect[3]     if win32gui.GetWindowText(hwnd) == "GameTest1":         gameWindow.append(x1)         gameWindow.append(y1)         gameWindow.append(x2)         gameWindow.append(y2)     else:         gameWindow = "None"  win32gui.EnumWindows(callback, None)  if type(gameWindow) != list:     print("ERROR: Couldn't detect game window.")     sys.exit() print(gameWindow)   It suppose to append the coordinates of a window to a list.   But it throws me this error  Detecting Game Window.. Traceback (most recent call last):   File "c:\Users\otter\Desktop\Tree Detector Test\main.py", line 55, in <module>     win32gui.EnumWindows(callback, None)   File "c:\Users\otter\Desktop\Tree Detector Test\main.py", line 48, in callback     gameWindow.append(x1) UnboundLocalError: local variable 'gameWindow' referenced before assignment   I have no idea why it's showing me this since i create gameWindow before even calling win32gui.EnumWindows(callback, None) function

The following code works as expected in both Python 2.5 and 3.0:  a, b, c = (1, 2, 3)  print(a, b, c)  def test():     print(a)     print(b)     print(c)    # (A)     #c+=1       # (B) test()   However, when I uncomment line (B), I get an UnboundLocalError: 'c' not assigned at line (A). The values of a and b are printed correctly. This has me completely baffled for two reasons:   Why is there a runtime error thrown at line (A) because of a later statement on line (B)? Why are variables a and b printed as expected, while c raises an error?   The only explanation I can come up with is that a local variable c is created by the assignment c+=1, which takes precedent over the "global" variable c even before the local variable is created. Of course, it doesn't make sense for a variable to "steal" scope before it exists.  Could someone please explain this behavior?


How can we prove formally that the  series $\sum a_{n}$ diverges whose $n^{th}$ term has been provided below:     $$ a_{n}=\frac{1}{n}\left( 1+ \frac{1}{\sqrt{2}}+\frac{1}{\sqrt{3}}+\cdots+\frac{1}{\sqrt{n}} \right),\qquad n\ge1.$$   The sequence converges to zero but I am not sure how book has proved that the series diverges?

Let $t_n= \frac{1}{n} [1+\frac{1}{\sqrt{2}}+.....+\frac{1}{\sqrt{n}}]$, n=1,2...  Then I am asked whether series$ \sum t_n $ converge or diverge. Also whether sequence $ t_n $ converge to zero or not.  I tried About sequence $t_n$, by Cauchy's 1st theorem, that since 1/$\sqrt{n} $ converges to zero so does t_n. But the seriex part is doubtful to me.?


I have entered a weird state  Firefox was open. The icon appears in the cmd+tab task menu.  In the dock it shows as "not responding". Force Quit does nothing though.    Ok... but then it doesn't show in Activity Monitor either.  I have searched for "Firefox", "fox", "ff", "mozilla" and skimmed through by eye.  I have also tried grepping the output of ps aux and top in terminal but I can't find it.  I wondered if maybe it wasn't really open and just the dock icon/task switcher were confused, but when I double-click Firefox from the Applications folder:    I have tried relaunching Finder but it doesn't fix anything.  I assume a reboot will fix it, can anyone suggest another avenue?

I've been encountering an extremely annoying problem since I upgraded to Yosemite. FCPX (but I've been having reports of this problem on other computers with finder.app and safari.app) sometimes will crash on exit (with no detectable log trace) and its icon will remain in the dock with the usual "this application is not responding" menu warning. Force quit won't work Rebooting can only be done the hard way because the stuck app is preventing a soft one yet no single process regarding FCPX is listed when in the activity monitor nor there is one in psaux. No zombie processes to be found; computer performance is fine. If I open an FCPX library, I'll get a dialog stating that "The application "Final Cut Pro" is not open anymore", which is quite irritating q: I'm on a MBP Retina early 2013 15' Does anybody have the slightest clue what's going on here?


I'm trying to populate an ArrayList<Integer> with numbers. When I call on the method in the main method, the compiler complains that  Exception in thread "main"`       java.lang.NullPointerException         at PrimeSum.setGeneralArray(PrimeSum.java:11)         at PrimeSum.main(PrimeSum.java:36)         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)         at java.lang.reflect.Method.invoke(Method.java:483)         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)  Process finished with exit code 1   This a sample of my code.  public class PrimeSum { private ArrayList<Integer> generalArray; private int limit; public void setGeneralArray() {     for(int i = 2; i < 2000001; i++) {         generalArray.add(i);     } } // ... // This is how I call on the method. public static void main(String[] args) {     PrimeSum ps = new PrimeSum();     ps.setGeneralArray();     // ...   What's the thing I'm doing wrong?

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


If I have a  on the battlefield and say that I will be casting  for 10 mana, will the cost reduction of 2 mana from the 's effect reduce the X so that the  is 8/8 or will it remain 10/10?  My thinking is going with X = 10, but I need to make sure.  Then, expanding on that:  If I have 4 x  on the battlefield, could I cast an 8/8  for "free", using only the total cost reduction of 8 mana (from the 4 x s) as the "X" casting cost?

If I play a spell with {X} in the mana cost, and I have a card out that reduces the casting cost by 2 generic mana, what happens to the X? Does it start at -2?  For example: I have  in play. If I play  for just 1 blue mana, do we draw 2 cards?


I burned a Live-CD of Ubuntu 14.04 (32-bits) and when I boot up the computer from the CD, it appears a purple frozen screen with a weird icon on the bottom. I think I've pressed every key on the keyboard to try to reach a menu of something but nothing seems to work. Most of the keys give me a "beep" sound when I press them. I have a 2007 computer running Windows Vista (32-bits).

I need to obtain a display adapter for SiS mirage +3 gpu (closed source), so I can run a stable system on Ubuntu.  I need to find a driver for this adapter that is open source and gives completely stable video playback.


I have a Windows Server 2012 R2 server that has the AD role installed on it. All machines, Linux and Windows use the AD DNS server for name resolution. When making DNS queries on Linux using NSLookup I have to type the FQDN (mynode.domain.com). But in Windows, I only need the hostname (mynode). So, my question is, is there a way to just use hostnames on Ubuntu?   Here is the output I get when trying just the hostname:  Got SERVFAIL reply from 192.168.0.2, trying next server ... server can't find mynode: NXDOMAIN   Any help with this, as always, is appreciated.

I have just installed ubuntu 12.04. And I am a beginner on Linux. So, how can I add the DNS suffix in this OS. Please help..


I am attempting to install a canon pixma mx330 (multi-function) all-in-one on Ubuntu 14.04.    I found a page with , and I have followed the instructions to the point of installing the actual driver without any errors.  When I attempt to install the mx330series driver I get the following error message:  charles@charles-GN689AA-ABA-m8277c:~$ sudo apt-get install cnijfilter-mx330series Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:    cnijfilter-mx330series:i386 : Depends: libtiff4:i386 (> 3.9.5-3~) but it is not installable E: Unable to correct problems, you have held broken packages   I have downloaded and attempted to install libtiff4, but my system tells me it is already installed.  What steps do I need to take to get the mmx330 driver installed?  Thank you.

I've been using my Canon MP550 printer for some Ubuntu versions now, and installation always worked:  $ sudo add-apt-repository ppa:michael-gruz/canon-trunk   $ sudo apt-get update   $ sudo apt-get install cnijfilter-mp550series   However, with a fresh 14.04 install I get this unmet dependency problem:  Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may  to resolve the situation:  The following packages have unmet dependencies:   cnijfilter-mp550series: i386: Depends: libtiff4: i386 (> 3. 9. 5-3~) but   it is not installable E: Unable to correct problems, you have held   broken packages.


I have two shapefiles. 1. the clinic buffers 500m area. 2. the postcode area.  Is there a simple way to calculate the intersect two shapefiles ? I'm using QGIS Dufour. I tried to use fTools to intersect. However, it didn't show me actually how much every piece of the green area. It just combined the fields of two shapefiles.   How do I calculate the intersect of two shapefiles?      I used "Field Calculator" to calculate the intersection with $area. But those numbers are bigger than original area.

I have a point shapefile of villages where data was collected in Northern Kenya. I created a buffer around those villages.   The second vector layer contains polygons defining areas according to vegetation type. So for example, a forest might be surrounded by a narrow ring of woodland in an area which is mainly grassland. I'm trying to obtain a percentage of each vegetation type within the buffer per village.   I'm using QGIS 1.7


There are methods on meta sites when discussing tags to put them graphically into your question/answer (using brackets):   I am requesting that the same be implemented for badges: that it would be possible to use the syntax [badge:tenacious] and have the system automatically convert it to a graphical badge, like:    It would enhance the meta sites in particular by making them more aesthetically pleasing, though it wouldn't have a large if any effect on the main sites.

I always found it odd that although I could compose  and  with  in , I can't do the same for a , , or . I assume that this is because, outside of Meta Stack Overflow, there is no real need to reference badges? Be that as it may, would there be any interest in adding badges to Markdown? I am envisioning a syntax similar to the one used for tags. For example,  [badge:great-question] Question score of 100 or more. This badge can be awarded multiple times.  or ( ):  [gold-badge:great-question] Question score of 100 or more. This badge can be awarded multiple times.  would be displayed as  Note that I am not proposing that you need to enter the badge description to display the badge, nor that the badge description will be automatically inserted. Typing [badge:great-question] (or [gold-badge:great-question]) would be sufficient to display the "Great Question" badge, which would ideally have a tooltip with the badge description and link to the badge page. (I used the badge description text in the example above only because it was easier to take a screenshot that way.)  and  are great examples of posts that would benefit from the addition of badges to Markdown. UPDATE:  has brought it to my attention that the idea of a badge creator is not a new one. Check out this post for .      , until inevitably . Luckily,   (as of May 23, 2013). Given the popularity and utility of these badges—their use in jokes notwithstanding—wouldn't it be better to have Stack Overflow host this functionality itself rather than have users rely on an external service that will inevitably go down?


Apache/2.4.18 (Ubuntu) Ubuntu 16.04   I tested the initial configuration, pointed my browser to the server, and got the normal ubunutu page. Works fine.  The 000-default.conf is:  <VirtualHost *:80>     ServerAdmin webmaster@localhost     DocumentRoot /var/www/html </VirtualHost>   The index.html is in the /var/www/html directory and the /var/www/html directory has permissions set to 0755  I created a directory /home/utils/rails/public, owned the user utils. I set the permissions for this directory to 0755  I copied the file index.html from /var/www/html to /home/utils/rails/public  I then modified the /etc/apache2/sites-available/000-default.conf to the following:  <VirtualHost *:80>     ServerAdmin webmaster@localhost     DocumentRoot /home/utils/rails/public </VirtualHost>   I restarted apache2 and pointed the browser to the location, but this time I got the  Forbidden You don't have permission to access / on this server   If I reverse the procedure, and change the DocumentRoot back to /var/www/html, everything works fine.  What am I doing wrong?  namei -lx /home/utils/rails/public f: /home/utils/rails/public Drwxr-xr-x root  root  / drwxr-xr-x root  root  home drwxr-xr-x utils utils utils drwxrwxr-x utils utils rails drwxr-xr-x utils utils public

I have changed the configuration of Apache to point towards a folder in my home directory:  <VirtualHost *:80>     ServerAdmin webmaster@localhost      DocumentRoot /home/dbugger/html      <Directory />         Options FollowSymLinks         AllowOverride None     </Directory>     <Directory /home/dbugger/html/>         Options Indexes FollowSymLinks MultiViews         AllowOverride None         Order allow,deny         allow from all     </Directory>      ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/     <Directory "/usr/lib/cgi-bin">         AllowOverride None         Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch         Order allow,deny         Allow from all     </Directory>      ErrorLog ${APACHE_LOG_DIR}/error.log      # Possible values include: debug, info, notice, warn, error, crit,     # alert, emerg.     LogLevel warn      CustomLog ${APACHE_LOG_DIR}/access.log combined      Alias /doc/ "/usr/share/doc/"     <Directory "/usr/share/doc/">         Options Indexes MultiViews FollowSymLinks         AllowOverride None         Order deny,allow         Deny from all         Allow from 127.0.0.0/255.0.0.0 ::1/128     </Directory>  </VirtualHost>   I have even given my /home/dbugger/html permission 777. But I still keep getting the same error message at http://localhost: "403 Forbidden"  What is it that I am missing?


The Wubi.exe is on the Ubuntu 1404 disk, not on Xubuntu1404 disk; (and when you launch it supports Ubuntu, Kubuntu, Lubuntu), but... doesnt support Xubuntu. Can anyone provide guidance? Thanks so much!

Is there any Windows installer (wubi) for Ubuntu 14.04 LTS?  When I mount the .iso file with Daemon Tools and run wubi.exe, it just asks me if I want to reboot (I think that's useful only when the .iso  is burned on CD), so is there no "real" installation?


What is the purpose of /usr/share/applications/bamf-2.index ?   I have noticed the applications it contains are installed in my computer. But I don't think it contains the complete list. Because the following commands give different values  more /usr/share/applications/bamf-2.index| wc -l   dpkg-query -l | wc -l`   Please Explain.

I've googled for it, and there's very little info besides "bamf matches application windows to desktop files".  Unity depends on it so it's difficut to remove, at least would be good to know what it does.


So I understand why this is true: $$ \frac{x}{(x+2)(x+1)} = \frac{A}{x+2} + \frac{B}{x+1} $$  But there's a special rule in partial fraction that I just couldn't get it. When you have a term that is squared, I must add another fraction with the term squared in the denominator: $$ \frac{x}{(x+2)(x+1)^2} = \frac{A}{x+2} + \frac{B}{x+1} + \frac{C}{(x+1)^2} $$  Why? Shouldn't $(x+1)^2$ be treated like $(x+1)(x+1)$ and do this instead?: $$ \frac{x}{(x+2)(x+1)^2} = \frac{A}{x+2} + \frac{B}{x+1} + \frac{C}{x+1} $$  Why is the extra square needed?    To visualize it easier, I have tried to substitute terms with letters.  $$ \frac{x}{(x+2)(x+1)}\\ \text{Let x+2 be X, x+1 be Y:}\\  = \frac{A}{X} + \frac{B}{Y}\\  = \frac{AY+BX}{XY} $$  And I can do the same thing for this:  $$ \frac{x}{(x+2)(x+1)^2} = \frac{x}{(x+2)(x+1)(x+1)}\\ \text{Let x+2 be X, x+1 be Y, x+1 be Z:}\\  = \frac{A}{X} + \frac{B}{Y} + \frac{C}{Z}\\  = \frac{AYZ + BXZ + CXY}{XYZ}\\ \\ \frac{x}{(x+2)(x+1)(x+1)} = \frac{AYZ + BXZ + CXY}{XYZ}\\ x = AYZ + BXZ + CXY $$  I don't see any problem in this.

I'm learning about partial fractions, and I've been told of 3 types or "forms" that they can take  (1) If the denominator of the fraction has linear factors:  $${5 \over {(x - 2)(x + 3)}} \equiv {A \over {x - 2}} + {B \over {x + 3}}$$  (2) If the denominator of the fraction has quadratic factors that don't factorise:  $${{2x + 3} \over {(x - 1)({x^2} + 4)}} \equiv {A \over {x - 1}} + {{Bx + C} \over {{x^2} + 4}}$$  (3) If the denominator has a factor that repeats:  $${{5x + 3} \over {(x - 2){{(x + 3)}^2}}} \equiv {A \over {x - 2}} + {B \over {x + 3}} + {C \over {{{(x + 3)}^2}}}$$    I'd appreciate it if someone could explain to me how these equivalence relationships are derived, essentially how do they take the forms that they do? I sort of understand the first one, but the other two I don't.  Thank you


hello i am trying to redirect to another webapage but its not working:  code which written to redirect:    window.location.replace = "/goal/viewgoal/goalID";   html code:     <button id="submit-new-goal"class="btn btn-sm btn-primary m-l-md redirect">      Continue Save    </button>   complete code:    if (!checkValidation) {   $.ajax({     url: "/goal/createGoal",     type: "POST",     dataType: "json",     data: {       goalSchemaObj,       userID,       selectedTeachers     },     success: function(data) {       console.log("created Goal", data);       $.bootstrapGrowl("
Success!

Goal Created.
", {         type: "success",         delay: 4500,         allow_dismiss: true       });        window.location.replace = "/goal/viewgoal/goalID";     },     error: async err => {       const response = await err;       console.log("creation-cehck", response);       $.bootstrapGrowl("
Error!

something wrong.
", {         type: "danger",         delay: 4500,         allow_dismiss: true       });     }   }); } else {   $.bootstrapGrowl("
warning!

Please Fill all the fields.
", {     type: "warning",     delay: 4500,     allow_dismiss: true   }); }

How can I redirect the user from one page to another using jQuery or pure JavaScript?


In practice, this difference is obvious, but how to put it in words?

I have been wondering about the differences between model paramters and model hyperparameters, as well as what their categorization means for a learning problem.  Is the distinction between model parameters and hyperparameters only about reducing the complexity of the problem or are there implications for the 'model quality' to be considered?  Let's consider an example from (1, Eq. 2.43), a linear expansion of basis functions   $$f_\theta(x) = \sum_{m=1}^{M} \theta_m h_m(x), $$  where $h_m\:\forall m=1,...,M$ is some function of $x$, $\theta=[\theta_1,...,\theta_M]^\intercal$ is a vector of the parameters of the model and $M$ is the number of basis functions.   In my understanding, we would consider $\theta$ to contain the parameters of the model, while $M$ is a .  To quote the Wikipedia article of hyperparameter that I linked above:     In machine learning, a hyperparameter is a parameter whose value is   set before the learning process begins. By contrast, the values of   other parameters are derived via training.   It makes sense treating the values in $\theta$ as parameters that should be learned from the data, similar to the coefficients in a linear model - it is surely far more reliable  and  specifying them manually would be quite annoying, although it's not impossible. But what about $M$? It surely is easier to pick some integer value for it. But would it really be terrible to determine $M$ based on the data, too? Probably not, as that is what we would do if we search a grid of possible values for the best performing one.   Let's consider the above basis expansion model and choose Gaussian kernel functions to serve as basis functions. As the Kernel itself has parameters too  this makes the problem a bit more complicated.  $$f_\theta(x) = \sum_{m=1}^{M}\theta_m K_{\lambda_m}(\mu_m,x), $$ with $\mu_1,...,\mu_m$ being the location of the kernels and $\lambda_1,...,\lambda_m$ their scales/bandwidths.  Friedman et al. write in (1, p. 36)        "In general we would like the data to dictate them as well. Including   these as parameters changes the regression problem from a   straightforward linear problem to a combinatorially hard nonlinear   problem. In practice, shortcuts such as greedy algorithms or two stage processes are used."   I see that if we were to treat $M$, $\theta_1 ... \theta_M$, $\mu_1 ... \mu_M$ and $\lambda_1 ... \lambda_M$, as model parameters, this problem would be really complex, especially with the choice of $M$ determining the number of the other parameters. But what if we simplify the model definition - let us for example use the same scale/bandwidth for each kernel, that gives us only one parameter $\lambda$. Furthermore, let's say we specify $\mu_1 ... \mu_M$ based on some heuristic, which would mean we treat it as a hyperparameter.  This gives us   $$f_{\theta,\lambda}(x) = \sum_{m=1}^{M}\theta_m K_\lambda(\mu_m,x), $$  Besides increased complexity of the involved optimization problem, does treating $\lambda$ as a parameter rather than a hyperparameter have other negative or undesired effects?      (1) Friedman, Jerome, Trevor Hastie, and Robert Tibshirani. The   elements of statistical learning. Vol. 1. No. 10. New York: Springer   series in statistics, 2001.


I want my small object to fall inside the shell of the larger sculpture. Why does it just hit the top plane of the object instead? Thanks!

I'm trying to get a ball to go through in between the cup gear things shown in the screenshot below.   It seems that the collision box does not consider the cups. Yes, the ball fits and they are rotating in the right direction.  If there is already an answer to this, please link it.       If you have any questions about what is going on/ what the project is, feel free to ask.


I couldn't find the bug. I used nextLine() after reading nextInt() but still next() is not reading the word("UPDATE"). What am I missing?  Input to read:       2     4 5     UPDATE 2 2 2 4     QUERY 1 1 1 3 3 3     UPDATE 1 1 1 23     QUERY 2 2 2 4 4 4     QUERY 1 1 1 3 3 3     2 4     UPDATE 2 2 2 1     QUERY 1 1 1 1 1 1     QUERY 1 1 1 2 2 2     QUERY 2 2 2 2 2 2   My code:     Scanner sc = new Scanner(System.in);         int t = sc.nextInt();         for(int i=0 ; i<t ; i++){             int n = sc.nextInt();             int m = sc.nextInt();             sc. nextLine ();             System.out.println(n+ " " + m);             for(int j=0 ; j<m ; j++){                 String Q = sc.next(); // tried (String)sc.next(); also                  if(Q == "UPDATE"){                     int x = sc.nextInt();                     int y = sc.nextInt();                     int z = sc.nextInt();                     int val = sc.nextInt();                     sc.nextLine();                     System.out.println(x+ " " + y + " "+ z + " "+ val);                 }                 else if(Q == "QUERY"){                     int x1 = sc.nextInt()-1;                     int y1 = sc.nextInt()-1;                     int z1 = sc.nextInt()-1;                      int x2 = sc.nextInt();                     int y2 = sc.nextInt();                     int z2 = sc.nextInt();                     sc.nextLine();                    System.out.println(x1+ " " + y1 + " "+ z1 + " "+ x2+ " " + y2 + " "+ z2);                 }               }         }

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


My Win7 professional client has a connected network drive to the server with cached login (user/pw) data. How can I connect to the same server as a different user simultaneously?

I have a machine running Ubuntu with Samba that I use to share stuff with my family's Windows machines in our local network.  Currently they access a share for movies/music/etc with one user.  I want to connect them to another share as a different user (for example, user "goytacaz").  When I try connecting to this new share, Windows gives me "Error 1219" and complains about multiple connections by the same user.  How do I get my machine to accept multiple connections by the same user?


MWE  \documentclass[usenames,dvipsnames]{beamer} \usepackage{xcolor} \usepackage{tikz} \usepackage{listings} \usepackage{algpseudocode} \usefonttheme[onlymath]{serif} \usepackage{amsmath} \usetheme{Madrid}   \algnewcommand\algorithmicinput{\textbf{Input:}} \algnewcommand\algorithmicoutput{\textbf{Output:}} \algnewcommand\algorithmicinitialization{\textbf{Initialize:}} \algnewcommand\Input{\item[\algorithmicinput]}% \algnewcommand\Output{\item[\algorithmicoutput]}% \algnewcommand\Initialize{\item[\algorithmicinitialization]}%   \logo{%   \includegraphics[width=1cm,height=1.5cm,keepaspectratio]{example-image-a}%   \hspace{\dimexpr\paperwidth-2cm-5pt}%   \includegraphics[width=1cm,height=1cm,keepaspectratio]{example-image-a}% } \begin{document}   \title{Resource  Allocation in Cloud Radio Access Network}   \author[alhelal \& Jobayed Ullah]{   \parbox{2.5cm}{ \centering Md.Al-Helal\\Roll:SH-51}\hspace{1cm} \parbox{2.5cm}{ {\centering Jobayed Ullah\\Roll:EK-107}} } \institute[CSEDU]{Computer Science \& Engineering\\CSEDU} \date{February 25, 2018} \begin{frame}   \maketitle \end{frame} \begin{frame}   \frametitle{Background}   Traditional cellular, or Radio Access Networks (RAN), consist of many standalone base stations (BTS) have some limitations-   \begin{itemize}     \item Each BTS is costly to build and operate.     \item When more BTS are added to a system to improve its capacity, interference among BTS is more severe as BTS are closer to each other.     \item Because users are mobile, the traffic of each BTS fluctuates (called 'tide effect'), and as a result, the average utilization rate of individual BTS is pretty low.   \end{itemize} \end{frame} \begin{frame}   \frametitle{Architechture Overview}   \includegraphics[scale=0.3]{example-image-b} \end{frame} \begin{frame}   \frametitle{Architechture Overview}   \begin{itemize}     \item Large scale centralized deployment: Allows hundreds of thousands of RRHs to connect to a centralized BBU pool.     \item Native support to Collaborative Radio technologies: Any BBU can talk with any other BBU within the BBU pool with very high bandwidth (10Gbit/s and above) and low latency(10us level).     \item  C-RAN BBU pool is built on open hardware, like x86/ARM CPU based servers. Real-time virtualization makes sure the resources in the pool can be allocated dynamically to base station software stacks, say 4G/3G/2G function modules from different vendors according to network load.\cite{Gill}   \end{itemize} \end{frame} \begin{frame} \bibliography{references} \bibliographystyle{plain}  \end{frame} \begin{frame}{\phantom{}}  % \color{Brown}   \color{Sepia}   \centering \Huge\textbf{Thank You} \end{frame} \end{document}   and references.bib is    @ARTICLE{Gill,    author    = "A. E. Gill",    title     = "Some Simple Solutions for Heat-Induced Tropical Circulation",    journal   = "Quart. J. R. Met. Soc.",    volume    = 106,    year      = 1980,    pages     = "447--462", } @InProceedings{conf/wiopt/AlabbasiC17,   title =   "Delay-aware green hybrid CRAN",   author =  "Abdulrahman Alabbasi and Cicek Cavdar",   publisher =   "IEEE",   year =    "2017",   bibdate = "2017-07-06",   bibsource =   "DBLP,          http://dblp.uni-trier.de/https://doi.org/10.23919/WIOPT.2017.7959942;          DBLP,          http://dblp.uni-trier.de/db/conf/wiopt/wiopt2017.html#AlabbasiC17",   booktitle =   "WiOpt",   crossref =    "conf/wiopt/2017",   ISBN =    "978-3-9018-8290-6",   pages =   "1--7",   URL =     "http://ieeexplore.ieee.org/xpl/mostRecentIssue.jsp?punumber=7951216", }   output shows

I've browsed the forums and found a number of posts that have addressed this issue, but none of the solutions seem to work for me. I have the following script that I just copied from the bibtex home page to get familiar with it. Instead of the citation number I get a question mark. I compile using Latex+Bibtex+Latex+Latex+PDFLatex+ViewPDF just as has been previously suggested and the problem persists.   \documentclass[11pt]{article} \usepackage{cite}  \begin{document}  \title{My Article} \author{Nobody Jr.} \date{Today} \maketitle  Blablabla said Nobody ~\cite{Nobody06}.  \bibliography{mybib} \bibliographystyle{plain} \end{document}   My bibliography (Bib.bbl)  @misc{ Nobody06, author = "Nobody Jr", title = "My Article", year = "2006" }    Looking at previous posts one thing that is concerning is that my .bbl looks empty as shown below. Further, I don't have a .blg  \begin{thebibliography}{}  \end{thebibliography}


Recent observations discovered really massive black holes, up to $20-40$ billions Solar masses.  Now, according to an recent study and various computer simulations (I'm sorry, I don't have any reference for this, if not a paragraph on a scientific magazine), in a complete ideal case a black hole would grow about $2$ millions Solar masses in $2$ millions years.  Given that, a $20$ billions Solar masses black hole shouldn't exist because the Universe is just $13.7$ billions years. But ok, the simulation indicated an "ideal case" so one should argue about this before.  In any case, there is something I don't get: how is it possible for a $20-40$ billions Solar masses black hole to exist?   A black hole is created by the collapse of a star (according to some criteria and so on), and stars usually live for billions years. So I do expect that a $30$ billions Solar masses black hole has to be really really old, like it does exist since a "short" time after the Big Bang.  How is that possible? How does huge massive black holes have been created?  Something useful maybe  Abstract of the paper I was referring to    And the complete article (hacked)

According to the article above, we observe this supermassive black hole as it was 900 million years after the formation of the universe, and scientists find its extreme specifications mysterious because of the relatively young age of the Universe at that time.   Why would the 12 billion Solar Masses mass value be mysterious, unless there was a limit of sorts to the rate of mass consumption by a black hole? (naive point: Why would 900 million years not suffice for this much accumulation, keeping in mind that most supermassive stars which form black holes have life-spans of a few tens of millions of years at most?)


I have a Mac. It is running Mac OS X 10.6.8. It is ten years old, came out in 2006.  I go to the App Store.  The listing for OS X 10.11 claims it is "compatible with 10.6.8", but when I "get" (click on the Get button) the update, it comes up with a message that says "...cannot be installed on this computer."  What am I doing wrong?

Is there a list of officially supported Macs for OS X El Capitan?  I ask to get ready if any hardware which is supported on Yosemite is not supported by El Capitan?


Can a moderator lose moderation privileges? Is it permanent?  I have seen a moderator who was last active like 2 years ago but he is still a moderator. I don't want to mention them but will they stay moderator forever?

Some people have a diamond after their username (e.g. )    What special privileges do diamond moderators have? How can I become a diamond moderator? Who are the diamond moderators?  How many are there?      For more information, see  in the .     Note: not to confuse with certain Stack Exchange employees, for example  members or "community managers", who often have diamonds as well, but are not ordinary moderators.


What's the derivative of $$f(X)=\text{Tr}(YX^{-1})$$ with respect to $X$, where $X$ and $Y$ are square matrices of the same dimension?   My first attempt is to apply the chain rule as: Let $h(X)=X^{-1}$. So, $f(X)=\text{Tr}(Yh(X))$. Hence,  $$\frac{df(X)}{dX}=\frac{\partial f(x)}{\partial h(X)}\cdot\frac{\partial h(X)}{\partial X}= Y \cdot - X^{-2}=-YX^{2}$$   I'm not sure of my answer.

Prove that $$\nabla_{\mathrm X} \mbox{tr} (\mathrm A \mathrm X^{-1} \mathrm B) = - \mathrm X^{-\top} \mathrm A^\top \mathrm B^\top \mathrm X^{-\top}$$   My proof is below. I am interested in other proofs.    My proof  Let   $$f (\mathrm X) := \mbox{tr} (\mathrm A \mathrm X^{-1} \mathrm B)$$  Hence,  $$\begin{array}{rl} f (\mathrm X + h \mathrm V) &= \mbox{tr} (\mathrm A (\mathrm X + h \mathrm V)^{-1} \mathrm B)\\ &= \mbox{tr} (\mathrm A (\mathrm X ( \mathrm I + h \mathrm X^{-1} \mathrm V))^{-1} \mathrm B)\\ &= \mbox{tr} (\mathrm A ( \mathrm I + h \mathrm X^{-1} \mathrm V)^{-1} \mathrm X^{-1} \mathrm B)\\ &= \mbox{tr} (\mathrm A ( \mathrm I - h \mathrm X^{-1} \mathrm V + O (h^2)) \mathrm X^{-1} \mathrm B)\\ &= \mbox{tr} (\mathrm A \mathrm X^{-1} \mathrm B) - h \, \mbox{tr} ( \mathrm A \mathrm X^{-1} \mathrm V \mathrm X^{-1} \mathrm B) + O (h^2)\\ &= f (\mathrm X) - h \, \mbox{tr} ( \mathrm X^{-1} \mathrm B \mathrm A \mathrm X^{-1} \mathrm V ) + O (h^2)\end{array}$$  Thus, the directional derivative of $f$ in the direction of $\mathrm V$ at $\mathrm X$ is  $$D_{\mathrm V} f (\mathrm X) = - \mbox{tr} ( \mathrm X^{-1} \mathrm B \mathrm A \mathrm X^{-1} \mathrm V ) = - \mbox{tr} ( (\mathrm X^{-\top} \mathrm A^\top \mathrm B^\top \mathrm X^{-\top})^\top \mathrm V ) = - \langle \mathrm X^{-\top} \mathrm A^\top \mathrm B^\top \mathrm X^{-\top}, \mathrm V \rangle$$  and, lastly,  $$\nabla_{\mathrm X} \mbox{tr} (\mathrm A \mathrm X^{-1} \mathrm B) = - \mathrm X^{-\top} \mathrm A^\top \mathrm B^\top \mathrm X^{-\top}$$


Claim: $3\mid n^4-n^2$  for all $n \in \mathbb{Z^+}$, $n\ge2$. What I've done so far: Base case: Let $n=2$. Then $\exists k \in \mathbb{Z}$ such that $12=3k$, namely, $k=4$. Thus $3 \mid 12$ and hence the claim holds for $n=2$. Assume for positive integer $m \ge 2$ that $m^4-m^2=3k'$ with $k' \in \mathbb{Z}$ I substituted $m+1$ for $n$, and have $(m+1)^4 - (m+1)^2$ $=$  $\sum_{i=0}^{4} {4\choose i} m^i \cdot 1^{4-i} - (m+1)^2= m^4+4m^3+6m^2+4m+1-(m+1)^2=m^4-m^2+4m^3+6m^2+2m=(m^4-m^2)+4m^3+6m^2+2m=3k'+4m^3+6m^2+2m$ I'm stuck. Would this be the correct way to go? Reattempt Proposition: $3 \mid n^4-n^2$ for all $n \in \mathbb{Z^+}, n \ge 2$ Lemma: $3 \mid (m-1)m(m+1)$ Proof. Suppose $m \in \mathbb{Z}$. By the QRT, we have $m=3q+r$ $\,\ni\, r \in \{0,1,2\}$, and $q=\lfloor{\frac{m}{3}}\rfloor$. We want to show that $(m-1)m(m+1)$ is divisible by 3. Clearly, if any one of the three factors in $(m-1)m(m+1)$ is divisible by 3, then the product must also be divisible by 3. $\cdot$ Case 1 ($r=0$): If $r=0$, then $m=3q$ is divisible by 3. $\cdot$ Case 2 ($r=1$): If $r=1$, then $m-1=(3q+1)-1=3q$ is divisible by 3. $\cdot$ Case 3 ($r=2$): If $r=2$, then $m+1=(3q+2)+1=(3q+3)=3(q+1)$ is divisible by 3. In either case, one of the three factors in $(m-1)m(m+1)$ is divisible by 3. Thus $3 \mid (m-1)m(m+1)$. Therefore, the product of any 3 consecutive integers is divisible by 3. Proof. Base case: Let $n=2$. Then $\exists k \in \mathbb{Z}$ such that $12=3k$, namely, $k=4$. Thus $3 \mid 12$ and hence the claim holds for the base case. Assume for positive integer $m \ge 2$ that $m^4-m^2=3k$ for some $k \in \mathbb{Z}$. We need only to show that this implies that $3 \mid (m+1)^4-(m+1)^2$. $(m+1)^4-(m+1)^2= \sum_{i=0}^{4} {4\choose i} m^i \cdot 1^{4-i}-(m+1)^2=(m^4-m^2)+4m^3+6m^2+2m=(m^4-m^2)+3(m^3+2m^2+m)+(m^3-m)$. By the inductive hypothesis, $3 \mid(m^4-m^2)$. And since $(m^3+2m^2+m) \in \mathbb{Z}$, it follows that $3 \mid 3(m^3+2m^2+m)$. Note that $(m^3-m)=m(m^2-1)=(m-1)m(m+1)$. By the Lemma, $3 \mid (m^3-m)$. Thus we have $3 \mid (m^4-m^2)$, $3 \mid 3(m^3+2m^2+m)$, and $3 \mid (m^3-m)$. To show that their sum is divisible by 3, let $k_1,k_2,k_3 \in \mathbb{Z} \,\ni\, m^4-m^2=3k_1, 3(m^3+2m^2+m)=3k_2$, and $(m^3-m)=3k_3$. Thus $3k_1+3k_2+3k_2=3(k_1+k_2+k_3)=m^4-m^2+3(m^3+2m^2+3m)+(m^3-m)$, where $(k_1+k_2+k_3) \in \mathbb{Z}$. Hence $3 \mid (m+1)^4-(m+1)^2$. Therefore, by induction, $3 \mid n^4-n^2, \forall n \in \mathbb{Z^+}, n \ge 2$

I am proving that  $$5n^3 + 7n^5 \equiv 0 \pmod{12}$$ It would suffice to show  $$n^3 \equiv n^5 \pmod{12}$$ How would I go about doing that?  I suppose I could just go through each $n \equiv r \pmod{12}$ with $r$ from $1$ to $11$ and show that $n^3 \equiv n^5 \pmod{12}$ for each, but that would be tedious.  Surely there's a better way.


Today I was informed by a journal that my paper was accepted.  So am I done with it, i.e. is my input no longer needed? Do I just sit back and wait for it appear?

What steps does a manuscript typically go through from submission to publication (or rejection) in a typical journal? How are these steps referred to, in particular by editorial systems, and how long do they each typically take?  Note that this question is about the typical situation and hence not about:   Journals with an atypical workflow, e.g. those that allow for an instantaneous reviewer–author interaction. Exceptional steps or rare occurrences such as withdrawal or .   This is a canonical question on this topic as per . Due to its nature, it is rather broad and not exemplary for a regular question on this site. Please feel free to improve this question.


Previously asked on .  I am looking for a citable reference (books, research papers, PhD theses, not websites, internal reports, etc.) about the heuristic interpretation of self-conjugate priors as "eigenfunctions for the conditioning operator". This is best explained (though without reference) in the Wikipedia page .  In a nutshell: A statistical model is any family $\{P_\theta\}_\theta$ of probability distributions, parametrized by $\theta\in T$ (e.g., $T\subset \mathbb R$ or $T\subset \mathbb R^k$). Some data $X:=(X_1,\dotsc, X_k)$ is sampled from the model in two stages:   firstly, we let $\Theta\in T$ be a $Q$-distributed random variable; secondly, we draw $X_1,\dotsc, X_k$ in such a way that $X_1,\dotsc, X_k\mid \Theta\sim P_\Theta$ conditionally i.i.d..   The posterior distribution of $Q$ given $X$ is then defined as $Q^X:=Q[\Theta\in \cdot\mid X]$.  A family of distributions $\{Q_\alpha\}_{\alpha\in A}$ (again $A\subset \mathbb R$ or $\mathbb R^k$) is self-conjugate (for a fixed model) if the posterior distribution $Q_\alpha^X$ satisfies $Q_\alpha^X=Q_{\alpha'}$ for some $\alpha'\in A$.  Heuristically, $Q_\alpha$ is (sort of) an "eigenfunction" for the conditioning operator $\mathbf E[\cdot \mid X]$.

On the Wikipedia page for conjugate prior there is a , which describes a metaphor where observation of data is seen as a "linear operator" on the space of probability distributions, with conjugate priors as an eigenvector. Unfortunately, this section has no inline citations.  Does anyone know of any good references on the subject?


Looking at         it says "36% unknown". No user by the name of 'unknown' appears in the  ()  What madness is this? Who is this 'unknown' you speak of?

Some questions and answers are marked Community Wiki and are owned by a community wiki user:  (In fact, this very question is one of them)  Why have Community Wiki posts? How do Community Wiki posts work? How does a post become a Community Wiki post? How can the Community Wiki status be removed from a post? How can I find Community Wiki posts?


REITs have to distribute out most of their earnings to shareholders. This deprives REITs the needed cash to reinvest into their business to grow organically. Wouldn't this stunt REITs' business growth and price appreciation? If REITs need capital, they ask money from shareholders. This is bad for shareholders and hold back the share price.   How do REITs' price appreciate, given that they do not retain earnings to reinvest back into their business like ordinary companies?

You can't grow that much if you invest only 10% of what's left after dividends


What's the difference in the meaning between "you could say" and "you would say"? when something is in specific context and If that (something) is usual, we use would instead of could? I'm not sure but I think "you would say" is used to speculate, imagin something or instead of may/might and "you could say" is used to refer the possibility of happening something or to give suggestion. I'm quite a bit stuck in the meaning of "you would say", could you please interpret its meaning and in which situations or context it's ("you would say") used?  For some example:  1.You would say "I wished I had been back..." in a suitable context. 2.If you never drink a cup of tea in the morning, you would say "I never drink a cup of tea in the morning" 3.If you Speak English well, you would say "I'm a native speaker of English."

could have vs would have  I know could means indicating a possibility or ability, and would means the past of will or something about that is uncertain.  Which of the following is correct?      If you had told me, I would have used the other route.   If you had told me, I could have used the other route.   Both of the above sound correct and similar to me.  Are these also possible?      If you had told me, I would use the other route.   If you tell me, I would use the other route.     Please clear my confusion.


This may not be the right place to ask this. However, I was just hired a couple of months ago at my first programming job as a student developer for my university, and I have had to write a couple of unit tests already. Before I was hired, I had the opportunity to talk to another developer who made the case unit tests were not necessary. He made the case: if you throw data at a method should know what comes out without writing a test, which I think makes sense.  For example (Java):  public int Add(int num1, int num2) {    return(num1 + num2); } //if I call Add(2,2) I know I should get 4,  //if I call Add(5,6) I know I should get 11, //etc...   I tried asking my co-worker about this and his response was more or less along the lines of, everyone else does it so we have to.  So, I guess my question is: Why are unit tests necessary if you can just test your code by calling it repeatedly with dummy data rather than testing it once with a unit test?

I am working to integrate unit testing into the development process on the team I work on and there are some sceptics. What are some good ways to convince the sceptical developers on the team of the value of Unit Testing? In my specific case we would be adding Unit Tests as we add functionality or fixed bugs. Unfortunately our code base does not lend itself to easy testing.


I have Perl script which will run for some time. It created file and write some data into it. I also have another Cron job which happens at 5.00 PM everyday.  My problem comes when my 1st script runs on 5.00 PM. Even when it is running(means that file don't have all details),it picks file from specified path.  How to prevent this?  I couldn't use flock in my script. I need another way to do this.

What is the best way to create a lock on a file in Perl?  Is it best to flock on the file or to create a lock file to place a lock on and check for a lock on the lock file?


I know what the difference between these two are:  var myFunction = function(a) { ... } function myFunction2(a) { ... }   I just can't figure out when I should use the first one and when the second one.  I saw this  but as I said, I know what the difference between these two are.

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent.  The previous developer used two ways of declaring functions and I can't work out if there is a reason behind it or not.  The two ways are:  var functionOne = function() {     // Some code };     function functionTwo() {     // Some code }   What are the reasons for using these two different methods and what are the pros and cons of each? Is there anything that can be done with one method that can't be done with the other?


The exterior derivative was introduced to me with the following axioms:   $df$  is the differential of  f  for smooth functions  f $d(df) = 0$ for any smooth function  f $d(α ∧ β) = dα ∧ β + (−1)^p (α ∧ dβ)$ where $α$ is a p-form   I wondered if it was possible to generalize the concept to arbitrary functionals. The problem is obvious: In the above formulation, we only deal with $p$-forms where $p$ has to be an integer. When dealing with arbitrary functionals, this can not be enough.  To clarify, the above definition of the ext. derivative is only suitable for functionals involving vector spaces with countable dimension. I am searching for a generalization where the vector space that is the domain of the functional might be uncountably dimensional. An example of such a functional is the $L^2$ norm:  $f \mapsto I(f) = \int_\Omega |f(x)|^2 dx$  I'm trying to define a meaningful exterior derivative $d I$.  Is it possible to define an outher derivate much in the same sense of above, that maintains most (all?) of the properties of the standard exterior derivative?

This thought occurred to me earlier and I'm surprised I hadn't considered it previously. I get the feeling that no meaningful generalization can occur in a non-separable Banach space but on the surface it seems like a meaningful generalization can be had if the Banach space is separable. Even if it's possible, convergence and other issues likely severely complicate the matter.


I installed my ubuntu  few days ago and everything was great until this morning when i started the computer instead of the ubuntu boot screen (with ubuntu and the dots ) i now get a black back ground with loads of writing moving down ...i want my normal boot screen back help! its not just a black background it has writings on it ... with green 'ok' starting each line

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


Hi All  My wife has applied for UK tier 2 general visa and travelling to India to submit application. While we were checking documents for her we observed a small line near back cover page near binding (as shown in picture). Could you please let us know if this can cause any issue in application?  Thanks for your help.   The passport is absolutely fine and doesn’t have any other issue and binding is also perfectly fine.... it’s just this one line   This is related to visa application and also the threading hasn’t come out hence a separate question as other questions on this portal are related to threading coming off and people trying to travel with such passport and not applying visa.

My Indian passport threading is coming off i.e. the cover of the passport is coming off, there are only 2 threads remaining.   Will it be a problem at the airport when going abroad ? Also anyone who has experience of getting a replacement passport fairly quick ? Because I need to get a passport in like 15 days.


In python to get an array of X strings (repeated) I can do: >>> 'hi' * 3 # 'hihihi'  Perhaps 'array' isn't the correct term but hopefully the above example clarifies what I mean. Is there a way to do this in javascript without using a loop? Or what would be the most straightforward way to do this? Currently I'm using a c-ish loop: > for (let i=0, x=''; i< 3; i++) {x += 'hi'} // "hihihi"

What is the best or most concise method for returning a string repeated an arbitrary amount of times?  The following is my best shot so far:  function repeat(s, n){     var a = [];     while(a.length < n){         a.push(s);     }     return a.join(''); }


I have been in recruiting since 1987. The high turn-over rate in recruiting is due to training and mis-management.   Do you have howto sections for sales and recruiting? They are one and the same.

I have an idea or subject that should have a Q&A, and want to propose a new site. How can I do this?  Related:


If you drop an effervescent tablet into a glass of water. The tablet first sinks to the base of the glass and effervesces energetically - producing a rising column of bubbles, i.e. a bubble plume - as it dissolves. Later the partially dissolved tablet (of reduced mass compared with the original tablet) rises to the surface of the glass on a cushion of bubbles.  What is(are) the reason(s) for this phenomenon?

This evening I became fascinated with how my Alka Seltzer tablet disintegrates over time within a small portion of Diet Lipton Citrus Ice Tea. I used a nearly frozen cup; tall, as one might request in a middle-class restaurant.  It is interesting to notice that the Alka Seltzer tablet attempts to float to the top of the glass; but it just cant quite make it, e.g., it keeps bobbing up and down and finally it becomes complete residue.  What are the formulas for this, completely? What might the mathematical model look like from start to finish? My first identifications include, but certainly not limited to: measuring the cup, the milligrams deposited into the cup and of course a the makings of a typical tablet of Alka Seltzer excluding room temperature?


I'm an undergraduate student of Mechanical Engineering, now closing my third year of studies. Throughout the years however, I've always went a bit off coursework to study and research the area. By now I have some material that I believe it could be publishable, and I would like to work towards that goal.  Although my entire research is a bit spread, I have something specific in mind that I would like to try and publish and that is a study on optimal beam profiles. My question is, which would be the best journal to submit? I researched some on Elsevier but they seemed too professional to me.  In total, what would be the best journal to try and submit work that is analytical in nature, but related to mechanical engineering?

I have written papers on the topic of network security.  Now I am trying to find a place to publish one of them.  Is there a list of publications by topic, somewhere?  If I come across such a list, how can I determine the reputation of the various publications?


How do I proof the right side of the following inequality: $(x^p+y^p)\leq(x+y)^p\leq2^{p-1}(x^p+y^p)$ for $0\leq x,y$ and $p > 1$ The left side can be easily proved with the binomial theorem and I assume that the right side can be proved with $\sum_{n=0}^{p}\binom{p}{n}=2^p$, but I can't get it working.

I have a small question that I think is very basic but I am unsure how to tackle since my background in computing inequalities is embarrassingly weak -   I would like to show that, for a real number $p \geq 1$ and complex numbers $\alpha, \beta$, I have \begin{equation} |\alpha + \beta|^p \leq 2^{p-1}(|\alpha|^p + |\beta|^p) \end{equation}  I thought it would be best to rewrite this as  \begin{equation} \left|\frac{\alpha + \beta}{2}\right|^p \leq \frac{|\alpha|^p + |\beta|^p}{2} \end{equation}  but then I am unsure what to do next - is this a sensible start anyways ? Any help would be great !  (P.S. this is not a homework question - I am currently trying to brush up my knowledge of $L^p$ spaces, and this inequality came up as a statement. I thought it might be worthwhile to  make sure I can fill in the gaps to improve my skills in computing inequalities.)


FTPClient mFTPClient;  mFTPClient = new FTPClient();  // connecting to the host  mFTPClient.connect(host, port);   After this line of code, the following exception thrown.     Method threw 'java.lang.NullPointerException' exception. Cannot evaluate android.system.StructAddrinfo.toString()

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


I've been using the code given in  to tune the authoryear citation style to my needs. More specifically, I'm trying to have references in the form (First Author, year), with everything within parentheses linking to the bibliography.  Unfortunately, the link created with this method doesn't actually work. Consider the following MWE:  \documentclass{article}  \usepackage{nameref} \usepackage[colorlinks=true]{hyperref} \usepackage[nameinlink]{cleveref}  \usepackage{filecontents}  \begin{filecontents}{bibliography.bib} @article{cubitt2017universal,     author = {Cubitt, T. and Montanaro, A. and Piddock, S.},     journal = {arXiv:1701.05182},     title = {Universal Quantum Hamiltonians},     url = {https://arxiv.org/abs/1701.05182},     year = {2017} } \end{filecontents}  \usepackage[     backend=biber,     style=authoryear,     bibstyle=authoryear,     citestyle=authoryear,     maxcitenames=1,     natbib ]{biblatex} % \renewcommand{\cite}{\mycitep}  % -------------- START AUTHORYEAR FIX \usepackage{twoopt} \usepackage{ifthen}  \newcommand\black[1]{\textcolor[rgb]{0,0,0}{#1}} \makeatletter  \newcommand{\multicite}[1]{% taken from egreg, see link   \@tempswafalse   \@for\next:=#1\do     {\if@tempswa;~\else\@tempswatrue\fi     \hyperlink{cite.\next}{\citeauthor{\next}\black{,~}\citeyear{\next}}%     }% } \makeatother  \newcommandtwoopt{\mycitep}[3][aa][bb]{%             \ifthenelse{\equal{#1}{aa}}                                                                  % if nargin == 1       {(\multicite{#3})}                                                                         %    \citep{key(s)}       {\ifthenelse{\equal{#2}{bb}}                                                               % elseif nargin == 2           {(\hyperlink{cite.#3}{\citeauthor{#3}\black{,~}\citeyear{#3}\black{,~}#1})}            %    \citep[pg]{key}           {\ifthenelse{\equal{#1}{}}                                                             % elseif #1 = []               {(\hyperlink{cite.#3}{\citeauthor{#3}\black{,~}\citeyear{#3}\black{,~}#2})}        %    \citep[][pg]{key}               {\ifthenelse{\equal{#2}{}}                                                         % elseif #2 == []                   {(#1~\multicite{#3})}                                                          %    \citep[eg][]{key(s)}                   %                                                                              % else                   {(#1~\hyperlink{cite.#3}{\citeauthor{#3}\black{,~}\citeyear{#3}\black{,~}#2})} %    \citep[eg][pg]{key}}               }           }       } } % ------------------- END AUTHORYEAR FIX  \addbibresource{bibliography.bib}  \begin{document}  This link works~\citep{cubitt2017universal}, but this doesn't~\mycitep{cubitt2017universal}.  \printbibliography \end{document}   This gives    which would be great if not for the fact that the link produced by \mycitep doesn't work: clicking on it does nothing, whereas the same reference created with \citep correctly sends me to the relevant bit in the bibliography.  How can I fix this? (another way to have the same type of reference style with working links would be equally good for me)

I'm new here so I'm not sure if this is the right way to express my question:  I'm using the excellent biblatex package with the author-year style and want the links in my citations to include the name of the author as well as the parentheses. The answer presented at  did exactly what I wanted but it seems the solution is broken with the newest biblatex version 1.4b. Can anyone help me by adapting the code to the newest biblatex version?


I closed the lid while it was updating. I previously removed the hibernation when the lid closes, but during update it asked me that file will be replaced, and I checked it YES. After that I closed my lid, and now I am left with a black screen with a cursor. Pressing CTRL+ALT+F1 gives a terminal, while CTRL+ALT+F7 gives blank screen with cursor. What should I do? Please help. I have seen other suggestions but nothing is working.    I even tried restarting the lightdm, even after swapoff -a command but it is not working. Also I am getting some error of type   Unable to lock ...  Could not get lock ...   Possible duplicate of  but no solution is mentioned there. I do not want to lose my data. Please help. I fear to shut it down by pressing the power button as I was in the middle of upgradation.

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


Determine the rectangle with the largest area inscribed on it, so long as one side is over the hypotenuse. Does this rectangle match the larger perimeter rectangle under the same conditions? I've done the calculation for the largest area and found the value of the sides of the rectangle, using a derivative, and found the values of 6/5 and 5/2 but I don't know how to answer the final part of the question.

Which rectangle has the largest perimeter inscribed in a right-angled triangle of legs $3$ and $4$, where one of the sides lies on the hypotenuse?  I've done the calculation for the largest area and found the value of the sides of the rectangle, using a derivative, and found the values of 6/5 and 5/2 but I don't know how to answer the final part of the question.


I have the following class structure:   public class TaskLog  {     public DateTime LogDate { get; set; }     public string Robot { get; set; }     public string Task { get; set; }     public Enums.ProbeDataState State { get; set; }      public TaskLog()     {     } }   I created a generic list as follows:  List<TaskLog> Logs;   My output:  Robot   Date                    State --------------------------------------------- aaa     8/5/2013 12:00:00 AM    Task:1=fileDeltaFailed aaa     8/5/2013 12:00:00 AM    Task:2=fileDeltaFailed aaa     8/5/2013 12:00:00 AM    Task:4=fileDeltaFailed bbb     8/5/2013 12:00:00 AM    Task:1=fileDeltaFailed bbb     8/5/2013 12:00:00 AM    Task:2=fileDeltaFailed bbb     8/5/2013 12:00:00 AM    Task:4=fileDeltaFailed   However I would like to group the tasks and state as follows:                                  Tasks Robot   Date                    1                 2                4 aaa     8/5/2013 12:00:00 AM    fileDeltaFailed   fileDeltaFailed  fileDeltaFailed  bbb     8/5/2013 12:00:00 AM    fileDeltaFailed   fileDeltaFailed  fileDeltaFailed   I tried using the groupby with no luck, and quite stuck.  e.g.   var dataQuery = Logs.Where(w => w.LogDate >= start && w.LogDate <= finish).GroupBy(g => g.LogDate).Select(t => new             {                 LogDate = t.Key,                 Details = t.OrderBy(o => o.Robot)             }).ToList();


I'm using a Late 2011 Mac mini with High Sierra on a Thunderbolt Display, connected by a Thunderbolt cable to the Thunderbolt port on the back side of the display.  My wife has a Mid 2015 MacBook Pro, which she wants to use on the Thunderbolt Display when I'm at work. For the connection to the MacBook Pro I´m using the fixed power/Thunderbolt cable from the display.   I'm looking for a way to switch between the two devices when both are connected to the Thunderbolt Display.

I have 2 MacBook Pros and one Thunderbolt Display (27 inch). Both MBPs support Thunderbolt connectivity and work fine with external display. I need a way to switch between 2 MBP, without changing the connection everytime.   Is there any hardware / KVM switch which supports this functionality?   MBP Models are as below:   MacBook Pro (13-inch Mid 2012) MacBook Pro (Retina, 15-inch, Late 2013)


I have a question regarding the interpretation of the relation $\Delta E \Delta t \ge 1$.   First, what is the exact meaning of $\Delta t$? We know that $\Delta E$ is calculated as the standard deviation of the energy distribution, but time is just a continuous parameter and there is no probability density associated with it. Can't measurements in non relativistic QM be done at precise time t?  Some undergrad texts explain this relation as "the longer you measure the energy, the less uncertain it is", but I feel this explanation is lacking. If we measure the energy of a particle, we should disturb it more, making $\Delta E$ larger!  Any input on this?

In non-relativistic QM, the $\Delta E$ in the time-energy uncertainty principle is the limiting standard deviation of the set of energy measurements of $n$ identically prepared systems as $n$ goes to infinity. What does the $\Delta t$ mean, since $t$ is not even an observable?


I am trying to show that this sequence $\{a_n\}$ = (2n+1)/(3n+5) does not converge to $42$ if it is not bounded above. I have already showed that it converges to $2/3$. For this I want to use a proof by contradiction,i.e, I assume that the sequence does converge to $42$, which will lead to a contradiction to the initial assumption that is the sequence will be bounded above. Any ideas or theorems that can help me solve this question?

I need some verification for my proof in part a) and help to get me started on part b)  a) Prove that the sequence $a_n = (2n+1)/(3n+5)$ converges to $2/3$ directly from the definition of convergence of a sequence.  Solution: Some rough work first: Given $\epsilon>0$, we want $|a_n-(2/3)|< \epsilon$. Need $|(2n+1)/(3n+5) - (2/3)|< \epsilon$ which after simplifying gives $7/(9n+15)< \epsilon$. Solving for $n$ gives $n> (7-15\epsilon)/9\epsilon$.  Then we write our formal proof: Given $\epsilon>0$, set $N= (7-15\epsilon)/9\epsilon$. Let $n>N$. Then $|a_n-(2/3)| = 7/(9n+15) < 7/(9((7-15\epsilon)/9\epsilon)+15) =\epsilon$.  Thus by definition the sequence converges to 2/3.  b) Suppose that the sequence $\{a_n\}$ is not bounded above (that is, for any real number $x$, there is some $n$ so that $a_n>x$). Prove that $\{a_n\}$ does not converge to $42$.  To solve this I am assuming that we have to suppose that $\{a_n\}$ does converge to $42$, and then we will get a contradiction, that is the sequence will be bounded above. So can anyone help me get started on this?


I need to prove for all real numbers $a$, $-(-a) = a$ using only the following axioms:     Thanks to many members of the Mathematics Stackexchange Community, I have the following proof worked out:  Theorem: The Additive Inverse Identity is Unique  $ ( \forall a,b,c \in \mathbb{R} )(a+b=0) \land (a+c=0) \\ ( \forall a,b,c \in \mathbb{R} )(a+b=a+c) \\ ( \forall a,b,c \in \mathbb{R} )(b=c) \\ \text{QED} \\ $  Theorem $\textbf{a} \cdot \textbf{0 = 0}$  $ \begin{align} a \cdot 0 &= a \cdot 0 \\ a \cdot (0 + 0) &= a \cdot 0 \\ a \cdot 0 + a \cdot 0 &= a \cdot 0 \\ a \cdot 0 + a \cdot 0 + (-a) \cdot 0 &= a \cdot 0 + (-a) \cdot 0 \\ a \cdot 0 &= 0 \\ &\text{QED} \\ \end{align} $  Theorem: $-\textbf{1} \cdot \textbf{(a) = (}-\textbf{a)}$  $ \begin{align} a \cdot 0 &= 0 \\ a \cdot \left[ 1 + (-1) \right] &= a + (-a) \\ 1 \cdot a + (-1) \cdot a &= a + (-a) \\ -1 \cdot (a) &= (-a) \\ &\text{QED} \\ \end{align} $  Theorem: $-\textbf{(}-\textbf{a) = a}$  $ \begin{align} 0 &= 0 \\ -a \cdot 0 &= 0 \\ -a \cdot \left[ 1 + (-1) \right] &= 0 \\ -a \cdot 1 + -a \cdot (-1) &= 0 \\ -a + \left[ -(-a) \right] &= 0 \\ -(-a) &= a \\ \text{QED} \\ \end{align} $  Does everything look alright? Have I missed anything?  Also--why is it necessary to show that the additive inverse is unique?  Many thanks in advance.

I need to prove for all real numbers $a$, $-(-a) = a$ using only the following properties:     I tried by starting with P12 written using symbolic logic:  $\begin{align} \forall a,b \in P \to & a \cdot b \in P \Leftrightarrow True \\ \forall a \in P \land \forall b \in P \to & a \cdot b \in P \Leftrightarrow True \\ \lnot \left[ \left( \forall a \in P \right) \land \left( \forall b \in P \right) \right] \lor & a \cdot b \in P \Leftrightarrow True \\ \exists a \notin P \lor \exists b \notin P \lor & a \cdot b \in P \Leftrightarrow True \\ \end{align} \\ $  and played with evaluating it with $b = -1$, $-a$ and so on. But, felt this wasn't really a solution because the last symbolic logic statement above is ambiguous.  Not to mention--other than P12--I haven't used any of the axioms listed above whatsoever. ( And I've not bothered to prove any of the theorems of symbolic logic I have used. )  Can anyone give me a start on this problem?  Many thanks in advance.  Edit  Thank you, everyone! .  Best regards!


I realize servers such as Google, Yahoo,  which use RSA has 2048 bits public key. After comparing those keys, I realize that the public keys share a common property, that is first 9 bytes and last 5 bytes are always the same. Since those public keys have 270 bytes altogether, this means there are only 256 useful bytes, which is 2048 bits. Is this 2048 bits of key secure? I google online and found that it takes a very long time to break 2048 bits of key as mentioned . But I am not convincing enough. Can anyone explain to me?

I think 1024 bit RSA keys were considered secure ~5 years ago, but I assume that's not true anymore. Can 2048 or 4096 keys still be relied upon, or have we gained too much computing power in the meanwhile?  Edit: Lets assume an appropriate padding strategy. Also, I'm asking both about security of signatures and security of data encryption.


I want to Run  /home/martyn/Desktop/Scanned Items$ python -m SimpleHTTPServer &    in   /etc/rc.local   When I try & do this I get   sh /etc/rc.local: 13: /etc/rc.local: /home/martyn/Desktop/Scanned: not found

Well I know how to open a folder in the terminal (using cd). But when the name of this folder have space? Ex: Eclipse Indigo. If you use cd Eclipse Indigo does not recognize


My website has a login feature and therefor needs to save the user's information in a cookie so that it they don't have to log in every time they go on the website.  To my understanding, cookies aren't secure unless some extra checks are put in place, so I've come up with a way that I think should make them secure (if not, please tell me how it should be):   create a table in the database that holds cookie information within the table, there are two columns; one that holds the user's username, and another that is some large random number (how would I generate the random number in code?) upon logging in to the website (if the cookie already exists), it checks with the database to see if the username and the random number match if it's the first time the user is logging in (the cookie doesn't exist), it fills the required tables in the database and sets a cookie upon logging in successfully, a new random number is assigned to the database as well as the user's cookie   Does this seem like a viable approach?  Also, if multiple pages require to have the person's username from the cookie, should it verify with the database each time it's required or should it just use $username = $_COOKIE["username"]; without any verification?  Thanks.

I am developing a PHP-based login system. Each user has an ID(a number) and a password, which is stored as a salted hash.  I am able to figure out if a login is sucessful or not, but now I need to store that information somewhere(so that the user is not permanently logged out).  In the past, I've played with $_SESSION variables. However, these seem to be deleted when the user leaves the browser, which is undesired. Also, I can not "assume" that the user won't try to trick the system, so it has to be safe.  So, here are my questions:   Should I use $_SESSION or $_COOKIE? What are the main advantages of each of these approaches? How to implement a 'Remember me' checkbox? Which information should be stored in the session/cookie variable?   Note that no database security issues are being taken in consideration in this particular question.  Regarding number 3, what I mean exactly is:   Should I store the ID and the hashed password of the user in the cookie/session, or Should I store the ID and the non-hashed password of the user in the cookie/session, or Should I store a "SessionID" and the password(hashed or non-hashed?) or Should I store a "SessionID", the "ID" and the password(once again, hashed or non-hashed)?   I want to keep my website as safe but efficient and user-friendly as possible. If a SessionID-based approach is taken, I'd also appreciate some explanation regarding how to store it in the database.  Thank you in advance  EDIT: Eran's and Brian's answers combined seem to be what I need. Unfortunately, I can only mark one of them as accepted. I'll try to go ahead and implement to see which one was more useful.


I'm looking through a product design, and I've seen these SMD / sticky segmented displays LCD being used.    They are not hand-soldered, the segmented display appears to use some conductive sticky pad that attaches the pads on the board that have the common & signals going to the LCD.  Do you know what this is called specifically?  I've used typical thru-hole segmented displays, and I see that you can get like half-hole module type displays.  Anyone know the term of display that you just stick on the board?   (The white part is actually the backlight, and then the LCD display just goes on top and connects to those rectangular vertical pads circled in red).

I found a component attached to a PCB inside one of my old $5 devices. There are pink, rubbery things attached to either side of the LCD that can bend and were firmly attached (glued?), and there are a lot of exposed conductive traces where the pink things were attached on the PCB.  I would like to know what these pink things are. Pictures are shown below.    The front side of the LCD ^    The back side of the LCD ^    The front side of the PCB. This is where the LCD is connected to. ^    The back side of the PCB ^  Again, I would like to know what the pink things are.


Are all definitions or axioms in logic biconditional (iff) statements? It would make sense to me that they would be. A lot of times I will read a definition though and it won't be written as an iff. Just curious as to why they are or aren't.

In some books the word "if" is used in definitions and it is not clear if they actually mean "iff" (i.e "if and only if"). I'd like to know if in mathematical literature in general "if" in definitions means "iff".  For example I am reading "Essential topology" and the following definition is written:     In a topological space $T$, a collection $B$ of open subsets of $T$ is said   to form a basis for the topology on $T$ if every open subset of $T$ can be written as a union of sets in $B$.   Should I assume the converse in such a case? Should I assume that given a basis $B$ for a topological space, every open set can be written as a union of sets in $B$?  This is just an example, I am not asking specifically about this sentence.


the following piece of code has a missing $ inserted error. \begin{equation} \theta^{\star} =   \begin{bmatrix} \boldsymbol{c}^{\star} \\ \boldsymbol{m}^{\star} \end{bmatrix}  ,\quad  \begin{bmatrix} \boldsymbol{\sum}_{cc}           & \boldsymbol{\sum}_{cm} \\  \boldsymbol{\sum}^{T}_{cm}   & \boldsymbol{\sum}_{mm} \end{bmatrix}  :=\boldsymbol{A}^{-1} \end{equation}  unfortunately i still cannot figure out why this occurs, my other equations without a matrix seem to compile normally, i appreciate the help.

Why blank lines between equation makes error? there are a lot of commands in latex and almost for all of them these blank lines are not important,  but why in this case is important and is there any similar function?


I absolutely love the notifications on my device by the way; they are awesome.  It would be great however if they automatically went away when I took action on the notification in the website.  Scenario   A user's question receives a comment Notification appears on Android app User views the comment via the site, notification dismissed on the site Notification is still visible on the device    The principal: If I've dismissed something anywhere it should be dismissed everywhere

I think it would be nice if you read an inbox notification on the desktop version of the site, it should dismiss the native Android notification in the system tray. It seems kind of weird when I come back to my phone an hour later, and find a bunch of notifications I thought a dealt with... and come to find out I really did deal with them.


I wish to access AskUbuntu in the terminal for seeing questions and their related answers.   My use case is this:  AskUbuntu is an excellent source of learning Linux. But I will have to continuously shift between my browser and terminal every time for seeing the site and learning by typing commands in terminal.   So I wish to atleast browse through the questions and the associated answers from the terminal (My requirement is not to post a new question in AskUbuntu from the terminal, so I don't even require to be signed in). In this way, I can see and type in the terminal itself.   Is it possible?

How can I browse the Internet from the command line in Ubuntu?


I want to build my own dev board (mostly to understand some concepts), and I started from some schematics that I found on the internet, but I have some questions about this schematic:   Why do I need those 3 capacitors (C2, C3, C10) on the VCC pin of the atmel? And what is with those values?   If I change the values, will it affect the circuit?   If I remove those capacitors from circuit, will it affect it?

What is a decoupling capacitor (or smoothing capacitor as referred to in the link below)?  How do I know if I need one and if so, what size and where it needs to go?    mentions many chips needing one between VCC and GND; how do I know if a specific chip is one?   Would an  4-bit parallel access shift register used with an Arduino need one? (To use my current project as an example) Why or why not?  I feel like I'm starting to understand the basics of resistors and some places they're used, what values should be used in said places, etc, and I'd like to understand capacitors at the basic level as well.


Given $n+1$ points in the plane, Lagrangian interpolation gives the unique polynomial of degree less or equal to $n$.  From the examples I've seen so far, interpolation polynomials all have degree exactly $n$ but I don't know if there might be a set of points for which the interpolation gives a polynomial of degree strictly less than $n$.  Many thanks for your answers.


Im new to the video editing side of blender and here's the thing: i was stitching image sequences of a rendered animation i created and i want to take a step baCK and change something on the animation but when i try to render a new image sequence again, only blender does is output a blank, empty gray screen, my guess is that this is the video sequence rendering and not the animation, because i moved the image sequence strips away from the frame range, because i want it out of the way when rendering the edited animation but alas, blank   what am i not getting here? how can i get blender to render the animation again? and not the video sequence?

If you create a scene for the Video Sequence Editor and start working on a project Blender will render the output from the VSE. But if you want to later switch it to render your 3D scene again (the camera output) where is the setting to select the source?  Usually I keep a separate .blend for VSE edits so I don't need to switch, but I feel like I ought to learn how to do this as it's pretty basic. I would expect to find this in the Render context but I see no place to specify the source.  Thanks.


After a failing a command on my Ubuntu virtual machine on Azure and adding a deadly space    sudo chmod -R 775 / ps_democqrshooksusage/   I ended up setting (accidentally) every single file in the system with the permissions 775.  After that I could not SSH to my VM anymore (but the Azure Shell kept working), and I noticed I could not use sudo anymore as well.   From what I understand, permissions 775 means that the owner and the group of the owner can do whatever they want and the others can only read and execute the file.   So why did this break some key functionnalities ?

This is a  about File Permission and Why 777 is "destructive".   I'm not asking how to fix this problem, as there are a ton of references of that already on Server Fault (reinstall OS). Why does it do anything destructive at all?  If you've ever ran this command you pretty much immediately destroy your operating system. I'm not clear why removing restrictions has any impact on existing processes. For example, if I don't have read access to something and after a quick mistype in the terminal suddenly I now have access well... why does that cause Linux to break?


Let's say I'm given a number.  I am now asked to determine if this number is of the form : $a^{b}$ mod $N$ . Unfortunately the parameters are such that I cannot perform a discrete logarithm in feasible time. $a$ and $N$ are known (and large) natural numbers with $a<b<N$. $a$ is a prime number. $N$ is composite. Nothing is known about $b$. What are some mathematical tests I can perform to determine this?

If values $a$, $b$, and $c$ are known, is there an efficient way to find $x$ in the equation: $a^{x} \bmod b = c$?  E.g. finding $x$ in $128^{x}\bmod 209 = 39$.


Is there anyway for me to look at the history of the contents of the clipboard?   I had a rather large SVN patch, that has unfortunately been wiped due to a careless copy of a URL, before pasting the contents of the patch. If I could recover those two hours of work, that would be very very nice.  And if not, are there any tools I can install to prevent such heinously stupid errors from occurring again?

I occasionally clobber whatever I had already copied to the clipboard. It would rock to just be able to keep all of my clipboard history right in front of me.


Why Object not true if checking consumer == true?    let consumer = {   "checked": true,   "ID": "680e543457-999fc-11e6",   "fio": "John Doe",   "office": {     "ID": "fgh4d"   },   "phone": "" };  console.log('consumer  == true', consumer == true); // false console.log('consumer  === true', consumer === true); // false console.log('Boolean(consumer)', Boolean(consumer));  // true console.log('!consumer', !consumer); // false if (consumer) console.log('1') // 1

I'm using  to go through JavaScript, and it's returning many suggestions to replace == (two equals signs) with === (three equals signs) when doing things like comparing idSele_UNVEHtype.value.length == 0 inside of an if statement.  Is there a performance benefit to replacing == with ===?   Any performance improvement would be welcomed as many comparison operators exist.  If no type conversion takes place, would there be a performance gain over ==?


How can I obtain a command block without using any minecraft plugins? I want to do this on a vanilla server and I'm not too sure how.

I know how to enable cheats, but when I search command block in my creative inventory, I can't find it. Where do I get it?


Why does $2^p-1|2^b-1$ where $p|b$ and $p$ is prime and $b\in Z$?  I'm working with Mersenne numbers and factorization of numbers to a large power minus 1 and the solution to the problems are to find a prime that divides $b$ then $2^p-1$ will divide $2^b-1$

How to prove $x^a-1\mid x^b-1 \iff a \mid b$, where $x \ge 2$ and $a,b,x \in \Bbb Z$.  I've tried the following in attempting to solve this:  $$a\mid b \Rightarrow aq=b \Rightarrow x^{aq}=x^b \Rightarrow x^ax^q=x^b$$  Because $x^q \in \Bbb Z$, it follows that $x^a\mid x^b$.  This is as far as I have gotten; any help getting further is appreciated.  Note: It may be that this identity is not true at all?


Let $P(n)$ be the statement "all horses in a set of n horses are of the same colour."  Basis Step: Clearly, $P(1)$ is true.  Inductive Hypothesis: Suppose that $P(k)$ is true for some arbitrary integer $k\geq 1$; that is, all horses are of the same colour.  Inductive Step: We now prove that $P(k+1)$ is true.  Consider any $k+1$ horses. Number these horses as $1,2,3,...,k+1$. By the inductive hypothesis, horses $1,2,...,k$ have the same colour. Also, by the inductive hypothesis, horses $2,3,...,k+1$ have the same colour. Because the set of the first $k$ horses and the last $k$ horses overlap, all $k+1$ horses must be of the same colour and we have shown $P(k+1)$ is true.  Therefore, all horses in a set of $n$ horses are of the same colour, for all integers $n\geq1$.

Hello guys I have this problem which has been really bugging me. And it goes as follows:  Using induction, we want to prove that all human beings have the same hair colour. Let       S(n) be the statement that “any group of n human beings has the same hair colour”.  Clearly S(1) is true: in any group of just one, everybody has the same hair colour.  Now assume S(k), that in any group of k everybody has the same hair colour. If we replace any one in the group with someone else, they still make a total of k and hence have the same hair colour. This works for any initial group of people, meaning that any group of k + 1 also has the same hair colour. Therefore S(k + 1) is true.  I cant seem to figure out where the problem lies in this proof. I have tried a few things and I have concluded the base case is correct. But other than that I can't seem to disprove this proof.


Prove using mathematical induction that for all $n! \ge 2^{n-1}$  Base case, p(1), 1! >= 1  $p(n+1), n!(n+1) \ge 2^{n-1}(n+1) $

I'm having difficulty solving an exercise in my course.  The question is:      Prove that $n!\geq 2^n$.   We have to do this by induction. I started like this:   The lowest natural number where the assumption is correct is $4$ as: $4! \geq 2^4 \iff 24 \ge 16$. The assumption is: $n! \ge 2^n$.   Now proof for $(n+1)$ which brings me to: $(n+1)! \ge 2^{(n+1)}$  I think I can rewrite it somehow like this:  $$ {(n+1)} \times {n!}  \stackrel{\text{(definition of factorial)}}{\ge} 2^n \times 2 $$  $$ (n+1) \times 2^n \ge 2^n \times 2 $$  Then I think I can eliminate the $2^n$ and have something like this: $n+1 \ge 2$, or $n \ge 1$.  But I think I'm wrong here some where and was hoping somebody has some advice on this. How can I prove the above assumption?  Any help would be appreciated, kind regards.


How to prove that the set $\{ m+n\alpha : m\in\mathbb{N},n\in\mathbb{Z}\}$, ($\alpha$ is an irrational number) is dense in $\mathbb{R}$?   Using the fact every additive subgroup of $\mathbb{R}$ is either discrete or dense in $\mathbb{R}$, we can prove that the set $\{ m+n\alpha : m,n\in\mathbb{Z}\}$ is dense in $\mathbb{R}$. But how to prove the denseness of the above set?

I am not able to prove that this set is dense in $\mathbb{R}$. Will be pleased if you help in a easiest way. $A=\{a+b\alpha: a,b\in \mathbb{Z}\}$ where $\alpha$ is a fixed irrational number.


Where does Linux store the shutdown messages from last shutdown?

I'm using Lubuntu 11.10. Every time I shut down I can read FAIL in red letters, but I can not read more.   So, how to read the log messages and try to solve the  problem?


I have booked a ticket with my Wizzair Discount Club membership, and I want to buy another ticket for a companion on the same flight. How can I do it?  Thank you in advance for your help.

We booked 2 tickets using discount club to complete the booking. During booking it was said that you have to be a passenger in order to use Wizzair Discount Club. But now something came up and the membership holder cannot travel.  My question is whether the other traveler can still use the flight?  If not, what are our options? Can we amend the booking in any way? Is the money we payed refundable in any way (or can be reused)?


How can you index from mid point of an array to the end point without specify the exact end point. So for example I have an array of {1,2,3,4,5,6} how can I index (find values of) [3] -> [5] (4-6). Its very clear in languages like python but I can't seem to find the answer for C# if there is a short and simple way please let me know thanks! ill give you some more context, I have an array of items and want to get the items from the 2nd value too the end, however the end changes for all the lists, but it always starts from 2nd value.

How do you do it? Given a byte array:  byte[] foo = new byte[4096];   How would I get the first x bytes of the array as a separate array? (Specifically, I need it as an IEnumerable<byte>)  This is for working with Sockets. I figure the easiest way would be array slicing, similar to Perls syntax:  @bar = @foo[0..40];   Which would return the first 41 elements into the @bar array. Is there something in C# that I'm just missing, or is there some other thing I should be doing?  LINQ is an option for me (.NET 3.5), if that helps any.


I was playing Minecraft and I decided to make a train so that when it hits the detector rail I teleport using a command block. I connected the command block to the detector rail and on the command block I typed in a random x y z and when I tried it I spawn in the clouds up high in the sky. When I fall back down to earth the train hits the detector rail again and I teleport back up again. How can I get out of this cycle?

I set a command block to /tp. It was supposed to activate only if you had 0 time left, and to activate the command block with a hopper clock to keep giving it power.   But it is not checking if you have 0 time left, so it keeps teleporting me. I can't get close enough to the command block to break it, so I'm stuck in a neverending teleport loop.  Any ideas?


I'm using the  module fetch posts from my website like so:  #!/usr/bin/perl use XMLRPC::Lite;  my $result = XMLRPC::Lite->proxy('http://example.com/xmlrpc.php)    ->call('wp.getPosts', '', 'admin', 'xxxxx', {post_type => "tribe_events', number => 20});   This returns 20 posts. If I don't include the number property, it returns 10 results by default. Let's say I want to get all the posts. Is there a way to do it without setting some arbitrarily large number for the number property? Are these results paged somehow?

I would like to retrieve all posts of a blog via the XML-RPC API of Wordpress.  There are the methods of blogger.getRecentPosts and metaWeblog.getRecentPosts which - given a sufficiently high value as number of posts (or -1) in theory should return all posts.  However, this does not work for very large blogs or very weak servers that cannot hold the whole blog in memory. In that case, these functions will not return anything at best or throw an error into the response XML.  A solution would be to retrieve smaller chunks of, e.g. 50, posts at a time and put it all together on the receiving side. For this to work one would need to specify an offset for the posts to get. I was not able to find a way to specify such an offset in the documented API.  Is there any way to make this work, either by specifying an offset or by using other than the methods mentioned above?  I'm not looking for a description on how to write a plugin or modify Wordpress itself in any way. I can do that, sure, but I'm talking about authorized retrieval of data of arbitrary Wordpress blogs.  Edit: I've opened a trac ticket at Wordpress with a suggestion for solution:


I tried to update to iOS 8 today, and when I opened iTunes to do so, it also requested to update itself, as I thought it could handle both things (especially because I assumed it would update itself then, the iPad Mini).   Now, the iPad is stuck in a connect to iTunes mode, if I try to open the iTunes while the iPad is connect, the iTunes won't open and if I connect it after the iPad doesn't appear as a device in iTunes.   In the Device Manager it states that I have a unknown Device, and in Devices and Printers it is displayed as Apple Mobile Device USB Driver.  How can I get out of this mode and install the new OS ? I remember that when I had an iPhone 3g it could be done through getting the device into DFU. Is there an analog for it in iOS 7?

I'm not really sure how, but after I woke up today, my phone was just displaying the loading spinner and doesn't start up anymore. It's weird because my phone turned off last night and suspecting that it was probably out of charge, I thought charging it overnight would fix the problem.   So, my iPhone is currently stuck on the iTunes/Apple Logo loop. When I put it into DFU/Recovery Mode and connect it to iTunes, it isn't able to restore it. It keeps throwing "Network Connection Problems" -- it downloads iOS 10 for a bit and suddenly stops downloading, throwing the error. I've also tried downloading a custom .ipsw from  but it seems that the file is corrupted whenever iTunes tries to unpack it.   Any thoughts on how I could go about fixing this?   Note - I don't have a jailbroken iPhone.


I am curious whether it's possible for the group $G$ such that there is a subgroup $H ≤ G$ and an element $g ∈ G$ such that $gHg^{−1}$ $\subsetneq$ $H$ to exist.  It means there exist some duplication under conjugacy operation on $H$, but is it possible?

Let $G$ be a group, $H\subseteq G$ a subgroup and $a\in G$ an element of the group. Is it possible that $aHa^{-1} \subset H$, but $aHa^{-1} \neq H$?   If $H$ has finite index or finite order, this is not possible.


If $A = LU$ and $B = UL$, where $L$ is a unit lower triangular and $U$ is an upper triangular matrices, then $A$ and $B$ have the same eigenvalues.   The eigenvalues of $A$ are obtained by solving the equation: $\det(A - \lambda I) = 0$. We have  $$\det(A - \lambda I) = \det(LU - \lambda I)= \det(L(U - \lambda L^{-1})) = \det(L)\det(U - \lambda L^{-1}).$$ Now, from the previous equation, we have $$\det(L)\det(U - \lambda L^{-1}) = \det(U - \lambda L^{-1})\det(L) = \det(UL - \lambda I) = \det(B - \lambda I), $$ thus, we have $$\det(A - \lambda I) = \det(B - \lambda I).$$ Does this means that they have the same eigenvalues?

a.) Let A and B be $n$ x $n$ matrices. Prove that the matrix products   $AB$  and $BA$ have the same eigenvalues.      b.) Prove that every eigenvalue of a matrix A is also an eigenvalue of   its transpose $A^T$. Also, prove that if v is an eigenvector of A with   eigenvalue $\lambda$ and w is an eigenvector of $A^T$ with a different   eigenvalue $\mu \ne \lambda$, then v and w are orthogonal vectors with   respect to the dot product.   For a, I know that if their eigenvalues are the same then their eigenvectors must relate too.    For the first part of b, is it similar to proving that the $det(A) =det (A^T)$? And, I do not know how to do the second part.


I am using a fresh installation of Ubuntu 17.10 with the default gnome desktop. I tried installing the qtcreator IDE, and wasn't able to find it with the gnome software center (gnome-software), so I installed it with apt.  I tried qt (which does not find anything, probably it expects three letters at minimum or so), qtcreator (which is the package name), qt creator and variations with qt5 as search strings. It sometimes found things, but nothing that has to do with the framework. qtcreator is in the universe/devel section, and universe section is enabled.  I wonder why and where these rules are defined or is this even a bug?  NOTE: This is about gnome-software as in the default installation of Ubuntu 17.10, not the Ubuntu Software Center from previous Ubuntu Unity versions.

I tried to enable additional repositories according to the instructions from , however my Ubuntu Software app is still missing a lot of popular apps. Is there anything I'm missing?  Ubuntu 16.10 Ubuntu Software app 3.20.1


What do you say when someone uses many words, without getting to the point and without saying something really of value with regard to a particular topic? I'd like to emphasize that it's really a lengthy statement with only little content which is actually relevant to what has been asked. It can seem sophisticated, but when you look closely it's either trivial conclusions or doesn't even answer the question.  I've heard the expression "mental masturbation", but maybe there are better ones.  EDIT: It is not merely lengthy or long-winded. It is rather off-topic or not relevant. It can be rather focussed and condensed - just on things which are irrelevant. Often the talker believes he is being very clever by mentioning complicating stuff.

Example 1 - When reviewing résumés I don't want someone to use 1.5 pages to describe one job.   Example 2 - When a person uses excessive description to answer a simple question.


I have requirement to remove the duplicate object from my arraylist of object. I tried it by making to arraylist of objects. First one contains all objects including duplicate and the another contain only the unique one.   ArrayList<ListTableClass> ltc = new ArrayList<ListTableClass>();//has duplicate ArrayList<ListTableClass> ltc2 = new ArrayList<ListTableClass>();//unique   And i used contains method to check for dublicates like this:  for (ListTableClass element : ltc) {           if (!ltc2.contains(element)) {             ltc2.add(element);           }     }   but this does not remove duplicates. It adds all the elements of ltc to ltc2. Don't know why? ltc does contain duplicate objects.

I have an ArrayList<String>, and I want to remove repeated strings from it. How can I do this?


From my knowledge, I know I can use concat() in such manner:  String str = "to"; System.out.println(str.concat("gether")   Which returns together. But isn't that just like saying str + "gether"?  Why make a method for it when you can just use + to join Strings together?  Does it serve any other purpose?

Assuming String a and b:  a += b a = a.concat(b)   Under the hood, are they the same thing?  Here is concat decompiled as reference. I'd like to be able to decompile the + operator as well to see what that does.  public String concat(String s) {      int i = s.length();     if (i == 0) {         return this;     }     else {         char ac[] = new char[count + i];         getChars(0, count, ac, 0);         s.getChars(0, i, ac, count);         return new String(0, count + i, ac);     } }