body1
stringlengths
20
4.1k
body2
stringlengths
23
4.09k
Why can I not see the complete date of posting? The year part is not shown. I prefer date/time to look like the ISO standard: 2013-07-04 21:15:33.1234 Is it a setup function that I have missed?
Throughout the site abbreviated dates are used (Apr 21 at 9:12). This works great for dates within the current year but it seems that as the years roll by it'll become important to include the year in the date. I am not sure that having the time is of value for a post that is a year old. Maybe at a certain threshold replacing the time with the year is appropriate.
Is on needed a second time in this sentence? There is a bad effect either on human health or environment. There is a bad effect either on human health or on environment.
A colleague of mine has written her thesis and requested me to read and correct its grammar. I have seen some sentences like The maximum deviation of the concentration values were obtained in the growing season, especially in May, in July, in August and in September. As you see there is one 'in' for each month. I think that one preposition would be enough for all: The maximum deviation of the concentration values were obtained in the growing season, especially in May, July, August and September. Which one is more suitable?
English is my second language and I largely depend on Grammarly for checking grammatical mistakes. To create a new app, first, make sure your current working directory is same as where manage.py file is located. After that execute the following command. I don't see any problem with this sentence, but Grammarly alerts me about "Passive Voice Misuse". Please tell me is there any problem with this sentence.
Whenever I create a document in Microsoft Word, it complains about a lot of my sentences being in passive voice. But, when I read that sentence aloud, it sounds fine to me. I am not sure if it is just me and will a statement in passive voice sound strange to a native speaker? So, my question is, is it considered bad form to use passive voice generally? Or in some specific cases like written communications only? Edit: If it is ok to use passive voice, then why does MS-Word complain?
Quite often, I have lists with short items, e.g.: \documentclass[a4paper,9pt]{scrartcl} \usepackage{braket} % for \Set{} \begin{document} adsfasdf \begin{itemize} \item $\Set{A}$ \item $\Set{A, B}$ \item $\Set{A, B, C}$ \item $\Set{A, B, C, D}$ \item $\Set{B}$ \item $\Set{C}$ \end{itemize} test text tex \end{document} which looks like this: I know that I can get this with tables and three lists. But can I also achieve the same result simpler?
Let us consider The following example \documentclass{article} \usepackage{enumerate} \begin{document} \begin{enumerate} \item Which of the following numbers is the largest ?\\ $2^{3^4},2^{4^3},3^{2^4},3^{4^2},4^{2^3},4^{3^2}.$ \begin{enumerate}[(a)] \item $2^{3^4}$ \item $3^{4^2}$ \item $4^{3^2}$ \item $4^{2^3}$ \end{enumerate} \end{enumerate} \end{document} This produces : But I'd like to produce the following using the same package : OR OR How can I do that?
I cannot set VLC as default. I know about right-click → 'Get Info' but there is no drop-down to change the default so it's not possible to change it. I'm not sure why this is but I know from searching around that I'm not alone.
I have seen people say to click get info then do something with the 'open with' but when I go to get info there is NO open with option, no options to change at all. I cannot drag the files into VLC like I could before the upgrade either. Please help me out! I am not real tech savvy, but I can do basics and follow instructions. Thanks.
I installed based on Drupal 7.x. As soon as I insert any menu item into create categories, I get this warning: Strict warning: Only variables should be passed by reference in sizzle_preprocess_views_view__content__menus__all_menus() (line 69 of /web/htdocs/xxxxxxxxxxx/home/profiles/restaurant/themes/sizzle/includes/menu.inc). I checked the line and I got this code: // Render the category and add it to template. $variables['term'] = drupal_render(taxonomy_term_view($term, $view_mode)); I don't know how to improve this, in order to solve the issue. Writing to the group that made Open Restaurant I didn't got any answer. Hence my post here.
I get the following error: Strict warning: Only variables should be passed by reference in include() (line 18 of /home/sites/dev/theparce/sites/all/themes/parce/block--block--3.tpl.php). This is the block code which is causing that error. if ($user_gallery) { print render(node_show($user_gallery)); // Line 18 print drupal_render ($user_gallery_edit); } else { print drupal_render($user_gallery_new); } Why do I get that error, even if I get all printed as expected?
EDIT: This is not a discussion about how great or broken the floating-point implementation in JS is. This is a very specific case, so please do not mark this as a duplicate of a discussion about floating-point. This is the script I use to calculate the decimal portion of an amount expressed in cents (Ex. 3.34 is 334 cents): const amount = 334; const decimal = Math.trunc(100 * ((amount / 100) % 1).toFixed(2)); console.log(decimal); //34 So far so good. If you change the amount to 329 you get 28, which is wrong: const amount = 329; const decimal = Math.trunc(100 * ((amount / 100) % 1).toFixed(2)); console.log(decimal); //28 This is due to the fact that (329/100) % 1 = 0.29000000000000004 instead of 0.30, because JS floating-point sucks? But what is really crazy to me is that while developing a loop to see the cases in which that script breaks using a FOR, it does not break on 329!: for(let x = 325; x < 335; x++) { const r = Math.trunc((100 * (( x / 100) % 1)).toFixed(2)); console.log(x, r); } What am I missing here? Why is working when inside the loop and not working when calling the function directly? And how can you calculate this in a robust and reliable way?
Consider the following code: 0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 Why do these inaccuracies happen?
I've tried nearly everything to get my image quality to improve upon upload. I have an imagestyle on my image upload field that is set to resize uploaded images to 300x300. I've installed ImageMagick (hearing a myth that doing so improves the image quality drastically), but I see no change. I'm desperate - any idea as to how I can get my images to maintain their quality when uploaded? This seems like it should be a simple thing? See example below. The image on the left is what it looks like when I resize outside of Drupal (e.g. with Photoshop; see how sharp it is?!) - the image on the right is when it's resized via Drupal image field/image style.
This is the original image (610x405) This is the image after applying image style (scale and crop) to 290x190. Both image have the same aspect ration, yet there is visible quality loss on downsizing. Am I applying the right image style? What should I be doing?
I am looking for a way to solve the following equation: $$(I + \alpha M)X=F$$ $\forall \alpha \in R$ (the real domain), with $M$ a square complex matrix without any particular properties, $I$ the identity matrix, $F$ a complex vector and $X$ the unknown. Thank you,
I have two square matrices: $A$ and $B$. $A^{-1}$ is known and I want to calculate $(A+B)^{-1}$. Are there theorems that help with calculating the inverse of the sum of matrices? In general case $B^{-1}$ is not known, but if it is necessary then it can be assumed that $B^{-1}$ is also known.
Consider a database with 3 tables holding names, with three rows: names ID,Name 1 , Eugene 2 , Igor 3 , George rooms ID, Roomnumber, Bednumber 1 , 10 , 1 1 , 15 , 1 1 , 10 , 2 2 , 5 , 1 2 , 3 , 1 Is there any way to get roomnumbers into single string with unique items only (can be separated by space or comma etc? So result will look something like this ID, Name , Roomnumbers 1 , Eugene , 10 15 2 , Igor , 5 3 3 , George , I had no problem doing select from single table into same row, but I am having problem joining this tables together with distinc. Using samples that I found here the best I ever get is ID, Name , Roomnumbers 1 , Eugene , 10 10 15 2 , Igor , 5 3 3 , George , The solution was SELECT distinct t1.ID, t1.Name, SUBSTRING((SELECT ',' + CAST(t2.Roomnumber AS VARCHAR(10)) FROM (SELECT DISTINCT ID, Roomnumber FROM Table2) t2 WHERE t2.ID = t1.ID ORDER BY t2.ID, t2.Roomnumber FOR XML PATH ('') ), 2, 100) [Roomnumbers] FROM Table1 t1 Thank you very much. I was trying to join and that was wrong and too complicated way to go around it. Thank you
Consider a database table holding names, with three rows: Peter Paul Mary Is there an easy way to turn this into a single string of Peter, Paul, Mary?
Do we always use were with the 3rd person in imaginary situations? If only she were here ... If only she was here ... Are we supposed to use were every time there is an if in the beginning of a sentence?
It is to me a curious fact that the of verbs in English has so nearly disappeared in modern times. In fact, even the correct form and usage of the subjunctive in Modern English barely distinguishes itself from the indicative! In many regions and dialects, the subjunctive would appear to be entirely obsolete, replaced by the indicative in all cases. (Educated speakers, certainly in Britain at least, do however still make good use of it.) The present subjunctive form in is (in almost all cases) virtually identical to the third-person plural present indicative (e.g. 'He were', 'She own'). This is markedly different from , where the subjunctive form a form was . Even by the advent of Early Modern English in the 16th century, the subjunctive was already converging with the indicative. Other Modern European languages, not only Romance ones such as French and Spanish, but Germanic languages related to English (e.g. Dutch/German) have a much more pronounced subjunctive form. From what I remember of my Classical Latin, word suffixes for a variety of tenses are hugely obvious in the subjunctive. My question is: why is this convergence of the subjunctive and indicative so strongly the case in Modern English? Is it a general trend in other Germanic/Romance (or more generally Indo-European) languages? Why is its disappearance so much more apparent in English than other related languages?
This is my problem: $ destroy apt-fast [sudo] password for colbyryptos: Reading package lists... Done Building dependency tree Reading state information... Done Package apt-fast is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable Setting up man-db (2.6.1-2) ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error processing man-db (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: man-db E: Sub-process /usr/bin/dpkg returned an error code (1) I have also tried sudo rm /var/lib/dpkg/lock, followed by sudo dpkg --configure -a. It then gives me this $ sudo dpkg --configure -a [sudo] password for colbyryptos: Setting up man-db (2.6.1-2) ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error processing man-db (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: man-db
I'm trying to install the flashybrid but when I enter the apt-get install flashybrid command, I get this error: root@user-desktop:/home/user# apt-get install flashybrid Reading package lists... Done Building dependency tree Reading state information... Done flashybrid is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0B of additional disk space will be used. debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable Setting up flashybrid (0.15+nmu2) ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error processing flashybrid (--configure): subprocess post-installation script returned error exit status 1 Errors were encountered while processing: flashybrid E: Sub-process /usr/bin/dpkg returned an error code (1) I also tried this one to find what is already using that file: root@user-desktop:/home/user# lsof | grep /var/cache/debconf/config.dat lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/user/.gvfs Output information may be incomplete. dpkg-prec 4672 root 4rW REG 8,6 39658 1697827 /var/cache/debconf/config.dat But I don't know how to fix this.
How do I set LibreOffice to spellcheck in British English? When I set it to BE now, it doesn't spellcheck anything. I'm using the latest LibreOffice in Ubuntu 17.04.
I want to be given correction suggestions while setting a text in LibreOffice to English-UK. Now it works for English-US, French and Romanian, as these are the languages that I have installed in Language Support. I cannot seem to have a setting to differentiate US/UK English as I was able in Xubuntu. In LibreOffice English-UK is absent. How to add it? In Tools/Options/Language Settings/Languages I get to the image above, but how to make English UK present there? it lacks that 'ABC-V' sign that is present for English USA, although in Tools/Options/Language Settings/Writing Aids an 'English-uk' IS PRESENT. But that is not enough for the corrector to function for English-UK.
Take , and note the description: Proposed Q&A site for professional and expert amateur chefs interested in the more subjective aspects of cooking; this would be to Cooking SE as Programmers SE is to Stack Overflow It seems like is MASSIVELY popular (has more views per-day than any other proposal by a factor of almost 2). There's also a . Should we allow this trend to continue, possible resulting in things like a subjective web applications proposal? It seems like almost ANY proposal's users could benefit from having a place to ask subjective questions, seeing how much the subjective programmers proposal took off, how many good questions are asked and closed as subjective, and how many successful blogs and discussion sites there are. But it seems like having totally different sites for this is wrong, as they would share no more official connection between them than with a gaming and skateboarding proposal. If they could be linked somehow, at the least like Stack Overflow and Server Fault are linked as part of a trilogy, they could both be more prosperous. Another idea would be having a subjective version of every site (subjective.blah.com, like every site has a meta.blah.com). This would be a great way to link the two, and the separation would still be there as it. Heck we could even do it with the existing trilogy sites, with a 'belongs on subjective' auto-move feature like 'belongs on meta'. It's obvious that people want to ask subjective questions. The issue at hand is how (or if) we choose to enable them to do that with the Stack Exchange model. This is a much more long term issue that will need heavy discussion before any consensus can be reached. EDIT: I see this question proposed something like this for polls. What I am proposing is a separate dominion for all questions that are valid except for being subjective. Hence every site could have a normal section, a subjective section, and a chat section. This may seem complicated, but IMHO it's a great way to divide up a topic. There would be a place to answer questions, discuss topics, and just talk. As far as I can see this covers every area users would be concerned with, leading to a one-stop site that would provide good organization for all areas of a topic. Thoughts? (sorry for the big wall of text ;)
Stuff like polls, recommendations based on subjective constraints, puzzles, webcomics etc. do not belong on the serious main SE sites, where professionals should be considered at work and having just a few spare minutes ("code's compiling") to answer questions, so they should not be distracted by such things. However, I'd also like to have a home for these things still using the SE engine. For the reason I mentioned before, this needs to be a separate place though. Let's call it four.[sitename-here].com.
Article Source: An Efficiency Comparison of Document Preparation Systems Used in Academic Research and Development Knauff M, Nejasmic J (2014) An Efficiency Comparison of Document Preparation Systems Used in Academic Research and Development. PLOS ONE 9(12): e115069. I am surprised to read this research paper. But if it’s the truth, the change is needed in a way the frontends are being designed. The research findings defeats the very purpose of latex : focus on content more than the formatting. This question is likely to be downvoted, blocked saying too wide or out of context. But still I would like to have comments from experts!
A new study in 1 concludes that even novice MS Word users perform better than expert LaTeX users in document creation. I have read the article and I feel like I have identified some flaws in their approach and design but I figured this community would be the best positioned to rigorously evaluate these results. Based on this study can we conclude that Word works better than LaTeX? Markus Knauff & Jelica Nejasmic. 2014. An Efficiency Comparison of Document Preparation Systems Used in Academic Research and Development. PLOS ONE DOI: UPDATE Since the question has been closed, but it's clear that there is interest to discuss the topic, I've set up a . UPDATE 2 I have created a to clarify the reason why this question was closed when other similar questions remain open. UPDATE 3 People in glass houses... The article had to be republished a few months later due to publishing errors whilst using Arbortext :-) see
Is there any series for natural log(x) where x is any number,unlike Taylor series for log(1+x) where |x|<1?
Does anyone know a closed form expression for the Taylor series of the function $f(x) = \log(x)$ where $\log(x)$ denotes the natural logarithm function?
I'm creating some code for a google challenge and I need to write the following function: Say you have a board game x places long, and you have a three sided dye with 'stay', 'right', 'and left'. I need to right a function that when given the amount of dice rolls and number of places and the board will return how many different ways you can get there in the correct amount of dice rolls. (Without going off the edge of the bored of course) Then Moodulas 123454321. (Don't ask me why I mod the answer to 123454321, I don't know). I have whipped up the following code, but it throws a null-pointer exception. I originally did it with plain integer lists. But they were to small and could not pass all tests. Can anyone help? Here is the code: public static void main(String args[]) { System.out.print(answer(100, 10)); } public static int answer(int diceRolls, int numOfSquares) { //Two many squares to be possible. Return 0 for 0 solutions. if ((numOfSquares - diceRolls) > 1) { return 0; } //If there are only two squares there is only One option. Roll a Right. if (numOfSquares == 2) { return diceRolls; } //If there are exactly as may dice rolls as there is squares. //There are as much possibilities as there are squares //Therefore return number of squares. if (diceRolls == numOfSquares) { return numOfSquares; } //Tests how many options there are to roll and get as many dice rolls as needed. //While still getting the amount of squares needed to finish the board game. BigInteger listOne[] = new BigInteger[numOfSquares]; //listOnes[current] holds the number valid paths to position 'current' using 'subCurrent-1' steps BigInteger listTwo[] = new BigInteger[numOfSquares]; //put number of valid paths to position 'current' using 'subCurrent' steps into listTwo[current] BigInteger total = new BigInteger("0"); listOne[0] = BigInteger.valueOf(1); listOne[1] = BigInteger.valueOf(1); int max = 1; for (int index = 1; index < diceRolls; index++) { listTwo = new BigInteger[numOfSquares]; //Resets listTwo //Adds one to max until max is correctly fitted with number of squares if (max < (numOfSquares - 1)) { max++; } for (int subIndex = 0; subIndex < numOfSquares && subIndex < (max + 1); subIndex++) { //If at first square if (subIndex == 0) { //Set listTwo's current value to lstOnes current value + the next value. listTwo[subIndex] = listOne[subIndex].add(listOne[subIndex + 1]); } else if (subIndex == max) { //If at final square if (subIndex == (numOfSquares - 1)) { total.add(listOne[subIndex - 1]); //Adds listOnes last value to total. } else { listTwo[subIndex] = listOne[subIndex - 1]; } else { //If subIndex is not yet at final or first Square //Set current value of listTwo to listOne's last square + current square + nextSquare listTwo[subIndex] = listOne[subInde add(listOne[subIndex].add(listOne[subIndex + 1])); } } listOne = listTwo; //Sets listOne to the new value of listTwo } int answer = total.mod(BigInteger.valueOf(123454321)).intValue(); //For some reason question asks to return modulo 123454321 of the number return answer; } Now here is the stack trace: Exception in thread "main" java.lang.NullPointerException at java.math.BigInteger.add(Unknown Source) at arrays.MinionsBoredGames.answer(MinionsBoredGames.java:59) at arrays.MinionsBoredGames.main(MinionsBoredGames.java:8)
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
Is there any way to disable permanently the software Escape button on the Touch Bar. After two months I can't get used it, and can't help touching it inadvertently in the middle of some important operations. Any solution other than drilling through the touchbar is welcome.
The question "How to disable Escape key in Safari" was asked here a few times. Now since on the new MacBook Pros the Escape key is a touchscreen button, it is much easier to press it accidentally, but there is a good chance we can actually remove it in Safari once and for all. How to remove Escape button from TouchBar in Safari? (or any specific app) There is no such option in Customize Touch Bar... menu:
I would like to run a command with an argument placed in the same directory as the shell script, from a shell script. example: my_installer.sh: #!/bin/sh sudo dpkg -i --someflags=abcd blah.deb How do I tell my_installer.sh where blah.deb is ? I have tried ./blah.deb and looked at some env vars... I get an error about file not found. I am assuming that the user would double-click the script, or run it from home - not cd to the script location.
I have a script which sets some environment variable to paths: export VAR1=/home/xyz/DIR_IN_WHICH_THIS_FILE_EXISTS export VAR2=$VAR1/abc/qwe ... Can I use something to get the DIR_IN_WHICH_THIS_FILE_EXISTS so that if I run this script from anywhere(any path) in the machine, it would set the same values to VAR1 depend on in which directory the script exists? Please help
How to show that $\mathbb Q(\sqrt 2)$ and $\mathbb Q(\sqrt 5)$ are non-isomorphic as a ring? All I could manage to show is that, for any isomorphism $\phi:\mathbb(\sqrt 2)\to\mathbb(\sqrt 5),$ $\phi(1)=1.$ Since $\phi$ is a homomorphism, $\phi(a+b\sqrt 2)=\phi(a)+\phi(b)\phi(\sqrt 2)=a+b.\phi(\sqrt 2)$ (Since $\phi(\dfrac{p}{q})=\dfrac{p}{q}\phi(1)$ for $p,q(\neq 0)\in\mathbb Z$) $\forall~a,b\in\mathbb Q.$
Page 105 of D. Burton's A First Course in Rings and Ideals reads It is not difficult to show that if (I'll call them $n$ and $m$ instead of $n_1$ and $n_2$) $n$, $m$ are square free integers, then $\mathbb{Q}(\sqrt{n}) \cong \mathbb{Q}(\sqrt{m})$ if and only if $n=m$. Well, it is getting difficult for me, any help or would be appreciated. My progress so far: Suppose $\phi :\mathbb{Q}(\sqrt{n})\to\mathbb{Q}(\sqrt{m})$ is an isomorphism. Then $\phi(u)=u$ for every $u \in \mathbb{Q}$, so that $\phi(\sqrt{n})^2=\phi(n)=n$. If $\phi(\sqrt{n})=a+b\sqrt{m}$ for some $a,b\in\mathbb{Q}$, then $(a+b\sqrt{m})^2=a^2+b^2m + 2ab\sqrt{m}=n$ implies $$a^2+b^2m = n$$ and $$2ab=0.$$ Then $b=0$ cannot happen since that would imply that $\sqrt{n}\in\mathbb{Q}$, where $n$ is a square-free integer. Also $a=b=0$ cannot happen. Hence $a=0$ and we have $$b^2m=n.$$ If $\psi:\mathbb{Q}(\sqrt{n})\to\mathbb{Q}(\sqrt{m})$ were an isomorphism then there would exist some $s\in\mathbb{Q}$ such that $$s^2m=n,$$ then $s=b$ or $s=-b$. Therefore the only isomorphisms from $\mathbb{Q}(\sqrt{n})$ to $\mathbb{Q}(\sqrt{n})$ are $\phi(u+v\sqrt{n})=u+vs\sqrt{m}$ and $\psi(u+v\sqrt{n})=u-vs\sqrt{m}$. I don't know if there's an easier way and I don't know if I'm in the correct way here. Thanks beforehand :)
I'm Trying to convert this xml to array saving the attributes names. Because I need to send this parameters to a Client using Wcf, and the client needs to display that information <?xml version="1.0" encoding="utf-8" ?> <Configuration> <Cameras> <Camera Name="Camera1" Url="Camera1" Width="600" Height="800" /> <Camera Name="Camera2" Url="Camera2" Width="600" Height="800" /> </Cameras> </Configuration> I'm using C#
How do I read and parse an XML file in C#?
Let's assume that I stumble upon a paper by author X where he cites ideas of A, B and C. Now I know about the rules of secondary sources and how I should cite them in case I haven't taken a look at the primary sources. But if I do track down the primary sources by myself and cite them instead, should I, somehow, credit author X for referring me to those ideas? Usually when doing a review of literature, I open like 10 studies, 'harvest' a few ideas and primary sources from each and track them down. Is this a good practice? I'd still cite, if required, the 10 studies for their own information (e.g. empirical results). EDIT: the part which may be unique is: Assume there are 20 citations in a paper. Should one feel unethical for 'harvesting' like 5-8 citations and tracking their original source without citing the intermediary source? It just feels like 'copying' since the intermediary paper 'led' one to these 5-8 citations.
Suppose that I am doing a literature review on a topic, and I read paper A, which makes an interesting claim and references paper B as its source. Naturally, as paper B is then the primary source, I will look up B and possibly cite it in my own paper if it seems relevant. And suppose that it turns out that paper A says nothing else that's relevant for my topic, so I say nothing about paper A. And this seems fine if I only discovered one citation from paper A. But if I find several useful citations in the same paper, it starts to feel like plagiarism if I just ruthlessly harvest it for citations without never citing itself. Sometimes it's easy to work in a citation in such a case. For example, if it's a review paper I'm reading, I might be able to just write in my own paper something like: Qwerty (2009) reviews a number of a results in this field, such as the finding that over 99% of the people who contract cancer wear shoes (Keyes 1999), that pink aliens from the sixteenth dimension dislike chocolate (Pinker 2001), ... But often there isn't really any reasonable way to work in a citation, especially not if you wish the citation to make it clear that this is where you found useful sources from. I could include a footnote or a thanks in the acknowledgements, but I've never seen anyone do that for such a reason. Are there any rules of thumb regarding the correct etiquette in such situations?
I have planned to build a circuit to display voltage and time value using PIC16F877A micro controller.To do this i tested the circuit using Proteus software as i attached here. It can display up to 5V. my question is can i read up to 300V using this micro controller?(I planned to use LR8N3G voltage regulator to give input voltage to PIC).will it damage the PIC? If so how can I read high voltage from this?
I want to read high voltages, like ~50V, using a microcontroller. I plan to put this as an input into the microcontroller's A/D line. But of course, you shouldn't have voltage that high on the input of a microcontroller or it'll fry. How might I read high voltages? The main thing is that I need to step down the voltage before reading it. What do I need to consider when stepping down this voltage? Thanks in advance! Edit: I noticed in the PIC18 datasheet that it says "The maximum recommended impedance for analog sources is 2.5 kOhms." How does this affect how I step down the voltage, be it with resistive dividers, etc.?
When I flag posts from several years ago, the flag seems to be never reviewed, unlike recent posts which can reviewed within minutes. I have >10 case like things with flagging things written more than 2 years ago. Why don't such flags get reviewed as fast as recent posts? They always last for months. Note: I've read , but it doesn't address the difference for old posts vs recent posts. Moreover, if about flag expiry get implemented, flagging old posts would mean such flags can not get reviewed. Update Ok, there is no common share about the correlation of a several years old post with less than 1000 view tend to not get it's flags reviewed. I will create a query on data.SE for this.
Here is the close queue: Here is an active flag I have: I currently have 5 flags pending in the close queue. Some, like this one, are months old. This doesn't feel right and may discourage newer users from flagging things that need attention with the assumption that a flag may be ignored for 4 months, so why bother? Here are some possibilities: Bump flags that have been languishing for more than 30 days to the front of the close queue (or weight questions with said flags a bit higher). Won't solve the issue, but will make it less egregious Punishing a misbehaving mod by forcing them to go through every sub-3000 user's flagged close votes in the queue and free them from flag limbo , "a new 10K flag list for "stuck" flags, which would be any close flag that is unhandled within 30 days." This question has been heavily edited under the assumption that flags didn't get refreshed every day. Apparently they do, thanks to Bill and Asheesh, so sorry about the misdirection. Languishing flags still an issue though!
I have just upgraded to Windows 10. Since the upgrade, my touchpad won't work at all (an external mouse does work, but the touchpad doesn't respond). I'm using an ASUS X200L laptop. I tried searching but couldn't find any proper drivers on ASUS's website. Any suggestions?
I have just updated Windows 7 to Windows 10. My touchpad scolling (right-side) is not working anymore. I have no idea how to fix this in Windows 10. I have hit the start button and typed "synaptic", but have found nothing useful. I used to have an icon on the taskbar that showed where I was touching the touchpad. I used to be able to right-click that icon to change settings, but Windows 10 has not brought that icon over. Also, the asus website has no synaptic touchpad drivers available for Windows 10. I have tried the enaltech drivers, but upon the installation atempt I am told that my hardware is not correct.
Are there any available computer engines that play the game Mancala? I know that there are many versions of the game but it would be interesting to know if there are computer engines that play the game, whether through AI or some form of alpha-beta pruning. Note that this is different from the other question based on Mangala. I am asking specifically on the game of Mancala, not Mangala. As a result I am not sure why this question was flagged as a duplicate.
is the Turkish version of mancala, with its own set of rules. I am planning on doing a project in it. Are there any game engines that either specifically play it, or universal Mancala players that plays it after supplying the options? EDIT: I am not looking for an app, but for a game engine. For example in chess, is a playing app, while is an open-source engine.
I just finish reading a pdf about group cohomology that explain a lot about it. It goes from the definition to Galois's cohomology. But there is one think I would like to know and I think I haven't enough read about cohomology to know : What is the intuition behind all of this theory ? If someone could explain me or just give me some references I would appreciate. Thank you very much !
Group cohomology is one thing I don't seem to get my head around. I understand $H^0$ as being the "fixed points" but when it comes to anything higher I have no idea what the notions are meant to be capturing...if anything. For example I can see that 1-cocycles are homomorphisms with a specific property but that property doesn't seem to mean anything to me...and I think it should! Is there an intuition or example that explains the meaning or is it just something that "stuck" and seems to work in lots of places?
I do not understand the presence of the red arrow in the table \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \x/\xtext/\ytext in{0/x/y,1/1/4,2/1.5/6,3/2/8,4/5/20} {\draw (\x,0.5) +(-0.5,-0.25) rectangle ++(0.5,0.25) ; \draw (\x,0) +(-0.5,-0.25) rectangle ++(0.5,0.25); \node[] at (\x,0.5) {$\xtext$}; \node[] at (\x,0) {$\ytext$}; } \draw[color=red,->,thick,>=stealth,shorten >=2pt,shorten <=2pt] (4.5,.65) edge [distance=1.2cm,bend left=80 ] node [right]{$\times 4$} (4.5,-.15); \end{tikzpicture} \end{document}
When I draw an edge between two nodes with anchors and globally set option [->], I get an additional arrow tip symbol at the beginning of the last edge in the path. For example in \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node (A) at (0,0) {$A$}; \node (B) at (1,0) {$B$}; \draw[->] (A.north east) edge (B.north west); \draw (A.south east) edge[->] (B.south west); \end{tikzpicture} \end{document} the first \draw command produces incorrect output, while the second produces correct output: Am I doing something wrong, or is this a bug in TikZ?
When making citations, I've seen both styles: with the tie/non-breaking space (~\cite{refnm}) and without it (\cite{refnm}). There are a few questions & answers on this topic in the more general sense, recommending reasonable things like a tie before a \ref. However, \cite never seems to be mentioned in these lists... I happen to be mostly concerned about numeric styles like IEEE, which I think is unlikely to produce bad line breaks if a tie is used, but what about other styles, and is it really recommended? Interestingly, the only says the following about references, which I think a few other guides have turned into "should be one the same line" (I'm pretty sure they mean as opposed to super/sub-script). When they are, they appear on the line, in square brackets, inside the punctuation. Grammatically, they may be treated as if they were footnote numbers [...] I did look at , and I thought that \cite deserves a separate question - I think it's pretty different case from \ref. I guess I'm looking for a more stylistic opinion.
My question is in the title of this post, but extends to other referencing commands like \eqref, \citep, \citet (and the like) as well.
I have a quite specific question and I haven't found it in the documentation of xparse or in the forum. In the documentation of xparse, page 3, there are three examples: \NewDocumentCommand{\foo}{o}{#1} \NewDocumentCommand{\foobar}{o}{#1} \NewDocumentCommand{\foobaz}{o}{#1} in which {\foo}, {\foobar} and {\foobaz} are written in braces {...}. Later, on page 4, there are other examples, but, now they are not in the braces {...}: \NewDocumentCommand \foo { m o m } { ... } \NewDocumentCommand \foobar { m o } { ... } \NewDocumentCommand \foobar { m !o } { ... } And this is where my question comes in. When is it necessary to put the name of the command between the {braces}?
Sometimes writing braces and omitting them produces the same result: \tilde{\psi} \mathrm{e}^{\mathrm{i} \pi} vs \tilde \psi \mathrm e^{\mathrm i \pi} Or (taken from Werner's comment below) \frac{1}{2} vs \frac12 If that's the case, how bad for the quality of my code is omitting them? Of course, if one compiles a pair of formulas, there is no difference. But, since I ignore how TeX works, my point is: if one writes long codes with these habits, doesn't TeX go somehow crazy because I'm not writing as it expects? For instance, does it have any effect on how fast are long documents compiled? Any reason to keep them?
I tried with defining another function $h(x):= f(x)-y$ where $ f(\frac{a+b}{2})<y<f(a)=f(b)$ So that $h(\frac{a+b}{2})\cdot h(a)<0$ and $h(\frac{a+b}{2})\cdot h(b)<0$ and therfore I have two points $x_{1}\in[a,\frac{a+b}{2}] , x_{2}\in [\frac{a+b}{2},b]$ with $h(x_{1})=0=h(x_{2})$. But I can't tell anything about how much they are apart.
Let $f$ be a real valued and continuous function over $[a,b]$ with $a <b$ such that $f(a)=f(b)$ , My question here is : Question (claim): How to show that : there exists $c \in [a, \frac{a+b}{2} ]$ such that : $f(c)=f(c+\frac{b-a}{2})$. Note: I have tried intermediate values but I didn't succeed.
What is wrong with the statement if (!adjacentNodes.get(nodeId).isEmpty()) in the below code? Such statement leads to the following message: java.lang.NullPointerException package IN.company; import java.util.HashMap; import java.util.HashSet; public class DiffusionModels { public int ICModel(int[] seedSet, HashMap<Integer, HashSet<Integer>> adjacentNodes, double p) { HashSet<Integer> infected = new HashSet(); HashSet<Integer> recentlyInfected = new HashSet(); ... while (recentlyInfected.size() > 0) { HashSet<Integer> nextActivator = new HashSet<>(); if (!recentlyInfected.isEmpty()) { for (Integer nodeId : recentlyInfected) { if (!adjacentNodes.get(nodeId).isEmpty()) { HashSet<Integer> neighborsOfNode =adjacentNodes.get(nodeId) ; for (Integer nodeNeighbor : neighborsOfNode) { if ((Math.random() <= p)&& !(infected.contains(nodeNeighbor))) { nextActivator.add(nodeNeighbor); } } } } } infected.addAll(recentlyInfected); recentlyInfected.clear(); recentlyInfected.addAll(nextActivator); } return infected.size(); } }
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
I was thinking about the epsilon-delta definition of a limit and began to wonder if it would work with closed intervals instead of open intervals. That is, for some function $f$, would the folowing definition work? $$\forall \epsilon>0\,\exists\delta>0\,(0<\lvert x-c\rvert≤\delta \, \implies \lvert f(x)-L\rvert≤\epsilon) $$ I've been trying to think of a counterexample, but can't seem to find one. edit: If it does work, why choose open intervals rather than closed?
Definition (As written in Michael Spivak's Calculus) The function $f$ approaches a limit $l$ near $a$ means: for every $\epsilon >0$ there is some $\delta > 0$ such that, for all $x$, if $0<|x-a|<\delta$, then $|f(x)-l|<\epsilon$. my question is: why can't it be: $$0<|x-a|\leq \delta,|f(x)-l|\leq \epsilon$$ After looking at limits of functions for a long time just to grasp it's meaning and using the definition quite a lot solving homework I realized I keep writing the same inequality without really understanding why. The only explanation given in Spivak's book for this part of the definition goes over it without explaining the inequality. I tried looking for an explanation myself but wasn't really able to find anything wrong with it. Is it also possible to write the definition like that or is there a problem with that? (first non-homework related question :p)
Long ago in a childhood far far away (around 2004), I read half of a book. Before I could finish it, my mom returned it to the library. Here are some things I remember about the book: There was a race of robotic lifeforms that had their own planet. When they showed up on Earth, the Japanese called them Gaijin (visitors). They caused religious upheaval when they arrived. They took some humans off planet to show them important things about the rest of the universe. The universe they showed the humans was full of diverse and abundant lifeforms. There was a binary star system that hosted microbial lifeforms that were regularly wiped out by radiation from the host stars. It was not very long, probably no more than 350 pages or so. Does this sound familiar to anyone? I'd LOVE to finish this book!!
I remember a book that described various lifeforms evolving in the galaxy (and i think may be the overriding theme was extinction). One of them was 2-D species evolved on rapidly changing environment (probably rings of some planet?) For some reason I'm thinking it may have been "Manifold" series but I honestly don't remember anything about that series, so it's just a vague feeling.
I am working on an application (zend framework) in which user can create their event and invite other users. Its current time zone is set to IST. But when any user from other country like USA, UK create an event its shows event expired because of its current time zone. Is there any way to set time zone dynamically on bases of country ? Can we get timezone of any location using php ? Please guide me in right direction. Many Thanks, M.
Is there a standard way for a web server to be able to determine a user's timezone within a web page? Perhaps from an HTTP header or part of the user-agent string?
All the fundamental laws of physics can be written in terms of an action principle. This includes electromagnetism, general relativity, the standard model of particle physics, and attempts to go beyond the known laws of physics such as string theory. For example, (nearly) everything we know about the universe is captured in a Lagrangian where the terms carry the contributions of Einstein, Maxwell (or Yang and Mills) and Dirac respectively, and describe gravity, the forces of nature (electromagnetism and the nuclear forces) and the dynamics of particles like electrons and quarks. Source: David Tong Me: I am a second year undergrad and have a nice familiarity with the -1/4 F_ij F_ij term (electromagnetism) and how it results to the Maxwell's Equations, but am still curious to know how it seems like there is always a Lagrangian. Apart from one obvious advantage that the Euler Lagrange equations hold in any coordinate system and the Lagrangian holds the key to the symmetries of the system.
It is an usual practice that any quantum field theory starts with a suitable Lagrangian density. It has been proved enormously successful. I understand, it automatically ensures valuable symmetries of physics to be preserved. But nevertheless the question about the generality of this approach keeps coming to my mind. My question is how one can be sure that this approach has to be always right and fruitful. Isn't it possible, at least from the mathematical point of view that a future theory of physics does not subscribe to this approach?
I have Raspberry Pi 3 running Ubuntu Mate 16.04. I'd like to uninstall all the crap I don't need, and among the first candidates is LibreOffice. However, when I try to uninstall LibreOffice, I'm warned that this would also uninstall ubuntu-mate-desktop: sudo apt-get remove libreoffice-calc The following packages will be REMOVED: libreoffice-calc ubuntu-mate-desktop I believe I do want to in fact keep ubuntu-mate-desktop. I'm getting the same message when trying to remove other packages I don't need/want (e.g. caja-wallpaper). Why is this? How do I correctly uninstall LibreOffice (and other software/packages)?
I once advised someone to remove a package that depends on ubuntu-desktop meta-package, if she didn't need it (EG: if one uses a different editor than gedit). Someone else said that doing so (removing gedit which will in turn remove ubuntu-desktop) could break things. Is this true? Are there any other potential problems?
I am trying to prove that the metric space $(\mathbb{R}, d(x,y))$, $d(x, y) = \frac{|x-y|}{1+|x-y|}$ is complete. To do this, I need to show that any Cauchy sequence converges. The definition of Cauchy sequence: A sequence $\{x_i\}$ is called a Cauchy sequence if $\forall \epsilon > 0 \exists N(\epsilon) : \forall m, n > N(\epsilon) => d(x_m, x_n) < \epsilon$. But I don't understand how this can be applied to a given metric space. Can anyone help?
What can we say about the compactness and completeness of the set $X = \mathbb{R}$ with the metric $$d(x, y) = \frac{|x-y|}{1+|x-y|}\;?$$ I tried by showing that $d(x, y)<1$ and thus it is bounded. But how to show rest of the things? Can anybody help me? Thanks
For example, "demonym" is the term for the people from a place. Is there a term for describing the collective noun of a species of animals, like a business of ferrets, swarm of bees, or congress of baboons? Say I was making a table with the animal in one column and the collective noun as the header of another column. What would the header of the collective column be?
murder : crows :: _ : collective nouns Sorry, no multiple choice this time.
I want to display the node count along with the filter in views exposed filter same feature like facets can any one help me out in this.
I have a couple of exposed filters to filter the content in my view. Most of them are taxonomy terms, now i would like to show how many nodes are tagged with that term behind the taxonomy term. example: London (5) Paris (3) Madrid (2) ... Any idea how i can do this?
Why does the density on the y axis sometimes have values greater than 1 if the curve is representing density? See the example below where I use R's density() function to plot a density curve. plot(density(rnorm(1000, 1, 0.01)))
On the , there is this line: $p(\mathrm{height}|\mathrm{male}) = 1.5789$ (A probability distribution over 1 is OK. It is the area under the bell curve that is equal to 1.) How can a value $>1$ be OK? I thought all probability values were expressed in the range $0 \leq p \leq 1$. Furthermore, given that it is possible to have such a value, how is that value obtained in the example shown on the page?
I just want to know how many images I can use as a CSS background or any other way to use multiple background images in a class so that I could use multiple of images I am trying to use this but it is accepting only two images #example1 { background: url(img_flwr.gif) right bottom no-repeat, url(paper.gif) left top repeat; padding: 15px; }
Is it possible to have two background images? For instance, I'd like to have one image repeat across the top (repeat-x), and another repeat across the entire page (repeat), where the one across the entire page is behind the one which repeats across the top. I've found that I can achieve the desired effect for two background images by setting the background of html and body: html { background: url(images/bg.png); } body { background: url(images/bgtop.png) repeat-x; } Is this "good" CSS? Is there a better method? And what if I wanted three or more background images?
From what I understand, a one layer network (no hidden layers) is exactly the same as logistic regression. Now suppose I have a function $f(x)$ that is exactly a logistic regression function with say d features. If I insist on running a neural network with say 3 layers with d/3 neurons each, is this a bad idea? That is, will it: Take much longer to train such a network? The final optimum weights produce a function that is not a great approximation to the original function? (Note the regression model reproduces f(x) exactly). This would be a hypothetical example of a situation where naively using deep learning is worse than shallow learning so to say.
How do we explain the difference between logistic regression and neural network to an audience that have no background in statistics?
Below are my xpaths and keep on chining, Element path <div class="dijitInline utilizationTitle">5.00%</div> Here need to capture values (5.00%).... Element Xpath //*[@id="dijit_layout_ContentPane_23"]/div[2]/div[1] //*[@id="dijit_layout_ContentPane_24"]/div[2]/div[1] //*[@id="dijit_layout_ContentPane_90"]/div[2]/div[1] //*[@id="dijit_layout_ContentPane_91"]/div[2]/div[1] //*[@id="dijit_layout_ContentPane_151"]/div[2]/div[1] //*[@id="dijit_layout_ContentPane_152"]/div[2]/div[1]
How to Handle Dynamic Changing IDs In XPath? for example : //div[@id='post-body-3647323225296998740']/div[1]/form[1]/input[1] In this xpath id "3647323225296998740" is changing every time when reloading the page. Is there any way to handle this type of situation in Selenium?
I was asked following question in an interview : Array a = {1,2,3,4,5}, Array b = {a,b,c,d,e}, write a program to add individual elements of both array and enter the sum in third array with output like {e1, d2, c3, b4, a5} I was not able to come up with solution at that time and now I am trying at home and wrote following code but got null pointer exception : public class ArrayMergeIndividualElements { String[] a = {"1","2","3","4","5"}; String b[] = {"a","b","c","d","e"}; String s[]=null; void mergeArrays() { int k=0; int j=b.length-1; for(int i=0;i<a.length;i++) { for(;j>=0;) { System.out.println("Number array is "+a[i]); System.out.println("String array is "+b[j]); s[k]=a[i]+b[j]; //getting null pointer exception at this line k++; j--; break; } } System.out.println("output is :"); for(int l=0;l<s.length;l++) { System.out.print(s[l]); } } public static void main(String[] args) { ArrayMergeIndividualElements amie = new ArrayMergeIndividualElements(); amie.mergeArrays(); } } I have tried following code by searching on stackoverflow , but no luck String[] both = Stream.concat(Arrays.stream(a[i]), Arrays.stream(b[j])) .toArray(String[]::new); Individually arrays are printing the value but when I try to add/concatenate them I am getting null pointer. Also can we add both arrays if one is Integer array and other is String array? Please help
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
I've a WordPress blog where I'm using the Infinite Scroll plugin to load posts infinitely. I developed the theme for the blog using Twitter Bootstrap 2.3.2 and I'm using the Bootstrap Tooltip plugin to show post meta (date, etc.) in a Twitter Bootstrap tooltip that fires on hover. My problem is that with the default set of posts that load when the site first loads, the tooltips work just fine using the following code: $(document).ready(function() { $('.post-info a').tooltip(); }) But when the ".content" DIV is dynamically updated with the new sets of posts pulled by an AJAX request, the same code stops working on newly inserted posts and the code provided above no longer shows the Bootstrap tooltip on mouse hover. Here is the HTML markup of the link that's supposed to show up the tooltip on hover: <a href="#" data-toggle="tooltip" data-placement="top" title="Dynamically inserted text with the help of PHP">Dynamically inserted text with the help of PHP</a> Could you please help me solve this issue? Thanks a lot!
I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.
A couple of years ago I read an interesting Wikipedia article about something called a "field-programmable gate array". The article made it sound like it's a box of logic gets which you can arbitrarily wire together to implement any kind of logic you want (but without needing thousands of discrete components). Now, I had assumed this works something like a PROM. As in, you buy a die which has all the gates on it, with everything connected to everything, and then there's a glass window to the die, and you use one of those extremely expensive UV-laser writers to "burn" through the connections you don't want, resulting in the logic circuit you designed. (And maybe there's a version that's erasable too, like how CD-RW is somehow erasable.) Once you've "burned" your program into the chip, it behaves as if it were that actual combination of logic gates. (Because now it is that combination of logic gates!) However, more recently I've been reading about this, and it appears this isn't how the technology works at all. A lot of recent articles talk about needing to send a "bitstream" to the FPGA at system power-up (and even the possibility of encrypting this bitstream to stop your competitors reading it). This makes it sound alarmingly like a FPGA isn't a hardware construct at all; it makes it sound like really it's just an ordinary microprocessor that's simulating your design in software. In particular, that means a design programmed into an FPGA can never run any faster than the underlying microprocessor that's simulating it. Which kind of makes the entire endeavour sound... kinda pointless. I thought the whole point of an FPGA was to make custom logic that does stuff faster than you can do it in software. But all this "bitstream" stuff makes it sound like it is still software... I'm a little confused here. How does an FPGA actually work?
I've seen a lot of people talking about FPGA's before and I know that it stands for field-programmable gate array but how does it work and what is the purpose of using an FPGA?
I believe there are 3 parts to this. 1) $(A\setminus B) \cup (A\setminus C) = B \Rightarrow A=B $ 2) $(A\setminus B) \cup (A\setminus C) = B \Rightarrow (B \cap C) = \emptyset$ 3) $A=B \wedge (B \cap C) = \emptyset \Rightarrow (A\setminus B) \cup (A\setminus C) = B$ I can do the the parts labelled 1 and 3 but cannot show part 2. Anyone who can explain how you do the 2nd part ie show $(A\setminus B) \cup (A\setminus C) = B \Rightarrow (B \cap C) = \emptyset$ ?
I`m trying to prove this claim and I need some advice how to continue, $$(A \setminus B) \cup (A \setminus C) = B \Leftrightarrow A=B , C\cap B=\varnothing$$ what I did is: $$(A \setminus B) \cup (A \setminus C) = (A \cap B') \cup (A \cap C') = A \cup (B' \cap C')$$ thanks!
Left an unfrozen uncooked store made pizza in the car for 4 hours in 54 degree weather. Is this safe to cook?
How do I know if a given food or ingredient I have is still good, or if I should discard it? How can I best preserve a food or ingredient? This broad question is intended as a "general reference" question to quickly answer many how long will food keep for? questions. Please feel free to edit this question to expand and clarify as needed.
I recently came to learn that Brewster's Millions (1985) with Richard Pryor, is only one of 13 versions adapted from the 1902 book. What film has the most versions?
The current movie industry seems to be engaged in an orgy of remakes to reduce the risk of funding completely new scripts. We have had a recent remake of Total Recall and are about to get a remake of Robocop. Sometimes the remakes happen very quickly (the Swedish movies Let the Right One In and The Girl With the Dragon Tattoo were both remade in English very quickly). Some of the scripts start as books (The Big Sleep, for example), some start as plays (The Front Page was originally a stage play but was remade as a movie several times, in 1931 and 1974 as The Front Page and in 1940 as His Girl Friday) and others as screenplays (Robocop seems to have started as a screenplay). What is the most remade story? NB For clarity let us exclude series where a character such as James Bond repeats and stick with those where the story credit references a single play, book or original script.
Sometimes I get a good answer and accept it, but the someone else posts a brilliant answer. I of course upvote it, but I avoid changing my accepted answer in most situations, since I feel it might be a bit frowned upon, so to speak. Is it "bad practice" (for lack of a better term) to accept a different answer after you've already accepted an answer?
I had a question of the form "does something like X exist?" Someone wrote a response to say that, No, X does not exist, but I could write it if I liked. I had suspected as much, so I marked his answer as the accepted answer. Today someone actually posted the code to do X for me, and I feel that the new poster deserves the "Accepted Answer" checkmark. Is it poor form for me to pick a new Accepted answer? Does the original answerer get penalized in terms of reputation? While the original responder's answer was accepted at the time, I feel this new answer is really more helpful. Edit: Which of these responses should I accept? What does the notion of a single accepted answer mean with a question that is subjective that could have multiple "right" answers?
I have read the Death Star (the first one) had a diameter of about 186 km, which made me think about whether it could somehow host a satellite or moon due to its size, .
The Death Star is the size of a small moon. Endor being a moon (not sure if it's small or not) has a rich atmosphere. Could the Death Star hold a nitrogen/oxygen based atmosphere with its gravity? (Now re-reading my question, I suppose this sounds a lot like the plot of SpaceBalls... that was not my intention)
prove that: $$\sin \alpha+\sin2\alpha+\sin3\alpha+...+\sin N\alpha = \frac{\sin\frac{N\alpha}{2}\sin\frac{(N+1)\alpha}{2}}{\sin\frac{\alpha}{2}}$$ without $\sum$
How can we sum up $\sin$ and $\cos$ series when the angles are in arithmetic progression? For example here is the sum of $\cos$ series: $$\sum_{k=0}^{n-1}\cos (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \cos \biggl( \frac{ 2 a + (n-1)\cdot d}{2}\biggr)$$ There is a slight difference in case of $\sin$, which is: $$\sum_{k=0}^{n-1}\sin (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \sin\biggl( \frac{2 a + (n-1)\cdot d}{2}\biggr)$$ How do we prove the above two identities?
I have multiple folders named as follow: Name1 Name2 ... Name9 Name10 Name11 ... I need to rename them using mv command into: Name01 Name02 ... Name09 Name10 Name11 ... Any ideas?
I've got bunch of files with ill-formed numbering: prefix-#.ext | for files with number 1-9 prefix-##.ext | for files with number 10-99 prefix-###.ext | for files with number 100-999 Due to further processing I need all of their names to be in format: prefix-###.ext. Is there any easy way to do that?
I have overstayed in the US for three years. Now I am returning to my home country and, while booking the ticket from the US, note that the flight has a stopover at London Heathrow of 1 hour 40 minutes. Do I need a transit visa?
Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have.
I'm having issue adding a new user to ubuntu core. I use sudo adduser --extrausers USERNAME and successfully created a user but I cannot run any sudo command using that account. $ sudo mkdir [sudo] password for switchadmin: switchadmin is not in the sudoers file. This incident will be reported.
In /etc/sudoers I see this: # Allow members of group sudo to execute any command after they have # provided their password # (Note that later entries override this, so you might need to move # it further down) %sudo ALL=(ALL) ALL So how do I add a user to that sudo group?
I'm getting started with proofs but I have no idea how to do this. I have gotten to $b c = a k$ where $k$ is some integer by divisibility. I'm not sure I can use division yet as they will no longer be integers. I have no idea how to prove it and am seeking helpful ideas.
I know it might be too easy for you guys here. I'm practicing some problems in the textbook, but this one really drove me crazy. From $\gcd( a, b ) = 1$, I have $ax + by = 1$, where should I go from here? The extra $ac$ is so annoying. Any hint? Thanks, Chan
I have this code to connect a server with a client, i need send json objects to a android studio client but the method escribir in the line of the printwriter have a error, and i dont konw what is the problem, please see the code and help me public class Servidor { ServerSocket servidor=null; Socket socket=null; BufferedReader lector=null; PrintWriter escritor=null; Gson gson = new Gson(); public Servidor(){ } public static void main(String[] args) { Servidor Server=new Servidor(); Server.iniciarHilo(); } public void iniciarHilo(){ Thread principal=new Thread(new Runnable(){ public void run(){ try{ servidor=new ServerSocket(8080); while(true){ socket=servidor.accept(); leer(); } }catch(Exception ex){ ex.printStackTrace(); } } }); principal.start(); System.out.println("Servidor iniciado......"); } public void leer(){ Thread leer_hilo=new Thread(new Runnable(){ public void run(){ RegUser registrar=new RegUser(); try{ lector=new BufferedReader(new InputStreamReader(socket.getInputStream())); while(true){ JsonParser parser = new JsonParser(); String mensaje= lector.readLine(); JsonElement elemento = parser.parse(mensaje); String mensaje_in=elemento.getAsJsonObject().get("tipo").getAsString(); if (lector==null){ System.out.println("Conexion Interrumpida...."); } if (mensaje_in.equals("registrar")){ System.out.println("Solicitud de Registro"); registrar.newUser(elemento); } else if (mensaje_in.equals("ingresar")){ System.out.println("Solicitud de Ingreso"); } } }catch(Exception ex){ ex.printStackTrace(); } } }); leer_hilo.start(); } public void escribir(final String dato){ Thread escribir_hilo=new Thread(new Runnable(){ public void run(){ try{ escritor= new PrintWriter(socket.getOutputStream()); escritor.println(dato); }catch(Exception ex){ ex.printStackTrace(); } } }); escribir_hilo.start(); } And this public class RegUser { Gson gson = new Gson(); ListaEnlazada listaUsuarios; Comparar comparar=new Comparar(); public RegUser(){ } public void newUser(JsonElement elemento) throws IOException{ Servidor respuesta=new Servidor(); //respuesta=new Servidor(); String user=elemento.getAsJsonObject().get("nombre").getAsString(); //boolean result=comparar.UserComp(user); if(true){ listaUsuarios=new ListaEnlazada(); listaUsuarios.add(elemento); System.out.println(listaUsuarios.get(0)); JsonObject o = new JsonObject(); o.addProperty("tipo", String.valueOf("registro")); o.addProperty("estado", String.valueOf("completo")); String enviar_mensaje = gson.toJson(o); respuesta.escribir(enviar_mensaje); } And the error is java.lang.NullPointerException at Servidor$3.run(Servidor.java:81) at java.lang.Thread.run(Thread.java:745) I has an error when writing a data through the socket to the client, the error is in the getOutputStream
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?
How feasible it is to be supervisored by a professor who doesn’t know the area? She told me it’s my research and she will only provide general research guidance.
In my PhD, I am assigned mathematical modeling topics and my supervisor's work is related to mathematical biology. But I don't want to work in mathematical biology. Because actually there is not so much real application of that and I don't like biology. Instead, I want to work in fluid dynamics. But my supervisor's research area is totally different. Is it possible to do independent research work without supervision of supervisor?
I search for "nurple" in a file. I found it, great. But now, every occurrence of "nurple" is rendered in sick black on yellow. Forever. Forever, that is, until I search for something I know won't be found, such as "asdhfalsdflajdflakjdf" simply so it clears the previous search highlighting. Can't I just hit a magic key to kill the highlights when I'm done searching?
After doing a search in Vim, I get all the occurrences highlighted. How can I disable that? I now do another search for something gibberish that can't be found. Is there a way to just temporarily disable the highlight and then re-enable it when needed again?
I have a list of articles and I put a submit button to all of them. The fact is I can't get the good input hidden when I'm in my controller because it will take the last input. <form method="POST" action="{{url('/deleteArticle')}}"> @foreach($articles as $a) {{ csrf_field() }} <div class="test"> <div class="name"><?= $a['name_a'] ?></div> <input type="hidden" name="id" id="ida" value='<?= $a['id_a'] ?>'/> <input type="submit" class="del" id="delA" class="cross" name="id">X</input> </div> @endforeach </form> Instead of doing the trick with javascript, I thought about looping my articles and foreach of them having a form. Is it a bad practice or should I have a single form with one submit button by article? The value of this submit button can't be "X" but only the ID of my article I want to delete, and this is bad for the display.
I have two submit buttons in a form. How do I determine which one was hit serverside?
When trying to install pagespeed on my debian 7.1 Unpacking mod-pagespeed-stable (from mod-pagespeed-stable_current_amd64.deb) ... dpkg: dependency problems prevent configuration of mod-pagespeed-stable: mod-pagespeed-stable depends on libc6 (>= 2.14); however: Version of libc6:amd64 on system is 2.13-38+deb7u11. dpkg: error processing mod-pagespeed-stable (--install): dependency problems - leaving unconfigured How to fix that ? (I guess I need to upgrade libc6, but no idea how)
Might be a stupid question, but how can I get an _amd64.deb package version of a mod_pagespeed release prior to the current stable/beta versions - i.e. release 1.11.33.0-beta - I need to install mod_pagespeed on my Debian Wheezy server and the current version doesn't support it (libc6 version dependency is now 2.14 and Wheezy has 2.13). Building mod_pagespeed from source or somehow updating libc6 wouldn't be a great option on this important production web server. I'd love to simply grab and dpkg the latest version that didn't yet require glibc >= 2.14 and would dpkg on Debian Wheezy 7.0 without throwing a dependency error like: sudo dpkg -i mod-pagespeed-stable_current_amd64.deb Selecting previously unselected package mod-pagespeed-stable. (Reading database ... 40509 files and directories currently installed.) Unpacking mod-pagespeed-stable (from mod-pagespeed-stable_current_amd64.deb) ... dpkg: dependency problems prevent configuration of mod-pagespeed-stable: mod-pagespeed-stable depends on libc6 (>= 2.14); however: Version of libc6:amd64 on system is 2.13-38+deb7u7. The release notes say the last version that supported this setup is just a couple of releases back - the glibc 2.14 requirement is in place as of v 1.11.33.1-stable in May 2016, so 1.11.33.0-beta should do the trick. Is there an archive of the older .deb packages out there somewhere? Or a way to reference the version in the URL structure when using wget - i.e. ????_amd64.deb
For a school assignment, I need to write an essay comparing the novel Norwegian Wood by Haruki Murakami to a film with a similar theme. Over the course of the novel, the main character is torn with sadness, feeling responsible for his love of a girl which is now in a mental hospital, the suicide of an old friend, and the uncomfortability of growing into adulthood. The novel focuses mainly on its characters' thoughts and feelings due to past events (usually ones of sadness, a lust for another's warmth, or loneliness) rather than the events themselves. In fact, almost all of the characters in the novel have some sort of life event which causes them to be haunted with sorrow for many years (for example, the suicide of a loved one), and each of them handle this emotion differently, either isolating themselves, ignoring them, or trying to face them. This is the theme I want to use as the point of comparison in my essay, how people handle their sadness, but I can't seem to find a corresponding film. I've never really been into watching too many movies, I've been spending hours looking for a corresponding movie (that's not the official live action film) with no avail. Is there any movie concentrating on the described themes?
As a general case, how can I find movies or TV shows similar to an existing movie or TV show that I like?
I have this problem with my redstone. Im trying to build a trapped chest piston trap, but 3 of the pistons will just not deactivate. it stays powered even when its not connected to anything. is there any way to stop this?
To reproduce this problem make layout like this and then power the piston. Once the piston is extended, removing the power source will not retract it: Since piston head block is transparent, I see no explanation for this. Also, even if it wasn't transparent, it still wouldn't power a piston. For example this doesn't power the piston: But if I place redstone and THEN place the piston, it's powered: It also remains powered no matter what, as long as there isn't a block update event: I suppose this behavior can be used to make a block update detector, but in my case this sucks. I wanted such setup for automatic smooth stone generator (without any clocks): But due to this bug, it won't work - the piston will be always extended.
If there is an n-by-n matrix, each element in the matrix can only be 1 or 0. We assume that an n-by-n matrix is nonsingular, then we do the two's complement at only the diagonal of the matrix. After I do the two's complement at the diagonal, an n-by-n matrix is still nonsingular. How many numbers of this kind of matrices can be found in an n-by-n matrix??? Can we derive a general formula?? If n=2, I can derive the number of this kind of matrices is 2, n=3, the number of this kind of matrices is 48. But I have no idea whether it exists a general formula when we expand to the n-dimensional matrix.
There is an invertible $n×n$ matrix with each entry $0$ or $1$. Now we negate ($x\to 1-x$) the diagonal of the matrix, and it is still invertible. How many such matrices exist for a given $n$? Can we derive a general formula? If $n=2$ there are $2$ such matrices, if $n=3$ there are $48$. But I have no idea whether a formula exists for higher $n$.
How do you call someone who turns to force to impose their view? That is how I call you, and I think it is time for a change. Consider how SE works: You are the one that built a platform -- thank you for that. We are the ones that produce the content. We try to do so freely, democratically, out of our needs, passion, and interest. You are the one that profits economically on the content that we create -- thank us for that, maybe? The issue with this balance is that you structured the platform to give yourself absolute ruling power, and while pretending to allow us some freedom and democracy, you haven't hesitated in showing it to us on multiple occasions. I do not think it is a healthy relationship when you can push your agenda on the rest of us, and we can barely write a complaint to show our disappointment. Regardless of the specific topic of the particular abuse, the issue is that you took no significant action towards a change. There could have been many things you could have done to improve our relations: Separate your activity from ours. You do that one thing that you know how to do, and that is to build and maintain the platform. We freely and democratically organise ourselves, elect our representatives, and contribute to our shared knowledge. Give us the full power to undo the effects of your abuses and to veto any further action that you may wish to take on members of our community, and on its content. Open any decisions that may affect our participation in the platform to referendum votes, as it is done in all respected democracies around the world. Accept that if you wish to partake in the community, you may do so as any other user with limited privileges unless elected to a position of power by the community itself. You have done nothing of it, and that is where the line is drawn. All the rest, apologies, promises, chit-chats, mea culpas, and excuses... they are just cheap words in the air. More action, less talking.
There's no need to the that have led to a lack of trust between of and . Suffice it to say that astoundingly they continue to assert that and, instead of apologizing and reinstating Monica have demanded that she go through a process with no transparency, due process, or involvement from the community. Has the time has come for Stack Exchange, Inc to spin off the community and all the data needed to keep the sites running to a separate non-profit, who would then in turn license the software from the company? What's in it for the community? The community can practice self determination for issues from as basic as the number of moderators they have to as fundamental as the policies they enforce. If the company development continues to be unresponsive to the community's needs, the community would be able to develop its own open source software that would meet its needs. They can find their own funding model instead of having ads imposed on them. What's in it for the company? Community actions will no longer reflect on the company. Interaction with the community as a customer may come more naturally to current leadership than the present paradigm. They don't have to worry about paying for the community's operating expenses. They can focus on doing one thing well.
I have installed UBUNTU 13.04 32bit,afer installing CCSM and NVIDIA drive,Unity launcher,top panel,Dash and title bar disappeared. Now what should I do?
When I login, nothing happens. I am presented with my desktop wallpaper. No Dash, no Launcher, nothing.
In Afrikaans, it is considered very disrespectful to use "you" ( "jy") when referring to someone who is above the level of a peer. Instead, it is expected that you use "u", which is a very respectful form of "you". Also you can talk in the third person "How is ma'am today" would be the equivalent. I cringe internally when I say "How are you" to someone older than me, because in Afrikaans it would be very rude. I was bought up to only ever refer to my parents in the third person. "how is mom today", "what is dad doing" when speaking in Afrikaans. The lack of English equivalent feels very wrong and disrespectful. What is the best way to convey this in English? I have been reassured that saying "you" to a parent isn't rude, and I understand that this can be cultural, but I'm particularly looking for what options English offers in this regard, as far as existing vocabulary, that convey respect. I'm in South Africa.
From the top of my head, Danish "De" (practically never used), German "Sie", Chinese "您", French "vous", Spanish "usted" are a formal way of addressing someone, especially if one isn't familiar with the addressee. Did English ever have this? It sounds as though Proto-Indo-European might have had this (based on my 4 examples), but perhaps someone can enlighten me?
I have a json like this: [ {"numbers":["1","2","3","4"], "city":"Tokio", "color":"blue", }, {"numbers":["5","6","7","8"], "city":"Tokio", "color":"green", }, ......... ] and i need to convert to another json with javascript like this: [ {"numbers":"1,2,3,4", "city":"Tokio", "color":"blue", }, {"numbers":"5,6,7,8", "city":"Tokio", "color":"blue", }, ......... ] so, i need to convert the array of numbers in a string, any idea? Thanks in advance.
I have a one-dimensional array of strings in JavaScript that I'd like to turn into a comma-separated list. Is there a simple way in garden-variety JavaScript (or jQuery) to turn that into a comma-separated list? (I know how to iterate through the array and build the string myself by concatenation if that's the only way.)
I am doing a tutorial for homework, which is to build an Instagram app. The tutorial is about two years old and I am having some problems with the coding. I am having the following error and am not sure why. java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference My UniversalImageLoader class public class UniversalImageLoader { private static final int defaultImage = R.drawable.ic_android; private Context mContext; public UniversalImageLoader(Context context) { mContext = context; } public ImageLoaderConfiguration getConfig(){ //File cacheDir = StorageUtils.getCacheDirectory(mContext); ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(mContext)//<--the error is in this line .memoryCacheExtraOptions(480, 800) // default = device screen dimensions .diskCacheExtraOptions(480, 800, null) .threadPriority(Thread.NORM_PRIORITY - 2) // default .tasksProcessingOrder(QueueProcessingType.FIFO) // default .denyCacheImageMultipleSizesInMemory() .memoryCache(new LruMemoryCache(2 * 1024 * 1024)) .memoryCacheSize(2 * 1024 * 1024) .memoryCacheSizePercentage(13) // default .diskCacheSize(50 * 1024 * 1024) .diskCacheFileCount(100) .diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default .imageDownloader(new BaseImageDownloader(mContext)) // default .defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default .writeDebugLogs() .build(); return config; } in HomeActivity:(and OnCreate)[in every Activity I call it like this] initImageLoader(); private void initImageLoader(){ UniversalImageLoader universalImageLoader = new UniversalImageLoader(mContext); ImageLoader.getInstance().init(universalImageLoader.getConfig()); }
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
I have almost solved the question but I am stuck in the last part we know $X_1 , X_2,......,X_{(n-1)}$ and $Y_1, Y_2 ,.....Y_{(n-1)}$ can be filled only in one way, so the question reduces to filling the $(n-1) \times (m-1)$ table with $±1$ with out any condition i.e $2^{(n-1)(m-1)}$ but what about the green ( right bottom) box how can we fill that box?
How many $m\times n$ tables are there if they are subject to the following two conditions? In each cell of the table we have $1$ or $-1$. The product of all the cells in any given row and the product of all cells in any given column equals $-1$. I already know if Parity of $m$ and $n$ are different there is no such a table. what is the answer in general?
cmd+tilde does not work as the key below Esc is mapped to '<' character on my layout. I cannot find any preferences to remap this. Franky I am surprised this does not work, this mapping should be bound to a key and not a character. Is this a bug that should be opened at Apple? Thanks
I opened two Google Chrome windows (because I am using multiple Gmails) and when I do the Cmd ⌘ Tab ⇥ shortcut it just shows me other applications that I opened but does not show me the other Chrome windows that are already opened. How to switch to the other Google Chrome window that I opened using keyboard shortcut?
Imagine firing one electron at a time at a double slit. Clearly the wave function interacts with the atoms of the material, and presumably many electrons do not pass through. Why does decoherence from these interactions not spoil the experiment? The question has been asked , but there is no answer Edit, to clarify the question: since the electron wave function interacts with the atoms of the material in which the double slit is cut, I naively expect that decoherence would make the system classical, no matter how carefully the experiment is set up. I must be misunderstanding the decoherence mechanism that prevents macroscopic systems being in quantum superpositions. The question is, why doesn't this decoherence spoil the double slit experiment? Can anyone explain why decoherence ensures Schrodinger's cat is alive or dead, but does not ensure the electron goes through one slit or the other?
If we shine light on an electron wave passing through a double slit then the interference pattern is destroyed. This is now understood as decoherence coming from interaction of the electrons with light. What I do not understand is why decoherence doesn't occur from the material making up the barrier (in which we have the slits). I mean why do we need the light to cause decoherence and why in the absence of the same does the electron behave like an isolated system?
Was making a simple mistake. Thanks
Occasionally I come across methods with an uncomfortable number of parameters. More often than not, they seem to be constructors. It seems like there ought to be a better way, but I can't see what it is. return new Shniz(foo, bar, baz, quux, fred, wilma, barney, dino, donkey) I've thought of using structs to represent the list of parameters, but that just seems to shift the problem from one place to another, and create another type in the process. ShnizArgs args = new ShnizArgs(foo, bar, baz, quux, fred, wilma, barney, dino, donkey) return new Shniz(args); So that doesn't seem like an improvement. So what is the best approach?
I'm running Ubuntu 18.04 on a Toshiba Satellite C55-A and trying to upgrade to 20.04. Software Updater first gives a "Failed to download repository information" message but I continue on. My internet connection is fine. Then I get a notice that third party sources are disabled. Then I get 404 errors. I've also tried the upgrade via the terminal and get the same results. Please help. This is an edit. Thanks for the suggestion @Matthew. This would have done it. It turns out that the mirror I'd been using for years was not able to handle the upgrade. This old mirror had at one time been the optimal one for me but something changed along the way. Hope this info helps somebody and Thank You to you good folks.
When I run software updater it says that it failed to download repository information and to check Internet connectivity. I have Internet connectivity. How do I fix this? editing to add content of sources,list: sorry I can't figure out how to paste in the content of sources.list without making a huge mess. Some of it previews as really large bold print. I tried to follow the block quoting and code rules but it is a huge mess anyway.
Now I have truly seen everything. The community user does a lot of things, but editing answers to add information? Now that is truly bizarre. What am I talking about? Have a look at the revisions to question. Yeah, that's right - the community user suggested an edit that adds to the answer. What is going on? Do we need to fear the new intelligent bots? Should we run for cover... or should we try to get rid of it? A plausible explanation of what happened here would be great if nobody can think of a good defense strategy.
When clicking "edit" I see: Your edit will be placed in a queue until it is peer reviewed. We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks. Like: Likewise, when I am not logged in, clicking "improve this question" or "improve this answer" shows: You are not . Your edit will be placed in a queue until it is . And when I click 'Save', I get: Thanks for submitting an edit. It is only visible to you until it's been approved by trusted community members Like: Who can suggest an edit? Where do suggested edits go? Who can vote on a suggested edit? How do suggested edits get reviewed? Can I earn reputation? What about abuse or bad edits? Sometimes the Community user approves or rejects my edit. Why is that? When can I not suggest an edit? Is there a minimum change requirement for a suggested edit? How do I check my suggested edit history? I disagree with the reasons why my suggested edit was rejected. What can I do? How do I know whether there are edits waiting for review? Someone suggested an edit to my own post, and the reviewers took the wrong action. What can I do? Are tag wikis included in this scheme? What do the "Improve Edit" and "Reject and Edit" buttons do? Why are apparently valid links to rejected edits resulting in 404 errors? For more information about editing, see "" in the .
An engineer has been shot, he was working on creating AI. His neural connections were broken and some kind of robot helped him to repair neural networks. The robot has micromanipulators each of which could split into two which were twice smaller (like a recursive tree structure), then he started to work on AI, created brain-computer interface through these manipulators. Then, using this brain-computer interface with help of the robot he created AI. And they started to share mind with this AI through the brain-computer interface. Meanwhile, the engineer was becoming more and more senseless while the robot (AI) instead started to be more and more human. I read it about 5 - 10 years ago. It was quite short I was able to print it. And in my opinion, at that time, it was new. PS: Some american scientist with a Japanese last name was editor of this book.
I'm trying to remember the name/author of a novel I read a few years ago. The basic premise is the main character wakes up after being in hospital, to find a chunk of brain missing from a gunshot wound and a cybernetic implant being used to connect the missing synapses. The main character was the actual developer of the tech, and during the course of the novel he gradually works out who tried to kill him and stole the tech. The thief/attempted killer re purposed the tech as a robotic pest controller to try and patent the overall tech without being obvious it was the stolen tech. I think the novel was written in the early 2000's.
Is it posible to define a structure with a pointer to that type of structure? What I mean is: typedef struct { char* name; node* parent; } node; As far as I tried or read, I don't know how to do this or if it's even possible.
How can I have a pointer to the next struct in the definition of this struct: typedef struct A { int a; int b; A* next; } A; this is how I first wrote it but it does not work.
I am reading a file Java, using this code : File file = new File(--path-); Scanner reader= new Scanner(file); while(reader.hasNext()){ // i want to add here if reader.Next() == emptyline // I tried if reader.Next()=="" but it did not work. } thank you all
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 left a 5 pound block of sliced white American cheese in my car all day it was hot out like 75/80 it was very soft I put it in the frig is it still good to eat
If I left food out of the refrigerator for some period of time, is it still safe? If I left it out too long, can I salvage it by cooking it more?
I have a shapefile which contains a 20 hectare polygon. I want to demarcate 9,48 hectares from the entire polygon with a parallel. I can make the parallel line with the longer line but I can not do the incision... Can you help me how to do the incision?
I am new at using QGIS. How can I simply split features in QGIS? The manual tells to simply draw a line through the polygon you want to split. But it doesn't work. The line disappears when finishing it. When I select the polygon and then split it, it sometimes works and sometimes doesn't (an info appears after which it does not split the feature). Does anybody have an idea why the tool does not work properly?
I was recently typing up a short story essay when my computer's spelling & grammar check informed me that the sentence "What kind of things are in there?" should be written as "What kind of things is in there?" I am not sure which one is grammatically correct to use. I am sure, due to subject-verb agreement that my original was correct, but I am not sure.
Is it correct to say, "What kind of patents are being issued in these sophisticated times?" It seems like it should be What kind of patents is being issued..., but that sounds wrong. What kind of patent is being issued... is correct and sounds right, but loses a little bit of the original meaning. Is there something magic about what kind that allows it to be plural, or do people just misuse it a lot?
I am creating a drow ranger. They're at 3rd level, and it's my first time playing. Their attack score is proficiency + ability + other bonuses. They have Drow weapon training which includes shortswords, rapiers, and hand crossbows. My ranger class gives me simple & martial weapons training. Does that mean their attack score is (2+2) + ability + other bonuses?
In D&D 5e it is possible for a character to receive proficiency in the same skill, tool, weapon and/or armor more than once via Class, Race, and/or Background. Do any of these proficiencies stack, thereby allowing a character to receive their proficiency bonus more than once?
I am using the following code: \documentclass[11pt,a4paper,twoside]{book} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \usepackage{mdframed} \theoremstyle{definition} \newmdtheoremenv[linewidth=1.1pt]{Definition}{Definition}[chapter] \begin{document} \begin{Definition} (blah blah)\newline Text... \end{Definition} \end{document} which produces Is it possible to reduce the space between the first line of text and the upper black line? Thank you in advance!
I have seen several similar questions on TeX.SE of a similar nature, but none of them seem to address my precise issue. I have been working with mdframed environments for a while. I read that there were some issues with older versions, so I updated to the latest version, 1.9b, but it seems to have introduced a spacing issue that I did not have before. \documentclass{article} \usepackage{amsthm} \usepackage{mdframed} \theoremstyle{definition} \newmdtheoremenv{definition}{Definition} \begin{document} \begin{definition} This is a definition. \end{definition} \end{document} The output, zoomed in, is seen here: There is more vertical space above the contents than below. This only began after I fully updated my TeX distribution, so I assume that this possibly changed how mdframed works. Any ideas? Obviously I can manually change the spacing to fix this, but I'm looking to diagnose the problem, if there is one. Thanks in advance.
i am getting serious error in the production server when i deploy for the first time. Please find the below PDO exception which i am getting. PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in variable_set() (line 977 of /var/www/htdocs/includes/bootstrap.inc). I am not allowed to increase allowed packet size and wait timeout in the mysql end, because multiple sites are running on the DB and such a way we are not allowed to change php.ini also. Is there any other solution for this problem I am facing this issue with the client for past one week not it has been very critical for me. Could anyone please help me out to get ride of this issue? Thanke in advance.
Recently I started getting an error every time I try and add a content no matter what type. This is the error that shows up in the browser: Additional uncaught exception thrown while handling exception. Original PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT COUNT(cid) FROM {comment} WHERE status = :status; Array ( [:status] => 0 ) in comment_count_unpublished() (line 313 of /Applications/MAMP/htdocs/modules/comment/comment.module). Additional PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => php [:db_insert_placeholder_2] => %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:12:"PDOException";s:8:"!message";s:154:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT COUNT(cid) FROM {comment} WHERE status = :status; Array ( [:status] => 0 ) ";s:9:"%function";s:27:"comment_count_unpublished()";s:5:"%file";s:56:"/Applications/MAMP/htdocs/modules/comment/comment.module";s:5:"%line";i:313;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => ; [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => 127.0.0.1 [:db_insert_placeholder_9] => 1338336955 ) in dblog_watchdog() (line 154 of /Applications/MAMP/htdocs/modules/dblog/dblog.module). I also get the following error in my php error file: PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /Applications/MAMP/htdocs/includes/database/database.inc:2136 Stack trace: 0 /Applications/MAMP/htdocs/includes/database/database.inc(2136): PDOStatement->execute(Array) 1 /Applications/MAMP/htdocs/includes/database/database.inc(664): DatabaseStatementBase->execute(Array, Array) 2 /Applications/MAMP/htdocs/includes/database/database.inc(2315): DatabaseConnection->query('SELECT expire, ...', Array, Array) 3 /Applications/MAMP/htdocs/includes/lock.inc(167): db_query('SELECT expire, ...', Array) 4 /Applications/MAMP/htdocs/includes/lock.inc(146): lock_may_be_available('theme_registry:...') 5 /Applications/MAMP/htdocs/includes/theme.inc(447): lock_acquire('theme_registry:...') 6 /Applications/MAMP/htdocs/includes/bootstrap.inc(427): ThemeRegistry->set(Array) 7 [internal function]: DrupalCacheArray->__destruct() 8 {main} thrown in /Applications/MAMP/htdocs/includes/database/database.inc on line 2136 I am having a little trouble deciphering these error messages. Could anyone help me understand what's going on here?
Many years ago I read a short story about mankind searching the galaxy, hoping to find intelligent non-human life. After many millennia, on the opposite side of the galaxy, they think they have finally found an alien species, who have been undertaking the same quest. Later, DNA analysis reveals that the supposed alien race are actually descended from humanity, but evolved differently while going the opposite way around the galaxy. They initially conclude that mankind is alone in the universe, but then turn to look at the Andromeda galaxy, and say something like "No, we are alone in this galaxy". Anyone recognise this story?
I'm looking for a plot line (it should be a short story) that depicts Earth population (or their close descendants) establishing contact with another intelligent life form deep into space. After careful studying of DNA samples and language / communication symbols they then realize that the civilization in question is also from Earth but that they departed very long ago and travelled throughout the galaxy in the completely opposite direction so that they are now meeting practically at the point of the circle opposite to Earth. There might have been some anatomical differences as well. As far as I can remember, the story concludes shortly after that. This should be a work of a well-known SF author, so I'm hoping for a quick response (if time didn't corrupt my memory too much). I don't think it was part of an anthology, but it's entirely possible it was in a magazine. As for the timeline, I've read it about 2-3 years ago, but since I have a passion for older SF works it might not be of much use. Edit: Not sure if this could help but for what it's worth, it might be contained in .
I am not a native speaker and I find the following sentence pretty confusing. Ask any doctor — they'll all tell you that alcohol is a poison. Here the speaker is referring to any doctor. Why is they used instead of he/her? Or to put it in other words shouldn't the correct form of the sentence be as follows? Ask any doctor — he/she'll all tell you that alcohol is a poison.`
Is there a pronoun I can use as a gender-neutral pronoun when referring back to a singular noun phrase? Each student should save his questions until the end. Each student should save her questions until the end.
I'm curious to hear some opinions from serious physicists on this site as to why no top physicists have ever worked on Bohmian Mechanics. Except Bohm and Bell, the theory has received virtually no attention from the world's most elite physicists. It does receive a lot of attention from lesser known physicists, and they are not well respected. Bohmian Mechanics just seems like a much more sensible theory. All paradoxes completely vanish, no Schrodinger's Cat, no particles in two places at once, no nonsense about the moon only being there when you look at it. Why won't any heavyweights take this reasonable approach seriously?
Possible Duplicate: I've heard of De Broglie–Bohm theory a.k.a causal interpretation of quantum theory. The predictions match accurately with with the nondeterministic quantum theory. As a philosophy buff this one seems just like the classical universe. No funny new-age religion style gimmicks. So why don't people use this interpretation instead of the Copenhagen "magic" interpretation? P.S. I'm not an expert. I possess only superficial knowledge of quantum physics.
Is is true that $$\lvert a+b\rvert^2\geq (\lvert a\rvert-\lvert b\rvert)^2, \quad \forall a,b\in\mathbb{R} ?$$ Is there any related result, related to this inequality?
Consider following inequality: $|z_1 + z_2|\ge|z_1| - |z_2| \ \ \ \ \ \ z_1,z_2 \in \mathbb{C}$ Is that true always? I tried many examples and it was correct but I don't know how to prove that if it's right.
Let's assume I want to create a function first that returns the first element of an array in C. Obviously I want to create something that accounts for all types. I would start with this: int first(int list[]) { return list[0]; } Which works. Obviously... I would now like to do the same for char char first(char list[]) { return list[0]; } Which does not compile as there is already a first function in the program. How do you C guys handle this kind of scenarios? Is one forced to go with different names? int first_int(int list[]) { return list[0]; } char first_char(char list[]) { return list[0]; }
Is there any way to achieve function overloading in C? I am looking at simple functions to be overloaded like foo (int a) foo (char b) foo (float c , int d) I think there is no straight forward way; I'm looking for workarounds if any exist.
I've some interesting Q&A posts about programming in my personal blog and I would like to post these questions (and the respective answers) on Stack Overflow, because a lot of people can be helped (for real, you can't find the answers easily on the web). I know that users are encouraged to create self-answered questions, but can I create a self-answered question that is already available at my website? And my main question: can I link my blog as a reference for the answer of the question? Hope that I've made the question clear, but ask me if you don't get something.
It's that posting links to your own website is ok, but should there be a line drawn? There were several spam flags today for 's recent posts, presumably because they all link to his website. Initially I disagreed because his answers seem for the most part relevant to the question, but then I looked into it more and realized there's three things that set this apart from most of the related cases that have come up: This isn't an occasional thing -- he's posted in the last year This isn't a random blog he writes for a fun, it's a for-profit company he and makes money promoting I'm not willing to go through all 412, but from the sample I checked, he generally doesn't mention that the products he's recommending are his own. The site is linked from his profile, but most people aren't going to check that Is all this considered acceptable use, or are the spam flags accurate?
Trying to make something on my bukkit 1.8.7 server that detects a nether star in an inventory named "Nut Gem" with the lore "Gem used to summon Nut", which will then try to remove the nether star from your inventory. For some reason it will not clear the item I need it to, but it does clear any normal nether stars. I am using /clear @a nether_star 1 0 {display:{Name:"Nut Gem",Lore:["Gem used to summon Nut"]}} Now found out that this is a problem with bukkit! Not sure why but it works in single player but not in bukkit servers(at least this version). Any info on how to fix this would be appreciated!
Recently I've been messing around with making a few minigames, and have used a few plugins to help make it easier to create and run them. However, a newer one I'm making requires me to use the /summon command in order to spawn zombies. However, no matter what I put in, I can't spawn hostile mobs. All other entities still spawn perfectly fine. Strangely, the /spawnmob command which comes with Essentials can summon hostile mobs fine. I would rather use /summon since it's more customizable though. Here's a list of plugins I have installed. Essentials EssentialsChat HolographicDisplays PermissionsEx setspawn [A plugin I have made, just a simple timer] Vault VoxelSniper WorldEdit WorldGuard Please let me know if you have any ideas on what I'm doing incorrectly or isn't functioning the way it should.
I feel like there is some silly syntax error going on here but I can't for the life of me figure it out. I am trying to sort a big list using multiple properties. Method A: IOrderedEnumerable<myClass> orderedList = myList.OrderByDescending(e => e.Tier); orderedList = orderedList.ThenByDescending(e => e.Priority[0].Value); orderedList = orderedList.ThenByDescending(e => e.Priority[1].Value); orderedList = orderedList.ThenByDescending(e => e.Priority[2].Value); orderedList = orderedList.ThenByDescending(e => e.Score); Method B: IOrderedEnumerable<myClass> orderedList = myList.OrderByDescending(e => e.Tier); for (int i = 0; i < 3; i++) { orderedList = orderedList.ThenByDescending(e => e.Priority[i].Value); } orderedList = orderedList.ThenByDescending(e => e.Score); The above Method A works perfectly, but Method B (the way I need to do it) keeps returning an index out of range error, even though it should be the exact same (i.e. 0, 1, 2) In both instances e.Priority represents a list of 3 KeyValuePairs. I don't understand why Method B is returning an out of range error.
I met an interesting issue about C#. I have code like below. List<Func<int>> actions = new List<Func<int>>(); int variable = 0; while (variable < 5) { actions.Add(() => variable * 2); ++ variable; } foreach (var act in actions) { Console.WriteLine(act.Invoke()); } I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s. It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output. Is there a way to work round this limit to have each action instance have its own captured variable?
I had a piece of code. compareScanMz = new Comparator<Triplet>() { @Override public int compare(Triplet o1, Triplet o2) { int scan1 = o1.scanListIndex; int scan2 = o2.scanListIndex; int scanCompare = Integer.compare(scan1, scan2); if (scanCompare != 0) { return scanCompare; } else { int mz1 = o1.mz; int mz2 = o2.mz; return Integer.compare(mz1, mz2); } } };` In the code I am able to figure out the other statements, but am unable to get the first one. i.e: compareScanMz = new Comparator() What does this statement mean?
What is the use of anonymous classes in Java? Can we say that usage of anonymous class is one of the advantages of Java?
I have this example public class AClass { public class BClass { public string name; public string id; } } now i want to make an intsance of Aclass public class Program { public static void Main() { AClass newitem = new AClass(); } } but i haven't access to the properties of BClass with the object newitem. How can achieve that with an instance of AClass?
Say if I have a dropdown in a form and I have another nested class inside of this class . Now what's the best way to access this dropdown from the nested class?
How do I make a HashMap, that maps Integer or int to a class instance of a class that extends a specified Class: public HashMap<Integer, ? extends myClass> myMap = new HashMap<Integer, ? extends myClass>(); This gives a error: Cannot instantiate the type HashMap<Integer,? extends mySuperclass> (by Eclipse) I am not too experienced with Java and I really appreciate your answers. To make this a little bit more obvious, this is a short image explaining what I want to achieve: Trying to add a class that does not extend that Superclass should not work. I'm really sorry if this has been asked already but I tried searching for a couple of terms and could not find a similar question. There was quite similar, but I did not understand what the accepted answer said and I don't think it was even the question I am asking here.
I have a couple of questions about generic wildcards in Java: What is the difference between List<? extends T> and List<? super T>? What is a bounded wildcard and what is an unbounded wildcard?
I did lasso regression for feature selection, and then I test the significance using logistic regression. But I wonder if I should do logistic regression after lasso regression, if not I don't know how to interpret my results. I did lasso regression in R using glmnet package.
[A similar question was asked with no answers] I have fit a logistic regression model with L1 regularization (Lasso logistic regression) and I would like to test the fitted coefficients for significance and get their p-values. I know Wald's tests (for instance) are an option to test the significance of individual coefficients in full regression without regularization, but with Lasso I think further problems arise which do not allow to apply the usual Wald formulas. For instance, the variance estimates neded for the test do not follow the usual expressions. The original Lasso paper: suggests a bootstrap-based procedure to estimate the coefficients variance, which (again, I think) may be needed for the tests (section 2.5, last paragraph of page 272 and beginning of 273): One approach is via the bootstrap: either $t$ can be fixed or we may optimize over $t$ for each bootstrap sample. Fixing $t$ is analogous to selecting the best subset (of features) and then using the least squares standard error for that subset What I understand is: fit a Lasso regression repeatedly to the whole dataset until we find the optimal value for the regularization parameter (this is not part of the bootstrap), and then use only the features selected by the Lasso to fit OLS regressions to subsamples of the data and apply the usual formulas to compute the variances from each of those regressions. (And then what should I do with all those variances of each coefficient to get the final variance estimate of each coefficient?) Furthermore, is it correct to use the usual significance tests (for instance Wald's test which makes use of the estimated betas and variances) with the Lasso estimates of the coefficients and the bootstrap-estimated variances? I am fairly sure it is not, but any help (use a different test, use a more straightforward approach, whaterever...) is more than welcome. According to the answers I suspect inference and p-values just cannot be obtained. In my case, p-values are an external requirement (although the use of L1 regularization was my choice). Thanks a lot EDIT What if I fit an OLS logistic regression using only the variables selected by a previous run of the Lasso logistic regression? Apparently (see ), There's no need to run the model again after doing cross-validation (you just get the coefficients from the output of cv.glmnet), and in fact if you fit the new logistic regression model without penalisation then you're defeating the purpose of using lasso But what if I do this with the sole purpose of being able to compute p-values while keeping the number of variables low? Is it a very dirty approach? :-)
After creating the admin user on a new build server, I create the builder user via the command-line using Ansible. gitlab-runner is installed via brew and a launch daemon plist starts the service automatically as the builder user. Unfortunately, gitlab-runner hangs when git fetching changes until I manually log-in the builder user account via Remote Desktop one time and click through the first-time setup of the user account. After the initial login, you can logout, reboot and everything just works after that. Since I have a workaround of logging in the first-time through the GUI to complete the setup of the builder user is there a way to get the macOS Mojave to do whatever it does during the first login via the command-line? gitlab-runner.plist For completeness, I'm providing the /Library/LaunchDaemons/gitlab-runner.plist file <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>SessionCreate</key><true/> <key>KeepAlive</key><true/> <key>RunAtLoad</key><true/> <key>Disabled</key><false/> <key>Label</key> <string>gitlab-runner</string> <key>UserName</key> <string>builder</string> <key>GroupName</key> <string>staff</string> <key>ProgramArguments</key> <array> <string>/usr/local/opt/gitlab-runner/bin/gitlab-runner</string> <string>run</string> <string>--working-directory</string> <string>/Users/builder</string> <string>--config</string> <string>/Users/builder/.gitlab-runner/config.toml</string> <string>--service</string> <string>gitlab-runner</string> <string>--syslog</string> </array> </dict> </plist>
How do you make a script or app to run or stop running automatically when the system is booted, a user logs on, at a specific time, when a disk is attached, etc.?
I am looking for an opensource web based metadata management tool for geographic data. I have gone through a related question: First of all it was asked six years ago. And it recommends tool like Geonetwork. Geonetwork at first looked promising but has several issues while installing (tried on windows). i am unable to install it despite asking for help on several forums. I have gone through this link listing quite a few tools : If anyone has had experience with any of it kindly share.
I am looking for a free open source ISO metadata editor for the development of an enterprise database. It will mostly be used for documenting shapefiles and GeoTIFFs. Hoping that it will be an intuitive software since a range of skill levels will be working with it. Any suggestions?
Dear fellow Ubuntu users, for two years now I've been using Ubuntu. Although I love the system, it's quality is going downhill, steeply. Every new update (12.10, 13.04, 13.10) the issues only seem to get worse. Now my system laggs every other minute (freezes for a couple of seconds) and is unresponsive at times. Firefox, for example, seems to crash every 10 minutes (but only for a few seconds where a grey zone overlays the whole browser window). I figured my issues could be due to Unity failing as I found many people on the internet with the same conclusion so I exchanged Unity for Gnome only to discover that it didn't fix anything (it actually added to the problem). A second guess would have been a malfunctioning or slow HDD, running a benchmark yielded following results: /dev/sda: Timing cached reads: 2 MB in 6.42 seconds = 319.19 kB/sec Timing buffered disk reads: 2 MB in 4.38 seconds = 467.79 kB/sec Which is extremely strange since I wouldn't expect cashed reading to be slower than buffered reading. So having said this, can anyone tell met whether I should be on the lookout for a new HDD or whether my OS is in fact failing? Working for school has been extremely annoying with a laggy system like this and I desperately need a fix here. What I have tried/done: HDD benchmark installing GNOME rather than Unity Reinstall every Ubuntu OS from 12.04 to 13.10, Thanks in advance!
What are your tips for improving overall system performance on ubuntu? Inspired by this I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster. This is not meant to be application specific (e.g. make firefox load pages faster), but system wide. Preferably 1 tip per answer, with enough detail for people to implement it. A couple of mine would be: Install (via Software Center or sudo apt-get install preload); Change value - "which controls the degree to which the kernel prefers to swap when it tries to free memory"; What are yours? PS: Since this is not intended to have a unique answer but rather, several useful tips, I'm making this community wiki out-of-the-box.