This is my program for stack implementation using linked list. But I keep getting a java.lang.NullPointerException at line number 31, i.e. the pop function. Why is this happening and how can I correct it?    import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner;   public class StackImplementtionLinkedList  {     private Node first= null;      private class Node     {         String item;         Node next;     }      public boolean isEmpty()     {         return first==null;     }      public void push(String item)     {         Node old= first;         first= new Node();         first.item= item;         first.next= old;     }     public String pop()     {         String item= first.item;         first= first.next;         return item;     }     public void printStack()     {         while(first!=null)         {   System.out.println(first.item);             first= first.next;         }     }      public static void main(String[] args) throws FileNotFoundException     {         StackImplementtionLinkedList stack= new StackImplementtionLinkedList();         String filename= "myfile.txt";         File textfile= new File(filename);         Scanner input= new Scanner(textfile);         while(input.hasNextLine())         {             String line= input.nextLine();             stack.push(line);         }         input.close();         stack.printStack();         String popped= stack.pop();         System.out.println(popped+ " is the popped item.");         popped= stack.pop();         System.out.println(popped+ " is the popped item.");         stack.printStack();     } }

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 would like to know how to integrate or rather solve this:  $$ \frac{dP}{dt} = kP(L-P). $$  I have the solution, but I would like to know how to arrive at it.  I have been told it involves separation of variables and partial fractions.

The population $P(t)$ of a biological species can be modelled by   $$ \frac{dP}{dt}=P(\beta - \delta P) $$   subject to $P(0)=P_0$ where $\beta$ is the birth rate and $\delta$ is the death rate. Assuming $P>0$, find the population $P(t)$ for three cases:         $P_0<\hat{P}$   $P_0=\hat{P}$   $P_0>\hat{P}$         where $\hat{P}=^{\beta}/_{\delta}$   So far, I have:  We see the equations is separable and so $$ \int\frac{dP}{P(\beta - \delta P)}=\int dt $$ then in partial fractions we have $$ \int\frac{dP}{\beta P}+\int\frac{\delta}{\beta (\beta - \delta P)}dP=\int dt $$ integrating both sides $$ \frac{1}{\beta}\ln P+\frac{\delta}{\beta}\ln(\beta - \delta P)=t + k $$ $$ \ln P+\delta\ln(\beta - \delta P)=\beta t + k $$ $$ P\cdot(\beta - \delta P)^\delta=ke^{\beta t} $$ so at $t=0$ we have $$ P_0\cdot(\beta - \delta P_0)^\delta=k $$ hence $$ P\cdot(\beta - \delta P)^\delta=P_0\cdot(\beta - \delta P_0)^\delta\cdot e^{\beta t} $$  I don't really see how to apply the three cases to this equation; I mean it seems that $P_0=\hat{P}$ would mean $P(t)$ is identically 0 but I don't think this makes any sense in terms of the original problem. So my reasoning must be wrong..? And for the other two cases I don't see how I would express $P(t)$ generally.


I am trying to embed A functional web browser in my java app.  I tried [jBrowser]1 but first it is for 32 bits platform and when I try in 32 bits it don't work, shows this message:  "java.lang.UnsatisfiedLinkError: D:\xulrunner\xulrunner\xulrunner\javaxpcomglue.dll: Can't find dependent libraries"  I tried using setXulRunnerPath(new File("d://xulrunner")) with latest. I tried with previous version and dont work anyway, but instead I found this [advice]2. I saw the swt browser works but  I need my application in swing.  My question: Is there is some component to acomplish this? Thank you in advance for any help.  1:    2:

Is there a way to embed a browser in Java? more specifically, is there a library that can emulate a browser?


Why can I not Loop Cut my plane?  The yellow dots appear on the side... I just don't understand it. I guess it can only be really understood with the blend file, so I have uploaded it here:  Thank you.

Alright so I've seen some postings about loop cuts and done some research. I am very new to blender and modeling overall. I am trying to loop cut this concrete barrier. Now I'm following a tutorial and kind of did my own thing in some areas. I cleaned it up following some instructions in another answer here on stack exchange.  I can't for the life of me figure out why I can loop cut around the whole bottom:   ...but not the whole middle:   I see this marked as answered by another question. That question refers to ngons and inside faces. Now once again I'm totally new to this. I looked on the inside. I don't believe I have inside faces or any ngons by the terms I've read online in my research.  Here is a wireframe picture and the inside view:     Maybe I'm missing something the answers on other posts are saying. If so and you know what it is I'd be very appreciative of what it is.


Recently an udev rules was not executed. After some investigations, it was a symlink to a user file with these permissions :  -rw-r--r-- 1 user user  changing ownership to -rw-r--r-- 1 root root and reloading indev rules with udevadm control --reload solved the problem.  I understand that for security reasons it is better to have system files owned by root. Does that mean udev checks rules owners and rejects non-root rules? Is there another explanation?

What permissions should a udev rule have for a USB device? 644? 755?  For example on Ubuntu I'm looking at this file: /etc/udev/rules.d/99-lpcscrypt.rules


In our sequence and series class, my teacher wrote this series and asked if it makes any sense. We all were saying "this makes no sense at all." But when I Googled it, the whole world knows it. So what exactly this series define? Some say string theory uses this series. Can someone explain it?

$\displaystyle\sum_{n=1}^\infty \frac{1}{n^s}$ only converges to $\zeta(s)$ if $\text{Re}(s) > 1$.  Why should analytically continuing to $\zeta(-1)$ give the right answer?


Suppose we pick a random real number between 0 and 1 and call it $x$. There are $2^{\aleph_0}$ possible values, so the chance of picking any specific number (such as $x$) in that range is 0. But in the end, we did manage to pick $x$, despite its probability of 0.  Does this mean that a 0% chance is actually possible, or is there some flaw in this logic?

I read a comment under :     There are plenty of events that can occur that have zero probability.   This reminds me that I have seen similar saying before elsewhere, and have never been able to make sense out of it. So I was wondering    if zero probability and impossibility mean the same? if an event with zero probability doesn't mean that the event is impossible to occur, how probability theory represents/describes impossibility?   Thanks and regards!


Not sure if an URL () is regexp-expressible but what would be the most robust and formal regular expression of an URL?  There are many regexp dialects (perl, emacs lisp, php, python, etc), but any dialect is acceptable.

How can I check if a given string is a valid URL address?  My knowledge of regular expressions is basic and doesn't allow me to choose from the hundreds of regular expressions I've already seen on the web.


I'm trying to write an xml file using javascript like this:   var root = new ActiveXobject("Microsoft.XMLDOM");  var Plnode = root.createProcessingInstruction("xml", "version ='1.0' encoding='utf-8'");  var Firstnode = root. createElement("Project");  var Input_data = root. createElement("Input_data");   When written, the data is written all in one line.  <?xml version="1.0" encoding="utf-8"?> <Project><Input_data></Input_data></Project>   Is there a way to print this in a prettified manner instead, like below?  <Project>  <Input_data>  </Input_data> </Project>

I have a string that represents a non indented XML that I would like to pretty-print. For example:  <root><node/></root>   should become:  <root>   <node/> </root>   Syntax highlighting is not a requirement. To tackle the problem I first transform the XML to add carriage returns and white spaces and then use a  tag to output the XML. To add new lines and white spaces I wrote the following function:   function formatXml(xml) {     var formatted = '';     var reg = /(>)(<)(\/*)/g;     xml = xml.replace(reg, '$1\r\n$2$3');     var pad = 0;     jQuery.each(xml.split('\r\n'), function(index, node) {         var indent = 0;         if (node.match( /.+<\/\w[^>]*>$/ )) {             indent = 0;         } else if (node.match( /^<\/\w/ )) {             if (pad != 0) {                 pad -= 1;             }         } else if (node.match( /^<\w[^>]*[^\/]>.*$/ )) {             indent = 1;         } else {             indent = 0;         }          var padding = '';         for (var i = 0; i < pad; i++) {             padding += '  ';         }          formatted += padding + node + '\r\n';         pad += indent;     });      return formatted; }   I then call the function like this:  jQuery('pre.formatted-xml').text(formatXml('<root><node1/></root>'));   This works perfectly fine for me but while I was writing the previous function I thought that there must be a better way. So my question is do you know of any better way given an XML string to pretty-print it in an html page? Any javascript frameworks and/or plugins that could do the job are welcome. My only requirement is this to be done on the client side.


Everything I've tried to install has opened in Archive manager. Even if the file says that it's executable it still opens in archive manager. There aren't any executable files inside the archive either. There also isn't any other software to open the files with. How do I make it so it opens an installer instead of the archive.

I have downloaded tar.gz files. But I don't know how to install it. How do I install this kind of file?


I have used a lot of recipes for Japanese cotton cheesecake, but none of them have worked well for me. I am currently using the following recipe and method:   60 gr of full milk 140 gr of cream cheese 40 gr butter 50 gr plain flour 15 gr cornstarch 5 eggs 100 gr fine sugar   Method: mix milk and cheese and add flour + cornstarch, then mix in the yolks. Make meringue and fold in.  Bake at 180C for 15 min, then lower the temperature to 160C and bake for 50 min.  Turn off the oven and leave the cake in the oven for 1 hour.  My problem: the cake is rising well during baking but then it deflates when it cools in the oven. What am I doing wrong?

A japanese cheesecake is basically like a cheesecake fused with a spongecake.  When i beat the egg whites they peak perfectly then i am required to get 1/3 of the egg white mixture and fold it into the cake mixture then fold in the rest of the egg whites. Then i pour it into a pan and place it into a baine-marie and bake it for about 1 hour and 10mins at 180 degrees celcius.   In the oven it raises perfectly and looks beautiful, then when i take it out of the oven to rest it slowly starts to shrink and is no longer tall but rather about 1-2cm shorter (20cm cake pan).  Can anyone please help me? Anyone have any suggestions or any techniques on how to prevent this from happening?


As a new Day Trader, I have used market orders on several occasions (mainly to exit positions). But it occurred to me that there might be an inherent danger in doing so...  Let’s say that I want to sell a stock that currently is trading about $20. At the instant I execute the market order, the only buy order left is someone (nefarious) who wants to buy the stock at $0... Is there any safeguarding in place to prevent the order from being filled?  An extreme example, and only dangerous if there is low volume, but it could happen?

I'm following an automated trading system. It gives me buy/sell signals periodically. I usually just add/subtract 0.5% from the current price (as reported by Google Finance) and buy/sell.  Last Monday, I did the same, but apparently the stock I was trying to sell fell in price quicker than my broker could sell it at my limit price. It fell about 3%. I wouldn't have minded selling at 1%, 2% or, frankly speaking, any percent lower. I just don't wanna hold on to it.  So, should I just use market orders instead of limit orders? Will it cost me more money to use market orders than limit orders with my current +/- 0.5% formula?


I chose to install Ubuntu with a fully encrypted disk, using LLVM.  How can I resize my partition so that I can install a new Linux version alongside Ubuntu?  Here's my current gparted status, this is the Ubuntu default:    I have already seen the following question:      However, that is not about resizing an encrypted partition, but it only talks about the standard LLVM volume. Also, it does not talk about installing the OS after resizing partitions. Can I just use the same /boot partition? How do I configure this?

I want to shrink my second (LVM) partition, in order to create a new partition in the newly freed space. I am using the Live CD to do so, because I know I can't resize/move this partition while it is in use. When I opened GParted in the Live CD, I realized that I could not resize the partition, because when I right-click it, the option "resize/move" is disabled.  I tried to unmount it, to "lazy" unmount it (umount -l /dev/sda2) but it didn't work.  A screenshot from GParted:


At the  and  Review pages1), when you hover the area next to a comment, the buttons for upvoting and flagging a comment do not light up.2)  After clicking the "add / show n more comments" button, the buttons re-appear:    Unfortunatily that option is not available when there are just a few comments.  1) This glitch is not seen on the  and  Review pages.  2) Observed in Chrome 31, IE 11, Firefox 25, Opera 12.

I´m not sure if it is already reported. But when i review the following post  and take a look at the duplicate, voting on question, answers and comments is disabled.  But the accepted answer of the duplicate question has the Link "show 2 more comments" and when I click it, the additional comments are loaded and then I can vote and flag the comments of the accepted answer.  Before:   After:


I have a situation where IVs positively correlate with the DV, and the IVs also correlate with eachother.  I do not explain how the beta weights are negative. No multicollinearity is detected, and the model is justified, and has an r-squared value of 5. Note for example, issue with Lev and Size; both correlate do DV CSRDI, both correlate to eachother, but negative beta for LEV and low significance?  This question specifically is asking about sign reversal. I am confused with this due to the lack of a multicollinarity issue. Lev and Size are correlated but not excessively, so why do IVs such as lev have a sign reversal in the regression model? Also is this classified as suppression? I am in no way a statistics expert and am only interested in understanding this for an assignment for my undergrad degree. So if possible, could you please explain in laymans terms. Thanks you    I was wondering if you anyone can explain this, and perhaps help with interpretation

Is it possible to obtain a positive correlation between a regressor and a response (+0,43) and, after that, obtain a negative coefficient in the fitted regression model for this regressor?  I'm not talking about changes in the sign of the regressor among some models. The coefficient sign always remains.  Could  the remaining variables of the fitted model influence the changing of the sign?


Why does BLAST use Local alignment, not Global alignment? And when would a global alignment be useful?

There are a bunch of , and I don't want to get bogged down in the maths behind them as this not only between software but varies from software version to version.  There are two main divides in the programs; some use local alignments and others use global alignments. My question is threefold:   What are the fundamental differences between the two? What are the advantages and disadvantages of each? When should one use either a global or local sequence alignment?


do embassies, generally speaking, ask a person applying for a visa their PR of the country in which they're currently applying for a visa (i.e the country where the embassy is based) or an eventual other visa for the country in which they're currently, in order to verify their legal presence there?  Example: My name is A, I'm an Egyptian citizen living in France. Once I go to a US istitution there in order to apply for a visa (I assume my passport is totally empty) and once I showed that I have enough funds to sustain and provide for myself there, would they ask a french PR in order for myself to be eventually issued a visa or do they simply bother about their related country entry conditions?  EDIT: The question does not pertain this current coronavirus hysteria and if the question's too broad or general, restrict your answer to the US or UK embassies cases.

I believe I heard cases when a Chinese citizen living in the US attempted to renew their passport they were asked for proof on what grounds they were residing in the US as there was no US visa in their expiring Chinese passport (the person was a US dual citizen).  Now, has anything like this ever happened when a person applied for a visa to some other country and instead received a similar request to justify on what legal basis they are in the present country?  So, to give an example of what I mean, if a Chinese citizen living in the US sent their Chinese passport (without a US visa) applying for a tourist visa to, say, an Australian, Russian, Polish, etc embassy. Just an example, I'm trying to see if anything like this is possible/has happened in general.


Is it possible for a human and another species to reproduce?

In some cases two species can hybridize. For example, Tigers and lions can hybridize to produce "".   Would it also be possible for humans and chimpanzees (or any other species) to hybridize ? If not, what would be the likely cause of failure?  Why do some hybridization matings produce offspring, like the Liger, and some not? What mechanisms prevent hybridizations?


I want to have tables with numbers so I can say "table 1 shows".. Can you please help?  Example:  \documentclass[table,dvipsnames]{beamer} \usepackage[english]{babel} % \usepackage{beamerthemesplit} // Activate for custom appearance \usetheme{Berlin} \useoutertheme{infolines} \useinnertheme{circles} \usecolortheme{dolphin} \usepackage{caption} \usepackage{graphicx} \usepackage{multirow} \usepackage{booktabs} \begin{document}  \frame{% \frametitle{Calibration} \begin{center} \captionof{table}{Parameter values} % title of Table \label{table:parametersone} \setlength{\tabcolsep}{0.3pt} \small \scalebox{.65}{\begin{tabular}{l c l c p{8.5cm} } % centered columns (4 columns)          \hline     %inserts double horizontal lines \\ Parameter &\phantom{.} & Value  & \phantom{.} & Description \\[1.0ex]    % inserts table  %heading \hline             % inserts single horizontal line \\ $\beta$ &\phantom{.}  & 0.97 &\phantom{.}  & Yearly discount factor   \\ % inserting body of the table $\alpha$ &\phantom{.}  & 0.60 &\phantom{.}  & Output elasticity of labor  \\ $\gamma$ &\phantom{.}  & 0.10 &\phantom{.}  & Output elasticity of public capital \\ $\theta$ &\phantom{.}  & 2.68 &\phantom{.}  & \parbox{10cm}{Multiplicative factor in the \\ human capital technology} \\ $\psi$ &\phantom{.}  & 0.80 &\phantom{.}  & Parental altruism \\ $\sigma$ &\phantom{.}  & 0.63 &\phantom{.}  & \parbox{12cm}{Exponent on parental human capital} \\ $\phi$ &\phantom{.}  & 0.30 &\phantom{.}  & \parbox{12cm}{Elasticity of the fraction of time during first \\ period spent in school} \\ $\eta$ &\phantom{.}  & 0.10 &\phantom{.}  & \parbox{12cm}{Elasticity on public education expenditures} \\ $\underbar{h}$ &\phantom{.}  & 2.30 &\phantom{.}  & Constant\\ $\lambda$ &\phantom{.}  & 5.00 &\phantom{.}  & \parbox{10cm}{Relative weight of adult labor in production}  \\ $r$ &\phantom{.}  &5.0\% &\phantom{.} & Interest rate \\ $\delta_G$ &\phantom{.}  & 2.5\% &\phantom{.}  & Yearly depreciation rate of public capital\\        % [1ex] adds vertical space \hline %inserts single line \end{tabular}} \end{center}}  \end{document}

I am giving a presentation and therefore I am using the  class. I have included some figures and it works, but there is no number after "Figure".  My code:  \documentclass{beamer}  \usepackage{graphicx} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \usepackage{listings} \usepackage{xcolor} \usepackage{eso-pic} \usepackage{mathrsfs} \usepackage{url} \usepackage{amssymb} \usepackage{amsmath} \usepackage{multirow} \usepackage{hyperref} \usepackage{booktabs} \usepackage{wallpaper} \usepackage{bbm} \usepackage{cooltooltips} \usepackage{eso-pic} \usepackage{everyshi} \usepackage{calc} \usepackage{graphicx} \usepackage{ifthen} \usepackage{graphicx} \usepackage{wrapfig} \usepackage{animate} \usepackage[singlespacing]{setspace} \usepackage[absolute,overlay]{textpos} \usepackage{enumerate} \usepackage{hyperref} \newenvironment{changemargin}[2]{%   \begin{list}{}{%     \setlength{\topsep}{0pt}%     \setlength{\leftmargin}{#1}%     \setlength{\rightmargin}{#2}%     \setlength{\listparindent}{\parindent}%     \setlength{\itemindent}{\parindent}%     \setlength{\parsep}{\parskip}%   }%   \item[]}{\end{list}}  \setbeamercolor{frametitle}{fg=red,bg=white}  \hypersetup{pdfpagemode=FullScreen} \renewcommand*{\UrlFont}{\normalfont}  \usetheme{Goettingen} \useinnertheme{circles} \beamertemplatenavigationsymbolsempty  \setbeamerfont{page number in head/foot}{size=\large} \setbeamertemplate{footline}[frame number]   %%% \begin{document}  \frame[plain]{ \titlepage }  \setbeamertemplate{background canvas}[default]  \frame{ \frametitle{}  \begin{figure} \begin{center} \includegraphics[scale=0.2]{varweakness} \caption{VaR as a quantile} \end{center} \end{figure}  }   \end{document}   Which gives the following frame with the figure:    (I am not sure what is causing the problem, therefore I did not delete any package.)  How can I get a number, e.g. Figure 1:?


I have a strange warning message that happens on startup of Windows 7.   It has started only recently and says there is a problem with a file on my computer called C:\Program. It also says renaming it C:\Program 1 would fix this problem. To be precise,     File Name Warning      There is a file or folder on your computer called "C:\Program"   which could cause certain applications to not function correctly.    Renaming it to "C:\Program 1" would solve this problem.    Would you like to rename it now?                           (Rename) (Ignore)   I took a screenshot of this dialog:     So far I have said not to rename it, before I know what it is.  This is what the file looks like in Notepad:  4 ›˜ýÒc?¾Bº3Ldgk/Œ$Oð½      ñ½  ½ÛéÕŽÄl(   ò½  ê¢ñ6£b(   ó½  ;¿¤¸îX (   ô½  ÞÞµkæ (      These are the General properties of the file:     I cannot find anyone on the Internet with the same problem as me and would like advice on whether to leave, rename or delete this file. I also want to know what it is.

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


How can you make the <, and the $\leq$ signs bold?  Thanks,

To make Latin-letter variables bold I can use e.g. \mathbf{a}, but while putting Greek letters or symbols such as \nabla inside \mathbf doesn't cause any errors or warnings, it also doesn't do anything else.  What is the best way to make bold math symbols, in particular Greek letters and \nabla?


Let $N$ be a rank $n$ submodule of $\mathbb Z^n$, and let $A$ be the matrix with rows being the generators of $N$. Show that $\lvert \mathbb Z^n / N\rvert = \lvert \det (A) \rvert$.  So this is a homework problem, and I am a little confused. Shouldn't it be the case that $\mathbb Z^n$ is the unique (up to isom.) free module of rank $n$? Then, wouldn't this imply that $N = \mathbb Z^n$? I think I am missing something here, but even assuming that this is indeed the case, then we would be trying to prove that $\lvert \det (A) \rvert = 1$ for every invertible matrix $A$ with entries in $\mathbb Z$, which I don't think is true.

Let $A$ be an $n \times n$ matrix with integer coefficients and nonzero determinant. Can we say something about $ \mathbb{Z}^n /\ \text{im}( \phi )$ (here $\phi : v \mapsto Av$ )?    This problem has arised as I was solving some problem in homology theory.


I'm aware of headaches that involve returning in try/catch/finally blocks - cases where the return in the finally is always the return for the method, even if a return in a try or catch block should be the one executed.  However, does the same apply to System.exit()? For example, if I have a try block:  try {     //Code     System.exit(0) } catch (Exception ex) {     //Log the exception } finally {     System.exit(1) }   If there are no exceptions, which System.exit() will be called? If the exit was a return statement, then the line System.exit(1) would always (?) be called. However, I'm not sure if exit behaves differently than return.  The code is in an extreme case that is very difficult, if not impossible, to reproduce, so I can't write a unit test. I'm going to try to run an experiment later today, if I get a few free minutes, but I'm curious anyway, and perhaps someone on SO knows the answer and can provide it before or in case I can't run an experiment.

Considering this code, can I be absolutely sure that the finally block always executes, no matter what something() is?  try {       something();       return success;   }   catch (Exception e) {        return failure;   }   finally {       System.out.println("I don't know if this will get printed out"); }


i want to completely delete Ubuntu from my hard drive and then want to install window on it. Please help me as soon as possible.  after installing window i will install Ubuntu

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


I'm relatively new to jQuery, so there may be a simple solution to this, but I've yet to find it! I have 2 sets of cards to distinguish when a particular item is 'active' or 'available'. When a stop button on an 'active' card is clicked, it becomes 'available' and moves to the 'available' div, and vice versa.  So far, I've been able to update the cards from one state to another - 'active' to 'available', or 'available' to 'active' and move them to the correct div using the 'appendTo' function, but after they move for the first time, I can't seem to them back.  I've tried updating their classes, after they're moved but this doesn't seem to work. Maybe I need to nest my functions inside each other? I've included my code below if anyone has any ideas?...    $('.activeBtn').click(function() {     $(this).removeClass('btn btn-sm btn-danger activeBtn mt-2');     $(this).addClass('btn btn-sm btn-success availBtn mt-2');     $(this).text('Start');     $('.card-text').text('AVAILABLE');     $(this).attr("id","availBtn");     $(".cardActive").appendTo("#availDiv");  });   $('.availBtn').click(function() {     $(this).removeClass('btn btn-sm btn-success availBtn mt-2');     $(this).addClass('btn btn-sm btn-danger activeBtn mt-2');     $(this).text('Stop');     $('.card-text').text('ACTIVE');     $(".cardAvail").appendTo("#activeDiv"); });  <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet"/>

Active Cards

ACTIVE
                 Stop

Available Cards

AVAILABLE
                 Start 1

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


Having a JSON-like structure:  {     "shopping_list": [         {             "level": 0,             "position": 0,             "item_name": "Gold Badge"          },         {             "level": 1,             "position": 10,             "item_name": "Silver Badge"          },         {             "level": 2,             "position": 20,             "item_name": "Bronze Badge"          }     ] }   I'm trying to sort the list by key.  However, when trying to get them by:  k = [c.keys()[0] for c in complete_list["shopping_list"]]   I get TypeError: 'dict_keys' object does not support indexing.   How to get keys? How to sort the list by specified key?

I have a list of dictionaries and want each item to be sorted by a specific value. Take into consideration the list: [{'name':'Homer', 'age':39}, {'name':'Bart', 'age':10}]  When sorted by name, it should become: [{'name':'Bart', 'age':10}, {'name':'Homer', 'age':39}]


I have 2 identical server with exact disk partitions (OS CENTOS 6.4 both ) [My college central oracle server]. [Oralce 11G Enterprise Edition]  Entire ORACLE HOME ( bin , control files, data files everything on oracle) is on 2nd Disk (which is not a OS disk)  Since OLD server had reached end of life (from HP) a new HP machine with upgraded RAM (OLD system had 16 GIG where as new system as 64 GIG).  Now Since All oracle Dependencies (RPM, libraries, environmental variables, JAVA, Users and groups) are already made on new server.  So Now Question is ..  Can I remove Disk [Oracle HDD] from OLD server and insert it on NEW server and just start Oracle (sqlplus "/ as sysdba" or dbstart and lnsctrl).  Can it will give any challenge. (I have cold backups, export backup, & RMAN backup too).  I just want to give a try on above case.  Will this work ??

I have 2 identical server with exact disk partitions (OS CENTOS 6.4 both ) [My college central oracle server].  Entire ORACLE HOME ( bin , control files, data files everything on oracle) is on 2nd Disk (which is not a OS disk)  Since OLD server had reached end of life (from HP) a new HP machine with upgraded RAM (OLD system had 16 GIG where as new system as 64 GIG).  Now Since All oracle Dependencies (RPM, libraries, environmental variables, JAVA, Users and groups) are already made on new server.  So Now Question is ..  Can I remove Disk [Oracle HDD] from OLD server and insert it on NEW server and just start Oracle (sqlplus "/ as sysdba" or dbstart and lnsctrl).  Can it will give any challenge. (I have cold backups, export backup, & RMAN backup too).  I just want to give a try on above case.  Will this work ??


Every time I open my terminal I get  (base) Users-MacBook-Air:~ Uriel$  instead of   Users-MacBook-Air:~ Uriel$  without the (base) line which means that the environment of conda is open. In order to get this, I have to do  conda deactivate  every time in my Terminal and it is annoying because not only I always have to type that but also because every time I open it, I have to wait some seconds because I think is logging conda in  Up in my Terminal what I should only get is the label   user--- -bash ---  but before I get that I see that first appears   Terminal --python<-bash  then  Terminal --java<-bash  then  Terminal --R<-bash  etc., until I get the  user--- -bash ---.  Is it because I let conda open? Or something like that? How do I fix this?  Following is the contents of the ~/.bash_profile file:  # Setting PATH for Python 3.6 # The original version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}" export PATH  # Setting PATH for Python 3.8 # The original version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}" export PATH # added by Anaconda3 2019.10 installer # >>> conda init >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/user/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)" if [ $? -eq 0 ]; then     \eval "$__conda_setup" else     if [ -f "/Users/user/opt/anaconda3/etc/profile.d/conda.sh" ]; then         . "/Users/user/opt/anaconda3/etc/profile.d/conda.sh"         CONDA_CHANGEPS1=false conda activate base     else         \export PATH="/Users/user/opt/anaconda3/bin:$PATH"     fi fi unset __conda_setup # <<< conda init <<< conda deactivate

when I get a fresh terminal, my prompt says   (base) ~>    The (base) part is something that seems new. Was this added during a recent update? How do I get rid of it? There is one piece of customization in my dot .profile, namely  export PS1="\[\e[32;1m\]\w> \[\e[0m\]"   I also installed Conda recently, which might be related to that.  How do I remove  (base) ?


I have a list like this, with an even number of elements: straight_list = [1, 2, 3, 4, 5, 6]  There are six items in this list. I'd like to group them into three pairs, like this: paired_list = [(1, 2), (3, 4), (5, 6)]  What's the best way to do this? More generally, given a list with 2*n items, what's the best way to create a list of n pairs? I have come up with the following: straight_list = [1, 2, 3, 4, 5, 6] paired_list = []  for i in range(len(straight_list)//2):     j = i*2     pair = (straight_list[j], straight_list[j+1])     paired_list.append(pair)      print(paired_list)  # [(1, 2), (3, 4), (5, 6)]  I also can make it work like this, though it's a tongue-twister: [tuple(x) for x in list(np.array(straight_list).reshape(len(straight_list)//2,2))] # [(1, 2), (3, 4), (5, 6)]  Is there a more elegant, functional, and/or "Pythonic" way to create this list of pairs? (In some ways, this is almost an inverse of this question: )

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


I've been working on the following problem:      Show that if $f\in C[a, b]$ , $f\ge 0$ on $[a, b]$, then $\left(\int_a^b f(x)^n \,dx\right)^{1/n}$ converges when $n\to\infty$ and the limit is $\max_If$ with $I=[a, b]$.   This is my solution:  For  Weierstrass $f$ has maximum, $\exists \  \xi : f(\xi)=M$; and as $f$ is defined on $[a,b]$, $f$ is U.C., then:  $\forall \epsilon >0  \ \exists \delta >0: \forall x,y \in [a,b]: |x-y|< \delta \Rightarrow |f(x)-f(y)|< \epsilon$  Let $[a,b]=\bigcup_{k=1}^m I_k$, with $mis(I_k)<\delta$, and $M_k=max_{\bar(I_k)}  f(x)$ $(\int_a^b f(x)^n \  dx)^{1/n}=(\sum_{k=1}^m M_h^n mis(I_k))^{1/n}=(M_1^n mis(I_1)+...+M^n mis(I_j)+...M_m^n mis(I_m))^{1/n}=$ =$M ((M_1/M)^n mis(I_1)+...+mis(I_j)+...+(M_m/M)^n mis(I_m))^{1/n}$  Then:  $(\int_a^b f(x)^n \  dx)^{1/n} \ge M$  $(\int_a^b f(x)^n \  dx)^{1/n} \le M(b-a)^{1/n}$  $\Rightarrow \exists \  \lim_n \ (\int_a^b f(x)^n \  dx)^{1/n}=M=\max_I \ f$

Show that $$\sup_{x\in [a,b]} f(x) = \lim_{n\rightarrow\infty} \left(\int_a^b (f(x))^n \;dx\right)^{\frac{1}{n}}$$ for f continuous and positive on [a,b].  I can show that LHS is greater than or equal to RHS but I can't show the other direction.


I'm new here - computers are my thing, but I could use some electrics help. I have travelled to a small island where I will be for several months.  I managed to bring everything except one power adapter.  I do have something "similar" and want to ask if this will work before blowing myself up.  The power requirement on the device is 12V 1.5A positive center.  I have an adapter that works on local current. It's output is 12V 1A. (12VA). Any chance this will work?  And, just in case, which way is the diagram for positive center?  Many thanks

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


why doesn't Heisenberg's uncertainty principle also work for macroscopic bodies which are in-turn made up of quantum-particles?  ps: if proof is provided it will be a lot more useful.

Many introductory quantum mechanics textbooks include simple exercises on computing the de Broglie wavelength of macroscopic objects, often contrasting the results with that of a proton, etc.  For instance, this example, taken from a textbook:     Calculate the de Broglie wavelength for      (a) a proton of kinetic energy 70 MeV      (b) a 100 g bullet moving at 900 m/s   The pedagogical motivation behind these questions is obvious: when the de Broglie wavelength is small compared to the size of an object, the wave behaviour of the object is undetectable.  But what is the validity of the actual approach of applying the formula naively? Of course, a 100g bullet is not a fundamental object of 100g but a lattice of some $10^{23}$ atoms bound by the electromagnetic force. But is the naive answer close to the actual one (i.e. within an order of magnitude or two)? How does one even calculate the de Broglie wavelength for a many body system accurately?


Set the WiFi Sleep policy as 'never' but when my new Galaxy Mini is in sleep mode wi-fi is turned off. I tried with a few apps like 'Keep WiFi' without success. Is anybody out there who actually got the same problem and solved it?

Occassionally my Wi-Fi goes into this weird state where the phone "thinks" I'm connected, but the connection simply doesn't work.  Apps still seem to think I have connectivity, though they can't actually connect to anything, and the status bar still shows that I'm connected to Wi-Fi.  Turning Wi-Fi off and back on resolves the issue, and this occurs on multiple networks.  It seems sort of like whatever service manages the Wi-Fi connection gets killed occasionally.  It usually happens when I've been playing a game (that doesn't access the Internet) for a while or if my phone's been sitting for a while; it never happens while I'm actively using the connection.  I have my Wi-Fi timeout set to "Never" and the normal timeout isn't the issue since my phone regularly lasts several hours without the Wi-Fi dying.  Sometimes it dies a couple times in a day, and recently I went a week or so without it happening.  How can I fix this or prevent the service from being killed (if that's indeed what's happening)?  Shouldn't that be a system process that never gets killed?  (Does Android ever kill system processes other than when they crash?)  Could it be related to TouchWiz?  I have an SGS Vibrant running 2.2 (Bionix NextGen v1, but this has occurred on multiple ROMs).


This code not working. products is react state. It gives " 'products' is not defined" error. <CardTitle tag="h5">{products.productName}</CardTitle> this is working: <CardTitle tag="h5"></CardTitle> my main component code:   state = { currentCategory: "", products: [] };    componentDidMount() {     this.getProducts();   };    changeCategory = (category) => {     this.setState({ currentCategory: category.categoryName });   };    getProducts = () => {     fetch("http://localhost:3000/products")       .then((response) => response.json())       .then((data) => this.setState({ products: data }));   };

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


Saw this from Windows 10 wallpaper. Hope that someone can help find this - blue lake with snowy mountain. I want to go here one day! Looks very serene.

Windows 10 has an extensive collection of lock screen photos, many of which have  here on Travel.SE.  Is there a website which lists the location of all of these photos? I imagine Microsoft has purchased an official license, so they should have a record about the photographer and the place where the photo was taken.


Let's say I get paid by my boss. There are 2 envelopes, A and B. I know for a fact that one envelope contains twice more money than the other one.  1) If I pick an envelope A, and the boss asks me if I want to change to envelope B. Is it better to change?  -> Since I do not know which one has more money, the expected value for both envelope is $\frac{x+2x}{2}=1.5x$ each. So it does not matter if I change or not.  2) If I pick an envelope A and see that it has \$100 in it, and the boss asks me if I want to change to envelope B. Is it better to change?  -> Envelope B will have either \$50 or \$200. The expected value of envelope B is now $\frac{50+200}{2}=\$125$. So it is better to change.  What makes these two situations different? While I think that some assumptions or logic of the problem might be flawed, I just cannot figure out why these two situations lead me to a different result. Thank you in advance :)

Suppose you're given two envelopes. Both envelopes have money in them, and you're told that one envelope has twice as much money as the other. Suppose you pick one of the envelopes. Should you switch to the other one?  Intuitively, you don't know anything about either envelope, so it'd be ridiculous to say that you should switch to the other envelope to maximize your expected money.   However, consider this argument. Let $x$ be the amount of money in the envelope you picked. If $y$ is the amount of money in the other envelope, then the expected value equals  $$E(y) = \frac{1}{2}\left(\frac{1}{2}x\right) + \frac{1}{2}\left(2x\right) = \frac{5}{4} x$$  But $5x/4 > x$, so you should switch!    The Wikipedia article says that $x$ stands for two different things, so this reasoning doesn't work. I say this is not a valid resolution.   Consider opening up the envelope that you pick, and finding $\$10$ inside. Then you can run the expected value calculation to get $$E(y) = \frac{1}{2} \cdot \$5+\frac{1}{2} \cdot \$20 = \$12.50$$  This means that if you open one of the envelopes and find $\$10$, you should switch to the other envelope. The $\$10$ doesn't stand for two different things, it literally just means $\$10$.   But you don't have to open up the envelope to run this calculation, you can just imagine what's inside, and run the calculation based on that. This is what "Let $x$ be the amount in the envelope" means. The problem with the argument is not that $x$ stands for two different things.   So what is the problem?    Previous questions on stack exchange have given the resolution that I just said I wasn't satisfied by, so please don't mark this as a duplicate. I want a different resolution, or a more satisfying explanation of why $x$ does stand for two different things.  Apparently there is still research being published about this problem - maybe it isn't so obvious?    I think there's something subtle wrong with the premise. Because there's no uniform probability distribution on $\mathbb{R}$, statements like "random real number" are not well-defined. Likewise, I think "one envelope has twice as much money as the other" assumes some probability distribution on $\mathbb{R}$, and perhaps our expected value calculation assumes that this distribution is uniform, which it cannot be ...


Will leaving my galaxy pro tablet plugged in 24/ 7 cause any damage?

I usually disconnect my cellphone from the charger some time after it's fully charged because I'm afraid the battery could lose capacity over time if I don't. However, I believe modern electronics should be able to handle this kind of scenario and automatically stop charging the battery once it's full. Does this apply to modern Android phones? Or do I need to continue disconnecting it all the time?


Hi I did some reading and came across this behavior that I don't really know why is like this. Would love to get an explanation why it works like this.  class InputTest {     public static void main(String[] args){         System.out.println("WITHOUT array:");         byte a=0;         System.out.println(a);         test(a);         System.out.println(a);          System.out.println("WITH array:");         byte[] b={1,2,3,4,5};         System.out.println(b[3]);         test2(b);         System.out.println(b[3]);      }     static void test(byte a){         a=120;     }     static void test2(byte[] b){         b[3]=120;     } }   printing of the code is:  WITHOUT array: 0 0 WITH array:  4 120   So I kinda want to understand why this is so maybe I don't make a unnecessary mistake in the future.

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


Edit : I know it is returning null pointer , but what is cause of it , is it some web service or code issue ?   I am calling a external WebService (celcius to Farenheit Demo)  from Android ..  it gives me following error  Attempt to invoke virtual method 'java.lang.String org.ksoap2.serialization.SoapPrimitive.toString()' on a null object reference   I dont have too much Code , Just the MainActivity Class and Async Class  public class MainActivity extends AppCompatActivity {  String TAG = "Response"; Button bt; EditText celcius; String getCel; SoapPrimitive resultString; protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);          bt = (Button) findViewById(R.id.bt);         celcius = (EditText) findViewById(R.id.cel);           bt.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View view) {                  getCel = celcius.getText().toString();                 AsyncCallWS task = new AsyncCallWS();                 task.execute();             }         });     }      private class AsyncCallWS extends AsyncTask<Void, Void, Void> {          @Override         protected void onPreExecute() {             Log.i(TAG, "onPreExecute");         }          @Override         protected Void doInBackground(Void... params) {                 Log.i(TAG, "doInBackground");             calculate();             return null;         }          public void calculate() {             String SOAP_ACTION = "http://www.w3schools.com/webservices/CelsiusToFahrenheit";             String METHOD_NAME = "CelsiusToFahrenheit";             String NAMESPACE = "http://www.w3schools.com/webservices/";             String URL = "http://www.w3schools.com/webservices/tempconvert.asmx";              try {                 SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);                 Request.addProperty("Celsius", getCel);                  SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);                 soapEnvelope.dotNet = true;                 soapEnvelope.setOutputSoapObject(Request);                  HttpTransportSE transport = new HttpTransportSE(URL);                  transport.call(SOAP_ACTION, soapEnvelope);                 resultString = (SoapPrimitive) soapEnvelope.getResponse();                  Log.i(TAG, "Result Celsius: " + resultString);             } catch (Exception ex) {                 Log.e(TAG, "Error: " + ex.getMessage());             }         }          @Override         protected void onPostExecute(Void result) {             Log.i(TAG, "onPostExecute");             Toast.makeText(MainActivity.this, "Response" + resultString.toString(), Toast.LENGTH_LONG).show();         }      }   Logcat Shows  Attempt to invoke virtual method 'java.lang.String      org.ksoap2.serialization.SoapPrimitive.toString()' on a null object      reference at testproject.example.com.sensor_new.MainActivity$AsyncCallWS.onPostExecute(MainActivity.java:89)   Some solution i saw like to apply Internet setting in manifest and do the calculation in DoBackGround . But that is not solving any issue ,   Any Help would be appreciated

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 am trying to export a model from modo to blender and the polygons are coming in with a weird look. I am exporting out of Modo as a FBX & OBJ and I get the same result with both. The polygons appear to be the correct shape but there is odd tearing look on the polygons any idea whats going on here?

I frequently come to the problem of having a mesh with parts I would like to render smooth and "hard" edges connecting them.   How can I set the mesh to show the sharp edges but render everything else smooth?  In the example I would like the sides of the individual cylinders render smooth but the intersection between bottom and top to be sharp/flat


When defining a tcolorbox-environment, there is the option fontlower available. However I have yet to discover to invoke that setting without using \tcbolower. Is it possible to get the content in the box set in sans-serif without using tcblower? I would prefer a native solution instead of a) using an unnecessary command, b) that dashed rule/line and/or c) using a work-around to circumvent the production of said rule. Screenshot of problematic MWE  Problematic MWE \documentclass[ parskip=false ]{scrartcl}  \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[english]{babel}  \usepackage{tcolorbox} \tcbuselibrary{skins} \newtcolorbox{specialnote}[1]{ fonttitle=\Large\sffamily, halign title=center, sharp corners, colback=white, title={#1}, width=(0.85\columnwidth), center, enhanced, frame style={ top color=black!70!white, bottom color=black!50!green }, boxrule=2mm, fontlower=\sffamily, }  \listfiles  \begin{document} \section{Just some words without meaning} Abc. Def.  \begin{specialnote} {Look look!} \tcblower asdfasdf \end{specialnote}  \end{document}

I am new in latex. My problem is that I want to make the text in the box italic.  \documentclass[a4paper,12pt,openany]{book} \usepackage{etex} \usepackage[utf8]{inputenc} \usepackage{chngcntr}    \usepackage{fontenc} \usepackage[french]{babel}   \usepackage{amsthm} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{color} \usepackage{dsfont}  \usepackage{lastpage}  \usepackage{sectsty} \usepackage[left=2cm,right=2cm,top=2.75cm,bottom=3cm]{geometry} \usepackage[Bjornstrup]{fncychap} \usepackage{hyperref}   \usepackage[T1]{fontenc} \usepackage{amssymb} \usepackage[most]{tcolorbox} \usepackage{cleveref} \newtcbtheorem[auto counter, number within = section]{defn}{Définition}{   colback=green!5,   colframe=green!35!black,   fonttitle=\bfseries, }{t} \begin{document} \begin{defn}{}{} asymptotically uniformly integrable relatively \end{defn} asymptotically uniformly integrable relatively \end{document}   The result :    But, I want the writing inside the Box in the following form:


Denote $(v_1, \ldots, v_n)$ the matrix that has columns $v_1,\ldots, v_n\in \mathbb{R}^n$. Let $A\in \mathcal{M}_{n\times n}(\mathbb{R})$. Is there a clever way (without expanding LHS and doing calculations) to show that $$\sum_{i=1}^n \det(v_1, \ldots, Av_i, \ldots, v_n)=\text{tr}(A)\det(v_1, \ldots, v_n)\ ?$$

Question:  Consider $f: (-\epsilon, \epsilon) \to \mathbb R^{m^2}$ a differentiable path of matrices $m \times m$ such that $f(0) = I_m$ and the function $g: I \to \mathbb R$ is defined by $$g(t) = \det f(t)$$  Show that $g'(0) = \mathrm{tr} \,a $ (trace of the matrix $a$), where $a = f'(0)$.   Attempt:  First we use that $\det f(t) = \det (f_1(t), \ldots, f_m(t)) $, where $f_i$ is the $i$-th row of the matrix $f(t)$ $m \times m$. Considering the operator $': \mathbb R^m \to \mathbb R^m$, $f(t) \mapsto f'(t)$  With this in mind $$\begin{align}g'(t) = \det'f(t) &= \sum_{i=1}^{m} \det (f_1(t),\ldots,f'_i(t),\ldots, f_m(t)) \\&\underbrace{=}_{(*)}\det(f_1(t), \ldots, f_m(t))\, \mathrm tr f'(t) \end{align}$$  For $t = 0$ we have   $$\begin{align}g'(0) &=\det(e_1, \ldots, e_m) \,\mathrm tr f'(0) \\&= 1 \dot\, \mathrm tr \,a \\& = \mathrm tr \, a\end{align}$$  I'm trying to come up with a proof using the fact that $\det$ is a $m$-linear form.   In order to prove $(*)$ I need the following equality, which according to this  holds.   If $A: V \to V$ is a linear operator and $f_0$ is a alternated $m$-linear form, such that $f_0 (e_1, \ldots, e_m) = 1$ then   $$f_0 (x_1, \ldots, x_m) \mathrm tr A = \sum_{i=1}^m f_0(x_1, \ldots, Ax_i,\ldots, x_m) $$  Could someone give a proof to this?


I am getting response like this  [   {     "id": "958315db-ca46-4b32-ad89-f0564a2bfa37",     "name": "XXXX",     "device_count": 3,     "gateway_count": 2,     "longitude": -109.207929275995,     "latitude": 33.1906871835467   },   {     "id": "4485e5ee-ba30-4103-8f24-c710efed3929",     "name": "YYYY",     "device_count": 0,     "gateway_count": 0,     "longitude": null,     "latitude": null   } ]   How can I parse it in JavaScript and get two ids and names in an array? Sorry, I am new to JavaScript

Given a string of JSON data, how can I safely turn that string into a JavaScript object?  Obviously I can do this unsafely with something like:  var obj = eval("(" + json + ')');   but that leaves me vulnerable to the JSON string containing other code, which it seems very dangerous to simply eval.


Is there a word for "when one reveals himself to be stupid, ignorant, foolish by attempting to appear intelligent, smart, witty"?

What is the word for someone trying to seem/be deep and intelligent, but really they are shallow, and not at all being insightful.  Pedant is about rules, so that is disqualified, the closest I could find is pseudointellectual, but that feels like cheating and clumsy as it is a simple compound word.


Show $\sqrt{1+\sqrt{2}}$ is algebraic over $\mathbb{Q}$ with degree $4$      Let $\alpha=\sqrt{1+\sqrt{2}}$, and it is a root of $f(x)=x^4-2x^2+1\in \mathbb{Q}[X]$, so $f(x)$ is irreducible in $\mathbb{Q}[X]$, thus $\alpha$ is algebraic over $\mathbb{Q}$.   Clearly, $\alpha$ is not a root of polynomial with degree one.  How to show $\sqrt{1+\sqrt{2}}$ has degree $4$? My thought is let $g(x_1)=a_1x^2+b_1x+c_1, q(x)=a_2x^3+b_2x^2+c_2x+d$ and let $g(x_1)=0$, $q(x_2)=0$, but is seems not right. Can anyone give a hit to do it? Thanks

Following my  the book then asks      Use this to determine when the field extension  $\mathbb{Q}(\sqrt{a+\sqrt{b}})$ over $\mathbb{Q}$  is biquadratic (where $a,b\in\mathbb{Q}$)   "this" means what proved in the linked post.  My thoughts: First, I don't know what to say when $a^2-b$ is not a square. When $a^2-b$ is a square I think that the extension is of degree $2$ if $a=b$, this leaves the case $a\neq b$ which I am also having problems with and I don't know what to do (I have some cases like if $m,n$ are different primes then the degree of the extension is $4$, but I don't have something that is general)  Can someone please help my do this exercice  ?


In the sentence below, is the pronoun "I" used correctly?  "If you mean that letter, then it was I who tricked you."

I was taught at school that the following expression is not grammatically correct:  Who is there? It's me.  The correct one is:  Who is there? It's I.  Can you let me know which one is accurate?


I am trying to write a script to check video file codec (using ffprobe), and encode them accordingly (with HandBrakeCLI).   Directory mp4 >> Sub-Directory >> mp4 >> >> Sub-sub Directory >> >> mp4   One of the problems in the script is that it can't do recursive sub directories. I tried to change the   for video_file in $(find . -type f -name '*.mp4')   the line above is probably wrong as I was testing afew of the codes by reading AskUbuntu and trying them out. Can't remember which got it to work, but in the end it was unable to deal with whitespaces in files/directories.  The script that works for current working directory, but not recursive directories:  #!/bin/bash for video_file in ./*.mp4; do ## using ffprobe to check video codec CHECK_FILE=`ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$video_file"` if [ $CHECK_FILE = hevc ] then     echo "$video_file is hevc/h265, skipping" else     # remove .mp4 extension     tempname="${video_file%.*}"_tmp.mp4     newname="${video_file%.*}"_hevc.mp4     HandBrakeCLI -i "$video_file" -o "$tempname"     mv -v "$tempname" "$newname"     echo "Moving on to next available file" fi done   Appreciate it if someone could show the way :)

How do I work recursively through a directory tree and execute a specific command on each file, and output the path, filename, extension, filesize and some other specific text to a single file in bash.


If run over ssh, a script with a trap statement with interrupt signal names (SIGINT, etc) gives an error and the trap does not work when an interrupt (eg. Ctrl+C) is sent. Eg:   #!/bin/bash  trap 'echo "Exit signal detected..."' SIGINT  # display something echo "This is a test"  sleep 100000   When this is run over ssh, it prints an error      trap: SIGINT: bad trap   and trap's command is never executed.  The problem is over ssh only; if run locally it works.  However, if the interrupt signal number (2) is used instead the name (SIGINT), it works including over ssh.  I thought it's preferable to use signal names and not signal numbers.  EDIT: Local system is running Fedora 28, and remote system is on Ubuntu 18.04.

I am running the script below to automatically download files from a server using lftp. It works except that when it runs I get the error message   trap: SIGINT: bad trap   If I replace SIGINT and SIGTERM with INT and TERM then it does work, but I don't know if it then achieves the same purpose. This is on Linux Debian 4.9.2-10.  #!/bin/sh login="login" pass="password" host="server.server.com" remote_dir='~/remote/dir' local_dir="/local/dir"  base_name="$(basename "$0")" lock_file="/tmp/$base_name.lock" trap "rm -f $lock_file" SIGINT SIGTERM if [ -e "$lock_file" ] then     echo "$base_name is running already."     exit else     touch "$lock_file"     /usr/bin/lftp -p 22 -u "$login","$pass" sftp://"$host" << EOF     set sftp:auto-confirm yes     set mirror:use-pget-n 5     mirror -c -P5 "$remote_dir" "$local_dir"     quit EOF     rm -f "$lock_file"     trap - SIGINT SIGTERM     exit fi


When I want to use sudo in Terminal I get this error: E: Type 'sudo' is not known on line 2 in source list /etc/apt/sources.list.d/mono-official-stable.list E: The list of sources could not be read. E: Type 'sudo' is not known on line 2 in source list /etc/apt/sources.list.d/mono-official-stable.list E: The list of sources could not be read  I know cause of this problem is Mono and I tried to delete it but I couldn't

Every once in a while I see users having issues to update due to errors like this:  E:Type 'ain' is not known on line 1 in source list /etc/apt/sources.list.d/some-ppa.list'   with varying types/line numbers/source list files (often after removing a PPA).  How can such an error be fixed?


I have recently started playing Diablo 3 again, and have discovered a "Seasonal" Character choice. Upon investigation, the main focus is to reward the player after achieving certain things within the game. However, 2 of these goals require the Expansion ("Adventure Mode"); which I don't have.  Without the Expansion, what do I get from playing a Seasonal Character specifically (that is not included in the base Expansion like extra classes etc)?

I own the base game of Diablo 3.  I didn't really like the "post-Inferno" content of the game, so I stopped playing shortly after I curb-stomped the final boss for the n-th time.    I understand now that a lot of things have changed in the base game.  There's also an expansion.  I don't plan to purchase the expansion, but some of these changes sound like they could make the game more fun for me.  I can guess that probably the new character and act are expansion-only content.  I know I'm probably , but if I go back and play now, what else will I be missing out on if I don't have the expansion?


Let's check the following script:  #!/bin/sh  func() {   echo "var: $var"; }  var="val" func  echo "after executing the command, var: $var"   Its output is:  var: val after executing the command, var: val   The var variable is left set after executing the command.  Is it correct behavior? I thought that command scope variables are set just for a single command.  If I use bash (set #!/bin/bash in the first line) instead of sh then setting a variable for a command doesn't affect the rest of the script:  var: val after executing the command, var:    In the busybox implementation sh and bash work equally: the variable is left assigned after executing the command.  To workaround the problem I use parentheses when executing such commands:  (var="val" func)   This way the var variable isn't touched in all shells.

In bash, say you have var=a.b.c., then:  $ IFS=. printf "%s\n" $var a.b.c   However, such a usage of IFS does take effect while creating an array:  $ IFS=. arr=($var) $ printf "%s\n" "${arr[@]}" a b c   This is very convenient, sure, but where is this documented? A quick reading of the sections on  or  in the Bash documentation does not give any indication either way. A search for IFS through  doesn't provide any hints about this effect either.  I'm not sure when I can reliably do:  IFS=x do something   And expect that IFS will affect field splitting.


Good afternoon!  I am in a beginner java class and am currently learning about making applets. Chrome is not letting me run them locally (they do run in appletviewer no problem) and I would like to test them out in a proper browser.  Can anyone guide me to where I may be able to find free web hosting? It doesn't have to be anything fancy, it can have all the adds it wants, I am just looking for somewhere I can test stuff out.  p.s. It is my first time asking something in this forum, please excuse any ignorance I still have.

This is a "catch-all" question designed to serve as an answer for all questions about choosing web hosting.  Pro Webmasters no longer accepts new questions about how to choose hosting.  All future questions pertaining to finding web hosting should be closed as a duplicate of this question. For more information about this policy please see .    How to find web hosting that meets my requirements?  What we're looking for in answers to this question are the basics about web hosting:   What is web hosting? What is the difference between shared, VPS, and dedicated hosting? How does a content delivery network relate to web hosting? Anything else you feel is helpful in finding a web host.   What we do not want is:   Endorsements or recommendations for specific web hosts We do not want your experience or other subjective information (just the facts please)


I have a Linode VM with Ubuntu, Apache2.  Right now, I have a large number of following lines in my /var/log/apache2/access.log file  www.example.com:80 223.96.144.128 - - [15/May/2015:11:30:13 +1000] "\x16\x03\x01" 400 0 "-" "-   Getting about 10 to 15 of these lines per second!  The thing is, I've removed "www.example.com" from Linode's DNS manager and I've disabled this domain on my apache configuration.  Why am I still getting it? and How could I remove it?

I'm having problems with apache server (CentOS VPS at Amazon). When apache starts, it starts to receive hundreds of requests, this is an example of the log:  173.208.216.165 - - [25/Jan/2015:18:23:11 +0000] "GET http://go.padstm.com/resources/img/iebt.png HTTP/1.0" 200 36023 "http://go.padstm.com/?id=173374&t=iframe&var=33110" "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)"   The path /resources/img/iebt.png is in my server, but not go.padstm.com. The strangest thing is that apache is accepting all the requests.  Other example: in this case, the entire resource is NOT in my server, but apache returns 200:  198.204.239.250 - - [25/Jan/2015:19:04:39 +0000] "GET http://fstads.com/show.php?z=26&pl=494&j=1&code=1422237874120 HTTP/1.0" 200 10819 "http://financezhen.com/?p=186#respond" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.2a1pre) Gecko/20110324 Firefox/4.2a1pre"   I don't know why these requests goes to my server, or why it returns 200...  Also, when apache starts and module prefork is enabled, it launches multiple httpd processes. If worker module is enabled, it launches multiple threads. Ok, but in both cases apache ends up consuming all the CPU and memory of the server, and there is not traffic directed to my server.  More info: ProxyRequests is Off. Also: I'm using ip-based vhosts:  NameVirtualHost xxx.xxx.xxx.xxx:80  <VirtualHost xxx.xxx.xxx.xxx:80>     ServerName mydomain.com     ServerAlias www.mydomain.com     DocumentRoot /var/www/html/w3prod     ServerAdmin admin@localhost     UseCanonicalName Off     CustomLog /var/log/httpd/w3prod.mydomain.com combined     ErrorLog /var/log/httpd/w3prod_error.mydomain.com </VirtualHost> <VirtualHost xxx.xxx.xxx.xxx:80>     ServerName picfarm.mydomain.com     ServerAlias www.picfarm.mydomain.com     DocumentRoot /var/www/html/picfarm     ServerAdmin admin@localhost     UseCanonicalName Off     CustomLog /var/log/httpd/picfarm.mydomain.com combined     ErrorLog /var/log/httpd/picfarm_error.mydomain.com </VirtualHost> <VirtualHost xxx.xxx.xxx.xxx:80>     ServerName test.mydomain.com     ServerAlias www.test.mydomain.com     DocumentRoot /var/www/html/engine-test     ServerAdmin admin@localhost     UseCanonicalName Off     CustomLog /var/log/httpd/test.mydomain.com combined     ErrorLog  /var/log/httpd/test_error.mydomain.com     ProxyRequests Off     ProxyPreserveHost On     <Proxy *>             Order deny,allow             Allow from all     </Proxy>     ProxyPass /bosh http://xxx.xxx.xxx.xxx:7070/http-bind/     ProxyPassReverse /bosh http://xxx.xxx.xxx.xxx:7070/http-bind/     ProxyPass / http://xxx.xxx.xxx.xxx:8080/     ProxyPassReverse / http://xxx.xxx.xxx.xxx:8080/ </VirtualHost>   Any help would be appreciated. Thanks!


I see many answers on the antecedent of "which", but not with this level of detail. In this sentence:  The values of MAE and RMSE obtained for the validation phase are similar, which confirms the method is robust.  Is the sentence correct? If yes, is the phrasal noun the entire first clause "Values of MAE and RMSE obtained for the validation phase are similar"? Or is the meaning of "which" more like "which fact", with "fact" understood? Basically: To which level can an antecedent of "which" be a phrasal noun (i.e. a set of more words)?

American talk show host Jimmy Kimmel was  as saying:  As “bad” as he was feeling for producers of both films, Kimmel admitted he was also “trying really hard not to laugh.” It was only after Denzel Washington yelled “Barry” from the front row that Kimmel realized he should step away from the microphone and let Moonlight director Barry Jenkins deliver his acceptance speech. “I did not pull a prank,” Kimmel assured skeptical viewers at home, saying that if he did he would have put a Bed, Bath and Beyond coupon in the envelope instead. “By the way, the producers of La La Land were very gracious, which they did not have to be, on stage and off,” he added.  The boldfaced portion is a relative clause in a supplementary use, and it seems that 'which', a supplementary relative pronoun, has 'very gracious', an adjectival phrase (AdjP), as its antecedent. How can the relative pronoun 'which' have an AdjP as its antecedent? (No other pronoun, relative or otherwise, can have an AdjP as its antecedent that I know of.) EDIT The call of the question has been shifted from "Can which have an AdjP as its antecedent?" to "How can it do so?"


I have a situation where I have N items in the population (e.g. these are item IDs in some inventory). Suppose I can sample and get back 1 item at a time, where each item has an independent and uniform distribution of being sampled; for example, I would call some function sample() and it would return one of the N items with probability $\frac{1}{N}$.  On average, how many samples would I need to observe all N items at least once? In other words, how many samples would I need to get the entire population? Obviously, I would need at least N samples as a lower bound, but is there a tighter bound?  Thank you for any help. I'm a software engineer, so please be gentle with any math.

What is the average number of times it would it take to roll a fair 6-sided die and get all numbers on the die?  The order in which the numbers appear does not matter.  I had this questions explained to me by a professor (not math professor), but it was not clear in the explanation.  We were given the answer $(1-(\frac56)^n)^6 = .5$ or $n = 12.152$  Can someone please explain this to me, possibly with a link to a general topic?


All REST API's that I've built have always had a good series of unit tests to verify that they are working as expected.  One downside to this approach is that the testing almost always happens on either a development or a CI server and they don't verify everything is running correctly on a live or a clone of the live servers.  Is anyone able to recommend any additional tools for checking the API at a higher level when deployed to a server.  Thanks Scott

There is a web API (RESTful) which is used by our mobile applications. Untill now we were manually testing it through mobile devices. Now, as per our client requirement, we need to automate the process.   Performance testing is one of the important tasks.  My problem is: I don't have an idea of how web API's work.  As of this my questions are:   What questions should I ask the developers so that I can proceed with automating? Which tools should I consider from JMeter and SOAPUI? (Costs are not an issue)


I've decided to build a route-planner for a game similar to Google Maps to expand my knowledge of graphs and to serve as portfolio project. I've done my research and got to the conclusion that I need to represent the roads as nodes in a weighted graph but my understanding is that only intersections are represented. My question is how would I also represent the shape of the road? My reasoning on how to solve this product would be that the graph node would have the link-cost and then as data would hold an object (JSON) with the information pertaining to the road shape until the next node/intersection. That poses some problems because what if I want to plan a route to the middle of a road. Take the figure below, I want to go from C to what is essentially between D and E but on the road above. Figure: Note that all of the roads are two ways so you can assume that the edges are directed and weighed.  I've tried to look into how OSM does this but the data size alone throws me off. Any resources would be very appreciated :)

Navigation systems like the Garmin and TomTom have always fascinated me.  I've wanted to implement small map/navigation applications to try out various pathing algorithms and expand on my knowledge of them.  This is a two part question:  1.) How is Map data stored?  - When you have a network of roads, how is this data generally stored?  What parts of the data are retained inorder to reproduce a map later?  Is each road stored as a series of points where it changes direction? What kind of file formats is this data stored in? Are there publically available libraries for easily parsing these files? Does anyone have specifics on how map/road data is stored/represented it would be very helpful.  2.) Navigation/Pathing - When doing basic pathing on this map data (a la Garmin) is my assumption correct that it is converted to a directed graph?  Is each road intersection a vertex with the edge weights the distance between vertexes?  This is what I was thinking about doing so I could try some basic well known pathing algorithms and see what I get.  I've seen  publically available map data on the US but I'm not sure how it is represented and if it is detailed enough for me to be able to build my directed graph out of it.  If anyone has any information I would appreciate it. The more detailed knowledge you have the better.


#include <stdio.h> #include <string.h>  int main(void) {     char ch='a';      printf("sizeof(ch)          = %d\n", sizeof(ch));     printf("sizeof('a')         = %d\n", sizeof('a'));     printf("sizeof('a'+'b'+'C') = %d\n", sizeof('a'+'b'+'C'));     printf("sizeof(\"a\")       = %d\n", sizeof("a")); }   This program uses sizeof to calculate sizes. Why is the size of 'a' different from the size of ch (where ch='a')?  sizeof(ch)          = 1 sizeof('a')         = 4 sizeof('a'+'b'+'C') = 4 sizeof("a")         = 2

In C++, sizeof('a') == sizeof(char) == 1. This makes intuitive sense, since 'a' is a character literal, and sizeof(char) == 1 as defined by the standard.  In C however, sizeof('a') == sizeof(int). That is, it appears that C character literals are actually integers. Does anyone know why? I can find plenty of mentions of this C quirk but no explanation for why it exists.


I've been playing MCPE for about 6 months alone. I want to know how I can play with some other guys in Survival mode. Do I need a server? If so, I have no idea how to create one.

Please bear with me since I don't play Minecraft, and I am asking this question on behalf of my kids.  They play mainly on a tablet, and want to know if they can set up a game with their friend who lives the other side of the village.  Is this possible, and if so, how?  (Please try to explain in a way that I can understand as a non-techie.)


I find an equation from wiki , $$\tan{\frac{\Omega}{2}}=\frac{|\vec{a}\cdot(\vec{b}\times\vec{c})|}{|a||b||c|+(\vec{a}\cdot\vec{b})|c|+(\vec{a}\cdot\vec{c})|b|+(\vec{b}\cdot\vec{c})|a|}\quad(1)$$ I want to calculate the solid angle or area spanned by these three vectors $$\vec{a}=(0,0,1),\\ \vec{b}=(\sin{\theta_{b}}\cos{\phi_b},\sin{\theta_b}\sin{\phi_b},\cos{\theta_b}),\\ \vec{c}=(\sin{\theta_{c}}\cos{\phi_c},\sin{\theta_c}\sin{\phi_c},\cos{\theta_c}). $$ Firstly, I can consider a special case $\theta_b=\theta_c=\theta$, $\phi_b=0$, $\phi_c=\pi/2$, then the area can be calculted by $$\int^{\theta}_{0}\sin{\theta}d\theta\int^{\phi_c}_{\phi_b}d\phi=(1-\cos{\theta})(\phi_c-\phi_b)\equiv\Omega_{A}\quad(2)$$ Eq.(1) gives $$\tan{\frac{\Omega}{2}}=\frac{\sin^{2}{\theta}\sin{(\phi_c-\phi_b)}}{(1+\cos{\theta})^{2}+\sin^{2}{\theta}\cos{(\phi_c-\phi_b)}}\quad(3)$$ Take $\phi_c=\pi/2$,$\phi_b=0$, Eq.(2) gives $\Omega_{A}=(1-\cos{\theta})\pi/2$, Eq.(3) gives $\tan{\frac{\Omega}{2}}=\sin^{2}{\theta}/(1+\cos{\theta})^{2}$, $\Omega_{A}=\Omega$ only when $\theta=\pi/2$. What is wrong here? Why the solid angle calculated by area and the equation from wiki give different result?

Given that the angles between the consecutive lateral edges AB, AC & AD meeting at the vertex A of a tetrahedron ABCD are $ α, β, γ$ (as shown in the diagram below). Is there any set-formula to find out the solid angle subtended by the tetrahedron at the same vertex?   Note: A tetrahedron is a solid having 4 triangular faces, 6 edges & 4 vertices. Three triangular faces meet together at each of four vertices & each of six edges is shared (common) by two adjacent triangular faces.


I'm making a simple method for a Java game with a class called DealOrNoDeal. It's a very simple method to get a int input from user between two bounds. But for some reason it thrown a java.lang.NullPointerException.   This is my code:   import java.util.Scanner; import java.util.Arrays; public class DealOrNoDeal {     public Scanner scanner;     public static void main(String[] args) {         new DealOrNoDeal().run();     }     public void run() {         Scanner scanner = new Scanner(System.in);         int[] values = {1, 20, 100, 1000, 2000, 5000};          System.out.println("Please select  the suitcase that you would like to keep (1-6): ");         int keuze = getIntBetweenBounds(1, 6);     }     private int getIntBetweenBounds(int lowerBound, int upperBound) {         int result = scanner.nextInt();         System.out.println("Please select  the suitcase that you would like to keep (1-6): ");         while (result < lowerBound || result > upperBound) {             System.out.println("Please select  the suitcase that you would like to keep (1-6): ");             result = scanner.nextInt();         }         return result;      }

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?


Is it more correct to say a computer program is erroring out, or it is erring out? Or are both statements grammatically incorrect?

I was wondering whether it is OK to use "errored out" as part of a status message in my code — is it grammatically correct to use it, or is there a better choice of words that I can use in its place?


I have two activity , the first activity pass value to Second activity  but the value is sent incorrectly that is the code for onclick in first activity    Intent nextScreen = new Intent(EgyptActivity.this, ViewRecord.class);              nextScreen.putExtra("name", "1".toString() );             startActivity(nextScreen);   second activity code is   Bundle i = getIntent().getExtras();          Receiving the Data      String name = i.getString("name");          Log.i ("name", name);     String ne="1";     Log.i ("ne", ne);     if (name==ne)     {Log.i ("info", ne);}      if (name!=ne)        {Log.i ("info", "2");}          }   LogCat   name: 1 ne: 1 info: 2   so please would any one tell me why the value name!=ne

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?


In the Sherlock episode "A Study in Pink", was the taxi driver bluffing when he asserted that there were two kinds of pills, those that kill and those that are harmless? I am not sure.

In  the serial killer asks Sherlock to take one of two bottles. 1 bottle is ok other is bad (poisonous). Whatever bottle Sherlock takes the serial killer takes the other one. That is same way the serial killer murdered his other victims.   But the episode doesn't say  how exactly serial killer achieved this. Before Sherlock can take one of the bottles the serial killer is murdered.   Does anybody know how the serial killer achieved this?


Q1. I was fiddling around with squaring-the-square type algebraic maths, and came up with a family of arrangements of $n^2 $squares, with sides $1,2\ldots n^2$ (n odd). Which seems like it would work with ANY odd $n$. It's so simple, surely it's well-known, but I haven't seen it in my (brief) web travels. I have a page with pics  of the $n=7,9,11$ versions, and description of how to construct them.  It seems the same method could square the plane, well, fill greater than any specified area, no matter how huge, at least. Which is what 'infinite' means, practically, isn't it? Anyway, it seems, if somehow not known (which it must be, surely - if anyone has links etc to where it's discussed I would be very grateful) then it's another way of squaring the plane.  Q2. Each of these arrangements can be extended, but the ones I've tried (5 or 6) have a little gap to the south-east, (i.e. where the squares don't fit neatly together) but otherwise can be extended forever. Is there an n for which there is no gap? There are more than 1 of each sized square in this arrangement, but still, it would be a nice tessellation with integer squares. 's a picture of the 7x7 version extended, and detail of the centre.

Q1. I was fiddling around with squaring-the-square type algebraic maths, and came up with a family of arrangements of $n^2$ squares, with sides $1, 2, 3\ldots n^2$ ($n$ odd). Which seems like it would work with ANY odd $n$. It's so simple, surely it's well-known, but I haven't seen it in my (brief) web travels. I have a page with pics  of the $n=7,9,11$ versions, and description of how to construct them; $n=11$ is:    It seems the same method could square the plane, well, fill greater than any specified area, no matter how huge, at least. Which is what 'infinite' means, practically, isn't it? Anyway, it seems, if somehow not known (which it must be, surely - if anyone has links etc to where it's discussed I would be very grateful) then it's another way of squaring the plane.  Q2. Each of these arrangements can be extended, but the ones I've tried (5 or 6) have a little gap to the south-east, (i.e. where the squares don't fit neatly together) but otherwise can be extended forever. Is there an $n$ for which there is no gap? There are more than 1 of each sized square in this arrangement, but still, it would be a nice tessellation with integer squares.  a picture of the 7x7 version extended, and detail of the centre.  Thanks for any answers or help.    P.s. This was too long for the comments section:  I wrote to Jim Henle the other day asking about this method, he hadn't seen it, thought it was nice, but not plane-filling in the way his method is. He wrote in part:     You are sort of "squaring the plane," but not in the sense that we did it. You are squaring larger and larger areas of the plane, but you don't square the whole thing. ... There are many meanings to "infinite". Aristotle distinguished between the "potential infinite" (more and more, without bound) and the "actual infinite" (all the numbers, all at once). Your procedure is the first sort, and ours is the second sort.   Which is what I had thought.   But the more I think about it.. the less clear the difference seems. Well, e.g. 'there are an infinite number of primes' means: there is no highest one; any number you can say, there's a higher prime. That's how that is defined, spoken about, to my (non-mathematician's) understanding. Similarly, there are an infinite number of these $n\times n$ square groups, there's no biggest one, any area you name, there's a bigger one. The Henle's method consists in adding more squares, ideally forever, but practically, you stop at some point and say 'and so on forever'. The procedure requires an infinite number of steps. I can't quite see how this series of $n\times n$ squares is so different. You have to start drawing again with each new $n$, sure, but I can't see that matters so much - there are an infinite number of arrangements, and there's the same 'and so on forever'.. i.e. "there is, strictly speaking, no such thing as an infinite summation or process."  Nov 2015. [I can't add comments to questions below, not sure why.]  Ross M, sorry about the delay! It seems you might be confused between the 2 parts, my fault for combining them in one question. (I still haven't heard anything much about either 2 from anyone.)  The first part is the basic $n^2$ arrangements of squares. (The second part takes just one of these and tries to extend it outwards, wonders about the possibility and mathematics of there being no gaps, and has many more than 1 of each sized square)  I still don't quite see why 'having to rearrange each step' makes a huge difference to anything. Imagine I had a method of going from $n^2$ to $(n+1)^2$ squares by adding more around the edges. Then, according to what people seem to be saying, I 'could tile the whole thing'? The way I've done it has exactly the same area as that would be, just it has to be redrawn. I don't see how that affects whether it 'tiles the plane' or not, or anything else. If someone could explain that to me, I would be very grateful.


HQ>enable  Password:   HQ#config terminal  Enter configuration commands, one per line.  End with CNTL/Z.  HQ(config)#int s0/0  HQ(config-if)#ip add 209.165.201.3 255.255.255.252  Bad mask /30 for address 209.165.201.3  HQ(config-if)#   How can I change?

This is a  about IPv4 Subnets.      Related:               How does Subnetting Work, and How do you do it by hand or in your head?  Can someone explain both conceptually and with several examples? Server Fault gets lots of subnetting homework questions, so we could use an answer to point them to on Server Fault itself.   If I have a network, how do I figure out how to split it up? If I am given a netmask, how do I know what the network Range is for it? Sometimes there is a slash followed by a number, what is that number? Sometimes there is a subnet mask, but also a wildcard mask, they seem like the same thing but they are different? Someone mentioned something about knowing binary for this?


I'm kind of new here. I googled for hours this evening, frustratingly looking for an answer to my problems.  So I compile like this: pdflatex -> bibtex -> pdflatex -> pdflatex -> pdfview I use TexMaker, i have a build folder ,etc etc. I started using a build folder because I saw it being advised to people with similar problems, I didn't have one before.   So my file is test.tex. When i use pdflatex, it creates a test.aux in the /build folder. Following this, bibtex goes to check in this file and sees this:  \relax  \bibstyle{biblatex} \bibdata{test-blx,test}   Then for some strange reason BibTex can't find test-blx.bib  although it is there, it's created by pdflatex. The error i get is this one:  Process started  This is BibTeX, Version 0.99d (MiKTeX 2.9) The top-level auxiliary file: build\test.aux The style file: biblatex.bst I couldn't open database file test-blx.bib ---line 3 of file build\test.aux : \bibdata{test-blx : ,test} I'm skipping whatever remains of this command I found no database files---while reading file build\test.aux Warning--I didn't find a database entry for "biblatex-control" Biblatex version: 3.0 (There were 2 error messages)  Process exited normally   And then i goes further downhill.  The test file i created looks like this:  \documentclass[12pt]{article} \usepackage[style=authoryear,backend=bibtex]{biblatex}  \bibliography{test.bib} \begin{document}  jan piet joris en korneel ze hebben baarden en hipsterstaartjes\nocite{*}  \printbibliography %\bibliographystyle{abbrv} %\bibliography{thesis} \end{document}   Using a different approach (biber,etc) is not a solution to my problem.  Thanks  EDIT: just to make sure: I had the problem before, when i wasn't using a build folder, as well. Bibtex can find the aux file that is created in the build folder without trouble.  EDIT2: so i played around with it some more. recreating my article in a new file seemed to fix the problem, but moving this recreated article to the folder of my original article messed things up again. So right now it seems that placing my .tex files in my dropbox folder (i always work in a cloud environment for safety) will cause bibtex to fail, very strange.

I used  to export my auxiliary files into a different directory. Basically i just add -aux-directory=build in Options -> Configure -> Commands and added the build folder into Options -> Configure -> Build -> Build Options -> Additional Search Paths -> Log. This succesfully generates all the auxilliary files in the build folder and it's also possible to generate the pdf. Unfortunately biber has a problem with this setup:  Prozess gestartet: biber.exe "MyFile" INFO - This is Biber 1.7 INFO - Logfile is 'MyFile.blg' ERROR - Cannot find control file 'MyFile.bcf'! - did you pass the "backend=biber" option to BibLaTeX? INFO - ERRORS: 1  I guess i have to specify the correct path for biber somewhere in Texstudio. Does anyone know where i have to update the path?  someone had similar problems. Also i'm not sure if the solution of   applies to my situation.


I tried to understand the use of interface and read  which says:     Interfaces define a standardized set of commands that a class will   obey.      The commands are a set of methods that a class implements.      The interface definition states the names of the methods and their   return types and argument signatures. There is no executable body for   any method that is left to each class that implements the interface.   I would like to ask why do I need to state name of methods and their return types and argument signatures in an interface while I can implement them directly in a class?

When should I use an interface and when should I use a base class?   Should it always be an interface if I don't want to actually define a base implementation of the methods?  If I have a Dog and Cat class. Why would I want to implement IPet instead of PetBase? I can understand having interfaces for ISheds or IBarks (IMakesNoise?), because those can be placed on a pet by pet basis, but I don't understand which to use for a generic Pet.


How to show that there are finitely many maps $\phi:\mathbb{N}\cup\{0\}\to \mathbb{N}\cup\{0\}$ with the property that $\phi(ab)=\phi(a)+\phi(b)$ for all $a,b\in \mathbb{N}\cup\{0\}$.

I am stuck on the following problem when I was trying to solve an entrance exam paper:  How many maps $\phi \colon \Bbb N \cup \{0\} \to \Bbb N \cup \{0\}$ are there with the property that $\phi(ab)=\phi(a)+\phi(b)$ for all $a,b \in \Bbb N \cup \{0\}$ ?  The options are as follows :   none  finitely many  countably many  uncountably many    Option 1 is not possible as if we take $a=1,b=0$ then we get $\phi(1)=0$ which is possible. But, I am not sure about the other options and could not decide which one holds good. Can someone explain?


Descend is intransitive when meaning  : He is descended from Cromwell.  Is descended an auxiliary to form the perfect aspect (as in He is finished, and He is gone)? According to , be descended from is an idiom.

"elements required by agent" is "required" here an adjective or verb?  another example "elements expressed by person".


I am having an issue and was going to ask a question, but searched first and found an existing question about the same issue. So now I want to know whenever any answer or any updates comes to that question.  Is it possible? If yes, then how?

I was wondering, is there a way to track particular questions in Stack Overflow?  For instance, if I see a question asked that I would like to see the answer to, is there a way that I can mark that question so that I can come back to it later?


I am currently developing a chat program where the Server as Ubuntu + Swift and client as JavaScript + WebSocket. Finally I reached the 0.1 version and I need to deploy it for public use.  I am renting a Virtual Cloud Server with Ubuntu 16.04 LST and I installed Swift 3 and my developed chat server as collection of .swift files. I can compile and run my chat server using swift commands. But as soon as I close my SSH connection the server stops. Yea, I can understand why.    How can I start my chat server permanently on my Virtual Cloud Server? Do I really need to make it as a service e.g. service squid start then how?   Where to start? I searched a lot in internet but could not find any example or advice. Any help? Thank you in advance.

I am developing a Nodejs application that the user interacts with via HTTP on localhost. There are practically no parameters and the daemon has virtually no dependencies and it just needs to be up by log-in time.  I would like to follow the idioms on each platform for start-up scripts, and that means Upstart on Ubuntu and systemd on Fedora.   Are there any good tutorials for writing systemd system files? Are there any 'best practices' to be aware of?   I have found these resources:        I am mostly looking for an API of sorts as a reference, as well as a basic format to follow.


If we are only talking about Class, as in java.lang.Class, what is the real difference between, say  Map<Class<?>, Class<?>>   and  Map<Class, Class>   ?  For other type names like List (which is not what this question is about at all), the wildcard makes a difference: you can't put something in a List<?> in a type safe manner. Since writing Map gives a compile warning yet I can still do map.put(Integer.class, String.class) on it, I was curious to know if it really does matter if Class or Class<?> gets used.  Would there be a real point to go through code that hasMap<String, Class> and replace it with Map<String, Class<?>, aside for the compiler warning?

I read about Java's type erasure .  When does type erasure occur? At compile time or runtime? When the class is loaded? When the class is instantiated?  A lot of sites (including the official tutorial mentioned above) say type erasure occurs at compile time. If the type information is completely removed at compile time, how does the JDK check type compatibility when a method using generics is invoked with no type information or wrong type information?  Consider the following example: Say class A has a method, empty(Box<? extends Number> b). We compile A.java and get the class file A.class.  public class A {     public static void empty(Box<? extends Number> b) {} }     public class Box<T> {}   Now we create another class B which invokes the method empty with a non-parameterized argument (raw type): empty(new Box()). If we compile B.java with A.class in the classpath, javac is smart enough to raise a warning. So A.class has some type information stored in it.  public class B {     public static void invoke() {         // java: unchecked method invocation:         //  method empty in class A is applied to given types         //  required: Box<? extends java.lang.Number>         //  found:    Box         // java: unchecked conversion         //  required: Box<? extends java.lang.Number>         //  found:    Box         A.empty(new Box());     } }   My guess would be that type erasure occurs when the class is loaded, but it is just a guess. So when does it happen?


Suppose $\{ a_n \}$ is a sequence of non-negative real numbers and $\sum a_nx^n$ converges for $|x|<1$. If $\lim_{x \rightarrow 1^-}\sum a_nx^n=A$, prove that $\sum a_n$ converges to $A$.   My attempt: given $\epsilon>0$, we can find $\delta$ such that if $x \in (1-\delta,1)$ then $|\sum a_nx^n-A| < \epsilon$. Now consider $|\sum a_n - A| \leq |\sum a_n - \sum a_nx^n| + |\sum a_nx^n-A|$ and since $x^n \rightarrow 1$ as $x \rightarrow 1^-$, we have $|\sum a_n - \sum a_nx^n| \rightarrow 0$ and so $\sum a_n$ converges to $A$. Is my proof valid? Thanks.  Edit: As suggested by @Clement C., my notes also say that by Tauberian theorem if we prove that $\lim_{n \rightarrow \infty}na_n=0$ then we can conclude the statement. I wonder if this is possible.

Let $f(x) = \sum a_nx^n$, with $a_n \ge 0$, have radius of convergence $1$.  Show that if $\lim_{x \to 1^-} f(x) = \sigma$, then $\sum a_n$ converges and $\sigma = \sum a_n$.  This is Abel summability with the hypothesis that $a_n \ge 0$.  I'm not sure how to proceed.


There was  Question on SO this morning (GMT Time). I made an edit (I don't have enough rep to do it without peer review) and the changes I commited were    Change the Title Fix code Indent   After this happened, my changes were accepted, and I +1-ed the question and put it as a favorite.   Within 1 minute I got +2 reputation, I have done peer-review-ed editing at least twice before but nothing like that happened.   Is this a bug on the system or is it standard behaviour? Is there any link we can find the detailed behaviour of how the edit-system works? Do all edits (either peer-reviewed or not) give you some reputation ?  Thanks for your time. I hope question is inline with the rules.

When clicking "edit" I see:  Your edit will be placed in a queue until it is peer reviewed. We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.  Like:     Likewise, when I am not logged in, clicking "improve this question" or "improve this answer" shows:  You are not . Your edit will be placed in a queue until it is .  And when I click 'Save', I get:  Thanks for submitting an edit. It is only visible to you until it's been approved by trusted community members  Like:     Who can suggest an edit? Where do suggested edits go? Who can vote on a suggested edit? How do suggested edits get reviewed? Can I earn reputation? What about abuse or bad edits? Sometimes the Community user approves or rejects my edit. Why is that? When can I not suggest an edit? Is there a minimum change requirement for a suggested edit? How do I check my suggested edit history? I disagree with the reasons why my suggested edit was rejected. What can I do? How do I know whether there are edits waiting for review? Someone suggested an edit to my own post, and the reviewers took the wrong action. What can I do? Are tag wikis included in this scheme? What do the "Improve Edit" and "Reject and Edit" buttons do? Why are apparently valid links to rejected edits resulting in 404 errors?   For more information about editing, see "" in the .


I'm mainly a Stack Overflower, but sometimes stray to darker sides of Stack Exchange. I get the customary 100 rep bump since I'm a 'trusted member'. However, on a recent site I visited (), I couldn't post an answer to a protected question because I didn't have 10 rep points on that specific site. So what was the purpose in giving me the 100 rep bump? More of a curiosity than anything and wondering if that's intentional or an oversight.

I registered on  only to post an answer to .  However, since it's a protected question, I am not allowed to answer it. (I found this info from ).  Worth to mention, I can comment on the above question, just not post an answer.  I was under the impression that the whole point of association bonus was to bypass such limits, so why isn't that the case for answering protected questions?