body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
In Android 7, how can I set a separate ringtone for callers who are not in my contact list? I still want to receive the call but I want to know if it is someone in my contact list or not before answering. | Is there an Android App that can perform one ring for anyone in my Contacts and another ring for anyone not in my Contacts? I know how to go in and set individual ringtones, but I have 350 contacts. Actually, all I would need is an App that sets a ringtone for any number that is not in my Contacts list. If not, would that be difficult to create? |
See in the Stack Exchange sandbox. I quote it here: Have a look at this JS code: document.body.removeChild(document.body.appendChild(document.createElement('style'))); If you manually type it into your browser console it will work, but copying and pasting from my comment will throw an error because Stack Exchange randomly adds \u200b and \u200c characters for no apparent reason. You can even manually type it in a comment on Stack Exchange, then copy and paste again, and it still won't work. | In ... the number "5000" does not paste as such but instead as 5 0 U+200C U+200B 0 0 The HTML source looks like this: perhaps the easiest would be <code>\edef\tmp{\everypar{\widowpenalty\the\widowpenalty\relax}}\tmp\widowpenalty=-50&zwnj;&#8203;00</code> that may reset Or (smaller snippet): \widowpenalty=-50&zwnj;&#8203;00</code> that So in the HTML, we have extraneous &zwnj; and &#8203; in between the two middle digits of 5000. Upon pasting and trying out this code, this first led to a mysterious compiler error. The same issue happened within a (now deleted) comment thread below ; there, these or similar two characters were inserted after the letter "r" within the string \ref ("\ref"). Note that not all browsers wrap the same way. The above screenshot was for Firefox 19.0.2, in which it breaks between \relax}} and \tmp, with 5000 insidiously left intact on the second line but with the two special characters remaining in the middle. So that is why this took me completely by surprise. Other browsers might indeed only break on the invisible Unicode characters, such as Chrome 25: Or on a smaller screen with the mobile site, multiple line breaks might show, possibly still leaving the Unicode characters unused: |
In verbs that end with "et", what is the rule for doubling the final consonant for present participle? Examples where doubling is used: getting typesetting forgetting Examples where a single 't' is written: targeting marketing pocketing | Why does "edited" have one "t" and and "emitted" has two? "Edit" and "emit" are so similar in spelling and pronunciation. I keep wanting to type "editted" for some reason. |
Ungoliant was the mother of all spiders, most famously Shelob. Ungoliant and Melkor teamed up to suck the life out of Telperion and Laurelin and escaped under darkness, then Melkor refused to give her the silmarils and balrogs came to Melkor's aid and she fled somewhere south of Beleriand. My question is: How exactly did she die if she did? | We know Ungoliant is Shelob's mother and we know that Shelob lives high up in the mountains surrounding Mordor near Cirith Ungol (note the reference to Ungoliant) and eats whoever comes up there. So what fate ultimately befell Ungoliant and Shelob? |
$ time ./Test real 0m2.906s user 0m2.887s sys 0m0.017s Here is the program code: #include <iostream> #include <map> void func_a() { std::map<int, int> m; for (unsigned int i = 0; i < 10000; i++) { m.insert(std::pair<int, int>(i, i)); } } void func_b() { std::map<int, int> m; for (unsigned int i = 0; i < 1000000; i++) { m.insert(std::pair<int, int>(i, i)); } } int main() { func_a(); func_b(); return 0; } | $ time foo real 0m0.003s user 0m0.000s sys 0m0.004s $ What do 'real', 'user' and 'sys' mean in the output of time? Which one is meaningful when benchmarking my app? |
While reading up on todays match, there was this line: Thomas Muller wants a penalty before Algeria counter and have a chance but Germany survive. Breathless! I would have written this as either before the Algerian counter or before Algeria counters and has. Is there some grammar rule or even basic knowledge I'm missing, or is this phrasing special to sports reports and possibly known to be off? | I'd say Microsoft have a way of bending the rules and I know that McLaren have won the championship. While this sounds strange, I believe it is correct English (sorry, I'm not native). But when it's a small company, would you still use it this way? Is a company always plural, or are small companies singular? I.e., would you say Bakery Johnson makes fine bread or Bakery Johnson make fine bread? Is it My book seller, Woody's, have moved or is it has moved? |
The following piece of code #include <iostream> #include <bits/stdc++.h> using namespace std; int main() { // your code goes here string a="abc", b="xyz"; a,b = a+b, b+a; cout<<a<<" "<<b<<endl; return 0; } outputs abc abcxyz Why is it so? Expected or desired output is abcxyz xyzabc How to get this? | What does the , operator do in C? |
What is the most efficient way to to find the i'th combination of all combinations without repetition and without first creating all combinations until i. K is fixed (number of elements in each combination) and N is fixed (number of elements to be combined). The order does not matter although extra kudos for finding i in the following order... 1 2 3 4 5 6 7 8 1,2,3,4 1,2,3,5 1,2,3,6 1,2,4,5 1,2,4,6 1,2,5,6 1,3,4,5 1,3,4,6 9 10 11 12 13 14 15 1,3,5,6 1,4,5,6 2,3,4,5 2,3,4,6 2,3,5,6 2,4,5,6 3,4,5,6 | Many combinatorial objects have some associated positional number system. For example, the subsets of a (finite) set S can be listed off by observing the bits of all $|S|$-bit numbers, treating the 1s and 0s as indicators for whether to pick a particular element or not. Permutations of a finite set S can be found by examining the representations of the first $|S|!$ natural numbers. Is there an analogous positional number system for encoding k-element subsets of an n-element set? Thanks! |
All window decoration is black. However scroll bars, maximize, minimize and exit buttons are active if one can find them. Separately, in the case of gnome-terminal, all text, whether prompts, std output or input is invisible. Text input is active. I can launch and kill applications in the window and kill the window by typing exit. I have tried reinstalling compiz, compiz-core, compiz-gnome and xserver-xorg with no change in behavior. I have also tried several other incantations found on the web with no change in behavior. If I ssh -Y into the machine from a different machine the windows are properly decorated and gnome-terminal text is visible. What log files might be relevant? Any ideas how to fix? | I've just upgraded to Ubuntu 13.10 and I'm seeing a strange behaviour. All windows I open have a black, boxy border, including popups, as you can see in the provided image. (The black box in the bottom right is a terminal, which fails to display any text. However, I can enter commands and they execute.) I followed the steps in this post: to reset Unity using the unity-tweak-tool. Although helpful, that did not fix the issue. I'm thinking this may be a graphics card driver issue. Any help is much appreciated. |
Newton's third law of motion states that every action has an equal and opposite reaction. But, on punching a wall, I feel much greater force than on punching an inflated balloon. So, what does it mean? Is the balloon not applying an equal and opposite force. Or, what else is going on here? | According to the Third Newton's law of motion: For every action there is an equal and opposite reaction. So, I understand that if I hit a brick wall with $50\, \mathrm{lbs}$ of force, the brick wall also hits me with $50\, \mathrm{lbs}$ of force (usually painfully). In this instance, Newton's third law makes sense. What I'm confused about is, if I hit a patch of drywall with $50\, \mathrm{lbs}$ of force, it's probably going to break, and due to the lack of pain in my hand, I can tell it did not hit me back with $50\, \mathrm{lbs}$ of force. How does Newton's third law apply to situations when one object or the other is destroyed? It certainly seems like at that point it is incapable of delivering the full force of my blow back to me. What happens with the energy? |
Let $X$ be compact and suppose $f:X\to X$ satisfies $d(f(x),f(y))<d(x,y)$ whenever $x\neq y$. Show that $f$ has a fixed point. $X$ compact and $f$ continuous $\rightarrow f(X)$ compact $\rightarrow f(X)\times X$ compact we know that, $d:f(X)\times X \to R$ defined as $(f(x),y)\mapsto d(f(x),y)$ is continuous, so the image of $f(X)\times X$ is a compact subset of $R$ hence the set $F=\{d(f(x),y)|x,y\in X\}$ is a compact subset of $R$ and therefore contains its infimum, say $\alpha = inf F$ so $\exists x_0, y_0 \in X$ such that $\alpha = d(f(x_0),y_0)$ Now how can I show $\alpha=0$ and $x_0=y_0$ ? or is this not the right approach? | Let $(X, d)$ be a compact metric space, and suppose $f : X → X$ satisfies $$d(f(x), f(y)) < d(x, y)$$ for all $x \neq y \in X$. Show that f has a unique fixed point. All I've gotten it so far is that we need to somehow use another function $g(x)=(x,f(x))$. Thanks |
It happens to me that I start answering a question, and hit some snag. So I abandon the partial answer, knowing that I can go back to it later and complete it (many thanks for that!). But I variously use my tablet, the PC at home or another one at work to participate here. And some of the sites (MSE is a particular culprit here) often have hundreds of new questions a day, and the original question (if not "favorite") is thus hopelessly lost. Is there a simple way to get at a list of all of my drafts? | In GMAIL you can list all your boss-tell-off and wife-cuss-out emails by clicking Drafts I'd like to see my started-but-never-finished responses, possibly between x Answers and y Votes in /<<user>>/Stats/? |
I would like to get individual file size, all used file size in the disk and usable the maximum file size in the disk. In linux, commands for checking file sizes such as "du", "df", "ls -l" are prepared. However, the result is different when examining the total size of the files used in "df -h" and when examining the total size of the file used in "du -shc /*". result of df, $df -h Filesystem Size Used Avail Use% Mounted on ubi0:rootfs 435M 195M 240M 45% / devtmpfs 88M 4.0K 88M 1% /dev tmpfs 248M 168K 248M 1% /run tmpfs 248M 124K 248M 1% /var/volatile result of du, $du -shc /* 3.3M /bin 1.2M /boot 4.0K /dev 5.5M /etc 38M /home 9.7M /lib 0 /media 0 /mnt 12K /opt 0 /proc 168K /run 2.5M /sbin 0 /sys 0 /tmp 45M /unit_tests 273M /usr 228M /var 36K /www 605M total Which command shows the exact file size? Or, what other command can be executed to obtain the correct file size? | When I sum up the sizes of my files, I get one figure. If I run du, I get another figure. If I run du on all the files on my partition, it doesn't match what df claims is used. Why are there so many different figures for the total size of my files? Can't computers add? Speaking of adding: when I add the “Used” and “Available” columns of df, I don't get the total figure. And that total figure is smaller than the size of my partition. And if I add up my partition sizes I don't get my disk size! What gives? |
For some reason, a Meta question on IPS has recently erroneously appeared in the sidebar "Featured on Meta" box. Not only is this question not currently featured, it's locked. The featured tag was removed February 2nd, and this is not a caching issue because it was not in the box earlier this evening. Some screenshots: The box and the entirety of the currently tagged "featured" list. The history page that shows the featured tag being removed on February 2nd and locked. Why must I be forced to relive out past failures??? My understanding is that this occurs from time to time. How can it be fixed? There's a similar problem on PPCG and, interestingly, that post is also locked for historical significance. I'm not sure if that's part of the bug or merely a coincidence. Can we please fix this? It's been a month. It's March 2nd and I'm still seeing it posted in the sidebar. At the same time, I have unfeatured the "UPDATED: COMPLETED" post in the first image (which is not locked) and it is not being affected. | about nominations for Pro Tempore Moderators on was a featured question, but was . However, it sometimes still appears as featured on the main page of : This might have something to do with the fact that the post shortly after the tag has been removed. This bug also extends to the API. During a period when they question appears in the sidebar, the API route /questions?tagged=featured&site=cseducators.meta returns: { "items": [ { "tags": [ "discussion", "featured", "topic-challenges" ], "owner": { "reputation": 2721, "user_id": 58, "user_type": "moderator", "accept_rate": 12, "profile_image": "https://lh4.googleusercontent.com/-ZnN3lJjklJg/AAAAAAAAAAI/AAAAAAAAAWE/zqGtDAyXfjo/photo.jpg?sz=128", "display_name": "thesecretmaster", "link": "https://cseducators.meta.stackexchange.com/users/58/thesecretmaster" }, "is_answered": true, "view_count": 91, "answer_count": 2, "score": 9, "last_activity_date": 1501024496, "creation_date": 1499711767, "last_edit_date": 1499961119, "question_id": 207, "link": "https://cseducators.meta.stackexchange.com/questions/207/topic-challenges", "title": "Topic Challenges" }, { "tags": [ "discussion", "faq", "featured", "new-users" ], "owner": { "reputation": 3275, "user_id": 1293, "user_type": "registered", "profile_image": "https://i.stack.imgur.com/dxcsS.jpg?s=128&g=1", "display_name": "Buffy", "link": "https://cseducators.meta.stackexchange.com/users/1293/buffy" }, "is_answered": false, "view_count": 127, "answer_count": 0, "community_owned_date": 1499432641, "score": 9, "last_activity_date": 1499616804, "creation_date": 1499431354, "last_edit_date": 1499616804, "question_id": 203, "link": "https://cseducators.meta.stackexchange.com/questions/203/what-does-a-new-member-need-to-know-on-this-site", "title": "What does a new member need to know on this site?" }, { "tags": [ "discussion", "moderation" ], "owner": { "reputation": 266, "user_id": 23, "user_type": "moderator", "profile_image": "https://www.gravatar.com/avatar/2cf2eee5993f6cf3b0b149c2f8c5a323?s=128&d=identicon&r=PG", "display_name": "Robert Cartaino", "link": "https://cseducators.meta.stackexchange.com/users/23/robert-cartaino" }, "is_answered": true, "view_count": 609, "answer_count": 7, "score": 15, "locked_date": 1498246037, "last_activity_date": 1498235396, "creation_date": 1496674251, "last_edit_date": 1498235396, "question_id": 75, "link": "https://cseducators.meta.stackexchange.com/questions/75/accepting-nominations-who-should-moderate-this-site", "title": "Accepting Nominations -- Who should moderate this site?" } ], "has_more": false, "quota_max": xxxx, "quota_remaining": xxxx } This includes the nomination post as well as the 2 featured posts (at the time of this edit). As mentioned in , the same issue appears with , which was locked shortly before the tag was removed (see the for details) and is at the time of this edit still visible in the sidebar. |
I have a situation where I need to communicate with an API that only allows connections from one particular IP. So api.example.com accepts connections on port 443 from whitelisted-ip I want to be able to connect from anywhere to whitelisted-ip port 443, and have it forward the packets to api.example.com on port 443, and send responses back to the connecting machine. I assume there's some way of doing this similar to a transparent squid proxy, but I can't figure it out. I tried following the examples here () using the statements below, but no success. iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 443 -j DNAT --to api.example.com:443 iptables -t nat -A POSTROUTING -o eth1 -d api.example.com -j SNAT --to whitelisted-ip Any help would be appreciated. Update: I also tried the below, to no avail: iptables -t nat -A PREROUTING -p tcp -d whitelisted-ip --dport 443 -j DNAT --to api.example.com:443 iptables -t nat -A POSTROUTING -p tcp -s api.example.com --sport 443 -j SNAT --to whitelisted-ip:443 Thanks | I would like do some NAT in iptables. So that, all the packets coming to 192.168.12.87 and port 80 will be forwarded to 192.168.12.77 port 80. How to do this with iptables? Or Any other ways to achieve the same? |
I'm getting a NullPointerException when I try to populate my ComboBox, I have my class implementing Initializable. private ObservableList<String> incomeList = FXCollections.observableArrayList("Regular", "Other"); private ObservableList<String> expenseList = FXCollections.observableArrayList("Food", "Entertainment", "Rent", "Bills", "Other"); @Override public void initialize(URL location, ResourceBundle resources) { incomeComboBox.setItems(incomeList); expenseComboBox.setItems(expenseList); } I just want the ComboBoxes to be filled. 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? |
After an update wifi stops connecting to any network (excluding router at work). It just tries to connect and after that asks for the password again and again. I tried to reinstall the driver but that doesn't help. 12:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01) Ubuntu 12.04.2 LTS \n \l It's strange because this is a Dell Vostro 1440 which is in certified Ubuntu laptop list. | I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible. What are the steps to install Broadcom wireless drivers for a BCM43xx card? I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc. lspci -vnn | grep Network showed: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b] iwconfig showed: lo no wireless extensions. eth0 no wireless extensions. NOTE: Answer below is updated every time new information is added and confirmed working. |
By way of motivating example, someone came up with a completely evil user interface where the user was required to select their ten digit phone number by moving a sliding window over the digits of pi: Given that pi is infinite and non-repeating, my gut says that all possible combinations of ten digits must exist somewhere in the digits of pi, but I don't know how to prove that. Help appreciated. Best, Glenn | I came across the : Which states: $\pi$ Pi Pi is an infinite, nonrepeating $($sic$)$ decimal - meaning that every possible number combination exists somewhere in pi. Converted into ASCII text, somewhere in that infinite string of digits is the name of every person you will ever love, the date, time and manner of your death, and the answers to all the great questions of the universe. Is this true? Does it make any sense ? |
I use a style in the following example to arrange references. I want to make some changes in the style. I need to add the condition of the status of a comma after the name of the scientific journal and writing vol. at volume \RequirePackage{filecontents} \begin{filecontents}{\jobname.bib} @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" } \end{filecontents} \documentclass[a4paper,10pt]{article} \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage{csquotes} \usepackage[% style=numeric, sortcites, backend=biber, giveninits=true % <=================================================== ]{biblatex} \addbibresource{\jobname.bib} \DeclareNameAlias{default}{family-given} % <============================ \renewbibmacro{in:}{} \renewcommand*\newunitpunct{\addcomma\space} % <======================== \renewcommand*\newunitpunct{\addcomma\space} % <======================== \renewcommand*{\finalnamedelim}{% \addspace\bibstring{and}\space}% % <===== ^^^^^^^^^^^^^^^^^ ============================================= \begin{document} \section{First Section} This document is an example of BibTeX using in bibliography management. Three items are cited: \textit{The \LaTeX\ Companion} book \cite{latexcompanion}, the Einstein journal paper \cite{einstein}, and the Donald Knuth's website \cite{knuthwebsite}. The \LaTeX\ related items are \cite{latexcompanion,knuthwebsite}. \medskip \printbibliography \end{document} The output Einstein, A., "Zur Elektrodynamik bewegter Körper. (German) [On the electrodynamics of moving bodies]", Annalen der Physik 322.10 (1905), pp. 891—921, DOI: . I need to have the output like this Einstein, A., "Zur Elektrodynamik bewegter Körper. (German) [On the electrodynamics of moving bodies]", Annalen der Physik, vol. 322.10 (1905), pp. 891—921, DOI: . I need to add the condition of the status of a comma after the name of the scientific journal and writing vol. at volume. ie., Annalen der Physik 322.10 to Annalen der Physik, vol. 322.10 | How do I suppress the "In: " before the journaltitle? Like so: In: Journal of Applied Physics |
I'm having a problem: I have to put a pdf (multi-page) file in a LaTeX document. But, when I do this, all the figures from the chapter appear after the document. I'm using: \begin{figure}[!htbp]...\end{figure} and after some text and lines \includepdf[pages=1-24, scale=0.95, pagecommand={\thispagestyle{plain}}]{document.pdf} What can I do to force \includepdf to appear after the figures? I tried \pagebreak and \newpage and none of them helped. Thanks! | For some reason, my figures get pushed to the end of the document. I tried begin{figure}[t], [h] and other options, but none helped. Any ideas how to get the figures to appear much earlier in the document, where they are approximately first mentioned in the .tex file? |
Hi I know in Audacity you can record a sound, invert it, and then play it, but I'm looking for something automatic. Basically this program would listen to all sound coming in, invert them, and then play them at the same time. All instantly. Is this possible? | I'm aware that the best option for noise cancelling is to buy myself a pair of noise cancelling headphones... But is there any software available that would use the pc mic and headphones to block background noise? |
prove that all the roots of $\sum_{k=0}^{n}\frac{z^{k}}{k!}$ are in $\{z:\frac{n}{e}<|z|<2n\}$. I thought about using Rouché's theorem but there is no function which I can compare to. Does anyone have an idea? | I'm having trouble with a question from an exam I'm studying for: " Prove that all roots of the polynomial $\sum\limits_{k=0}^n \frac{z^k}{k!}$ (for $n\geq 1$) are in the annulus $\{z: \frac{n}{e}<\vert z\vert<2n \}$. Hint: use the inequality $n^ne^{-n}<n!$" These kind of questions are usually solved by using Rouché's theorem, so I assume that's the case here as well, but I'm having trouble choosing the right functions to use and bounding their norms correctly. I feel like I should be comparing $e^z$ and $\left(e^z - \sum\limits_{k=0}^n \frac{z^k}{k!}\right)$ on the circle with radius $\frac{n}{e}$ since e^z has no roots there, so maybe that will imply the polynomial also has no roots there. And then maybe using some other argument to show that all the polynomial's roots are inside the larger disk of radius $2n$. |
I managed to craft the Team Fortress 2 badge after trading away a couple of duplicates to friends. However when I went to view my badge progress, I noticed that the remaining duplicate cards had formed an alliance and were requesting more of their friends for another badge. Just how many levels are there for card badges? | With the new Steam Trading Cards, I decided to craft the badge for CS:GO. I got this: I then noticed that this is only a level 1 badge, and there was a level 2 badge to get. So I crafted it too: Now it says there's a level 3 badge to get next. How many levels are there in total? |
The equation for angular momentum is L=mvr in which L is the angular momentum, m is the mass, v is the velocity, r is the radius. How does one derive this equation from the other laws of motion? | I am reading An Introduction to Mechanics by Kleppner and Kolenkow (2014). On page 241 is the definition of the : Here is the formal definition of the angular momentum $\vec{L}$ of a particle that has momentum $\vec{p}$ and is at position $\vec{r}$ with respect to a given coordinate system: $$\vec{L}=\vec{r} \times \vec{p}$$ In the book there is no explanation why this formula should be true. From this equation the formulas for torque and moment of inertia are derived. My question is: Why is the formula above correct? Why isn't the formula for angular momentum something completely different, like $\vec{L}=\sqrt{(\vec{r} \times \vec{p})2\pi M}$? Is the formula for angular momentum just a mere definition and if not, how to derive it? How did people come across that particular formula? |
I am trying to understand closure and I understand that a function closes over the variables of its outer scope. But it seems like, it's not just outer scope but any scope outside the function. For example this code function func (arg) { return function f1() { return function f2(){ console.log(arg) } } } var t1 = (func("test1"))(); var t2 = (func("test2"))(); t1(); t2(); works and anytime you call t1 or t2, they print out test1 and test2 respectively. So my question is this, does function closure work for any scope outside the function? | How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves? I have seen given on Wikipedia, but unfortunately it did not help. |
If in the series $1-\frac{1}{2}+\frac{1}{3}-\frac{1}{4}\cdots$ the order of the terms be altered, so that the ratio of the number of positive terms to the number of negative terms in the first $n$ terms is ultimately $a^2$, show that the sum of the series will become $\log 2a$. It is easy to show that when $a^2=1$, the sum is just the expansion of $\log(1+x)$ when $x=1$. However I don't know how to prove it in the general case. | If in the series $1-\dfrac {1} {2}+\dfrac {1} {3}-\dfrac {1} {4}+\ldots $ the order of the terms be altered, so that the ratio of the number of positive terms to the number of negative terms in the first $n$ terms is ultimately $a^{2}$, show that the sum of the series will become $\log \left( 2a\right) $. Solution attempt. Let $p$ be the number of positive terms in the first $n$ terms of the reordered series so based on the question we are allowed $a^{2}=\dfrac {p} {n-p}$. Now solving for p we get $p=\dfrac {a^{2}n} {\left( 1+a^{2}\right) }$ and $n-p=\dfrac {n } {\left( 1+a^{2}\right) }$. We also observe that in the original series only the odd terms are positive and only the even terms are negative. Let's define $S_{odd}=1+\dfrac {1} {3}+\dfrac {1} {5}+.\ldots +\dfrac {1} {2n-1}$ and $S_{even}=\dfrac {-1} {2}\dfrac {-1} {4}\ldots -\dfrac {1} {2n}$ $S_{Reordered}=S_{odd_{p}}+S_{even_{n-p}}$ $S_{Reordered}=\sum _{t=1}^{t=P}\dfrac {1} {2t-1}+\sum _{t=1}^{t=(n-P)}\dfrac {-1} {2t}$ $S_{Reordered}=\sum _{t=1}^{t=\dfrac {a^{2}n} {\left( 1+a^{2}\right) }}\dfrac {1} {2t-1}+\sum _{t=1}^{t=\dfrac {n } {\left( 1+a^{2}\right) }}\dfrac {-1} {2t}$ In order to extend $S_{Reordered}$ from n terms to an infinite length. I guess i should take the limit of the $S_{Reordered}$ as $n\rightarrow \infty $ which would make the upper values of $t$ (Not sure of technical term here) to be $\infty$ giving me $S_{Reordered}=\sum _{t=1}^{t=\infty}\dfrac {1} {2t-1}+\sum _{t=1}^{t=\infty}\dfrac {-1} {2t}$ and i have lost the $a$ from the expression. I guess i am stuck i need to perform some step to capture a before taking the limit. Any help would be much appreciated. |
There was the following quote from Adam B. Schiff, Democrat Representative on President Obama’s request for a formal authorization of Congress to fight the Islamic State in New York Times article (February 10), titled “Obama to seek war bill from Congress to fight ISIS. “Representative Adam B. Schiff was uncomfortable with much of what he has seen floated, especially the lack of a 2001 repeal. “If you don’t sunset that” he said, “any sunset you put in a new authorization is pretty meaningless because any president can rely on the 2001 authority to claim they have all they need.” Oxford Advanced Learnner's Dectionary at hand defines 'sunset' simply as a noun meaning 1.(u) the time when the sun goes down and night begins. 2. (c) the colours in the part of the sky where the sun slowly goes down in the evening. I don’t think I’ve ever seen the case of the word “sunset” being used in tandem in the form of both verb and noun in a line in this way. Is it common to use “sunset” as a verb to mean (as I take it) “to repeal” or “put something to an end” in this way? What does “sunset” exactly mean here? | In the definition of , I read the following text: Many of the act's provisions were to sunset beginning December 31, 2005, approximately 4 years after its passage. In the months preceding the sunset date, supporters of the act pushed to make its sunsetting provisions permanent, while critics sought to revise various sections to enhance civil liberty protections. In July 2005, the U.S. Senate passed a reauthorization bill with substantial changes to several sections of the act, while the House reauthorization bill kept most of the act's original language. The two bills were then reconciled in a conference committee that was criticized by Senators from both the Republican and Democratic parties for ignoring civil liberty concerns. What does sunset mean? In which cases can the word be used with a similar meaning? |
I am doing a homework where I need to mount test.img to a directory so I was running $ mount -o loop test.img t NTFS signature is missing. Failed to mount '/dev/loop2': Invalid argument The device '/dev/loop2' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around? So I run df to check my disk ,the result is: As the picture shows, there is loop0,loop1,loop3,loop4,loop5,loop6, just not loop2. What can I do to make the mount operation successful? | I'm running into trouble trying to mount a large iso: dev@dev-OptiPlex-745:~$ sudo mount -o loop /home/dev/Hämtningar/matlab2011a_64.iso /cdrom mount: warning: /cdrom seems to be mounted read-only. dev@dev-OptiPlex-745:~$ Can you tell me how I should do it? |
I have a following XML structure: <?xml version="1.0" encoding="utf-8"?> <Class> <subjects> </subjects> <students> <Name>klashf</Name> <Name>lkashf</Name> </students> <marks> <english>yes</english> <math>yes</math> </marks> </Class> Now for e.g. I want to delete English element <english>yes</english> from it. How can I do that? I tried many things like following but I am unable to find a way to get to that node. I tried to construct a XPath to that node but unable to get there. Can nayone tell me what should be the xPath to there? public bool RemoveTag(string userName, string tagName) { XmlDocument newDoc = new XmlDocument(); newDoc.Load(path); XPathNavigator navigator = newDoc.CreateNavigator(); XPathExpression query = navigator.Compile("//marks"); query = navigator.Compile("//marks/" + tagName); XmlNodeList marksNodes = newDoc.GetElementsByTagName("marks"); XmlNode nodeToDelete=marksNodes[0].SelectSingleNode(userName+"/marks/"+tagName); for (int i = 0; i < marksNodes.Count; i++) { marksNodes[i].RemoveChild(nodeToDelete); } return status; } | The following code should find the appropriate project tag and remove it from the XmlDocument, however when I test it, it says: The node to be removed is not a child of this node. Does anyone know the proper way to do this? public void DeleteProject (string projectName) { string ccConfigPath = ConfigurationManager.AppSettings["ConfigPath"]; XmlDocument configDoc = new XmlDocument(); configDoc.Load(ccConfigPath); XmlNodeList projectNodes = configDoc.GetElementsByTagName("project"); for (int i = 0; i < projectNodes.Count; i++) { if (projectNodes[i].Attributes["name"] != null) { if (projectName == projectNodes[i].Attributes["name"].InnerText) { configDoc.RemoveChild(projectNodes[i]); configDoc.Save(ccConfigPath); } } } } UPDATE Fixed. I did two things: XmlNode project = configDoc.SelectSingleNode("//project[@name='" + projectName + "']"); Replaced the For loop with an XPath query, which wasn't for fixing it, just because it was a better approach. The actual fix was: project.ParentNode.RemoveChild(project); Thanks Pat and Chuck for this suggestion. |
I need to increment a row in attribute table: def func (w,v,pot): return pot + ((pot+1 - pot)/(v+1 - v))*(w-v) The "+1" is not the addition of number one to the variable, is the intention to increment + 1 row in that column of that variable. This is because I need to calculate the actual record using records from the next line. How can I do that? I know this is basic, but I realy don't know python. | This is probably a fairly basic question but I have a long list of latitude and longitude values that represent telemetry points that will be the start point of the line. Before I convert them to line, I need to add a column for the ending latitude and longitude values of the line. This will be equal to the lat longs of the next point. Each point is represented by a column "uniqueID" This is one example of what I need done but there are several other instances in the database. The example is shown in excel and is easily calculable with an "=B2" expression in excel but I need a formula for it in ModelBuilder. |
I am about to complete my High school. Typically, I study text books of science but it takes a lot of time to understand the concept resulting less time to do questions and due to which I get low marks(not having English as my native language is also a factor). How should I start, please guide me from basic to advance level. How could I study science, effectively, without wasting any time. | Note: I will expand this question with more specific points when I have my own internet connection and more time (we're moving in, so I'm at a friend's house). This question is broad, involved, and to some degree subjective. (I started out as a physics-only student, but eventually decided to add a mathematics major. I am greatly interested in mathematics; the typical curriculum required for physics students is not deep or thorough enough; mathematics is more general (that means work!); and it only requires a few more classes. Naturally, I enjoy immensely.) This question asks mainly of undergraduate-level study, but feel free to discuss graduate-level study if you like. Please do not rush your answer or try to be comprehensive. I realize the StackOverflow model rewards quick answers, but I would rather wait for a thoughtful, thorough (on a point) answer than get a fast, cluttered one. (As you probably know, produces clear, useful writing; and a properly-done comprehensive answer would take more than a reasonable amount of time and effort.) If you think an overview is necessary, that is fine. For a question this large, I think the best thing to do is focus on a specific area in each answer. Update: To Sklivvz, Cedric, Noldorin and everyone else: I had to run off before I could finish, but I wanted to say I knew I would regret this; I was cranky and not thinking clearly, mainly from not eating enough during the day. I am sorry for my sharp responses and for not waiting for my reaction to pass. I apologize. Re: Curricula: Please note that I am not asking about choosing your own curriculum in college or university. I did not explicitly say that, but several people believed that was my meaning. I will ask more specific questions later, but the main idea is how a physics student should study mathematics (on his or her own, but also by choosing courses if available) to be a competent mathematician with a view to studying physics. I merely mentioned adding a mathematics major to illustrate my conclusion that physics student need a deeper mathematical grounding than they typically receive. And now I have to run off again. |
I'm using amsthm and thmtools to define custom theorem environments, definition environments, etc. All such environments share the same counter. Is it possible to vary the numbering format depending on the section depth? I want to achieve the following numbering format: 1 Section 1.1 Theorem 1.2 Definition 1.1 Subsection 1.1.1 Theorem 1.1.2 Lemma | I would like to change the numbering scheme for my theorems per chapter. That's because I have smaller and bigger chapters. Bigger chapters need subsections for proper structuring, and so my theorems are numbered within subsections. For smaller chapters there won't be any subsections so I would like to have my theorems numbered within sections. (That means one less number). What I'm trying to accomplish is: Chapter 1. Section 1.1. Subsection 1.1.1. Theorem 1.1.1.1. Theorem 1.1.1.2. Chapter 2. Section 2.1. Theorem 2.1.1. Theorem 2.1.2. How can I do that? MWE: (randomize section titles and theorem body text as you please) \documentclass{book} \usepackage{amsthm} \newtheorem{theorem}{Theorem}[subsection] \begin{document} \chapter{} \section{} \subsection{} \begin{theorem}\end{theorem} \chapter{} \section{} \begin{theorem}\end{theorem} \begin{theorem}\end{theorem} \end{document} Note: egreg's answer includes a version incorporating the hack he gave me . |
I use tis code: $(document).bind('click', function(e) { if(!$(e.target).is('#paybox')) { $('#paybox').hide(); } }); to hide #paybox when user click anywhere but #paybox. But when I click on "radio" form: <div id="paybox"> <table width="100%"> <tr> <form method="post" action=""> <td> <input type="radio" name="dauer" value="small" checked> </td> <td> <input type="radio" name="dauer" value="mid"> </td> <td> <input type="radio" name="dauer" value="big"> </td> </form> </tr> </table> </div> INSIDE the #payboy then #payboy get hidden! How can I prevent this? | I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area. Is something like this possible with jQuery? $("#menuscontainer").clickOutsideThisElement(function() { // Hide the menus }); |
Questions like are locked (or closed, or on hold, etc.) which is clearly stated when using the website version of Stack Exchange. This message does not appear on the app. I think it would be awesome if it were added to the app. (In order to prevent foolish questions like for example.) | Testing the app, I noticed the title does not specify if a question is "On Hold" ... I haven't checked specifically, but would assume it doesn't specify as "Duplicate" either ... Or am I missing it somewhere? Is it not in the title but located/displayed some other way? If it is, this could be very confusing to users. If it isn't there, it's definitely confusing to users :-) Using: Version 1.0.1.125 on iPad3 with iOS8 |
Sometimes you can see Pokémon "nearby" your location, which is identified by footprint icons depicting the distance that particular Pokémon is from your current location: There are 3 "distances"; 1, 2 or 3 footprints. How far do each of these represent? | I just started and finally caught my second Pokémon, as I noticed these steps on my close by Pokémon. What does it mean? It is probably related with how far the Pokémon is, but how far is far? |
When I include a JavaScript library with my normal script, is there a way to make Visual Studio (2015)'s Intellisense work? My setup: <!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8" /> <!-- the library I want Intellisense to work with --> <script src="libs/three/build/three.min.js"></script> </head> <body> <h1>Hello</h1> <script type="text/javascript" src="main.js"></script> </body> </html> And in my main.js I want to use the Three library I have specified: var scene = new THREE.Scene(); When I enter THREE. I want to see a list of available attributes as I begin typing Scene. Is my setup wrong - do I need some sort of config file? Or does this functionality not exist with JS? | I thought jQuery Intellisense was supposed to be improved with SP1. I even downloaded an annotated version of jQuery 1.2.6, but intellisense will not work in a separate jscript file. I have the jQuery library referenced first on my web page in the <head> tag. Am I doing anything wrong? |
I have a hp 8570w workstation with an Nvidia graphics card. I did not update my system for a long time fearing that the graphics card would break and by mistake i updated the system recently. As expected it happen, my laptop gets stuck in blank screen when I power on. I am only able to login through tty1 to tty6 and on tty7 it just shows a blank screen and wouldn't proceed to the desktop. Can someone help me fix this problem ? Thank you | I am trying to boot Ubuntu on my computer. When I boot Ubuntu, it boots to a black screen. How can I fix this? Table of Contents: |
The following code tries to determine from which input field the user has filled via the getParameter() method: protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println(request.getParameter("userinput")); if(request.getParameter("userinput") != "userinput") accessExampleView(request, response); else accessServletSubsidiary(request, response); } Visually, I am trying to find out whether the user entered a value in the first field, or the second: However, each time this runs, it points to accessExampleView. I tried setting the if statement logic to: if(request.getParameter("userinput") != null) to no avail - the first line continues to be true and routes to the accessExampleView method. Essentially, is there a better way to check what kind of value exists in request object? Here is the JSP file that this utilizes: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>JSP HTML page</title> </head> <body> <form action="ServletHome" method="post"> <fieldset name="f1"> This page communicates with the servlet page via input types. <br> <br> <label>Enter some text: </label> <input type="text" name="userinput"> <input type="submit" value="send"> <br> Enter your age: <input type="number" name="userAge"> <input type="submit" value="send"> <br> </fieldset> </form> </body> </html> | I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference? |
I'm an undergraduate student, and I'm working on a (physics) project with one of my supervisors. We hope to complete the project soon and submit it to various journals for publication. Most journals require the affiliation of the authors. Since I am an undergraduate student, I'm not affiliated with/hired by a university's department, per say. How would I ho about filling in the affiliation section (in my case)? Should I be leaving it blank? | I am an undergraduate, and I want to know what to put as an affiliation on a research paper. |
I have a 4x6 grid when click on the Show Applications icon in Ubuntu 18.04. The resulting icons look MASSIVE on my desktop. Is there a way to either alter their size or, ideally, alter the grid dimensions so that more icons fit on each page (thereby reducing the icon size)? | The appDisplay.js file which could be used to set icon size and grid properties of the application overview (Super+A) in Ubuntu Gnome 14.04 is not available any more in Ubuntu 16.04 shipping with Gnome 3.18. In most displays, having only the default six columns leave a large empty space on each side of the application grid, which could be used to avoid scrolling three or four pages down in the all-applications display and simply make better use of the available space. Where is that value defined? Is it possible to configure the number of columns to be computed according to the available space or to set it to a higher value? |
I have a very basic WinForms App that searches for the number of files in a specified folder that the user selects. The code is: DialogResult result = folderBrowserDialog1.ShowDialog(); if (result == DialogResult.OK) { if (checkSubFolders.Checked = !true) { string[] files = Directory.GetFiles(folderBrowserDialog1.SelectedPath); txbNumberOfFiles.Text = files.Length.ToString(); txbFilePath.Text = folderBrowserDialog1.SelectedPath; } Now what I want to do is also return the number of files in sub-folders when my check box is checked. Is there a simplistic way to do this? Thanks | Is there a way to find the number of files of a specific type without having to loop through all results inn a Directory.GetFiles() or similar method? I am looking for something like this: int ComponentCount = MagicFindFileCount(@"c:\windows\system32", "*.dll"); I know that I can make a recursive function to call Directory.GetFiles , but it would be much cleaner if I could do this without all the iterating. EDIT: If it is not possible to do this without recursing and iterating yourself, what would be the best way to do it? |
I just wanted to flag question as offtopic. I wanted to suggest that it belongs to cstheory.stackexchange.com. Unfortunately, I can't, because it's not on the possible target StackExchange sites list. Why is there no "other" button? | I think there should be more Stack Exchange networks available when flagging a question to be migrated. For example I'd think that the following question: ...would be a better fit on unix.stackexchange.com instead of Stack Overflow. But without the option to mark it so, I feel hesitant to mark it. |
I am working on a class that makes a callout to a third party API. The third party API needs to be authenticated with a OpenID Connect Auth token. So, in my class, I am making a callout to the OpenID Connect Auth service to get a bearer token and then I am making a callout to the third party API with the bearer token from OpenID Connect API. The third party API is providing some additional information about the fields on the Account object and I am updating the values on the Account object. There are multiple scenarios in this case. The values on the Account object is different from what is retrieved from the third party API. In this case, the values on the Account object are updated. The values on the Account object is same as what is retrieved from the third party API. In this case, the account is not updated. The third party API returns a blank response. So, the response body contains []. In this case, I am skipping the account. The apex class is working fine. However, I need some help in building a test class for this. I am sure I need to use MultiStaticResourceCalloutMock stub class to build the test class, but I have some questions around it. My questions are below. Do I need to write three test methods, one for each scenario? In each of the test methods, I assume I need to use MultiStaticResourceCalloutMock with two end points, one for OpenID Connect Auth and one for third party API, correct? I also need three static resources, one for successful response, one for blank response (the static resource file will contain [] only, and one with the response where the values are exactly same as what is on the Account, correct? Can someone help? | What is the best practice for writing apex test classes where you have multiple callouts? My Test Class would then be testing the secondCallout method which happens to also call a firstCallout method that has a callout in itself. My question is, what is the appropriate way to be able to run the mock test for both methods? Main Class public class myclass { public static String firstCallOut() { HttpRequest req = new HttpRequest (); HttpResponse res = new HttpResponse(); req.setMethod('POST'); //code snippets only return res.getBody(). } public static void secondCallOut() { String resultFromFirstCallout = firstCallOut(); HttpRequest req = new HttpRequest (); req.setMethod('POST'); req.setBody(resultFromFirstCallout); //code snippets only } } Mock Class public with sharing class MyMockclass implements HttpCalloutMock { protected Integer code; protected String status; protected String body; protected Map<String, String> responseHeaders; public MyMockclass (Integer code, String status, String body, Map<String, String> responseHeaders) { this.code = code; this.status = status; this.body = body; this.responseHeaders = responseHeaders; } public HTTPResponse respond(HTTPRequest request) { // Create a fake response HttpResponse response = new HttpResponse(); for (String key : this.responseHeaders.keySet()) { response.setHeader(key, this.responseHeaders.get(key)); } response.setBody(this.body); response.setStatusCode(this.code); response.setStatus(this.status); return response; } } Test Class @isTest(seeAllData=false) public class myclassTest{ static testMethod void myTestMethod(){ Map<String, String> responseHeader = new Map<String, String>(); responseHeader .put('Content-Type','application/json'); MyMockclass mock= new MyMockclass ( 200, 'success', 'Succesful', responseHeader ); Test.setMock(HttpCalloutMock.class, mock); Test.startTest(); myclass.secondCallOut(); Test.stopTest(); } |
I saw this in the mid 80's with subtitles. It seemed to me that it wasn't very recent even then, so it could possibly have been made in the 70's or the 60's. Two men end up in a future after a war which devastated the earth, and forced humans to live underground. I don't remember how they ended up in the future; time travel, having been frozen or having been away, for example in space, for a long time are reasons I can think of. However, they key plot is that the need for men has been eliminated, and the women reproduce by some process involving in vitro tanks. Their society is lead by an elderly woman referred to only as Her Excellency. As the story goes on, the two men find that the surface is actually habitable, and that Her Excellency has kept that fact from her subjects, and when they confront her, she shows her true self, and it turns out that she's actually a man, and that he hates having to pose as a woman. The three of them devise a plan to re-introduce men, and eventually they release their own semen in the in vitro tanks. The final scene shows a young woman picking a baby up from one of the tanks only to discover that it's boy. | My recollection is very sketchy but this is what I remember.... Film was possibly black and white I saw it as a child in the late '80s early '90s but it's older It was subtitled and in Russian or similar language It involved some astronauts travelling in space with possibly time travel The astronauts (mostly men) encounter a planet/civilization of only women The women no longer need men to breed and are so become superior and possibly want to eliminate all men That's all I have to go on, sorry. |
How to check whether a cell is not equal to #N/A & if so include that with another cell to check both are same | I have over 6000 records and half of them are formulas that are missing a variable so they result in #N/A on the spreadsheet, what i want to do is if the cell is #N/A then leave the cell blank, otherwise print a string like so =IF(AR6347="#N/A","","string in here") But this does not work with ="#N/A", is there a way to do this? |
I have accidentally deleted some files. With rm. It seems recovery is not so easy on Linux. Is it some way I can do a image backup including the lost files (If they still exist)? I should know the filesystem of course, don't remember - but its a regular company CentOS. Update: lvm2 pv. Lost files are small text-files. | Is there a command to recover/undelete deleted files by rm? $ rm -rf /path/to/myfile How can I recover myfile? If there is such a tool how can I use it? |
I need the data within 2 Parentheses. Something sorta like this. textBox1.Text += "IndexError[0] : (untabbedIndex) in Program.cs"; I need to only get the untabbedIndex in the string. I've tried splitting the string again, but no luck. | I have a string User name (sales) and I want to extract the text between the brackets, how would I do this? I suspect sub-string but I can't work out how to read until the closing bracket, the length of text will vary. |
Taking 2.82 for a spin and tried to both 'Add' Images as planes, and 'Import' Images as planes. Neither option is available. Will this option be back in when 2.82 has it's final release? Thanks! | Cannot find Background Images feature to add in a photo in Blender 2.8 Where is it? |
How would I compare an object that I created using scanner. To an object stored of the same class that I placed in the java link list. This is where I get the object stored in the phone book class where my java link list is. //this is the class I will use to //create an object to store in the objects of link list //here I will store the records public class Person { private String firstName; private String lastName; private String phoneNumber; public Person() { firstName=""; lastName=""; phoneNumber=""; } public Person(String nombre,String last, String number) { firstName=nombre; lastName=last; phoneNumber=number; StringBuilder str =new StringBuilder(phoneNumber); str.insert(3,"-"); str.insert(7,"-"); phoneNumber=str.toString(); } public Person(String nombre, String last) { firstName=nombre; lastName=last; phoneNumber=""; } } //this will see if the two object are equal without comparing phone numbers public boolean same(Person waco) { boolean perro=false; if(firstName == waco.firstName && lastName == waco.lastName) { perro =true; } return perro; } This is how I add entry to my link List. //santiago is the link list if( input == 'n') { System.out.println("you have chose to add an entry"); String first; //this will hold the firstName String last; //this will hold the last Name String phone; //this will hold the phoneNumber System.out.println("enter the first name"); first=keyboard.nextLine(); System.out.println("enter the last Name of this person"); last=keyboard.nextLine(); System.out.println("insert phone in the following form without dashses xxx-xxx-xxxx"); phone = keyboard.nextLine(); keyboard.nextLine(); santiago.add(new Person(first,last,phone)); } Now what I am trying to do is see how a Person object I put into my list, is equal to a new Person item I created using scanner in this following part of the code if( input == 's') { System.out.println("enter a first Name"); String first = keyboard.nextLine(); //put in here the first name System.out.println("enter a last name"); String last =keyboard.nextLine(); //put in the last Name Person agustin = new Person(first ,last); Person maria = santiago.get(0); System.out.println(agustin.same(maria)); } Now if santiago and maria objects have the same first and last Name the same method should return true But my program returns to it to me as false. I am not sure why? | I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference? |
I need to get posts with specific post meta. If I inspect regular loop using following code: $args = array( 'post_status' => 'published', 'posts_per_page' => 77, 'post_type' => 'post', ); $query = new WP_Query($args); while ($query->have_posts()) : $query->the_post(); $literature = get_post_meta(get_the_ID(), 'popis_literature'); var_dump($literature); endwhile; for some posts var_dump gives an array of data like this array (size=1) 0 => array (size=2) 0 => string '32985' (length=5) 1 => string '59956' (length=5) How can I query posts by one of those IDs? This doesn't give me anything $args = array( 'post_status' => 'published', 'posts_per_page' => -1, 'post_type' => 'post', 'meta_query' => array( array( 'key' => 'popis_literature', 'value' => array('32985'), 'compare' => 'IN' ) ), ); | Here are the args for my query : $args = array( 'post_type' => 'news', 'meta_query' => array( array( 'key' => 'topics', 'value' => 'sports', ) ) ); This works when topics is a string, but not when it is an array. I'd like this query to work when topics is for example array( 'sports', 'nonprofit', etc. ) Is there a way to build meta queries with arrays as a meta_key ? |
I am working with SharePoint online and in one of the lists, I am using a choice check box column called 'Vehicle Type' with following choices: Personal Vehicle, Company Vehicle. I am looking to do a simple thing, when Personal vehicle is checked, then I would like to hide two currency columns: Car Rental, Fuel and if Company Vehicle is checked I want to show the above two columns. Can someone help me with the JS solution. Thanks in advance. P.S: it should account for the change event. <script src="//code.jquery.com/jquery-3.2.1.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() $("input[title='Vehicle Driven']").change(function(){ if($(this).is(":checked")=="Personal Vehicle"){ $("nobr:contains('Fuel')").closest('tr').hide(); }else{ $("nobr:contains('Fuel')").closest('tr').show(); } }); }); </script> | I followed the steps in the link to Show/Hide a field in a form, based on the value of another field. What I am having an issue with now is getting this to work on a New List Form, that I created from SharePoint Designer. I have SharePoint foundation 2013, so no access to InfoPath or conditionally hiding a field. The New form needs to be created because of other restraints found within SharePoints default forms. Any help is appreciated. Thank you |
OK here's a weird question. I have like, 7 year old hardware. I have Ubuntu 12.10 installed. If I ever have a need to go into the BIOS, it's showing the time incorrect - I think it's showing it in GMT. I'm in EST. When I go into Ubuntu, it reflects the time accurately in the OS. If I correct the time in the BIOS and go into Ubuntu then reboot into BIOS again, the time is once again set to GMT. Is this normal behavior? | Dual boot system Windows XP Pro and Ubuntu 12.04. I have the bios set for the correct time and Ubuntu set for US Eastern time. Ubuntu will boot up and the time will be off by -4 hours. If I correct the time in Ubuntu then when I boot up in Windows XP the time will be off by + 4 hours. This is a fresh install of 12.04. I did not have this problem before reinstalling Ubuntu. |
Im a 10th grader and i want to learn combinatorics. I donot have a mentor and planning to self study it. Im interested in solving Olympiad probelms and maybe participate as well. I want a book that explains combinatorics to me like a kid! I know a bit of graph theory and a little bit of generating functions. I would love to learn recurrence relations. I would love to see a book within this topics as well. Thanks! | Can anyone recommend me an olympiad style combinatorics book which is suitable for a high schooler ? I know only some basics like Pigeon hole principle and stars and bars . I hope to find a book which contains problems which purely test our originality ( the problems with beautiful constructions like , Nim problems, games,tillings, etc ) . More specifically problems which doesn't require theory but requires out of the box thinking . I don't know much about recurrence relations, generating functions or graph theory, so I would also love to see a book which introduces these topics . |
I tried to prove that the only functions $f: \mathbb{N} \to \mathbb{N}$ satisfying $$xf(y) + yf(x) = (x+y)f(x^2+y^2)$$ for all positive integers $(x, y)$ are constant functions. I supposed that: $$ \exists \; x \mbox{ such that } f(x) \neq f(1) \mbox{ and } \forall y \neq x, f(y) = f(1)$$ Then we have: $$ xf(1) + yf(x) = (x+y)f(1) $$ $$ \implies yf(x) = yf(1) \implies f(x) = f(1)$$ I would like to know if this is correct, since I am not sure that the negation of my hypothesis implies that the function is constant. Thank you! | The question below is from the 2002 Canada National Olympiad. I have found one family of functions but need help in finding (or proving the non-existence) of others. Suggestions on how to improve the solution method (especially rigour of arguments) would also be appreciated. Let $\mathbb{N} = {0,1,2,\dots}$. Determine all functions $f : \mathbb{N} \rightarrow \mathbb{N}$ such that $xf(y) + yf(x) = (x + y)f(x^2 + y^2) \tag{1}$ for all $x,y \in \mathbb{N}$. Expressing $f$ as a power series: $f(t) = a_0 + \displaystyle{\sum\limits_{k=1}^{\infty}{a_k x^k}} \tag{2}$ Assuming the power series is convergent, the general coefficient, $a_n$, is the same on both sides of equation (1). [I am not sure of this step]. So for $a_0$ $x(a_0) + y(a_0)=(x+y)(a_0)$ which is satisfied for all values of $a_0$. Hence $\boxed{f(t)=a_0,\:a_0\in\mathbb{N}}$ is a solution. For any $n > 0$, we have $\begin{align} x a_n y^n + y a_n x^n &= (x+y)a_n(x^2+y^2)^n \iff \\ a_n(xy^n+yx^n) &= a_n(x+y)(x^2+y^2)^n \end{align}$ and if this is true for fixed $n>0$ and all $x,y\ge0$ then $a_n=0$. So I am unable to find any other functions. |
I am using biblatex with backend=biber and hyperref package. In order to control the cite link color, I use \definecolor{mycolor}{HTML}{065F8F} \hypersetup{colorlinks, citecolor=mycolor, linkcolor=black, urlcolor=mycolor} For the biblatex package, I configure style \usepackage[backend=biber, style = authoryear, citestyle = authoryear-ibidem, hyperref = true, ... ] When I now use the \cite command, it renders something like Albrecht and Lee, 2012 where you must imagine the 2012 in blue and the rest in black. How can I edit the \cite command so that the complete reference (including the author name) is a link and therefore blue? | I'm new here so I'm not sure if this is the right way to express my question: I'm using the excellent biblatex package with the author-year style and want the links in my citations to include the name of the author as well as the parentheses. The answer presented at did exactly what I wanted but it seems the solution is broken with the newest biblatex version 1.4b. Can anyone help me by adapting the code to the newest biblatex version? |
If I create an enum like this public enum ImportType { Direct, Indirect, InBond } and I have a method that takes an ImportType as parameter as follows public bool ProcessValidImport(ImportType type) { // Process ImportType variable here } I can go and call the method as follows bool blnProcessed = ProcessValidImport((ImportType)7); But the ImportType variable value of 7 passed in to the method is not valid at all because any integer will work if cast. The enum defaults to an int type, so what is the best way to validate that an enum in this case is in fact a valid ImportType. | I need to validate an integer to know if is a valid enum value. What is the best way to do this in C#? |
This morning, I removed all the unity-webapps-something and didn't pay attention that removing unity-webapps-service or unity-webappas-common required to remove other key packages: The following packages will be REMOVED: bamfdaemon hud indicator-appmenu indicator-sound libbamf3-1 libunity-webapps0 lightdm-remote-session-uccsconfigure unity unity-tweak-tool unity-webapps-common unity-webapps-service xul-ext-unity xul-ext-websites-integration 0 upgraded, 0 newly installed, 13 to remove and 1 not upgraded. After this operation, 10.3 MB disk space will be freed. Do you want to continue [Y/n]? y (Reading database ... 458920 files and directories currently installed.) Removing unity-tweak-tool ... Removing lightdm-remote-session-uccsconfigure ... Removing unity ... Removing indicator-sound ... Removing indicator-appmenu ... Removing hud ... Removing libbamf3-1:amd64 ... Removing bamfdaemon ... Removing xul-ext-unity ... Removing xul-ext-websites-integration ... Removing unity-webapps-common ... Removing libunity-webapps0 ... Removing unity-webapps-service ... Now, that I login to my unity session, I have no launcher, no top panel, global menu integration and hud are disabled. I reinstalled all the packages removed above and restarted the computer but in vain. I reconfigured these packages but in vain (sudo dpkg-reconfigure unity) I issued: unity --replace and compiz --replace but in vain. Any Ideas please. this is kind of frustrating. PS: At the greeter stage, everything is fine. It's only when I log in. I can also login to my gnome Fall back session without problems. | When I login, nothing happens. I am presented with my desktop wallpaper. No Dash, no Launcher, nothing. |
I was recently sent an image by a friend containing many different Star Trek characters and vessels from the next generation era. Several of the main characters are pretty obvious, with the TNG crew in the bottom third. Several of vessels are pretty clear too with DS9, Enterprise-D, Stargazer and Enterprise-C (on the right). Can we identify the other characters and vessels? | Can you identify every character and spacecraft in ? Please mention the episode(s) if you can. The poster is for the 30th anniversary of . (First aired on September 28, 1987.) I got many of them (along with episodes), but there are plenty I don't recognize. A few occur more than once. (e.g. - Jean Luc Picard and Tasha Yar) |
This concerns the graph view on the reputation tab of your profile. (i.e. ) In Chrome, the area selector doesn't show its bars. Something similar appear to have been reported , but this is a completely different one. This isn't solved by returning to default zoom - in fact, the bars are somewhat visible in any zoom level except for the default one. Firefox 26: Chrome 32: (Note the absence of the little spikes along the bottom row, or that specifically, they're white.) | As you can see, if you go to the reputation graph on your profile on Stack Overflow, the bars in the bottom overview will be white. This makes them invisible unless they are selected. Eeek! This does not happen on meta or any other site. Also, I cannot seem to reproduce it on others' profile. Possibly a bug only on your own profile? EDIT: I think I've existed for too long. If I change the CSS on one of the bars to stroke: none, then it becomes green. I think the outline is covering the fill because the bars are too skinny. EDIT2: Confirmed hypothesis by reproducing on Jon Skeet's graph. Proposed solution: enforce minimum bar width and add horizontal scrollbar. EDIT3: Can only repro on Chrome 29.0.1547.57 (Official Build 217859) m (the latest version). Norepro on older versions of Chrome, IE9 (winces), all versions of FF, and all versions of Safari. EDIT4: Can be fixed simply by running the JavaScript $('rect').css('stroke-width', '0') or a userstyle rect { stroke: none }. I may make a user[style|script] to fix this. |
In the example above, there are two loops. Why is running the second loop valid? We already trained the network 1000 from the first loop, does running the second loop mean we trained it 2000 times? | I found this confusing when I use the neural network toolbox in Matlab. It divided the raw data set into three parts: training set validation set test set I notice in many training or learning algorithm, the data is often divided into 2 parts, the training set and the test set. My questions are: what is the difference between validation set and test set? Is the validation set really specific to neural network? Or it is optional. To go further, is there a difference between validation and testing in context of machine learning? |
I'm trying to compile a gnuplot epslatex output (which contains a .tex and .eps file). When I use \documentclass{article} \usepackage{graphicx} \usepackage{epstopdf} \begin{document} \input{temp.tex} \end{document} I get the error ) (C:\Users\Stefan\Documents\temp.tex ! LaTeX Error: Can be used only in preamble. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.2 \documentclass {minimal} ? The temp.tex file output by gnuplot has documentclass{minimal}, so my document can't run minimal classes for some reason, why is that? | Suppose I have two latex files file1 and file2 with the same preamble and so on. Then I want to create a file called bigfile which just puts the two files together. This is not working for some reason. Therefore I first tried to include just file1, this is what I have done: \documentclass .... %% same as file1 ... same preamble as file1 \begin{document} \input{file1} \end{document} The result is that I not only get file1, but also the preamble and so on. This is my first experience with putting files together in 1 file. Kindly provide me a solution :) |
In the Windows 7 setup where you choose the drive to install on you can delete partitions. I accidentally deleted a partition on the wrong drive and I wondered if it's possible to revert? I am still in the setup now and haven't restarted my computer but in the command prompt in advanced options I can no longer see the drive. Is there anything I can do to cancel the delete and not lose the files? Edit: This question is not a duplicate - it it specifically asking about the process during setup, i.e. is there any way back from a delete and not just another how do I recover a partition drive. Or maybe it's deemed too similar, then fair enough :) | So before I get to the problem, a little background. My computer is a dell laptop running (well, ran...) Windows 7. I had a problem with the partitioning of drive d. After many unsuccessful attempts I download a software to fix the problem. For some reason, the software started deleting the C drive, which obviously caused a blue screen. From then on, the computer won't boot. I tried booting through the windows disc, and clicked repair. When it asked me which windows I want to repair it had a list with one item, the windows 7, with a size of 0 MB. I continued to the "System Repair Options"screen and clicked "Startup Repair". The process stuck on an infinite loop, which I can't cancel unless I shut the computer down. I then tried running the command prompt. I typed "C:\", and when I typed the dir command it gave me this message: "Directory of C:\ File not found" Needless to say, I really need to recover this drive(it used to be my dad's laptop, a lot of family pictures are in there...), though I'm starting to believe it can't be done. ANY help or a mild breakthrough would be greatly appreciated. Thank you. |
Consider the sequence defined by $a_1 = \sqrt{2}$, $a_2 = \sqrt{2 + \sqrt{2}}$, so that in general, $a_n = \sqrt{2 + a_{n - 1}}$ for $n > 1$. I know 2 is an upper bound of this sequence (I proved this by induction). Is there a way to show that this sequence converges to 2? What I think is that the key step is to prove 2 is the least upper bound of this sequence. But how? | (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: . |
Soon I will fly back home from Argentina. Here in some places (as in other Andean countries) coca leaf from Erythroxylum Coca are legal and of common use for plenty of reasons, mainly historical. You can find it everywhere and usually sold in packets of about 20g of leafs. My question is: can I fly back to Europe (Buenos Aires->Madrid->Milan) with two packets of those leaves? | When travelling in Chile, tea from coca leaves was something you could buy at regular places. It is even sold as a preventive to altitude sickness in places like San Pedro de Atacama. After feeling the horrible effects of altitude sickness, I did try Mate di Coca before going on my next to the higher altiplanos. Whether it as a placebo or not, it seemed to work. I was considering buying a package of coca tea to bring back as souvenir, but I hesitate since I didn't know if it would be considered legal. Google provided mixed answers. From a big no, to a maybe in some countries, to yes because you can't make cocaine out of tea from coca leaves. What is factual? Can you bring Mate de Coca as a souvenir? |
I can surely do it for you.. Is the use of surely correct or shall I replace it with certainly without change in meaning. | Dictionaries provide the following- surely/ˈʃʊəli,ˈʃɔːli/ adverb, used to emphasize the speaker's firm belief that what they are saying is true and often their surprise that there is any doubt of this. certainly/ˈsəːt(ə)nli,-tɪn-/ adverb, used to emphasize the speaker's belief that what is said is true. Are there any usage nuances? |
I have 2 tables, custlogin and custinfo: custlogin: custid int primary key auto notnull custusename varchar(25) custpassword varchar(50) custinfo: custid foriegnkey custlogin.custid ondelete set NULL custfirstname varchar(25) custlastname varchar(25) custaddress varchar(100) I want to write a stored procedure which will insert into both tables More precisely, insert into custlogin with custusername custpassword, which would return custid for use as foreign key for custinfo. I have searched much but I didn't find any solution. | What is the best way to get IDENTITY of inserted row? I know about @@IDENTITY and IDENT_CURRENT and SCOPE_IDENTITY but don't understand the pros and cons attached to each. Can someone please explain the differences and when I should be using each? |
Sorry for the noob question, I'm writing a paper on quaternions for a linear algebra class and I decided it would be a good time to start learning LaTex. | 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? |
Well, I have a number $\text{p}$ that is given by: $$\text{p}=9+108x^2(1+x)\tag1$$ I want to find $x\in\mathbb{Z}$ such that $\text{p}$ is a perfect square. I found no solutions. Is there a way to prove that there aren't any solutions? Except for the obvious ones: $x=0$ and $x=\pm1$. My work Since $\text{p}$ must be a perfect square we can write: $$\text{p}^2=9+108x^2(1+x)\tag2$$ Now, because $\text{p}^2\ge0$ we need: $$9+108x^2(1+x)\ge0\space\Longleftrightarrow\space x\ge-\frac{1}{3}\left(1+2^\frac{2}{3}+2^{-\frac{2}{3}}\right)\approx-1.07245\tag3$$ | Well, I have a number $n$ that is given by: $$n=1+12x^2\left(1+x\right)\tag1$$ I want to find $x\in\mathbb{Z}$ such that $n$ is a perfect square. I found the following solutions: $$\left(x,n\right)=\left\{\left(-1,1^2\right),\left(0,1^2\right),\left(1,5^2\right),\left(4,31^2\right),\left(6,55^2\right)\right\}\tag2$$ Is there a way to prove that this a complete set of solutions? So I mean that the solutions given in formula $(2)$ are the only ones? My work: We know that: $$ 1 + 12x^2 \left(1+x \right) \ge 0 \space \Longleftrightarrow \space x \ge -\frac{1+2^{-2/3}+2^{2/3}}{3} \approx -1.07245 \tag3 $$ So we know that for $x<-1$ there are definitely no solutions. |
If I'm not mistaken, a Young's modulus $E$ can theoretically take on any positive value without bound. Physically, I interpret this as though a solid can have any arbitrary "stiffness" (within the limits of its linear stress-strain region, of course). On the other hand, the range of possible Poisson's ratios is constrained to $[-1,0.5]$ for stable, isotropic, linearly elastic materials. I'm not quite sure how to interpret this physically. Why must the Poisson's ratio necessarily be constrained? | For an isotropic solid, Poisson's ratio can be expressed in terms of stiffness constants as: $$\sigma = \frac{c_{11} - 2c_{44}}{2c_{11} - 2c_{44}}$$ Alternatively we may express Poisson's ratio in terms of the Lamé constants $\lambda$, $\mu$ where $\lambda = c_{12}$ and $\mu = c_{44}$. For an isotropic solid, we have $c_{12} = c_{11} - 2c_{44}$. When we solve this algebraically we get: $$\sigma = \frac{\lambda}{2(\lambda + \mu)}$$ I am supposed to show that $\sigma$ must lie between $-1$ and $+\frac{1}{2}$. I figure that by setting $\mu=0$, it follows from the last expression of $\sigma$ that we get the value $\frac{1}{2}$. However, I can't see how to show that the lower bound must be $-1$. I've tried fidgeting around with the expressions and letting them go towards $0$ or $\infty$, but I still don't get the $-1$ value. If anyone can help me out here, I would greatly appreciate it! |
I can't install lighttpd on my Ubuntu 18.04. I did an update & upgrade and then: fmf@kodi:~$ sudo apt install lighttpd Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: lighttpd : Depends: libssl1.1 (>= 1.1.0) but it is not going to be installed E: Unable to correct problems, you have held broken packages. fmf@kodi:~$ My sources.list: fmf@kodi:~$ cat /etc/apt/sources.list # Ubuntu 18.04 Bionic Beaver deb http://it.archive.ubuntu.com/ubuntu/ bionic main universe restricted multiverse #deb-src http://it.archive.ubuntu.com/ubuntu/ bionic main universe restricted multiverse deb http://security.ubuntu.com/ubuntu bionic-security main universe restricted multiverse #deb-src http://security.ubuntu.com/ubuntu bionic-security main universe restricted multiverse deb http://it.archive.ubuntu.com/ubuntu/ bionic-updates main universe restricted multiverse #deb-src http://it.archive.ubuntu.com/ubuntu/ bionic-updates main universe restricted multiverse # Backports: deb http://it.archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse #deb-src http://it.archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse # Canonical partner: deb http://archive.canonical.com/ubuntu bionic partner #deb-src http://archive.canonical.com/ubuntu bionic partner fmf@kodi:~$ My system: fmf@kodi:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.1 LTS Release: 18.04 Codename: bionic fmf@kodi:~$ uname -a Linux kodi 4.15.0-44-generic #47-Ubuntu SMP Mon Jan 14 11:26:59 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux fmf@kodi:~$ How can I fix this? | After upgrading from 10.04 to 12.04 I am trying to install different packages. For instance ia32-libs and skype (4.0). When trying to install these, I am getting the 'Unable to correct problems, you have held broken packages' error message. Output of commands: sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. After running this: sudo dpkg --configure -a foo@foo:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. |
I have seen the answers to this saying that the effect Earth's rotation is neglegible compared to Gravity. But isnt the answer to this should include that the relative acceleration between object under consideration and the observer on the ground is zero. As both have the same effect of Earths rotation. | Clearly, the Earth is accelerating (as it has centripetal acceleration), and thus it is a non-inertial frame of reference. Then, why don't we use pseudo forces all the time? My teachers told me that the effect produced by the centripetal acceleration of the Earth on our calculations is negligible and hence we can safely neglect pseudo force. But how? I want rigorous proof with examples that show exactly how much we are compensating in exchange for neglecting that the Earth is a non-inertial frame of reference. |
This is a long shot since my tablet is not listed in the supported devices, but is there any chance that it might work anyway? Android 4.2 Tablet E10320 | With the announcement of the Ubuntu Phone OS I'd like to know what phone (and tablet) models are supported at this time. Note from foss & Oli: We are making this the master question for all future "Will this work on <insert random tablet/phone/device here>?!" questions |
This is a general question about (La)Tex. Is it possible to configure/setup tex to make it "hold register"? To "hold register" is to ensure that the horizontal lines which all "normal/plain" text is placed on, are the same on all pages. | I'd like to typeset documents using the '' of page layout. Good examples are on pages 40-53 of . The package is helpful for this, but two additional features would be useful: Automatic flow of text across (arbitrarily placed) columns / textpos blocks. Vertical line spacing enforced to be an integer multiple of a base line spacing, even when interrupted (for example) by an equation of arbitrary height. Any ideas as to how either or both of these could be accomplished? |
I recently upgraded to 17.10 from 16.10, and I'm experiencing an annoying problem: I CAN'T drag and drop files. When I select files and then hold to drag, it behaves as though I'm re-selecting and doesn't drag the files like it did in 16.10. Also, ctrl- and shift- selecting no longer work the way they used to, shift now selects from the FIRST file selected rather than the LAST file I selected. I don't know if these are OS bugs or if there's an easy solution. PLEASE HELP. I don't want to have to re-install 16.10 | I'm having a strange problem on Ubuntu 17.10: when I try to drag and drop something inside Nautilus it simply doesn't work, it doesn't even select the item, it seems like it's ignoring the action... Also, I cannot select things inside nautilus by drawing rectangles with the mouse. All of these actions work only on the Desktop. Here is a demo: I'm using the Xorg session with nVidia proprietary drivers. I also noticed that Nautilus seems to hang when I try to copy, paste or cut a file... EDIT 1: I solved the problem for the slow copy/paste by disabling the clipboard sync plugin of KDEConnect. I also discovered that if I open Nautilus as root, I can drag and drop or select whatever I want... |
Is there anything wrong with this? I have refreshed many time but the view still be 1. I don't think think this is a dup of . In that question. Jeff Atwood answers: We buffer view count increments, so this should be normal -- unless the post stays at 0 for more than say 5 minutes or so. I submitted the question at 04:33:40Z, and got the first upvote at 04:43:13Z (I don't know what Z means). | I look today on a few fresh question, and the view count was 0. Even after I refreshed the page a few time. This is definitely a bug, since the question isn't mine. Also I don't think the all page was cached, since that the DateTime mark was change every reload. But maybe the SQL result is cached. |
What is the difference between MapBox and CartoDB ? | I want to start working on a web map at work to map some of our statistics by city. I have an idea, but I'm not exactly sure where to start. Are there any definitive resources that provide step by step guidance on how to do this? |
I've been told to calculate the age of the Universe at $T = 1 \, \text{MeV}$, assuming that $a(t=0)=0$. Now, I've already calculated the value of $H$ at that temperature, which was around $H(1\,\text{MeV}) \approx 0.6 \,\text{s}^{-1}$. I've also shown, that in a radiation dominated Universe, which I assume much be the case at $T = 1 \, \text{MeV}$, that: $$H = \frac{1}{2}t^{-1}$$ So basically, my idea was just to solve for $t$ in that equation, and use the value for $H$ I calculated, and then I end up with $t = 0.85 \, \text{s}$, which seems okay reasonable to me, but, my main question is the info: "assuming that $a(t=0)=0$". I haven't really used that information here, so either it's just not important, or I have missed something. But what ? | How does the change with the age of the universe? This question was posted recently, and I had almost finished writing an answer when the question was deleted. Since it's a shame to waste the effort here's the answer anyway. Maybe this can be one of the canonical answers . |
Is it possible to run Internet Explorer 11 32 bit on Windows 8.1 64 bit? Since only 32 bit ActiveX is available for Check Point Software VPN. Currently when I go into site it wants me to download the Java version. Even when \Program Files (x86)\Internet Explorer\iexplorer.exe is clicked the 64 bit version of IE is launched. (The three answers given to a previous similar question () do not apply. The first answer mentions a registery entry which is absent on my pc Windows 7 64 bit and IE 10 32 bit does not work on my case. Since the registery does not contain the mentioned "TabProcGrowth") | I need to run IE 10 in 32-bit mode on 64-bit Windows 7 Enterprise N. When I run IE 10 from "C:\Program Files (x86)\Internet Explorer" I can see in task manager that I have only one process "iexplorer.exe" and no process "iexplorer.exe *32". I have an application with an ActiveX that is supported only on 32-bit, and the application can't be loaded on 64-bit mode. Is there a way I can force IE10 to run in 32-bit mode? |
Like in standard controller we can fetch objects records like: standardcontroller="account"; {!account.name}; how we can fetch from a custom controller? | If I have a custom controller and a custom visualforce page, and I'm passing an ID as a query param, how can I get the associated record for that ID from within the VF page? public class MyCustomController() { ... legacy code here } <apex:page controller="MyCustomController"> <apex:outputText value="{! SOME VF SYNTAX TO RETRIEVE RECORD GIVEN QUERY PARAM ID}" /> </apex:page> |
Suppose $\lambda_1, \lambda_2, \dots, \lambda_k $ are complex numbers that $\forall n \in \mathbb{N}$ satisfy $$\lambda_1^n+ \lambda_2^n+ \dots +\lambda_k^n =0.$$ Can we deduce that $\lambda_1= \lambda_2= \dots= \lambda_k = 0 $? | Here is a statement that seems prima facie obvious, but when I try to prove it, I am lost. Let $x_1 , x_2, \dots, x_k$ be complex numbers satisfying: $$x_1 + x_2+ \dots + x_k = 0$$ $$x_1^2 + x_2^2+ \dots + x_k^2 = 0$$ $$x_1^3 + x_2^3+ \dots + x_k^3 = 0$$ $$\dots$$ Then $x_1 = x_2 = \dots = x_k = 0$. The statement seems obvious because we have more than $k$ constraints (constraints that are in some sense, "independent") on $k$ variables, so they should determine the variables uniquely. But my attempts so far of formalizing this intuition have failed. So, how do you prove this statement? Is there a generalization of my intuition? |
I am trying to understand how to check equality of class instances. Let's say I have a class as follows: class Car(object): def __init__(self): self._color = None I instanciate two objects as follows : car1 = Car() car1._color = 'red' car2 = Car() car2._color = 'red' The two objects having exactly the same attributes, I naively thaught that: print(car1 == car2) would print True , which is not the case. What is happening here? I did find a solution to check equality: print(car1.__dict__ == car2.__dict__) which does print True. Was that in fact the simplest thing to do? | When writing custom classes it is often important to allow equivalence by means of the == and != operators. In Python, this is made possible by implementing the __eq__ and __ne__ special methods, respectively. The easiest way I've found to do this is the following method: class Foo: def __init__(self, item): self.item = item def __eq__(self, other): if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ else: return False def __ne__(self, other): return not self.__eq__(other) Do you know of more elegant means of doing this? Do you know of any particular disadvantages to using the above method of comparing __dict__s? Note: A bit of clarification--when __eq__ and __ne__ are undefined, you'll find this behavior: >>> a = Foo(1) >>> b = Foo(1) >>> a is b False >>> a == b False That is, a == b evaluates to False because it really runs a is b, a test of identity (i.e., "Is a the same object as b?"). When __eq__ and __ne__ are defined, you'll find this behavior (which is the one we're after): >>> a = Foo(1) >>> b = Foo(1) >>> a is b False >>> a == b True |
I want to build a regular expression which only matches [A-Za-z0-9\-] with an additional rule that hyphens (-) are not allowed to appear at the start and at the end. For example: my-site is matched. m is matched. mysite- is not matched. -mysite is not matched. Currently, I've come up with ^[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]+$. But this doesn't match m. How can I change my regular expression so that it fits my needs? | I had a requirement where in the text field the first character should be a alpha numeric and then i can allow a hyphen from thereafter in JavaScript.Also hyphen should not be allowed at the end |
I have Dell Inspiron 5567 laptop (i-7, 8GB) with Windows-10 OS installed on it. I am trying to install ubuntu 16.04 as a dual boot OS on Windows10. I have disabled fast boot and secure boot options also. I am facing this error while installing Ubuntu 16.04: grub-efi-amd64-signed failed to install into /target/. Without GRUB boot loader, the installed system will not boot The target partition is /dev/sda1. I have created three partitions: 20GB-ext4- Root mounted 18.9GB-ext4- /home 4GB Swap area Launchpad link for the log files: Pastebin link for boot-repair: Output of sudo fdisk -l: Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: F87D48DF-F3FF-429E-8F0B-558F81712A60 Device Start End Sectors Size Type /dev/sda1 2048 1026047 1024000 500M EFI System /dev/sda2 1026048 1288191 262144 128M Microsoft reserved /dev/sda3 1288192 1843265535 1841977344 878.3G Microsoft basic data /dev/sda4 1927151616 1928073215 921600 450M Windows recovery environment /dev/sda5 1928073216 1951281151 23207936 11.1G Windows recovery environment /dev/sda6 1951281152 1953523711 2242560 1.1G Windows recovery environment /dev/sda7 1843265536 1851078655 7813120 3.7G Linux swap /dev/sda8 1851078656 1890140159 39061504 18.6G Linux filesystem /dev/sda9 1890140160 1927151615 37011456 17.7G Linux filesystem Partition table entries are not in disk order. Output of sudo parted -l: Model: ATA TOSHIBA MQ01ABD1 (scsi) Disk /dev/sda: 1000GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 525MB 524MB fat32 EFI system partition boot, esp 2 525MB 660MB 134MB Microsoft reserved partition msftres 3 660MB 944GB 943GB ntfs Basic data partition msftdata 7 944GB 948GB 4000MB linux-swap(v1) 8 948GB 968GB 20.0GB ext4 9 968GB 987GB 18.9GB ext4 4 987GB 987GB 472MB ntfs hidden, diag 5 987GB 999GB 11.9GB ntfs hidden, diag 6 999GB 1000GB 1148MB ntfs hidden, diag Model: SRT USB (scsi) Disk /dev/sdb: 32.5GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 32.5GB 32.5GB primary fat32 boot, lba Please guide me how to resolve this problem. | I am installing Ubuntu 16.04 in an Intel NUC computer with UEFI enabled. I am using an SSD from another computer. During the installation I chose Erase the disk and make a new full install At the end of the process I see: grub-efi-amd64-signed failed installation /target/ Ubuntu 16.04 And the system does not boot. I tried to use boot-repair but apparently it does not solve the problem. |
I'm trying to download all features from this WFS: , It's working fine with the most simple requests like: But now, I need >all< features in the dataset, but the service won't allow me to do so since the maxFeatures is set to 100 (serverside). Now, I'd want to create some sort of quadtree to iterate through the data. But therefore I need a boundingbox filter. I found some examples like; and one using a cql_filter: None of them is working. Is there someone who can guide me in the right direction? I'd like to know how to use the boundingbox filters, but still, ultimately I'm looking in downloading >all< features within a certain boundingbox. Edit: I also tested the WFS server in QGIS. Without enabling the viewport as a boundingbox, it works fine. As soon as I say I want only the data within the viewport, it gives an error on the bbox... Is this maybe a server-side problem? Or is it just the QGIS method doesnt work on this specific Service? | I am running a GetFeature request against a WFS server which does not support to download all data at once. Can I use ogc:PropertyIsGreaterThanOrEqualTo to split the dataset into chunks at download them step by step? I wonder how I can construct the actual URL to include the paging filter. Here is what I tried: http://example.com/wfs.aspx?request=GetFeature&service=WFS&version=1.1.0 \ &typeName=example:example&maxFeatures=50000 \ &FILTER=<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"> \ <ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>OBJECTID</ogc:PropertyName> \ <ogc:Literal>50000</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:Filter> This is not a valid URI though... That's why uri-encoded the filter part: http://example.com/wfs.aspx?request=GetFeature&service=WFS&version=1.1.0 \ &typeName=example:example&maxFeatures=50000 \ &FILTER=%3Cogc%3AFilter%20xmlns%3Aogc%3D%22http%3A%2F%2Fwww.opengis.net \ %2Fogc%22%3E%3Cogc%3APropertyIsGreaterThanOrEqualTo%3E%3Cogc%3APropertyName%3EOBJECTID \ %3C%2Fogc%3APropertyName%3E%3Cogc%3ALiteral%3E50000%3C%2Fogc%3ALiteral \ %3E%3C%2Fogc%3APropertyIsGreaterThanOrEqualTo%3E%3C%2Fogc%3AFilter%3E This actually works. Is there a "nicer" way to do this? |
Is it possible that the DNA of an individual changes significantly over a period ? | As far as I know, DNA is the construction protocol of all organisms on Earth. Does it change when influenced by time and environment (physical laws)? As parents with schizophrenia are more likely to have children with schizophrenia and an individual with no genetic predisposition for schizophrenia can suffer from such a condition because of drug abuse or environmental influence, does this prove that human DNA is changing during our lifespan? |
I've always said "texted" when referring to the past tense of receiving an SMS (text message). However I've noticed a pattern recently that a lot of my friends are saying "text". I texted you earlier. I text you earlier. Despite having a red squiggly line under it in Chrome (), . Which word is correct? | –verb (used without object) Digital Technology. 15. to send a text message: Texting while driving is an accident asking to happen. Can I use: I text to her but she didn't text me back. I will text on your facebook later. What about the simple past and past participle forms? Is it text, text, text? |
Below exception is thrown from PayUMoney Android SDK. This is captured in Crashlyst. I cant reproduce this in local but it happens in production for few customer. Please let me know your thought? Im using latest PayUMoney sdk Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'com.payumoney.core.PayUmoneySdkInitializer$PaymentParam com.payumoney.core.PayUmoneySDK.getPaymentParam()' on a null object reference Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'com.payumoney.core.PayUmoneySdkInitializer$PaymentParam com.payumoney.core.PayUmoneySDK.getPaymentParam()' on a null object reference at com.payumoney.sdkui.ui.fragments.PayUMoneyFragment.onCreate(SourceFile:244) at androidx.fragment.app.Fragment.performCreate(Fragment.java:2414) at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:844) at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1229) at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1295) at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2605) at androidx.fragment.app.FragmentManagerImpl.dispatchCreate(FragmentManagerImpl.java:2559) at androidx.fragment.app.FragmentController.dispatchCreate(FragmentController.java:234) at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:304) at androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:85) at com.payumoney.sdkui.ui.activities.BaseActivity.onCreate(SourceFile:77) at com.payumoney.sdkui.ui.activities.PayUmoneyActivity.onCreate(SourceFile:61) at android.app.Activity.performCreate(Activity.java:6904) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) at android.app.ActivityThread.-wrap17(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7325) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) | 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? |
There are a lot of Generalized Linear Model questions on here, but I couldn't find one that explicitly addressed this point. The page starts out by saying: [T]he generalized linear model (GLM) is a flexible generalization of ordinary linear regression that allows for response variables that have error distribution models other than a normal distribution. However, the subsequent parts of the Wikipedia page drop the talk of non-normal errors and instead talk about non-normal responses, e.g. The general linear model may be viewed as a special case of the generalized linear model with identity link and responses normally distributed. I get that sometimes a non-normal response variable means that the errors must also be non-normal, but understand from that residuals can be normally distributed while the outcome variable is not. So why does Wikipedia bother talking about non-normal response variables? | On whether an error term exists in logistic regression (and its assumed distribution), I have read in various places that: no error term exists the error term has a binomial distribution (in accordance with the distribution of the response variable) the error term has a logistic distribution Can someone please clarify? |
If $A,B$ are diagonalizable complex matrices of size $n$ such that $AB=BA$ , then is there a common eigen-basis of $A$ and $B$ ? | I've come across a paper that mentions the fact that matrices commute if and only if they share a common basis of eigenvectors. Where can I find a proof of this statement? |
Let's say I run lspci command. This command reports names and models of the devices in my system. Output may look like: 03:00.0 Network controller: Intel Corporation Centrino Ultimate-N 6300 (rev 3e) This string "Centrino Ultimate-N 6300" - where it came from? Was it originally stored somewhere inside the network card's ROM? If not, the card must have provided some information which allowed linux kernel to uniquely identify it. What information is that, how can I get it? | In I found "[The latest version of this document ". There I says: "… lspci is a synonym for cat /proc/pci". Which isn't the case here, on a Crunchbang 10 system (Debian based). No such directory. I do get the basic idea and, as far as I know, the content of proc is (mainly) created during runtime. (Wrong?). This made me curious: Question: Where does lspci gather it's information from? And where is this documented? (Where did I miss something?) Another difference I found: In kernel.org's documentation, under "Table 1-5: Kernel info in /proc" pci Deprecated info of PCI bus (new way -> /proc/bus/pci/, decoupled by `lspci) |
Let $0<a<b$, $x_1=a>0$, $y_1=b>0$, $x_{n+1}=\sqrt{x_ny_n}$, and $y_{n+1}={x_n+y_n \over 2}$, $n\geq 2$. Show that $\lim _{n\rightarrow \infty}x_n=\lim_{n\rightarrow\infty} y_n$. I have considered the fact that $(y_n-x_n)^2>0$ implies that ${x_n+y_n \over 2}>\sqrt{x_ny_n}$. I'm not entirely sure how to prove this result. Any solutions/hints are greatly appreciated. | I am given this problem: let $a\ge0$,$b\ge0$, and the sequences $a_n$ and $b_n$ are defined in this way: $a_0:=a$, $b_0:=b$ and $a_{n+1}:= \sqrt{a_nb_n}$ and $b_{n+1}:=\frac{1}{2}(a_n+b_n)$ for all $n\in\Bbb{N}$ To prove is that both sequences converge and that they have the same limit. I don't know how to show this. I have spent 2 hours on this, no sign of success |
I'm new to sql, I've one table with 2 columns Table1 Form_Name | Form_Version abc1 | 0.1 abc1 | 2.1 abc1 | 1.1 pqr | 0.1 pqr | 2.1 pqr | 3.1 pqr | 4.1 pqr | 0.2 xyz | 0.1 xyz | 2.1 But i want output as below Form_Name | Form_Version abc1 | 2.1 pqr | 4.1 xyz | 2.1 I'm interested to get corresponding max value of each unique form_name Answer will be appriciated | My table is: id home datetime player resource 1 10 04/03/2009 john 399 2 11 04/03/2009 juliet 244 5 12 04/03/2009 borat 555 3 10 03/03/2009 john 300 4 11 03/03/2009 juliet 200 6 12 03/03/2009 borat 500 7 13 24/12/2008 borat 600 8 13 01/01/2009 borat 700 I need to select each distinct home holding the maximum value of datetime. Result would be: id home datetime player resource 1 10 04/03/2009 john 399 2 11 04/03/2009 juliet 244 5 12 04/03/2009 borat 555 8 13 01/01/2009 borat 700 I have tried: -- 1 ..by the MySQL manual: SELECT DISTINCT home, id, datetime AS dt, player, resource FROM topten t1 WHERE datetime = (SELECT MAX(t2.datetime) FROM topten t2 GROUP BY home) GROUP BY datetime ORDER BY datetime DESC Doesn't work. Result-set has 130 rows although database holds 187. Result includes some duplicates of home. -- 2 ..join SELECT s1.id, s1.home, s1.datetime, s1.player, s1.resource FROM topten s1 JOIN (SELECT id, MAX(datetime) AS dt FROM topten GROUP BY id) AS s2 ON s1.id = s2.id ORDER BY datetime Nope. Gives all the records. -- 3 ..something exotic: With various results. |
I heard that it's possible to do this with natbib but I am using biblatex with biber backend but I already have my bib file ready. Is there any way to do this with biblatex? Pic related red underline is how I want it to work. | I have a reference which has a bib entry and appears in the bibliography. I want to be able to include the entire entry, exactly as it appears in the bibliography, somewhere else in the document. Is there any way to do that other than to manually write it and format it to look similar? |
Given the string This is just an example string to show what I mean. How do I check that none of the words in this string start with amp, or that one (or more) of the words start with s? This is what the iOS contacts app does when searching in the list: It checks if the firstname or lastname start with the given search string. The post that's supposed to be a duplicate, does not answer my question; it's just a general item about the use of regular expressions. | Initial Googling indicates that there's no built-in way to do regular expressions in an Objective-C Cocoa application. So four questions: Is that really true? Are you kidding me? Ok, then is there a nice open-source library you recommend? What are ways to get close enough without importing a library, perhaps with the NSScanner class? |
Simple question: Is there a rule of thumb for number of bins in a histogram with a uniform distribution? Details: I have a stochastic computer simulation that produces, as a test, $n$ values that should be uniformly distributed in a given interval, $[a, b]$. Due to the inherent random nature of the simulation, there is some noise. I want to show (visually) that under certain circumstances there is additionally a deviation from this uniform distribution. The deviation happens at the lower boundary, up to $5$ to $15$% of the interval and manifests as less values (up to about $40$%) per bin as a uniform distribution would have. At the moment $n=5\times10^6$, but I can increase that if necessary. To simplify the comparison between different cases that don't have the same $a$ and $b$ I scale to $[0, 1]$. This is standard practice in my field. My idea is to use a histogram, but I've been trying to find a justifiable method to define the bin size (or number of bins) and failed so far. Most rules-of-thumb I found assume a normal distribution. Is there any that uses uniform distribution? It's bad to search for, because I only find discussion about uniform bin size, not uniform distribution. The best rules I can find from are: Freedman-Diaconis $\approx 160$ Doane-Rule $\approx 20$ The difference lies most likely in the skewness, which is very close to zero in my cases, or I simply used the formula wrong. It's not that simple. What I did (in Python): k = 1 + numpy.log2(n) + numpy.log2(1 + abs(scipy.stats.skew(z, bias=False)) / np.sqrt(6 * (n - 2) / ((n + 1) * (n + 3)))) Purely subjectively I'd say that $20$ is far too few and $160$ is ok, but Freedman-Diaconis is built on the assumption of normal distributed values... This is an example with 160 bins. I want to show the difference between the black, blue and red line at the bottom for panels (3)-(5), which are not there for (1) and (2). I'm aware that connecting histogram values with a straight line is terrible from a mathematical standpoint, but there are extenuating circumstances that make this a little bit better (basically the values represent a concentration field, which is continuous). Edit1: I forgot to mention: plotting the independent variable on the second axis is standard practice in my field, because it's the height. So the histogram is turned by $90°$ compared to the usual way. Edit2: An example P-P-plot (the rightmost panel in the figure above), as suggested by whuber: For me it is a lot harder to interpret, but that might be my problem, not true in general. Edit3: is different, because it (i) looks for an automated solution (which I don't) and (ii) it does not have an underlying (almost) uniform distribution. | I'm interested in finding as optimal of a method as I can for determining how many bins I should use in a histogram. My data should range from 30 to 350 objects at most, and in particular I'm trying to apply thresholding (like Otsu's method) where "good" objects, which I should have fewer of and should be more spread out, are separated from "bad" objects, which should be more dense in value. A concrete value would have a score of 1-10 for each object. I'd had 5-10 objects with scores 6-10, and 20-25 objects with scores 1-4. I'd like to find a histogram binning pattern that generally allows something like Otsu's method to threshold off the low scoring objects. However, in the implementation of Otsu's I've seen, the bin size was 256, and often I have many fewer data points that 256, which to me suggests that 256 is not a good bin number. With so few data, what approaches should I take to calculating the number of bins to use? |
I've been trying to create a button that adds a new Value to my Arraylist (contries) when clicked, but it instead of adding my item(Card) the app simply crashes. I am also using Fragments. Here's my code. That one is my Class for my FragmentPage package com.example.barryblack; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; public class FragmentPage extends Fragment { private RecyclerView.Adapter mAdapter; private ArrayList countries; Button btn; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { CreateExampleList(); View view = inflater.inflate(R.layout.page_fragment, container, false); RecyclerView recyclerView = view.findViewById(R.id.listRecyclerView); btn = view.findViewById(R.id.button_insert); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { InsertItem(); } }); recyclerView.setHasFixedSize(true); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity()); recyclerView.setLayoutManager(layoutManager); RecyclerView.Adapter adapter = new MyAdapter(countries); recyclerView.setAdapter(adapter); return view; } public void InsertItem() { countries.add("Smile"); mAdapter.notifyDataSetChanged(); } private void CreateExampleList() { countries = new ArrayList<String>(); countries.add("Eat"); countries.add("Kill"); } } This is my CustomAdapter public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> { private ArrayList<String> cards; public MyAdapter(ArrayList<String> countries) { this.cards = countries; } @Override public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.example_item, viewGroup, false); return new ViewHolder(view); } @Override public void onBindViewHolder(MyAdapter.ViewHolder viewHolder, int i) { viewHolder.tv_country.setText(cards.get(i)); } @Override public int getItemCount() { return cards.size(); } public class ViewHolder extends RecyclerView.ViewHolder{ private TextView tv_country; private Button tv_button; public ViewHolder(View view) { super(view); tv_country = (TextView)view.findViewById(R.id.tv_country); } } }public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> { private ArrayList<String> cards; public MyAdapter(ArrayList<String> countries) { this.cards = countries; } @Override public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.example_item, viewGroup, false); return new ViewHolder(view); } @Override public void onBindViewHolder(MyAdapter.ViewHolder viewHolder, int i) { viewHolder.tv_country.setText(cards.get(i)); } @Override public int getItemCount() { return cards.size(); } public class ViewHolder extends RecyclerView.ViewHolder{ private TextView tv_country; private Button tv_button; public ViewHolder(View view) { super(view); tv_country = (TextView)view.findViewById(R.id.tv_country); } } } And my LogcatText java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.recyclerview.widget.RecyclerView$Adapter.notifyDataSetChanged()' on a null object reference at com.example.barryblack.FragmentPage.InsertItem(FragmentPage.java:60) at com.example.barryblack.FragmentPage$1.onClick(FragmentPage.java:43) | 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? |
If a circuit calls for a capacitor with a specific capacitance, what happens if a capacitor with a different capacitance is substituted? I have a circuit that calls for a 250uF capacitor to power a small speaker. What would happen if I substituted it for a capacitor with less/more capacitance? Why can't I substitute it for a 220uF capacitor? Why can't I substitute it for a 300uF capacitor? | The basic amplification schematics shown in the datasheet shows a 250 uF capacitor in series with the output. I don't have any 250 uF, but I do have plenty of 470uF. If I understand correctly, is this capacitor used as a high pass filter, so should I be able to use a 470 uF instead of a 250 uF? Also, is the resistor (10 ohm) and capacitor (0.05 uF) going to ground a low pass filter? |
Anxious means 'very eager' or feeling nervous . Can you please explain the difference via an example. I'm interested to hear other people's opinions on this. | Are these words interchangeable? When would you use one over the other? For example, is it correct to say you "feel nervous" or "feel anxious"? Is it correct to say you are an "anxious person" or a "nervous person"? The Oxford Dictionaries website defines as "feeling ... nervousness ... about something with an uncertain outcome" or "... characterised by nervousness". is defined as "the quality or state of being nervous". is defined as "anxious or apprehensive". It seems circular to me. In fact, one of the example sentences of "nervous" is: The days are gone when I am going to get nervous about games or worry about whether or not I play well. Yet, according to the definition of "anxious", it sounds to me that "anxious" would be a better fit, since it relates to "something with an uncertain outcome". |
I have just installed Ubuntu for the first time. I followed the steps for partitioning and root directories as recommended. However, when I partitioned the /dev/sda1 was green and the disk did not recognize Windows 7. After installation, the Ubuntu was orange. When I reboot I am not given a choice of operating system: instead it goes straight to Ubuntu. How do I change this so I can access Windows 7 again? | I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu. How can I get Ubuntu back? |
How can I check, from a client machine (in Global Group)(also is local admin), whether the domain controller is authenticating my login request to the domain using NTLM or Kerberos? I know that Kerberos is enabled by default, but the domain Admin can always force clients to auth with other Protocols. So i just want to be sure which protocal they are using. Are there any methods to do to check? Any help would be appreciated | Is there a command line program you can use? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.