Suppose I have a training data-set A which is m x n, with samples arranged as rows, and I use singular value decomposition to find k principal directions defining a lower-rank space, k < n.  The output of SVD, named by convention U, Σ, V gives me an approximation for my training set: A approximately equal to U Σ transpose(V)  Moreover, the product U Σ is m x k with each row representing a vector in the lower-rank space that approximates the corresponding row in the rank-n original space. From this "lossy" data, it is also possible to return to the rank-n space by right-multiplying with V.  All of this is fine and well but let's say I now train some learning system using U Σ as my training set instead of the original A. In order to later exploit the trained system, I would have to query it using vectors in the lower rank space.  Assuming I have a query vector Q which is 1 x n and not present in the training set. I want to find the 1 x k vector in the lower-rank space that most appropriately matches Q. How do I do this?  Or am I completely missing the point of SVD and misunderstanding how it is useful for dimensionality reduction?

I have collected some data and stored them in an $N\times P$ matrix $A$. Using SVD, we can rotate $A=UDV^T$ into a new basis, also discarding some dimensions: $A\approx U\tilde{D}V^T$, where $\tilde{D}$ is a diagonal matrix of the first $k<P$ singular values, with the remaining diagonal values $0$.  Then I train some model using $U\tilde{D}$ as the source data. Now I have a new set of data $B$ that I want to test the model on. The first step in applying the model is rotating $B$ to correspond to the data $U\tilde{D}$ that I trained the model on. How can I do this?


So basically on a  I attempted and failed to answer, I have been following it because I am interested in the solution. People have been posting answers to solve it (some similar or identical to mine). Since I've been looking at the problem the whole time I felt an obligation to tell some people they were incorrect (maybe a bit too insistently). However after one of my corrections, I noticed my reputation suddenly drop; when I looked at the cause I noticed that two of my questions (which is all of them btw) had been simultaneously downvoted. The chances of that are very slim (since the questions have no recent activity) so I assume someone got angry at me correcting them and decided to lower my rep.    My question is:  is there any recourse for this or any way to tell if I am just being a suspicious person?

While browsing Stack Overflow, I noticed that I lost a lot of reputation:        Is this serial downvoting? Will it be corrected by a rep-recalculation? How often are those done?    Here's a second instance:


Is there a way to include line numbers and file name in C#'s Console.WriteLine function?  For example, on the line 115 of file "myClass.cs" I have the statement  Console.WriteLine("Hello world");   I would like the output to be:  [myClass.cs][115]:  Hello world

Considering that the debug data file is available (PDB) and by using either System.Reflection or another similar framework such as Mono.Cecil, how to retrieve programmatically the source file name and the line number where a type or a member of a type is declared.  For example, let's say you have compiled this file into an assembly:  C:\MyProject\Foo.cs  1:    public class Foo 2:    { 3:       public string SayHello() 4:       { 5:           return "Hello"; 6:       } 7:    }   How to do something like:  MethodInfo methodInfo = typeof(Foo).GetMethod("SayHello"); string sourceFileName = methodInfo.GetSourceFile(); // ?? Does not exist! int sourceLineNumber = methodInfo.GetLineNumber(); // ?? Does not exist!   sourceFileName would contain "C:\MyProject\Foo.cs" and sourceLineNumber be equal to 3.  Update: System.Diagnostics.StackFrame is indeed able to get that information, but only in the scope of current executing call stack. It means that the method must be invoked first. I would like to get the same info, but without invoking the type member.


What are the basic rules to put a logo in photos which are taken by you?  Where to add a logo that makes a picture more beautiful rather than spoiling it?

I was just editing  of my pics yesterday using Adobe Lightroom and watermarking it after I had finished editing it. I tried out different positions and angles while placing the watermark but most of them seemed to either block something or the other in the image or not allow the watermark to be seen otherwise. Could you suggest me what to look out for while positioning my watermark so that it does not spoil my work and looks good at the same time?


I am new to SO. I was wondering why the initial rep is 1 (and not 0) on any new stack exchange site that I join?

If a user is the type of person to consecutively get downvoted to potential negative reputation, so be it. What's the reasoning to maintain a minimum of one?  One reason that may justify this is of trying to not deter new users from the site who haven't read the FAQ and unknowingly and wrongly ask or answer a question. But most of us acknowledge this and not downvote in such a scenario.  So what's the reasoning behind this lower bound of 1?


This is from a lesson at the .  The stove should be positioned so a person using it doesn't have their back facing a doorway.  Why in the above sentence there is "their" instead of "he" or "she"?

This post has two parts: (a) a question and (b) a proposal.   (a) Often, particularly while writing technical papers or user's manuals, I have come across a situation where I need to say:      A user of this software may not need to use it from his personal computer. He can use it from a phone or even from his tablet.   I have seen many authors use female pronouns (i.e. “she” and “her”), but lately this trend seems to have ebbed somewhat.   I, and (I suspect) many other authors, do not want to use passive voice to avoid this.   Is there a gender-neutral way to describe the same situation?   (b) If there is none, I would like to propose using “ze” (for “he” or “she”) and “zir” (for “his” or “her”, rhyming with “fir”) as gender-neutral pronouns. I want to know how you feel about these words.


I am trying to install a gcc-arm version but run into trouble while trying to run the setup shell script.  Following step 2 in the prerequisites I downloaded GNU ARM embedded toolchain v4.9-2015q3.   I have now tried to run the setup_sdk.sh file with sh setup_sdk.sh. I get the following message.  robban@:Nordic-Thingy52-FW-master$ sh setup_sdk.sh  /bin/sh: 1: /usr/local/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc: not found Cannot find: "/usr/local/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc". Please set values in: "/home/robban/sommarjobb/Examensarbete/Nordic-Thingy52-FW-master/external/sdk13/components/toolchain/gcc/Makefile.posix" according to the actual configuration of your system. ../../../../components/toolchain/gcc/Makefile.common:25: *** Cannot continue.  Stop. /bin/sh: 1: /usr/local/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc: not found Cannot find: "/usr/local/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc". Please set values in: "/home/robban/sommarjobb/Examensarbete/Nordic-Thingy52-FW-master/external/sdk13/components/toolchain/gcc/Makefile.posix" according to the actual configuration of your system. ../../../../components/toolchain/gcc/Makefile.common:25: *** Cannot continue.  Stop.   Now looking at the path /usr/local/gcc-arm-none-eabi-4_9-2015q3/bin.  robban@:bin$ ls arm-none-eabi-addr2line  arm-none-eabi-gcc-4.9.3   arm-none-eabi-ld.bfd arm-none-eabi-ar         arm-none-eabi-gcc-ar      arm-none-eabi-nm arm-none-eabi-as         arm-none-eabi-gcc-nm      arm-none-eabi-objcopy arm-none-eabi-c++        arm-none-eabi-gcc-ranlib  arm-none-eabi-objdump arm-none-eabi-c++filt    arm-none-eabi-gcov        arm-none-eabi-ranlib arm-none-eabi-cpp        arm-none-eabi-gdb         arm-none-eabi-readelf arm-none-eabi-elfedit    arm-none-eabi-gdb-py      arm-none-eabi-size arm-none-eabi-g++        arm-none-eabi-gprof       arm-none-eabi-strings arm-none-eabi-gcc        arm-none-eabi-ld          arm-none-eabi-strip   The file is clearly there, and I can even do less arm-none-eabi-gcc to read the binary. But I can't do ./arm-none-eabi-gcc, because it tells me that the file is not found.  I also did add the bin directory to my path.  robban@:~$ echo $PATH /home/robban/bin:/home/robban/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/gcc-arm-none-eabi-4_9-2015q3/bin     robban@:bin$ uname -a Linux robban-K56CB 4.15.0-51-generic #55-Ubuntu SMP Wed May 15 14:27:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux robban@:bin$ file arm-none-eabi-gcc arm-none-eabi-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 2.6.8, stripped

I have a 64-bit (amd64 a.k.a. x86_64) Debian or Ubuntu installation. I need to run 32-bit (i386/i686) programs occasionally, or to compile programs for a 32-bit system. How can I do this with a minimum of fuss?  Bonus: what if I want to run or test with an older or newer release of the distribution?


I would like to know if there are any security risks/gains from encrypting twice, i.e. $$\text{plaintext}\xrightarrow{encrypt}\text{intermediate text}\xrightarrow{encrypt}\text{ciphertext}.$$ I would like to know if there are known gains/risks to what I'm looking at. Perhaps certain pairs of systems are compatible while others are detrimental. Or perhaps some systems are obviously its own inverse (like the one-time pad).  I would like to hear your thoughts and if there is a survey paper, that would be great as well. Thanks!

If I use the output of a cipher, for example a block cipher such as AES and encrypt it again with the same algorithm, I read that this introduces weaknesses into the overall security of the system.  Is this the case?


I often make some pdf files (not so long) using LaTeX. I often need to later modify these files and I often can not do this because I lost the tex source file. You will say: "Be more careful!"....  Leaving out jokes, I am thinking of a way of creating a pdf file with included the LaTeX code for generating it, but I don't know how to do it (I do not even know if it is possible). The only thing I can imagine is to save the code in the pdf metadata but I don't know how much space they can occupy and a problem is that I would like also to preserve the spacing of the code (indentation and breakline).  So my questions are:   Do you think using metadata is a good idea? What about the size (disk space) and  the spacing of the code? Have you any other idea to do it?

Several times now I have inadvertently lost the .tex file that generated a PDF file with pdflatex. Given what I know of the internal structure of PDF files, it should be possible to embed a text file containing the original LaTeX file into the PDF file so that it can be extracted later.   I am aware of no technology for doing this, but perhaps you are. Does anybody have something like this?


I watched this movie around 80s to 90s.  I remember the part about a monster creature, who wore a wedding dress and was about to marry the kid's dad. She changed her skin from a kind of green lizard-like or alligator-like but little creepy into human skin. Some kids found out this woman is not human; he tried to tell his father about it but he don't believe him.  Some kids went to the cave to free some people whom she had kidnapped.

To be honest, I vaguely remember this one scene from the movie (I was like 5 when I saw it I think).  The scene depicts a teenager spying on this stepmom/dad's girlfriend along with a girl (possibly girlfriend) because he has a hunch something weird is up with her and he sees her in the backyard transformed into her alien form.  The movie probably belongs to the horror-scifi genre since the alien form was scary (at least to the 5 year old me).  The movie is possibly from the late 80s/early 90s.


How can I sort the name of student on basis of their marks? The marks of student is provided. Can I use Collection class in java for the sorting? Should I import something?  import java.util.*;  class ShortRecord {     public static void main(String args[]) {        // Create a hash map       HashMap hm = new HashMap();       // Put elements to the map       hm.put("Zara", new Double(3434.34));       hm.put("Mahnaz", new Double(123.22));       hm.put("Ayan", new Double(1378.00));       hm.put("Daisy", new Double(99.22));       hm.put("Qadir", new Double(-19.08));        // Get a set of the entries       Set set = hm.entrySet();       // Get an iterator       Iterator i = set.iterator();       // Display elements       while (i.hasNext()) {          System.out.print(me.getKey() + ": ");          System.out.println(me.getValue());       }     } }

I am relatively new to Java, and often find that I need to sort a Map<Key, Value> on the values.  Since the values are not unique, I find myself converting the keySet into an array, and sorting that array through array sort with a custom comparator that sorts on the value associated with the key.  Is there an easier way?


Hei,  I am trying to add a textbox to my document. The textbox should contain both text and one or more figures, and should be floating itself. It works, as long as I do not include the caption package. However, as soon as I use the caption package, the caption of the figure is moved outside the box. Any ideas? Bug in package caption? Something I missed? Or a good alternative for defining floating textboxes with figures?  Thanks, Theo  MWE:  \documentclass{article} \usepackage{lipsum,float} \usepackage[framemethod=TikZ]{mdframed}  \mdtheorem{boxtest}{Box}[section] \newfloat{floatbox}{tb}{abox}[section] \usepackage{caption}   \begin{document}  \section{First} Figure \ref{fig:test} is in Box \ref{box:test}.  \begin{floatbox}[b!]     \begin{boxtest}[Testbox]         \label{box:test}              \begin{figure}[H]             \centering             \includegraphics[width=5cm]{example-image-a}             \caption{Highly precise description of the example image: it is an A.}             \label{fig:test}         \end{figure}          \lipsum[1]     \end{boxtest} \end{floatbox} \lipsum[2]  \end{document}

I've created a new float element to define examples:  \usepackage{float} \floatstyle{plain} \newfloat{example}{thp}{lop} \floatname{example}{\textsc{Example}}   I want to set my example in an frame. Usually I use the mdframed or framed environment to set figures in frames.  The current problem is that I can't wrap my example with the caption. I can only wrap the example.  \begin{example}     \begin{mdframed}{         My example         \caption{content of the caption}     }     \end{mdframed} \end{example}   Is there a way to set the example and the caption in a frame like with a figure or a table ?  With a minimal example to see the difference between a figure and my example :  \documentclass[a4paper,twoside,12pt]{article}  \usepackage[francais]{babel}  \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[labelsep=endash]{caption} \usepackage{mdframed}  \usepackage{float} \floatstyle{plain} \newfloat{example}{thp}{lop} \floatname{example}{\textsc{Example}}  \begin{document}  % The figure \begin{figure}     \begin{mdframed}{         My figure         \caption{content of the caption}     }     \end{mdframed} \end{figure}  %The example \begin{example}     \begin{mdframed}{         My example         \caption{content of the caption}     }     \end{mdframed} \end{example}  \end{document}


So I'm working on my mathematical probability class, and I have the following question:  Suppose $\{A_n\}$ are independent events satisfying $P(A_n)<1$ for all $n$.  Show   $P(\bigcup _{n=1}^\infty A_n)$=1  iff $P(A_n i.o.) =1$. So, the backwards direction was trivial.  For the forward direction,  what I have so far is   $P\left(\bigcup_{n=1}^{\infty}A_{n}\right)^{C}=0=P\left(\bigcap_{n=1}^{\infty}A_{n}^{C}\right)=\prod_{n=1}^{\infty}(1-P\left(A_{n}\right))$  Since the $A_n$'s are independent.  Now, since $P(A_n)<1$,  we have  $1-P\left(A_{n}\right)>0$.  Hence, for the infinite product to be $0$,   we must have an infinite number of $1-P\left(A_{n}\right)<1$,   hence for an infinite number of $n$'s,   $P\left(A_{n}\right)>0$.  Now, I'm not sure if that's sufficient. Does that imply the desired conclusion that $P(A_n i.o.)=1$  I feel like it should....(Or did I make another mistake!)

Practice problem for exam:     Let ${A_n}$ satisfy $\sum\limits_{n=1}^\infty P(A_n \cap A^c_{n+1}) < \infty$ and $\lim\limits_{n\to \infty} P(A_n) = 0$.  Show that $P(\lim \sup A_n) = 0$.    I can see that it is sufficient to show that $P\left(\sum\limits_{n=1}^\infty A_n\right) < \infty$ and then apply the Borel-Cantelli lemma, but I am having trouble showing this from the information given.  I see an almost identical problem here: , however the hint there is not enough for me to make headway, and this problem is also different in which term gets the complement inside the first sum.


Trying to limit the user to only enter numbers in a text field.

Is there a quick way to set an HTML text input (<input type=text />) to only allow numeric keystrokes (plus '.')?


I'm working on an ASP .NET MVC application, and i'm the inexperienced guy on a team of 3.  One of my colleagues, the most experienced guy on the team, is constantly using var when defining a variable, although the functions that he uses to load the variable return a specific type(int, string and so on), is this a good practice?  I confronted him with this question but the answer he gave me was "i don't know search for it...", the experienced guy answer, you know...  So, is this a good practice?  Thank you!

After discussion with colleagues regarding the use of the 'var' keyword in C# 3 I wondered what people's opinions were on the appropriate uses of type inference via var?  For example I rather lazily used var in questionable circumstances, e.g.:-  foreach(var item in someList) { // ... } // Type of 'item' not clear. var something = someObject.SomeProperty; // Type of 'something' not clear. var something = someMethod(); // Type of 'something' not clear.   More legitimate uses of var are as follows:-  var l = new List<string>(); // Obvious what l will be. var s = new SomeClass(); // Obvious what s will be.   Interestingly LINQ seems to be a bit of a grey area, e.g.:-  var results = from r in dataContext.SomeTable               select r; // Not *entirely clear* what results will be here.   It's clear what results will be in that it will be a type which implements IEnumerable, however it isn't entirely obvious in the same way a var declaring a new object is.  It's even worse when it comes to LINQ to objects, e.g.:-  var results = from item in someList               where item != 3               select item;   This is no better than the equivilent foreach(var item in someList) { // ... } equivilent.  There is a real concern about type safety here - for example if we were to place the results of that query into an overloaded method that accepted IEnumerable<int> and IEnumerable<double> the caller might inadvertently pass in the wrong type.  var does maintain strong typing but the question is really whether it's dangerous for the type to not be immediately apparent on definition, something which is magnified when overloads mean compiler errors might not be issued when you unintentionally pass the wrong type to a method.


Why can an  abstract class have a constructor? As we can't create an object of it why would we need a constructor in an abstract class?

Can an abstract class have a constructor?  If so, how can it be used and for what purposes?


When I run genymotion, I got this error in the following screenshot:

So I am trying to run Ubuntu in a virtualbox but on installing 12.10 from the .iso I was greeted by a warning telling me that audio wouldn't work then I pressed next and this popped up:  Failed to open a session for the virtual machine Tux 3 VT-x features locked or unavailable in MSR (VERR_VMX_MSR_LOCKED_OR_DISABLED) Details  Result Code:  E_FAIL (0x80004005) Component:  Console Interface:  IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}   And then it doesn't work.  I assigned 4GB of my 8GB to Ubuntu, 100 dynamically allocated GB of space, and 12MB of graphics memory. I'm running an Asus p8z77 V LX mobo with an Intel i5 3550 processor.   Downloaded 12.04.2 on my PC and tried again. Still getting the same message.


I want to do some star trail and time lapse shoots this weekend and I have for the first time been looking into the interval shooting option on the Nikon D5100. I already understood that the interval time needs to be longer than the shutter speed so as a test I set the shutter speed to 30 seconds and the interval setting to 32 seconds. I said I wanted 3 shots.  I activated it and it took the first 30 second exposure, then seemed to sit around for another 30 seconds before taking a 2nd 30 second exposure and then decided it was done.  What I had hoped for was 3 x 30 second exposures with a 2 second gap between them. What have I done wrong to end up with such a big delay between exposures and then not even getting the requested number of shots?

I am trying to take 180 x 25 second exposures (changed down from 30 second ones) with say a 2 second interval, either with the internal Interval Timer or an external one. How would the menu read? Thanks to the previous reply to my first question regarding the same problem. On the 30 second exposure, the camera fired a shot and the green light flashed every 30 seconds for one hour or 100 shots.


I'm looking for a way to hide some search results based on their address for example. I'm interested about a "permanent" way, not a query-based one (like "-stuffIdontWant").  I'm thinking about a browser extension which allows to fill a blacklist, but there are probably other ways.

I want to block Yahoo Answers from Google searches. As there is no option from Google for that, are there any extensions for Chrome or add-ons for Firefox that can block sub-domain results from Google search?


\documentclass[12pt, french]{article} \usepackage{lmodern} \usepackage{amsmath} \usepackage{amssymb} \usepackage{mathrsfs} \usepackage{amsthm} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{babel} \usepackage[utf8]{inputenc} \usepackage[margin=3cm]{geometry} \usepackage[x11names]{xcolor} \usepackage{framed, etoolbox} \colorlet{framecolor}{VioletRed4}    \begin{document}             Soit f une application linéaire alors:     \[\forall x,y\in G,\ f(x)=f(y)\iff x=y\]   \end{document}

One can use the command such as \textcolor[rgb]{1.00,0.00,0.00}{boundary} to color the word "boundary" in a document.   Here is my question:  How to color the math symbols in $$? For example, can one turn $C^{2}$ into red in LaTeX?


suppose the following is mentioned in the tag a:  <a href=www.google.com/url?url=www.xyz.com> www.xyz.com/1213sdsd/en-us </a>    The text between the  tagname is also a link. How do I select the same using driver object in selenium.  my code:  String link = "www.xyz.com"; WebElement link = driver.findElement(By.partialLinkText(link)); link.click();

When you are writing Selenium/WebDriver automation scripts you will probably run into the exception NoSuchElementException. You think your selector is working, but somehow the element cannot be found.  What strategy should I take to analyse different reasons that this might be the case?   What should I research and how? Good answers would contain example situations and how to resolve them. (e.g. verify selectors, frames, waiting, etc)


Let we have the following sequence $$x_1=1$$ $$x_{n+1}=\frac{x_n^2+a}{2x_n}$$ such that $$a>0$$ how can I prove it is a convergent sequence and its limit is $\sqrt{a}$

a) Let $a>0$ and the sequence $x_n$ fulfills $x_1>0$ and $x_{n+1}=\frac{1}{2}(x_n + \frac{a}{x_n})$ for $n \in \mathbb N$. Show that $x_n \rightarrow \sqrt a$ when $n\rightarrow \infty$. I have done it in two ways, but I guess I'm not allowed to use the first one and the second one is incomplete. Can someone please help me?  We already know $x_n \rightarrow \sqrt a$, so we do another step of the iteration and see that $x_{n+1} = \sqrt a$.  Using limit, $x_n \rightarrow x, x_{n+1} \rightarrow x$ (this is the part I think it's incomplete, don't I have to show $x_{n+1} \rightarrow x$, how?), we have that   $$x = \frac x 2 (1 + \frac a {x^2}) \Rightarrow 1 = a/x^2 \Rightarrow x = \sqrt a$$ b) Let the sequence $x_n$ be defined as $x_{n+1}= 1 + \frac 1 {x_n} (n \in \mathbb N), x_1=1$. Show that it converges and calculate its limit. "Tip: Show that sequences $x_{2n}$ and $x_{2n+1}$ monotone convergent to the limit." I didn't understand the tip, how can this help me? Does it make a difference if the number is odd or even? Thanks in advance!


In one section of my document I have several equations. Due to the normal separation of paragraphs trough the equations I do not have any further passages in the text. Somewhere in the middle of the section I want to include a figure. As the section is quite long I don't want to set the \begin{figure} ... \end{figure} at the end of the section as the graphic would not be in the right position.  But if I am entering the graphic as shown in the example I get an indent at the beginning of the next paragraph after the equation.  Is there any way to prevent this?  \documentclass[parskip=full]{scrbook} \usepackage{lipsum} \usepackage{graphicx} \begin{document} \lipsum[1] % \begin{equation} 1+2=3 \end{equation} % \begin{figure} \centering \includegraphics[width=0.4\linewidth]{example-image-a} \end{figure} % \lipsum[2] \end{document}     Solution:  Commenting the line \end{figure}% prevents the extra space at the beginning of the new paragraph.

I see that the code in many packages and examples contains percent signs % at the end of (many) lines. What are they used for? Do they affect the parsing of those lines?


Teaching one student who is very good and another who is bad was a learning experience. Teaching a student who is very good and the other who is bad was a learning experience.  One side of the coordinating conjunction uses "one student", the other side only uses "another." The parallelism of this usage depends on whether the term "student" carries over from first clause of "and" to the second clause that begins with "another" making it "another student." does it need to be "another/other student?" Cite the rule for why or why not.

...on Finnis's view all distinct instances of basic goods are incommensurable — none is of more, less, or equal value with any other. —    I expect to see more or less than any other, but then equal shows up, and is followed by with. But since with any other cannot replace than any other, do you think this sentence illegitimately omits something?


I'm using the scrollBehavior(to, from, savedPosition) function of vue-router.  I have the following output for to.params:  {videoId: "18764"}  and the following for from.params:  {videoId: "18764"}  however the following console.log(to.params !== from.params)  returns true  Why is this?

A strict equality operator will tell you if two object types are equal. However, is there a way to tell if two objects are equal, much like the hash code value in Java?  Stack Overflow question  is similar to this question, but requires a more academic answer. The scenario above demonstrates why it would be necessary to have one, and I'm wondering if there is any equivalent solution.


One question please.  I am translating a web form into english. In this specific case what is correct?  Passenger quota or Passengers quota ?  Vehicle quota or Vehicles quota ?  Thanks!

Is it correct to say user accounts or users account when referring to the accounts any user has on a site like this one?  In general, in the case of a noun that is used as adjective for the noun that follows, is it better to use <plural-noun> <singular-noun> or <singular-noun> <plural-noun>?


Let's say we have a domain example.com   Domain registrar : NAME.COM Web Host : IPAGE.COM Email Host : GMAIL (Google Apps)   My understanding is that:    I should add MX records to use Gmail (clear) I must add A record to use Ipage hosting (clear)   What should be the Nameserver values? Should I keep the nameserver values of NAME.COM or change them to IPAGE nameserver values? And is it necessary to change nameservers?  UPDATE: I wanna make everything clear before I make actual changes.

$ORIGIN example.com. ; not necessary, using this to self-document  $TTL 3600 @        IN     SOA   ns1.example.com. admin.example.com. (                       1970010100 7200 1800 1209600 300)  @        IN     NS   ns1.example.com. @        IN     NS   ns2.example.com.  @        IN     A    198.51.100.1 ns1      IN     A    198.51.100.2 ns2      IN     A    198.51.100.3  sub1     IN     NS   ns1.example.edu.  sub2     IN     NS   ns1.sub2 ns1.sub2 IN     A    203.0.113.1 ; inline glue record   The role of a NS record beneath the apex of a domain is well-understood; they exist to delegate authority for a subdomain to another nameserver. Examples of this above would include the NS records for sub1 and sub2. These allow the nameserver to hand out referrals for portions of the domain that it does not consider itself authoritative for.  The purpose of the NS records at the apex of a domain, ns1 and ns2 in this case, seem to be less understood by the internet at large. My understanding (which may not be holistic) is as follows:   They are not used by caching DNS servers in order to determine the authoritative servers for the domain. This is handled by , which is defined at the registrar level. The registrar never uses this information to generate the glue records. They  used to delegate authority for the entire domain to other nameservers. Trying to do so with software such as ISC BIND will not result in the "expected" referral behavior at all, as the nameserver will continue to consider itself authoritative for the zone. They are not used by the nameserver to determine whether it should return authoritative responses (AA flag set) or not; that behavior is defined by whether the software is told to be a master or a slave for the zone. Most nameserver software will quite happily serve apex NS records that disagree with the information contained by the upstream glue records, which will in turn cause well-known DNS validation websites to generate warnings for the domain.   With this being the case, what are we left with? Why are we defining this information if it doesn't appear to be consumed by caching DNS servers on the internet at large?


I'm using LDME, a Debian based distro.  Is there someway, preferably automatic, where one could download the source to everything that might be executed and everything needed by those executables? I'd also like the downloaded "items" to be stored under one common directory, though a hierarchical structure under that directory would be fine.  An extra requirement would be to keep track of what was downloaded ( because that source would only be the source of a snapshot) and update that tree to what is presently installed.  NOTE: To be clear, I want to be able to download ALL the source for the software that's included with my distro.

Is there any way (dpkg, apt?) to get a package's sources and URL to repository, if available, in Debian ?


I have Ubuntu Mate 18.04 on my computer: No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 18.04.3 LTS Release:    18.04 Codename:   bionic  When I run in terminal: sudo apt-get update  I get: Ign:1 http://old-releases.ubuntu.com/ubuntu bionic InRelease Ign:2 http://old-releases.ubuntu.com/ubuntu bionic-updates InRelease Ign:3 http://old-releases.ubuntu.com/ubuntu bionic-security InRelease Err:4 http://old-releases.ubuntu.com/ubuntu bionic Release   404  Not Found [IP: 91.189.88.153 80] Err:5 http://old-releases.ubuntu.com/ubuntu bionic-updates Release   404  Not Found [IP: 91.189.88.153 80] Err:6 http://old-releases.ubuntu.com/ubuntu bionic-security Release   404  Not Found [IP: 91.189.88.153 80] Reading package lists... Done E: The repository 'http://old-releases.ubuntu.com/ubuntu bionic Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://old-releases.ubuntu.com/ubuntu bionic-updates Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://old-releases.ubuntu.com/ubuntu bionic-security Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.  This is my sources.list: deb http://old-releases.ubuntu.com/ubuntu/ bionic main restricted deb http://old-releases.ubuntu.com/ubuntu/ bionic-updates main restricted deb http://old-releases.ubuntu.com/ubuntu/ bionic universe deb http://old-releases.ubuntu.com/ubuntu/ bionic-updates universe deb http://old-releases.ubuntu.com/ubuntu/ bionic multiverse deb http://old-releases.ubuntu.com/ubuntu/ bionic-updates multiverse deb http://old-releases.ubuntu.com/ubuntu bionic-security main restricted deb http://old-releases.ubuntu.com/ubuntu bionic-security universe deb http://old-releases.ubuntu.com/ubuntu bionic-security multiverse  How can I fix this? I am not able to install programs from repository, nor to update to a new version of Ubuntu Mate 20.04. Any help is appreciated. Thank you

There are now errors when updating and I cannot install most software due to a corrupted  /etc/apt/sources.list   file. Is there a copy I can download to replace it?  The file would be for Ubuntu 12.04 (Final Beta) in the United States.


The title says it all, how do I move the Panel on Ubuntu 17.10 to the bottom?

Is there a way to move the top panel to the bottom in Gnome 3? It is very annoying to have this panel at the top, because then I have to aim for the close button when I want to close a window. When the panel is at the bottom, I can simply throw the mouse pointer to the corner. Big usability issue.


Can any one help me get a free Ubuntu installion disk in Bangladesh?

Earlier, if we registered on the Ubuntu site, we would get a CD shipped freely to our home. Why has Ubuntu stopped it?


What was the take off time of west jet flight number ws2 on June 23 2016 from Gatwick airport. I want to claim compensation and can't remember what time we departed.

The question  only deals with flights in the US sourced from the  . Is there some similar source for EU, Asia etc?


Is it possible to implement or at least simulate code  in Node.JS? If yes, how?     Hot swapping (frequently called hot plugging) is replacing or adding   components without stopping or shutting down the system. Erlang and   Lisp support hot swapping natively.

Is there any tool that enables you to "hot swap" JavaScript contents while executing a webpage?   I am looking for something similar to what HotSpot does for Java, a way to "hot deploy" new JS code without having to reload the whole page.  Is there anything like that out there?  Clarifying in case people don't understand "hot swap", as indicated by lock:  By "hot swap" I mean allowing me to change parts of the code contained on the page itself and its .js files.   Then this framework would detect the change - either automagically or by some indication from my end - and reload the code dynamically, avoiding the new server-side post (reload).   That kind of approach would simplify debugging and error fixing, since you don't need to reload the page and start the interaction all over again, from scratch.


My partner origins from Taiwan and would like to visit me in Sweden, for as long as possible. The idea is to apply for a Sambo Visa before she comes to Sweden and hopefully get it approved before she needs to go back.  Our plan so far is for her to visit Sweden on visa exemption (3 months) and 2 months in apply to extend it to a Visitor's Permit (3 months hopefully). Which will give her a residence permit card because she'll be staying longer than 3 months. My question starts after these 6 months, how does the 90/180 rule apply here?  Now looking at this link:   It states      Periods of stay authorised under a residence permit or a long-stay visa shall not be   taken into account in the calculation of the duration of stay on the territory of the Member   States.   Does the above mean that if we are allowed to extend her stay by another 3 months (she will stay 6 months in total) that once the Visitor's Permit ends she can again use her visa-free period but is required to go out of Sweden for 1 day and then come back in to re-activate it?  Any help is greatly appreciated!  Stay golden

I have searched the web a lot and could not find an answer that fits my situation. Here are two links that are quite contradictory:       My situation:  I've visited Portugal in December 2012 for 29 days on a Schengen visa valid from December 1st, 2012 to February 1st, 2013 for research purposes (I am a Ph.D. student). I want to visit Sweden from February 10th, 2013 to May 10th, 2013 (89 days). I have applied for a Schengen visa again (for research). How will the 90/180 rule work in my situation?


I started reading Quantum Mechanics and I'm being told that matter and light have both a particle and wave aspect to them. It is easy to understand the particle aspect of light: experiments show that light can push an electron out of it's orbit, so one imagines that light has to behave to some extent "as if" it was a particle that can collide with an electron. Furthermore, when we say that "light" behaves as a wave I understand this as simply meaning that light can be viewed as a specific solution of Maxwell's equation of the form $f(x - c t)$ and in particular it can be expanded into a superposition of "waves" of the form $\exp(2\pi i u (x - c t))$. However, I am confused as to what is being meant when people say that matter behaves like a wave. In particular I am confused as to the meaning of the de Broglie relation between the momentum of a particle and it's wavelength. What is the physical meaning of this wavelength associated with matter? And how is it associated to matter? My best guess is as follows: we can conceptually view a beam of electrons of a certain energy directed in a certain direction as behaving like a "wave". This allows us to explain certain experiments in a consistent way, by maintaining the principle of superposition: for instance when two beams collide we can view the resulting beam as a superposition of the original ones. In this way coupled with the statistical interpretation of the wave, we manage to obtain physical information on the collisions of electrons having different energy levels (within the limits of precision that are enforced by the uncertainty principle).

What does a  wave look like? Are de Broglie waves transverse or longitudinal?   Can they be polarized?    What about the de Broglie wave of a ground state neutral spin-zero Helium 4 atom?   What experimental evidence do we have that supports the detailed nature of a de Broglie wave?     I have always assumed that de Broglie waves were mathematically  identical to electromagnetic waves, but I just realized there is no basis for this assumption, and in fact it must be false, unless there is an analogue to both the magnetic and the electric components of the electromagnetic wave.  So what does a de Broglie wave "look like"?


OK, so this is still about a game... only a web-based browser game, in this case , a political/social role-playing game that's text/image-based, interactive fiction.  It's a political/social satire, basically.  I'm creating fictional magazines for a fictional nation, and they're being hosted on a flipbook site. My question relates to titles and same names.  I obviously can't call my fictional newspaper relating to the nation The Times or my fictional car magazine Auto Trader, as they're trademarked - I checked on ipo.gov.uk,  but if I was to call them The Anytown Express The Times or The Anytown Express Auto Trader (with different logos than the original to avoid copyright infringement, as well), would that fall under copyright infringement / trademark infringement, and is adding an affix sufficient enough to differentiate themselves?  I don't actually have anything yet on the site about my fictional nation's media... so am OK for now, but when I actually do, what's the right way to go about it?  Since this game is a parody/satire/social commentary, what's the right way to do a parody successfully?  All help is gratefully appreciated.

Most games build on other games' successes and many are downright clones. Where is the limit of imitation before legal issues come into play? Is it down to literary or graphic work like characters and storyline that cause legal problems, or can someone actually claim to own gameplay mechanics?  There are so many similar clone games out there that the rules are probably very slack or nonexistent, but I'd like to hear the views of more experienced developers / designers.


I have installed Ubuntu 16.04.2 LTS, and found that there are fewer applications in Software Center, for example, I could not find Evolution for email.  Is there any other way that I could obtain Ubuntu application other than using the Software Center, and download / install them?

How can I install applications like Google Chrome on Ubuntu?  Are there any commands to install an application?    Index of answers:


I am learning about serial communication, and I just can't understand why the start bit and the stop bit(s) are necessary.  I mean say I have two devices connected via serial ports, and the bit 1 is represented by +15V and the bit 0 is represented by -15V.  So for device 1 to send the 4 bits 0110 to device 2, device 1 should send the following voltages: -15V +15V +15V -15V.  What am I missing here, because it seems like it can work without the start bit and the stop bit(s)!

This might be obvious but I don't understand why RS-232 needs a stop bit. I understand that the start bit is necessary to notify the other end about the beginning of a transmission.  Let's say we are communicating at 9600BPS. We go from high to low, so that the receiver will know something is coming. The receiver also knows that we are at 9600BPS and it will receive 7 bits of data in total.  So, after receiving 7 bits, the transmission will end. Since we can determine the end of the transmission just by calculation, why do we need a stop bit as well?


I have dual booted Ubuntu 16.04 on a windows laptop. I have been using it for a week now. All of a sudden while I was working on Ubuntu it just blacked out and when I tried switching back my laptop on it's going directly to Windows.   I did check the BIOS menu and it doesn't show any sign of Ubuntu there.  And furthermore, time setting on my Windows has been messed up too.   I don't know if this matters but my battery was in critical mode while I was working but it still had some charge left.  Any help is appreciated. Thank you.

I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu.   How can I get Ubuntu back?


I would like to halt running JVM and store its state in persistant storage like HDD.  Then i should be able to restart the JVM from the point where I had stopped. I would like to have windows hibernate kind a functionality for JVM.

Are there any Java VMs which can save their state to a file and then reload that state?  If so, which ones?


I want to find the number of new lines in a string and then use this number in a while loop as the limit.  I can find and write the number of lines using:  echo "$MY_STRING" | grep -c '$'   In order to have the number of lines as integer and use it in while loop I do this:  MYNUM="$MY_PEERS" | grep -c '$'   However, this line writes 0, which is not the number of lines in my string, immediately to the terminal. Moreover, I cannot use MYNUM in a while loop. (I use $MYNUM in the while) How can I obtain number of lines so that I can use it in a while loop as the limit?

Below is a complete copy of a demo I'm using to to figure out to get the sed command to get rid of the spaces in a persons name, and compress it down to not have spaces.  Once this is done, I want to assign it to the variable comp then I can re-use it later on in the script. Here I am just trying to echo it to the stdout so I can see it worked.  If I run the script and enter my name as Ronald McDonald the result I get returned is RonaldMcDonald} with that curly brace on the end of his name, or whatever I type in.  How do I get it to work, so that the result doesn't append the } to the back of the assigned text.  #!/bin/bash  function readName {     echo "Enter your full name:"     read fullName     clear }    # end readName  function cmprsName {     comp={ echo "$fullName" } | sed 's/ //g' }    # end cmprsName  function sayItNow {     echo $comp }    # end sayItNow  function allTogether {     readName     cmprsName     sayItNow }    #end allTogether  case $1 in         -h | --help )           allTogether                                 exit                                 ;;         * )                     echo "$0 -h"                                 exit 1 esac


Fred and George come into possession of the Marauder's Map in their first year when they steal it from Filch's office. At this point, Peter Pettigrew is Percy's pet until he is given to Ron for his first year, two years later.  This gives Fred and George two full years to notice that an extra boy called Peter is sleeping in their older brother's room/bed at night. Given their propensity to prank Percy, and Percy's attempts to be an authority figure over them, I think it would be reasonable to assume that in two years they would have at least looked for him once at night on the Marauder's Map.  Even if they noticed this, thought it was strange but didn't report it, they then have a further two years of Pettigrew belonging to Ron. Even as a pair of teenage pranksters, I'm pretty sure seeing a man you've seen in your older brother's bed, sleeping in your 11-year old little brother's bed is going to set off alarm bells.  This is assuming they don't just immediately recognize Peter Pettigrew's name when they first see it. Harry Potter's story is well known by everyone in the Wizarding World, as McGonagall says, "There won't be a child in our world that doesn't know his name."  Peter is a hero of the Harry Potter story up until he is revealed as a traitor. He gave his life chasing down and confronting the betrayer of Harry's parents. I should imagine his name would also be well known to Fred and George, as they will have heard the story enough times.  Why don't Fred and George say anything?

Fred and George stumbled upon the Marauder's map in their first year. They passed it on to Harry while in their fifth year. Also note that, while talking to Harry on the train, Ron described Scabbers as being "Percy's old rat".   Hence, we can safely assume that the twins had the Marauder's Map for about five years. How could they not see Peter Pettigrew on the map, with Percy for first two years and with Ron for the next three years?  How come Harry didn't see Peter? How was Lupin the only one able to see Peter on the map?


I'm making an sftp server with OpenSSH, I have 2 lines of internet and connect to the server via 2 different route  Route 1 has gateway 192.168.2.1 and the LAN IP for the server is 192.168.2.11  Route 2 has gateway 192.168.5.1 and LAN IP 192.168.5.11  I test the connection to the server via 2 LAN IP and it working good. Next, I test the connection via 2 external IP and only 1 IP can connect.  So is there any way to build an sftp server can connect by both 2 different internet line? Please send me the link if you have a topic about this.

I building a linux server and today I have a problem. I'm using ubuntu for user not ubuntu server. My server use 2 ways to connect and use 2 different router *1: Using an 4 ports LAN card to make a bonding mode, the router have gateway 192.168.1.1, the IP of bonding is 192.168.1.147 .The bonding is working good, I can easy connect to sever. *2: Using normal internet port on mainboard, gateway is 192.168.5.1, IP for server is 192.168.5.11 . This connection use for SFTP server. Check this pictures to see my connection:     I make a sftp server using openssh, here is my test case using filezilla:  Connect to server via LAN ip 192.168.1.147 and external ip of router 192.168.1.1: working  Connect to server via LAN ip 192.168.5.11: working  Connect via external ip of router 191.168.5.1: not working   The result of not work test from filezilla:  Status:   Connecting to 123.21.47.2:3389... Response: fzSftp started, protocol_version=8 Command:  open "Deadlinesftp@123.21.47.2" 3389 Error:    Network error: Connection timed out Error:    Could not connect to server  I have already do the port redirection on router, and this router work well with another windows server. I feel like something in ubuntu OS is blocking the connection via external ip of 192.168.5.1, I turned off the ubuntu firewall and still not work. I have to focus on 192.168.5.1 because this is the internet line use for ftp or sftp, can't use another one. Does anyone here know why and can help me with this problem please. Thank you so much.


I got a database table having a nullable varchar2 column. The value is "NULL" as string. When trying to handle the result-set I'm facing the problem that the string "NULL" doesn't match anything.    I'm using an Oracle 11g XE database and ojdbc6.jar libraries.    What am I doing wrong?   Following an example for reproducing the behaviour:    Sql:    CREATE TABLE jtest (   ID NUMBER(3) PRIMARY KEY,   TEXT VARCHAR2(30) NULL ); INSERT INTO jtest VALUES (1, 'Test1'); INSERT INTO jtest VALUES (2, 'NULL');   nullstring.java    public class nullstring {  final static String JDBC_DRIVER = "oracle.jdbc.driver.OracleDriver";   final static String DB_URL      = "jdbc:oracle:thin:@myhost:1521:xe"; final static String DB_USER     = "myuser"; final static String DB_PASS     = "myuserpw";  public static void main(String[] args) throws ClassNotFoundException, SQLException, UnsupportedEncodingException {     Class.forName(JDBC_DRIVER);      Connection hDB = null;     hDB = DriverManager.getConnection(DB_URL, DB_USER, DB_PASS);      String sCelldata = "";     Statement oStatement = null;      oStatement = hDB.createStatement();     ResultSet oResult = oStatement.executeQuery("SELECT id, text FROM jtest");      while (oResult.next()) {         for (int i = 1 ; i < (oResult.getMetaData().getColumnCount() + 1); i++) {             String test = "NULL";             if ( test == "NULL" ) {                 System.out.println(">> 1111111111111111111111111111111");             }             if ( oResult.getString(i) == "NULL" ) {                 System.out.println(">> 2222222222222222222222222222222");             }             sCelldata = URLDecoder.decode(oResult.getString(i), "UTF-8");              if ( sCelldata == "NULL" ) {                 System.out.println(">> 3333333333333333333333333333333");             }              System.out.println("> [" + i + "] " + sCelldata);             sCelldata = "";          }     }      hDB.close(); } }   Output:    >> 1111111111111111111111111111111 > [1] 1 >> 1111111111111111111111111111111 > [2] Test1 >> 1111111111111111111111111111111 > [1] 2 >> 1111111111111111111111111111111 > [2] NULL >> 1111111111111111111111111111111

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?


Since my webhost have updated the php on the server from 5.2 to 5.3 I am unable to update any fields in the database if the text contains an apostrophe.  I have tried using mysql_real_escape_string() with no success.  I have tried....      $id = uniqid();     $case_account = $_POST['case_account'];     $contact = ucwords($_POST['contact']);     $subject = mysqli_real_escape_string(ucfirst($_POST['name']));     $desc = mysqli_real_escape_string(ucfirst($_POST['description']));     $resolution = mysqli_real_escape_string(ucfirst($_POST['resolution']));     $account_name = $_POST['case_account_name'];     $entered_by = $_POST['entered_by'];      $sql="INSERT INTO cases (id, account_id, name, description, resolution, account_name1, created_by, date_entered) VALUES ('$id', '$case_account','$subject', '$desc', '$resolution', '$account_name', '$entered_by', NOW())";     $result = mysqli_query($sql)or die(mysqli_error());   I have also tried using it in the actual query (I only tried round $subject to test).  $sql="INSERT INTO cases (id, account_id, name, description, resolution, account_name1, created_by, date_entered) VALUES ('$id', '$case_account',".mysqli_real_escape_string."('$subject'), '$desc', '$resolution', '$account_name', '$entered_by', NOW())";         $result = mysql_query($sql)or die(mysql_error());   I've also tried changing the field in the database to text from varChar to text and back again but with no success.  I know this should be simple but for some reason I can't make it work.

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


Before a battle starts, during the hero selection, I can choose one of my allie's strong heroes to help me during the battle.  But is it always the strongest one ? How does it work ?

For a given ally, I don't always get the same character to borrow, but it's usually one of the same two or three, and often it's the same one. It seems like it could be a random selection from among their most powerful characters. I've also read that it might be the character the ally most recently used as their leader.   I've noticed that my most recent team affects what's available. For example, if I had Chewie on my last team (for that squad) then no Chewies are available to borrow. That makes sense, in that I can't have two Chewies on my team, but they could just remove him on the squad selection and force me to replace him with someone else. Anyway, that's at least one thing that affects who can be borrowed, but is there anything else we know for sure?


Prove: If $|r| < 1$, then $\lim_{n\to \infty} r^n = 0$.  I know I am supposed to use the fact that $\lim_{n\to \infty} r^n = 0$ iff $\lim_{n\to \infty} |r^n| = 0$. I also know that $|r^n|$ is monotone and that I have to prove it by plugging in a value like 1/2 to show it's decreasing but that is as far as I have gotten. I just do not know how to use those ideas. I am stuck on how to prove that it is monotone and how the proof should look in general. Any help would be much appreciated.

Prove that the $\lim_{n\to \infty} r^n = 0$ for $|r|\lt 1$.   I can't think of a sequence to compare this to that'll work.  L'Hopital's rule doesn't apply.  I know there's some simple way of doing this, but it just isn't coming to me. :(


i am trying to read an odt file from terminal. When i type cat myfile.odt it shows me an image like this

Is there a way to cat or less a .odt file just as antiword does for .doc files?


Normally when I'm making something semi-transparent I edit the transparency in layer properties, but now im trying to make something in the layer (a symbol level) semi transparent. I want to edit the transparency of each fill symbol when I've symbolized by category. is this possible in ArcGIS 10.0?

I have a polygon layer which I am drawing in ArcMap using a graduated color symbology:  Is it possible to vary the transparency between the classes, so that the transparency tapers off with the color ramp? For example, draw the first range (0.175 - 0.225) with no transparency, but the last range (0.45 - 0.52) with 50% transparency. This is the effect I am trying to mimic, taken from Google Earth as a polygon KML:  One workaround could be to create a separate layer for each class using a definition query, vary each layer's transparency, then group them together but I am looking for a less cumbersome approach.


I would like to add onClick listeners to my buttons in Unity, C#. I have an array of these buttons. I am trying to loop through that array, and for each button, I am adding an onClick listener which calls a function that takes an index parameter. In that function, I print out the paramater that the function has received. However, when I click on one of these buttons, I get 10 as an output every time. for(int i = 0; i < roleButtons.Length; ++i) {     roleButtons[i].onClick.AddListener(delegate { changeEquipment(i); }); }  void changeEquipment(int index) {     Debug.Log(index); //Here I got 10 as an output after every single click. }

I met an interesting issue about C#. I have code like below.  List<Func<int>> actions = new List<Func<int>>();  int variable = 0; while (variable < 5) {     actions.Add(() => variable * 2);     ++ variable; }  foreach (var act in actions) {     Console.WriteLine(act.Invoke()); }   I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s.  It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output.  Is there a way to work round this limit to have each action instance have its own captured variable?


I used to use .local as TLD for small household networks however I got a popup that I wasn't allowed to use it anymore after a firmware upgrade of an Asus Router. I choose now for .lan as internal TLD. Apart from MS Technet / MS best practice / issues with Apple devices to stop using .Local anymore is there any other reason to stop using it?

At our office, we have a local area network with a purely internal DNS setup, on which clients all named as whatever.lan.  I also have a VMware environment, and on the virtual-machine-only network, I name the virtual machines whatever.vm.  Currently, this network for the virtual machines isn't reachable from our local area network, but we're setting up a production network to migrate these virtual machines to, which will be reachable from the LAN.  As a result, we're trying to settle on a convention for the domain suffix/TLD we apply to the guests on this new network we're setting up, but we can't come up with a good one, given that .vm, .local and .lan all have existing connotations in our environment.  So, what's the best practice in this situation?  Is there a list of TLDs or domain names somewhere that's safe to use for a purely internal network?


There is "tonal recognition," but the term seems to be ambiguous. I'm looking for a better one.   Let me describe the phenomenon:  You hear a tune, any tune. It may be pop music, or jazz, or rock, or opera, or symphonic music, or a theme song. At the same time (or on the same day, anyway) you experience something truly memorable; something pleasant, perhaps.   Days, weeks, months, or years pass.   Suddenly you hear the tune again, and it brings back all those memories.   You may or may not be truly aware that the tune is linked to those memories in your mind. You just like to hear it.  Your liking to hear it (and this is crucial) has nothing at all to do with the tune's actual artistic value. You assume it's a great tune because it makes you feel happy.   Thus, music appreciation per se does not play a part here: the tune may, in fact, be brilliant, or it may be completely worthless: you're bound to like hearing it because of all those memories.  Now, what is this phenomenon called? It's "tonal ..." something ... something ... I can't quite put my finger on it.

This has been bugging me for a while. I use the term liberally when I talk about music, and more often than not I draw blank stares.  It's a simple concept. You hear a tune and associate it with something that's happening in your life at the same time, mostly pleasant. Years later the same tune plays on the radio, and you recognize it, and it brings back all those good memories. Without realizing that it's the memory and not necessarily the tune itself that fills your heart with joy, you come to believe that the tune is great music regardless of its actual artistic value. That's the important point: the tune may be boring and stupid, yet you're still inclined to believe it's great.  This phenomenon is known as "tonal recognition." Is there a better term for it, or at least a term everyone's familiar with?


I have the following function: $$ f(x) =  \begin{cases}   |x|^\alpha \sin(\frac{1}{x}),  & x \neq 0,\\       0,  & x = 0.    \end{cases} $$ I need to find all values of $\alpha$ such that function: (a) is continuous at $x_{0}$ = $0$; (b) has a derivative at point $x_{0}$ = $0$; (c) has a continuous derivative at $x_{0}$ = $0$. I suppose that there is no such $\alpha$, because at $x_{0} = 0$ function is discontinuous, therefore whatever $\alpha$ we take, it will remain discontinuous. I would appreciate some theoretical explanation or any other hint.

If $$f(x)=\begin {cases} x^a\sin (1/x) & x\not =0 \\ 0 & x=0 \end {cases}$$ is continuous but not differentiable at $x=0$ find $a$. Since the function is continuous $$\lim_{x\to 0} x^a \sin \left(\frac 1x\right) =0.$$ Function is not differentiable at $x=0$ $$\lim_{h\to 0} \frac {h^a \sin (\frac 1h)}{h}$$ $$=\lim_{h\to 0} h^{a-1} \sin \left(\frac 1h\right)$$ must not exist. How do I find the interval of $a$ from these two results?


asdfg askjhgkasdhj gfskjd;hdgfk ;jasgdjkf hasdjkghf asdjkf hasdjkfgh klasdhdf jkasdjkf hdjksahf jklhdjkf asjkdhdf jkdlf ajsdhf jklashdf jaksdf hkjlasdjklf hasdhdf kdf kjlasdhdf hkjadf ljkdf adf kjahdkf adf kjashdfhkjlsasdf   else {         printf("[-]Invalid command\n");       }     }      bzero(buffer, SIZE);   }  }

I have a feeling that there must be client-server synchronization patterns out there. But i totally failed to google up one.  Situation is quite simple - server is the central node, that multiple clients connect to and manipulate same data. Data can be split in atoms, in case of conflict, whatever is on server, has priority (to avoid getting user into conflict solving). Partial synchronization is preferred due to potentially large amounts of data.  Are there any patterns / good practices for such situation, or if you don't know of any - what would be your approach?  Below is how i now think to solve it: Parallel to data, a modification journal will be held, having all transactions timestamped.  When client connects, it receives all changes since last check, in consolidated form (server goes through lists and removes additions that are followed by deletions, merges updates for each atom, etc.). Et voila, we are up to date.  Alternative would be keeping modification date for each record, and instead of performing data deletes, just mark them as deleted.  Any thoughts?


In the national English language test (equivalent to A-levels), exam sitters were supposed to fill the spaces in the sentences with a word of some grammatical function.  One such sentence read: 'Some major junctions even have a special set of traffic lights for cyclists, allowing ___ a head start ahead of motorists.'  The key of the test says the correct answer is 'them'. However, what I did choose was 'for'. Is 'allow for something' a reasonable construction in this case?

To be precise, I know that allow means to permit, and allow for is more like to make something possible, to enable, to make a provision for, but I'm still in doubt when I have to decide whether to use the preposition for or not.  For example, in the sentence taken from Google Dictionary entry used to explain usage of allow:     They agreed to a ceasefire to allow talks with the government.   I'm not sure what I would use in this example — maybe even allow for.


I noticed that these keys are not working on my Apple Wireless keyboard: q, w, e, r, t, y, u, i, & o. All the other keys work normally. The keyboard layout is set to US.  Is there a setting that I enabled accidentally or it is time to get a new keyboard?

This is an attempt to write a canonical QA for this issue, as per the Meta post:   I expect it to be periodically edited with the goal of becoming a comprehensive information resource.  I have a MacBook Pro that has a key(Shift, Return,   Command, P, etc.) that doesn’t respond when pressed or is stuck in the down position.    It's possible that my favorite beverage was spilled (or some other liquid damage).  It's also possible that I have no idea what happened.  It was working yesterday and suddenly today it's no longer working.  Is there any way to bypass or remap the key?  Can I  have the system ignore it completely?  (This question can also apply to external USB keyboards or the Bluetooth keyboards)


I am trying to match text after a hashtag.  Here is my current progress:  String: "Here sometext #BestRappaAlive #CategoryK #test #sadsadsadsa some more text"  Regex: /(?:#)(\w+)\b/g  Desired output: ["BestRappaAlive","CategoryK","test","sadsadsadsa"]  Current output: ["#BestRappaAlive","#CategoryK","#test","#sadsadsadsa"]  This seems trivial (I can just loop and slice) but I am curious as to where I am going wrong.

I want to match a portion of a string using a  and then access that parenthesized substring:  var myString = "something format_abc"; // I want "abc"  var arr = /(?:^|\s)format_(.*?)(?:\s|$)/.exec(myString);  console.log(arr);     // Prints: [" format_abc", "abc"] .. so far so good. console.log(arr[1]);  // Prints: undefined  (???) console.log(arr[0]);  // Prints: format_undefined (!!!)   What am I doing wrong?    I've discovered that there was nothing wrong with the regular expression code above: the actual string which I was testing against was this:  "date format_%A"   Reporting that "%A" is undefined seems a very strange behaviour, but it is not directly related to this question, so I've opened a new one, .    The issue was that console.log takes its parameters like a printf statement, and since the string I was logging ("%A") had a special value, it was trying to find the value of the next parameter.


What is the difference between the Golden Ball and the Golden Boot awarded in the FIFA World Cup?

My bookmaker has prices for the golden boot winner and the top tournament goal scorer in the World Cup. What is the difference between the two awards?


I used a juicer to juice vegetables. Then, I used the juice in making bread. Some of my friends said that something in vegetables affects the fermentation, namely the enzymes. They said it can kill the yeast. Is it true? Can you briefly explain?

I used vegetables juice for the additional liquid ingredients in milk bread, and it didn't rise. I think there is something in vegetables juice that killed the fermentation of dough.  This is a study, a food experiment. I used radish, mustard green, ginger, onion, garlic, beans, tomato, squash, eggplant, winged beans, winter melon, bitter melon, mexican turnip, and sponge gourd juice. The first step that we did was, we mixed first the yeast, milk and the juice. After mixing all the ingredients the dough become sticky, and it didn't rise.  In our first trial, we have done it right by using the extract of vegetables. And in our 2nd trial, we used the process of juicing, we actually use a juicer to get all the juice. and after all, the juice had an effect in our dough.


I tried to follow this guide:  (scroll half way down), but I didn't understand anything from that page..  I need something for beginners, please..  Thanks in advance :)

I have Ubuntu on my laptop. Now I want install Windows 7 in a dual-boot. How can I do this? I can't lose my Ubuntu files, and I'm afraid that I might break . Go  for UEFI only!


I've been going around the Ubuntu website looking for a 32bit version that isn't a LTS (Long Time Support) version, but I just can't seem to find one. Where is it?

As mentioned in the , Ubuntu 18.04 LTS will not have a 32 bit Desktop Image Installer. But in the  it has  32bit Desktop Images.  This is little off topic, but I'm confused.


Best defensive troops to have in your clan castle?

Several members of my clan have been asking for "Defensive Troops". Which got me thinking what are some good defensive troops that are readily available at the Barracks? Troops that Most members will have access to. So lets try to cap this at nothing better than healers.  So of barbarians, archers, goblins, giants, wall breakers, balloons, wizards and healers which are the very best at defense? By best I mean likely to save you the most money. Whether they kill the enemy before they can do damage or draw enemy fire works. Longevity of troops is also an important element to consider.  I am aware that what the enemy attacks you with will have some impact on this, so let's limit this to which troops are best most of the time.


I'm trying to fracture my statue object. I looked everywhere  but couldnt make the fracture work well. this is the blend file  anyone can help me? Thank you!!!

I have been trying to make a short clip of a bullet hitting a wine glass with wine in it, but I keep running into the same problem with the add-on. Every time I have used it the result has left me with at least a partial box being generated as several of the fractured pieces.  I have tried subdividing and/or adding a sub-surf modifier but the result only changes where the large distorted fragments end up. I have been having trouble with this for quite some time and I would greatly appreciate any help.


If I do:  sudo systemctl --user daemon-reload   It fails with:  Failed to connect to bus: No such file or directory   Being the "sudo" necessary, as this belongs to a package installation.

systemctl --user seems to be working fine for the desktop user:  dev@dev-VirtualBox:~$ systemctl --user > /dev/null dev@dev-VirtualBox:~$ echo $? 0   But when running the same command under the www-data user I get an unexpected response  dev@dev-VirtualBox:~$ sudo su www-data -s /bin/bash www-data@dev-VirtualBox:~$ systemctl --user > /dev/null  Failed to connect to bus: No such file or directory  www-data@dev-VirtualBox:~$ echo $?  1   How to enable systemctl --user here?  Running Ubuntu 16.04


I have multiple polygon .shp files that are denoting farm boundaries. The sources are varied and the original fields vary in name and number. These boundary files are to be imported into a Farm Management Software and require specific fields for identifying the data on import. The data in the fields will have to be entered manually. I am using QGIS 2.18  I have limited knowledge of scripting. A plugin would be awesome. I am aware of the "Add Field" in the Processing Toolbox. I could add each field separately through the batch function.  Is it possible to add more than one field to a layer in a batch configuration?

The label toolbar uses fields in the attribute table of vector layers to fine tune labeling (Data defined labeling). That's the main reason i'm looking for that, but it may have more applications.  I'd like to automatically add some format columns instead of adding them manually every time.   Do you know a plugin or a way to do this manipulation automatically on multiples layers ?  I tried to get the QGIS tool "Add a field to attribute table" into a quick model which works properly, but it creates a new memory layer. And I'd like just new fields.  ##Add_ETIKT_Field=name ##myvlayer=vector ##myvlayer=output vector outputs_QGISADDFIELDTOATTRIBUTESTABLE_2=processing.runalg('qgis:addfieldtoattributestable', myvlayer,'ETIKT_Y',1,15.0,4.0,None) outputs_QGISADDFIELDTOATTRIBUTESTABLE_1=processing.runalg('qgis:addfieldtoattributestable', outputs_QGISADDFIELDTOATTRIBUTESTABLE_2['OUTPUT_LAYER'],'ETIKT_X',1,15.0,5.0,myvlayer)   What I'm looking to automate is :   Open the attribute table Edit button Field Calculator button Add Column + Type + length + Precision   It seems there's some ideas in , but I'd love to avoid coding anything, or at least at minimum go through the modeler.     Adding and Removing Fields       To add fields (attributes), you need to   specify a list of field definitions. For deletion of fields just   provide a list of field indexes.   if caps & QgsVectorDataProvider.AddAttributes:     res = layer.dataProvider().addAttributes([QgsField("mytext", QVariant.String), QgsField("myint", QVariant.Int)])  if caps & QgsVectorDataProvider.DeleteAttributes:     res = layer.dataProvider().deleteAttributes([0])


I have Drupal module with a form and it works just fine (/my_module/search) I need menu hook for my_module/search/% and to be auto submitted and repopulate the form with the argument form url. So basically I need the same form just with the argument form URL submitted.

I have a custom module that displays a form.  Upon submitting the form, I want to redirect the user to a different page.  How can I do that?


Can the sponsor or applicant make a complaint for the decision of visit visa to UK for 6 months ?   What is the procedure or link to do that ?

I have applied recently for a general visitor visa to the UK to spend 10 days during Christmas with my British unmarried partner and it has been turned down.   The Entry Clearance Officer stated on his refusal notice the following:     I note that you have never previously travelled to the UK or any country with similar immigration requirements and you therefore do not have a history of travel and compliance to consider.      You have submitted an employment letter to confirm your occupation in KSA but I am required to also assess your personal, domestic and economic circumstances in determining whether you are genuine visitor travelling to the UK for the period and purpose you state.      You claim an income of SAR ........ per month which equal ........ GBP and from the evidence submitted this appears to be your sole source of income.   I note that this monthly income is reflected on your bank statements. However, the bank statement you have presented show a recent large deposit that are in excess of your stated income and inconsistent with the account history. You haven't provided evidence toward the origin of this recent deposit and in the absence of reasonable evidence I am not satisfied that these bank statements accurately reflect your personal circumstances.      In view of the above, I am not satisfied you have demonstrated that your circumstances are as you claim and therefore I am not satisfied that you're travelling to the UK for the period and purpose you stated. 41(i)and(ii).   Its true that I have deposited that sum of money right before I apply and it was a commission I received from work earlier this month.   So, could you please give me your advice on the above as I am planning to apply again soon. and how to avoid my application being refused again?


Is there a built in function or plugin I can use to achieve smooth lines for my polygons instead of the blocky ones I have now?

Here is a contour map for which all the polygons of levels are available.  Let ask how to smooth the polygons keeping all vertices preserved in their exact locations?    Indeed the contour is made on top of a grid data, you may suggest then to smooth the grid data and hence the resulting contour will be smoother. Note that this is not working as my desire since the smoothing function such as Gaussian filter will remove small packs of data and will change the range of the third variable e.g., the height which are not allowed in my application.    Actually I'm looking for a piece of code (preferably in Python) which can do the smoothing of 2D polygons (any type: convex, concave, self-intersecting etc) reasonably painless (forget pages of codes) and accurate.   FYI, there is  that does this perfectly, but using third party commercial applications is not my choice for this question.        1)    Scipy.interpolate:        As you see the resulting splines (red) are not satisfactory!  2)    Here is the result using the code given in . It is not working well!      3)    To me the best solution should be something like the following figure in which a square is being smoothed gradually by changing only one value. I hope for similar concept for smoothing any form of polygons.       Satisfying the condition that spline passes the points:     4)    Here is my implementation of "whuber's idea" line by line in Python on his data. There are possibly some bugs since the results are not good.         K=2 is a disaster and so for k>=4.   5)    I removed one point in the problematic location and the resulting spline is now identical to whuber's. But it is still a question that why the method does not work for all cases?        6)    A good smoothing for whuber's data can be as follows (drawn by vector graphics software) in which an extra point has been smoothly added (compare with update   4):      7)    See the result from Python version of whuber's code for some iconic shapes:     Note that the method seems doesn't work for polylines. For the corner polyline (contour) green is what I want but got red. This needs to be addressed since contour maps are always polylines although closed polylines can be treated as polygons as in my examples. Also not that the problem emerged in update 4 has not been addressed yet.  8) [my last]    Here is the final solution (not perfect!):        Remember that you will have to do something about the area pointed by stars.  There is perhaps a bug in my code or the proposed method needs further development to consider all situations and to provide desired outputs.


I have multiple internet accounts linked on macOS for calendar, mail, contacts etc. I wish to disable notifications for a particular account on the mail app. Is it possible to do so?

When managing multiple mailboxes, is it possible to disable the notifications for certain mailboxes?


I accidentally deleted my pen drive partition.  How can I recover the data from the usb-pen-drive?

Are there any tools, methods, incantations to recover recently deleted files on Ubuntu?  If it makes any difference, I want to recover a  2.x database file. But would be better to have a method/tool that works on any kind of file.


I'm trying to remember the title of a sci-fi novel I read back in 2007, maybe later. It was in English and printed in the USA. It was a dystopian future type novel that dealt with an Hispanic type (I think) protagonist who had a mother that was suffering from a disease in which her muscles were solidifying to the point that she was becoming a literal living statue.   It was a highly specialized hive/caste society in which you were identified by BODY SMELLS. if you gave off a certain odor you were recognized for whatever position you were assigned in life. The protagonist learns how to artificially mask his body smells/pheromones(?) in order to move up the societal ladder. I believe the book was called "Claive" or "Glaive" but I can't seem to locate it online. Any help in identifying this novel would be GREATLY appreciated!

I remember a lot of things about the book, but none of them have brought up a name and nobody I've asked remembers it   Pheromone technology plays a big role in the world- airborne pheromones serve as security systems that trigger allergic reactions in anyone not inoculated, were used to enforce cliques, and one of the major characters is basically an indentured servant to her mother because she was made addicted to a pheromone only her mother could supply. There was a bit about how you could use something sort of like those coin-operated binoculars to control drones in the atmosphere of Jupiter, but how they tended to be full of malware and would leave you craving various fast food brands. A biotech shuttle is mentioned as looking like "a bumblebee". There's a plot thread about a moon colony using cutting-edge biotech to grow habitation "pods"- towards the end one of the characters that joined the project and became merged with the facility as some sort of bioCPU takes over and launches the whole thing as a spaceship, I think using a hydrogen thruster fuelled by ice? There's a scene where a parking lot was "paved over with transparent plastic" years ago and you could still see cigarette butts and lotto cards frozen inside. Corporate agents(?) wore pastel-coloured ties because they were supposed to be "soothing".


p,q should be different,but if I let p = q,and encrypt the plaintext,then I can't decrypt it,so can decrypt it?

The two primes $p$ and $q$ part of the public key need to be distinct. What's the reason for them to be distinct? Is it because factorization of $p^2$ where $p$ is a prime is relatively easier, or is there some other reason?


I deleted a picture from the Facebook Lookback Movie yesterday, and now it's gone. Know how to get it back?

I was able to successfully create and share the FB Lookback movie, but had to delete it when I saw a picture had been included that should not be shared (someone with their ex).    After deleting the picture I tried to go back to  but it now only gives me a still collage of 6 pictures.  Does anyone know how to get a second chance at the movie?


I was just browsing Meta Stack Overflow, when I found this <iframe> hiding below the footer:        Could someone explain why  needs to be embedded at the bottom of the page?

Can someone authoritative explain what the cookies that teststackoverflow.com wants to set are for (tracking — I know, but tracking what, and what's wrong with the regular stackoverflow.com and is teststackoverflow.com part of the Stack Exchange infrastructure, and …).  And why does it think it needs to run JavaScript?


I am currently building a model based on a GARCH process. You can find a quick description of how the variance is modelled below.   $\sigma_t^2 = \alpha_0 + \sum\limits_{i=1}^{n} \alpha_i \epsilon_{t-1}^2$, $\epsilon_t = \sigma_t z_t$ where $z_t$ is a white noise process  Requirements are that $\alpha_0 >0, \alpha_i \geq 0,i>0$.  The current results show a confidence interval where the lower bound is negative and the upperbound is positive. How should I interpret this lower bound given the requirements for the variance process? Should one prefer a model with a higher BiC score over this model, that is, is it problematic that the confidence interval contains zero? Note that I do not want to simply remove this intercept from the model but that I want to know its implications on the requirement that the intercept should be larger than 0.

I've estimated an ARMA-GARCH model. All the parameters except the intercept ($\omega$) in the GARCH part are significant. So I tried to estimate the model again imposing that $\omega = 0$. I compared the information criteria of the two models and found out that keeping omega in the model gives the model a better fit.  Questions:   Does it make sense?  Can I keep $\omega$ in the model, although it appears non significant at 5% level, just because of better information criteria? Is it rigorous from a statistical point of view?


So, i'm just starting trying to understand tensor products. A basic exercise is given by showing the following equality:  $A \bigotimes \mathbb{Z}_m \cong \frac{A}{mA}$  Well, how about the map $\gamma(a,\bar{x})= ax$ mod $mA$.  And now i'm lost. Can anyone give me some insight please? Thanks!

I've just started to learn about the tensor product and I want to show: $$(\mathbb{Z}/m\mathbb{Z}) \otimes_\mathbb{Z} (\mathbb{Z} / n \mathbb{Z}) \cong \mathbb{Z}/ \gcd(m,n)\mathbb{Z}.$$  Can you tell me if my proof is right:  $\mathbb{Z}/m\mathbb{Z}$ and $\mathbb{Z} / n \mathbb{Z}$ are both finite free $\mathbb{Z}$-modules with the basis consisting of one single element $\{ 1 \}$. So $(\mathbb{Z}/m\mathbb{Z}) \otimes_\mathbb{Z} (\mathbb{Z} / n \mathbb{Z})$ has the basis $\{ 1 \otimes 1 \}$.  Therefore, any element in $(\mathbb{Z}/m\mathbb{Z}) \otimes_\mathbb{Z} (\mathbb{Z} / n \mathbb{Z})$  is of the form $(ab) 1 \otimes 1$ and any element in $\mathbb{Z}/ \gcd(m,n)\mathbb{Z}$ is of the form $k 1 = k$ where $k \in \{ 0, \dots , \gcd(n,m) \}$.  I would like to construct an isomorphism that maps $ab$ to some $k$. Let this map be $ab (1 \otimes 1) \mapsto ab \bmod \gcd(n,m)$.  This is a homomorphism between modules: it maps $0$ to $0$ because it maps the empty sum to the empty sum. It also fulfills $f(a + b) = f(a) + f(b)$ because there is only one element, $a = 1$.   It is surjective. So all I need to show is that it is injective. But that is clear too because if $ab \equiv 0 \bmod \gcd(m,n)$  then both $a \equiv 0 \bmod n$ and $b \equiv 0 \bmod m$ so the kernel is trivial.  Many thanks for your help!!


Jill did not allow last game to Liz.   Or     Jill did not allowed last game to Liz.   Do we always use the infinitive form of the verb with "did"?

Should I use the past tense with did? For example, I was to say:     The important question is: Did they knew what it means or not?   Or should I say:     The important question is: Did they know what it means or not?   In other words: Should I use past tense with did?  I looked at this:    but it didn't really answer my question.


I have a string that can be a hex number prefixed with "0x" or a decimal number without a special prefix except for possibly a minus sign. "0x123" is in base 16 and "-298" is in base 10.  How do I convert this to an int or long in Python?  I don't want to use eval() since it's unsafe and overkill.

How do I convert a hex string to an int in Python?   I may have it as "0xffff" or just "ffff".


I'm working with a client that would like to use the built-in Internet Explorer spell check to help their staff with some complex legal and medical terms. We have a list of words, and what we'd like to do is preload the user's browser dictionary so that we can skip each user having to add each word, and avoid the likely errors that may have.  I'd also consider a browser add-in or adding a custom language, but I haven't be able to find anything for the first or much detail for the latter.

Windows 8 has system-wide spell-check/autocorrect:    Users can also choose to add unknown words to their own custom dictionary:    I believe the dictionary is one of the settings that is synced/roamed as well.  So, how is one to edit the dictionary to, for example, remove words added by mistake? (In case the methods differ for Windows and IE, I'd like to know about both.)


I am trying to change the permissions for a folder outside my home directory in Ubuntu 14.04. by mistake I run the command "sudo chmod -R -777 /" in the terminal and my system crashes. Nothing is appearing on the screen. I have restarted it several times by but always a purple blank screen appears.  What can I do to recover from this. It contains lot of data related to my project.please help me.

I accidently ran  sudo chmod 755 -R /   instead of  sudo chmod 755 -R ./   I stopped it after few seconds, but now there is some problems such as  sudo: must be setuid root   How can I revert permissions back?


I am new to LaTeX, cant figure out this issue. I want a box around the following equation.   \begin{equation} A  State  S_{t}   is  Markov if and only  if  : \newline P [ S_{t+1}  |  S_{t} ] = P [  S_{t+1}   |  S_{1}.......S_{t} ] \end{equation}   The \newline has no effect. Some solutions say use boxed, fbox etc. but then I cannot use newline inside it gives me an error. If I use fbox the frame is too big, I just need a nice looking frame (like what boxed gives you), but I also want to use \newline in it.    Edit : I could not achieve exactly what the title says but I got what I wanted using the following lines.   \newcommand*\widebox[1]{\fbox{\hspace{1em}#1\hspace{1em}}} \begin{empheq}[box=\widebox]{align} \nonumber\\ A \ State \ S_{t} \  is \ Markov \ if \ and \ only \ if \ :\\ P\ [\ S_{t+1}\  |\  S_{t}\ ] = P [ \ S_{t+1} \  | \  S_{1}.......S_{t} \  ]\nonumber\\ \nonumber \end{empheq}

I often used \boxed{...} from the AMS math package to place a box around important equations.  However, this approach often produces somewhat awkward looking output.  Consider  \documentclass{article} \pagestyle{empty} \usepackage{amsmath} \begin{document}  \[  \boxed{c_i = \sum_jA_{ij}}  \]  \[  \boxed{c_i = \langle\psi|\phi\rangle}  \] \end{document}     Observe that in the first case the  box looks unbalanced while in the second case could do with more padding on both the top and bottom.  What is the best way to go about this?  I know that I could use a \phantom but am wondering if more elegant solutions exist.


Yesterday I downvoted on an answer, and posted a comment explaining why I disagree with the answer.  The author of the answer replied to my comment, and his reply convinced me that the answer was reasonable. Now I would like to remove my downvote, but I can't because it's locked in. What is the sense in that?

Why am I not allowed to change my vote after some period of time? There are times when I go back to things I voted on, and decide they didn't deserve that specific vote. (I get wiser as I grow older)


I never used external flash. Please tell me what to look for in an external flash for my Panasonic DMC-FZ200 camera.

I have zero experience with flash and want to learn how to use it from zero, for example by following the Strobist blog.  What are the absolutely necessary specifications I should look for when shopping for a flash, and can I find something in a price range less than $200.00?  My camera is a Nikon DSLR.


Using some web page, I tried to install tex on Windows, but with my internet environment it did not succeeed. I want to know other web pages to install. What web-page do you use to install tex?

I am new to TeX/LaTeX. How do I install TeX on Windows (7)? It seems that there are many different implementations, so which one is best for my OS?


I  read a book as a teen, and I can't remember the name.  It was about a disease of some kind that turned people into stone. Regular doctors couldn't find a cure, but there was a secret path (hidden in road signs) that led to a group of people who'd figured out a way to make victims into fully functioning, indestructible people. As best I can recall, it was called something like "The Hidden Highway" Any help is appreciated.

I remember reading a Sci-Fi book as a kid.  The protagonist caught a supposedly fatal alien skin disease that caused the body to "crystalize".  A secret organization treated him with devices that were drilled into the body and vibrated, the result was a person practically bulletproof, and stronger.  The procedure was painful. Other plot elements were telepathy and such.  The disease was supposedly acquired from space travelers, but that wasn't elaborated upon. The book was a bit of a hodge-podge, and a bit cheesy, but I remember being amused by it. . .


I am defining a "somewhat normal number" as such:  A somewhat normal number is a number where every possible numerical string in base $10$ can be found in said number at least once, but the density of each $n$ digit string may not be equal to $10^{-n}$.  A somewhat normal number is a weaker version of a normal number, since it removes the requirement of the density of each $n$ digit string being equal to $10^{-n}$. An example of a number that is somewhat normal but not normal would be $$0.\color{red}11\color{red}21\color{red}31\color{red}41\color{red}51\color{red}61\color{red}71\color{red}81\color{red}91\color{red}{10}11\color{red}{11}11\color{red}{12}11\cdots$$ i.e. every natural number (highlighted in red) with $1$s added to the end of each number is concatenated together (like in the ), and the number of $1$s is equal to the length of the natural number preceding it. The number contains all of the natural numbers and therefore each possible numberical string can be found in this number. However there are $1$s than other digits in this number, and this number is therefore not normal. Under this definition of "somewhat normal", can we say that $\pi$ is a somewhat normal number?

I came across the :    Which states:     $\pi$ Pi      Pi is an infinite, nonrepeating $($sic$)$ decimal - meaning that   every possible number combination exists somewhere in pi.  Converted   into ASCII text, somewhere in that infinite string of digits is the   name of every person you will ever love, the date, time and manner    of your death, and the answers to all the great questions of    the universe.   Is this true? Does it make any sense ?


I'm teaching out of Rosen's discrete math book, and for mathematical induction he says:  "Why is mathematical induction a valid proof technique? The reason comes from the well-ordering property, listed in Appendix 1, as an axiom for the set of positive integers, which states that every nonempty subset of the set of positive integers has a least element. So, suppose we know that P(1) is true and that the proposition P(k) → P(k + 1) is true for all positive integers k. To show that P(n) must be true for all positive integers n, assume that there is at least one positive integer for which P(n) is false. Then the set S of positive integers for which P(n) is false is nonempty. Thus, by the well-ordering property, S has a least element, which will be denoted by m. We know that m cannot be 1, because P(1) is true. Because m is positive and greater than 1, m − 1 is a positive integer. Furthermore, because m − 1 is less than m, it is not in S, so P(m − 1) must be true. Because the conditional statement P(m − 1) → P(m) is also true, it must be the case that P(m) is true. This contradicts the choice of m. Hence, P(n) must be true for every positive integer n."  Everything makes sense except for this sentence:  "Furthermore, because m − 1 is less than m, it is not in S..."  That doesn't appear to be part of the well-ordering property, or anything else I could find in the book.  Where did that come from and how can it be explained?  I see no logical reason m-1 cannot be in S.

Context: I'm studying for my discrete mathematics exam and I keep running into this question that I've failed to solve. The question is as follows.    Problem: The main form for normal induction over natural numbers $n$ takes the following form:   $P(1)$ is true, and for every $n, P(n-1)\to P(n).\qquad\qquad\qquad\text{[Sometimes written as $P(n)\to P(n+1)$]}$   If both 1 and 2 are true, then $P(n)$ is true for every $n$.  The question is to prove the correctness of the form above.    My work: My idea was to make a boolean statement and if it's a tautology in a true false table. That means the statement is always correct.  I've tried many times but I've failed.  Here is the original question in Hebrew:  n טענה כלשהי לגבי מםפר טבעי  $P(n)$ תהי   אם מתקימיים שני התנאים הבאים:  1- הטענה $P(0)$ נכונה  2- לכל n>0, $P(n)$ נכונות הטענה $P(n-1)$ גוררת את נכונות הטענה   אז $P(n)$ נכונה לכל מספר טבעי n  הוכיחו את נכונות משפט זה


I am trying to set the default umask to umask 002. I tried adding it to:  /etc/apache2/envvar /etc/profile   But after restarting Apache it hasn't changed? Still 0022. Where do I have to put it?  Thanks

I have an http daemon server process (yaws) that I would like to have server write any new files with a umask of 002, so that another user in the same group can modify, move, or delete files created by the daemon process.  This is on Ubuntu 10.04.  Unlike Apache, yaws does not have a configuration option for umask, so what methods are there for setting the umask of any daemon process?  I found  about changing the init script to add umask 002.  This did work, but I'm not sure editing the init script is the best way of making this easy to document and configure on multiple machines.  I also found reference to the pam_umask module .  It looks like this allows per user settings of the umask to be configured in the GECOS field of /etc/passwd.  Are there any other ways to set the umask for daemon processes?  And what would be the recommended way?


Considering a 2D motion in a plane and the equation of the trajectory of a point $y=f(x)$, I don't understand how exactly $\frac{\mathrm{d}y}{\mathrm{d}x}$ can be used.  In particular if I'm looking for the tangential acceleration, I need the tangential unit vector $u_T$.  Since   $$\lvert\vec{v}_y \rvert=\frac{\mathrm{d}f(x(t))}{\mathrm{d}t}=\frac{\mathrm{d}f(x)}{\mathrm{d}x} \frac{\mathrm{d}x}{\mathrm{d}t}=\frac{\mathrm{d}y}{\mathrm{d}x} \lvert \vec{v}_x \rvert$$  Can I conclude that  $$u_T=\frac{\vec{v}}{\lvert\vec{v}\rvert}=\frac{u_x+\frac{\mathrm{d}y}{\mathrm{d}x}u_y}{\sqrt{1+\bigl(\frac{\mathrm{d}y}{\mathrm{d}x}\bigr)^2}}$$  If so, can I do something similar for trajectories (like circles) in the form $f(x,y)=0$?  Furthermore how can I get the normal unit vector $u_N$ (for istance to find the normal acceleration) from the $u_T$ previously found?  I know that $u_N=\frac{\mathrm{d}u_T/\mathrm{d}t}{\lvert\mathrm{d}u_T/\mathrm{d}t\rvert}$ but the derivative is with respect to time here.  Am I missing something?

A lot of my problems have objects moving in circular paths with tangential and normal components of acceleration.  If the tangential component is non-zero though, the speed is changing so the radius of its path would also be changing.  So how can its path be considered circular? The size of of its radius of curvature of constantly changing.


I am finding patterns within a large text file, then I remove the patterns, and print the text. But, I am trying to replace the old text within the file (with the patterns) with the new_text without the patterns.   Im using the regex package, and no matter what i try it doesnt work   My command .replace is not working.   import re  rgx_list = ['Read More',             'Read',             'And follow us on Twitter to keep up with the latest news and and acute and primary Care.',...]  txt_path = '/Users/sofia/Documents/src/fakenews1/data/news-data/war_sc_r.txt'  with open(txt_path) as new_txt_file:     new_text = new_txt_file.read()  for rgx_match in rgx_list:         new_text = re.sub(rgx_match, '', new_text)  new_text.replace(txt_path, new_text)  print(new_text)   Thank you !

I want to loop over the contents of a text file and do a search and replace on some lines and write the result back to the file. I could first load the whole file in memory and then write it back, but that probably is not the best way to do it.  What is the best way to do this, within the following code?  f = open(file) for line in f:     if line.contains('foo'):         newline = line.replace('foo', 'bar')         # how to write this newline back to the file