I have a flex container with flex children inside of it. In every flex-child there are 2 divs on top of each other, first one is with unknown height. I want to make the second div's height to fill the whole remaining height. Everywhere I look I see flex solution, but I don't know how to implement it since parent of the 2 divs is flex-child itself. The whole case is more complex, but I'll try to simplify code here:

     ...more flex children...
  And putting ".auto-height" div inside ".i-want-this-one-to-fill-remaining-height" is not an option at this moment. Please help :) Thank you! EDIT: I've made a full Fiddle:  EDIT-2: Solved! Thank you for your suggestions! Here's the fiddle with the solution:

I am working on a web application where I want the content to fill the height of the entire screen.  The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom.  I have a header div and a content div. At the moment I am using a table for the layout like so:  CSS and HTML    #page {     height: 100%; width: 100% }  #tdcontent {     height: 100%; }  #content {     overflow: auto; /* or overflow: hidden; */ }

...

...

     The entire height of the page is filled, and no scrolling is required.  For anything inside the content div, setting top: 0; will put it right underneath the header. Sometimes the content will be a real table, with its height set to 100%. Putting header inside content will not allow this to work.  Is there a way to achieve the same effect without using the table?  Update:  Elements inside the content div will have heights set to percentages as well. So something at 100% inside the div will fill it to the bottom. As will two elements at 50%.  Update 2:  For instance, if the header takes up 20% of the screen's height, a table specified at 50% inside #content would take up 40% of the screen space. So far, wrapping the entire thing in a table is the only thing that works.


Situation:  I am composing this phrase for a real forum discussion in person:   There are a large number of proverbs/idioms in English (and doubtless additional ones in American). Some are entirely regional and if you don't live in that region you are unlikely to hear them.  It is not easy either sometimes when you associate the situation that includes a cultural background [when you translate/interpret the Indo cultural things for Westerner you will find it].  Thank you.  Question: Any recommended advise whether I should use: "There is a large number" OR "There are a large number"?

Formally, is it correct to write:     A number of questions has been asked here.   or:     A number of questions have been asked here.   As a non-native speaker of English, I would prefer the former: the subject seems to be "number", therefore the verb ought to be singular, I'd say. However, the latter seems more common, and therefore I believe that my gut feeling is just plain wrong — but I would really like to have a definite answer.  Moreover, is it the same for "a myriad of", "a plethora of", and so on?


I'm using ArcGIS Desktop 10.6.1 with PostgreSQL 10.3/PostGIS 2.4 and would like to edit PostgreSQL polygon features regardless of client (QGIS/ArcGIS desktop) without having to create an ArcGIS Enterprise Geodatabase.  How can I create a PostGIS database where edits are possible in ArcGIS Desktop?   Note as a test with a different method - I've created a Postgres database (with PostGIS extension enabled), then created an ESRI Enterprise geodatabase on top of this, created a "data_manager" user/schema and proceeded to import a layer (with pg geometry keyword) where I can edit in ArcGIS and QGIS.  However if a QGIS user creates a spatially enabled table in the data_manager schema, it's not registered with the geodatabase in ArcGIS.  Old/related posts (no longer relevant) due to changes of read/write at ESRI Desktop 10.4 then again at 10.6:

I have been working with QGIS/PostGIS for a while now, without problems, but now I have to change QGIS for ArcGIS Desktop 10.1.  I am having trouble adding a layer from PostgreSQL and being able to edit that layer. I want to work directly with the database, and if I change something in the map it should be reflected on the database.  Can I do this without a Geodatabase?


I am doing a gene expression analysis on blood samples collected from the same 8 goats. My sampling points are before LPS-treatment (0h), and 1h, 2h, 5h and 24h after treatment. I want to compare the mean expression of each post-treatment to the before-treatment values. Due to problems in RNA-extraction, one sample is missing at 1h and one sample is missing at 2h. Is it possible to do a paired t-test with unequal sample size? E.g n=8 at 0h and n=7 at 1h/2h?   I'm using log2 transformed data for the statistical analysis. (We are have decided not to correct for multiple comparisons, but we use a fold-change limit instead)

An investigator wishes to produce a combined analysis of several datasets.  In some datasets there are paired observations for treatment A and B.  In others there are unpaired A and/or B data.  I am looking for a reference for an adaptation of the t-test, or for a likelihood ratio test, for such partially paired data.  I am willing to (for now) to assume normality with equal variance and that the population means for A are the same for each study (and likewise for B).


In ubuntu 17.04 and earlier, a middle-click on the calculator icon in the launcher would start another instance of it, like it still does for most other programs. This does no longer work in 17.10/18.04 - how can I restore the old behavior?  (I know that I can open a terminal and type gnome-calculator but that is too cumbersome)

I need multiple calculators at the same time. But when I click on the calculator icon it just refers to the one that is already opened.  How can I do this in Ubuntu 18.04?


So... I just got a new hat today. I can't understand how I got it, and since it's secret hat (which is also weird), it doesn't show up in the "WinterBash 2014" page. It's called "Fascinating" hat, and I'm wearing it now.  Any idea?

So far, I've unlocked one of the secret hats. I'm wondering what other secret hats are out there and how to earn them?


I don't understand why the probability of getting a type I error when performing a hypothesis test, isn't affected. Increasing $n$ $\Rightarrow$ decreases standard deviation $\Rightarrow$ make the normal distribution spike more at the true $µ$, and the area for the critical boundary should be decreased, but why isn't that the case?  (Cross posted on .)

If I run the R code below, it will generate two independent vectors then test them to see if they are related in some way (i.e. p-value < 0.05).  If I repeat this 1,000 times, then 50 of these (5%) will have a false positive, with a p-value < 0.05. This is a type 1 error.  If we increase sampleSize to 1000, or even 100,000, the results are the same (5% false positives).  I am struggling to understand this, as I would have thought that if we collected enough samples, the chance of a false positive would drop towards 0 (just like correlation).  So, I guess my question is: "How is it possible that the number of false positives, based on p-values generated from comparing two independent datasets, be independent of sample size?".  # R code to demonstrate that with a large dataset, we can still  # get significant p-values, purely by chance.  # Change this to 1000, and we still get the same number of false positives (50, or 5%). sampleSize = 20  cat("Sample size:",sampleSize,"\n")  set.seed(1010093) n=1000 pValues <- rep(NA,n) for(i in 1:n){     y <- rnorm(sampleSize)     x <- rnorm(sampleSize)     pValues[i] <- summary(lm(y ~ x))$coeff[2,4] } # Controls false positive rate fp = sum(pValues < 0.05) cat("Out of ",n," tests, ",fp," had a p-value < 0.05, purely by by chance.\n",sep="")  ----output---- Running "true positives - none.R" ... Sample size: 1000  Out of 1000 tests, 52 had a p-value < 0.05, purely by by chance.


I don't have enough reputation in the Stackoverflow community. So whenever I try to downvote a public post, there is a blue message which says:     Thanks for the feedback! Votes cast by those with less than 125 reputation are recorded, but do not change the publicly displayed post score.   However this is confusing because I can still upvote posts. I am just not allowed to downvote. This message should instead say:  Thanks for the feedback! Downvotes cast by those with less than 125 reputation are recorded, but do not change the publicly displayed post score.  This is just a small thing to change.

I have found that if I upvote an answer, it gets upvoted, but if I downvote I receive a message that the vote is hidden until I have sufficient reputation points.  Here's an example from an answer on  - on which I have .  If I upvote:    It simply gets upvoted - isn't that nice!  The trouble is if I downvote an answer, I get a message saying my vote is hidden until I have 125 reputation points:    And here is an example of a question on , on which I have :      So either this is a straightforward network-wide bug, or this is a Stack Exchange policy to hide downvotes from users with less than 125 reputation points - in which case perhaps the wording of the message is ambiguous?


I think this movie is from the early 2000. A man goes on a quest to get something for his girlfriend/wife?               The quest start with him need to defeat an old man who is a martial arts master. After that I only know some vague details.  There are witches who 'fast travel' with candles. I also believe there is a assassin? who has killed his brothers and they follow him as ghosts.  And at some point the main protagonist runs in to pirates who capture him but after he finds out the captain is cross dressing they become his allies.  Somehow the movie title Starfall stuck with me but I can't find a movie with that name.

Yes, the plot is pretty weird. There is this "star" (whose incarnation is a woman dressed in white) and some random guy who falls in love with her. There's the arc of "if you cross a specific border you'll die" which applies to our lady "star". Well, I also remember that they have some kind of a tubular case, and when one opens it, lightning files out.  I watched the film somewhere around 2010, it's in English and when I try to remember it, I get the vibe of a mediocre Hollywood fantasy romance.


I would like to have the Unity launcher appear on both of my monitors. If the launchers could be configured to show only the windows active on their respective monitors, that would be even better.  How would I go about doing this?

I use a large monitor as primary and laptop screen as secondary. Is it possible to move the launcher to my big monitor or do I have to turn off my laptop monitor?   "Monitor Preferences" (Launcher search -> "Monitors") does not have a way to set the default/primary monitor. nvidia-settings which I just installed says "You do not appear to be using the NVDIA X driver. Please edit your X configuration file (just run nvidia-xconfig as root), and restart the X server.  sudo nvidia-xconfig says sudo: nvidia-xconfig: command not found.  I guess I don't have an AMD driver because I don't have "AMD Catylist Control Center" in the launcher search.


My desktop has been hijacked by ransomware. They won't let me reach the login screen. Even tried safe mode, but I can't get past the virus. I have a bootable linux mint USB, can I boot it on the PC and scan for viruses? If so, how? The data has not been encrypted, I am lucky enough.

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


I think i have two event listeners in conflict, in my js file i have a click listener made like:  document.getElementById('sidebar').addEventListener('click', function(et) {   et.preventDefault();    var item = et.target.closest('.inner');     if (item) {     // etc.   that checks all clicks made over the sidebar, if the item clicked is that with class .inner then do something.  now when i'm trying to set a on hover listener on list items in the same sidebar with:  $('.list-item').on('mouseenter', function(eee){   console.log('entered'); }).on('mouseleave', function(eee){   console.log('left'); });   it doesn't work. same code placed on the logo for instance works fine. So i'm thinking it may be a conflict with the first code shown above, is it or must be something else?  SOLVED:  I was creating .list-item after 1000ms from page load with a setTimeout function, so despite the jquery .on method which is sort of a delegate from my understanding, the setTimeout was still able to mess it.  I now placed the code inside the timout and works.  $(window).on('load', function(){        setTimeout(function(){         // other code          $('.list-item').on('mouseenter', function(eee){           console.log('entered');         }).on('mouseleave', function(eee){           console.log('left');         });       },1000);  });

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.


Somebody I know online has been writing a story where he’d like to name the system where gods rule, but a church isn’t involved. He used “deiocracy,” but we both agreed that’s one, made up, and two, a hircocervus monstrosity of Latin and Greek together. Are there any words that can be used for rule by gods, but not by their church?

I'm familiar with most -ocracies. And I don't mean a theocracy (rule by religious officials). This would probably make more sense in a fantasy setting (say D&D) where deities actually come down and mess around with the mortals. However if one (or more) deities took it upon themselves to rule, what would this be called?


Let A be a subset of {1, 2, 3 ... 2n-1, 2n} containing n + 1 elements Show that:  a) some two elements of a are relatively prime b) some two elements of a have the property that one divides the other  I am assuming that we have to use the pigeon-hole principle here but I have no idea how to use it in this particular situation.

Let $n$ be greater or equal to $1$, and let $S$ be an $(n+1)$-subset of $[2n]$. Prove that there exist two numbers in $S$ such that one divides the other.   Any help is appreciated!


I have a Ubuntu VPS in Singapore region and I have players who are going to play in my Indian Tournament.  My Indian server accepts only Indian traffic to protect from DDoS.  My players want to play from different location.  So is it possible that Players get connected to Singapore VPS and then   VPS's IP is spoofed to some Indian IP and they can play on my server ?  Server is hosted on UDP port 27000  Here latency doesn't matter.  How do I achieve it ?

I want to spoof my internet ip on my Ubuntu 10.10 system so that I can access country specific websites. Can some one please tell me how to go about this?


How would you arrange for a shell script to be executed in a child process, while still being able to change the current directory of the invoking shell?

I want to run a script to simply change the current working directory:  #!/bin/bash cd web/www/project   But, after I run it, the current pwd remains unchanged! How can I do that?


I have a shell script (let's call it parent.sh) which calls another shell script (child.sh), passing it an argument.  The child script does some work and sets a value in a variable called create_sql. I want to access this create_sql variable from the parent script which invoked it.   I am calling the child script from within the parent script like this:  ./child.sh "$dictionary"  and straight afterwards I have the line:  echo "The resulting create script is: "$create_sql  However, there is no value being output, however, in the child script I am doing the same thing and the variable is definitely set.  How can I get this to work so that I can read variables created by the child script?

I have a bash script which must call another bash script which varies per-user in order to get some configuration information, like so:  somescript:  #!/bin/bash ${HOME}/.ssconfig echo "Hello, ${VARIABLE}!"   ~/.ssconfig  #!/bin/bash VARIABLE=world   Which, instead of giving me Hello, world! as expected, gives me Hello, ! How can I pass variables up from a script to the one that called it?


In general I find the financial term "securitization" written with "z", but in some Basel Committee documents I've found "securitisation" with "s".  I think it is more common the term with "z", may I use it if I write in British English?  In particular I'd like to know if it is OK if I use the "z" form for this term while I'm using "s" form for other non-financial terms.

I have trouble understanding why some words change "s"-es to "z"-s from BE to AE and some not. For example:   analyse -> analyze characterise -> characterize hypnotise -> hypnotize   But:   compromise -> compromise   Is there any rule to this?  Slightly related:


The sea stone, which is the weakness of devil fruit users, was said to have the same power as the ocean, and it was said that the sea rejected the devil fruit users. I understand that devil fruit users can't swim, but if they were standing in a river or fresh water of any sort, would they still lose all their strength and be unable to do anything? I tried to search for it, but they closed it and archived it, so can anyone help please?

If a Devil Fruit user goes to a bathtub full of water or gets into a spa, will he drown?


I am trying to install Text::CSV, because can't install using cpan Text::CSV it's therefore need to install CSV.pm manually for my server. The error is below.  Can't locate Text/CSV.pm in @INC (you may need to install the Text::CSV module)  so I would like to download that full source file manually does anyone know where can I download that file?

I get this error:  Can't locate Foo.pm in @INC  Is there an easier way to install it than downloading, untarring, making, etc?


While reading Ernst Kunz's commutative algebra book, I came across this problem:     Let $K$  be an infinite field, and $V \in\mathbb{ A}^n (K)$ (the affine n-space) be a finite set of points. Show that the ideal of $V$, i.e. {$f(x_1,\dots,x_n) : f(p) = 0 \forall p\in V$} is generated by exactly n polynomials.   For $|V| = 1$ this is obvious, since the ideal $(x_1 - a_1, ..., x_n - a_n)$ works. The book says to use interpolation as a hint, but I have no clue how to use it (to be honest, being a pure math student I haven't handled interpolation in my life). Thanks in advance.

I am reading Gathmann's free online notes on Algebraic Geometry. One exercise asks to show that     "Every affine variety in $\mathbb A^n$ consisting of finitely many points can be written as the zero locus of $n$ polynomials".    There is a hint says "interpolation". I don't know how to start with the hint.   If $n=2$, we can use interpolation to get 1 polynomial for finitely many points. But we need to show 2 polynomials instead. I am also not sure how to apply interpolation for higher dimensions. Anyone can help? Thank you!


How is $\displaystyle\lim_{n\to\infty}{(1+1/n)^n} = e$? Please help by letting me know why in a very simple way. Thank you.

I was recently thinking about how I could evaluate the famous limit of 'e' as I haven't ever seen a proof. I can't really find anything online so I've tried to evaluate the limit myself. And I was also thinking it would be nonsensical to use L'Hopital's rule, am I right?  So I did the following:  $$\lim_{n \to \infty} \left(1 + \frac{1}{n} \right)^{n} = \exp \left(\lim_{n \to \infty} n \cdot \ln \left(1 + \frac{1}{n} \right) \right)$$  $$=\lim_{n \to \infty} \exp \left( n \cdot \left( \frac{1}{n} - \frac{(1/n)^{2}}{2} + \cdots \right) \right)$$  $$= \lim_{n \to \infty} \exp \left( 1 - \frac{(1/n)}{2} + \cdots \right)$$  $$= e$$  I am not sure, is my logic correct or does it create circularity by taking logarithms and assuming $$f(x) = \exp \left( \ln f(x) \right)$$ ?


Is there a way to display the name of the used CRS in the layout?  The expression "project_crs" displays the code of the used CRS but I'd like to use the common name of the reference systems.  This question was asked and answered before as , however the api the answer used changed with QGIS 3.0 and the solution is not valid anymore.

I would like to know if there is a way to add a dynamic coordinate system field into a QGIS composer layout.  I can use an expression to add many items such as document name, file path, etc but I can;t seem to figure out how to add the coordinate system?


The Sun, as we all know, is white. Because our atmosphere scatters light the sun appears yellow to us hear on earth. So, why isn't the moon also yellow. Doesn't our atmosphere scatter its light. How about those little stars in the night sky, they don't look yellow.  I have heard the explanation that "the moon is dim and mostly stimulates the rods in our eye and not cones" but that's impossible! The moon does look orange/yellow when its low in the sky due to our atmosphere. So, why isn't it bright yellow when its up above our head like the sun? Same thing with the stars. Whats going on with the light?

Just what the title states; and this isn't an original question:  On full-moon, moonlight is almost as bright as mid-dawn; yet there is hardly any colour visible. This is not the case with sunlight.   I'm curious to know why this is the case.


If moon travels with constant speed in one direction and earth gravitation causes constant acceleration in perpendicular direction why moon does not eventually fall into earth? I mean if gravitation causes moon to fall faster each second (10m/s2) shouldn't after time velocity toward earth be big enough to cause it to fall ?

Why doesn't the Moon fall onto the Earth? For that matter, why doesn't anything rotating a larger body ever fall onto the larger body?


I install ubuntu 14.04 last night, every is fine except the trouble in installing kingsoft office which is widely used in China, I googled a lot, nothing happened. Has someone succeeded in using it?

Can Kingsoft Office be installed in Ubuntu?


A common notion is that there is another universe in the other side of a black hole, past the singularity point....is this true?  does it have any scientific support?

I know that there's no evidence at this point for "white holes" however would it even be mathematically possible for a black hole to be connected to a white hole (total opposite so everything would be expelled, after some really extreme physical conditions)? Maybe with a wormhole connecting them? If this was even possible (if the black hole or connection could actually be created and be stable enough), would that matter be expelled into a different universe, etc? Maybe even a different region of spacetime? Just curious, as it would be a cool idea.


I am a student in Undergraduate Mathematics, and I'm struggling to number theory ... I have this problem gcd, and do not know how to do it, and still do not study, congruences, Diophantine equations or, among other matters more advanced ... I'm used to divisibility, and some properties and/or theorems gcd ... Help me, please ...  question a) Show that if   $(a, b) = 1$, $\Longrightarrow$ $(a · c, b) = (c, b)$.

Suppose $\forall (a;b;c;d) \in \mathbb{Z}^4$ as $\gcd(a,b)=\gcd(c,d)=1$:  How can I prove that $\gcd(a,bc)=\gcd(a,c)$?  Also, how to prove that $\gcd(ac,bd) = (\gcd(a,d))*(\gcd(b,c))$?


I find a good books for number theory...  An Introduction to the Theory of Numbers (by G.H hardy)or Burton, Rosen..etc  is it good?? (i want a book which best of best in number theory)  i want a lot of theorm and background. etc.  (level is under~~graduate)

Books on Number Theory for anyone who loves Mathematics?(Beginner to Advanced & just for someone who has a basic grasp of math)


<channel>   <title>Company</title>   <link>http://www.ndroid360.com/companypms/index.php/main_con</link>   <description>Companypms - By Keyur Modi </description>   <language>en-us</language>   <image>     <title>Company</title>     <url>http://www.ndroid360.com/companypms/public/admin/dashboard/images/keyur.jpg</url>     <link>http://www.ndroid360.com/companypms/index.php/main_con</link>     <width>90</width>     <height>36</height>   </image>   <item>     <title>Project Add</title>     <link>http://www.ndroid360.com/companypms/index.php/main_con</link>     <description>       OK, modi sarkar     </description>   </item>   <item>     <title>A Post Title</title>     <guid isPermaLink="true">http://www.mydomain.com/file-location/</guid>     <link>http://www.ndroid360.com/companypms/index.php/main_con</link>     <pubDate>Wed, 30 Apr 2009 23:00:00 +1100</pubDate>     <description><![CDATA[
This is a brief summary of the post, so tempting that noone  will be able to resist clicking through.
 ]]></description>    </item> </channel>   I want to put an image after second <item></item>-tag. What can I do?

I'm currently using  but it sometimes falls over when the RSS or Atom feed isn't well formed. Are there any other options for parsing RSS and Atom feeds with PHP?


I came across this function with arguments like this. I am wondering what does the ^ mean in here.  bool GetDeviceInformation(String ^ port, LibCECConfiguration ^configuration, uint32_t timeoutMs){}   Cheers, Lan

I just came across this code and a few Google searches turn up no explanation of this mysterious (to me) syntax.  Hashtable^ tempHash = gcnew Hashtable(iterators_);  IDictionaryEnumerator^ enumerator = tempHash->GetEnumerator();   What the heck does the caret mean? (The gcnew is also new to me, and I asked about that .)


What is the correct verb form to use here?     I recommend that Company X adopt Y.   or     I recommend that Company X adopts Y.

I'd say Microsoft have a way of bending the rules and I know that McLaren have won the championship. While this sounds strange, I believe it is correct English (sorry, I'm not native).   But when it's a small company, would you still use it this way? Is a company always plural, or are small companies singular? I.e., would you say Bakery Johnson makes fine bread or Bakery Johnson make fine bread? Is it My book seller, Woody's, have moved or is it has moved?


This problem is very similar to:   So $b$ is a multiple of $a$ and $c$ is $a$ multiple of $b$ $$bk_1 = a$$ $$ck_2 = b$$  But how do I get $ a \mid (bx +cy)$ out of it? I mean, if I substitute I get:  $$\frac{ck_2k_1}{a} = 0$$  out of it.

As the title says, if a number is divisible by a number, is it always divisible by that number's factors?  An example being that $100$ is divisible by $20$, it is also divisible by $10, 5, 4, 2$ as well?  Does this always apply?


I have seen ^ this thing in C++ object declaration as    Bitmap^ image1;   but I cannot understand what it means, I tried to find it over google but cannot!

I was reading Ivor Horton's Beginning Visual C++ 2008 and many of its CLR examples have this definition for main:  int main(array<System::String ^> ^args)   I went back, page by page, to the beginning of the book to find the first such instance with an explanation what it really means, but couldn't find one.  Obviously it means the same as the standard int main(int argc, char *argv[]), but I'd like to know when and why that ^ is really used, and why it even exists (does it do something that pointers * and references & cannot represent)?


I am very confused about how to compute  $$\sum_{n=0}^{\infty}nk^n.$$  Can anybody help me?

How can I evaluate $$\sum_{n=1}^\infty\frac{2n}{3^{n+1}}$$? I know the answer thanks to , but I'm more concerned with how I can derive that answer. It cites tests to prove that it is convergent, but my class has never learned these before. So I feel that there must be a simpler method.  In general, how can I evaluate $$\sum_{n=0}^\infty (n+1)x^n?$$


at the moment I'm developing in a more "uncool" kind: I write my stuff and see if this works with manual interaction. (For the most time I'm writing java based webapps)  I know that unit-testing would cut some of the bugs I meet in devtime but to be honest: I dont know how go with unittesting. Especially I don't really have a clue how I test respectively split my code in small units which can ran in Junit or something.   I really would appreciate it if someone could point me literature, blog or tutorial to get a little deeper into this topic or much better: Maybe you can share some of your experiences.  Cheers and regards

Unit testing is, roughly speaking, testing bits of your code in isolation with test code. The immediate advantages that come to mind are:  Running the tests becomes automate-able and repeatable You can test at a much more granular level than point-and-click testing via a GUI    My question is, what are the current "best practices" in terms of tools as well as when and where to use unit testing as part of your daily coding? Lets try to be somewhat language agnostic and cover all the bases.


I am reading about "flip flop" circuits (and I've bought one as an integrated circuit to mess with). When it says that when the SET goes high, then Q (output) will be high, what is "high" in relation to? Could I feed in -5v and call that low, while 0v is high? Or connect +5v and call that high and 0v low? Or are flip flops usually biased so that they expect a positive or negative voltage at their terminals?  The IC that I bought has the following terminals: SET, RESET, DATA, CLOCK, Q and Q(with bar over it).

In a circuit involving integrated circuits, the documentation for the ic often states that if a pin is in logic 1 or high the circuit will behave in one way, and if the circuit is in logic 0 or low the circuit will behave in another way.  One example i found was experimenting with the 4029 CMOS Counter ic  on the up/down and dec/bin pins. What i don't understand, is what the pin that is set either high or low should be connected to i would assume it would be the positive supply voltage, the negative supply voltage, or neither, but i can't seem to figure out which one.


How can I convert a shapefile (GIS) to text, or, how can I extract the information in a shapefile?

I have a Shapefile with several shapes inside it.  Using MapWindow I have been able to determine that the shape I need is the one with shapeId 19.  As you can probably tell I have very little experience with GIS in general but I think I have come to the right place to ask for help.  What I need is to extract all the lat/long coordinates that determine the shape.  Is it possible to do this using MapWindow or do I need to use some other software?  If more information is needed to help, please comment and I will update as soon as possible.  Any help is appreciated as this is driving me crazy!


Here's a problem which I thought to be lacking an additional condition. So I imposed the condition and presented my solution. Please check whether it can be done without the additional condition. Thank you.     The Problem : Let $f,g:\mathbb{R} \to \mathbb{R}$ be differentiable. Assume that $f(0)=g(0)$ and $f'(x) \leq g'(x) ~\forall~ x \in \mathbb{R}$. To show that $f(x) \leq g(x) ~\forall~ x \geq 0$.   If we impose the condition that $g'(x) \neq 0 ~\forall~ x>0,$ then it is a quick consequence of .  For every $x > 0, \exists c \in (0,x)$ such that $$\frac{f(x)-f(0)}{g(x)-g(0)}=\frac{f'(c)}{g'(c)} \tag{1}$$  The right hand side of $(1)$ is $\leq 1$ because of given assumption. Coupled with the fact that $f(0)=g(0),$ we have the desired result. $\blacksquare$  What can I do when $g'(x)=0$ at some points of $(0,\infty)??$

I have to do the following exercise:     Let $f$ and $g$ two differentiable functions such that $f(0)=g(0)$ and $f'(x)\leq g'(x)$ for all $x$ in $\mathbb{R}$. Prove that $f(x)\leq g(x)$ for any $x\geq0$.   Now, I know this is true because the first derivative of a function is the angular coefficient of the function in a point $x$. So, $f'(x)\leq g'(x)$ means, in other words, that the function $g(x)$ grows faster than $f(x)$. I think this is the base for a more formal proof, could someone help me to figure out a more formal proof?


I'm looking for some help with my Daily Work Log spreadsheet. I've search and read many different version of making a "TimeStamp" in Google spreadsheet. And it seems I don't have enough experience for it to work correctly. The time stamp script I am using updates every time my spreadsheet auto saves or something is changed.   Here's what I'm tring to do. I have work force of technicians.  Initials are AB, DD, RG, JW, RZ.   I want the spreadsheet to time stamp column N when they enter their initials in column M.    I know you can use the keyboard shortcut Ctrl + Shift + : to time stamp a cell. Is there a script I can use to do that action in column N when initials are entered in  column M?

I use PSPad as a text editor, which allows you to press Alt + D to insert a timestamp, e.g.:  2010-07-17 23:45:44   Is there a way to do this in a Google Spreadsheet?


I tried to use Liouville theorem to show that function is a constant function first, but I found it useless. Then I found that modulus of 1/$f$(z) is less than a bounded function, but here also lead to a problem that I cannot make sure the 1/$f$(z) is holomorphic except origin point. I wonder how to solve this problem.

Suppose function $f$ is holomorphic on $\mathbb C-\{0\}$ and satisfies $$|f(z)| \le \sqrt {|z|} + \frac{1}{\sqrt {|z|}}.$$ Prove that $f$ is a constant function. I think it's related to Laurent series representation and ML inequality but I have no idea how to prove it. Can anyone give me some hints? Thanks in advance!


My login works fine when I enter the correct username and password and it starts a new activity. But for some reason when I enter incorrect username and password it doesn't proceed and the app just crashes. protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);     myDB = new DBHelper(this);      EditText txtUser = (EditText) findViewById(R.id.txtUser);     EditText txtPassword= (EditText) findViewById(R.id.txtPassword);      Button btnLogin = (Button) findViewById(R.id.btnAdminLogin);     Button btnCreateAcc = (Button) findViewById(R.id.btnCreateAcc);     Button btnAdmin = (Button) findViewById(R.id.btnAdmin);      btnLogin.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View v) {             u = new User();             String username = txtUser.getText().toString();             String pass = txtPassword.getText().toString();              u = myDB.readUser(username);              if(u.getUser().equals(username) && u.getPass().equals(pass)){                 Intent menu = new Intent(getApplicationContext(), MainMenu.class);                 startActivity(menu);             }             else {                Toast.makeText(MainActivity.this, "Incorrect username or password!" + pass, Toast.LENGTH_SHORT).show();             }          }     });  This is in my DBhelper, readUser. public User readUser(String user){     SQLiteDatabase db = this.getReadableDatabase();     User u =null;     String where =  col_uname + " = ?";     String[] selectionArgs = {user};     Cursor cursor =db.query("tblUser", null, where, selectionArgs, null, null, null);      try {         if(cursor.moveToNext()) {             u = new User();             u.setUser(cursor.getString(0));             u.setPass(cursor.getString(4));             u.setFname(cursor.getString(1));             u.setMname(cursor.getString(2));             u.setLname(cursor.getString(3));             u.setMobile(cursor.getString(6));             u.setCity(cursor.getString(5));         }     } catch(Exception ex) {}      db.close();     return u; }  I don't know what I did wrong with my if/else statement. Pls 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?


Is there a mailing list and/or IRC channel that announces changes to packages hosted by the Canonical repositories? If so, how does one subscribe? Here's an update explaining how this question is different from those linked as possible duplicates: I'm interested in subscribing to all changes in all packages throughout a given repository-suite tuple. Some editors/commenters have shown how to subscribe to events relevant to a single package, but the technique relies on setting up , either via browser extension or cronjob-python-script. This technique has a number of shortcomings that make it unsuitable for what I want:  it polls rather than subscribes; i.e., polling too fast wastes bandwidth and polling too infrequently risks losing information it's too manual; i.e., it requires a human subscriber to add the things being monitored it's too shallow; i.e., it does not track or accumulate changes through time  To those asking "Why?", let me explain my motivation by way of example. Consider an automated nightly build process that, without any change to the package being built, suddenly starts failing. Clearly, something in the Build-Depends and/or Depends has changed to cause the failure. One can bound the duration between the most recent success and the failure that follows it. What happened to the package repositories within that duration?

I'd like to recieve some sort of notification when a new version of  package is available on the archive.ubuntu.com repository.  Is there an email list or any other tool of this sort I can subscribe to?


I am having a bit of an issue. I want to bind elements (in Jquery) to an event Listener. I would normally do it in the $(document).ready() but these elements are not created yet in the body, so they are not binded with the event listeners. I would like to know if there is a way of doing this so I don't have to bind the elements every time I create a new element.  The elements are created like this : $("#theDiv").html(functionReturningHTMLString())  Thank you all

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.


I am about to write a python script, that is able to read a txt file, but with readline() there is always the \n output. How can i remove this from the variable ?   a = open("file", "r") b = a.readline() a.close()

What is the Python equivalent of Perl's chomp function, which removes the last character of a string if it is a newline?


Small code snippets in C.  #include<stdio.h>  int main() {     printf("%zu\n%zu\n", sizeof(char*), sizeof(double*)); }   Output:(GCC 64 bit)  8 8   Is sizeof(char*) always equal to sizeof(double*)?   What C standard say about this?

For example: sizeof(char*) returns 4.  As does int*, long long*, everything that I've tried.  Are there any exceptions to this?


(Geodesic frame). Let $M$ be a Riemannian manifold of dimension $n$ and let $p \in M$. Show that there exists a neighborhood  $U \subset M$ of $p$ and $n$ vector fields $E_1,...,E_n \in X(U)$, orthonormal at each point of $U$, such that, at $p$, $\nabla_{E_i}E_j(p) = 0$.  Such a family $E_i, i = 1,..., n,$ of vector fields is called a (local)  geodesic frame at p.   Question: I don't know how I can to prove the step: $\nabla_{E_i}E_j(p)=0$.   I am using $\exp(te_i)$ as a geodesic for this.

I'm having the same problem as it was questioned   I can't get throught the step where I need to show that $\nabla_{E_i}E_j (p)=0$. It only leads to $$ \nabla_{E_i}E_j(p)=\sum_{lk}^n a_{il}(0)\dfrac{\partial b_jk}{\partial x_l}(0)\partial x_k(p) $$ which I can't show that equals zero.  On the linked question, there is also the indication that $\nabla_{E_i}E_j (E_k)=\Gamma^k_{ij}$. This could lead that $\nabla_{E_i}E_j (E_k)(p)=\Gamma^k_{ij}(p)=0$, but $\nabla_{E_i}E_j (E_k)(p)$ is not equal to $\nabla_{E_i}E_j (p)$ which is the one I need.  Can someone help me?


I installed gmail desktop app using following command, sudo snap install gmail-desktop  But it was not letting me sign in, so I want to uninstall it. How to do so?

I used this command line  sudo snap install pwgen-tyhicks   to install pwgen but I can't findout how to use it. So I want to uninstall it. How to  uninstall it?


Why $\mathbb{R}$ with $d(x,y)=|\arctan{x}-\arctan{y}|$ is an incomplete metric space?

I have to show that the real numbers equipped with the metric $ d (x,y) = | \arctan(x) - \arctan(y)| $ is an incomplete metric space.  Certainly, I have to search for a Cauchy sequence of real numbers with respect to given metric that must not be convergent. But I am unable to figure out that.  Can anybody help me with this.   Thanks for helping me.


I'm trying to make a simplified version of Black Jack in Java using eclipse. I'm trying to make it so the player types 'hit' or 'stand', and while they haven't, it keeps prompting them to do so.  while (hitorstand != ("hit") || hitorstand != ("stand"))                 {                     System.out.println("Would you like to hit or stand?(1 for hit, 2 for stand)");                     hitorstand = scan.nextLine();                     hitorstand.toLowerCase();                 }                        if (hitorstand.equals("hit"))                     {                         playercard3 = random.nextInt(10) +2;                         System.out.println(""+playercard3);                     }                 else if (hitorstand.equals("stand"))                     {                         System.out.println("You had a total value of " + playercardtotal + ".");                         if (hiddendealercard == card2)   When I run it, no matter what I type it cannot escape the while loop. I know it would work if I used numbers but I really want to learn how to use words as input.

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?


So I am reading the rulebook of magic the gathering. I haven't played it but I am curious about the game. In the rule book, I didn't see how much mana you start off with. For example .   If you have one forest land card on the field can you summon her? My understanding was that you had to have 2 land cards on the field since she requires two mana. Do you start off with a certain number and type of mana in your mana pool? How much mana does a land produce and how is that determined?

What is the relationship between lands and mana in Magic and what do each of them do?  A good answer should especially include how a new player should think about them.    Note:  This is an attempt to create a canonical question about the relationship between lands and mana in Magic.  Beginners are often confused about this given the same symbols are used to mean different things across basic lands, non-basic lands, and mana costs.  This can lead to confusion about , about , or even about .


As a moderator on , I mod messaged a user about a moderation issue.  Weird thing is, when the user replied, I got it in my normal inbox, rather than my mod inbox.  Attached is a screenshot (personal details obviously hidden and freehand circles added):    Another moderator saw it in his mod inbox as normally.  Is this a bug? Or ?

The new moderator inbox shows mod messages sent by all of our site's moderators... except myself.  On looking at the list today, it seemed that several messages were missing. I know that mod messages were sent after November 22, since I sent several of them (being almost the only mod around during the holidays).    And indeed, on manually checking, I found that all the messages I thought were missing were those I sent.  Is it intentional that I don't see mod messages I sent, and is there a better way for me to go find my own mod messages again if necessary?


I regularly have to use certain command line tools like smbclient or sqlplus which offer rudimentary or no command line editing capabilities. I.e., the aforementioned programs offer you a prompt, and typing commands there is the primary or only way of interacting with them, but they provide no history, you cannot scroll up or even move the cursor to left on the current line. This is often in docker containers where I control the Dockerfile; i.e. I could install small further tools. Is there a generic unix tool which wraps such a dumb command line tool, providing the more modern capabilities comparable to, say, readline? I would at the very least wish to use the cursor keys, and preferably even a persistent history. The program would sit between the terminal and the dumb CLI and translate. This is in contexts where TERM etc. are all set correctly; i.e. on a bash in that same environment, or in more modern CLIs, everything works fine. Instead of sqlplus myschema@db  ... I would type... good_editing_wrapper sqlplus myschema@db  and as if by magic, the command line of that tool would work great. As comparison, Emacs has a shell-mode which does exactly that - it controls the inferious program, while presenting "good" editing to the user. I am now looking for a standalone version of that, in cases where I am in places where there I cannot easily install Emacs.

bash has a handy file .bash_history in which it saves the history of commands and on the next execution of bash the history is populated with saved commands. Is it possible to save bc command history to a file in the same way and then load it on startup so that bc history is preserved? I tried reading  and it mentions readline and libedit. From ldd /usr/bin/bc I see mine uses readline and readline has  and read_history functions. Is this functionality implemented in bc or to do it I'll need to patch bc?


I have a blender object. I applied a diffuse color to the object. Then I duplicated it. Now I want to apply a different color to the duplicated object, however, the original object also changed to the new color.   How can I make the two objects have different colors?

I've a sphere and then duplicated it. In object tree they are displayed as three siblings. I selected on of them and created a green glass material through node editor however this material was assigned to all three spheres. I confirmed that my selection is only on one sphere. What am I missing?


I fired up Stack Overflow just now and entered in the search "best jquery tooltip plugin", and was met with a fine collection of perfectly clickable candidates ... many of which have been closed as not constructive.  I've read the FAQ and I get it; it's not necessarily a factual programming question, and at some point they have to .  Alas, I'm spoiled, and at this point I've pretty much convinced myself that if a SO post fails to generate traction then my question is untenable.  Where in the Stack Exchange universe does a question like the one above make the most sense?  Is it just flat out unacceptable anywhere?  Is there a stackdiscussion.com?  Should I be asking this in meta.stackoverflow?  .  But this is a programming question.  Factual?  debatable.  But most certainly a programming question.

I have a list of requirements for a program, but I don't know what program meets these criteria. That's about general-purpose software, for example, not a programming IDE or statistical workbench, questions about which would certainly go to respective sites.  Is this question appropriate on Stack Overflow? Where should I ask about it? On Super User or elsewhere?


My program allows to find fibonacci numbers at a certain position n using stack but when I type in a position after 76, the numbers start to get a single number off and larger from there. Here is my arithmetic:  for (int i = 2; i < nth; i++) {      if (nth == 1)         return 1;     else if (nth == 2)         return 1;     else     n1 = fibStack.top();     fibStack.pop();     n2 = fibStack.top();     fibStack.pop();      temp = n1 + n2;     fibStack.push(n2);     fibStack.push(n1);     fibStack.push(temp);  }   I used double type and precision to output correctly. The correct output at 83 is: 99194853094755497 What my code outputs is:     99194863094755488

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


My understanding of Hawking Radiation is that it is a pair of virtual particles that pop into existence at the edge of an even horizon.  The anti-particle falls into the event horizon thus slightly reducing the holes mass. My question is this:  The anti particle will fall in 50% of the time...  Wouldn't that mean that 50% of the time, the regular particle falls in... thus adding the same amount of mass that was just deducted? In some cases, couldn't a black hole increase in mass if just a tiny bit more regular particles fall in that anti- particles?

Could someone please provide an explanation for the origin of ? (Ideally someone who I have been speaking with on the h-bar)  Any advanced maths beyond basic calculus will most probably leave me at a loss, though I do not mind a challenge! Please assume little prior knowledge, as over the past few days I have discovered that much of my understanding surrounding the process as virtual particle pairs is completely wrong.


So I am making a kar98k model but the entire texture is metal everytime I switch to Texture Paint the whole model gets turned into the wooden texture but for the bolt and barrel I intend to be a metal texture so far I have everything finished I just need to know how to add a specific texture to my bolt and barrel.

How do you add more than one material to a mesh?   I have tried adding two materials to the object, and then assigning one of the materials to a vertex-group, but I could not find a place to assign it.  I am making a striped bouncy ball that I want to deform, so adding a different material by separating the mesh into different objects would not be ideal.


Java Noob here, I wrote the following code to check if a given string is palindrome or not: import java.io.*; import java.util.*;  public class Solution {      public static void main(String[] args) {          Scanner sc=new Scanner(System.in);         String A=sc.next();          StringBuilder str = new StringBuilder(A);         StringBuilder original = new StringBuilder(A);         str.reverse();         if(str == original)         {             System.out.println("Yes");         }          else             System.out.println("No");     } }  for input 'madam' it's saying NO? What is wrong with the code?

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 have a broken Windows 7 system which does not fully boot. The system restore is not working.  I am inexperienced with Windows systems.  Question: Is it possible to use a Windows 7 install CD and install it over the old system? Will the data and programs be preserved? Or is there a repair/reinstall/overinstall mode? I haven’t tried it yet, as I don’t want to destroy anything.

I've experienced some freaky data loss in Windows 7 & tried to recover the files. (.) The work data is safe but I also decided to copy everything missing back into Windows directory & rebooted thinking that the recovery mode would be a better option for rolling back to a restore point. Shockingly, the only options System Restore gave me were from November 2010 (2.5 years old) despite many updates & installs since. I thought that only the dates were corrupted but when I scanned for software to be affected by the roll-back, the list included everything installed since then. On top of that, something got screwed up in the OS and I can't boot even into Safe Mode - the system BSODs supposedly on compbatt.sys (which I've already tried to copy from the original distro).  Since I have many settings not saved, I don't want to perform a clean install of the OS. The problem is that the install disc keeps on telling me that upgrade can be performed only from the fully-booted system and not from the recovery mode. This is very annoying because all previous versions of Windows could be upgraded from DOS or PE.  Thus, the question is: how can I fix my OS without formatting the drive if it's not bootable & System Restore is broken?


I love  but sometimes, I want to collaborate with the query creator - perhaps suggesting why their query isn't working as expected or asking something about the query. I don't know if comments is the appropriate form for this - perhaps a meta.data.stackexchange.com works instead or some other system, but I feel that something is lacking in this general area. For example,  has a comment suggesting the data dump is broken - actually, I believe it's anonymized as it should be. However, I can't comment to clarify that.

I guess I'm asking for comments, with subsequent notifications, to be added to queries in SEDE, so we can point out [fixes]  to flawed queries, especially when [the query]  has a comment in it explaining the problem.


I'm fairly new to PHP and have built a medium sized website using standard MySQL database calls. However, I have recently learned about PDO and I am hoping to find out from the community if it is worth switching from MySQL over to PDO. For security I have been using mysql_real_escape_string.  Info about the site: I'm using a mix of INSERT and SELECT calls. The data returned from SELECT calls isn't massive (no more than 30 records returned by using LIMIT). There will also not be a whole lot of INSERTs. The site is currently not live and so making changes now is easy.  In your professional opinions, is it worth my time to switch the site over to PDO from MySQL?  Or is staying with MySQL just as good? Or in other words, what would be the reason, if any, to switch to PDO now?

In our place we're split between using mysqli and PDO for stuff like prepared statements and transaction support. Some projects use one, some the other. There is little realistic likelihood of us ever moving to another RDBMS.  I prefer PDO for the single reason that it allows named parameters for prepared statements, and as far as I am aware mysqli does not.  Are there any other pros and cons to choosing one over the other as a standard as we consolidate our projects to use just one approach?


I had submitted a manuscript to an International Journal few months before. It is already 5 months. But the status is still showing "under review". Since it is getting late, so I contacted to the Journal stating the current status. I got a reply that they have contacted a number of reviewers, but no one shows interest to review it. At present they have sent the manuscript to the editor.   So whether an Editor can reject it most probably? or can review my manuscript to make a proper decision?

I submitted to a journal a couple of months ago. The editorial flow is somehow quick and very transparent. I receive notifications for all events happening to the manuscript.  Unfortunately, the managing editor contacted me three weeks ago. They informed me that the assigned editor could not commit to the job and left. Another editor was immediately assigned.  However, I was contacted today by the new assigned editor. I was informed that all the contacted reviewers so far either refused to review the manuscript or did not respond to the invitation. They are now looking for other reviewers.  Despite the bad luck surrounding the manuscript, all of this happened in a reasonable time and I am satisfied with how quickly they react.  Nevertheless, these events made me reflect. Even if an editorial board possesses a fair network of reviewers, there is still a little risk that all the contacted reviewers either refuse or do not reply.  What happens if no reviewers could be found for a submitted manuscript? Is the journal going to reject the manuscript because of a lack of reviewers?


Please help! I’m new to the sugar daddy world and he’s willing to pay me through email by sending me a check? He’s asking for me to provide my full name and email address. Is this fraud or no?

I used a website called Seeking Arrangements and met a  sugar daddy. He asked for my email login, online banking login, routing, account number, Facebook, as well as my  address which is the only thing I gave him since it’s a PO. I’ve been extremely vague just to see if this is real.   I don’t plan to give him anything because I have only been talking to him for a few months and  I feel conflicted. I doubt that he is trying to scam me but I suspect that he has some kind of master plan. With things such as Venmo, Zelle, and Cashapp, what is the need for “put me on his payroll?”   He claims that he is in another country on a business trip.  He said that  he tried to send me a gift but he lost access to his card. He is now asking to deposit more than 10k into my account and have me wire it. Is this a l classic way of scamming people? If so, is it common that they spend months creating a relationship with you  to catfish you?


I was reading one of Olivia Rodrigo's :  I say, ‘I've never felt this way for no one' which is completely grammatically incorrect.  Why is that incorrect? It is a part of her song, Driver's license, lyrics.

Is there at least one right sentence on the list?  1) You should say it to no one  2) You shouldn't say it to no one  3) You say it to no one


Given this class:  public class Tool     {         public int Id { get; set; }         public int Number { get; set; }         public string Source { get; set; }     }   And a list of Tools like this:  var tools = new List<Tool>()             {                 new Tool {Id=444, Number=121, Source="Master"},                 new Tool {Id=777, Number=121, Source="M1"},                 new Tool {Id=333, Number=51, Source="Master"},                 new Tool {Id=555, Number=61, Source="Master"},                 new Tool {Id=848, Number=51, Source="M1"}                 //Many more             };   How could I use Linq to get a list of distinct Tools by Number and if 2 tools have the same Number select the one whose source is "M1", i.e.the resulting list would contain:  Tool {Id=777, Number=121, Source="M1"} Tool {Id=848, Number=51, Source="M1"} Tool {Id=555, Number=61, Source="Master"}

I am playing with LINQ to learn about it, but I can't figure out how to use Distinct when I do not have a simple list (a simple list of integers is pretty easy to do, this is not the question). What I if want to use  on a list of an Object on one or more properties of the object?  Example: If an object is Person, with Property Id. How can I get all Person and use Distinct on them with the property Id of the object?  Person1: Id=1, Name="Test1" Person2: Id=1, Name="Test1" Person3: Id=2, Name="Test2"   How can I get just Person1 and Person3? Is that possible?  If it's not possible with LINQ, what would be the best way to have a list of Person depending on some of its properties in .NET 3.5?


I left my laptop suspended for a bit and when I re-opened it, most of my system fonts were hidden. On my desktop, a few folders have some random letters in their name visible, but most have disappeared:    And most of my title bars and dialog windows are totally opaque, as you can see in this screenshot of the screenshot dialog:     I'm not sure how to even begin to troubleshoot this. I'm sure I could restart my computer but there must be a better way to get my fonts back?  I read through  but this isn't something I've seen before and I've been on 16.04 LTS for quite some time, so I think this is a different issue.   Plus, I have compiz (the solution suggested in the answer to the above question) and it, too, is unusable at the moment:    Two months later, I'm still struggling with this. My fonts just kind of choke, usually after my computer has been asleep for a while. It's inconsistent which apps choke -- for instance right now there are zero letters on my desktop or my terminal but Firefox is fine. If I re-boot my computer everything is back just fine but that's obviously super inconvenient.   Logging out and back in would be a good option, but I'd have to memorize the location of the "log out..." menu item. Because that is always hidden.   Note that this is marked as a duplicate of  but the solution there is to upgrade to 15.04. I'm on 16.04, so should be past that.

I have a fresh installation of Ubuntu 14.10 on my laptop. It appears that letters are missing from files and folders, as well as menus and configuration windows. I'm not sure where to start in order to fix this.


I have a dataset made up of observations of procedural cases, with a count outcome (variable X carries the number of times a specific finding was detected in one procedure/case). My denominator is the total number of procedures. My count outcome starts with 1 (no zeros), therefore I am using a Poisson model.  I am not sure what the exposure variable should be as the data is a retrospective cross-sectional sample of procedures with procedural findings, from each of 4 calendar years aggregated together. What would be the offset (exposure) variable, if appropriate, in this case?  Hence the question comes to interpreting the incidence rate ratios of the independent variables.  For example, specialist vs trainee (reference level) IRR =1.50 . If no exposure (offset) variable is used, does that mean that the specialist is 50% more likely compared to the trainee to detect one addtional finding count per procedure? Or : the specialist will detect on average 50% more copies of that finding per procedure?  I have seen and watched various people phrasing the interpretations of IRRs in various ways.  With or without exposure variable (if needed) , what would be the correct interpretation of IRR in this case?

So, I want to fit a random effects negative-binomial model. For such a model STATA can produce exponentiated coefficients. According to the help file such coefficients can be interpreted as incidence-rate ratios. Unfortunately I am not a native English speaker and I do not really understand what incidence-rate ratios are or how I could translate them.  So my question is, how can I interpret incidence-rate ratios. E.g.:  If the model gives me an incidence-rate ratios of .7 for one var. would that mean that the number of expected observations (counts) on the dependent var. changes by .7 if the independent var changes by one unit?  Can anyone help?


having problem with null pointer exception and i read few article bout that error and still coundnt figure out what the problem.   The error happen at CompatibleActivity[topIndex]=new Activity(aNum,bNum,c);  topIndex=0 by the way.  Can anyone highlight the problem im having?  here my class  public class Schedulingtest {   public static void main (String[] args) throws IOException {        Scanner fileScan;     fileScan=new Scanner(new File("data.txt"));      Schedule compatibility = new Schedule();        while(fileScan.hasNext())     {String url=fileScan.nextLine();     compatibility.addActivity(url);       }  }   public class Schedule{   import java.util.Scanner; import java.util.Arrays;  public class Schedule { Activity[] CompatibleActivity; int totalTime=0,topIndex=0; Scanner urlScan;  public Schedule(){ Activity[] CompatibleActivity=new Activity[30];  }   public int getTotalTime() {return totalTime; }       public void addActivity(String entry){      urlScan=new Scanner(entry);     urlScan.useDelimiter(" ");       String c=null;     int aNum = 0,bNum=0;      while(urlScan.hasNext())     {String a=urlScan.next();      String b=urlScan.next();      c=urlScan.next();       aNum=Integer.parseInt(a);      bNum=Integer.parseInt(b);                }         CompatibleActivity[topIndex]=new Activity(aNum,bNum,c);     topIndex++;      System.out.println("Activity added:  start "+aNum+ " stop "+bNum+" "+c );  }       }  Activity Class  public class Activity {  private int start,stop,duration; private String name;  public Activity(int Start,int Stop,String Name) { start=Start; stop=Stop; name=Name; duration=Stop-Start;    }      public String getName() {return name; }          public int getStart() {return start; }  public int getStop() {return stop; }          public int getDuration() {return duration; }      public boolean compatible(int Start1,int Stop1,int toMatchsideStart,int toMatchsideStop) {    int Start=Start1;    int Stop=Stop1;    int toMatchStart=toMatchsideStart;    int toMatchStop=toMatchsideStop;  if(toMatchStop<=Start) {return true; } if(toMatchsideStart>=Stop) {return true; } else {return false;}     }           public String toString() {return( name+"<"+start+","+stop+">"); }         }

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 an algorithm defined with algorithmc like this:      \documentclass{article}     \usepackage{algorithm}     \usepackage{algorithmicx}      \begin{document}      \begin{algorithm}     \begin{algorithmic}[1]     \Function{X}{ItemA, ItemB, ItemC}     \State {Lorem Lorem}     \State {Final}     \end{algorithmic}     \end{algorithm}       \end{document}   Suppose that this is a very long algorithm.  Is there a way to break algorithm to fit in many pages?

I am writing a few rather large pseudocode functions using algorithm and algorithmic, i.e. my code looks something like:  \begin{algorithm}                      \caption{Coolest Algorithm ever}           \label{findme}                           \begin{algorithmic} [1]                   % enter the algorithmic environment \REQUIRE    Here are a few variables \\             variable 2 \\             variable 3  \ENSURE     this is the output \\             output 2  \STATE $some cool code here$ \STATE $some cool code here$ \STATE $some cool code here$ \STATE $some cool code here$ \end{algorithmic} \end{algorithm}   Unfortunately this code does not fit on one page and I am definitely not able to split it into some subfunctions or so (I already did that as far as possible).  So now I need to split up the algorithm into two pages, but I have no idea how.  The easiest way I can imagine is just to start a new algorithm on the new page, but this time letting the line counter start at line 35 or so instead of 1. But how can I do that?  Please not that there is already a similar question here on this site, but it deals with the package algorithmicx.


This is more of a general "mathematical english/punctuation" question, but I figure TeX users will know the answer.  The following sentence seems natural:   We define the $xyz$ constant via $xyz=\int_0^\infty f(y)dy$.   Note the period at the end, which is of course correct.  What if I decide to align the equation for $xyz$?   We define the $xyz$ constant via   \begin{align}     xyz=\int_0^\infty f(y)dy  \end{align}     Should I still place a period at the end of this sentence (in the aligned equation)?  Is it considered bad form to end sentences in the middle of aligned equations like this?  Thanks!

For formal articles, should a displayed equation be followed by a punctuation to conform to the language grammar ?  For example:  The most well-known physics formula is      \[E=mc^2.\] %should I put a period here?  And if you expand      \[(x+y)^2,\] % should I put a comma here?   you will ...


How can I paint terrain with normal map? In texture paint mode I can choose one texture to paint, but what if I have a pair of texture? (color + bump)  For example I have a pebbles looping texture. It would be great if I could also make a big bump map as I paint the pebbles.

Is there any way to paint onto a bump map and diffuse map at the same time, so that the strokes match up? Like a multi-layer brush that uses a greyscale texture for the bump layer and a color texture for the diffuse color?  Here's a rough sculpt to demonstrate what I'm imagining:    The GIF above shows how such a brush could be made. The black and white height map would be the displacement brush, transferring its greyscale data to the bump map texture and the green one would transfer its color data to the diffuse map texture.  The resulting brush images:      Making the brush is one thing, but is it possible to use such a brush?


Currently my data set is:  {('NSW', '06'): 0.4, ('QLD', '06'): 0.2, ('VIC', '06'): 0.0, ('NSW', '07'): 0.2, ('QLD', '07'): 0.4, ('VIC', '07'): 0.0, ('NSW', '08'): 0.2, ('QLD', '08'): 0.2, ('VIC', '08'): 0.0, ('NSW', '09'): 0.2, ('QLD', '09'): 0.2, ('VIC', '09'): 0.0, ('NSW', '10'): 0.2, ('QLD', '10'): 0.2, ('VIC', '10'): 0.0, ('NSW', '11'): 0.2, ('QLD', '11'): 0.6, ('VIC', '11'): 0.0}   I have achieved this from doing:  key = (state,month)     if key not in rainfall_and_month:         rainfall_and_month[key] = rainfall     if key in rainfall_and_month:         rainfall_and_month[key] = min(rainfall, rainfall_and_month[key])   I wish to print out the largest value out of the key-value pairs. So basically I would like to make the code find "('QLD', '11'): 0.6", and then print out,  A-value: QLD B-value: 11   separately, so I would probably end up doing  print("A-value:", state) print("B-value:", month)   However I'm not sure as to how to find the largest value then extract those data points.

I have a dictionary: keys are strings, values are integers.  Example:   stats = {'a':1000, 'b':3000, 'c': 100}   I'd like to get 'b' as an answer, since it's the key with a higher value.  I did the following, using an intermediate list with reversed key-value tuples:  inverse = [(value, key) for key, value in stats.items()] print max(inverse)[1]   Is that one the better (or even more elegant) approach?


I don't exactly know what I did wrong, but now every command that needs sudo returns: sudo: /etc/sudoers is owned by uid 1000, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin  I found a bunch of answers for fixing this in these situations:  If I was running Linux and could boot with a live USB If I was running Mac OSx.  But I'm running WSL2 in Windows 10, so these answers didn't helped me. Have I rendered my WSL useless? Is there a way to fix this windows-side? Things I've tried in WSL terminal (Ubuntu 20): pkexec chown root:root /etc/sudoers /etc/sudoers.d -R pkexec visudo  Both gives me Error getting authority: Error initializing authority: Could not connect: No such file or directory response. I've also tried su - root, but I put my password and it gives me Authentication failure. Let's suppose this has no answer and I need to reset my Ubuntu WLS install. Is there a way to export everything that I did, installed and all, or will I have to start ALL over? Thanks a lot.

I faced this issue when I want to use sudo command :  sudo: /etc/sudoers is owned by uid 1000, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin   then I tried a solution from a similar question in order to change the owner back to the root:   $ pkexec visudo   also I tried this one   $ pkexec chown root:root /etc/sudoers /etc/sudoers.d -R   but I have faced another issue with these commands:   Error getting authority: Error initializing authority: Could not connect: No such file or directory   So is there a solution to this issue?    Full shell issue snippets:   ubuntu@LAPTOP-D4T16P7J:~$ sudo -i sudo: /etc/sudoers is owned by uid 1000, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin ubuntu@LAPTOP-D4T16P7J:~$ pkexec visudo Error getting authority: Error initializing authority: Could not connect: No such file or directory ubuntu@LAPTOP-D4T16P7J:~$ pkexec chown root:root /etc/sudoers /etc/sudoers.d -R Error getting authority: Error initializing authority: Could not connect: No such file or directory     This is my /etc/sudoers file:   ubuntu@LAPTOP-D4T16P7J:~$ cat /etc/sudoers # # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults        env_reset Defaults        mail_badpass Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"  # Host alias specification  # User alias specification  # Cmnd alias specification  # User privilege specification root    ALL=(ALL:ALL) ALL  # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL  # Allow members of group sudo to execute any command %sudo   ALL=(ALL:ALL) ALL  # See sudoers(5) for more information on "#include" directives:  #includedir /etc/sudoers.d     OS info:    Ubuntu WSL2.


I was taught that punctuation goes inside quotes. For example, this would be wrong:  Mama opts to give Maggie the quilts because “Maggie knows how to quilt".  But someone was reading my essay and told me I'm wrong. Please clarify. I'm confused :(

I have been/am being taught that end punctuation should always go inside quotes. For example, you are supposed to write:     Marvin thought it was "awful."   The problem is I do not see how does this make sense. Intuitively, I always wrote:     Marvin thought it was "awful".   as that makes more logical sense — you want a quote to be an exact replication of what somebody else said, so why should you add punctuation inside?  I always thought it made more sense to not touch the quote and add anything after or before if it must be added.  So, why should I put end punctuation inside quotes?


My question is not related to the  Parse XML to get node value in bash script? Also i cannot install/use any new XML parser as per the company policy. This needs to be achieved using shell/perl/awk/sed  I will try to rephrase my question:  1) We have a process.log file in which we have lot of text data and in between we have some XML data published. 2) There of thousands of different XML published in the logs along with other text data. 3) Now i need to select only the XML files which are published after Outgoing XML: value 4) Also the XML file which must be selected and copied to a new file should be the one which matches the value in the ALERTID tag. 5) The ALERTID value will be provided in the script input. So in our case mGMjhgHgffHhhFdH1u4 will be provided in the input and we need to select the full XML file published for this alertid. Starting tag is from  and ending tag is  5) So i need to select the relevant Outgoing XML file in a new file based on a particular ALERTID so it can be replayed in different environments.     Format of the log:   Info Jan 11 17:30:26.12122 The process is not responding to heartbeats Debug Jan 11 17:30:26.12123  Incoming XML :<xml version "1.0" encoding ="UTF-8"?> <Alert trigger = "true" > <Alerttype>orderReject</Alerttype> <AlertID>ghghfsjUtYuu78T1</AlertID> <Order>uusingas</Order> <Quantity>1254</Quanity> </Alert> (CreateInitEventHandler. C:356) Debug Jan 11 17:30:26.12199 The process is going down with warnings Debug Jan 11 17:30:26.148199 Outgoing XML: <xml version "1.0" encoding ="UTF-8"?> <Alert trigger = "true" > <Alerttype>orderheld</Alerttype> <AlertID>mGMjhgHgffHhhFdH1u4</AlertID> <Order>uwiofhdf</Order> <Quantity>7651</Quanity> </Alert>(CreateEventHandler. C:723) Debug Jan 11 17:30:26.13214 The process has restarted and thread opened Debug Jan 11 17:30:26.13215 The heartbeat is recieved from alertlistener process   Now the requirement is to take AlertID in the input, scan the process log and extract the matching outgoing XML in a separate file.  Using awk i am able to extract all the outgoing xml files but not sure how to extract the one  related to a particular AlertID.   Eg:  awk '/Outgoing/{p=1; s=$0} P & & /<\/Alert>/ {print $0 FS s; s="" ;p=0}p' 1.log>2.log

I would like to know how I can get the value of a node with the following paths:   config/global/resources/default_setup/connection/host config/global/resources/default_setup/connection/username config/global/resources/default_setup/connection/password config/global/resources/default_setup/connection/dbname   from the following XML:  <?xml version="1.0"?> <config>     <global>         <install>             <date><![CDATA[Tue, 11 Dec 2012 12:31:25 +0000]]></date>         </install>         <crypt>             <key><![CDATA[70e75d7969b900b696785f2f81ecb430]]></key>         </crypt>         <disable_local_modules>false</disable_local_modules>         <resources>             <db>                 <table_prefix><![CDATA[]]></table_prefix>             </db>             <default_setup>                 <connection>                     <host><![CDATA[localhost]]></host>                     <username><![CDATA[root]]></username>                     <password><![CDATA[pass123]]></password>                     <dbname><![CDATA[testdb]]></dbname>                     <initStatements><![CDATA[SET NAMES utf8]]></initStatements>                     <model><![CDATA[mysql4]]></model>                     <type><![CDATA[pdo_mysql]]></type>                     <pdoType><![CDATA[]]></pdoType>                     <active>1</active>                 </connection>             </default_setup>         </resources>         <session_save><![CDATA[files]]></session_save>     </global>     <admin>         <routers>             <adminhtml>                 <args>                     <frontName><![CDATA[admin]]></frontName>                 </args>             </adminhtml>         </routers>     </admin> </config>   Also I want to assign that value to the variable for further use. Let me know your idea.


I am looking for an analogy. I am trying to convey the message that if you have disordered eating and you are trying to fix it with weight loss, it's like....and here I am lost with an analogy that will help people understand that weight loss isn't the right tool in this case.

In my native language, we use an idiom to warn someone that they're doing something which has no result at the end:     Trying to convince him is like squashing water ...   Is there any idiom in English with the same meaning?


I have a pretty basic installation of Ubuntu 16.04 LTS.  When I go to the launcher and select FILES a new screen opens.  It has two parts to show some of the tree.  In the left sidebar are five directories with unusual icons tied to them.  I can delete the directories or rename them, but after deleting them they are still displayed.  There is a "remove" option, but they are removed temporarily.  As soon as FILES is re-opened the directories are back.  The directories are not recognized from the terminal.  I need to know how to eliminate them from appearing. Appreciate any answers.

I want to remove Videos and Music from the left side panel. But, I can't seem to find the option to do so. How do you do that?


I believe when a singleton object gets serialized and is then deserialized upon a plethora of times in series, there are multiple instances of singletons created.   How can you avoid such a situation?

What is an efficient way to implement a singleton pattern in Java?


Can we insert equations as images in IEEE format? So instead the writing the equation in latex I will be inserting the image.

Here is the output I get when I use \includegraphics to import a figure in an equation environment:    But I want the output to be like this (edited photo):    My MWE:  \documentclass[]{IEEEtran}      \usepackage{graphicx}        \usepackage{amsmath}   \begin{document}   \begin{equation}     \includegraphics[width=0.8\columnwidth]{my_figure.png} \end{equation}   \end{document}


we can synchronize the functions in a class, or we can lock its object in the thread, to create thread safety on a object.      class DBresource {          synchronized public void dosomething() throws InterruptedException {             ...             ...         }     }   OR  class MyThread extends Thread {      public void run() {         synchronized (r) {             r.dosomething();         } }   Which is advisable and why?  Further, i could lock on the class DBResource too. How would that be different?  OR, use a dedicated Lock object. Is that discouraged or prefered and why?  Thanks.

Can any one tell me the advantage of synchronized method over synchronized block with an example?


I am working on a TeX project. I can compile everything without error nor warnings. However, all of my figures are showing up as a solid black rectangle. Does anyone have a clue of what might be going on?  I have all the figures with the correct filenames at the project folder.  Minimal working code:  \begin{figure}[h!]     \centering      \includegraphics[width=6cm]{fig3.png}     \caption{Something goes here}\label{fig3} \end{figure}

I write some of my network notes in TeX. I wanted to make a table, and inside it insert an image:   .   I wrote a document:  \documentclass{article} \usepackage[demo]{graphicx} \usepackage{booktabs} \usepackage{array}  \begin{document} \begin{tabular}{m{3cm}m{3cm}m{5cm}} \toprule Configuration for ... & Commands & Topology\\ \midrule PPP: CHAP, PAP & \#sh int se 0/0/0  & \includegraphics[width=4cm, height=4cm]{chappap.png}\\  & & \\ \bottomrule \end{tabular} \end{document}   But instead of my network topology image, I see only this: .   I don't know what is wrong, cause my image is 100% in the same dir, as my *.tex file.  EDIT:  Changed my code as @Jubobs suggested, now everything is as I wanted:  \documentclass{article}     \usepackage{graphicx}     \usepackage{booktabs}     \usepackage{array}      \begin{document}     \begin{tabular}{m{3cm}m{3cm}m{5cm}}     \toprule     Configuration for ... & Commands & Topology\\     \midrule     PPP: CHAP, PAP & \#sh int se 0/0/0  & \includegraphics[width=4cm, height=4cm]{chappap.png}\\      & & \\     \bottomrule     \end{tabular}     \end{document}


The question is simple enough: How can I make the following output of my counter (\themycounter) say 6?  \documentclass{article} \newcounter{mycounter} \newcommand{\myitem}{\refstepcounter{mycounter}} \begin{document} I have some reason to tally up some items here\myitem \myitem \myitem. But how many items are there in total in this document? Are there {\themycounter} items? Surely there are more since I am tallying up some more items now\myitem \myitem \myitem. \end{document}   I'm quite confident that the answer doesn't need to be as complicated as the one given in  (which is why I'm taking the liberty to ask here).

At the beginning of my document, I have created a counter using \newcounter. Over the course of the document, this counter is increases using \stepcounter. How can I display the final value of the counter in a place prior to the the final occurrence of \stepcounter, such as at the beginning of the document?


I am looking to create a series of maps each one highlighting the camping pitch. I would like to put the number of the pitch highlighted on either page before or after to allow duplex printing of map on one side and pitch number on the other side.  Is this possible using ArcMap with or without python?  See image of camping pitches:

I want to create a mapbook that displays changes in river flows over time. I have one shapefile of my recent digitizations, as well as ones done prior. I was hoping to display them, new on the left and old on the right.   Does anyone know if this is possible?  I'm using ArcGIS 10.1 for Desktop.


So it turns out I can not install Sierra because I have a Mid2009 Macbook Pro. I wanted to update to El Capitan, but it turns out its no longer available on the app store?  Any ideas, how to get El Capitan?

Sometimes it's hard to search for older versions of macOS & OS X  on the App Store.  This is an attempt to provide the canonical QA for this issue, as per the Meta QA -  I expect it to be modified over time to hopefully become a complete information resource.  How can I get any older version of a Mac OS to be able to run as a VM, or to reinstall on my Mac?


I have many issues on my Linux server, a lot of malicious files have been added.  Can you advise a good Virus Software to install on Plesk , that is free of charge? Or that at least is VERY cheap?!  Thanks!!!

This is a  about Server Security - Responding to Breach Events (Hacking)   See Also:                  Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism:   What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning?   Original Version       2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a    attack on our provider. The servers access to the Internet   has been shut down which means over 5-600 of our clients sites are now   down. Now this could be an FTP hack, or some weakness in code   somewhere. I'm not sure till I get there.      How can I track this down quickly? We're in for a whole lot of   litigation if I don't get the server back up ASAP. Any help is   appreciated. We are running Open SUSE 11.0.            2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed   to resolve this problem, although it may not apply to many others in a   different situation. I'll detail what we did.      We unplugged the server from the net. It was performing (attempting to   perform) a Denial Of Service attack on another server in Indonesia,   and the guilty party was also based there.      We firstly tried to identify where on the server this was coming from,   considering we have over 500 sites on the server, we expected to be   moonlighting for some time. However, with SSH access still, we ran a   command to find all files edited or created in the time the attacks   started. Luckily, the offending file was created over the winter   holidays which meant that not many other files were created on the   server at that time.      We were then able to identify the offending file which was inside the   uploaded images folder within a  website.      After a short cigarette break we concluded that, due to the files   location, it must have been uploaded via a file upload facility that   was inadequetly secured. After some googling, we found that there was   a security vulnerability that allowed files to be uploaded, within the   ZenCart admin panel, for a picture for a record company. (The section   that it never really even used), posting this form just uploaded any   file, it did not check the extension of the file, and didn't even   check to see if the user was logged in.      This meant that any files could be uploaded, including a PHP file for   the attack. We secured the vulnerability with ZenCart on the infected   site, and removed the offending files.      The job was done, and I was home for 2 a.m.            The Moral   - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole   world is made aware of the vulnerability.   - Always do backups, and backup your backups.   - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server   Fault.


I've read that $$\frac{\mathrm{d}y}{\mathrm{d}x} = - {\frac{\frac{\partial}{∂x}}{\frac{∂}{∂y}}}$$ For example, if $f(x,y) = 2xy + y^2,$ $$\frac{\partial f(x,y)}{\partial x} = 2y \ \ \text{ and }\ \ \frac{\partial f(x,y)}{\partial y} = 2x+2y, $$ so $\displaystyle \frac{\mathrm{d}y}{\mathrm{d}x} = -\frac{2y}{2x+2y}$ Is there a proof for this assertion? I can't seem to find one.

I am trying to prove that, if $f:\mathbb{R}\rightarrow \mathbb{R}$ and $F:\mathbb{R}^2\rightarrow\mathbb{R}$ are differentiable, $F$ satisfying $F(x,f(x))=0$ and $\partial{F}/\partial{y}\ne 0$ then $$f'(x)=-\frac{\partial{F}/\partial{x}}{\partial{F}/\partial{y}}$$  This appears in a section on the chain rule for many-variables functions, but without knowing the details of $F$ I find it very hard to prove much about it.  To the best of my ability to reason about it, I suppose I could say  $$ \frac{\partial{F}}{\partial{x}}=\frac{\partial{F}}{\partial{x}}\frac{\partial{x}}{\partial{x}} + \frac{\partial{F}}{\partial{y}}\frac{\partial{y}}{\partial{x}}$$  but for more than one reason I doubt that what I have written is correct.  Yet I'm not exactly sure what's wrong about it, nor can I guess what else I could do.  I tried finding the partial with respect to $y$ but got nothing more useful looking than this.  I also tried writing out limit definitions and saw no useful path forward through that.


string inputText="lorem impsum dolar sit amet lorem"; string patternText="lorem"; string replacementText="XXXX"; Regex.Replace(inputText, patternText, replacementText, RegexOptions.IgnoreCase);   output:XXXX impsum dolar sit amet XXXX  But how do I make only one change ?  should be such that  : XXXX impsum dolar sit amet lorem

It seems the .NET Regex.Replace method automatically replaces all matching occurrences.  I could provide a MatchEvaluator delegate that returns the matched string after the first replacement, rendering no change, but that sounds very inefficient to me.  What is the most efficient way to stop after the first replacement?


Below is the json that returns a callout and I would like to insert just the advisoryModel value into a field called PropuestaID from an object called Test.  With the code below, I managed to insert the entire data set into 1 fieldrecord. So just be able to select individual values from the json. Can anyone help me with this?   This is the data set:  [     {         "AdvisoryModel": "",         "AdvisoryModelName": "",         "AnalysisDate": "2017-09-01",         "AssetClassDistrib": [             {                 "Code": "5917",                 "Name": "Equities - Emerging Markets",                 "Value": 278.79749999999956,                 "Weight": 0.284105297215223             },             {                 "Code": "5911",                 "Name": "Equities - USA",                 "Value": 211.79749999999956,                 "Weight": 0.224105297215223             }         ],         "AssetTypeDistrib": [             {                 "Code": "8",                 "Name": "ETFs",                 "Value": 721.69750000000033,                 "Weight": 0.735437307497319             },             {                 "Code": "98",                 "Name": "ETFs",                 "Value": 721.69750000000033,                 "Weight": 0.735437307497319             }           ],         "BenchmarkId": "16wUCvxf2IlH6LTDtskWKw==",         "BenchmarkName": "",         "Code": "MqzY3apIzI+7gLwtH81sg+5si1fQbB8XEuLscw2KLFw=",         "CostValue": 981.3175,         "Currency": "GBP",         "CurrencyDistrib": [             {                 "Code": "GBP",                 "Name": "GBP",                 "Value": 824.91750000000036,                 "Weight": 0.840622428520841             }         ],         "InitialDate": "2016-11-09",         "InOutflows": 0,         "IsOpenPortfolio": false,         "ModelPortfolioId": "16wUCvxf2IlH6LTDtskWKw==",         "ModelPortfolioName": "",         "Name": "All Jaime",         "Nature": "Agreggated",         "Performance1M": 0.0155937904269082,         "Performance1W": -0.00370064850184649,         "Performance1Y": null,         "Performance1YOpen": 0.174732685075806,         "Performance3M": 0.0100169290351478,         "Performance3Y": null,         "Performance5Y": null,         "PerformanceStartDate": -0.00845315378943068,         "PerformanceStartDateAnualized": -0.010413360304749042,         "PerformanceYTD": -0.00798690763601953,         "PortfolioCode": "24497@252",         "PortfolioId": "K4dqbPaHvD3gu6jUXq7EjQ==",         "PortfolioNature": "A",         "ProfileId": 0,         "ProfileName": "Without profile",         "ProfitLoss": -18.6825,         "ProfitLossPercent": -0.00845315378943068,         "RatioSharpe": 2.1502607927577819,         "RiskLevel": "Dynamic",         "UnrealizedProfitLoss": -45.1225,         "UnrealizedProfitLossPercent": -0.313,         "TrendStrength": 0.00496941002014014,         "Type": "Real",         "UserId": "O1Zi/pdqdc2nt/ifOfzQPQ==",         "Valuation": 981.3175,         "ValuationStartDate": 1000,         "Var1Y95": -0.126305977228028,         "Volatility": 0.0812611594204373     } ]   I have this code so far:  List<Object> results = (List<Object>) JSON.deserializeUntyped(response.getBody());     for (Object agency: results) {     System.debug((Map<String, Object>)agency);      Test__c ani = new Test__c();     ani.PropuestaID__c=String.valueOf(agency);     insert ani;     System.debug('ani'+ani);

A type of the body is JSON Blob in a form of:  {"key1":"val1";"key2":"val2"}  I wanted to convert it into a Map<String, String>. Do I have to manually deserialize it or there's a class which can handle that?


I just started tinkering with java and now am trying to send a JSON object over the socket. I tried to implement Serializable but it did not work so I've put that to hold. Now I m just trying to send a JSON object in the form of a string.   JSONObject jsontype = new JSONObject; String stringJSON = jsontype.toString();     return stringJSON;  this.clientOut = socket.getOutputStream(); this.clientOut.write((tosend+"\n").getBytes()); // had to add \n  //otherwise it doesn't work    I have tested the receiving side of it by sending a plain string with \n and it works! but if i try to send a json object it throws a nullpointerexception error. My json object is not null as I have tested it. Is there any other way to convert a json into a regular string? I am using the org.json library.

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I am trying to fix this null pointer exception issue from the past 24 hours. It is constantly showing error in getOppositeSexUsers() . I have asked questions and also got the reply but it  showing the Null Pointer Exception evey time.   This is the logcat .    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference         at com.techjd.hubu.MainActivity$6.onChildAdded(MainActivity.java:205)         at com.google.firebase.database.core.ChildEventRegistration.fireEvent(com.google.firebase:firebase-database@@19.2.0:79)         at com.google.firebase.database.core.view.DataEvent.fire(com.google.firebase:firebase-database@@19.2.0:63)         at com.google.firebase.database.core.view.EventRaiser$1.run(com.google.firebase:firebase-database@@19.2.0:55)         at android.os.Handler.handleCallback(Handler.java:815)         at android.os.Handler.dispatchMessage(Handler.java:104)         at android.os.Looper.loop(Looper.java:207)         at android.app.ActivityThread.main(ActivityThread.java:5740)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766)   This is the main activity code .       public void getOppositeSexUsers(){         DatabaseReference oppositeSexDb = FirebaseDatabase.getInstance().getReference().child("Users").child(oppositeUserSex);         oppositeSexDb.addChildEventListener(new ChildEventListener() {             @Override             public void onChildAdded(@NonNull DataSnapshot dataSnapshot, String s) {                 if (dataSnapshot.exists() && !dataSnapshot.child("connections").child("nope").hasChild(currentUId) && !dataSnapshot.child("connections").child("yes").hasChild(currentUId)){                     Object ImageData = dataSnapshot.child("profileImageUrl").getValue();                     String ImageDefault = "default";                      if (ImageData != null){                         ImageDefault = ImageData.toString();                     }                        cards item = new cards(dataSnapshot.getKey(), dataSnapshot.child("Name").getValue().toString() , ImageDefault);                       //cards item = new cards(dataSnapshot.getKey(), dataSnapshot.child("Name").getValue().toString(), dataSnapshot.child("profileImageUrl").getValue().toString());                     rowItems.add(item);                     arrayAdapter.notifyDataSetChanged();                 }             }             @Override             public void onChildChanged(@NonNull DataSnapshot dataSnapshot, String s) {             }             @Override             public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) {             }              @Override             public void onChildMoved(@NonNull DataSnapshot dataSnapshot, String s) {             }             @Override             public void onCancelled(@NonNull DatabaseError databaseError) {             }         });      }   Everytime I try a solution in getOppositeSexUsers() It will generate Null Pointer Exception . What is fix ?


After updating to the new version I can no longer dig when I click and hold left Mouse button. I have made sure I am in creative mod. When I click my left mouse button I just get a \.

Every time I go to break a block in Minecraft it opens the in-game menu.  I don't know how to stop this from happening, any ideas?