Should I use “/dev/random” or “/dev/urandom” for large random data needs?

Sometimes I want a lot of highly-random data, for example to overwrite a file or even a whole hard disk. Should I use  or ? What are the advantages or disadvantages of each? Is there a better alternative?


I am stuck on the 4 th one.I have done the rest.I have found out the value of a_n.But not getting how to proceed for the 4 th one.


As far as I'm concerned, you only roll initiative at the beginning of combat and keep those rolls for the rest of the encounter.  If that's the case (if it isn't, why?), what happens when the initiative value of a player changes during the combat? For example, a Druid polymorphing into a creature. Should he/she reroll? Simply add the new modifier to the roll? Or keep the first rolled value regardless of any change in Initiative?


Windows losing IPv6 address after ~10 minutes

When I initially connect to my home network my windows PC is assigned an IPv6 address - however after a few minutes it loses this address! I seem to have similar behaviour on multiple hosts using both wireless and wired connections.  My router is an Asus RT-AC87U.  How could it be losing the IPv6 address? How can I mintor / diagnose this issue?  Update:  Based on @grawity's suggestion below I ran wireshark on this. Sure enough I see a Router Solicitation message and a Router Advertisment message with a Router lifetime of 600 seconds. After 600 seconds my computer drops its Ipv6 address.  What is supposed to happen? Should my host send another Router Solicitation message? Or should the router periodically resend the Router Advertisment message?  Update 2:    says that Router Adverticement messages should be sent periodically.


Update by iterating table in batches faster than whole table in PostgreSQL

I have a table with approximately one million rows.  It is being used in production and I ran an UPDATE which covers ~95% of those rows.  After five hours I cancelled the request because it was taking so long.    The table has an auto-incrementing ID column, so I tried extending the WHERE condition of my query to include id BETWEEN 1 AND 500.  This update completed in approximately two seconds. I then manually iterated up through the id in batches of 500, e.g. BETWEEN 500 AND 1000, then BETWEEN 1000 AND 1500.  At this rate it will require 2000 batches of 500 to update the whole table.  Updating 2000 batches at 2 seconds each is just over an hour.    My questions are:    What reasons are there for this difference? I don't care about transaction isolation, so is there a way to simulate this 'update in batches', without having to script the 2000 updates to run separately.


Why there is a $\frac{1}{2}$ in the distance formula $d=\frac{1}{2}at^2$?

I'm preparing for my exam, but I have difficulties in perceiving why there is a $\frac{1}{2}$ in the distance formula $d=\frac{1}{2}at^2$?


Except the syntax, is there any difference between "call by reference" and "call by pointer" in C++ in terms of memory?

MyObject obj = new MyObject(k); foo(obj); bar(&obj);  foo(MyObject &) bar(MyObject *)   I know we need to use the passed parameter differently in the two functions, but apart from that, in terms of memory allocation or otherwise, is there a difference between the two? I mean for the reference also the compiler would be storing the memory pointer.


I would like to make the dense&soft bread like the bottom one and the taste is plain not sweet. What techniques will make bread closer to the one I want? I also want it to be chewy, not just soft.


Unable to backup after recovery model change

Previously I had the recovery model as SIMPLE. I have altered it to FULL.   While trying to perform BACKUP LOG, I am getting an error saying      BACKUP LOG cannot be performed because there is no current database backup.   How can I get the backup of transaction logs?


How to access private members of a class by another class without using friend class

Suppose we have the following:  class base{ }  class derived1 : public base{   private:   void fun();   friend class derived2; }  class derived2 : public base{   derived1 ob;   void fun2(){   ob->fun(); }   I want to use fun() of derived1 in derived2's fun2() wihtout using friend class and keeping fun() private in derived1.


Conventional directory for application build source

I know this is rather subject to opinion but what are some good choices where on the file system to locate the source code of a build that the server builds (let's say it's a build/integration server)? E.g. there is /usr/src but I think that is rather a conventional location for shell-related stuff (correct me if wrong). How about /usr/local/src?  E.g. right now I check out foo (one of our apps we integrate) source code in /var/lib/foo but I think that may be a misleading reference. Of course it doesn't matter for execution purposes but I am trying to get in line with the convetions.


I would like to know if there is any way to disable Spotlight Search, even when an user goes to Settings -> Spotlight Search, and change the options there.  That's mainly because anyone could still search in Spotlight only by going to Settings -> Spotlight and enabling the search on the web. I do know that you can set it so you can apply filters, but they are not successfull at what I need. (Yes, I know also that Safari can be restricted under "Restrictions", but I am only talking about Spotlight)  I would need something like "Spotlight Search" under "Restrictions", so I can turn it off completely, so any user can't enable the Internet search again.  That's like a little bug for anyone who want to be fully protected for mature/adult content. (I want to have my own filter, not what Apple says that is good)  PS. Currently I am with iOS 10.X in an iPhone SE. There's a video from youtube  that explains how to disable Settings app. That would be great, but that workaround only work in older versions of iOS.


Existence of the moment generating function and variance

Can a distribution with finite mean and infinite variance have a moment generating function? What about a distribution with finite mean and finite variance but infinite higher moments?


How to demonstrate a property that can hold for linear maps between an infinite vector spaces via sequences

Hi I am trying to find a simple ( if possible) way to show that for some infinite dimensional vector space V there can exist linear transformations $f:V \to V$ such that they are injective but not surjective, and surjective but not injective.  My thought was possible something could be done using  $(a_{1},a_{2},a_{3},.......)  \to (b_{1},b_{2},b{3}......)$  entries in $\mathbb{N}$  in both directions, but I am not sure the best way to set it up. Any ideas?  Thanks


I have a script that needs to know the processor architecture. I'm doing this way:  if [["$(uname -m)" = "x86_64"]]; then wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm else echo "Nossa! Você só pode usar 3,5GB de memória RAM. Que triste :( Vou baixar a versão 32bits pra você tá?" wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.rpm fi   But when I execute the code, I receive:  instala_chrome.sh: line 35: [[x86_64: command not found   Anyone can help me to solve this? Thanks!


How to study physics as a first year student?

I firstly apologise if this question is off the topic.  I am a first year undergraduate student and  the required textbook for the course Advanced Physics is Fundemental of physics by Halliday. This textbook is huge and to be honest I was scared when I saw the size of the textbook. There are too much text to read and there are many exercises at the end of each chapter and I do not think that I would have time to do every single problem at the end of each chapter.  So with this information, what is the effective way of studying physics? what to read and what not to read? what exercises should I do? should I try to do all exercises? any other advice that I should do to be successful in physics is also appreciated.  If you need also some information about my background: I am a first year combined bachelor of electrical engineering and bachelor of mathematics and I have good knowledge of math but did not do any physics in highschool.


How to setup server side of OpenSSH on Windows 10 for autologin?

I am trying to follow this tutorial on auto-login into SSH:  The objective is to make a script so my linux computer can shutdown my windows computer with a single script file, automatically. The issue I'm having is that all the tutorials on internet are oriented of course to a linux-linux environment and the commands asked for configuring the server-side of the configuration, don't work for windows 10. The idea is to use it in the LAN so I don't really mind "security" concerns. So How can I achieve auto-login on windows 10 ssh from a linux terminal? Thanks.


Regression with cyclic/modular variables

I'm trying to create a simple regression model from time to outside temperature. Obviously there will be some relationship since it is colder at night than during the days (mostly anyways), only how can I make this model?  The time of the day is in hours and runs from 0 to 23, but obviously 23:00 is very near to 0:00 but not when looking at the difference in numbers. How can I change the time notation to reflect actual time difference? So 22 hours and 19 hours have a difference of 22-19=3 hours, and 23 hours and 0 hours have a difference of 1, but when calculating the difference you get 23-0=23 which isn't correct. This will have a big influence on the regression model. We use modular arithmetic in daily life, but can you use it in a regression model? What do you suggest?  N.B. if you think a regression model won't work but an other statistical model will, that's also fine. I'm just looking for a model that measures the goodness of fit (like $R^2$) for time and temperature.


Attempted relative import in non-package for optional package

I tried to run :   import numpy as np from dipy.reconst.multi_voxel import multi_voxel_fit from dipy.reconst.base import ReconstModel, ReconstFit from scipy.special import hermite, gamma from scipy.misc import factorial, factorial2 import dipy.reconst.dti as dti from warnings import warn from dipy.core.gradients import gradient_table from ..utils.optpkg import optional_package  cvxopt, have_cvxopt, _ = optional_package("cvxopt")   But it gives ValueERROR:ValueError: Attempted relative import in non-package Thank You !


I'm looking for a way to remove text editor from page because i'm using Beaver Builder plugin (for building my pages).  like you see in the picture bellow, i have 2 tabs. I want to remove text editor tab (in the red color).  Thanks in advance.


Create library from single / multiple existing files within git repo?

I have a private git repo for a project.   In there, a few file exist which I'd like to make available as a separate library, as they're not application specific and can be reused.   Is there a way to fork a git repo so that it contains just these few files, retaining the version history but ignoring all other files?   The other files need to be kept private, so I can't simply fork the whole repo and remove them for future commits.


Can I get a Russian transit visa on arrival?

I need to apply for a transit visa to go outside the Russian airport (48 hours of layover). Due to shortage of time I cannot apply the transit visa in India. Does Russian government allow passenger to take transit visa from the airport itself ?  Passenger should have take visa if they even have to stay in Transit area for more than 24 hours. How do they apply?


Confusion on arr[-1] and what reverse does

Task: Given n numbers, I store them in a list and find the second highest. I found a solution by acisikta19 on Github:     n = int(input())     arr = list(map(int, input().split()))     arr.sort()     max1=arr[-1]     arr.sort(reverse=True)     for x in arr:         if x!=max1:             result = x             print(result)             break  I wanted to ask what max1=arr[-1] does? Particularly the -1? Second, does arr.sort(reverse=True) simply sort the negative numbers? (The array of numbers is in [-100,100].


Short story about a robot who outlives his humans

Trying to remember the title of a short story about a robot who survives several generations of a family, and at one point stows away on a spaceship. It was an older story — I want to say pre-1970 — part of an anthology. There was some reason why he stowed away. Maybe he was trying to get home? His longevity figured into the plot somehow. He might have been facing obsolescence.


Potty Training 2.5 year old - Regression?

I spent three days this weekend (took a day off work) potty training my 2.5 year old daughter. She has been showing signs of being ready for a while - telling me when she wets her diaper, talking about the potty etc.   I used a more relaxed version of the Nathan Azrin method, basically practicing with a doll first, and then giving her an m&m for "dry checks" (she checks to see if she's dry), and 2 m&ms and a "prize" from a prize box everytime she went in the potty. I didn't train for naptime or bedtime, and used a pullup for sleeping for now.   The first two days went really well, and she only had one accident the second day. She even pooped in the potty the first day. The second day, she seemed to be doing well with the pee, but was holding her poo in, and eventually ended up pooping in the bath in the evening of the second day :(  The third day, she was just unhappy and seemed to be regressing, not wanting to sit on the potty and holding her pee in. She didn't have any accidents the third day, but was holding her pee (she seems to have great bladder control!) and would go to pee only if i insisted she try sitting on the potty. She didn't poop at all the third day, and was way constipated by the evening. We gave her prune juice, which helped her poo in her diaper while in her bed the morning of the fourth day (which is today).   I'm trying not to be negative, or frustrated, but she just seems to be scared of the potty now, and I'm not sure what I did wrong, or what I can be doing to fix this problem. Help!


How to check if this limit exists: $$\lim_{(x,y)\rightarrow (0,0)}{ \frac{x^4y^4}{(x^2 + y^4)^3}}$$  Can I convert it to polar form ? $$\frac{r^8 (\cos^4 (\theta)\sin^4(\theta)}{r^6 (\cos^6 (\theta) + r^6 \sin^{12} (\theta))} = \frac{r^2}{\cos^6(\theta) + 0} = 0$$


I have a Python program that uses the "threading" module. Once every second, my program starts a new thread that fetches some data from the web, and stores this data to my hard drive. I would like to use sqlite3 to store these results, but I can't get it to work. The issue seems to be about the following line:  conn = sqlite3.connect("mydatabase.db")    If I put this line of code inside each thread, I get an OperationalError telling me that the database file is locked. I guess this means that another thread has mydatabase.db open through a sqlite3 connection and has locked it. If I put this line of code in the main program and pass the connection object (conn) to each thread, I get a ProgrammingError, saying that SQLite objects created in a thread can only be used in that same thread.   Previously I was storing all my results in CSV files, and did not have any of these file-locking issues. Hopefully this will be possible with sqlite. Any ideas?


Does $ \sum\left( (n^3+1)^{\frac{1}{3}} -n \right) $ converge or diverge?

The test I know are Cauchy's root test, Cauchy's integral, Raabe's test, logarithmic test and D' Alembert's Ratio Test. I dont know which test I can use to prove that this series converges? $$\sum \left( (n^3+1)^{\frac{1}{3}} -n \right) $$


Analog to Digital convertor using capacitor

I found out that I can use a capacitor in order to get the data from an analog sensor in a digital manner(Connecting the analog sensor to the GPIO of a Raspberry Pi).  I have a 1μF polarised capacitor. Is it suitable? How should I connect it in order to work?   The sensor I'm talking about is the below push sensor.  Is it ok to connect GND to GND, VCC to 3.3V Power and the capacitor with the positive branch to OUT and with negative to the GPIO pin?  Here is the datasheet of the sensor:   Thank you!


StackOverflow Careers: Better detailed remote locations

I have been looking through the SO Careers site of late and because I am located in Australia there isn't as many opportunities as there would be for people in the US; especially in the city I live in.  Because of this I attempted to look for positions that allow remote work, but trouble is practically none of the positions that state they allow remote work indicate how remote they will consider.  Is it..   Remote is ok, but you must live in the same city Remote is ok, but you must live in the same country Remote is ok, but you must live in a similar timezone Remote is ok, anywhere in any timezone   Without any more details on what the employer will accept, searching for positions that will allow remote work is practically useless for people living outside of the US.


If an element has a unique right inverse, is it invertible?

Suppose $u$ is an element of a ring with a right inverse. I'm trying to understand why the following are equivalent.   $u$ has at least two right inverses $u$ is a left zero divisor $u$ is not a unit   If $v$ and $w$ are distinct right inverse of $u$, then $u(v-w)=0$, but $v-w\neq 0$, so $u$ is a left zero divisor. It's also clear that if $u$ is a left zero divisor, it cannot be a unit (else I could cancel $u$ from $ub=0$ to see $b=0$).  I'm having a heck of a time seeing why $u$ is not a unit implies $u$ has at least two right inverses. I tried the contrapositive, but saw no good approach. What am I missing?


Word whose form is contrary to its meaning?

Is there a word for a word whose form is contrary to its meaning?  For example, "quotidian" is anything but quotidian.


I have a Dell Studio XPS 1647 and headphones do not work (though , internal speakers work like a charm) , I have dual boot Windows 7 and headphones work perfectly fine ...     I also tried -adding in options snd-hda-intel model=eapd probe_mask=1 position_fix=1.  I've experienced this with Oneric Ocelot and the latest Precise Pangolin (LTS).


How can I program a batch script to re-write a specified string?

I'm making a batch script that will automatically compile some projects for me and I want to know how (if possible) to program said script to first locate a specified file (i.e. .txt, .ini, .cpp, .py,  ect), then find a specific line of text and finally re-write said line to something that I specify. An example would be as follows:  find file >  locate line #x >  re-write as %TEXT%  save(?) >   I added a question to save because I don't know if such a function needs to be made or if the script can simply re-write the line upon execution.  Another thing I would like to experiment with is instead of seeking a specific line, would bt to seek a specific string to be re-written. This example would go (theoretically) as such:  find file >  locate string "Sample text" >  re-write as "New sample text" >   The goal of this would mainly be to compensate for scripts where a certain string will not always be on the same line or that will vary in location.  Currently I can write a simple text document with this script:  (   echo %SampleText% ) > %DOCUMENT%.txt   Any help would be greatly appreciated, I've done a lot with batch scripts but never anything like this.


Screen brightness control not working on Lenovo T530

My brightness control doesn't work with a fresh install of 12.10 (brand new laptop). It is set to the brightest setting when I boot up and when I try to change it, I see the notification bar come up but the brightness doesn't actually change. I've tried all the solutions I could find around the Internet but none of them work. Things I have tried include:     Editing /sys/class/backlight/acpi_video0/brightness      In /usr/share/X11/xorg.conf.d/10-brightness-control.conf: Option   "RegistryDwords" "EnableBrightnessControl=1"      In /etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash   acpi_osi=Linux acpi_backlight=vendor"   There is no xorg.conf file in 12.10 that I have found, so the solutions that suggest editing that file don't do me a whole lot of good.  I am currently using the Nouveau driver, but switching to the Nvidia proprietary drivers made no difference.  Any other ideas? When is this bug going to be fixed? With all the reports I've come across I would think it would get a lot of attention. Thanks.


Unable to dual boot ubuntu 16.04 with windows 10

I selected the option of running Ubuntu 16.04 alongside Windows 10. But the problem I am facing right now is that I am unable to use Windows. When I start my PC there is no option of using Windows 10.


AES CBC Encryption Key & Special ASCII characters

Can we add characters like α π Σ µ σ ♂   ╩ Φ ¥ ∩ ∞ ε in the AES 256bit CBC Encryption Key? Does it make the key more unique? In my VB.NET application I am using a key like this: "∩TY&Hjubf78▐Φ4≥╬V% ÷⌡Uαπ^f7cHJßF" Does it make any difference in Encrypting the data?


Terminal Server - Group Policy prevent command line

I have a Windows 2008 Terminal Server. Terminal Server Configuration(licence server, session broker, etc) is managed by group policy. If i want to disable logon via:  change logon /disable  The Error Message: "Connections are currently ENABLED by Group Policy for this machine, unable to change."  Is there a smart way to fix this?  btw. is there some way to look into the session broker database?


When I execute  sudo apt-get update   I get the following error:  E: Type 'ain' is not known on line 3 in source list /etc/apt/sources.list.d/diesch-testing-precise.list   E: The list of sources could not be read.   How can I fix this?


How can I have one object create another object and insert a reference to itself in that second object?

I have an abstract class Skill, from which the actual skill classes inherit shared fields and methods. Then, the Character class creates new instances of each of these, like:  public class Character {     String name;     String className;     String raceName;     Acrobatics acrobatics = new Acrobatics();     Diplomacy diplomacy = new Diplomacy();     //etc. }   So if you're not familiar with the d20 system, when you use a Skill, it checks against a difficulty class. Right now, the Skill classes themselves have a method to discover the DC (discoverDC()) for whatever check is being made.   The problem is that the Skill object has to check with the Character object that created it in order to discover all the relevant modifiers.  So to get it to work that way, I think I'd need to somehow attach a reference to the Character object that created the Skill object, but I have no idea how that would work. I've tried passing the Character object as a parameter to the Skill objects when they're created, but the compiler just gets irritated.  I'm pretty sure one solution would be to create another object that has these functions (like a GM) and have it look for relevant modifiers. However, I'd really like to know if there is any way to get this to work the way I originally put it together.


How to Close modal window and refresh parent window in salesforce?

My Requirement is when we click on edit button open child visualforce page as modal window when we save that record close that modal window and refrsh parent page.


Are moving objects producing stronger gravity fields?

If the strength of gravitational influence exerted by a body is derived from its mass and energy then is it true that a moving object which has some kinetic energy should also produce stronger gravitational pull than a static/slower one?  If that's correct then would it be also possible for an object moving fast enough to produce gravity so strong that it would collapse into a (fast moving) black hole?


How to fit weights into Q-values with linear function approximation

In reinforcement learning, linear function approximation is often used when large state spaces are present. (When look up tables become unfeasible.)   The form of the $Q-$value with linear function approximation is given by   $$Q(s,a) = w_1 f_1(s,a) + w_2 f_2(s,a) + \cdots, $$  where $w_i$ are the weights, and $f_i$ are the features.   The features are predefined by the user. My question is, how are the weights assigned?   I have read/downloaded some lecture slides on $Q-$learning with function approximation. Most of them have slides on linear regression that follow. Since they are just slides, they tend to be incomplete. I wonder what the connection/relation is between the two topics.


I am trying to make a header of an exam page but with logo. Below is my code.  \usepackage{graphicx}  \begin{document}  \firstpageheadrule \begin{figure}[] \includegraphics[width=20mm]{logo.png} \label{overflow} \end{figure} \chead{Department of Mathematics}  \begin{questions} Question one \end{questions}  \end{document}   I am trying to make something like   But my code does not give a desired output. I have little clue why my code is not working. I am wondering how can I fix the code.  Helps are really appreciated. Many thanks!


Environment variable seems not set while it is in a shell script

I have a shell script file ./bin/postactivate with following content:  #!/bin/sh  export STATIC_ROOT="/webapps/tsango/static/" export MEDIA_ROOT="/webapps/tsango/media/" export DATABASE_NAME="tsango" export DJANGO_SETTINGS_MODULE="tsango.settings.vagrant" export DATABASE_PASSWORD="password" export BROKER_URL="amqp://tsango:password@localhost/tsango" export DATABASE_USER="tsango"   I execute it with sudo sh ./bin/postactivate command. The command seems to run properly, i.e. no output from the command line.  However, when I use printenv to see the list of environment variables, none of the variables of the script is set.  I'm probably missing something... Can you tell me what?


Undefined reference to class constructor derived from template

I have a template class called Interpolator.  Interpolator.hpp  namespace interpolation {     template< class Abscissa >     class Interpolator; }  template< class Abscissa > class interpolation::Interpolator {  public:      Interpolator();      virtual     ~Interpolator();  };   Interpolator.cpp  template< class Abscissa > interpolation::Interpolator< Abscissa >::Interpolator() { }  template< class Abscissa > interpolation::Interpolator< Abscissa >::~Interpolator() { }   Then, I have a class for an specific interpolation shape. The shape is a quadrilateral and is handled by the class Abscissa_Quad. The interpolation of this shape is handled by the Interpolator_Quad class.  Interpolator_Quad.hpp  namespace interpolation {     class Abscissa_Quad;     class Interpolator_Quad; }  class interpolation::Interpolator_Quad      : public interpolation::Interpolator< interpolation::Abscissa_Quad > {  public:      Interpolator_Quad();      ~Interpolator_Quad();  };   In the .cpp file I have:  Interpolator_Quad.cpp  interpolation::Interpolator_Quad::Interpolator_Quad()     : Interpolator() { }  interpolation::Interpolator_Quad::~Interpolator_Quad() { }   Finally, I use the class in my main.cpp file as follows:  main.cpp  #include "interpolation/Interpolator_Quad.hpp" #include "interpolation/Interpolator.hpp" #include "integration/Abscissa_Quad.hpp"  int main(         int    argc,         char * argv[] ) {     interpolation::Interpolator_Quad interpolator;      // Do some stuff with the interpolator. }   But now I keep getting this error:  undefined reference to `interpolation::Interpolator<interpolation::Abscissa_Quad>::Interpolator()'   I have tried different approaches, mainly from these questions:    I tried using in main.cpp:  interpolation::Interpolator_Quad< interpolation::Abscissa_Quad > interpolator; But of course that did not work because Interpolator_Quad is not a template. From this question:  I know that the implementation of the template must be in the header file. What I don't understand is why the compiler does not find the reference to the template constructor since Interpolator_Quad defines the template class as Abscissa_Quad in the header file.   I understand that similar questions have been asked before regarding undefined references to template constructor; however, the examples I found either didn't work or perhaps I did not understand them fully.  I'm sorry I went a bit crazy with the namespaces in my question. I just want to make sure my error is not in the improper use of them.  I'm using gcc 4.8.2 with a Ubuntu machine.  Any feedback is appreciated. Thanks!


Classification and convex optimization of the cost function

From the literature I read that     For a neural network, the cost function, J(W,b) is a non-convex function, gradient descent is susceptible to local optima; however, in practice gradient descent usually works fairly well.   But on the other hand, support vector machine which is another popular classifier involves optimizing convex functions.  How is that solving SVM is a convex optimization problem and for feed forward neural network it is non-convex optimization?  Edit:    This link provides some information regarding the intuition behind the optimization in neural networks. But it is not clear there. Also my question was in the reason behind the difference in the optimization approaches in ANNs and SVMs. Both involves a cost function involves a sum of squared errors and a regularization term. Why is one convex optimization problem (SVM) and the other optimizing non-convex functions.


Would you hear a gravitational wave, if its amplitude and frequency were suitable?

If there was a source of a continuous gravitational wave at (say) 50hz, and amplitude of say a micrometer (a typical sound wave displacement, I think), and you were nearby (standing happily on a planet in an atmosphere), with your ear pointing to the source, would you hear it?  It seems to me that since the gravitational wave is reducing and increasing the distance between points in the atmosphere right at your eardrum, surely the density and pressure of the air there is likewise increasing and decreasing, so you might expect to hear it.   What I can't "intuit" is whether you would actually hear it due to the fact that you yourself are also being distorted.  My tentative conclusion is that you would hear it.   At any given time, there appears to be a pressure differential across your eardrum due to this distortion in space pressurising the materials - so ... deflection?  (note: I know that in the recent LIGO announcement they talked about "hearing" the waves, but this is something completely different: an electro-acoustic rendition of the waveform.  I'm asking about direct physical sensing.)


Will moving some ecommerce products from one domain to another with redirects cause SEO penalties?

I'm the developer for a small online webstore. We've just moved a subsection of products (the bodyboarding products), off surfhq.co.uk on to bodyboardhq.co.uk to sell them there instead.  We didn't want to sell on both stores as search engines don't like duplicate pages - and domain2.co.uk has much better seo for bodyboarding - the site has been run as an active blog for sometime - we've only just added the cart.  My question is, should I be using a 301 redirect on the old product pages (sending users to the new pages on domain2.co.uk), or should I just serve up a 404 not found? Google search currently lists a lot of broken links (I've gone down the 404 route for fear that permanent redirects will result in one of our sites being penalised).  EDIT  My question is not answered  where the 301 is to the home page and the products have been deleted. My products have been moved to another domain (the 301 would be to the product on the new domain). Also I'm concerned with the SEO effect on both domains.


This is an identity that I couldn't prove.     $$\binom{n-1}{r-1}=\sum^{r-1}_{k=0}(-1)^k\binom rk\binom{n+r-k-1}{r-k-1}.$$   I believe that the identity is provable through combinatorics, but I can't prove it.


How can I stop pagination URLs from getting indexed?

I want to prevent pagination URLs from being crawled or indexed anywhere.  When I check site:example.com, the search results looks like this.   /blog/page/69/ /blog/page/55/   I have not listed this type of URLs in sitemap.xml  How do I stop this from happening?


How does the system select which tag to show in the search engines?

One of the sources of visitors to Stack Exchange sites is search engines like Google. When we are shown the results of a question from Stack Exchange sites on Google, we are shown along with a tag. For example, look at below image.     In the above picture, the character tag is shown along with character tag. That is the most popular tag tagged with the question.   Now, there is another example from Google as shown below.     The above question is from Hinduism Stack Exchange where it is shown along with the tag worship. Now, that is not the most popular tag in the question. I have noticed this with other questions too.  The question is how does the system select the tags which are shown with the question in the search engines?  I noticed that these tags accompany in the tabs in the browser too.     So, how does the system select the tags which are to be shown along with the question on search engines like Google?


Finding an example of field extensions satisfying certain properties

This is problem 3.18 from Patrick Morandi's Field and Galois Theory.     Give an example of fields $k \subseteq K \subseteq L$ and $l \subseteq L$ for which $l/k$ and $L/K$ are algebraic, $k$ is algebraically closed in $K$, and $lK = L$, but $l$ is not algebraically closed in $L$.   This question has been asked twice, namely  and , though neither had any answers, and only some inconclusive comments. Normally I wouldn't ask the question again, but after struggling with it for weeks at this point, I emailed Morandi, and he gave me some hints.  He told me that he remembers finding an example, but that he isn't sure. He told me that it would need to be over characteristic $p$ and that the extensions (at least some of them I suppose) could not be separable. Moreover, he told me that $K = k(x)(a)$, where $a$ is a root of an irreducible polynomial $f(x,y) \in k(x,y)$ (I'm not 100% what the root of a two variable polynomial is). Finally, he said that $l$ is an algebraic extension of $k$, where $f$ becomes reducible over $l$. Still however, I can't come up with anything. I was hoping that with these extra hints, someone would be able to figure it out.  He did point out that there is a chance that there is an error in the question, but I haven't managed to prove that such an example cannot exist.


How do you solve a recurrence with a summation function inside: $t(n) = 1 + \sum\limits_{j=0}^{n-1} t(j)$

Show that  $$t(n) = 1 + \sum_{ j=0}^{n-1} t(j)$$  is the same as  $$t(n) = 2^n$$  Initial condition $t(0) = 1$


I was wondering if there was any meaningful interpertation of the product of two $n\times n$ adjacency matrices of two distinct graphs.


How to make a new list every 3rd element?

Let's say I want to make a list of lists:  List_of_lists = [ [1, 2, 3] , [4, 5, 6], [7, 8, 9], .... ]   How do I make a loop that immediately creates a new list (ex: [4,5,6])  AFTER the previous list is filled with 3 elements?  Right now, all I can do is:  [ [1, 2, 3, 4, 5, 6.... ] ], essentially a giant list within a list, instead of this giant list being split into lists with 3 elements each.


When I upload an image to Stack Overflow, I cannot see my JPEG file in my post. It's all blank. I've tried it with different files, but gotten the same result.


I'm not a particle physicist, but I did manage to get through the Feynman lectures without getting too lost. Is there a way to explain how the Higgs field works, in a way that people like me might have a hope of understanding?


These are my current disk partitions. /yedek is for some personal backup files. As you can see there is only Ubuntu on my PC. I will install Windows, too. Because of this I want to shrink /dev/sda3 . It currently 546GB and I want to split it: 300GB for / and 246GB for Windows (NTFS) is OK for me.  I'm using GParted for the first time. How can I shrink /?  I don't want to lose any datas from Ubuntu.


Can I use a USB hub to simultaneously charge a tablet and connect a USB drive?

What I do have (default way of charging tablets: A) vs. what I want to have (B or C):  Can I have it? It’s a simple thing, so why not? How else can I use a tablet together with a portable hard disk (or with any USB device in fact) when I run out of battery power? Update Marking my question as a duplicate of  is wrong (as @AliChen explains on my behalf in a comment below). In fact, I already use a USB hub connected to a universal USB charger to split electric power and charge multiple devices. And that hub is not even powered – it’s passive. So I know the answer to the other question very well – even without reading it. This is different from using a single USB socket to charge a tablet and connect that tablet to a pendrive at the same time (presumably by the means of some kind of USB hub).


L'Hospital's rule for $\lim_{n\rightarrow \infty} (a^n + b^n)^\frac{1}{n}$.

I have recently come across a problem concerning the limit of a sequence given as, $$\lim_{n\rightarrow \infty} (a^n + b^n)^\frac{1}{n}$$  Where $0<a<b$. Solving the limit is not a concern. But applying L'Hospital's rule to this limit is one to me.   On rearranging we get, $b \lim_{n\rightarrow \infty} ((\frac{a}{b}) ^n + 1)^\frac{1}{n}$. The solver had then applied the L'Hospital's rule to evaluate the limit. Here, as $n\rightarrow \infty$, the limit approaches the form $1^0$. I have tried to think about this limit approaching an indeterminate form. It does not. From my knowledge of Cauchy's Mean Value theorem, I say that we cannot apply the rule to determinate forms. But it seems to me that we can because it worked for the solver. I think I am not clear on this. Can somebody help?


How can I stop my iPad from ringing when my iPhone rings?

Similar to , but my iPad is ringing, not my Mac.


Browsers redirect to level3.com if domain does not exist

If I enter a URL incorrectly, my Firefox browser occasionally redirects me to    This occurs in Chrome too. I've restarted Firefox in safe mode, and it still happens I've restarted Windows 10 in safe mode, and it still happens I've installed Hitman Pro Alert. The scan found nothing, and could not prevent the redirect. My HOSTS file is clean. My ethernet settings IPv4 properties use Google's DNS: 8.8.8.8 and 8.8.4.4 The only other issue I have is when visiting  which produces numerous pop-up windows, unless I disable scripts. I have Comodo Internet Security (antivirus and firewall) installed, and it identifies nothing.   Any other suggestions?


Ubuntu - Some one is able to write on ubuntu/apache server

Someone is trying to hack my website, I have a website built on PHP (7)/MySQL in Laravel framework. The owner of the /var/www is www-data and folder permission is set 700 for all folders and file permissions are set to 600. Still, the hacker is able to modify the content of index.php and also he was able to delete few PHP  files. The server is Ubuntu 17.04 and the web server is Apache.    I need immediate guidance on how he is able to write files in a folder which has a permission 700. I would really appreciate your help and guidance. Please let me know if you need more details to understand the problem.


How do we know that the laws of physics are invariant in all inertial frames?

Einstein's Special Relativity theory is based on the assumption that the laws of physics are invariant in all inertial frames, and from there - according to Maxwell's equations - it derives that the speed of light must be the same in all reference frames, thus the need for time dilation etc...  But how is the initial assumption justified? I have always been explained this assumption in an "intuitive" way, as a thought experiment, for example regarding the fact that sitting on a sofa feels no different than sitting in a plane. But I could have made the same thought experiment about the hypothesis that velocities always add together, so one could make light "faster" by shining a beam from the tip of a rocket...


How can i list all user registered on my website and have pagination

How can i list all user registered on my website.  If i have 300 users, i want to list only 10 on a page and list next 10 on other page..   I want the user to have an image I want to list post added by the user I want to list the number of  trailer's added by the user (custom post type - trailere)( if i click on the number it shoud get me on user page) I want to list the number of  subtitrari's added by the user (custom post type - subtitrari )( if i click on the number it shoud get me on user page)   This is wath i have try, it list ok but how can

             Poza	             Name	             Inregistrat	             Nume	             User Level	             User Role	             Vezi Profil

                                 <?php            $wp_user_search = $wpdb->get_results("SELECT ID, display_name FROM $wpdb->users ORDER BY ID");           foreach ( $wp_user_search as $userid ) {             $user_id = (int) $userid->ID;             $user_info = get_userdata($user_id);                                                 $user_picture =  get_avatar($userid->ID, 40);             $formid = $user_info->formid;             $user = new WP_User( $user_id );             echo '' . $user_picture .  '	';             echo '' . $user_info->display_name . '	';             echo '' . $user_info->user_registered . '	';             echo '' . $user_info->nickname . '	';             echo '' . $user_info->user_level . '	';             echo ''; if ( !empty( $user->roles ) && is_array( $user->roles ) ) { foreach ( $user->roles as $role ) echo $role; } echo '	';             echo '' . $userid->ID . '	';                                                 echo '
';           }                                          ?>

             Poza	             Name	             Inregistrat	             Nume	             User Level	             User Role	             Vezi Profil


Find all positive integers n with the property that for each positive divisor d of n, we have that d + 1 is a divisor of n + 1.

How would I approach or solve a problem such as this? I know that $n = d*a$ and $n+1 = (d+1)*b$ for some integer $a$, $b$. So I substituted them into each and got $$d(a-b)=b-1$$ But how would I go from here?


I'm new to X and Y and I'm a bit confused about how EV works. Let's say I have two Gyarados, one at level 20 and the other at level 70. If I EV train them the same way so that they have the same EV spreads and suppose they have the same nature and IVs, will they have the same stats at level 100? Now suppose that the one at level 70 was previously EV trained and I just changed his spread to match the one at level 20. Would this change the answer?


String conversion to char array including punctuation

I have a String text "Welcome!to java@";  I know how to convert it to receive array [Welcome, to, java]      String[] aaa = text.split("[\\p{IsPunctuation}\\p{IsWhite_Space}]");     System.out.println(Arrays.toString(aaa));   //priinting   But I need to include punctuation. I need to receive [Welcome, !, to, java, @]  Anybody know who to receive it ?  The reason why I need to do it, because i have a randomise(char[] cw) method, which is tweaking words for me. However that method is going crazy when punctuation is included  public void randomise(char[] cw)      {         for (int i = 1; i < cw.length-1; i++)          {             //my range             int range= (int)(Math.random() * (cw.length - i - 1));              //swap index             int index=i+range;              //swap             char temp  =  cw[i];             cw[i] = cw[index];              cw[index] = temp;          }         System.out.println(cw);      }   Thanks for reply


Calculating circle radius from two points and arc length

For a simulation I want to convert between different kind of set point profiles with one being set points based on steering angles and one being based on circle radius.  I have 2 way points the steering angle the distance driven and now I need to approximate or calculate a circle radius where the arc length equals the distance between the waypoints.  Is this kind of problem solvable or is there no solution but incremental calculations.  Please see the Image i attached as link. I marked the things that I have blue, the things that I need red. Dotted are the things I don't really need.    Edit:


On a plane, there are two congruent circles, $O_1, O_2$. One line intersects $O _1$ and A and B and $O_2$ at C and D such that AB=BC=CD=14. Another line intersects $O _1$ and E and F and $O_2$ at G and H such that EF=FG=GH=6. What is the radius of the circle.   The configuration was hard to draw. . You can reflect the lines over the centers, but it is still the same. Cleary, $\widehat{AB}=\widehat{CD}$ and $\widehat{EF}=\widehat{GH}$. I have no idea how to proceed.


Getting a static resource obj model for webGL

I'm trying to get an obj model parsed for webGL content. I'm using Java Spring with thymeleaf and have my resource as an obj file in my resources/static/ folder. I need to get the contents of the obj file as a string to parse it in the javascript on the html web page and feed it into my WebGL, but I'm not sure on how to access it.  Do I need to do an ajax html call to return the data as a JSON? Or is there a way of just accessing that resource from the URL similar to embedding an image on a webpage.  I'm quite new to this web development business, so it might sound dumb but I am stuck here.  Thank you.


I have made a clean install of Ubuntu 14.04 LTS Desktop and now want's to convert it into a kiosk with a full screen webbrowser.  This was previously done in 10.04 and worked perfect, but due to hardware changes (graphics) we are forced to use version 14.04.  I have created a kiosk.desktop in /usr/share/xsessions and a shell script called kiosk.sh that launches firefox with r-kiosk installed. The shell script is executable. A user called "kiosk" is set to autologin (in /etc/lightdm/lightdm.conf).  But now i'm stuck. I'm want the kiosk.sh to be run when the kiosk user session is started.   In previous versions this could be done in the GUI tool "Login Screen Settings" or in /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf.  I have changed 50-ubuntu.conf to "user-session=kiosk" but it doesn't start. The "Login Screen Settings" tool can't be found. Has it been replaced by another utility in 14.04?  Placing a kiosk.sh.desktop in ~/kiosk/.config/autostart works, but the gnome-desktop is shown before firefox starts in fullscreen mode making it possible for the users to interact with the desktop.  What is to correct/best way to start firefox in fullscreen after user autologin?  Thanks  Thomas


Can't install .deb files on VirtualBox VM running Xubuntu

I've been trying to get a VirtualBox VM set up with Xubuntu on my Windows 10 Home laptop for web development (working through The Odin Project if any of you are familiar with it). However, I can't seem to install any applications from downloaded .deb files. For reference, I've been trying to get Google Chrome and VSCode. I've tried using the software installer and all the methods listed here:  (tl;dr sudo apt install gdebi-core then sudo gdebi _.deb, sudo dpkg -i _.deb, sudo apt install _.deb) None of those seemed to work. After getting some help, I tried the following: sudo apt install _.deb  sudo apt-get install -f then sudo apt install _.deb  sudo apt update and sudo apt upgrade then the same commands from before   Sorry if the images are difficult to read. I don't have the original terminal output anymore, so those are the screenshots of error messages I sent while getting help. At this point, I'm at a loss for what I should do. It took me ~15 tries of uninstalling and reinstalling Virtual Box and Xubuntu to get the VM up and running, so maybe this installation isn't functional either? I'd greatly appreciate any suggestions.


Only HTTPS websites working otherwise I receive ERR_CONNECTION_REFUSED

I am facing annoying problem of only HTTPS websites working on my Mac (in all browsers). I can only visit Google, YouTube, Facebook, Yahoo etc.  So far, I tried following:   Websites shows error of: ERR_CONNECTION_REFUSED I have uninstalled Anti-virus Turned off firewall Changed DNS, to 8.8.8.8, 8.8.4.4 (Google), 208.67.222.222, 208.67.220.220 (Open DNS), 0.0.0.0 My network is ipv4 supported (but not ipv6) so most websites should work. I tried ping websites that are not opening on browser e.g: dailymotion.com , but I transmitted and received packets without loss. Reinstalled Yosemite but problem still persists. Everything works when I use VPN (e.g hotspot shield), so my guess is DNS is messed up. I tried flushing DNS using sudo killall -HUP mDNSResponder    P.S Everything works in Safe Mode and using mobile hotspot  Here is , and . So the issue is with only http websites.  When I use sudo pfctl -s nat, I am getting following response: “No ALTQ support in kernel ALTQ related functions disabled rdr pass inet proto tcp from 192.168.1.100 (my IP) to any port = 80 -> 127.0.0.1 port 9882”. By removing port forwarding using sudo pfctl -F all, the websites works for few seconds only  Any suggestions please ?


How do I install Compiz extra animations?

I have tried the sudo apt-get install compiz-fusion-plugins-extra in the terminal window but it said that it can't find it, so if anyone of you know a way to get the extra animations I would be thankful for an answer!  I am using Ubuntu 12.10.


I get a different domain name in google search

So here is the story guys please bear with me:  I have registered my domain and deployed my web app and everything is fully functional and working 100%. Then out of the blue I get these SEO scams telling me to pay for SEO. Of course I knew it's a load of bull and I simply deleted all emails. I then wanted to check my web site's ranking so I googled my site's domain and I got my website's pages but with a different domain name! and when I click on them they actually get me to my site while the URL maintains that same weird shady not-domain of mine. I won't be mentioning the domain of my web app or even the one imitating mine since it's a social network still in the works.  I go to godaddy where I registered my domain and then changed my domain to private, and after a few days I checked again and it was gone(the shady domain) and I was like "Thank God, finally". And just now I check again and it's back! what do I do?  The only thing the private domain helped in is giving you a certificate warning when trying to access the shady domain either through google search or directly from URL.  I honestly need help guys, nobody has addressed this problem and I looked all over. Thank you all


Does losing reputation lead to losing privileges?

Imagine that a user reaches 10K reputation and gains the moderation privilege. Now he can edit posts immediately. The day after he gets a vote down for one of his answers/questions. Will he lose his moderation privilege? Or is it given to him anyway?  My concern is because I think for either way it has some problems. In example above there isn't any problem if the given privilege is not taken back, but what if the loss of reputation is due to a spam user's removal (that was created by the user to generate fake reputation)?


How are old post edits from question banned reviewed?

I just got question banned from Stack Overflow this afternoon, sadly. I read through the FAQ on that, and it suggests editing old posts to improve them.  My first question is: How exactly is that credited? I mean, it seems unlikely that someone who downvoted a question a long time ago would for-no-reason-at-all revisit it months later, notice the edit, and remove/change the downvote. So are moderators tasked with reviewing old question edits just for this, or is there some other process?  It looks like the number to the left of the question was the number of upvotes; on StackOverflow (but not here) the number of downvotes only displays when you click it. That's why it didn't match my actual reputation change.  Yes, this link () is what I meant by the FAQ. But it didn't explain how edits to old posts are credited; so I wanted to ask here.


How can I create a second bibliography for unreferenced items?

I'm writing a literature study in LaTeX. There are some studies I excluded from the search results. I would like to create a second bibliography with items I excluded. Right now, I've got this:  \bibliography{./bib/references.bib}   I would like to have a section/chapter before called "Unreferenced articles", with a few articles I did not refer to. Worth mentioning is that these articles are listed in ./bib/references.bib but if I refer to them, they will pop up in the normal bibliography as well, which is not what I want.  I know about \nocite, but that's not useful in this scenario. However, if something like this existed, that would be great:  \nocite[unreferenced]{66, 142, 143}   to have articles 66, 142 and 143 pop up only in the Unrefernced Articles section and not show up in Bibliography.


Other people i'v googled with this MySQL error have had restricted words, but I cant see any in mine.  I'm having trouble storing an css div in a variable and inserting it into a table as a field.  I'm very confused because the 2
's work perfect, but then it breaks when I try a div.  userrepost.php      /* Connect and Query database "accounts", then close connection */     $connection=mysql_connect("localhost","root","");     if (!$connection)     {         die('Cannot connect to MySQL. Error: ' . mysql_error());     }      $check_database = mysql_select_db("accounts", $connection);     if (!$check_database)     {         die('Cannot connect to database. Error: ' . mysql_error());     }      /* Escape all POST variables */     $query=mysql_query("SELECT * FROM posts WHERE id='$_GET[postid]'");     $result = mysql_fetch_row($query);     $escaped_repostinfo=$_POST['repostinfo'];     $final_repostinfo=$escaped_repostinfo."

".$result[0]." ".$result[1]."
";     echo $final_repostinfo;     $date = new DateTime('Canada/Saskatchewan');     $date->setTimezone(new DateTimeZone('Canada/Saskatchewan'));     $date_string=$date->format('d/m/Y H:i:s');      /* Query database to save user's post */     /* If field "repostid==0", then the post is not a repost; if the field "repostid>0", then the post is a repost with the field "repostid" linking to the id of the post to be reposted */      $result = mysql_query("INSERT INTO posts (user, content, repostid, date) VALUES ('$_SESSION[username]', '$final_repostinfo', '$_GET[postid]', '$date_string')");     if (!$result)     {         die('Cannot query. Error: ' . mysql_error());     }      /* Close Connection */     mysql_close($connection);   'rptext' is a css div( #rptext{stuff;} )  This is the error:  Cannot query. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rptext'>shawn619 dfsd', '51', '09/11/2013 15:27:11')' at line 1


Underline formatting option should be implemented in all the SE sites

Bold and italics simply aren't enough. This is especially true in the case of websites on the sciences and languages, where a lot of explanation needs to be provided. The formatting package should come with all the three options: bold and italics and underline.   Underline should be included in the formatting package of all SE sites.  My reasons for it:   When you've bolded and italicised as  much as you possibly could and still have other things to highlight, you run out of options. Overusing bold ad italics doesn't look very good. Italicising isn't a sensible alternative to underlining, since it isn't that noticeable. To set apart the most significant piece of text within a writing that's bolded and italicised all over, you need a distinct formatting.  For instance, consider this . Compare this     with this    Anyone who remotely understands style and how formatting works will agree the underline looks better and serves a very useful purpose. The major argument against the use of underline is that they can be easily confused with links. Yes, possible — but people using the computer for quite some days should easily be able to distinguish. (Even if they can't, the misunderstanding doesn't have any serious consequences. Everybody eventually gets that.) If the difference between a hyperlink and a simple underline were so foggy, HTML and MS Word wouldn't have supported underline. And besides,  in SE don't have underlines so it's highly unlikely that an average user would fail to differentiate between them.


Probability of two people meeting when the arrival intervals and wait times are different

Bill arrives between 5:00 and 5:30 and waits 10 minutes. Will arrives between 5:10 and 5:40 and waits 5 minutes. What is the probability that they meet each other?


What are the visa rules for US speakers, at UK conferences, who may be getting paid?

In the last few days, a friend-of-a-friend who was due to give a talk at a tech conference in the UK was denied entry at Heathrow and sent back. Their full story . It seems that, in the last few days, the  has been changed. (Compare the  with )  Understandably, with a comparatively well known tech speaker being turned back at the border before a talk, there's been a lot of "WTF"'s and "surely that's not right" on social media from those in and around the UK / US / EU tech scene.  Rather than rely on bits of www.gov.uk which appear to change quite often at the moment (possibly related to many of the people attending the conference in question having the personal phone numbers of people working on the gov.uk site!), I was wondering what the rules and guidance actually said?  If you hold a passport from one of the countries that normally entitles you to request "leave to enter" on arrival in the UK, and you're coming over to give a talk at a conference, what are the rules on if you need to get a visa in advance? And does it vary depending on if the conference organisers are paying for your flights/hotels or not? Or if they're giving you a small fee or not? Or if the conference organisers are a UK or EU registered company?


What to do if residuals are not normally distributed?

I was wondering what to do with the following non-normal distribution of residuals of my multiple regression.        Normality test of standardized residual                      Shapiro-Wilk                    Statistic: ,955 df: 131 Sig: ,000   According to the Shapiro-wilk test the normality test fails. However, after excluding the outlier located at the left bottom of the graph, I get these test results:  Normality test of standardized residual                      Shapiro-Wilk                    Statistic: ,980 df: 130 Sig: ,055   What are my options when the residuals don't have a normal distribution? Is it for example alright to remove outliers in order to achieve a normal distribution?


Identifying the funtion of "There" in a sentence

What part of speech or function does the word There have in the following statement?  There is no quick way to become wealthy.  I would like to diagram this sentence but am having trouble.


How to generate a random integer using math.random class

I am having trouble with the RandInt() method as it will not return a random integer. The result must be an int ranged 0-9 and must use the math.random class. This is my code below:  public class RandNumGenerator {     public static int RandInt() {         int n = (int) Math.random() * 10;         return n;     }     public static void main(String[] args) {         RandInt();     } }


I want to add 30 days to current date and get in a format.  Im confused to add a 30 to a date and get new.  Its pure JS Solution needed.  Format : June 10, 2017


COUNT(id): query cost: 463    COUNT(*): query cost: 91.47    Can someone help me to understand why COUNT(id) is more expensive than COUNT(*)?


How connect two computer to one an external hard disk drive?

I have two computers running windows 10. I wanted to connect both of them at the same time to an  external hard disk drive. Are there any hard disk drives that can accept two USB ports?


find -exec not working in bash script but working in terminal

I am trying to write some bash script to replace a command I quite often use. Here is the code from my file test.sh  #!/bin/bash echo -e "\n"  i=0 args[i++]=$0 for arg in $@ ; do   args[i++]=$arg done  where="." what="-type f" gcase= str=  while getopts "d:f:F:ih" opt ; do   case $opt in     h)       echo -e "This is the help of this search function."       echo -e "\t $0 [-d <dir>] [-f|-F <pattern>] [-i] string"       echo -e "This will output the result of"       echo -e "\t find dir -[i]name pattern -exec grep --color -Hn[i] string {} \;"       echo -e "Default is"       echo -e "\t find . -type f -exec grep --color -Hn string {} \;\n"       exit 0       ;;     d)       OPTIND=$(($OPTIND-1))       where=       tmp=${args[$OPTIND]}       while [[ $OPTIND -lt $# ]] && [[ "${tmp:0:1}" != "-" ]] ; do         where="$where"" $tmp"         OPTIND=$(($OPTIND+1))         tmp=${args[$OPTIND]}       done       ;;     F)       what="-iname "       what="$what""\"$OPTARG\""       ;;     f)       what="-name "       what="$what""\"$OPTARG\""       ;;     i)       gcase="-i"       ;;     \?)       echo "Invalide option, use option -h for help." >&2       exit 0       ;;   esac done  str=${args[$OPTIND]}  command="find $where $what -exec grep --color -Hn $gcase \"$str\" {} \;" echo "$command" $command   Now, from my terminal, I do ./test.sh -d auto-avoid -F "TEST*" "main" and I get  find  auto-avoid -iname "TEST*" -exec grep --color -Hn  "main" {} \; find: missing argument to `-exec'   (auto-avoid is a directory with a small c++ program I wrote for fun.)  Then, in my terminal I copy-paste the command find  auto-avoid -iname "TEST*" -exec grep --color -Hn  "main" {} \; and I get  auto-avoid/test.cpp:26:int main(int argc, char **argv)   which is the expected result.  The question is: what did I miss?  For now I wrote it as an independent script to test it, but the goal is to have it as a function in my .bash_aliases.  I have found some similar topic but nothing that could help me. If you find that this is a duplicated question, I will gladly take the solution. I am pretty sure some people will tel me to use grep -r, but I would at least want to understand why my script does not work. This is a minimal "not"-working example, I will exclude some directory from my find later.


Do we know for sure that laws of physics are time invariant?

Is there a proof that Maxwell's equations will hold true even billions of years in the future, for example?


Solve the equation $28^x = 19^y+87^z$, where $x,y,z$ are integers.   This is related to Beal's conjecture (and it turns out there are no integer solutions to the equation), but I am wondering how to first prove there are no integer solutions when $x,y,z$ are positive integers. For positive integers we can use the following argument:  Taking the equation modulo $19$ gives $28^x-(19^y+87^z) \equiv 9^x-11^z \equiv 0 \pmod{19}$. Thus, since the complete set of residues of $9^x$ modulo $19$ is $\{9,5,7,6,16,11,4,17,1\}$ and the complete set of residues of $11^z$ modulo $19$ is $\{11,7,1\}$. Therefore, $x = 3+9k_1$ and $y = 2+3k_2$, or $x = 6+9k_1$ and $y = 1+3k_2$, or $x = 9+9k_1$ and $y = 3+3k_2$ where $k_1, k_2 \in \mathbb{N}_0$.  How can we complete this argument and also extend it to all integers?


Proving that the triangle inequality holds for a metric on $\mathbb{C}$

Show that $(X,d)$ is a metric space where $X =\Bbb C $ and the distance function is defined as:   $$d(x,y) = \frac {2|x-y|}{\sqrt {1+|x|^2} +  \sqrt {1 + |y|^2}}, \text{ for } x,y \in \Bbb C.$$   I have done the proof of the first two propositions for being a metric, but I'm having a problem in proving the triangle inequality.


I just made an edit and saved it without giving it an edit summary. The default summary was      added 24 characters in body   I made another edit to the same post within 5 minutes, this time changing the automatic edit summary, however, when I viewed the edit, the original automatic summary remained.  I suggest that we be allowed to edit the summary while we're within 5 minutes of posting the edit.  It has been suggested that users can make two edits to change the summary: the first by making a superfluous change, the second by undoing the change and changing the summary at the same time. This is counterintuitive and surprising behaviour. A user only has 5 minutes to change an edit before it becomes a new edit, and in that period they should be able to do anything they could have done on the first edit.  This feature was first suggested in early 2011 and was very popular, yet was never done. If the reason it hasn't been implemented is to avoid trivial edits, then the workaround (which didn't work for me) simply doubles the number of trivial edits needed to get the job done.


I want to add a check constraint on a column if entered value for column is greater than 3 than it should be saved as 1 else entered value. For that scenario I am using below query but on insertion of data it shows an error message.  create table tblTestCheckConstraint  ( id int, NewColumn int )   alter table tblTestCheckConstraint add constraint chk_tblTestCheckConstraint_NewColumn1 CHECK   (     CASE         WHEN NewColumn >4 THEN 1         ELSE NewColumn     END = 1 )   Insert Statement:   insert into tblTestCheckConstraint values ( 1,5) insert into tblTestCheckConstraint values ( 1,2)   Error Message:   Msg 547, Level 16, State 0, Line 1 The INSERT statement conflicted with the CHECK constraint "chk_tblTestCheckConstraint_NewColumn1". The conflict occurred in database "DBName" , table "dbo.tblTestCheckConstraint", column 'NewColumn'. The statement has been terminated.


During the Time War why didn't the Daleks blow up at least one TARDIS while in the Time Vortex?

From the Cracks in time and space story arc it's known that if a TARDIS is blown up (possibly while in the Time Vortex) it rips creation itself apart. Also, from the Stolen Earth / Journey's End we learn the Daleks' masterplan which is subjugating creation itself via destroying it with the Reality Bomb (unfading Z-neutrino energy radiation).  In the Last Great Time War all sorts of temporal weapons were used and it's known that Daleks have the ability of time travel as well. Why didn't they use the Time Vortex back then to win the war once and for all via detonating a TARDIS while inside?


How to create Concentric Circles in QGIS?

I'm trying to build a planning tool for .  It involves selecting a field (polygon), a center point, and then an outer circle to set the outer limits of the system.  From there you select the inner rings based on fixed length sections. to optimize the coverage area.  Anyone have an idea where I can start?


I have created two custom objects (A and B)and a junction object(AB). i.e. Both A and B have Many to Many relationship. Now I need to insert 5000 records. How can I automatically populate the relation in Junction object. DO I have to write any trigger or Do I have to do Manually mapping the records?


Is a finite monoid with left cancellation property always a group?

I need to answer and show if a Monoid with left cancellation property always a group.  I managed to show that it is correct when cancellation property holds for both left and right (that was part a of the question), but I have a feeling i proved it wrong because i didn't use the right side at all. what I did is :   M is finite though if $x \in M$ there is some $i \in N$ such that  $x = x^i$   then  $x*e = x*x^{i-1}$  so  $x^{i-1} = e$  then $x^{i-2}$ is the inverse of x  so i proved that G is a Group without using the right cancelation property.   where am I wrong..   any help will be appreciated


Using VirtualPathProvider to load ASP.NET MVC views from DLLs

Based on this question  and using code found  I'm trying to load views that are embedded resources in a separate DLL project, and the original question's author says he has had success doing this - but I can't get it to work as it seems the MVC view engine is intercepting the request and still looking at the file system for the view. Exception:  Server Error in '/' Application. The view 'Index' or its master could not be found. The following locations were searched: ~/Views/admin/Index.aspx ~/Views/admin/Index.ascx ~/Views/Shared/Index.aspx ~/Views/Shared/Index.ascx ~/App/Views/admin/Index.aspx ~/App/Views/admin/Index.ascx ~/App/Views/Shared/Index.aspx ~/App/Views/Shared/Index.ascx    I am using a CustomViewEngine, like Rob Connery's /App structure one as follows:  public class CustomViewEngine : WebFormViewEngine     {          public CustomViewEngine()          {              MasterLocationFormats = new[] {                  "~/App/Views/{1}/{0}.master",                  "~/App/Views/Shared/{0}.master"                  };               ViewLocationFormats = new[] {                  "~/App/Views/{1}/{0}.aspx",                  "~/App/Views/{1}/{0}.ascx",                  "~/App/Views/Shared/{0}.aspx",                  "~/App/Views/Shared/{0}.ascx"                  };               PartialViewLocationFormats = ViewLocationFormats;          }     }   Here are my routes:      routes.IgnoreRoute("{resource}.axd/{*pathInfo}");      routes.MapRoute("Home", "", new {controller = "Page", action = "Index", id = "Default"});     routes.MapRoute("Default", "Page/{id}", new { controller = "Page", action = "Index", id = "" });     routes.MapRoute("Plugins", "plugin/{controller}/{action}", new { controller = "", action = "Index", id = "" });     routes.MapRoute("Error", "{*url}", new { controller = "Error", action = "ResourceNotFound404" });   In my  I'm checking to see if the path starts ~/plugin/ and then using the dll filename convention plugin.{controller}.dll  Any suggestions?  UPDATE: By the time the routed request for say http://localhost/plugin/admin is getting to the VirtualFileProvider it doesn't have any View attached at the end. So in the VirtualFileProvider's Open method the virtual path of ~/plugin/admin is being passed in when it should be ~/plugin/admin/Index.aspx as defined in my route above. Have I messed up my routes or am I right to be expecting this to happen?


How do I install steam on a 64bit system?

Alright so my computer is 64-bit and I only want to use Linux to install Steam, play Team Fortress 2 and get that penguin item but It's not working out for me. The version of Ubuntu I installed was the "Wubi.exe" which let's me use it along with Windows. But when I get it up and download the Steam .deb file, it tells me "Wrong Architecture 'i386'". What do I have to do to run Ubuntu alongside windows without using a CD/USB stick?


Let $R$ be a commutative ring. Prove that $R[x]/(x)$ is isomorphic to $R$.  Should I use the first isomorphism theorem for rings?  Can someone give me a hint on how to approach this problem? Also how would I use the first isomorphism theorem to prove this? I know that the theorem says $R /\ker f$ is isomorphic to image of $f$.


Getting size of different-domain iframe content

This issue isn't very rare and there are many solution proposals around, but all I've found require some sort of access to the code of the iframe content. So this is the situation: I have a webpage which contains an iframe. The iframe contains another webpage, from a different domain, which content changes with interaction. Now, sometimes the allocated static iframe height is too much, and I get a lot of while space under the content. Sometimes it is too little, and some of the content of the iframe gets cropped out. And, sadly, I do not have access to the source code of the iframe content, so solutions like PostMessage are not an option. I am trying to figure out if JSONP is an option, but I'd like to ask if anyone had to deal with a similar issue before, and how they solved it. Any help is greatly appreciated


In the movie Logan, they hint at the fact that the X-Men are no more because something happened. While initially Professor-X asks Logan "What did you do?" later he's seen repenting doing something that may have caused the death of the X-Men.   What is it that happened to the X-Men according to the film Logan?  PS: I know how the story goes in the original comic - Old Man Logan. While there they explain what happens exactly, I'm interested in knowing what happened to the X-Men in the film world of Logan.


Can one force-feed an opponent a potion in combat?

Is there a check by which a combatant can force-feed an unwilling target a potion?   The question stems from several magic items, including the Potion of Diminution and Potion of Poison. I am seeking to develop an expanded list of potions for the Unearthed Arcana Artificer class and the ability to affect an enemy with potions such as these would be grounds for a much higher spell slot to Infuse than if it was restricted to willing targets (or misled, in the case of Poison).   This question is specifically in reference to conscious opponents, enemies who can resist the attempt.


Curious spacing while using variables with \newcommand

\documentclass[10pt]{article} \usepackage[default]{opensans} \usepackage[T1]{fontenc} \usepackage{xifthen}   \newcommand{\cvAnrede}{Herr} \newcommand{\cvTitel}{Dr.} \newcommand{\cvVorname}{Max} \newcommand{\cvNachname}{Mustermann}  \newcommand{\cvSetTitel}[1] {   \ifthenelse{\equal{#1}{}}{}{\cvTitel} }  \newcommand{\setName}[1] {   \ifthenelse{\equal{#1}{nachname}}{\cvAnrede{} \cvSetTitel{\cvTitel} \cvNachname }{\cvVorname } }  \newcommand{\setCompleteName}[1] {   \ifthenelse{\equal{#1}{nachname}}{\cvSetTitel{\cvTitel} \cvVorname \cvNachname }{\cvVorname} }  \newcommand{\cvName}{\setName{\cvSetName}} \newcommand{\cvFullName}{\setCompleteName{\cvSetName}}  \begin{document}  \ifdefined\cvSetName \else    \def\cvSetName{nachname} \fi   \cvName \\ Herr Dr. Mustermann   \end{document}  Output:  What is my mistake? I don't understand why 1. there are spacing and 2. there are different spacing.


NullPointerException when storing html date value to mysql database using servelt java

I have this html form which is a date input type  <form method="POST" action="FillTanks" onsubmit="return(showAlert());">

                                                                                <input style="color: gray;" type="date" id="datedd" class="form-control">

                                                                     <button type="submit" id="btn-fill" class="btn btn-blue btn-lg">Fill</button>

             </form>   And this is my servlet  public class FillTanks extends HttpServlet {  @Override protected void doPost(HttpServletRequest request, HttpServletResponse response)         throws ServletException, IOException {     String fuelType = request.getParameter("fueltype");     String liters = request.getParameter("liters");     String date = request.getParameter("datedd");      try {         Class.forName("com.mysql.jdbc.Driver");         Connection con = DriverManager.getConnection("jdbc:mysql://localhost/Vehicle", "root", "");         PreparedStatement ps = con.prepareStatement("INSERT INTO fuel(fueltype,liters,date) VALUES(?,?,?)");          Date date2 = new SimpleDateFormat("MM/dd/yyyy").parse(date);          ps.setString(1, fuelType);         ps.setString(2, liters);         ps.setDate(3, (java.sql.Date) date2);          int i = ps.executeUpdate();          if (i > 0) {             System.out.println("Success");         } else {             System.out.println("not success");         }      } catch (ClassNotFoundException ex) {         Logger.getLogger(FillTanks.class.getName()).log(Level.SEVERE, null, ex);     } catch (SQLException ex) {         Logger.getLogger(FillTanks.class.getName()).log(Level.SEVERE, null, ex);     } catch (ParseException ex) {         Logger.getLogger(FillTanks.class.getName()).log(Level.SEVERE, null, ex);     } }   But everytime I execute the project, it gives me this error.  > Warning:   StandardWrapperValve[FillTanks]: Servlet.service() for servlet FillTanks threw exception java.lang.NullPointerException     at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1439)     at java.text.DateFormat.parse(DateFormat.java:364)     at FillTanks.doPost(FillTanks.java:37)   I have used date datatype when creating the database table related to this servlet.  Can anyone please help me what is wrong with my implementations?


My issue is similar to    but I have not enough reputation to comment there.  Megacorp paid my tuition. They made the payment directly to the school and not me. The amount was not included on my W2 and I did not deduct educational expenses over the years.  Now I left the company, and I may need to pay back a portion of the amount that they paid towards my degree. The payback is requested because of "wage overpayment". Question: should I deduct this amount from my W2 income or should I claim an educational expense deduction?  How would I do the former if that is the right thing to do?


change in original array if I change the copied one

Again a confusing Issue: Here I copied the array into another variable and I expect not to change the original array when I change something in another one but both arrays change Why?    const groups = [[1, 2, 3, 4 ,5], [2,3]];  const sets = [...groups];    sets[1].push(9000); // I just push a number into sets NOT groups    console.log(sets);  console.log(groups);       This only happens if we have an array of arrays! What I'm missing and How to fix this?


If $R$ is infinite and $R/I$ is finite for every $I\neq (0)$, then $R$ is a domain

I encountered the following exercise (Exercise 3.9, page 24) in the book A Course in Galois Theory by D. J. H. Garling (Cambridge Univ. Press) :  Assume that $R$ is an infinite commutative ring with a multiplicative identity for which $R/I$ is a finite ring for every non-zero ideal $I$ in $R$. Prove that $R$ must be an integral domain.  Not even sure how to approach this! I don't have a feeling why this assertion should be true.


I want to prove that $P((0,1)-\mathbb{ Q})  = 2^{\mathbb{R}}$, i have a proof which is roughly that $((0,1)-\mathbb{Q}) \cup \mathbb{Q} = (0,1)$ and there intersection is empty so assuming the AC we have that $|\mathbb{R} |= |(0,1)| = |(0,1)-\mathbb{Q}| + |\mathbb{Q}| = \max(|(0,1)-\mathbb{Q}|, \aleph_0)$ , my question is there a proof that $P((0,1)-\mathbb{ Q})  = 2^{\mathbb{R}} $ without AC ?  I have another question, what is the cardinality of the set of all real numbers whose digits are odd in the form $0.a_1 a_2 \cdots$ , i suspect its $|\mathbb{R}|$ but i don't know how to prove it?


What is correct?  1.) The topic is smart homes.  2.) The topic are smart homes.  Regarding 1.) It sounds wrong for me, but in my opinion grammatically correct. Regarding 2.) It sound right, but grammatically incorrect.  Thanks!


I'm using InDesing CS4.  Is there a way to setup text frames to start at the end of thread and flow upwards?  This is how I want it to look/work.  Each box will represent a text frame on a page:    If I add a new line:    Edit: This data gets filled in by an automated app.  So re sizing, or adding frame-breaks not really an option.


Grant Select on all Tables Owned By Specific User

I need to grant select permission for all tables owned by a specific user to another user.  Can I do this with a single command along the lines of:  Grant Select on OwningUser.* to ReceivingUser   Or do I have to generate the sql for each table with something along the lines of:   Select 'GRANT SELECT ON OwningUser.'||Table_Name||'TO ReceivingUser'   From All_Tables Where Owner='OWNINGUSER'


How to find the network address of a given subnet?

How do I find the x th subnet of X.X.X.X /XX (300 th subnet of 172.16.0.0 /29)?


Asked a question yesterday and SE metrics say that it was today

I am currently in Portugal (UTC timezone - , and it is 2021-01-09 11:31AM. I have asked a question yesterday, 2021-01-08, at 02:54PM  However, if one looks at the metrics under the title of the question, it says that the question was asked "Today"


Not full-sized windows go too far to top left of the screen and their title bar is blocked by the top bar

It started happening recently and it is like in this question:  but the solution given there doesn't work any more according to a comment under it and also, I still would like windows to open in the top left of the screen just not so much that the title bar is blocked.  It seems like this came with an update because I haven't been making any changes to my computer recently.  It doesn't happen on the guest account.  Also, just before this started happening I rebooted my computer and when I logged in only the Desktop was shown--no top bar or side bar so I had to reboot it again.  Should I report it as a bug somewhere?  I've attached a picture as an example.


Is there a school of thought that addresses an engine behind every physical aspect of the universe?

First of all, this question also relates to physics but goes beyond it, into the phylosophical field.  After dealing with physics engines in computer engineering, an idea of something similar crossed my mind.  When thinking about every physical process in nature where events trigger new scenarios of matter and energy in different states, one might think that an "engine" of some kind must have had to calculate all aspects of the initial states to actually produce results in the universe.  An example of this would be throwing a glass against a wall. Given all kinds of variables (speed, air-related variables, materials variables, wall variables, etc), something or someone must tell the glass into how many pieces it should be broken and at which speed and angle each piece has to rebound. This way, something in the universe must be constantly calculating all data (seen as "inputs" of the system) to produce the inmediate future state of the universe. The rules are somehow written and this engine would apply them fore every aspect and in every corner of the universe.  I know that the concept of formulas and variables are a human post-construction that comes after observing the universe, but it can be said that some these rules where there before and independently of human thought (this might be another topic).  Having said this, is there a school of thought that deals with this concern? is it even a surrealistic topic?


What are some lesser-known examples where increasing the dimensionality makes the problem easier to solve?

I feel like there is a common pattern in mathematics where increasing the dimensionality makes the problem easier to solve or provides a solution where otherwise one would not exist. Some examples:  Going from real numbers to complex numbers Working with quaternions (4D) instead of (roll, pitch, yaw) or rotation matrices which have singularities Laplace transform which lets us solve differential equations with algebra (ok this isn't really increasing the dimensionality, more like working in a different dimension)  I'm not a mathematician but I imagine this appears in other areas. What else is there? Is there a "method" or systematic way for increasing the dimensionality of a problem to make it easier to solve? Bonus if there is something in the field of optimization and/or linear algebra, which I am most interested in at the moment.


I've been recently learning about GLM's after learning about ordinary linear regression. In simple linear regression, I believe that an error term is used in order to account for randomness in the actual response when we predict values, like the equation below: Yi= β0+ βxi+ ϵi Where ϵi follows a normal distribution with expectation 0 and variance sigma^2. However I believe that this assumes that our Y variable follows a normal distribution. I was wondering what would be the equivalent error term (if any) for GLM's that we model assuming Y follows another distribution (such as Poisson or Gamma), and if it relates anyway to the "link" function used in GLMS. Thanks!


Is there a way to uncover arrows in an xymatrix? Usually when I have problems with \uncover I use multiple frames, but I would like to be able to do this on a single frame.  Here is a sample: I would like the first slide to read "B", and then uncover "A →". The following code doesn't cover the "→".  \documentclass{beamer} \usepackage[all]{xy}      \begin{document}  \begin{frame}[plain]  \xymatrix{ \uncover<2->{A \ar[r]}& B }  \end{frame}  \end{document}


Preventing SQL injections when creating tables with names given by the user

I am building a social networking website. After user signs up an account, I add his/her information to the database and creates 3 different tables for his/her other information, they are called like this ($username . "_posts"),($username . "_friends") and ($username . "_notifications"). In the creating statements I can not use placeholders for the table name to prevent SQL injection.  So, I was thinking of a way to prevent the user from manipulating the statement I use to create the tables by his/her input.  So, what if I prevented the user from inputting characters like (back quote) , (single quote) or (double quote) ....etc to the input field (username) ,  will this work? Is there a better way? If I choose to use way mentioned above what other characters should I prevent the user from inputting? thanks in advance.  Here is one of the create statements I use:  $create_table_for_user_posts = $conn->prepare("CREATE TABLE " . $username . "_posts (     id INT(255) UNSIGNED AUTO_INCREMENT PRIMARY KEY,     posts VARCHAR(35000) NOT NULL,     poster_username VARCHAR(2000) NOT NULL,     poster_first_name VARCHAR(2000) NOT NULL,     poster_last_name VARCHAR(2000) NOT NULL,     reg_date TIMESTAMP )");


Why is $(f_n)_{n\in\mathbb{N}}$ with $f_n :[0,1]\rightarrow\mathbb{R}, f_n(x)=x^n$ not uniformly convergent?

If I choose $f:[0,1]\rightarrow \mathbb{R}$ with $f(1)=1$ and otherwise $f(x)=0$ then $||f_n-f||_{[0,1]}\rightarrow0$ therefore it is uniformly convergent and because it is uniformly convergent $f$ would have to be continuous but it is not, where is the mistake?


Prettify, commafy, beautify the question views

A very small and rather simple suggestion... Could you please (pretty please!) prettify the the number of times a question has been viewed, so that at a glance you can figure it out instead of having to decrypt it. Current Look  I mean look at it! It isn't very user friendly. Suggestion Have it output as 296,877 instead of just 296877. I thought I'd ask here so it could be implemented on all the sites network-wide. According to  (comment copied below) comment in this related question, I think anything just to split the numbers up would be better than the current system; spaces would be fine too.  Commas should never happen due to internationalization concerns. The same goes with dots. The only "correct" option is following the ISO standard which calls for spaces. – psubsee2003 Apr 25 '15 at 21:02


Is it possible to export geospatial PDF from QGIS via GDAL/OGR?

Is there any plugin for QGIS which would help me in exporting the map document as a geospatial PDF (similar to Terrago's GeoPDF)?


Prove by induction that $n < 2 ^n $ where $n \in \mathbb{N}$

Example question in a textbook that I don't understand.  Proof works for n = 1  Setting for k makes $k < 2^k $  Setting for k  + 1 makes $k+1 < 2^{k+1}  $.  Here, I would be stuck, the book takes the equation to:  $k+1<2^k +1\leq 2^k+2^k = 2 \cdot 2^k=2^{k+1}$.  NB: $<2^k +1$ is not a typo.  There doesn't seem to be a good explanation for this in the book (although it does mention adding 1to both sides of the equation), could I have some advice on how the method used works?


Combinatorial proof of $\sum_{i=0}^n {n \choose i}^2={2n \choose n}$ by using a binary string of length $2n$

I was wondering if there is any combinatorial proof of $$\sum_{i=0}^n {n \choose i}^2={2n \choose n}$$ It is obvious that the RHS of the equation counts the number of binary strings of length $2n$ with exactly $n$ 1's, but how about the LHS?


I've got the following code snippet: class Base{  public:   virtual float operator()(float x){return x;}; };  class Child: public Base{  public:   virtual float operator()(float x) override{return 2 * x;}; };  void scoped(Base b){     std::cout << "Nested: " << b(5) << "\n"; }  int main() {     Child c = Child();     std::cout << "Output: " << c(10) << std::endl ;     scoped(c); }  The output 20  // expected 5  // unexpected. Should ahve been doubled?  context I'm making scoped take a base class because I've got multiple child classes derived from it. On one hand I suppose it makes sense that it would called the () from the base class since that's what the type is declared as. On the other hand, why wouldn't it call the method from the instance (which is a Child first, then a Base?) Questions  Am I missing something? How would I accomplish what I'm aiming to do? I get the feeling that templates may be a solution but maybe are not the right one?  Why is it calling the base class method as opposed to the child


sqlplus: ORA-01017 logon denied from one host but OK from another

I have a strange behavior for remote sqlplus login to Oracle 11.2 that I cannot explain:  1) I have an Oracle 11.2 server running on a virtual host, say host1 2) I set up another VM, say host2 (CentOS 6.5 x86_64) with oracle-instantclient 11.2.0.4 64bit, built up from a minimal install ISO 3) I also downloaded a CentOS 6.5 x86_64 VM image from the net (a desktop install with everything already installed), say host3, on which I installed the same Oracle instantclient  I use the same environment and tnsnames.ora file on both host2 and host3, something like:  MONSTER= (DESCRIPTION=     (ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521))     (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=CRM)))   Issue: On host2, I cannot get rid of the ORA-01017 error:  host2> sqlplus sys/<passwd>@monster as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Fri Aug 1 12:09:51 2014  Copyright (c) 1982, 2013, Oracle.  All rights reserved.  ERROR: ORA-01017: invalid username/password; logon denied   BUT, on host3, everything is OK:  host3> sqlplus sys/<passwd>@monster as sysdba  SQL*Plus: Release 11.2.0.4.0 Production on Fri Aug 1 06:21:59 2014  Copyright (c) 1982, 2013, Oracle.  All rights reserved.  Connected to: Oracle Database 11g Enterprise Edition Release ... SQL>   Has someone an idea why connecting from one host is OK while connecting from the other one is KO?  NB: Needless to say this is not an issue of case sensitivity, or bad orapwd, or remote_login_passwordfile not set to EXCLUSIVE, since it works from host3.  Thanks


Prove the maximum of convex functions is also convex using this def.

Could someone assist me in proving that the maximum of a convex function is also convex using the below definition? I cannot figure out how this proof would work and would appreciate some help!  $$ f(\lambda x +(1-\lambda)y) \le \lambda f(x)+(1-\lambda)f(y) $$  $$ \lambda \in[1,0] $$  Thank you!


Is this correct PDO and sufficient to prevent injection?

Changing from php 5 to php 7 I must change my queries. Now using PDO. Is this method sufficient to prevent mysql injection etc? I connect to the db like this: $conn = new PDO("mysql:host=$hostname;dbname=$db", $username, $password);  my full query is 8 queries joined by union all. My (simplified) query is like this: (there are other cols to be queried, hence the numerous union all) $query="select * from product_catalogue          where sub_category like ? union all         select * from product_catalogue          where brand like ?  union all         select * from product_catalogue          where category like ? union all         select * from product_catalogue          where colour like ? union all         select * from product_catalogue          where stock_code like ? union all         select * from product_catalogue          where barcode like ? union all         select * from product_catalogue          where item_name like ? union all         select * from product_catalogue          where department like ?";     $input = "%".$input."%";   $stmt = $conn->prepare($query);    $stmt->bindParam(1, $input, PDO::PARAM_STR, 12);  $stmt->bindParam(2, $input, PDO::PARAM_STR, 12); $stmt->bindParam(3, $input, PDO::PARAM_STR, 12); $stmt->bindParam(4, $input, PDO::PARAM_STR, 12); $stmt->bindParam(5, $input, PDO::PARAM_STR, 12); $stmt->bindParam(6, $input, PDO::PARAM_STR, 12); $stmt->bindParam(7, $input, PDO::PARAM_STR, 12); $stmt->bindParam(8, $input, PDO::PARAM_STR, 12);  $stmt->execute();   $data = $stmt->fetchAll();


Why is there no chat in the footer on Stack Overflow like on other sites?

On all Stack Exchange sites there is a chat in the footer why is there none at Stack Overflow? Usually I find it over Google or a bookmark, but I was wondering why it is this way.


Writing a quick plugin to strip Amazon associate links out of emails and feed to not brake the terms ofservice. Worked it all out apart from the iframe.  A typical iframe associate link looks like this   <iframe style="width:120px;height:240px;" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" src="//ws-eu.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=GB&source=ac&ref=qf_sp_asin_til&ad_type=product_link&tracking_id=keepchickens-21&marketplace=amazon&region=GB&placement=1473689309&asins=1473689309&linkId=2ee7072c3050c40cded9c2ecdb317332&show_border=true&link_opens_in_new_window=true&price_color=333333&title_color=0066c0&bg_color=ffffff"> </iframe>    This regexp   /(<iframe )(.*)(amazon.adsystem.com).*/   picks up everything except the closing iframe tag I have tried variations of   /(<iframe )(.*)(amazon.adsystem.com).*(</iframe>)/   But can't get it to work. Any ideas?


This is not about new macros like \newcommand, \def and others. This is not about autocompletion like using .cwl (in TexStudio) This is also not about using shortcuts for predefined commands that are listed in the shortcuts sections.   It is more closely related to the 3. Though. I want to define shortcuts for commands that are not listed there.  e.g. When I type Ctrl + Shift + B, I want   \begin{bmatrix} \end{bmatrix}   to be inserted just like Ctrl+ Enter inserts \\.


What further steps can I take to distinguish a question incorrectly closed as duplicate?

The perfect question for my problem is erroneously closed as a duplicate. The one answer doesn't work; in fact, it's an answer to the (allegedly) duplicated question. Maybe that (and the fact that the answer was, at one point, accepted) is part of the problem.    I've done   to get it reopened:   I commented on the question itself I commented on the unsatisfactory answer I carefully examined the alleged duplicate to make sure it was different I edited the question to highlight the differences I flagged it for moderator attention ... twice, or tried to, anyway - see below I'm asking about it on Meta


Why is this void method not working as I would expect?

Assuming that the Given array is instantiated as follows: int[] given = {1, 2, 3, 4, 5};  These methods should change the array and show the print results.  public int[] change(int[] given) {    out.println(Arrays.toString(given)); //before-changes    whatIsGoingOn(given); //make changes    out.println(Arrays.toString(given));//after changes    return given; //return the supposedly changed array } //Make changes: public void whatIsGoingOn(int[] given) {    given = new int[5];    given[0] = 200; }   I BELIVE THE PROBLEM to be with the void method, overriding the original values of the int[] given but the new initialization and declarations never make it out.  I Would expect the array to be:   {200, 0, 0, 0, 0};   But Java prints out:  {1, 2, 3, 4, 5} {1, 2, 3, 4, 5}   But in the case where I returned a newly changed array in the whatIsGoingOnMethod, I get my wanted results:  {1, 2, 3, 4, 5} {200, 0, 0, 0, 0}   If the void method just does something and its not really being "applied" as I would like to expect. I'd appreciate an illuminating explanation for this.  This Question is ALREADY ANSWERED THANKS!!! I need to freeze it.


I am new to AES and I am too much confused about the generation of S-box in AES. I don't have any idea of $GF(2)^8$ field and how the things are happening around. Please answer this question with a example in layman language.


Web scraping/email harvesting to contact survey respondents

I'm working on a research project that includes a survey of academics in a specific field. One method we've discussed for building a sample frame and obtaining contact information for potential respondents involves using web scraping to automatically obtain email addresses from various University websites. Names would be obtained by downloading citations for papers related to our topic, then we would use a script to search the web for email addresses that match those names. I'm not sure that this is an appropriate method for obtaining contact information, and have found some sources online that suggest my hunch is correct. However, most discussion of these methods relates to marketing research, rather than an academic context.  What do you think? Are there rules or guidance about this that I haven't found (I've read the CASRO and ESOMAR guidelines for research market which suggest that web scraping/email harvesting is not appropriate).


How to remove some pages from the navigation bullets in Beamer?

I'm making a beamer presentation using the miniframes outer theme, with navigation bullets, and the subsection=false option, meaning the bullets are all on a single row. The problem I have is that, if one section has too many pages, the bullets overflow to the next section:  Section 1 Section 2 oooooooooooooooooooo   I tend to have many frames, some of them just asking a question, leading to the next detailed frame. I don't really need those frames to be represented by navigation bullets, and removing them would fix the problem. Any idea how to do that?  I could cheat by using overlays to have the question and the answer on the same frame, but that would be a mess...  Code example to answer percusse's question: this should give you one circle per frame, not one per subsection. If you add many frames in one subsection, the circles will overflow over the next section.  \documentclass[compress]{beamer} \useoutertheme[subsection=false]{miniframes} \begin{document} \section{S1} \subsection{SS1} \frame{1} \frame{2} \frame{3} \subsection{SS2} \frame{1} \frame{2} \frame{3} ... \end{document}