body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
The tittle of this question is the main question. Why it is necessary to not consider these kind of functions in $\Lambda$. My teacher told me that if one consider these functions to be in the ring of symmetric functions, then the inner product would fail since this kind of functions would have infinitely non-zero homogeneous parts. But I do not see it clearly. Can anyone explain me why it is necessary to exclude the functions which do not have bounded degree? Thank you very much. $$\prod_i (1+x_i) \notin \Lambda.$$ | I am doing my thesis related with symmetric functions and representations. It is for this reason that I am reading MacDonald's book Symmetric Functions and Hall Polynomials. When reading chapter 1.2. The ring of symmetric functions, he also talks about symmetric polynomials. And he compares both notions and sometimes treats them as equivalent but sometimes not. Does anyone have a clearer explanation about what is the difference (if there are differences)? So, what is the difference between symmetric functions and symmetric polynomials? |
Intention is to make peanut butter. What is the easiest way to achieve the said aim? | I recently blanched and peeled the "skin" off 500g of shelled pistachios and 500g of almonds. For the pistachios I poured boiling water over them, waited a minute, strained, and then rubbed the nuts in small batches in a clean cloth to pull the skin off. For the almonds, I tried the same strategy as the pistachios. But this was not so good. The skin starts to dry too quickly. So I poured more lukewarm water over them. Then I dried them in an oven preheated to 150C for about 10 minutes. They are still a but soft, so I may have to do this again later. My question is, is there a better way? That took a really long time. |
Please tell me how to hide the top panel. Dragging any of the corner handles up on the other panels does not work. | I would like to close some view windows that I opened accidentally. See the image below: Edit: another note: I tried searching for the solution, but only found things like "Join Area", which don't seem to work in this situation. |
Do there exist non trivial solutions of the equation tan x = x and if they do exist, how to evaluate them algebraically? I graphed it on Desmos and got many random - looking solutions, is there any specific pattern or equation which describes their occurrence and if it does, what is the nature of these numbers? I mean like rational, irrational, transcendental etc | I know that the equation $$ \tan(x) = x $$ can be solved using numerical methods, but I’m looking for a closed form of the solutions. In my opinion, having only numerical solutions means that we don’t know the problem, and sooner or later, we’ll be able to find a closed-form solution or at least a power-series solution. I’m looking for an explicit form of a sequence $ (x_{n})_{n \in \mathbb{Z}} $ in $ \mathbb{R} $ such that $ 0 < x_{0} < \dfrac{\pi}{2} $, $ \tan(x_{n}) = x_{n} $ for all $ n \in \mathbb{Z} $, and $ (2 n - 1) \dfrac{\pi}{2} < x_{n} < (2 n + 1) \dfrac{\pi}{2} $ for all $ n \in \mathbb{Z} \setminus \{ 0 \} $. The existence of such a sequence follows from the continuity of $ x \mapsto \tan(x) - x $ over its domain. Its uniqueness follows from the monotonicity of $ \tan(x) - x $ over the intervals $$ \left( (2 n - 1) \frac{\pi}{2},(2 n + 1) \frac{\pi}{2} \right), \quad n \in \mathbb{Z}. $$ |
Reopen voters: flock() doesn't work on named pipes, this is not a dupe. I was trying to do the following with named pipes: mkfifo example.txt ( printf "456"; printf "abc"; printf "\n"; ) > example.txt & ( printf "456"; printf "abc"; printf "\n"; ) > example.txt & ( printf "456"; printf "abc"; printf "\n"; ) > example.txt & If I cat the example.txt sometimes I got: 456abc 456abc 456abc Other times I got: 456456456abcabc abc I was hoping the writes would be atomic. Is there any way to achieve atomic writes? | After going through the bash , question and one it's still not clear to me how can I perform atomic write (append) operations to a file in bash. I have a script that is run in multiple instances and at some point must write data to a file: echo "$RESULT" >> `pwd`/$TEMP_DIR/$OUT_FILE How is it possible to make all write operations from all concurrently running scripts to that file atomic (so that data from one instance doesn't overlap data from another)? |
Suppose we created a vacuum and spinned a turbine inside it with some amount of force. According to newton's second law it will keep spinning as there is no air resistance, so why can we not make electricity out of it? | There are many videos on youtube in which people arranged magnets in circle and rotated one placing in middle of that circle on a shaft, and the magnet (magnet motor) starts madly and continues its movement. Do they really rotate infinitely? If so, do they from where they get that extra energy to move so fast and infinitely? EDIT: This question is about real world scenario UPDATE: I am unable to find that particular video about which i talked about -- I added them to my favourites, but they are all now deleted :( -- there are hundreds of that that kind of videos. Some example videos links |
Given a file descriptor, is there a way in Linux to find out how many other file descriptors refer to the same file description (i.e. how often dup was called, not how often open was called)? I do not need to know which ones (they might be even in a different process by now). In fact I'd be quite happy knowing whether there are ANY or if this fd is a unique reference. | If I do (in a Bourne-like shell): exec 3> file 4>&3 5> file 6>> file File descriptors 3 and 4, since 4 was dup()ed from 3, share the same open file description (same properties, same offset within the file...). While file descriptors 5 and 6 of that process are on a different open file description (for instance, they each have their own pointer in the file). Now, in lsof output, all we see is: zsh 21519 stephane 3w REG 254,2 0 10505865 /home/stephane/file zsh 21519 stephane 4w REG 254,2 0 10505865 /home/stephane/file zsh 21519 stephane 5w REG 254,2 0 10505865 /home/stephane/file zsh 21519 stephane 6w REG 254,2 0 10505865 /home/stephane/file It's a bit better with lsof +fg: zsh 21519 stephane 3w REG W,LG 254,2 0 10505865 /home/stephane/file zsh 21519 stephane 4w REG W,LG 254,2 0 10505865 /home/stephane/file zsh 21519 stephane 5w REG W,LG 254,2 0 10505865 /home/stephane/file zsh 21519 stephane 6w REG W,AP,LG 254,2 0 10505865 /home/stephane/file (here on Linux 3.16) in that we see fd 6 has different flags, so it has to be a different open file description from the one on fd 3, 4 or 5, but from that we can't tell fd 5 is on a different open file description. With -o, we could also see the offset, but again same offset doesn't guarantee it's the same open file description. Is there any non-intrusive1 way to find that out? Externally, or for a process' own file descriptors? 1. One heuristic approach could be to change the flags of one fd with fcntl() and see what other file descriptors have their flags updated as a result, but that's obviously not ideal nor fool proof |
I fetch below error GoldfishAddressSpaceHostMemoryAllocator: ioctl_ping failed for device_type=5, ret=-1 2020-11-19 19:32:10.000 20105-20105/com.example.popularmoviebycookies E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.popularmoviebycookies, PID: 20105 java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View androidx.recyclerview.widget.RecyclerView.findViewById(int)' on a null object reference | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
Suppose we have a positive sequence $\{x_i\}$ where $i=1, 2, \dots , n$. And let $m=\mathrm{min}(x_i), \; M = \mathrm{max}(x_i)$. Notice that $m, M>0$. Prove this inequality (discrete version): $$ \frac{\sum_{i=1}^{n} x_i }{n} \cdot \frac{ \sum_{i=1}^{n} \frac{1}{x_i} }{n} \le \frac{m+M}{2} \cdot \frac{ \frac{1}{m} + \frac{1}{M} }{2} \;.$$ Or you can prove this continuous version, where $f(x)$ is positive and continuous on $[0, 1]$ , and $m$ and $M$ are min and max values of $f(x)$ on $[0, 1]$, respectively: $$ \int_0^1 f(x) \,\mathrm{d}x \int_0^1 \frac{1}{f(x)} \,\mathrm{d}x \le \frac{m+M}{2} \cdot \frac{ \frac{1}{m} + \frac{1}{M} }{2} \;.$$ Important: I do have a proof, because the continuous version is actually an excercise of a workbook of mine. But that proof is too tricky, lacking insight as to why the product of two types of "average"s is controlled by their max and min values. So I brought it up here in seeking of an insightful solution. Hopefully finding a proof directly to the discrete version, for it is easier to imagine with my brain. | Let $f,g$ be two continuous positive functions over $[a,b]$ Let $m_1$ and $M_1$ be the minimum and maximum of $f$ Let $m_2$ and $M_2$ be the minimum and maximum of $g$ Prove that $$\sqrt{\int_a^bf^2 \int_a^b g^2}\leq \frac{1}{2}\left(\sqrt{\frac{M_1M_2}{m_1m_2}}+\sqrt{\frac{m_1m_2}{M_1M_2}}\right)\int_a^bfg$$ I can't make any significant progress on this one... Thanks for any hint. |
I have added Schema Code (Json Ld) for organisation with ratings, there's no error in the Structured data testing tool + it shows correctly in the preview result. But even then the Ratings are not being shown on Google Search. | I have added to my site and I can confirm that has no issues with my code. After waiting some time Google has enabled review stars on all pages apart from the home page. Using Google's Site Search Command: site:http://www.example.com reveals: Question: How do I enable rich snippets on the homepage so Google displays review stars using Schema Aggregate Rating? |
how do I highlight every occurrence of a word, Linux? I have tried to show the contents of my file but I don't know how to highlight specific words! please help!! | Say I have the following file: $ cat test test line 1 test line 2 line without the search word another line without it test line 3 with two test words test line 4 By default, grep returns each line that contains the search term: $ grep test test test line 1 test line 2 test line 3 with two test words test line 4 Passing the --color parameter to grep will make it highlight the portion of the line that matches the search expression, but it still only returns lines that contain the expression. Is there a way to get grep to output every line in the source file, but highlight the matches? My current terrible hack to accomplish this (at least on files that don't have 10000+ consecutive lines with no matches) is: $ grep -B 9999 -A 9999 test test If grep can't accomplish this, is there another command-line tool that offers the same functionality? I've fiddled with , but it doesn't seem to have an option for it either. |
Can I use "pretty" as a degree adverb to describe an adjective that has a negative meaning? | What is the difference between using "pretty bad" and "pretty good" in this kind of slang context? It seems to be more of an American English quirk. Looks like you hurt your leg pretty bad Looks like you hurt your leg pretty good |
I need to change the class of each href item depending on its value. I have this code. <body onload="myFunction()"> <div class="indi-download"> <div class="pull-left"> <h6 class="file" id="file-display-id">%file_display_name%</h6> </div> <div class="pull-right"> <a class="download-link" id="download_link" href="%file_url%">Download</a> </div> </div> </body> In getting the href item on class download-link, I used this javascript code. function myFunction() { var anchors = document.querySelectorAll('a.download-link'); for (var i = 0; i < anchors.length; i++) { var url = anchors[i].href; var splitfile = url.split('.').pop(); if(splitfile=='pdf'){ //class="file" would be class="pdf-file" }else if(splitfile=="docx"){ //class="file" would be class="docx-file" }else{ //other file format... } } } on Inspect Element, Something this kind of output. Element 1 --- <div class="indi-download"> <div class="pull-left"> //Changed into pdf-file <h6 class="pdf-file" id="file-display-id">Sample PDF 1</h6> </div> <div class="pull-right"> <a class="download-link" id="download_link" href="http://mysite- info/download/files/file1.pdf">Download</a> </div> </div> Element 2 --- <div class="indi-download"> <div class="pull-left"> //Changed into docx-file <h6 class="docx-file" id="file-display-id">Sample docx 1</h6> </div> <div class="pull-right"> <a class="download-link" id="download_link" href="http://mysite- info/download/files/file2.docx">Download</a> </div> </div> How to achieve this kind of output? Changing the classes that depends on the values on href. Any Idea? | I have an element that already has a class: <div class="someclass"> <img ... id="image1" name="image1" /> </div> Now, I want to create a JavaScript function that will add a class to the div (not replace, but add). How can I do that? |
I am writing my PhD thesis and I am using an adapted version of the memoir-class + IEEEtran.bst for the bibliography style. The idea is to create a specific List of Publications exclusively with the papers of the PhD canditate. This List of Publications is divided in two sections:'pub' denoting peer-reviewed papers, and 'pubOther' for other publications. Inside the document, the command \selfcite{} is used for citations in aforementioned List of Publications. I get errors if I use \selfcite{} INSIDE a caption, while everything works fine if it is used elsewhere. Here I copy the error I get: ! Undefined control sequence. <argument> ...@tempc }\fi \fi \def \@tempa {\@nil }\ifx \@tempa \@nnil \else... l.96 ...ncies. (Source: \selfcite{JS2009})} ? While here I copy the piece of code describing the List of Publications and the command \selfcite \RequirePackage[resetlabels]{multibib} % Used for multiple bibliographies, as this class enables the use of a separate List of Publications %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % We define two 'sections' in our own List of Publications, but it can be % % expanded as desired. Here, 'pub' denotes peer-reviewed papers (journals, % % conferences), and 'pubOther' denote other publications (popular article, % % invited talk, workshop, ...). Use \selfcite{<key>} to cite these % % These two lists need to be separately compiled: 'bibtex pub' % % 'bibtex pubOther' % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \makeatletter \newcites{pub}{Peer-reviewed} \newcites{pubOther}{Other} \newcommand\biblabelprefix{} \newdimen\b@belwidth \newdimen\b@b@lwidth \newcommand\setbabelwidth[1]{{% \newbox\tmp \setbox\tmp=\hbox{#1}% \global\b@belwidth=\wd\tmp }} \renewcommand\@biblabel[1]{{% \newbox\tmp \setbox\tmp=\hbox{#1}% \@tempdima=\wd\tmp% \@tempdimb=\m@ne\@tempdima \advance\@tempdimb by \b@belwidth \rule{\@tempdimb}{0pt}[\biblabelprefix#1]% }} \def\@bibitem#1{% \item\if@filesw \immediate\write\@auxout{\string\bibcite{#1}{\biblabelprefix\the\value{\@listctr}}}% \fi\ignorespaces} \renewcommand{\@fnsymbol}[1]{% \ensuremath{% \ifcase#1\or \dagger\or \ddagger\or \mathsection\or \|\or \mathparagraph\or **\or \dagger\dagger \or \ddagger\ddagger \else\@ctrerr\fi } } \newcommand\blfootnote[1]{% Enable a footnote at begin of chapter to say e.g. parts of this chapter were published in ... \xdef\@thefnmark{\null} \@footnotetext{% \hspace{-1.8em} #1 } } \@ifundefined{@mb@citenamelist}{\def\@mb@citenamelist{cite,citep,citet,citealp,citealt}}{\relax} \def\selfcite#1{\setcitestyle{open={[\initials}}\citepub{#1}\setcitestyle{open={[}}} \newcommand\listofpublications{{% \small \setbabelwidth{10} \microtypesetup{protrusion=false}% \renewcommand{\bibsection}{%no chapter but simply section \section{\bibname} \prebibhook } \renewcommand{\biblabelprefix}{\initials}% Add prefix to biblabel for publications \continuouslabelstrue \bibliographystylepub{IEEEtran2}% \bibliographystylepubOther{IEEEtran2}% \chapter{List of publications} \scriptsize \bibliographypub{IEEEabrv,\bibfile} \bibliographypubOther{IEEEabrv,\bibfile}% \microtypesetup{protrusion=true}% }} \makeatother Can you please help me to find the problem? Thanks! | Problem: Getting error messages when trying to cite a reference in the figure caption. Not sure what I am doing wrong. Can't seem to find that this has been up previously either. Minimal Working Example: \documentclass{book} \usepackage[utf8]{inputenc} \usepackage[pdftex]{graphicx} \usepackage{epstopdf} \graphicspath{{figures/}} \usepackage{apacite} \bibliographystyle{apacite} \usepackage{filecontents} \begin{filecontents}{\jobname.bib} @article{rub14, author = {Rubin, Jared}, title = {Printing and {Protestants}: An empirical test of the role of printing in the {Reformation}}, journal = {Review of Economics and Statistics}, volume = {96}, number = {2}, pages = {270--286}, year = {2014}, } \end{filecontents} \begin{document} \begin{figure}[htp] \centering \includegraphics[width=\textwidth]{conceptdriven.eps} \caption{\label{fig:researchscope}The process of concept-driven design approach in relation to theory and use situation, adopted from \citeA[p.~282]{rub14}} \end{figure} \bibliography{\jobname} \end{document} Desired outcome: The reference to be directly after the words "adopted from". |
I have a file, jtc.sty, that houses all the repetitive stuff that normally goes into a latex document (usepackage statments, turning paragraph indent off, and some formatting stuff) that I include in pretty much all of my tex files. However, I find it annoying to manually copy over that file every time I want to use it. Is there some way to configure latexmkrc so that it knows where to find jtc.sty whenever I use it? | I know how to define a package or a class, but how do I make it available (to myself) at all times? Say I have the package file commonstuff.sty (or myprettyclass.cls), that I want to be able to include in any .tex file I create on my computer. Where do I put it? Do I need to run some installer on it, or is it enough to keep it in a certain folder? Note: I know I can just place it in the same folder as the .tex file, but that's not what I'm after here. I'm looking for a way to "install" the package centrally on my computer. |
How would I even do such a problem(without a calculator are anything like that)? I really don't have any idea on where to start for this problem. I know the answer is $1001$ from the that I made to solve this problem. It might be worth noting that the integer pairs that produced equal remainders all produced remainders of $1$ except for $x=y=0$, which produced a remainder of $0$. | Find the number of integer pairs 0 ≤ a, b ≤ 100 such that $a^{20}$ ≡ $b^{50} \pmod {101}$. Here is the solution: "Since is prime, there exists a primitive root g in modulo 101. For some integers x and y, with 1 ≤ x, y ≤ 100, let a ≡ $g^x$ and b ≡ $g^y$. Hence, $g^{20x}$ ≡ $g^{50y}$ (mod 101). Therefore, $g^{20x−50y}$ ≡ 1 (mod 101), and 100|20x − 50y, or alternatively, 10|2x − 5y. Since 2|2x − 5y, we have 2|y. Also, 5|2x − 5y, so 5|x. Hence, the congruence holds for all x and y such that x is a multiple of 5 and y is a multiple of 2. There are 20 choices for x and 50 choices for y, so our answer is 20 · 50 = 1000." In general, I'm very confused on the logical reasoning behind these steps. I'm a beginner in learning primitve roots and perhaps don't have enough background yet. I'm confused why you can let a ≡ $g^x$ and b ≡ $g^y$. Wouldn't that mean both $g^{x}$ and $g^{y}$ are both one Modulo 101? Finally, why does 100 have to divide 20x-50y. In fact, shouldn't it be 20x-50y dividing 100? I thought ord(a) of x always has to divide totient of x, and therefore 20x-50y|totient 101 which is 100. |
I am using a Fish shell and when I search through file with grep, I usually get a long output, which is difficult to further search through. If I use something like this grep -r 'email' . | less, I get an output limited to one page all right but I also loose all colors (the output is white). How do I use less while keeping colors, or is there other way to get my output one page at a time? | Can I get less not to monochrome its output? E.g., the output from git diff is colored, but git diff | less is not. |
Can I take raw chicken out of a mainade that consist of soy sauce, vinegar and other things and put ribs into it to marinade as well? Its a couple days old and been in the fridge the whole time. | I marinated chicken a couple weeks ago, and stored the marinade afterwards in a jar. Can it be reused, or is that dangerous? I've been told conflicting stories here. The marinade is mostly teriyaki if that makes a difference. Intended use of used marinade: Marinate chicken which will then be cooked in the oven. It will not be used with anything that won't be cooked (like a sauce). |
How would I go about proving that $n! \ge 2^{n-1}\ \forall n \ge 1$? The base case makes sense to me, but when I do the inductive step, I go here using the inductive step: $$ n+ 1 = k+1 $$ $$ (k+1)! \ge 2^{(k+1)-1} $$ $$ (k+1)! = (k+1)\cdot k!$$ $$\ 2^{k-1+1} = 2^k = 2^{k-1} \cdot 2 $$ $$(k+1) \cdot k! \ge 2^{k-1} \cdot 2 $$ $$ \therefore (n+1) \cdot n! \ge 2^{n-1} \cdot 2$$ Is this a viable proof? If not, what do I need to do differently in order to make it correct? Have I not gone far enough? | Im trying to solve the following question In the second step where do they get $k!=2^k-1?$ |
There is a funny modern deck where you play , but you really need to have it on the starting hand. How many mulligans should I take, if my deck contains 60 cards and contains 4 copies of Treasure Hunt? | In Magic, at the start of the game, you draw 7 cards. How would you calculate the likelihood of drawing a specific card in your opening hand? For example, let's say I have a 60 card deck, and I'm running 4 . What is the percent chance that I will have at least one Bird in my opening hand? |
How can we calculate this integral: $$I=\int\limits_0^1\frac{x^n-1}{\ln(x)}\,\mathrm dx$$ I believe that integral is equal to $\ln(n+1)$, but I don't lnow how to prove it. | $$I(\alpha)=\int_0^1 \frac{x^\alpha-1}{\ln x}dx.$$ As the title says, if someone could solve this without using the differentiation under the integral sign technique, I would be very grateful. |
Jerry is shown going into labour in the opening credits but I have not seen it in any episode. Am I missing any? | The show Rick and Morty has seen a couple of different title sequences throughout its three season (so far) run: Which of these scenes are from actual episodes? They do not need to be actual copies, just depictions of the same scene. They may be from after credit scenes, such as the one where . |
Well, I was watching The Walking Dead season 6, and during episode 1, when that walker bit Carter's face off, I started to wonder! What happens to all the flesh they consume? | It's something that's always bothered me. Especially now I'm watching The Walking Dead series. People die and turn into Zombies, from The Walking Dead we see that only part of the brain becomes active. Do they actually have a working digestive system and requirement for food or is it just impulse? If it's impulse... why? |
Give a precise meaning to evaluate the following: $$\large{\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\dotsb}}}}}$$ Since I think it has a recursive structure (does it?), I reduce the equation to $$ p=\sqrt{1+p} $$ $$ p^2=1+p $$ $$ p^2-p-1=0 $$ $$ p=\frac{1\pm\sqrt{5}}{2} $$ Did I do this right? | (Fitzpatrick Advanced Calculus 2e, Sec. 2.4 #12) For $c \gt 0$, consider the quadratic equation $x^2 - x - c = 0, x > 0$. Define the sequence $\{x_n\}$ recursively by fixing $|x_1| \lt c$ and then, if $n$ is an index for which $x_n$ has been defined, defining $$x_{n+1} = \sqrt{c+x_n}$$ Prove that the sequence $\{x_n\}$ converges monotonically to the solution of the above equation. Note: The answers below might assume $x_1 \gt 0$, but they still work, as we have $x_3 \gt 0$. This is being repurposed in an effort to cut down on duplicates, see here: . and here: . |
I am writing a twocolumn document. But the problem is the author's email is split in to two lines with a hyphen. How can I remove the hyphen from the email? MWE \documentclass[twocolumn]{article} \usepackage{lipsum} \title{Something} \author{Author\thanks{department name, institute name with details- [email protected]}} \begin{document} \maketitle \end{document} \maketitle \lipsum[2-5] \end{document} Screenshot | I want to footnote a URL which contains mathematical signs such as = and LaTeX asks me for a $ sign to take it to mathematical space (and therefore changing the font which is not suitable). How should I overcome this situation, i.e. put url in footnotes without using a $ sign and evading mathematical space? |
What is the proof for $\forall x \in [0, \frac{\pi}{2}]\quad \sin(x) \ge \frac{x}{2}$ ? Assuming it is true. | I need to show that $\dfrac{2}{\pi}<\dfrac{\sin(x)}{x}<1$ for $0<x<\dfrac{\pi}{2}$. I know I need to use the mean value theorem, would I just say that since $f$ is continuous in the interval (call it I). We know $\exists c\in I$ such that $f'(c) = \dfrac{f\left(\dfrac{\pi}{2}\right)-f(0)}{\dfrac{\pi}{2}}$. I don't know where this is going though. Also, would I need to show $\lim_{x \to 0}\dfrac{\sin(x)}{x} = 1$? Is there a way to do this without L'H Rule? |
I am reading Esteban Herrera's Java 8 Programmer II Study Guide. I already understand the keyword "synchronized," but not "volatile." In the first chapter, the author makes the case for the "volatile" keyword. First, he points out an issue with the following code. class Singleton { private static Singleton instance; private Singleton() { } public static Singleton getInstance() { if(instance == null) { synchronized (Singleton.class) { if(instance == null) { instance = new Singleton(); } } } return instance; } } He calls the above code imperfect, arguing, "The JVM, or sometimes the compiler, can optimize the code by reordering or caching the value of variables (and not making the updates visible)." He recommends adding the volatile keyword to the Singleton instance field because this ensures that its read and write operations will be atomic rather than cached in the case of multiple threads. I do not fully understand Herrera's argument. What does it mean to reorder the value of variables, and why would this be a problem? What does it mean for read/write operations in multiple threads to be atomic, and why is this necessary? Every explanation that I have found online is likewise full of jargon. Can anyone explain the volatile keyword in layman's terms without assuming a prior understanding of the above terms? | At work today, I came across the volatile keyword in Java. Not being very familiar with it, I found . Given the detail in which that article explains the keyword in question, do you ever use it or could you ever see a case in which you could use this keyword in the correct manner? |
Im struggling to think of a ring that satisfies this. I thought maybe a subset of Mat$(2,\mathbb{R})$ with all elements in the General Linear group but I am not sure that would form a ring. Any suggestions? | What are some examples of a non-commutative division ring other than quaternions? |
I am not sure whether this is a help request or a feature request, so I'm (at first) asking for help. Often, when I downvote a question/answer and a message "Please consider adding a comment if you think this post can be improved." appears, I see there is already a comment explains why this question/answer is not good. What should I do then? If I will ignore the pop-up, the user will not be able to understand the reason for my downvote. But duplicating the comment is not acceptable, of course. The best I can think of is upvoting the comment, but this does not clearly explains the correlation between the two. | Possible Duplicate: Is down-voting on SO supposed to be anonymous? I ask because it does not seem to me to be. Example: I asked a question today. I got 3 good and 1 mediocre responses. I voted up the two that helped me and accepted the one that worked best. A while later, several new comments from one person appeared, to which I responded (since they were questions for me), and then that same person posted a new answer. This answer was crap. The person missed the whole point of the question and gave vague "pseudo-code" (and calling it that is generous) that basically restated my question. Though I try to use down votes sparingly, especially when someone takes the time to answer a question I asked, I really want to down vote his answer. However, if I do, then my "reputation" will report "-1 downvoted" today. Since we've been going back and forth in the comments (in my failed attempt to explain the question to him), it's fairly likely that he'll peg me for the down vote. In rumaging through the his reputation, I noticed that he gets down voted a lot. Moreover, he often votes down things on the same day as he gets down voted. Looking at a few recent questions where he posted an answer that was down voted, it's pretty clear that he (often successfully) down votes questions or competing answers when he is down voted, perhaps based on comments or, as is easier, based on profiles where down votes are recorded. In this particular case, it's worth it for me to down vote him because (1) it's a stupid answer, (2) I don't live and die by my SO reputation, and (3) it really wasn't a great question that I asked. However, this does bring up the larger point that perhaps a date should not be associated with a down vote. |
I have the following jQuery code: $("#file-upload").change(function () { if (this.files && this.files[0]) { $('#cancel-image-upload').html('<button type="button" class="btn btn-warning" id="cancel-upload-button" style="margin-right:15px;">cancel</button>'); } else $("#image-preview").attr("src", "http://placehold.it/200x150"); }); $('#cancel-upload-button').click(function () { $("#file-upload").replaceWith('<input type="file" id="file-upload" name="file" accept="image/*">'); }); What this code does is to display cancel button after file has been chosen, and the button should be able to delete it when clicked. I tried the code above but it didn't work for some reason. Why and how can I fix it? thanks! | I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option. |
As I've discovered with Ajax in jQuery, loaded elements are not jQuery objects. What's the best way to 'rescan' the document to make elements loaded with Ajax jQuery objects? In the code below jq('.storyBlock button').click(function() and the other functions do not fire on the loaded Ajax html. How best to change this code so they will fire? var jq = jQuery.noConflict(); jq(document).ready(function() { // Disable buttons after clicking jq('.storyBlock button').click(function() { jq(this).addClass('selected'); jq(this).parent().addClass('disabled'); jq(this).parent().find('button').attr('disabled', true); }); // Event Handler jq('.storyBlock button').click(function() { // Find link var getID = jq(this).data('link'); console.log(getID + '.html'); // Load file and insert after last story jq.ajax(getID + '.html').done(function(html) { jq('#stories > div:last-child').after(html); if ( (getID) != 'start' ) { jq('html,body').animate({ scrollTop: jq('#' + getID).offset().top },'slow'); } else { jq('.storyBlock').remove(); jq('#stories > div' ).load( "start.html" ); jq('html,body').animate({ scrollTop: jq('#start').offset().top },'slow'); } }); }); }); | I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option. |
Let $V$ be the vector space over $\mathbb{R}$ whose basis is $(\sin(t),\cos(t))$. Let the scalar product be defined by $$\langle f,g \rangle =\int_{-\pi}^{\pi} f(t)g(t)\,\mathrm dt$$ What is the matrix of this scalar product with respect to the given basis? $$\langle f,g \rangle = \int_\limits{-\pi}^{\pi} f(t)g(t)\,\mathrm dt = \int_\limits{-\pi}^{\pi}(\sin (t)+\cos(t))(\sin (t)+\cos(t))\,\mathrm dt = 2\pi$$ From a previous exercise with polynomials, I acquired this method. However I do not get a matrix but a number. Am I doing anything wrong? I do not know why people consider it a duplicate, if I am not getting the same result using the same method. Thanks in advance. | Let $V$ be the vector space over $\mathbb{R}$ consisting of all polynomials of degree $\leqslant n$. If $f,g\in V$, let $$\langle f,g \rangle = \int_\limits{0}^{1}f(t)g(t)dt$$ Find the matrix of this scalar product with respect to the basis $\{1,t,\dots,t^n\}$. What does it mean to find a matrix of the scalar product? Thanks in advance! |
I'm working as a bit of a webmaster for a guy that runs a network of backlinked websites to increase his PR for a couple of his eCommerce sites. I don't know much about them, I just know they generate content and funnel the link juice back to where it's needed. He is hell-bent on making SEO as good as possible on every one of the sites under his network. We have a VPS running about 10 of these sites on a single IP address and he has been struck with the somewhat logical assumption that if Google thought they all came from different servers, as opposed to one, their SEO and pagerank would be better. I'm however a little more skeptical of this idea, as I don't see why on earth Google would consider the content generated from the same server more valuable than content generated from different servers. In terms of SEO, would a network of sites that link to each other benefit from having different IP addresses? Or could they result in a penalty if they all used the same IP address? | I've googled that and I've found many opinions on this subject, and I'm not sure, if, dedicated IP addresses actually really improve SEO? Is it that different from shared IP address (of 50-100 other sites)? |
Suppose a user is question or answer banned from a certain site. And suppose a question was migrated from another site to the one where the user was banned. And suppose the user's answer from the other site on someone else's question was highly upvoted on the destination site. Do the upvotes on the user's answer to the migrated question count toward removing a question or answer ban? | There's a sad little loophole in the suspension/question-block system: migrations. Example: Let's say you've been suspended on MSO, but you really, really want to post a question here now. All you need to do is: Go to any other site and ask your question. Chances are good that a moderator there will automatically migrate it here. If not, request it. Success! Your question is now on MSO. Can this be fixed? The best approach, imo, is to check if the user already has an account at the destination, and if they do, if they're allowed to post. |
I have this query and i need to get the maxvalue of the CCSEQ camp, i have tried using this query but it doesn´t work, if anyone can help me i will be very grateful. the query select max(cc.CCSEQ), cc.ccline4, cc.ccstreetno, cccity from ccontact cc where customer_id = '724609' and ccbill = 'X'; EDIT I have resolved the issue with this query select cc.ccline4, cc.ccstreetno, cccity from ccontact cc where CC.customer_id = '724609' and CC.ccbill = 'X' AND cc.CCSEQ = (SELECT MAX(C1.CCSEQ) FROM ccontact c1 WHERE CC.customer_id = C1.customer_id) Best wishes | Table: UserId, Value, Date. I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle) Update: Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date. |
someone logged into their game center earlier on my phone. Then, they loaded their Clash of Clans village and played it. After they were done, I logged them out of the game center and logged myself back in. Later on I went to play my village and it's stuck on his village. I've logged into multiple different game centers to see if it would load their village or start from townhall 1, but it's always stuck on his village. I want to get my village back. What's going on? Why won't it load another game center progress or even start over then have a pop up asking if you want to load Town hall 8 village? | I have been playing on two clash of clans accounts on one device for a long time but just recently i cannot switch from my lvl17 to my lvl75. The switch villages option is not popping up for me and I don't know why. Can anyone help me get my main account back? |
Please can someone help me write a regex to validate an IP BLock eg. 196.126.0.1/29. Thanks! | Does anyone have a regular expression handy that will match any legal DNS hostname or IP address? It's easy to write one that works 95% of the time, but I'm hoping to get something that's well tested to exactly match the latest RFC specs for DNS hostnames. |
I had around 1700+ reputation points on Stack Overflow, but when I logged in today, it was 16. There hasn't been any notification or any email from Stack Overflow. Further, Stack Overflow is not displaying my name but some userXXXXXX. Why did this happen? I did not do anything wrong. I am sure this was not because of serial upvoting. And why has the profile name changed? | This user is only displaying 56 rep. But surely (s)he has much more than that. The user has also never given out any bounties. Also, badges are missing: |
Currently using OSX version 10.11.3. Prior to downloading El Capitan I had all the options that I'd see on the Finder side bar when I wanted to save a document. see screen shot: and I could drill into sub folders which allowed me to be very specific to where I saved documents. I now have a very limited number of options and I cant drill into sub folders see screen shot:. I'd love if someone had a solution. I went into controll panel but nothing stood out to correct it. | I'm having the strangest issue since updating to OS X El Capitan. My "Open File" dialogs show the sidebar but all my main (and useful) locations are missing. Take a look at this screenshot. This screenshot shows Keychain Access but this happens in Safari when I'm trying to attach a file to Gmail for example, or uploading an image to Facebook. What I would like is for the sidebar to show my home directories, such as Desktop, Documents, Downloads, etc. Help? |
"One of my family members were/was sick last night." In this sentence should I use was or were? Please explain. Which one is subject and why? Please explain with detailed information. I am having trouble with sentences like this. | Which one is correct? Please explain. I saw one of my classmates who was also on the boat while travelling to Saint Martin. I saw one of my classmates who were also on the boat while travelling to Saint Martin. In this sentence what is the subject and why? How can I find the subject in sentences like this? |
I got a new lenovo PC pre installed with windows 8.1 and I'm having trouble installing Ubuntu. I tried using the Live USB/DVD option. It would show an option to choose between windows 8 & Ubuntu and when I choose Ubuntu it will show me an error screen. I didn't want persist because I don't want to screw it up, it being new and all. What steps should I follow to properly install Ubuntu safely and smoothly? Thanks! | I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS. Should I do it with Wubi, or through the Live USB/DVD? What steps do I need to take to correctly install Ubuntu? |
Our weight is more at the pole than at the equator (because it is closer to the center). Does that mean if we go down into the earth (some kind of bore), will our weight increase further? I remember reading somewhere that this is not the case. Is that true? | Would the effect of gravity on me change if I were to dig a very deep hole and stand in it? If so, how would it change? Am I more likely to be pulled downwards, or pulled towards the edges of the hole? If there would be no change, why not? |
If f is an entire function satisfying f(z+1)=f(z) and f(z+i)=f(z) then f must be constant throughout the complex plane. I would appreciate if someone helps me know how to prove the above statement. | Let $f: \Bbb C \to \Bbb C$ be an entire (analytic on the whole plane) function such that exists $\omega_1,\omega_2 \in \mathbb{S}^1$, linearly independent over $\Bbb R$ such that: $$f(z+\omega_1)=f(z)=f(z+\omega_2), \quad \forall\,z\in \Bbb C.$$Prove that $f$ is constant. The intuition seems clear to me, we have the three vertices of a triangle given by $0$, $\omega_1$ and $\omega_2$. All points in the plane are one of the vertices of that triangle under a suitable parallel translation. The constant value will be $f(0)$, fine. Throwing values for $z$ there, I have found that $$f(n\omega_1) = f(\omega_1) = f(0)=f(\omega_2) = f(n\omega_2), \quad \forall\, n \in \Bbb Z.$$ I don't know how to improve the above for, say, rationals (at least). Some another ideas would be: Checking that $f' \equiv 0$. I don't have a clue of how to do that. Write $w = a\omega_1+b\omega_2$, with $a,b \in \Bbb R$, do stuff and conclude that $f(w) = f(0)$. This approach doesn't seem good, because I only have a weak result with integers above. Finding that $f$ coincides with $f(0)$ on a set with an accumulation point. This seems also bad: the set on with $f$ coincides with $f(0)$ by which I found above is discrete. Nothing works and this is getting annoying... And I don't see how analyticity comes in there. I'll be very thankful if someone can give me an idea. (On a side note.. I know that this title is not informative at all. Feel free to edit if you come up with something better.) |
I'm currently having some trouble getting spans to work with this function I made in Javascript. It calls the OpenWeatherMap API and outputs current weather conditions, but adding CSS to the mix doesn't effect the spans I need it to, although doing the same sort of thing in a function to update the time does it perfectly well. EDIT: Should probably mention that the digitalFont in my CSS is a custom font, and works perfectly fine with my other CSS elements. JS: function getCurrentWeather() { fetch('https://api.openweathermap.org/data/2.5/weather?q=Tokyo&appid=') .then(res => res.json()) .then(res => { var icon = res.weather.map(d => {return d.icon}); var con = res.weather.map(d => {return d.main}); var tempC = Math.floor(res.main.temp - 273.15); // var tempF = Math.floor((res.main.temp - 273.15) * 1.8 + 32); var iconPNG = `../res/img/weather_icons/${icon}.png` document.getElementById('tempC').innerHTML = `${tempC}`; // // document.getElementById('tempF').innerHTML = `${tempF}`; document.getElementById('condition').innerHTML = `${con}` document.getElementById('icon').innerHTML = `<img src="${iconPNG}">` }); } getCurrentWeather(); setInterval(getCurrentWeather, 3600000) // Update every hour HTML: <div class="weather"> <span id="tempC"></span>C <span id="condition"></span> <span id="icon"></span> </div> <script src="index.js"></script> CSS: .tempC { font-family: digitalFont; font-size: 60px; text-align: right; } | What's the difference between <div class=""> and <div id=""> when it comes to CSS? Is it alright to use <div id="">? I see different developers doing this in both ways, and since I'm self taught, I've never really figured it out. |
Is there any difference in the way these two objects create their methods? Are there performance differences? What's the difference here, if any? Method 1: var Point = function(x, y, z) { this.x = x; this.y = y; this.z = z; this.add = function(point) { this.x += point.x; this.y += point.y; this.z += point.z; }; this.sub = function(point) { this.x -= point.x; this.y -= point.y; this.z -= point.z; }; }; Method 2: var Point = function(x, y, z) { this.x = x; this.y = y; this.z = z; }; Point.prototype.add = function(point) { this.x += point.x; this.y += point.y; this.z += point.z; }; Point.prototype.sub = function(point) { this.x -= point.x; this.y -= point.y; this.z -= point.z; }; | What's the difference between var A = function () { this.x = function () { //do something }; }; and var A = function () { }; A.prototype.x = function () { //do something }; |
find . -name *.jks -print 2>/dev/null returns files of extension jks that do not have underscores as part of their name. Much to my surprise, I have just discovered that * does NOT substitute the underscore. find . -name *_*.jks -print 2>/dev/null returns files of extension jks that have one underscore. How do I search for files that have 0 or more underscores? Using OSX Mountain Lion. | I am running the following command, but it is not performed recursively: find . -name *.java I know there are java files further down in the current directory but it is performing the find on the current directory only. I am using OS X, 10.9. |
My Dell Optiplex 780 is blanccoed, how do I know whether I need a 32 or 64 bit ubuntu? | What is the difference between 32-bit and 64-bit Ubuntu? I've heard the 64-bit platform performs better and can detect more than 4GB of RAM. Also, while some apps haven't ported to 64-bit yet, ia32-libs lets a 64-bit machine run them. If so, why not promote 64-bit over 32-bit? |
I have integer for example "123", using this i want to create all possible combinations listed below. 123 12,3 1,23 and so on irrespective of the digits i have entered. Is there any way possible using python for the same? I am not able to get any idea. | I have a list with 15 numbers in, and I need to write some code that produces all 32,768 combinations of those numbers. I've found (by Googling) that apparently does what I'm looking for, but I found the code fairly opaque and am wary of using it. Plus I have a feeling there must be a more elegant solution. The only thing that occurs to me would be to just loop through the decimal integers 1–32768 and convert those to binary, and use the binary representation as a filter to pick out the appropriate numbers. Does anyone know of a better way? Using map(), maybe? |
Let $X$ and $Y$ be compact Hausdorff spaces, and let $F$ be a continuous function from $X$ to $Y$. Define a function $\Phi_F$ from $C(Y)$ to $C(X)$ by $\Phi_F(f)=f\circ F.$ I have shown $\Phi_F$ is a unital $*$-homomorphism from $C(Y)$ to $C(X)$, where $*$ is the usual complex conjugation of complex-valued functions and it is naturally an involution. (i.e. I proved that $\Phi_F$ is an algebra homomorphism that carries identity element to identity element, and respects complex conjugation) Now the problem is to prove that the mapping $F\mapsto \Phi_F$ is a bijection between the set of continuous functions from $X$ to $Y$ and the set of unital $*$-homomorphism from $C(Y)$ to $C(X)$. The fact that this mapping is injective is trivial. But I can not figure out the surjective part. Can someone help me? Any help will be appreciated. Thanks! | Suppose that X and Y are compact Hausdorff spaces and $p:C(X)\to C(Y)$ is a unital * homomorphism. Prove that there exists a continuous function $h: Y \to X $ such that $p(f)=f\circ h $ for all f in $C(X) $ I have managed to prove the other 3 parts ( show the statement false if $p$ is not unital as well as finding conditions on $h$ for $p$ to injective and surjective. I have found a function that does what I want but I can't prove it's continuous. Any help much appreciated. |
Ive read that it is "in the middle" of the room but I cannot for the life of me find the light switch. Can someone be more descriptive on how to turn this light on? Is it near the fire? Above or below? perhaps a screenshot?? Thanks! | In the castle there's a room that is dark. I can't seem to do anything in there, is it solely there as a reference to another game or is there something to be done here? |
Let $E|F$ be an algebraic field extension and a ring $K$ such that $F\subseteq K\subseteq E$. It is true that $K$ is a field? | This is an exercise in some textbooks. Let $E$ be an algebraic extension of $F$. Suppose $R$ is ring that contains $F$ and is contained in $E$. Prove that $R$ is a field. The trouble is really with the inverse of $r$, where $r\in R$. How to prove that $r^{-1}\in R$, in apparent lack of a characterization of $R$. It occurred to me to use the smallest field containing $R$ ($R$ is easily shown to be an integral domain), that's the field of quotients, and proving that it's $R$ itself, but I don't really know how to proceed. A not-too-weak, not-too-strong hint will be much appreciated. Beware $ $ Readers seeking only hints should beware that there is now a complete answer. |
There are many posts about lays/lies on the internet, but half of them contradict the others. It's an important letter - which is the proper form? | How do I know when to use lay and when to use lie, and what are the different forms of each verb? I'm always getting them confused. |
I am new in latex and I need to express the following symbols: &, &&, ^, | , || , <, <=, >, >= , == , != , % When I write them in that way, nothing happens on the document. Please help. best regards, | I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out? |
There is a lot on stackoverflow about vertical alignment, but it is not working in my case. See code and CSS below, how to centre the img... .file-upload-content { width: 100%; height: 100%; text-align: center; position: relative; } .file-upload-image { position: relative; max-height: 100%; max-width: 100%; margin: auto; } .btn-verwijderen{ position: absolute; top: 0px; right: 0px; } .nr-foto{ position: absolute; bottom: 0px; right: 0px; } <div class="foto_vak_25_50 border_dashed foto_upload"> <div class="file-upload-content" id="content_foto2" > <img class="file-upload-image" src="#" id='image_foto2' /> <img src="/img/prullenbak.png" class="btn-verwijderen"> <img src="/img/nr-2.png" class="nr-foto"> </div> </div> | I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS needed for this to work on all common browsers? <div id="header"> <img src=".." ></img> <h1>testing...</h1> <img src="..."></img> </div> |
I have a two-sample t-test where the t-statistic is equal to the critical t-value (at three decimal points) at a p-value of 0.05. does this mean i reject the null hypothesis or the opposite? thank you so much! | This is clearly just a matter of definition or convention, and of almost no practical importance. If $\alpha$ is set to its traditional value of 0.05, is a $p$ value of 0.0500000000000... considered to be statistically significant or not? Is the rule to define statistical significance usually considered to be $p < \alpha$ or $p \leq \alpha$?? |
When I print to my Canon LBP2900, Ubuntu shows printing completes, but nothing is really printed. | How can I install Canon LBP2900B on Ubuntu 14.04 LTS ? I tried the method for the installation of LBP2900, but it didn't work. I tried installing the CanonCaptDrv190 as outlined in the Community wiki and answers #1 by Alvar. #2 by SarveshM @ but neither approach worked for me. The printer is switched on and has pages in tray and connected through USB. EDIT: I followed the Ubuntu 13.10 installation method of Community Help Wiki again. Now I get this On command 4 (sudo update-rc.d ccpd defaults) - update-rc.d: warning /etc/init.d/ccpd missing LSB information update-rc.d: see System start/stop links for /etc/init.d/ccpd already exist. On seeing captstatusui for LBP2900, I get - Message : No Specified Printer In the below box I get - Check the (Printer asterix,asterix,asterix (the symbol)) of /etc/ccpd.conf I tried your method, Elder Geek but it didn't work. Any more ideas? Regards, Andy |
At the end of Star Trek: Nemesis Data sacrifies himself by destructing Scimitar(year 2379). I thought he died. But then i searched for Enterprise F and there I saw written that: "Captain Data was offered command of the vessel but refused." (Year 2409). How is he alive? | I've just read this on the : The main setting for the films Star Trek: First Contact (1996), Star Trek: Insurrection (1998), and Star Trek Nemesis (2002).[6] According to Star Trek: Countdown (2009), Data assumed command of the Enterprise after Captain Picard retired from Starfleet to become the Ambassador to Vulcan. (emphasis added by me) I haven't read Star Trek: Countdown, but looking at I read this: The comic came about because Anthony Pascale, editor of TrekMovie.com, kept requesting to the film's co-writer Roberto Orci a way of having The Next Generation characters "pass the baton" back to the originals. When asked whether the filmmakers' involvement in the comic made it canonical, Orci stated he was in no position to declare whether it was, though he felt it could easily remain as such unless it was contradicted in a future film. (emphasis added by me) How could that ever be canon if Data sacrifices himself during while saving Picard, still captain of the Enterprise? Data arrives with a single use personal transporter and has the captain beamed back to the Enterprise before ultimately sacrificing himself to shut down the weapon and destroy the ship. Am I missing something? Was Data revived? Was Star Trek: Nemesis un-canonized? Was Data of Star Trek: Countdown really B4? |
I was reading about the Rutherford atomic model which said that electrons revolve around the nucleus the way the Earth and other planets revolve around the sun. This model was,however,shunned as it did not accommodate the fact that when charged particles accelerate,they emit radiation,lose energy and fall into the nucleus.This does not happen in the case of the earth as it is electrically neutral. But it does comprise charges. So why don't the individual charges emit radiation ? What difference does it make if the charges are moving alone or in vicinity of other charges? How can charges differentiate if they are moving with or without charges?(Which would lead them to either emit or not emit radiation) P.S- A simple answer would be appreciated as I am not familiar with Maxwell's theory of EM radiation. | I'm having trouble understanding the simple "planetary" model of the atom that I'm being taught in my basic chemistry course. In particular, I can't see how a negatively charged electron can stay in "orbit" around a positively charged nucleus. Even if the electron actually orbits the nucleus, wouldn't that orbit eventually decay? I can't reconcile the rapidly moving electrons required by the planetary model with the way atoms are described as forming bonds. If electrons are zooming around in orbits, how do they suddenly "stop" to form bonds. I understand that certain aspects of quantum mechanics to address these problems, and that there are of atoms. My question here is whether the planetary model itself addresses these concerns in some way (that I'm missing) and whether I'm right to be uncomfortable with it. |
Is there any alternate proof for proving that The product of L.C.M (Least Common Multiple) and G.C.D (Greatest Common Divisor) of any two positive integers = the product of those two integers ? As of now, there exists a proof which involves use of Number Theory based facts. I am interested to know if there exists any alternate proof (perhaps in different branch of Mathematics ?!). You can assume that you want to prove this fact to a person who is aware of basics of mathematics but not NUMBER THEORY | Let $a$ and $b$ be two integers. Prove that $$ dm = \left|ab\right| ,$$ where $d = \gcd\left(a,b\right)$ and $m = \operatorname{lcm}\left(a,b\right)$. So I went about by saying that $a = p_1p_2...p_n$ where each $p_n$ is a prime. Same applies to $b = q_1q_2 ... q_c$. So then $m = (u_1u_2...)(p_1p_2...p_n)$ and $m = (t_1t_2...)(q_1q_2...q_c)$ since $a|m$ and $b|m$. $m$ has a unique factorization, so the primes $(u_1u_2...)(p_1p_2...p_n) = (t_1t_2...)(q_1q_2...q_n)$ and the gcd(a,b) = $(p_1p_2...p_n) \cap (q_1q_2...q_n)$ (I know this is not mathematically correct, so is there a correct way to express this?). So $dm = |ab| \iff d= \frac{|ab|}{m}$. And by the definition above, $\frac{ab}{(t_1t_2...)b} = \frac{a}{(t_1t_2...)}$. And this is where I get stuck. Is my proof right? Am I going in the right direction? Thanks PS. I am trying to do this using only the prime factorization theorem and the definitions of the gcd and the lcm. |
I am working on this exercise: $$ \forall \varepsilon > 0, \ \exists q \in Q \text{ where } 0 < |r - q| < \varepsilon $$ To clarify, r is a real number, q is a rational number. This is what I have so far: $$ 0 < |r - q| < \varepsilon $$ $$ -\varepsilon < (r-q) < \varepsilon $$ $$ r - \varepsilon < q < r + \varepsilon $$ Then making use of a given theorem that "Between any two distinct real numbers there is a rational number and an irrational number," I conclude the proof by claiming that the inequality must hold by the theorem and given that $r - \epsilon$ and $r + \epsilon$ are two distinct real numbers. Is this sufficient for the proof? Otherwise, would appreciate some help on how to proof the above inequality more rigorously. I recall the Archimedean Property that for each positive real number r, there exists a positive integer n such that $\frac{1}{n} < r$. There is a hint to use this condition, but I am unsure how to apply it into the proof. Thanks in advance for any help! | I'm having difficulties making progress in proving: $$\forall \varepsilon > 0, \ \exists q \in Q \text{ where } 0 < |r - q| < \varepsilon $$ To clarify, $r$ is a real number and $q$ is a rational number. Is there some theorem I should be using? This exercise is presented in the same section/chapter as the Completeness Axiom (each nonempty set has a least upper bound or supremum), the Archimedean Property of Real Numbers ($ \exists n \in Z^{+}$ such that $na>b $ for positive real numbers $a$ and $b$), and a theorem stating there is a rational and irrational number between any two distinct real numbers. I'm just not seeing the connection (if any at all). Any help in the right direction would be much appreciated. Thank you! |
In lecture I learned the following definition of valuation: Let $(K,+,\cdot)$ be a field and let $(G,+)$ be a totally ordered group. A map $v: K \longrightarrow G\cup\{\infty\}$ is a valuation if the following properties hold: $v(ab) = v(a)+v(b)$ $v(a+b) \ge \min\{v(a),v(b)\}$ $v(a) = \infty \iff a = 0$ Then we proved that: $v(1) = 0$ $v(a^{-1}) = -v(a)$ $v(-a) = v(a)$ $v(a - b) \ge \min\{v(a), v(b)\}$ Later in the lecture we used the "easy fact" that $$ \text{If }v(a) \ne v(b), \text{ then } v(a+b) = \min\{v(a), v(b)\}$$ I do not understand why this is true. I looked on and there they define a valuation to so that it has this property. But is it possible to derive this from my definition? | Let $F$ be a field and $v:F\rightarrow G\cup\{\infty\}$ be a valuation on $F$ so $G$ is a totally ordered abelian group with $\infty$ having the properties $\infty+\infty=g+\infty=\infty+g=\infty$ and $\infty\leq\infty$ for all $g\in G$, $\infty \notin G$. Show if $v(a)\neq v(b)$ then $v(a+b)=\min(v(a),v(b)$). I must be missing some trick here on how to show this is true. My approach has been to use that $G$ is a totally ordered group so I start by assuming $v(a)\neq v(b)$ and letting my first case be $v(a)<v(b)$ as trichotomy holds in $G$. By $v$ being a valuation on $F$, we then have that $v(a+b)\geq \min(v(a),v(b))=v(a)$. From here what I've tried doing doesn't seem to help much. I've said lets assuming $v(a+b)>\min(v(a),v(b))=v(a)$ and we also have $$v(a+b)> v(a) \Rightarrow v(a+b)+v(a^{-1}) > 0 \Rightarrow v(1+ba^{-1}) > 0$$ and $$v(a)<v(b) \Rightarrow 0< v(b)+v(a^{-1}) \Rightarrow 0 < v(ba^{-1})$$ also $$v(1+ba^{-1})\geq\min(v(1),v(ba^{-1}))=\min(0,v(ba^{-1}))=0.$$ How does one solve this? |
I have only 1 reputation, and I see on all questions "add a comment" link. However when I click it, I get: You must have 5 reputation to comment It means I can't really comment. So why show me the link in such case? | The comment link should be always visible. For users without enough rep to comment, clicking on it should give a nice popup, just like those on the vote buttons, informing them that they need more reputation to comment. |
I believe the noun is practice and the verb is practise, as demonstrated in; The doctor with a private practice practises privately However, if I wanted to say: It is good practi(s/c)e to colour-coordinate wires Which is correct when you are using it as an adverb? | As an Australian, I like to follow British forms of words such as license/licence and practise/practice. I have no problem with licence the noun and license the verb, but I find it hard to keep practise and practice straight. To get better, I practise my juggling. When I see a doctor, I visit their practice. But what about preparing a set of practice problems? Are they a set of problems that are used for practising, being instead practise problems? Is there a use of the word practice besides referring to, say, a doctor's establishment? |
I am experiencing an identical problem to the one in: However this thread in unanswered and unresolved My internal drive can format to everything except APFS, I have tried troubleshooting via linux, and simple disk utility. Fsck and first aid both report no problems and this is driving me insane!! help desperately needed! | I’ve recently ran a semi-routine clean install on my 2018 MacBook Pro. This involves the following steps (in the given order): Creating a USB installer with the latest macOS Mojave 10.14.2. Booting into the USB (Pressing Option key on boot). Using the Disk Utility, erasing the Disk and formatting it as APFS with a GPT Partition scheme. Using the Terminal, unmounting the disk diskutil unmountDisk disk0, where disk0 is the internal NVME drive. Using the Terminal, running gpt destroy disk0 where disk0. Using the Terminal, running diskutil zeroDisk disk0. Once that process is complete, I use the Disk Utility application to reformat as APFS, and install macOS. Nothing super crazy, maybe a little redundant in steps, maybe a little overkill, maybe a little unnecessary. Recently, however, on the final step where I format it as a APFS drive, it fails in creating the APFS container and says Internal State Error. It appears to first format as Mac OS Extended (Journaled) then create an APFS container, then add a APFS Volume. It fails when adding a Volume with An internal error occurred. I have tried many things, including: Securely erasing the drive diskutil secureErase 0 disk0. Simply zeroing the disk again diskutil zeroDisk disk0 (I’m not sure what the actual difference between these two are). Reformatting the drive as other things, such as ExFAT / FAT / MacOS Journaled, then trying to format as APFS. Reformatting the drive through the command line instead: diskutil eraseDisk JHFS+ NAME disk0 → diskutil apfs createContainer /dev/disk0s2 → diskutil apfs addVolume disk0s2 APFS NAME (It fails here with Error starting APFS Container creation: The given disk is not an APFS Container Reference (-69630), even though I just made a container there. Also, trying to add a volume to where it actually made the container (i don't know what it does this) diskutil apfs addVolume disk24 APFS NAME also fails with Error: -69624: Unable to add a new APFS Volume to an APFS Container Reformatting the drive using this: diskutil eraseDisk APFS NAME disk0 Restarting and trying these again. Using a different installer than the USB (The one from Command + R, Command + Shift + R, and whatever the other combo is), and trying these again. All end up at the same thing - the final step fails. I would expect especially after a secure wipe that the drive would be removed from whatever state it was put in, or that if it was a bug with the 10.14.2 installer, that it still wouldn’t happen again in the High Sierra installer. In Disk Utility, I’m left with the following structure: - APPLE SSD AP(...) // “Container disk24” takes up all space - Container disk24 // or some other number. “Used” is 207.2MB and “Free” is 1TB. Please note even though I can format as JHFS+, it won’t let me install the OS to such a formatted volume. The installer tells me this computer forces me to only install on APFS formatted volumes. Any direction is greatly appreciated. I have never had such a silly problem before. Also, note that I have no Time Machine backup. |
I'm struggling to build an expression tree so I can dynamically do filtering on some data. I have come up with this, but it fails at the var lambda = line foreach (var rule in request.Where.Rules) { var parameterExpression = Expression.Parameter(typeof(string), rule.Field); var left = Expression.Call(parameterExpression, typeof(string).GetMethod("ToLower", Type.EmptyTypes)); var right = Expression.Constant(rule.Data.ToLower()); var method = typeof(string).GetMethod("Contains", new [] { typeof(string) }); var call = Expression.Call(left, method, right); var lambda = Expression.Lambda<Func<T, bool>>(call, parameterExpression); query = query.Where(lambda); } The var rule has a Field (ex "Name") which I want to compare with the text in rule.Data (ex 'tom'). So if T.Name.Contains("tom"); I want the query to include the record, otherwise, not. The var query is of type IQueryable<T> EDIT: Finally got it working with this code: foreach (var rule in request.Where.Rules) { var parameter = Expression.Parameter(typeof(T), "x"); var property = Expression.Property(parameter, rule.Field); var value = Expression.Constant(rule.Data); var type = value.Type; var containsmethod = type.GetMethod("Contains", new[] { typeof(string) }); var call = Expression.Call(property, containsmethod, value); var lambda = Expression.Lambda<Func<T, bool>>(call, parameter); query = query.Where(lambda); } | I am just getting started with expression trees so I hope this makes sense. I am trying to create an expression tree to represent: t => t.SomeProperty.Contains("stringValue"); So far I have got: private static Expression.Lambda<Func<string, bool>> GetContainsExpression<T>(string propertyName, string propertyValue) { var parameterExp = Expression.Parameter(typeof(T), "type"); var propertyExp = Expression.Property(parameter, propertyName); var containsMethodExp = Expression.*SomeMemberReferenceFunction*("Contains", propertyExp) //this is where I got lost, obviously :) ... return Expression.Lambda<Func<string, bool>>(containsMethodExp, parameterExp); //then something like this } I just don't know how to reference the String.Contains() method. Help appreciated. |
This problem is from Herstein's 'Topics in Algebra'. I've thought about it a bit but haven't come up with much. Let $G$ be a non-empty set with an associative product which also satisfies: $\exists e\in G $ such that $\forall a \in G$, $a \cdot e=a$. Given $a \in G$, $\exists y(a) \in G$, such that $y(a) \cdot a =e$. Prove that $G$ need not be a group. I know that $G$ is a group if any one of those multiplications is switched around, i.e, either $a \cdot y(a)=e$ or $e \cdot a=a$. But I can't quite understand why in this case $G$ is not a group. I'd be much obliged if someone can give me a good explanation of why it must be and I'd also appreciate a counter-case if nothing else. Thanks a lot. Cheers! | Hungerford's Algebra poses the question: Is it true that a semigroup $G$ that has a left identity element and in which every element has a right inverse is a group? Now, If both the identity and the inverse are of the same side, this is simple. For, instead of the above, say every element has a left inverse. For $a \in G$ denote this left inverse by $a^{-1}$. Then $$(aa^{-1})(aa^{-1}) = a(a^{-1}a)a^{-1} = aa^{-1}$$ and we can use the fact that $$cc = c \Longrightarrow c = 1$$ to get that inverses are in fact two-sided: $$ aa^{-1} = 1$$ From which it follows that $$a = 1 \cdot a = (aa^{-1})a = a (a^{-1}a) = a \cdot 1$$ as desired. But in the scenario given we cannot use $cc = c \Longrightarrow c = 1$, and I can see no other way to prove this. At the same time, I cannot find a counter-example. Is there a simple resolution to this question? |
I'm a new one to use java. My problem may seem naive but I really don't know what to do. Here's the code: class Employee{ String name; Employee supervisor; } public class EmployeeTest{ public static void main(String[] args){ Employee emp = new Employee(); emp.name = "Xhaka"; emp.supervisor.name = "Origi"; if(emp.supervisor == null){ System.out.println( emp.name + " is the boss and has no supervisor!" ); } else{ System.out.println("The supervisor of " + emp.name + " is " + emp.supervisor.name); } } } When I tried to compile it, it shows the problem with this:Exception in thread "main" java.lang.NullPointerException. How can I solve this question? | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
Were can i find the original old releases of ubuntu any viruses? Please respond If you know. | Due to compatibility issues I am looking for an older Ubuntu version. Where can I download Onceiric Ocelot? I found this page But this only goes up to Maverick. |
How do I cycle through blend/transfer modes in Illustrator? It seems I can only manually choose 1 at a time from the drop down then open the menu and choose another. It's a slow process. What shortcuts exist to do this more quickly? | In Photoshop you can select next or prev blending mode with cursor up and down, but can't do the same in the Adobe Illustrator. How to fix that? Maybe shortcuts or scripts can help... |
If I pick an arbitrary interval like (0,1), the probability of picking any given number (like 0.5) = $\lim_{x \to \infty}\frac{1}{x}=0$ I at first thought that this was a paradox, and questioning whether '$0$' really meant impossible. I realised that it is impossible to even pick a number between (0,1). A computer cannot do it as it would require every number in that range to chose from (infinite). Is this really a paradox? Either interpretation of 0 being impossible or infinitesimal leads to it not being one. | I read a comment under : There are plenty of events that can occur that have zero probability. This reminds me that I have seen similar saying before elsewhere, and have never been able to make sense out of it. So I was wondering if zero probability and impossibility mean the same? if an event with zero probability doesn't mean that the event is impossible to occur, how probability theory represents/describes impossibility? Thanks and regards! |
Ex-Moderator Madara Uchiha's was recently untagged as by a staff member, which removes it from the featured box on the related community's sidebar. This is rather early for a moderator resignation. Per a on a question regarding the above event, it is now becoming standard practice for moderator resignations to be untagged from after only 24 hours. This is a rather large step away from the usual practice of letting elected moderators decide how long moderator resignations, or questions in general, should be featured. Juan went on to explain, with my emphasis on one point: Lately, we have had an increase of resignation posts that have served to host combative and hurtful words to attack Stack employees, other mods, and teammates. We need to be mindful of this and limit the time the posts are featured. We still value people posting these when they're stepping away from the team. We also value folks being able to say their goodbyes and we want to continue to feature these resignation posts. But we need to keep an eye on the length of time that these featured posts can be in the sidebar. Why can't the hurtful material be moderated, as is usual practice? Is it too much to moderate? I feel what Journeyman Geek♦ is particularly impactful: We watch out for, and remember our own. If we're restricting this due to fear, we're lost. We have lost. Featured posts, as noted historically, should be a reflection of what the community at large feels requires attention. I feel that a moderator resignation, given their extensive contributions to the community, should be a part of that - for a time that their fellow elected moderators feel is appropriate. They're very important moments in a community's history. For what other reasons are we limiting these announcements now? Are there no other options? | How long are moderator resignation posts allowed to be featured in the sidebars of our sites? |
I saw may programmers using HEXADECIMAL number to describe value and I was wonder what is the BENEFIT of using HEXADECIMAL instead of regular decimal number. For example : <?php fread( $myFile, 0x594 ); //vs fread( $myFile, "1428" ); ?> And more importantly, How do I get to that hexadecimal value ? I was trying echo hexdec (1428); and I'm receiving 5160 and not 0x594. What am I doing wrong here ? | Hey! I was looking at this code at I noticed that in some situations they used hex numbers, like in line 134: for (j = 1; val && j <= 0x80; j <<= 1, q++) Now why would they use the 0x80? I am not that good with hex but I found an online hex to decimal and it gave me 128 for 0x80. Also before line 134, on line 114 they have this: small_n = (n & 0xffff0000) == 0; The hex to decimal gave me 4294901760 for that hex number. So here in this line they are making a bit AND and comparing the result to 0?? Why not just use the number? Can anyone please explain and please do give examples of other situations. Also I have seen large lines of code where it's just hex numbers and never really understood why :( |
The number of ways of selection of $n$ things out of $3n$ things of which $n$ are of one kind alike and $n$ are of second type alike and rest are different: Options are A) $n2^{n-1}$ B) $(n+2)2^{n-1}$ I want a detailed solution. | No. of ways to choose $n$ things from $n$ alike "a" things $n$ alike "b" things and $n$ different things. Answer is $(n+2)2^{n-1}$. But how to prove it..? |
no script to attach as I can pull the data just fine, I am struggling to join my two tables though. The column I want to join on has the same information formatted differently in each table, making it worse, one of these columns uses wildcards for the program that takes data from there. Example of what I mean: T1.Col1 would contain the actual value, say EXAMPLE A , EXAMPLE B , EXAMPLF A T2.Col1 would have one entry like EXAMPL*[AB] The Program using that table would treat all values the same if it started in EXAMPL, and ending in EITHER A or B. Meaning the following would all be a match, this is what I need to recreate for my script: EXAMPLE A , EXAMPLE B , EXAMPLF A Can I recreate that logic in SQL? To find a match/closest match based on certain conditions? T2 Column contains about 200 values just like that and all different, so I need a solution that can apply to everything and not just this case. I've tried formatting T2 values using Replace to be more like T1 but the square brackets are killing me. Making new rows in the output table might help but we're at the limit of what I can do in SQL. | OK, so I have a Microsoft SQL Server 2014 database table called owner with around 90,000 records with owner information, another called vehicle with vehicle information Owner_Name owner_id V_name owner_id exempt ------------------------------------- ------------------------------ JACOB JAMISON & JESSICA 35 Civic 35 H3 JACOB JAMISON M & JESSICA B 39 Accord 39 H3 BLACKSON BARRINGTON 56 Bugatti 56 H6 BLACKSON BARRINGTON H 98 SSC 98 H7 BRUSTER MICHAEL 107 Corvette 107 H9 I'm trying to find all records that have more than one exemption on a vehicle ( H0 means no exemption). This code below has worked well, as long as the name is exactly the same. However, if there's a variation, such as an extra letter or if it's entered backwards, then it won't return those records. I've looked at things like SOUNDEX, but this wouldn't work in my scenario. SELECT Owner_name , COUNT(Owner_name) AS 'xNameAppears' , COUNT(v.exempt) AS 'ExemptionCount' FROM owner o INNER JOIN vehicle V ON V.owner_id = o.owner_id WHERE v.exempt <> 'H0' GROUP BY O.owner_name HAVING COUNT(v.exempt) > 1 Is there a solution that would allow me to return records like so, not knowing which owner_name's may be similar? Basically trying to get the server to search through the owner_name column and if there's a similarity such as JACOB JAMISON & JESSICA and JACOB JAMISON M & JESSICA B then it'll return those records like so: Owner_Name xNameAppears ExemptCount ------------------------------------------------------------- JACOB JAMISON & JESSICA 2 2 JACOB JAMISON M & JESSICA B 2 2 BLACKSON BARRINGTON 2 2 BLACKSON BARRINGTON H 2 2 Thank you in advance! |
Following various examples, here here my current (relevant) code: in %Preamble% \usepackage[backend=biber, style=numeric, sorting=none, defernumbers=true]{biblatex} \addbibresource{Pages/bibliography.bib} And at the vary end of the document: \nocite{*} \chapter{Bibliography} \printbibliography %Prints bibliography Bibliography is not showing, what am I missing or doing wrong? I trimmed down and anonimsed the code for testing, still not working: File main.tex %Preamble \documentclass[a4paper,french,oneside,openright]{book} \usepackage[backend=biber, style=numeric, sorting=none, defernumbers=true]{biblatex} \addbibresource{Pages/bibliography.bib} \begin{document} \nocite{*} \input{Pages/xx-Bibliography.tex} \end{document} File xx-Bibliography.tex \chapter{Bibliography} \printbibliography %Prints bibliography or \chapter{Bibliography} \printbibliography File Pages/bibliography.bib : sample found on @article{einstein, author = "Albert Einstein", title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German}) [{On} the electrodynamics of moving bodies]", journal = "Annalen der Physik", volume = "322", number = "10", pages = "891--921", year = "1905", DOI = "http://dx.doi.org/10.1002/andp.19053221004" } @book{latexcompanion, author = "Michel Goossens and Frank Mittelbach and Alexander Samarin", title = "The \LaTeX\ Companion", year = "1993", publisher = "Addison-Wesley", address = "Reading, Massachusetts" } @misc{knuthwebsite, author = "Donald Knuth", title = "Knuth: Computers and Typesetting", url = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html" } Also tried Pages/xx-Bibliography.tex: \chapter{Bibliography} \printbibliography[keyword={physics},heading=none,resetnumbers=true] | As you can see in article on Wikipedia, there is a distinction made between notes, citations and references. I would like to have a section called citations at the end of my document which I can refer to like this[2] [2] Lasker (1934), p. 73 which is to be found in my references under "Lasker, Emanuel (1934). Lasker's Chess Primer. London: Billings (1988 reprint). ISBN 0-7134-6241-8". Ideally, I would like this citation to contain a hyperlink to this reference (although this is not done in the document). Any good way to do this or something similar? |
I want to see source code of built-in tool (just now "Intersect", later maybe another). Is there any built-in function for its reading? | I want to see the definition of any tool in ArcGIS tool box and How to enable to see the procedure to use them and option to edit the tool? |
I want my footer to stick to the bottom of my page, but it is not displayed at the bottom. It goes to aside or to the top close to navigation or, if it`s displayed at the bottom of the page then its background gradient color applies to the upper div element as well. I have tried the following code: body::after { content: ''; display: block; height: 90px; } #footerindex { position: absolute; bottom: 0; width: 100%; height: 90px; } Second code- #footer {clear: both; position: relative; height: 40px; margin-top: -40px; } <footer style="background: linear-gradient(to bottom, #4e54c8, #8f94fb)"> <div id="footerindex"> <a href="terms.html"> Terms and conditions </a> <a href="privacy.html" style="padding-left: 15px;">Privacy Policy</a> <p>&#169; Copyright 2019 - jobg.xyz, All Rights Reserved. </p> <p>Website designed and developed by Riven Apwbihls</p> </div> </footer> | I have a simple 2-column layout with a footer that clears both the right and left div in my markup. My problem is that I can't get the footer to stay at the bottom of the page in all browsers. It works if the content pushes the footer down, but that's not always the case. |
How to achieve to keep alive the session for long time. Example: If I logged into a page and after sometime(say 5hrs) the session is getting closed automatically. How to make it alive until I press logout button. | I want my website to have a checkbox that users can click so that they will not have to log in each time they visit my website. I know I will need to store a cookie on their computer to implement this, but what should be contained in that cookie? Also, are there common mistakes to watch out for to keep this cookie from presenting a security vulnerability, which could be avoided while still giving the 'remember me' functionality? |
I have 2 different javascript object : key = { id : 3, name : "Leroy", class : "A", address : "IDN", age : "17" } and ... answer = { id : 3, class : "A", name : "Leroy", age : "17", address : "IDN" } What I wanted to do is to compare answer object with key object using (===) or (==) and will return true, even when the answer object key order is mixed, but as long as the value within each key is the same, it will still return true. The condition will return false if one of the key in answer object and its value is not present, or there is a new key and value set inside the answer object. Any help would be appreciated! | 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. |
here is my code @Override public void onActivityResult(int requestCodeC, int resultCode, Intent data) { // if this is the result of our camera image request if (requestCodeC == CAMERA_REQUEST_CODE) { // getting bitmap of the image Bitmap photo = (Bitmap) Objects.requireNonNull( Objects.requireNonNull( data ).getExtras() ).get( "data" ); // displaying this bitmap in imageview imageView.setImageBitmap( photo ); } super.onActivityResult( requestCodeC, resultCode, data ); } on back pressed while in camera activity the app crashes, I think this is because data is remaining null. How can I fix this? Thanks, | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
Im testing the async client/server example on MSDN. It works fine. The server example , and the client example I'm trying to check if I can add some custom server "version" tag. So the client need to specify the version number in order to get a valid connection. It's not the default TCP Three Way Handshake I need. It's a extra custom version number added on the server and specified in the connection string on the client I am looking for. Can I add some "version" object to the socket? // Establish the remote endpoint for the socket. // The name of the remote device is "host.contoso.com". IPHostEntry ipHostInfo = Dns.GetHostEntry("localhost"); IPAddress ipAddress = ipHostInfo.AddressList[0]; IPEndPoint remoteEP = new IPEndPoint(ipAddress, port); // Create a TCP/IP socket. Socket client = new Socket(ipAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp); // Connect to the remote endpoint. // TODO: How to add custom version object? client.BeginConnect(remoteEP, new AsyncCallback(ConnectCallback), client); | I am trying to gain a better understanding of tcp/ip sockets in c#, as i want to challenge myself to see if i can create a working MMO infrastructure (game world, map, players, etc) purely for educational purposes as i have no intention of being another one of those "OMGZ iz gonna make my r0x0r MMORPG that will be better than WoW!!!", you know what im talking about. Anyway, i was wondering if anyone can shed some light as to how one might approach designing this kind of system and what kinds of things are required, and what i should watch out for? My initial idea was to break up the system into seperate client/server connections with each connection (on its own port) performing a specific task, such as updating player/monster positions, sending and receiving chat messages, etc. which to me would make processing the data easier because you wouldn't always need to put a header on the data to know what information the packet contains. Does that make sense and is useful or am i just way over complicating things? your responses are very much appreciated. |
One of my first models from several months ago, when I began with Blender, doesn't work with a mirror modifier properly. While tabbing between Edit and Object modes, the object origin remains in place, while the mesh location is different on the x-axis by a half a blender unit. In Edit Mode the mesh favors the right as in +5, while in Object Mode it is -1! I did try clearing scale, rotation and location. Any ideas? Here is the blend file: | When I add a mirror modifier it sometimes doesn't mirror correctly, giving me an overlapping mesh. How can I fix this? |
I have been considering this problem: Colour is characterized by which of following character of light? a)Frequency b)Amplitude c)Wavelength d)Velocity Different websites claim different answers; some claim wavelength, some claim frequency. My textbook is an average Indian textbook and has wavelength as the answer. I searched in standard books but did not find the answer. But, as the wavelength changes from one medium to another medium, frequency does not change, and colour also does not change, it seems confusing to decide between frequency and wavelength. I consulted a teacher as well, he said wavelength, with logic I did not understand, and as he seemed to be in a hurry I did not feel comfortable to prolong the conversation. References: // says frequency //says wavelength but answer mentioned(in the lower section of webpage) is frequency. //says wavelength //says wavelength //says frequency | What determines the color of light -- is it the wavelength of the light or the frequency? (i.e. If you put light through a medium other than air, in order to keep its color the same, which one would you need to keep constant: the wavelength or the frequency?) |
Hello I have a Dualboot system with Windows 10 and Ubuntu 20.04 and I use Ubuntu grub so the grub is like this:- Grub [Its version] 1) Ubuntu 2) Advanced option for Ubuntu 3) Windows boot loader 4) UEFI Configuration So I want to change it to this :- is it possible? Grub [Its Version] 1) Windows Boot Loader 2) Ubuntu 3) Advanced option for Ubuntu 4) UEFI Configuration And also after updates the grub is updated everytime so will it revert it to the previous even if I changed it? Thankyou. | I have both Windows 7 and Ubuntu installed on a shared machine. Because a lot of the non-developers use Windows, I'd like to change the boot order to make it easier for them. Currently the boot order looks like the following: Ubuntu 11.10 kernelgeneric *86 Ubuntu 11.10 kernelgeneric *86 (safe boot) Memory test Memory test Windows 7 on /dev/sda6 How do I change the default order so that Windows 7 is at the top of the list? Windows 7 on /dev/sda6 Ubuntu 11.10 kernelgeneric *86 Ubuntu 11.10 kernelgeneric *86 (safe boot) Memory test Memory test |
I have understood that since $\mathbb Z_3$ is a finite field so $R$ has to be a finite dimensional vector space but is there any way of proving this from purely ring theoretic concepts ? | i) Check whether $R$ is a finite ring or not. ii) Check whether $R$ has zero divisors. iii) Check whether $R$ has nilpotent elements. i) The field $Z_3$={0,1,2} has 3 elements but as repetitions are possible while forming a polynomial for infinite times and power of x can also have infinitely possible positive integers thus $Z_3[x]$ is not a finite ring. Again as $Z_3$[x] is not finite so will not be R. Please help rectify if I am wrong here and also need help for part ii) & iii). |
It is very strange, I just installed Ubuntu 16 on my computer, and at the end of the installation, the system says that I need to restart my computer. When I do it, I get back to the black screen that asks me if I want to try Ubuntu or if I want to install it. I'm stuck in an infinite loop. However the first time I did the installation, I was able to do the crypted one, protected by password. Now I can't. Also, sometimes the system says that some files already exists, which certainly come from the first installation, and that it may cause issues. | I created a live usb to boot Kubuntu, which has worked well enough. However, when the installation gets to the point of telling me to restart the computer (and it restarts) the installation window pops up again, and the computer is still signed in as a live user. None of the installation or settings appear to have saved. Any ideas? |
I have a table named "person". It contains person's id and it's parent id (only one parent is possible). As a result of a query, I want a table with first column - a person id, and a second column - a list of it's children id's. How exactly to do this? I've read about listagg function, but I'm not sure if it is appropriate for my purpose. And this query produces an empty second column: select t1.id, (select t2.id from person t2 where t2.parent_id = t1.id) from person t1 where t1.status = 'parent'; | I have a simple query: select * from countries with the following results: country_name ------------ Albania Andorra Antigua ..... I would like to return the results in one row, so like this: Albania, Andorra, Antigua, ... Of course, I can write a PL/SQL function to do the job (I already did in Oracle 10g), but is there a nicer, preferably non-Oracle-specific solution (or may be a built-in function) for this task? I would generally use it to avoid multiple rows in a sub-query, so if a person has more then one citizenship, I do not want her/him to be a duplicate in the list. My question is based on the similar question on . UPDATE: My function looks like this: CREATE OR REPLACE FUNCTION APPEND_FIELD (sqlstr in varchar2, sep in varchar2 ) return varchar2 is ret varchar2(4000) := ''; TYPE cur_typ IS REF CURSOR; rec cur_typ; field varchar2(4000); begin OPEN rec FOR sqlstr; LOOP FETCH rec INTO field; EXIT WHEN rec%NOTFOUND; ret := ret || field || sep; END LOOP; if length(ret) = 0 then RETURN ''; else RETURN substr(ret,1,length(ret)-length(sep)); end if; end; |
Why does Padme still have a belly even after child birth? Here is the picture of Padme's dead body. I believe she gave birth before death. Is she died with baby in her body? | During Padmé's funeral in she still appears to be very pregnant as her casket is drawn through the street, even though she had already given birth to twins before she died. You could perhaps make the argument that it is remaining baby weight, but judging from how thin she was before giving birth (to twins, no less) there wouldn't seem to be enough baby weight to make her still appear just as pregnant as before. So that lead me to think that she was purposely made to still appear pregnant for her funeral, so that the Emperor (and/or Vader) wouldn't suspect that there were any little Skywalkers running around. There's no overt mention of this sort of ruse in the movie. Is there any other source that makes reference to Padmé being made to still appear pregnant for her funeral? |
There is not any go to top link on any of the site of stack, specially on the questions page, as when user scroll down to the end of the page there must be a link that bring user to the top, | Can we get Back to Top Button on and ? The reason behind this request is sometimes I scroll down the questions to see the available questions that I can answer, when the scroll bar already on the bottom page I want to refresh the page to find the newest questions. When the whole page already load, the page will display on the latest state (in this case my scroll bar on the bottom page). So when I want to go to top page I must scroll back to the top, maybe if this possible added some button in the right corner like in . |
I have a short question. Why XML files should be validated and not just well-formed? I looked at several places for an answer to this question but I have not found a good one. | I wasn't aware of a difference, but a coworker says there is, although he can't back it up. What's the difference if any? |
I've learnt that for parametrical distributions you can describe the family of statistical model with the parameters, one such example has been the uniform distribution. I just came across a text saying that the uniform distribution is "inherently non-parametric". What is really the difference between parametric and non-parametric distributions? (I have already read the previous answers on this topic). edit: link I don't have a background in statistics/mathematics/machine learning. | Does a family of a distribution have a different definition for statistics than in other disciplines? In general, a is a set of curves, each of which is given by a function or parametrization in which one or more of the parameters is varied. Such families are used, for example, to . For statistics, a family according to is the result of varying the shape parameter. How then can we understand that the gamma distribution has a shape and scale parameter and only the generalized gamma distribution has, in addition, a location parameter? Does that make the family the result of varying the location parameter? According to @whuber the meaning of a family is implicitly A "parameterization" of a family is a continuous map from a subset of ℝ$^n$, with its usual topology, into the space of distributions, whose image is that family. What, in simple language, is a family for statistical distributions? A question about relations among of the statistical properties of distributions from the same family has already generated considerable controversy for a so it seems worthwhile to explore the meaning. That this is not necessarily a simple question is born out by its use in the phrase , which has nothing to do with a family of curves, but is related to changing the form of the PDF of a distribution by reparameterization not only of parameters, but also substitution of functions of independent random variables. |
single ticket(lufthansa) from new jersey to munich ; munich to bombay travelling light-only carry on, no check in luggage assuming same terminal- 2 ( both arrival and departure) at Munich will there be any immigration check or any waiting line to get on the Mun-Bom plane Indian national Have a US visitors B1/B2 No schengen visa. | I bought a single ticket from Lufthansa, of Mumbai to Paris. My first flight (LH765) lands at 5:55am at Munich, from where I have another Lufthansa flight (LH2226) to Paris at 6:40am. This is a single ticket so I guess its responsibility of the airline to get me on the second flight, but since it's Non-Schengen to Schengen, will customs etc. be a problem? I am assuming the checked-in luggage would transferred automatically by the airline. Will I be able to make it? |
I'm trying to remove or hide the update nags for non-admin users. As an admin, I see: The popular answer I've seen to handle this says to use: function hide_update_nag() { if ( !current_user_can('update_core') ) { remove_action( 'admin_notices', 'update_nag', 3 ); } } add_action( 'admin_head', 'hide_update_nag', 1 ); This works fine for removing the first message (WordPress 4.5.3 is available! Please update now) but leaves the second one visible to non-admins: Both messages are wrapped in a <div class="update-nag">, so is to modify the above chunk of code to use CSS to hide the nag with: echo '<style>.update-nag {display: none}</style>'; But this feels kludgy to me. Is there a way to hook into an action or filter and remove ALL the update nag messages for non-admin users? No third-party plugin recommendations please. | I have 2 administrators in my wordpress, but I only want that one of them see the "Update Notification". I've inserted this code on my funtions.php file and change name of one of my adminastrator login name the code - if ($user_login !== "miguel") - but it didnt' work? Any help? Thanks |
There are damaged site icons on chat.stackexchange.com popup: | I recently got an answer upvote on an answer on Programming Puzzles and Code Golf. However, I ended up checking this on chat.stackexchange (specifically , but it appears on main too. Testing looks like favicons for multiple (at least 3) sites are not working. Here is what it looks like on stackexchange.com (still old top bar, but no visual error): Here's what it looks like on chat.se: I'm not entirely certain what that is? Looks like a meta icon for another site. If you look closely, you can see a tiny bit of the "PCG" icon just below it, but it's cut off. This also happens on Literature notices, and Sci-fi and Fantasy (but not Vegetarianism or Veg.meta). I don't have any meta notices to test with, other than the vegetarianism one (which is fine). I'm not providing an image, but this works with answer notices too. (tested with PPCG) This is on Chrome (latest version, 61.0.3163.100) on OS X El Capitan. (but tagged ) and (unresolved). |
I am getting this error for everytime I am executing sudo. What can be the possible issue? | When I run sudo the terminal is stuck for a few seconds and then outputs an error message. My terminal looks like this: ubuntu@(none):~$ sudo true sudo: unable to resolve host (none) What can I do to solve it? |
If there is no mass for the light, it should penetrate. But light is not penetrating through solid medium. If the speed of light is constant there is some work should be done to maintain the speed. Einstein said that the light is curved because of Sun's gravity, to bend that also work has to be done. Maybe the black hole is completely dark solid matter that's why the light was unable to penetrate? This question is in my mind for years please explain | Photons are massless, but if $m = 0$ and , then $E = 0c^2 = 0$. This would say that photons have no energy, which is not true. However, given the formula $E = ℎf$, a photon does have energy as $ℎ$ is a non-zero constant and photons with a zero frequency do not exist. What am I missing here, or does the famous formula not apply to photons? |
Looking for a good (preferably free) driver or way to enable read and write access to an NTFS hard drive from OS X 10.9. | Possible Duplicate: Coming from Windows (Vista/7), I have a few NTFS formatted Hard Drives. Are there any programs to make OS X write to NTFS? Do I have any options aside from installing Windows via Boot Camp and reformatting? |
Often I talk nonsense, and need to delete an invalid answer via mobile. This works for comments. Is this a planned feature on Android? | Currently, the only way to vote to delete (and undelete, since you can't see deleted posts) in the Android app is to open the post in a browser, and then vote to delete from there. Can we get delete vote functionality within the app, as well as the ability to delete our own posts? Worth to mention: users , so it's possible in the API. Related: |
I want to be able to move my tabs in my jTabbedPane left or right to change the sorting order. I looked around but I noticed most of what I found is asking how to drag and drop a tab in. I just want to make it resortable so that I can move the rightmost tab to the left of the leftmost tab or any order I want. I know for table columns in a JTable, there is a method, something along the lines of JTable table = new JTable(); table.setReordering(false); //disables reordering of columns which prevents this so this functionality is already enabled with columns in tables but with tabs in JTabbedPanes, I cannot find any method similar to this but I'm thinking it would be something similar like tab.setReordering(true) as well but I don't see anything. | How do I implement a draggable tab using Java Swing? Instead of the static JTabbedPane I would like to drag-and-drop a tab to different position to rearrange the tabs. EDIT: . |
I have a Linux server with SSH service on it. If I performing a TCP connection to it (e.g. telnet %ip% %port%), it sends me a version line, like SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3. It is not a banner! (Banner sent after successful authentication). So, my question: it is possible to disable this message or change it? Without recompiling from source code... | If you access my server via HTTP using the SSH port (22), you'll see a message like this: SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1 Could be possible to display a different message? |
Subsets and Splits