I'm pretty new to PHP and am trying to learn more in the area of making my forms secure so that my DB are more difficult to mess up via SQL injection and such. The current web programmer/php guy at our company quit with short notice so my boss has placed me in the php programmers position temporarily with only a single week of training under the previous programmer (I do lots of html and css work, but no php prior), until they can find a real replacement.  Anyways, I read that using mysql_query() is a depreciated function and it should be avoided because that method is vulnerable. I see that my two options are to now use PDO or MySQLi. Being new to PHP, I'm having trouble figuring out what exactly I need to do to convert the code I am currently using (which sends info from a request a quote form on the site and stores it in the database incase of email troubles) into a more secure method of sending data to the database via PDO or MySQLi.  The current line of code I'm using is:      $query = mysql_query("insert into request_for_quote(rfq_company_name, rfq_name, rfq_email, rfq_phone, rfq_end_user) values ('$rfqCompanyName', '$rfqName', '$rfqEmail', '$rfqPhone', '$rfqEndUser')");   Which is mostly powered by $_POST variables.                  $rfqName = mysql_real_escape_string($_POST['rfq_name']);                 $rfqEmail = filter_var($_POST['rfq_email'], FILTER_VALIDATE_EMAIL);                 $rfqPhone = mysql_real_escape_string($_POST['rfq_phone']);                 $rfqCompanyName = mysql_real_escape_string($_POST['rfq_company_name']);                 $rfqEndUser = mysql_real_escape_string($_POST['rfq_end_user']);   Now, my code does what I need it to, it just seems like it is extremely vulnerable to database attacks, and I want to learn how to fix that, but it seems all examples I'm finding online aren't using the setup of "insert X,Y, and Z variables into the table Columns as values A, B, C".  Are there any simple changes I do to make my database submission query more secure?

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


function Cell(row, col) { this.row = row this.col = col this.piece = '' }  function makeBoard() {     let board = new Array(3)         for (let i = 0; i < 3; i++) {             board[i] = new Array(3)         }         for (let row = 0; row < 3; row++) {             for (let col = 0; col < 3; col++) {                 board[row][col] = new Cell(row, col)             }         }   return board   }  let a1 = makeBoard() let b1 = [...a1]  b1[0][0].piece = 'knight' console.log(a1[0][0].piece) // returns 'knight'  I want to be able to change b1 without affecting a1. I realized the objects within the array aren't being copied. When I change the object within b1, the object in a1 is affected too. How can I do a deepcopy including the object of the 2D array?

What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but . I've done things like obj = JSON.parse(JSON.stringify(o)); but question the efficiency.  I've also seen recursive copying functions with various flaws.  I'm surprised no canonical solution exists.


Show that the eigenvalues of the adjacency matrix for cycle $C_n$ on $n$ vertices are $λ_j=2 \cos(\frac{2πj}{n})$.  I've seen a couple of references that just assume this to be true, but I have not found any sort of prove for it. Any help will be much appreciated.

I am trying to find the eigenvalue of cycle graph and its complement. How to simplify.Suppose  $\omega^{1}+\omega^{n-1}=2\cos (2\pi/n) $, then, $\omega^{\frac{n-1}{2}}+\omega^{\frac{n+1}{2}}=\ ?$ Is it true that $\omega^{1}+\omega^{n-1}=\omega^{\frac{n-1}{2}}+\omega^{\frac{n+1}{2}},$ where $\omega=e^{\frac{2\pi i}{n}}$?   Similarly, what is the value of $\omega^{0}+0+\omega^{2}+\omega^{3}+\cdots+\omega^{n-2}+0$. Both the adjacency matrices $C_n$ and its complement $\bar{C_{n}}$ gives circulant matrix.


How to set the current working directory in Python?

cd is the shell command to change the working directory. How do I change the current working directory in Python?


I'm generating a KML file and at the point where I use the transformer API, I get the NullPointerException exception. Here's the code I'm refering too:  TransformerFactory transformerFactory = TransformerFactory.newInstance();             Transformer transformer = transformerFactory.newTransformer();             DOMSource source = new DOMSource(kml);             StreamResult result = new StreamResult(new File("src/mapa/mapa.kml"));             System.out.print("DESPRES DE CREAR RESULT\n");             if(source == null)                 System.out.print("SOURCE IS NULL");             if(result == null)                 System.out.print("RESULT IS NULL");             transformer.transform(source, result);             System.out.print("AFTER TRASNFORM\n");   It doesn't print any of the NULL System.outs, however it doesn't print the last one either. Why is it giving me NPE?  Exception:  DESPRES DE CREAR RESULT ERROR:  '' javax.xml.transform.TransformerException: java.lang.NullPointerException     at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)     at Joc.crearMapa(Joc.java:199)     at MastersOfWar.main(MastersOfWar.java:18) Caused by: java.lang.NullPointerException     at com.sun.org.apache.xml.internal.serializer.ToUnknownStream.characters(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(Unknown Source)     ... 4 more --------- java.lang.NullPointerException     at com.sun.org.apache.xml.internal.serializer.ToUnknownStream.characters(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)     at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)     at Joc.crearMapa(Joc.java:199)     at MastersOfWar.main(MastersOfWar.java:18)

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


Poincaré tell us (roughly speaking) that any hamiltonian system come up arbitrarily close  to the initial condition if you wait enough time.  For example, this theorem is valid for gases, and in general is one of the many key theorems that sustain Statistical Physics.  And if this theorem is valid to cosmological level , what that implies? I mean, at the end, the universe is just evolving along  the most probable line which could be one posible option of many more.

If the theory of everything indicates a singularity-free and finite universe, will  be relevant to the universe? If so, is there any interesting physical consequence, e.g. in superstring or quantum gravity?


I need to edit the etc/bash.bashrc file but the VI is being a little complicated. Is there a way to access the folder directly? Not by command line, and edit by the GUI text editor?

I can't seem to edit and save config files in the root system (eg: /etc/dhcp/dhcpd.config); it just says "permission denied" or the save option is blocked in the text editor.  I'm pretty sure I'm a root user, but how do I make sure? If I am a root user, how do I fix this?


I seems to be an paradox when working with energy. If a person going 20 m/s to 40 m/s the kinetical energy gain is (40^2-20^2)/2= 600 J. Now imagine that i goinng in the opposite diraction with speed 10 m/s. Now the kinetical energy gain of the person is (50^2-30^2)/2=800 J. I see this as an Paradox? Maybe not, just an effect of two different moving reference frame...

The energy of a moving object is $E = mv^2\;.$ That is it increases with velocity squared.  I walk at say 3 miles per hour, or lets round that down to 1 meter per second for a slow walk. I weigh less than $100~\mathrm{kg}\;,$ but lets just round that up to $100~\mathrm{ kg}$ for convenience (it is just after Christmas).  So when I walk along the pavement, I have $100~\mathrm{kg\; m^2 s^{-2}}$, 100 joules of kinetic energy.  Now I get on a passenger jet, which is cruising at around 500 knots, call that 250 meters per second.  In my seat I have $100\times 250^2 = 6250000$ joules of kinetic energy. But when I walk down the aisle I have $100\times 251^2 = 6300100$ joules of kinetic energy. The difference between these is: 50100 joules.  It feels the same to me, walking down the pavement as walking down the aisle of the plane. I didn't have to make some huge effort to get up to speed on the plane, yet I needed 500 times the energy to do it.  How is this possible, and where did the energy come from?


I want to book tickets from Ahmedabad to Boisar in train Jamnagar-Bandra Intercity. But I am not getting that option to book from irctc.co.in. I know this same train goes to boisar and also know that engine and some coaches are added/removed from surat. Thats not the point. Question is how to book the ticket in one go so to get the same seat.  Need an urgent solution want to book for day after tomorrow.

Suppose I want to go from Station A to Station C but Station C is not a stoppage of some train say train 01, so I can get a combined ticket from station A to Station B  through train 01 plus Station B to station C through a different train say 02, so my total fare will be of same ticket as from Station A to Station C.  We can get Combined ticket from the Booking Window but how's that possible on the IRCTC website?


Does there exist a continuous function $f : \Bbb R \to \Bbb R$ which takes irrational values at rational points and rational values at irrational points?

Is there a way to prove the following result using connectedness?  Result:  Let $J=\mathbb{R} \setminus \mathbb{Q}$ denote the set of irrational numbers. There is no continuous map $f: \mathbb{R} \rightarrow \mathbb{R}$ such that $f(\mathbb{Q}) \subseteq J$ and $f(J) \subseteq \mathbb{Q}$.


I have a command: $var=test_file_20200612000000  aws s3 ls [s3 bucket name] --profile [profile name] | grep "test" | awk '$4 > $var'  This is looking at files on an s3 bucket and returning only those where the name is greater than a string variable being passed in (finding new files with later time stamps essentially). Awk is not recognizing the var variable - how does one deal with this?

Here is my script (to find the files that contain a specified pattern):  find . -type f \     -exec awk -v vawk="$1" '/'"$vawk"'/ {c++} c>0 { print ARGV[1]; exit 0 } END { if (! c) {exit 1}}' \{\} \;   I would like to use my script with an argument §:  MyScript.sh pattern   My problem is that I don't manage to put the $1 variable in awk.  When I try to debug my script  bash -x MyScript.sh pattern   Here is the output :  + find . -type f -exec awk -v vawk=pattern '// {c++} c>0 {print ARGV[1] ; exit 0 } END { if (! c) {exit 1}}' '{}' ';'   The $vawk variable seems to be empty.  Any idea?


I have accidentally updated over 3,000 records in one of my tables hosted on Azure. This was not a transaction and I did not have any back ups for this table.  I've read around and found  but when I connect I try to connect I see "SQL server Azure is not supported"  I understand that this tool examines logs to reproduce the data, is there a manual technique to do is, or an alternative compatible tool?  Really grateful for you support.  Thanks.

I have accidentally updated over 3,000 records in one of my tables hosted on Azure. This was not a transaction and I did not have any back ups for this table.  I've read around and found ApexSQL Log but when I connect I try to connect I see "SQL server Azure is not supported"  I understand that this tool examines logs to reproduce the data, is there a manual technique to do is, or an alternative compatible tool?  I also found this  but after running it on Azure I see 'Invalid object name 'fn_dblog'  Really grateful for you support.  Thanks.


I want to run a function every x sec and never end unless interrupted. Using threading.Timer will spawn a new thread everytime. Is there a way to achieve the same in one thread?

I want to repeatedly execute a function in Python every 60 seconds forever (just like an  in Objective C). This code will run as a daemon and is effectively like calling the python script every minute using a cron, but without requiring that to be set up by the user.  In , the solution appears to effectively just  for x seconds. I don't need such advanced functionality so perhaps something like this would work  while True:     # Code executed here     time.sleep(60)   Are there any foreseeable problems with this code?


I am a student who is currently learning the basics of Python. I understand how functions work, but I do not know how to return multiple variables from a single function. I am able to reach the same effect by just using copy + paste, but that's not accepted by the teacher. I wish to run the function twice, and I want the program to save both of the outputs, but only in seconds. Below is the program in question, and when you enter your birthday, it will give you your age in seconds, minutes, hours, days, weeks, months, and years.   #Age Finder Program #This program will calculate a person's age   import datetime  #Get current dates current_month = datetime.date.today().month current_day = datetime.date.today().day current_year = datetime.date.today().year  def age():  #Get info name = input('What is your name?') print('Nice to meet you, ', name,) print('Enter the following information to calculate your approximate age!') month_birth = int(input('Enter the numerical month in which you were born:    ')) day_birth = int(input('Enter the numerical day in relation to the month of which you were born: ')) year_birth = int(input('Enter the year in which you were born : '))  #Determine number of seconds in a day, average month, and a year numsecs_day = 24 * 60 * 60 numsecs_year = 365 * numsecs_day  avg_numsecs_year = ((4 * numsecs_year) + numsecs_day) // 4 avg_numsecs_month = avg_numsecs_year // 12  #Calculate approximate age in seconds numsecs_1900_dob = ((year_birth - 1900) * avg_numsecs_year) + \                     ((month_birth - 1) * avg_numsecs_month) + \                     (day_birth * numsecs_day)  numsecs_1900_today = ((current_year - 1900) * avg_numsecs_year) + \                     ((current_month - 1) * avg_numsecs_month) + \                     (current_day * numsecs_day)  age_in_secs = numsecs_1900_today - numsecs_1900_dob age_in_minutes = age_in_secs / 60 age_in_hours = age_in_minutes / 60 age_in_days = age_in_hours /24 age_in_weeks = age_in_days / 7 age_in_months = age_in_weeks / 4.35 age_in_years = age_in_months / 12  #Output print('Well,',name,', you are approximately', age_in_secs, 'seconds old!') print('Or', age_in_minutes, 'minutes old!') print('Or', age_in_hours, 'hours old!') print('Or', age_in_days, 'days old!') print('Or', age_in_weeks, 'weeks old!') print('Or', age_in_months, 'months old!') print('Or', age_in_years, ' years old!')  #Extra if age_in_years < 18:     print('Have fun in School!\n')  age()

The canonical way to return multiple values in languages that support it is often . Option: Using a tuple Consider this trivial example: def f(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return (y0, y1, y2)  However, this quickly gets problematic as the number of values returned increases. What if you want to return four or five values? Sure, you could keep tupling them, but it gets easy to forget which value is where. It's also rather ugly to unpack them wherever you want to receive them. Option: Using a dictionary The next logical step seems to be to introduce some sort of 'record notation'. In Python, the obvious way to do this is by means of a dict. Consider the following: def g(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return {'y0': y0, 'y1': y1 ,'y2': y2}  (Just to be clear, y0, y1, and y2 are just meant as abstract identifiers. As pointed out, in practice you'd use meaningful identifiers.) Now, we have a mechanism whereby we can project out a particular member of the returned object. For example, result['y0']  Option: Using a class However, there is another option. We could instead return a specialized structure. I've framed this in the context of Python, but I'm sure it applies to other languages as well. Indeed, if you were working in C this might very well be your only option. Here goes: class ReturnValue:   def __init__(self, y0, y1, y2):      self.y0 = y0      self.y1 = y1      self.y2 = y2  def g(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return ReturnValue(y0, y1, y2)  In Python the previous two are perhaps very similar in terms of plumbing - after all { y0, y1, y2 } just end up being entries in the internal __dict__ of the ReturnValue. There is one additional feature provided by Python though for tiny objects, the __slots__ attribute. The class could be expressed as: class ReturnValue(object):   __slots__ = ["y0", "y1", "y2"]   def __init__(self, y0, y1, y2):      self.y0 = y0      self.y1 = y1      self.y2 = y2  From the :  The __slots__ declaration takes a sequence of instance variables and reserves just enough space in each instance to hold a value for each variable. Space is saved because __dict__ is not created for each instance.  Option: Using a  (Python 3.7+) Using Python 3.7's new dataclasses, return a class with automatically added special methods, typing and other useful tools: @dataclass class Returnvalue:     y0: int     y1: float     y3: int  def total_cost(x):     y0 = x + 1     y1 = x * 3     y2 = y0 ** y3     return ReturnValue(y0, y1, y2)  Option: Using a list Another suggestion which I'd overlooked comes from Bill the Lizard: def h(x):   result = [x + 1]   result.append(x * 3)   result.append(y0 ** y3)   return result  This is my least favorite method though. I suppose I'm tainted by exposure to Haskell, but the idea of mixed-type lists has always felt uncomfortable to me. In this particular example the list is -not- mixed type, but it conceivably could be. A list used in this way really doesn't gain anything with respect to the tuple as far as I can tell. The only real difference between lists and tuples in Python is that lists are , whereas tuples are not. I personally tend to carry over the conventions from functional programming: use lists for any number of elements of the same type, and tuples for a fixed number of elements of predetermined types. Question After the lengthy preamble, comes the inevitable question. Which method (do you think) is best?


The language being L, which is described as follows:  $L$ = { $<M>$ | $M$ accepts the binary encodings of at least 4 odd numbers } .    I understand that this involves using one turing machine to simulate another. What sort of methodology could I use for these kinds of questions?

The language being L, which is described as follows:  $L$ = { $<M>$ | $M$ accepts the binary encodings of at least 4 odd numbers } .  My solution:  M generates the binary encodings in $\Sigma_M*$ in ascending order and uses dovetailing to interleave the computation of M on those binary encodings. As soon as four computations accept, M halts and accepts.  Is this correct? What corrections would have to be made if not? I am not sure if I am providing enough details in my solution which may cause it to be incorrect.


I have seen this problem in a book .   But I don't know what should be the solution . Question is   There is a sequence defined by $$\sqrt[1]{1},\sqrt[2]{2},\sqrt[3]{3},\sqrt[4]{4},\cdots,\sqrt[n-1]{n-1},\sqrt[n]{n}$$  We have to find the largest number in this sequence.  What I did is as usual what I do when comparing two irrational numbers  I compared $\sqrt[1]{1} $ & $\sqrt[2]{2}$ and found that $\sqrt[2]{2}$ is greater.  Then I compared $\sqrt[3]{3} $ &$\sqrt[2]{2}$ and found $\sqrt[3]{3}$ is greater.  Then I compared $\sqrt[3]{3} $& $\sqrt[4]{4}$ and found $\sqrt[3]{3}$ is greater.  And then I compared  $\sqrt[5]{5}$&$\sqrt[4]{4}$ and found $\sqrt[4]{4}$ is greater.  And finally I compared $\sqrt[5]{5}$&$\sqrt[6]{6}$ and found $\sqrt[5]{5}$ is greater.  I cannot guarantee will it work up to infinity or not and found $\sqrt[3]{3}$ is greatest term.  And now I have to prove my result.  More generally I have to prove that $\sqrt[n]{n}\gt \sqrt[n+1]{n+1}$ for all $n\in\mathbb N$ and $n\gt 2$  I applied induction to prove it but didn't got the solution.  Please help me in proving this .  Or please tell me an alternative way to tell which number is largest in the sequence.

$1, 2^{1/2}, 3^{1/3}, 4^{1/4}, 5^{1/5}, 6^{1/6} , 7^{1/7}$. I got this question in an Application of Derivatives test. I think log might be used here to compare the values, but even then the values are very close to each other and differ by less than 0.02, which makes it difficult to get some specific answer to this question. How to solve this by a definite method?


So I am working on a research project where I need to combine two datasets from a community survey given every year in NYC. I am combining years 2016 and 2017 which have the same variables used for each year, and each year has a respective survey weight. I am using the append function to combine the datasets but I am unsure how to combine the survey weights for a total survey weight of the two. I'm working with Stata 14.2 if that helps at all. I'm new to stata so if you can clearly explain what you have to do/why you do it, that would be really helpful. Any insight on this would be great! Thanks!

I have results from 5 surveys each 2 years apart and let us assume that no subjects are selected in more than one survey.  The sampling method used in these surveys are biased and I have sampling weights calculated(with respect to the population) for each data point in each study.  The question is, how would I be able to combine the 5 datasets and have the weights recalculated so as to obtain one giant dataset for analysis on this population?  Also, what should I do if subjects appear in more than one survey?   Updates/Further Elaboration:  thank you @user30523, here are some more infomation that might be useful:  Suppose I wish to find out the estimated distribution of height across the population using these 5 datasets.   In some data, younger people are oversampled because of the location where the survey are conducted. Let's assume the weights are calculated with respect to their age.   Eg. assuming 2% of the population are 15 years old, and the location of the survey is at a mall where 15-year-olds made up 5% of all shoppers, then sampling weight for an subject aged 15 in that survey would be calculated as 0.02 / 0.05 = 0.4. For simplicity, each person in the mall has equal chance of being surveyed and all participants complied when asked.  Given that 5 surveys are conducted in 5 different malls and each has their set of weights calculated in the same way, how would I then be able to combine all 5 datasets and recalculate the sampling weights?  P.S: I'm new to the topic on sampling weights so do correct me if I have made errors in the way I have calculated the weights.


After some manipulations (i don't know, which excatly did it) i unexpectedly broke terminal autocomplete feature. Each time i try yo use it i get:  nimga@ubuntu17:~$ sudo systemctl res-bash: /dev/null: Permission denied bash: _upvars: `-a4': invalid number specifier -bash: /dev/null: Permission denied bash: _upvars: `-a0': invalid number specifier   According to text above i tried to autocomplete "sudo systemctl restart" but got an error. What can i do with it?

I read the  and was playing around by moving files to /dev/null.  For this I created a test_file and put some contents in it:  $ touch test_file $ echo "This is written by Aditya" > test_file $ cat test_file This is written by Aditya   Thereafter I tried to move the file to /dev/null:  $ mv test_file /dev/null mv: inter-device move failed: ‘test_file’ to ‘/dev/null’; unable to remove target: Permission denied   Since, this gave me a Permission denied Error; I went ahead and used sudo as I normally do whenever I encounter a Permission denied error.  $ sudo mv test_file /dev/null   The command succeeded and test_file is no longer present in the directory.  However, the Wikipedia article says that it is not possible to recover anything moved to /dev/null and it gives an EOF to any process that tries to read from it. But, I can read from /dev/null:  $ cat /dev/null This is written by Aditya   What did I do wrong and how do I fix /dev/null back to normal? And why did I encounter Permission denied error in the first place?


When there are forces acting on a rigid body, the two conditions that has to be satisfied for the body to be in static equilibrium are: 1. The sum of all forces must be zero (translational equilibirum): $$\sum_i F_i = 0$$ 2.The sum of all torques relative to any point must be zero (rotational equilibrium): $$\sum_i \tau_i=0$$  Why does the torque have to be zero relative to any point? My understanding is that as long as torque is zero with respect to the pivot, the body will not be in rotational motion. What does it mean when you talk about torque with no reference to a pivot?   Also, how can you makes sure that torque is zero relative to any point? Do you consider all the possible points?

I know that when a body is is equilibrium   There is zero resultant force in any direction, i.e. the sum of all the components of all the forces in any direction is zero The sum of the moments about any point is zero (this point does not need to be on the body)   What if the body is not in equilibrium?  Let me clarify: What if there is a resultant moment of $5\text{ Nm}$ clockwise about a point on a body. If I calculated the moment about another random point in or outside the body, would I still get $5\text{ Nm}$ clockwise as my value?


Is there a way to do this:  Player[] player = new Player[numOfPlayers]; for(int i=0; i < numOfPlayers; i++){     player[i] =  new Player("Player"+i, 0);  } //becomes like this right?  player[0].name='a'; player[1].name='b' player[2].name='c' player[3].name='t' player[i].name='baz'   How can I remove say player[2] so that the new array of objects becomes:  player[0].name='a'; player[1].name='c' player[2].name='t' player[i].name='baz'

Given an array of n Objects, let's say it is an array of strings, and it has the following values:  foo[0] = "a"; foo[1] = "cc"; foo[2] = "a"; foo[3] = "dd";   What do I have to do to delete/remove all the strings/objects equal to "a" in the array?


I am sorry for bothering you but I can not start my Ubuntu session since this morning. When I choose Ubuntu from grub it takes me to Ubuntu logo, it loads and then it stops at this screen. I couldn't find any solution online.

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


I know 2 options to break the line.  Option 1:  Abcdef\\ Ghijkl   Result:  Abcdef Ghijkl   Option 2:  Abcdef  Ghijkl   Result:  Abcdef   Ghijkl   Are there any rules when to use which?  PS: I'm using scrreprt as my document class.

What is the difference between \par, \newline, \\ and blank lines? When should I use which one?


In Iron Man 2, Tony Stark has the problem of poisoning from his Arc Reactor. He stops this by   synthesizing a new element, with instructions from his father, Howard Stark.  The new element was created and in the comics was actually Vibranium! However, in the MCU, it's definitely not; so what is it called? I've heard extrapolations that it was called Starkium, and based on Tony's personality, that would make sense. Is there any official reveal of the name?

I just watched Iron Man 1&2 the other day. I'm new to the entire story. In IM2 we learn that his blood is being poisoned and that he has tried every combination of every existing element as a cure - unsuccessfully. Then he deducts "the key" from the Expo park's plans which saves him. What is that key? What element had he not tried? I realize that the movie story has to be simplified, compared to the original story, so there are probably story elements that I have completely missed because they're only in the original works. We also saw that in LOTR.


I recently recovered my Dell Inspiron 700m from my collection of old hardware. I have a ton of old files and programs on it, none of which I need. I want to install ubuntu and make it a running machine again. Can I replace the windows operating system and reformat with the new ubuntu 13.04 download?

I'm thinking about installing Ubuntu Desktop, but I don't know what flavor is the best for my system. What are the minimum and recommended hardware requirements? What kind of CPU? How much memory? Should I have Hardware Acceleration? What flavor should I use?  This is an attempt of a canonical answer. My answers have the "official  requirements", the recommended are a mix of official sources and opinion based (along with the answer it's told the source). You can comment or edit if you feel that the information is obsolete or incomplete. It is a good rule of thumb that any system capable of running Windows Vista, 7, 8, x86 (Intel) OS X will almost always be a lot faster with any Ubuntu flavor even if they are lower-spec than described below.


I want to show for $x>0$ the inequality $$ \sqrt{x+1}-\sqrt{x} \leq \frac{1}{\sqrt{x}} , $$ which gets suprisingly sharp for large values of $x$.  I guess some kind of binomial theorem for non-integer exponents would be helpful. But maybe there is something simpler?  Any hints? thanks.

I'm having some trouble figuring out where to start for this proof.     Prove for all positive integers $n$,   $$\sqrt{n+1}-\sqrt{n}\lt \frac{1}{2\sqrt{n}}$$   Any help will be greatly appreciated.


Cards is plural but tool is singular. What would be more appropriate to use? Are or Is?

Does it always agree with a singular verb?  For example, does one say (i) or rather (ii)?   (i) It is the birds he is chasing away. (ii) It are the birds he is chasing away.


I have written a pretty simple code to initialize a matrix, but I'm getting some very unexpected behaviour, this is the exact code that I run:    n = 2 b = [ ([0.0] * n) ] * n c = [ ([0.0] * n) ] * n    a = [ [1.0, 2.0, 3.0], [2.0, 1.0, 3.0]] .... print(c[0]) print(c[1]) for i in range(0, n):     b[i][0] = a[i][0] #this one is initialized as expected     c[0][i] = a[0][i] / b[0][0] # notice that c[1] isn't touched here in any way but when I print it out it is initialized to [1.0 1.0] print("") print(c[0]) print(c[1])   but these are the results I get from the print statements:  [0.0, 0.0] [0.0, 0.0]  [1.0, 1.0] [1.0, 1.0]    (Only the first row should be initialized, not all of the elements)  I run Python 2.7.2 on Windows. Is there something I'm missing here?

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


I've read through many of the questions on AskUbuntu about disabling the lock-screen.  Everything I've tried, from setting the lock-screen to "Off" in the Privacy window, to setting the dconf flag:  gsettings set org.gnome.desktop.lockdown disable-lock-screen true   Nothing seems to work, still when I close the lid of my laptop and open it the lock-screen appears and asks for my password.

I want to disable the lock screen on Gnome 3.14 after the computer is woken up from suspension. I've tried different proposed solutions, like , but they does now work.


What one is correct to use? "Do you want to help me to build?" or "Do you want to help me build?" I don't know what one to use

I wrote:      I will help you to acquire Russian.    A native English speaker corrected me saying that 'to' is unnecessary here. Is it correct to say      "I will help you acquire Russian"


I am from the mathematics community on StackExchange. I should say that I know absolutely nothing in statistics. I have never taken a statistics course or read any book on it. I am familiar with basic probability theory though, because it is a mathematics subject. After all probability is an application of real analysis to finite measure spaces, and the subject of probability has a rigorous mathematical foundation to it. But what about statistics?   I view statistics as a way to derive quantitative results from observable data. (Please correct me if this is an inaccurate description of statistics.) This is why statistics is very valuable to scientists whose work entirely consists of observable data. But mathematics is entirely non-empirical. None of the major mathematicians of the last century, or the current one, (at least that I know of), know any statistics. This is why I am asking if you, statisticians, agree with the statement that, "statistics is a numerical branch of science, rather than mathematics".   Now I understand that statisticians use mathematics, sometimes even advanced results. But does not necessarily make them mathematics. Physicists use a lot of mathematics too, but they are not mathematicians. For them mathematics is a means to solve some other problem, it is not the math that inherently interests them.

Is stats maths or not?   Given that it's all numbers, mostly taught by maths departments and you get maths credits for it, I wonder whether people just mean it half-jokingly when they say it, like saying it's a minor part of maths, or just applied maths.   I wonder if something like statistics, where you can't build everything on basic axioms can be considered maths. For example, the $p$-value, which is a concept that arose to make sense of data, but it's not a logical consequence of more basic principles.


I am getting an error in my SQL for my code but for the life of me, I can't seem to understand how to fix it. the error code in SQL is:  1064 - 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 '[value-1],[value-2],[value-3],[value-4])' at line 1  from:          INSERT INTO mensajes(id, nombre, email, mensaje) VALUES ([value-1],[value-2],[value-3],[value-4])  My code is as follows:      if ( isset($_POST["nombre"],$_POST["email"],$_POST["mensaje"]) and $_POST["nombre"]!="" and $_POST["email"]!="" and $_POST["mensaje"]!=""){      // Traspasamos a variables locales, para evitar complicaciones con las comillas:     $nombre = $_POST["nombre"];     $email = $_POST["email"];     $mensaje = $_POST["mensaje"];      // Preparamos la orden SQL:     $consulta = "INSERT INTO mensajes(id,nombre,email,mensaje) VALUES('0','$nombre','$email','$mensaje')";      if ( mysqli_query($con, $consulta) ){          echo "
Registro agregado.
";      } else {          echo "
No se agregó...
";      }  } else {      echo '
Por favor, complete el formulario
';  }  } else {  echo "
Servicio interrumpido
";  }   Any help on this would be great and if I need to provide more information, also, please let me know. Cheers!

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


I saw several examples on the web of tutorials using redux and react where the code of omitting the semicolon when using es6 with babel.  Example semicolon at the end of import, export.   What is the reason? What is a good practice?   Missing semicolon    import React, { PropTypes } from 'react'  const Location = ({ onClick, name, country}) => (     <li         onClick={onClick}     >         {name} {country}     </li> )  export default Location     vs with semicolon     import React, { PropTypes } from 'react';  const Location = ({ onClick, name, country}) => (     <li         onClick={onClick}     >         {name} {country}     </li> );  export default Location;

I've only written a small amount of JavaScript that runs embedded in a Java application, but it was tested using , has been mixed, and I've not noticed any problems yet.    Is there some conventional wisdom whether to use semicolons or not in JavaScript?


Every time I come to Stack Exchange and I have inbox items, I click on the inbox icon and all I see are repeated reminders of the long-closed community moderator elections, and I can't even scroll in the box to find the actual replies I care about. Instead, I have to go to a subsite to actually see the incoming messages; once I do that my inbox starts to display correctly again on Stack Exchange.

I'm having an odd and inconsistent problem where certain inbox notifications are re-appearing within my inbox every few days, even though the date/time for the notification is a week, two weeks, a month, two months or even three months ago. Unfortunately my screenshot didn't take so I don't have a screenshot at this time. The messages I'm getting within the inbox that are repeating though are posts that have been migrated, moderator elections, and other non-answer related items.  Usually a page refresh or clicking on the inbox notification badge, opening the inbox dropdown, and clicking outside of the dropdown clears the messages out of the timeline. Yet every week or so they all re-appear again.    Update I finally was able to capture a screenshot. This was taken this morning at 8:06am. Even though I have an inbox notification of "7", you can see that the "newest" inbox notification dates from May 22nd and the other 6 "new" notifications are from as far back as Feb 2014.


So I've got this problem where I can't seem to insert texts into my database which contain the following character: ' (as in for example:  It's). I've had this problem before and I just stripped the symbol, but now I really need a solution and nowhere on the entire web or stack overflow I can't seem to find a decent and clear answer.  This is how my data is displayed:  HTML  <textarea name="text_from_form">       This is the kind of stuff I need and It's awesome (user input example) </textarea>     PHP  <?php    $my_text = $_POST["text_from_form"};   $my_text_new = htmlentities($my_text);    $sql = "INSERT INTO tableName (text)   VALUES ('$my_text_new')"; ?>   THE 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 's awesome ')' at line 2   Thank you in advance for the help!


Mktime and other functions give wrong answer for such a date like 2011-02-27 02:04:46;

How do I get timestamp from e.g. 22-09-2008?


I am working on my masters thesis and I am trying to reach as many software developers as possible with a survey concerning testing for software vulnerabilities. Is it acceptable to post such a survey on stackexchange? If so which stackexchange site would be the best place to post it?

Stuff like polls, recommendations based on subjective constraints, puzzles, webcomics etc. do not belong on the serious main SE sites, where professionals should be considered at work and having just a few spare minutes ("code's compiling") to answer questions, so they should not be distracted by such things. However, I'd also like to have a home for these things still using the SE engine. For the reason I mentioned before, this needs to be a separate place though. Let's call it four.[sitename-here].com.


I’m new to this but I’m having issues with my camera, a canon rebel eos t3i, sadly it got splashed by saltwater (not even fully submerged) but it wouldn’t turn on for a few days. I read that the chances of it working ever again were slim but today I put in a battery and it turned on and seemed fine until I went to take a picture. It says it is error 70, and that I should turn the camera off and on again and reinstall the battery but that didn’t work. Does anyone know if I would be better off shipping it in to get serviced or if it would be cheaper to just replace it. I heard that repairs an quickly add up and I wouldn’t want to do that if it’s gonna end up costing more than a replacement. Let me know if you have any suggestions, thanks!  Edit- I just found out that canon no longer offers service for this model camera so that narrows down my options

I have had a Nikon d750 for a year or so, and 6 months ago it took on a bit of saltwater damage. It still works, but twice in the past it wouldn't power on, once for two weeks and once for two days.   Now it is at a point where it takes around 5 minutes to power on, and when i switch the camera to 'off' or standby, it completely powers off as if the battery drops out, then it takes another 5 mins or so for it to power back on, if it does at all. So I have switched the standby timer in the settings to 'infinity' so it just stays powered on.  I am taking it in to have it looked at, I just hope the damage isn't too fatal. I wonder if anyone has experienced anything similar to this, or can help me diagnose the actual problem. I have tried different batteries, and everything else possible really. Camera itself works fine, just power issues.  thanks in advance.


I have two different folders in my directory with the following permissions:  file x: drwxr-xr-x 2 , file y: drwxr-xr-x 5. What is the permission difference between these two folders? why one has number 2 and the other 5?

The output of ls -l command yields the following result:    What is the number field between file permission and owner? i.e. what are those 1, 1, 1, and 2? I checked the --help but that doesn't explain it.  [EDIT]  I thought it was the number of files in a directory but it isn't. See image. "tempFolder" has 3 files but still show a "2"


Our stack: backend: flask + nginx frontend: android, ios firebase cloud messagng for push message  We often discover bugs after fcm-related feature update. users report the bug with angry face :( We know that is not so good in terms of user experience. we need a way to catch the bug before we release it to actual product. first, let me give an example.  For instance, a user(named Fred) post a article, other users who subscribing fred should receive a notification message but after the release, we found that users who are using iphone are not receiving push message. (android was fine)  we couldn’t find the bug because back then we tested with a few android device which our developers have.  after that, we bought an iphone test machine but we don’t think that will suffice. we are desperated to expand our test coverage.  we are looking for a way to build a virtual test environment which simulates thousands of device receives push messages. so that we could test without sendng message to actual user.  currently looking firebase test lab. but I appreciate any Insights.

How can you beta test an iPhone app?  I can get it on my own device, and anyone that gives me a device, I can run it on theirs, but is there a way to do a limited release via the app store for beta testing?  Related: Also, see  on getting your app onto phones without using the App Store.


Give an example of fields $k \subset K \subset L$ and $l \subset 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$.  Difficulty in figuring out an example.

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.


I'm trying to use an array and a curve modifier to create a simple track along a single bezier curve.    I've run into a small issue though when I try to have the path curve around a corner while also lowering elevation at the same time:      After the sloped turn completes and straightens out, the path becomes tilted despite all control handles having 0 tilt:    After this point, the tilting remains along the path unless I manually tilt in the opposite direction to offset but I don't like this since it seems incorrect and I don't know an exact number to use as a tilt offset.  Tilting doesn't occur if the turn is made while keeping the control handles at the same z-axis height:    How can I ensure the path is always facing straight up along the z-axis (unless I add tilt)?

I have attempting to make a fin tube for two days and it is killing me.  Fin tubes are pipes that have a tight spiral of flat fins sticking out all around them. The spiral wraps around the circumference of the pipe. They are used in heat reclaimers among other places.  I made a spiral using the extra shapes add-on and scales pretty tight. And then I set the scale.  I made the fin shape and set its scale. I added the curve modifier and it jumped around a bit. I set its origin point to one end face and finally got it going the right way off the beginning of the curve.  Then I added the array modifier and moved it to the top  of the stack. It all looked good for the first loop, then the fins started to tip. The outside edge aimed upward steadily as the inside edge seemed to continue to be oriented at the center base of the curve.  How can I keep the darned things at 90 degrees to the z axis? Or should I be using a particle system? I haven't learned that one yet, sigh.


We usually write something like           \includegraphics{image}   instead of:  \includegraphics{image.png}     That is, \includegraphics does not usually require a file extension such as .png .pdf .jpg, etc... That is,  Suppose that I have all of the following files in the same directory. Which file will \includegraphics embed?  my_pic.jpg my_pic.psd my_pic.png my_pic.pdf my_pic.jpeg my_pic.gif   Document:  \documentclass{minimal} \begin{document} \begin{figure}[htpb]   \centering   \includegraphics[width=\linewidth]{my_pic}    \caption{Sunshine and Rainbows}   \Description{summertime} \end{figure} \end{document}

When using 's \includegraphics you can specify the file extension or not. For generic use and perhaps portability, extensions are commonly dropped. The types of "approved" inclusions and their order of precedence depends on the driver/compiler being used. What are these driver-defaults?  Related:


The SE network serves adverts for revenue, but they have been kind enough to make them non-obtrusive and on-topic. I have actually found 2 tools that I now use in production via these adverts. So kudos!  But, sometimes what happens is that you notice an interesting advert just as you hit refresh and then it is gone. Or you are on a new browser instance/machine and forgotten to turn the ad-blocker off.  Why not have a list of the adverts somewhere and searchable. I know I wouldn't mind looking at it once in a while. You will also get some additional click-through revenue from there.  Again it is non-obtrusive and a user has to navigate to and thus opt-in to view the page - so no harm done.

nhj asked the other day,  In , I wrote:     We were thinking of putting together a "sponsor gallery" of sorts that listed out all of the sponsors with a brief description. Kinda in the vein of what we have on the every-now-and-then  at TDWTF.   So, consider this the discussion for that topic.   What would you like to see in a sponsor gallery? Should it be one big, long list? How does the order get determined? Should we organize the sponsors based on tags (and if so, what about sponsors who target like java and .net)? What about former sponsors... do they get removed from the list, or go on like the "past sponsors" section/page?  Keep in mind that this is not something we intend to charge extra for... this is more a service to the you, the members, than anything else. I've gotten postive feedback from the TDWTF "gallery", as a lot of readers come through RSS, have adblock running, etc.


I gave "network profile" link  but it says that is not correct. where do I get profile link?

I accidentally posted a question without being logged in. Is there a way to associate that question with my account?   For more information, visit "" in the .   a.k.a. How can you link a registered account to a cookie-based account? a.k.a. How do I merge an unregistered account with a registered account a.k.a. Merging users a.k.a. How do I associate anonymous questions I’ve asked with my registered account? a.k.a. Is there a way to claim an unregistered user? (in case anyone searches with those terms)


I have an old Alienware computer that I found in storage. It has Ubuntu 11.04 installed on it and I really would like to update to the most recent Ubuntu.  I am not Computer savvy when it comes to terminals and commands.  I don't know what to do.  All I want is to have my son able to watch Youtube but Flash won't install.  Nothing will install, I keep getting Fetch errors or failed to fetch.  I can't download Chrome website, because it says check Internet... Internet is fine. I don't understand what is going on or how to fix it?

What are the different ways I can use to upgrade Ubuntu from one release to another?


My opponent cast , which says "Destroy target tapped creature". In response, I cast , which says "Untap target creature. It gets +2/+2 and gains reach until end of turn. (It can block creatures with flying.)"  Does my creature gets destroyed? I think not because of the stack, being my spell was the last to be cast.

When you have a card like  which reads "Exile Target Creature with power 3 or less", as I understand it, it becomes untargetable if the opponent's creature power increases thanks to a pump spell like .  But what if the Disregard is already on the stack and targeting; and they respond with Brute Strength? I'm pretty sure (and my opponent with Brute Strength was certain) that it won't exile the creature, but I don't know which rule states this, and there's no gatherer ruling on the spell.


<apex:repeat value="{!Accountlab}" var="acclab">        Delivery Date for Supplies :<b>{!acclab.Delivery_Date_for_Supplies__c} </b>     </apex:repeat>  By using above code im getting "Fri Apr 16 00:00:00 GMT 2021" but i need  "April 16,2021"

I need this date format in a visualforce page: "December 14, 2013". I can't seem to find the format options for visualforce. I read that it's the same as the java messageformat class options, but I cannot find a list for that either.  A little help would be much appreciated


I'm new to Java and i decided to experiment, however I'm having hard time trying to understand what is the problem. What my program is supposed to do is to receive login and login2, password and password2, and if they match then program says "You may enter", if not then program says "You may not enter", however, it says it even when login and login2, password and password2 are the same. Any ideas what to do?  public static void main(String args[]) {     Scanner input = new Scanner (System.in);     System.out.println("In order to register type your login");     String login = input.nextLine();     System.out.println("And password");     String password = input.nextLine();      System.out.println("Enter Login");     String login2 = input.nextLine();     System.out.println("Enter password");     String password2 = input.nextLine();       if (login == login2 && password == password2){         System.out.println("You may enter");     }     else{         System.out.println("You may not enter");     } }

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


I like using my Macintosh to read things, but Ubuntu is really growing on me. I want to be able to have my computer read aloud to me without booting up my Mac.  Is there a way to do this without installing any third party programs?  If not, could you reccomend something as light weight as possible? Some of the answers I found involved running the program at start-up. I'd prefer not to have the program running until I want to use it.

Are there specific configurations and packages that could help blind people to use Ubuntu?  Blind people do use computers, and Ubuntu should be accessible to everyone.  It would be interesting to have the testimony of a totally or partially blind person who uses Ubuntu sharing their experience.   (Using Ubuntu 16.04, but I'm open to other Linux distributions)


I have researched for 30 mins to solve my problem without success... I want to have an image that always stays on the bottom right of some text but have part of the text to its left so that it always ends at the image's bottom.  I tried floating the image but it only stayed on the right, while the text was entirely on top of it. I don't want to put the image somewhere in the text, so that it comes up to this alignment. I want to somehow accomplish this by having this alignment of the code at all times :
Random text prevailed sincerity behaviour to so do principle mr. As  departure at no propriety zealously my. On dear rent if girl view.  First on smart there he sense. Earnestly enjoyment her you resources.  Brother chamber ten old against. Mr be cottage so related minuter is.  Delicate say and blessing ladyship exertion few margaret. Delight  herself welcome against smiling its for. Suspected discovery by he  affection household of principle perfectly he.
      Here's an example :

Every time I try to do something seemingly-simple in CSS, it doesn't work.  I have a content div that contains a 460x160 image. All I want to do is position the image at the bottom-right corner and wrap my text around it.
          text text text text text text ...
   So I want it to look like:  ------------------ | text text text | | text text text | | text text -----| | text text |    | ------------------   Doing it with a top-left or top-right image is cake:  #contents img { float:right; }  ------------------ | text text |    | | text text -----| | text text text | | text text text | ------------------   Now how do I push that to the bottom? The best I've come up with so far are:  #contents img { float:right; margin-top: 90%} // really needs to be 100%-160px  ------------------ | text text      | | text text      | | text text -----| | text text |    | ------------------   In this case the text does not print in the margin, so there is white space above the image.  #contents { position:relative; } #contents img { position:absolute; right:0; bottom:0; }  -or-  // move the img tag under the text in the html and: #contents img { float:right; margin-top:-160; }  ------------------ | text text text | | text text text | | text text -----| | text text | te | ------------------   In this case the text prints over or under the image.  So... how can I accomplish this?


I want to perform multiple apt operations, llike sudo apt install ubuntu-gnome-desktop in one terminal and sudo apt remove lubuntu-desktop in another terminal. When I try to do this I get this (Please don't ask me why I had installed these desktops; I had done so many experiments on Ubuntu that I had to reinstall it many times due to breaking the system)   $ sudo apt autoremove  E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)  E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?   I can do only one operations in at one time with apt!!  I know that it is not safe to break lock but I will take all risk on my own!!  My question is not a duplicate of  as i want to know about how to do in multiple terminals. I know these ways apt install package1 package2 and apt install package1 && apt remove package2. If do this apt install pack1 && apt remove pack2 then I have to wait a long time for pack1 to install.  Also will it work if I break the lock?

When I install Ubuntu, the first thing I usually do is remove some programs and install some others. To get that done, I enter the following in a terminal:  sudo apt-get remove applicationA applicationB applicationC && sudo apt-get install applicationX applicationY applicationZ.  This works nicely, but the problem is that I have to confirm twice: first I have to confirm the removal of the applications, and after some time I have to confirm the installation of the others. It would be great if I only had to confirm once, because I wouldn't have to come back to the computer in the meantime. Is there any command to get that done?  Please note that I'm not looking for workarounds in e.g. Synaptic Package Manager. I want to do this from the command line.  Thanks.


I am trying to make a chest that is called 'I' that has another chest inside called 'II' that has another chest inside called 'III' that has another chest inside called 'IV' that has another chest called 'V' that has a piece of paper called 'An important message...' and it has a lore saying      自分自身を解放する方法があります。呪文はもう一度私たちの魂を得る。しかし、我々はそれを話さなければならない - 私たちは話すないとき - 音が出ないを。我々は、すべての耳が聞こえています。だから、失敗は避けられない。そして、私は今まで私の中の悪魔で、私の内部賭けに入る後悔。不滅か。魂のひったくり。ジェイク対ゲイリー·クルック。野望は過大評価され。   I keep getting 'Unbalanced Curly Brackets' every time I try use this command. I checked with Notepad++, I'm pretty sure the curly brackets are right? Here's the command below, but what am I doing wrong?  /setblock ~ ~ ~ chest 0 replace {Items:[{id:54,Count:1,Slot:13,tag:{display:{Name:"II"},Items:[{id:54,Count:1,Slot:13,tag:{display:{Name:"III"},Items:[{id:54,Count:1,Slot:13,tag:{display:{Name:"IV"},Items:[{id:54,Count:1,Slot:13,tag:{display:{Name:"V"},Items:[{id:339,Count:1,Slot:13,tag:{display:{Name:"An important message...",Lore:[自分自身を解放する方法があります。呪文はもう一度私たちの魂を得る。しかし、我々はそれを話さなければならない - 私たちは話すないとき - 音が出ないを。我々は、すべての耳が聞こえています。だから、失敗は避けられない。そして、私は今まで私の中の悪魔で、私の内部賭けに入る後悔。不滅か。魂のひったくり。ジェイク対ゲイリー·クルック。野望は過大評価され。]}}}]}}}]}}}}],display:{Name:"I"}}}

Often, when making a command block contraption, you need to set an entity's data tag. These tags can sometimes be very long, with many layers of nested curly and square brackets. For example, this is the command to summon a villager with a single custom trade:  /summon Villager ~ ~ ~ {Profession:3,Career:2,Offers:{Recipes:[{buy:{id:minecraft:diamond,Count:6b}},sell:{id:minecraft:diamond_hoe,tag:{ench:[{id:16s,lvl:10s}]}]}}   The single-line command block interface of Minecraft makes it incredibly difficult to find and fix errors, especially when it comes to mismatched brackets. In fact, for illustration purposes, I put an error in the above command.  What techniques can I use to find and fix unbalanced square or curly brackets when writing long and complicated data tags?


Please give an example of a cyclic group having only one generator. The only example I can think of is the trivial group, leading me to think I cannot find another example? If such a group doesn’t exist please state an explanation.

Let $G$ be a non-trivial cyclic group with an unique generator. Show that $G$ has exactly two elements.   Let $g$ be a generator of $G$. My first idea to approach the problem was to show that if $|G|=n > 2$ then there is an integer $k$ between 1 and $n$ such that $\langle g^k \rangle = G$ or, equivalently, $g \in \langle g^k \rangle$. My second idea was to analyse the problem in 2 separate cases. For the first one, if $n$ is prime, let $k$ be a positive integer then, by Lagrange's Theorem, $|g^k| \mid n$ and, therefore, $\langle g^k \rangle = n$. Hence, we must conclude that, if $n > 2$ the generator cannot be unique. For the second case, where $n$ is composite, I was hoping to get to a contradiction, but could not advance any further. Is there a way to develop either of these ideas or is it necessary a new approach?


I would like to know how to add arguments to commands.  I would like it to be somewhat like this:  $ arg --test   'arg' would be the main command and '--test' would be the argument.

I am new to bash script programming.  I want to implement a bash script 'deploymLog', which accepts as input one string argument(name).  [root@localhost Desktop]# ./deploymLog.sh name   here I want to pass the string argument(name) through command line   As an initial step, I need to append the current timestamp along with this input string to a log file say Logone.txt in current directory in the below format:  [name]=[System time timestamp1]   How it is possible?


This is Spivak's Calculus on Manifolds ex. 2-25, he says     Define $f:\mathbb{R}\to \mathbb{R}$ by $f(x) =  \left\lbrace   \begin{array}{l}      e^{-x^{-2}} &\text{ if } x \neq 0\\      0 &\text{ otherwise } \\   \end{array}   \right.$. Show that $f$ is $C^{\infty}$ anf $f^{(i)}(0)=0\; \forall i$.   I haven't found a way to get a general solution. I only managed to prove:  $(1)$ $f$ is continuous at $0$.  This follows from $f(0)=0$ and $\lim_{x\to0} f(x)=\lim_{x\to 0}e^{-x^{-2}}=\lim_{x\to 0}\displaystyle\frac{1}{e^{1/x^2}}=0$ since $\displaystyle\frac{1}{x^2}\to+\infty$ if $x\to 0$ then $e^{1/x^2}\to+\infty$ if $x\to 0$, which means that $\displaystyle\frac{1}{e^{1/x^2}}\to 0$ if $x\to 0$ .  $(2)$$f'(0)=0$.  I got this by calculating the limit $f'(0)=\lim_{h\to 0}\displaystyle\frac{f(0+h)-f(0)}{h}=\lim_{h\to 0}\displaystyle\frac{f(h)}{h}=\lim_{h\to 0}\displaystyle\frac{e^{-h^{-2}}}{h}=\lim_{h\to 0}\displaystyle\frac{1/h}{e^{h^{-2}}}$.  The last one follows from L'Hôpital: $\lim_{h\to 0}\displaystyle\frac{\frac{d}{dh}(1/h)}{\frac{d}{dh}(e^{h^{-2}})}=\lim_{h\to 0}\displaystyle\frac{(-1/h^2)}{(e^{h^{-2}})(-2h^{-3})}=\lim_{h\to 0}\displaystyle\frac{h}{2e^{h^{-2}}}=\displaystyle\frac{1}{2}\left(\lim_{h\to 0}\displaystyle\frac{1}{e^{h^{-2}}}\right)\left(\lim_{h\to 0} h\right) = 0$.  $(3)$ $f''(0)=0$  I found that $\displaystyle\frac{df}{dx} =  \left\lbrace   \begin{array}{l}      2x^{-3}e^{-x^{-2}} &\text{ if } x \neq 0\\      0 &\text{ otherwise } \\   \end{array}   \right.$, then  I can get $f''(0)$ computing the limit $\lim_{h\to 0}\displaystyle\frac{f'(0+h)-f'(0)}{h} = \lim_{h\to 0}\displaystyle\frac{f'(h)}{h} = \lim_{h\to 0}\displaystyle\frac{2e^{-h^{-2}}}{h^4}= 2\lim_{h\to 0}\displaystyle\frac{1/h^4}{e^{h^{-2}}}=-2\lim_{h\to 0}\displaystyle\frac{-4h^{-5}}{-2h^{-3}e^{h^{-2}}}\\=4\lim_{h\to 0}\displaystyle\frac{1}{h^2e^{h^{-2}}}=4\lim_{h\to 0}\displaystyle\frac{h^{-2}}{e^{h^{-2}}})=-4\lim_{h\to 0}\displaystyle\frac{-2h^{-3}}{e^{h^{-2}}(-2h^{-3})}=-4\lim_{h\to 0}\displaystyle\frac{1}{e^{h^{-2}}}=0$, after using L'Hôpital twice.  But still I don't have a clue to prove that $f^{(i)}(0)=0$ for every $i$. One of the ideas I managed was to find a general form for $f^{(i)}$ but after I got $f'$ doesn't seem possible to do so considering that I would have to apply the product rule each time.

Let $f:\Bbb{R}\to\Bbb{R}$ be a function given by  $$f(x)=\begin{cases} \exp\left(\frac{1}{x^2-1}\right) & \text{if }\vert x\vert\lt 1\\  0 & \text{if }\vert x\vert\geqslant 1  \end{cases}$$  I would like to prove that $f\in C^\infty$, that is, $f\in C^k$ for all $k\in \mathbb{N}$. I think that it can be done by induction on $k$. If $\vert x\vert\gt1$, the problem is trivial. On other points, the base case is the simplest and the only that I'm be able to do. Can someone help me?  Thanks.


Compute $I=\int_0^2\frac {\arctan{x}}{x^2+2x+2}dx$   My 2 attempts:  First:  We observe that $\frac {1}{x^2+2x+2}=\frac {1}{(x+1)^2+1}$ and $\frac 1{(x+1)^2+1}=(\arctan{(x+1)})^{'}.$ Then:  $$\int_0^2\frac{\arctan{x}}{x^2+2x+2}dx=\int_0^2\arctan{x}(\arctan{(x+1)})^{'}dx=\left.\arctan{x}\arctan{(x+1)}\right|_0^2-\int_0^2\frac{1\times\arctan{(x+1)}}{1+x^2}dx=\left.\arctan{x}\arctan{(x+1)}\right|_0^2-\int_0^2\frac{(1+x^2-x^2)\times\arctan{(x+1)}}{1+x^2}dx=\left.\arctan{x}\arctan{(x+1)}\right|_0^2-\int_0^2\arctan{(x+1)}dx-\int_0^2\frac{x^2\arctan{(x+1)}}{1+x^2}dx$$  Where the second integral is pretty easy to solve using integration by parts but the second one is not very pleasant so... I thought I should try something else.  Second attempt:  Let $u=\arctan(x+1)$ then $x=\tan u-1$ then $$I=\int_{\arctan1}^{arctan3}\arctan{(\tan u -1)du}$$  then I could let $w=\tan(u)-1$ then $dw=((w+1)^2+1)du$... but it's a lot of work and I really think you can do this more easily...  Any hints?

I am tring to evaluate $$I=\int_0^2 \frac{\arctan x}{x^2+2x+2}dx$$ The first thing I did was to notice that $$\frac{1}{x^2+2x+2}=\frac{1}{(x+1)^2+1}=\frac{d}{dx}\arctan(x+1)$$ So I integrated by parts in order to get $$I=\arctan 2\arctan 3-\int_0^2\frac{\arctan(x+1)}{1+x^2}dx$$ I let $x=u+1$ but when I do that I get $$I=\arctan 2\arctan 3+\int_{-1}^1\frac{\arctan(u)}{1+(1+u)^2}du    =\arctan 2\arctan 3$$ Now this is not close to the approximation given by wolfram. What have I done wrong and how to solve this?


I'm setting up collision detection for my enemy objects and projectile. When I add the detect collision script below, my enemy object just disappears. Projectile has the same detect collision script and also disappears. I get this error code: NullReferenceException: Object reference not set to an instance of an object MoveForward.Start () (at Assets/Scripts/MoveForward.cs:16) This is a copy of my prefab settings for enemy object:  I'd appreciate any advice. Thank you Detect Collision Script using System.Collections.Generic; using UnityEngine;  public class DetectCollision : MonoBehaviour {   // Start is called before the first frame update   void Start()   {    }    // Update is called once per frame   void Update()   {    }    private void OnTriggerEnter(Collider other)   {     Destroy(gameObject);     Destroy(other.gameObject);   }  }   Move Forward Script using System.Collections; using System.Collections.Generic; using UnityEngine;  public class MoveForward : MonoBehaviour {   public float speed = 20f;   public GameObject Trump;   public GameObject Player;   private Rigidbody enemyRb;   // Start is called before the first frame update   void Start()   {     enemyRb = GetComponent<Rigidbody>();     Player = GameObject.Find("Player");     this.transform.LookAt(Player.transform);     }    // Update is called once per frame   void Update()   {     transform.Translate(Vector3.forward * Time.deltaTime * speed);            } }

Since many users are facing the NullReferenceException: Object reference not set to an instance of an object error in Unity, I thought that it would be a good idea to gather from multiple source some explanation and ways to fix this error.  Symptoms I am getting the error below appearing in my console, what does it mean and how do I fix it?  NullReferenceException: Object reference not set to an instance of an object


When anonymous users wants to download e.g a PDF file, they must first fill in their email address. What is best way to set this up?

In the Drupal site I'm setting up, there's a Download page containing several links to download softwares.   What is the best way to "bind" the softwares to the page, put them anywhere online and place a direct link in the page?   Does anyone know a module that would show a contact form when a user clicks one of the "Download" buttons, preventing him from downloading unless he properly completes the form?  Our goal is to receive the contact information of any person downloading our software.


Short story where man is in a dream world or a world that is not quite real, his thoughts can become true.  He is either a prisoner or a subject of an experiment, in a sandy arena facing a monster.  To save himself he remembers his Dad's Colt .45 auto and shoots the monster.  This is probably from the fifties or early sixties.  I think that he was from the South and when he was thinking he contrasted the Colt .45 to the .22 rifle he hunted with, his father had brought it back from World War Two and as part of his conjuring it up he remembers being allowed to shoot it when he was a young boy and how heavy and noisy it was; at that point it appears in his hand and he shoots the monster.

This is a short story, I think, but I might be wrong.  A man is recruited to enter an authors' dreams to try & bring him out of a coma & finds himself in a hackneyed barsoom type world where the coma victim is a muscle bound hero, it's a desert world with two suns, the damsel in distress is the typical scantily clad princess trope.  The "hero" basically spoils the authors' dreams by manifesting a pistol & simply shooting the monsters dead at one point & the author tries to write him out of the "story" by simply jumping forward several chapters & is both surprised & peeved to find him still there.  The author eventually comes out of his coma & immediately assaults the man when he recognizes him from his dreams, he tries to strangle him if I remember right.  He enters the authors' dreams with some kind of experimental dream imaging tech, basically a two ECG sort of set up linked through a computer with him put to sleep with drugs I think.


Can U tell me what are the advantages and reasons of using GET method in php?  Why even use it if there is POST? Why do some websites use both GET and POST at the same time?  Can U name main reasons? cheers

What's the difference when using GET or POST method? Which one is more secure? What are (dis)advantages of each of them?  ()


This story Starts out like the standard "Planet of the Apes" routine: Space voyagers from Earth get caught in some sort of warp and return to a recognizable Earth, but the civilization they knew is long gone. In this story, however, all macro biological life has disappeared completely, to be replaced by a wilderness of feral machines, many of them replicating the standard biological forms: amulatory predators/prey (analogous to animals), sessile energy accumulators (like plants), even sea "creatures". Some predators are able to use parts of their prey directly, although most incorporate some kind of smelter or other recycling feature that allows them to mine basic materials from prey. Explosives are part of the repertoire of prey defenses, hinting that some of this may have been kicked off by humans tinkering with autonomous machines meant for warfare. I think it was by a well-known SF author, like, say, Robert Silverberg.  I believe it dates back to the 1980s, could have encountered it in a collection of older stuff, but it's definitely post-60s, as integrated chips are mentioned explicitly as a resource.

Read a story once about earth being abandoned for long periods of time. Upon the return of man to earth all life forms, flora and fauna, have evolved into intricate electronic forms of themselves.   Would like to find that story and it's name.


I have some records in MYSQL database with domain name, Now i changed domain and i want use query for find these word example.com in record column and then change to example.net.  I think if column only include domain, it's very easy but my records include domain name and some text. Like this:     it's a sample text www.sample.com and i want change it   I have some recorde like above and i want find every recorde that have sample.com text and then change it to sample.net

What MySQL query will do a text search and replace in one particular field in a table?  I.e. search for foo and replace with bar so a record with a field with the value hello foo becomes hello bar.


I have supervisor that is handling a queue process that is dependent on Redis being available.  When I restart the server (Ubuntu 18.04) the Redis server is quitting before Supervisor and the queue process spams me with hundreds of errors in Slack because of the missing Redis server.  I need to set Supervisor quit before the other services that are used in the subprocesses of Supervisor so I do not get all these errors. I know it should be in the systemd but haven't done it so far and couldn't find a good way to find it in Google.

Suppose I have a.service which I cannot modify, and b.service which I can modify, I want to see this stop order:  Stopping b.service ... Stopped b.service Stopping a.service ... Stopped a.service   instead of this:  Stopping b.service ... Stopping a.service ... Stopped b.service Stopped a.service   Assume that b.service may take at least 20 seconds to finish.


values = []          records =  contains two records of different person         values.extend((records.name, records.age , records.gender))  print values   This will print [some_name,age,gender , some_name,age,gender]     Expected output : [[some_name,age,gender] , [some_name,age,gender]]   How can I achieve this?

What's the difference between the list methods append() and extend()?


I have a variable that is measured using a 13-item, 4-point Likert scale with the exception of one item (yes $=1$, no $=2)$.  How can I calculate the total score for this variable?

I would like to create a composite scale using items that measure parent communication extracted from a UK panel survey (n=941). However although all 6 variables in question measure similar constructs - 2 of the items are dichotomous (yes/no) the other 4 are likert (1,2,3,4). My intention is to transform the 6 variables to z scores and then sum them to form the composite score which will be used in a path analysis.  I need to know if it is correct to do this, i.e., merge dichotomous variable (yes/No) and Likert scale (1,2,3,4) after they have been standardized to z scores.    Pending this being ok, would it be necessary to do an exploratory factor analysis to ensure the the composite scale measures one underlying construct or it is enough to do a reliability analysis?  This analysis is forming part of my PhD so I need to defend what I am doing and I would appreciate any guidance anyone can give me.


Severity    Code    Description Project File    Line    Suppression State Error   LNK2019 unresolved external symbol "class AMD<int,class std::basic_string<char,struct std::char_traits,class std::allocator > > * __cdecl Search_Author(int)" (?Search_Author@@YAPAV?$AMD@HV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@H@Z) referenced in function "class AD<int,class std::basic_string<char,struct std::char_traits,class std::allocator >,float> * __cdecl Create_AD<int,class std::basic_string<char,struct std::char_traits,class std::allocator >,float>(class std::basic_string<char,struct std::char_traits,class std::allocator >)" (??$Create_AD@HV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@M@@YAPAV?$AD@HV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@M@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)  test    C:\Users\Admin\Desktop\with templates\test\test\test.obj    1 I am implementing a soundcloud music database system using linked list C++.The google test cases of the code pass perfectly without templates. But I need to do it with templates and this is the error I am receiving while doing it with templates. Any suggestions?

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


I'm curious as to whether there is a convenient way to push updates to multiple Ubuntu servers from a central location instead of remoting into each one individually and manually updating them. Bonus points if this central location would be able to reboot the systems if needed due to updates.

Recently I got in charge of managing 2 computer labs (currently 35 workstations, could double in a month or two) in university with total control over software stack as long as I install a bunch of commonly used scientific software (Mathematica and friends).  I plan to use Ubuntu for various reasons.   Installing Ubuntu and managing updates etc by hand is certainly an option, But I want to know if there is a more efficient way to do this stuff in and a more "Don't Repeat Yourself" manner?  Tasks   Ubuntu installation Installation (duplication) of same software stack and configuration over each workstation Keeping them updated


I am writing a unit test to verify that both the ISO8601Utils (deprecated class which I replaced with SimpleDateFormat) and SimpleDateFormat has the same format.  My class:       public static class ISO8601DateFormat extends DateFormat {      public static final long serialVersionUID = 3549786448500970210L;      public ISO8601DateFormat() {}      @Override     public StringBuffer format(Date date, StringBuffer       toAppendTo, FieldPosition fieldPosition) {         DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-         dd'T'HH:mm:ss.SSS'Z'");         String value = dateFormat.format(date);         //This used to be ISO8610Utils.format(date, true) which           //is now deprecated and I replaced it with the new one. I           //want to verify this part so that the newly replaced          //dateFormat still returns the same formatted output as the          //ISO8610Utils          toAppendTo.append(value);         return toAppendTo;     }      public Date parse(String source, ParsePosition pos) {         pos.setIndex(source.length());         return ISODateTimeFormat.dateTimeParser().parseDateTime(source).toDate();     }      public Object clone() {         return this;     }      public String toString() {         return this.getClass().getName();     } }   My test method:    @Test     public void testDateFormat() {      df = new DefaultHttpClientUtil.ISO8601DateFormat();      Date date = new Date();      //df.setTimeZone(TimeZone.getTimeZone("GMT")); I'm getting NPE         for this line      assertThat(df.format(date)).isEqualTo(ISO8601Utils.format(date,      true));   }   However, I am getting null pointer exception for the commented line. I assume it has to do with injecting or mocking object, but I am not sure how I should approach this problem.

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


I'm having a bit of trouble understanding the definition of the infinite cartesian product, particularly with the intuition behind it.  According to my textbook, Enderton's Elements of Set Theory, the infinite cartesian product takes the cartesian product of each set $X_i$ for $i \in I$. This idea makes sense to me, but the definition of $$\prod_{i \in I} X_i = \left\{\left. f: I \to \bigcup_{i \in I} X_i\ \right|\ (\forall i)(f(i) \in X_i)\right\}$$ does not.   For example, if I make a function $X = \{(1,\{2\}), (2,\{3\}), (3, \{4\})\}$ where $X_1 = \{2\}$, $X_2  = \{3\}$, and $X_3  = \{4\}$ if I take the cartesian product of them, don't I get $(2,3,4)$? How is this a function and how does it relate to the definition?   I am very aware that my misunderstanding most likely comes from an inadequate knowledge of cartesian products, and that my example may be incorrect. If so, please let me know what misconceptions I may have so that I can grow and learn!

From Tao's Analysis I:    I'm having trouble parsing this {...} expression. I'm not sure about the operator/quantifier precedence, and I'm especially unclear on how to read, and understand, "$(x_\alpha)_{\alpha\in I}$". How do you write this whole expression in prose? How do I make sense of $(x_\alpha)_{\alpha\in I}$?


I added another language to my Windows 8 machine.  In the language options, there is a set of radio buttons titled "Spellchecking Preferences" with the following options:   Full Partial Mixed Mixed Authoritative   My US-English default language does not have this option.  I cannot find what the choices here mean in any documentation.  What do these options do and why do they only show up for some languages?

What's the difference between the Spell check settings in the Language Options of Windows 10 version 1803?  The options I see are as follows:   Full Partial Mixed Mixed Authorized


I am trying to follow the MDN article Introduction to Object-Oriented JavaScript.   In there it defines a constructor as:  var Person = function(firstName) {   this.firstName = firstName; }   and  function Student(firstName, subject) {   // Call the parent constructor, making sure (using Function#call)   // that "this" is set correctly during the call   Person.call(this, firstName);    // Initialize our Student-specific properties   this.subject = subject; }   Why is the Student constructor not defined as:  var Student = function(firstName, subject) {   // Call the parent constructor, making sure (using Function#call)   // that "this" is set correctly during the call   Person.call(this, firstName);    // Initialize our Student-specific properties   this.subject = subject; }

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


How to change the bracketed references at the end of an article to parenthesis, i.e., [1] to (1). The journal in question wants (1) at end of the article not [1] which I get with latex \article.

The editor asked me to use the following format.      Reference   1. Author, blah blah   Instead of      Reference   [1] Author, blah blah ...   Even though in the main text, [1] style has been used.   For example,        Smith [1] has proposed ...      Reference   1. Smith,      This is what I want.   Could you please advise how I can do the above?  Thanks in advance.


I have a Tomcat behind an Apache server and I would like to use the https request to be rewritten to the Tomcat on port 9001 with a hidden subfolder /test.  hosts entry:   127.0.0.1 local.domain.com   I tried the following in different configurations in the httpd.conf but with no success:  VirtualHost 127.0.0.1:80  RewriteEngine on RewriteCond %{HTTPS_HOST} ^(www\.)?local\.domain\.com$ [NC] RewriteCond $1 !^subdir/ RewriteRule ^(.*)$ https://local.domain.com:9001/subdir/$1 [L,QSA]

This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.


What is the default range in slicing: For example: ls = [1, 2, 3, 4, 5] ls[-3::1]  #returns copy of the elements at indexes -3, -2, -1 ls[-3::-1] #returns copy of the elements at indexes -3 till the start of the list i.e ls[-5] ls[::-1]   #returns copy of the reverse version of the list ls[::1]    #return the list as is  What is the idea behind that? How does python determine unstated start and end indexes?

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


I want to settle down, and my friend says i can get a daughter and stuff, how do I?  PS.Is there jobs? Like, not quests, but actual jobs?  PPS.I dont have acces to any of the DLCs.

Is it possible to have children in Skyrim?


Is the set of all polynomials of degree at most 3 with integer coefficients a subspace of Pn (for n >= 3)?  Im thinking no, for the set in question has polynomials with degree 3 and below while Pn seems to contain 3 and above, at least that is how I interpreted the question. I appreciate it!

Definition. A subspace  of a vector space V is a subset H of V that has three properties  (a) The zero vector of V is in H.  (b) $\forall$ u, v $\in H$, we have  u + v $\in H$.   (c) $\forall$ u $\in H$, c scalar, we have c  u $\in H$.  For $n \geq$ 0, denote $\mathbb{P}_n$ to be the set of all polynomials of degree at most $n$.  Which of the following are subspaces of $\mathbb{P}_n$ for an appropriate value of $n$? Support your answer with reason.  (a) All polynomials of the form $p(t) = a + t^2$, where $a \in \mathbb{R}$.  (b) All polynomials of degree at most 3, with integers as coefficients.  Solution:  Both the statements (a) and (b) above are not subspaces of $\mathbb{P}_n$.  Reason:  For part (a), All polynomials of the form $p(t) = a + t^2$, where $a \in \mathbb{R}$, is not a subspace because it failed to meet the standards of the first property stated above, that is, the coefficient of the $t^2$ term is always a 1, therefore the zero vector is not in this subspace of polynomials.    For part (b), All polynomials of degree at most 3, with integers as coefficents is also not a subspace becuase it as well failed to meet the standards of the third property, that is, integer coefficents, when multiplied by a real scalar, will not necessarily be of integer type leading to integer coefficents. Thusly, the resulting polynomial will not be in the subset of polynomials $\mathbb{P}_n$. $\Box$  Can someone please look at this and see if I have the right idea and approach to this question. Thank You


I have connected my USB3 memory stick to computer port. I got 23 MB/s speed while copying to USB memory. But I'm not sure it is connected to USB 3 and not USB 2 port on PC. I'm expecting higher speed. How to know my USB device is connected to USB 3 port on PC on Windows 10 machine?

I have a  external HDD. It has USB 3.0. It flashes blue if you connect it to a USB 3.0 port. If it is a 2.0 port, the light becomes white.  Yesterday, I plugged it in and the light was blue. Now, I plugged it in the same port and the light is white.  Can I somehow detect if the USB port I just plugged in is 2.0 or 3.0? I want to know if there is a problem with the device or the USB port I'm using.  Edit: I'm using Windows 8.1


In Avengers: Endgame, Hawkeye retrieves the soul stone, holding it in his hand (seemingly without difficulty).  However, in previous movies, e.g., Guardians of the Galaxy volumes 1 and 2, it's an important plot point that Quill was only able to handle the power stone because of his heritage (i.e., he's a part lowercase-g god, not pure human).  Question: How is Hawkeye able to handle the soul stone?  I have two ideas, but I don't know if either of these are accurate:   Simply because he was wearing a glove (if I remember correctly).  Although that seems like pittance compared to an infinity stone. The soul stone has effectively "chosen" him because of the sacrifice of Black Widow.  Another human in the same setting would be destroyed.  The infinity stones have minds of their own.   Another possibility is that it's only the power stone that destroys humans on contact, but I don't think that's accurate, as it doesn't match Ego's explanation in Guardians of the Galaxy vol. 2.

I thought that normal people couldn't handle the Infinity Stones without something to control their power?    The main scene that drives this home for me is the end of Guardians of the Galaxy, where Peter Quill, being part eternal, can barely hold one Infinity Stone but in Endgame they treat them as just stones that anyone can hold.  Can this apparent discrepancy be resolved?


As the title says. What's the point of the LTS if I have to update anyway at least every 2 years because the packages aren't updated to new versions and hence quickly contain non-supported versions?

Why are packages in the official Ubuntu repositories older than the latest (upstream) versions from Debian Sid, PPAs, the authors, etc.?


I have a references problem that i can't handle with.  I have a array of strings. - ["String1","String1","String1"]  I am trying to map this array to have new array of objects { name: "String1", disabled: false } etc.  The code for that is:      let teamsWithProperty = teams.map(team => {       let object = {name: team, disabled: false}       return Object.assign({},object)    });   In next step i am creating an matrix of teamsWithPropery array:       for (let i=0; i<numberOfRounds; i++){       this.teamsMatrixForEachRound.push([...teamsWithProperty]);     }   The problem is that when i am trying to change a objects value in for example [0][0] element of matrix all of first elements have changes propery  (this.teamsMatrixForEachRound[0][0]).name = "Example"   I want to change property only of first object in matrix; But im getting:

What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but . I've done things like obj = JSON.parse(JSON.stringify(o)); but question the efficiency.  I've also seen recursive copying functions with various flaws.  I'm surprised no canonical solution exists.


Is there a known "standard" injective function $f: \mathbb{R} \to \mathbb{R} \setminus \mathbb{Q}$? Or actually any injective function, doesn't have to be "standard/simple."

I need to prove that $\mathbb{R}\backslash\mathbb{Q} \sim \mathbb{R} $  Using Cantor-Bernstein, need to show an injection from $\mathbb{R}\backslash\mathbb{Q}$ to $\mathbb{R}$ and from $\mathbb{R}$ to $\mathbb{R}\backslash\mathbb{Q}$.    $\mathbb{R}\backslash\mathbb{Q}$ is a subset of $\mathbb{R}$ so only need to show injection from $\mathbb{R}$ to $\mathbb{R}\backslash\mathbb{Q}$ to complete the proof.    Possible injection: $f:\mathbb{R}\to \mathbb{R}\backslash\mathbb{Q}$ defined as $f(x) = \pi x$ if $x$ is not a multiple of $\pi$; otherwise $f(x) = \sqrt{2} x$.    Not sure if $f$ actually is an injection...


\usepackage[     colorlinks=true     ,breaklinks     ,%ngerman     ]{hyperref} % needed for creating hyperlinks in the document, the option colorlinks=true gets rid of the awful boxes, breaklinks breaks lonkg links (list of figures), and ngerman sets everything for german as default hyperlinks language \usepackage[hyphenbreaks]{breakurl} % benÃ¶tigt fÃŒr das Brechen von URLs in Literaturreferenzen, hyphenbreaks auch bei links, die ÃŒber eine Seite gehen (mit hyphenation). \usepackage{xcolor} \definecolor{c1}{rgb}{0,0,1} % blue \definecolor{c2}{rgb}{0.1,0.1,0.1} % light blue \definecolor{c3}{rgb}{0.3,0,0.9} % red blue \hypersetup{     linkcolor= {c1}, % internal links     citecolor={c2}, % citations     urlcolor={c3} % external links/urls }

If I use  \usepackage[colorlinks]{hyperref}   I get colored links for \cite (not good for printing or even viewing) but table of content looks fine.  If I use  \usepackage[colorlinks=false]{hyperref}   I get \cite  links in black with a colored frame (this looks very good) but the table of content looks strange with extra long boxes.  What are my other options? Can you have two styles in different parts of a document?   How do you make the page numbers in TOC to be the links instead of the section headers?


Sometimes people say:     I am going to visit the Taj Mahal.   But sometimes:     I am going to visit Taj Mahal.   What is the difference between these two sentences?  The definite article becomes confusing to me at times. Could you please help me how it is used in general?

With proper nouns, we don't use the except for river names, newspaper names, etc.  I want to know why we use the with White House. I mean, under which rule can we categorize it? What could other similar examples for that rule be?


I have comcast xfinity cable coming into my house.the cable runs to a comcast supplied router.On the back of the router are 4 ethernet jacks. I am running my 2 computers using wifi. I am using a CAT5 ethernet cable from the back of the router connected to a PS4 game located about 50 feet away from the router. I want to know if I can split this one ethernet cable so that I can then connect the PS4 game with one ethernet cable on one TV and run another ethernet cable to a different TV and plug into a blu-ray player. Thanks

I have one ethernet cable that runs into my TV cabinet. It comes from a router in my closet. The router splits the main feed into the home into six runs that run through out the house. I now have several components in my TV cabinet that work best if they are connected to a hard line and not WiFi. Can I split the one cable in my TV cabinet into three or four lines to run to these other components, i.e.: playstation, Receiver,TV antenna box etc. If so, what items do I need to purchase? Thanks for your help.


I would like to load geometries in any format into a predefined box and take pictures around that box. How can I make sure that the object I am importing is scaled in an appropriate manner? Side note: I am trying to force the scaling as the camera is always focused on the cube which ensures the object is always captured appropriately.

I'm having issues with an obj file I've imported into Blender. At first I thought the import was broken in some way because the import would go smoothly, but there was no model to be seen. Eventually I figured out that I could snap my view to the object by pressing . on the numpad and it was in fact there, just extremely small or large (I can't tell). I've tried scaling, but the sizes are so extreme that it doesn't seem to be working. Also due to the extreme nature of the object I can only see certain parts of it at a time depending on the angle in which im viewing it at it starts to de-render the parts not directly in front of the camera.


I have a running command that should take about 10 days. As the process is search files in all subdirectories and converting videos. To each video comand line found, the system changes the process number.  This is the line I'm running:  find . -exec ffmpeg -i {} -vf scale=1280:720 -vcodec libx264 -crf 30 -b:v 300000 {}_250.mp4 \;   How can I do to quit the SSH session and leave some current command line running normally?  I'm already on day 2 and my fear is that my connection will be interrupted simply and I lose all this time.

..and then still be able to return to the same session/screen after restarting the terminal machine. I've tried screen but once I restarted my computer screen -d showed no sessions. Nohup seems to be what I want, but then I lose the ability to see the output later on, other than by saving it to a file. Cannot I pretend more?