I've installed some applications via apt.  Here they are in the LXDE menu (note the two IDEs and also the "Graphics" menu are present):    If I right-click on the Application Launch Bar and select "Application Launch Bar Settings" like so:    The settings dialog does not have any of the applications I've installed (note also, the "Graphics" category is empty - there is no + icon next to it):    The problem isn't limited to the launch bar settings dialog, either.  If I right-click a PNG image in the file browser and select "Open With...", that dialog is also missing the newly-installed applications (note again the absence of the + icon next to the "Graphics" category):    So:  Why are installed applications not appearing in these dialogs, even though they do appear in the main application menu?  Note that they are present in the applications database directory:    Environment:  A fresh install of the latest Raspbian and the PIXEL desktop environment (which is essentially just a reskinned LXDE).    Note for those who think this is a duplicate of :  It isn't.  That other question is asking how to add applications to the launch bar.  I know how to do that.  I am not asking how to do that.  I am asking:  Why is LXDE not showing all of the installed applications in various dialogs which are supposed to list all of the installed applications?

Is there a way on LXDE toolbar to change what applications are on the quick launch part via the terminal so that it can be put in a batch file to change on multiple clients?


We have purchased two stock HP ML350e Gen8 servers. Ubuntu 12.04 is to be installed in those. The stock, base unit have provision for 6 hard disks for creating RAID in which, one is filled with 500GB Hard disk and others with blank plates. We are planning to buy hard-disks and hard-disk bays for creating RAID array.  I am confused with software RAID, hardware RAID and RAID levels. Kindly help me. Which RAID level is commonly used in IT firms and is most reliable.  Kindly guide me with what all steps are there for creating RAID in HP Proliant ML350e Gen8 server? I am new to RAID configuration. Kindly answer in detail.

This is a  about RAID levels.    What are:   the RAID levels typically used (including the RAID-Z family)?  deployments are they commonly found in? benefits and pitfalls of each?


I am trying to integrate the function $f(z)=$$\frac{5}{z^2}$ from -3 to 3 and I am supposed to develop a closed region that avoids the origin and use the analyticity of the function in this region to integrate the function in a way that is simpler than parametrizing along some path. Any suggestions?

I am supposed to integrate $f(z)=$$\frac{5}{z}$ from -3 t0 3 but I am having trouble understanding how to do this. I've done the integration the "hard" way by using parametrizations but now I need to use the fact that $f(z)$ is analytic everywhere except at $z=0$ and a different method to perform the integration but I am stumped.


I've been using QGIS for a little while now, but I am still a bit confused about coordinate systems. There is plenty of guidance about how to change project and layer CRS, on-the-fly transformation etc, but I can't find anything which explains fairly simply why you should use a particular CRS in preference to another. Does it depend on the data sources (if any) which I intend to use? Or the size of the area to be covered (eg a few square kilometres vs a whole country)? Or the locale?  I've tried searching for tutorials etc which can shed a bit more light, but haven't come up with anything yet.

What strategies, criteria, or rules do you use for selecting coordinate systems for    (a) storing,  (b) analyzing, and  (c) displaying GIS data?     (I humbly offer  to a  about watershed analysis as an example of the considerations involved in (b).)  What are the pitfalls to watch out for?  Links to Web sites you find particularly helpful in this regard are welcome.


I'm 81 and have not been living in a cave all my life, BUT I had never heard of a "Polish dill pickle" until  today. So, let me now ask, What's the difference between a dill pickle and a Polish dill pickle? Sun Nov 10, 2019, 11:00 a.m.

What is the difference in taste between kosher dill pickles and polish dill pickles? Do they have any visual distinctions that would make it possible to differentiate between them on sight?


I have a Vivo y11 smartphone with 512mb ram. I know it is not sufficient to run Pokemon go, but still I want it. It crashes down every time.

While poking around on Pokemon Go's , it lists some specs required for Android and iOS devices. I'm particularly interested in Android devices, but I do not see a minimum/recommended RAM listed on their site.        Android 4.4 to Android 6.0.1  (Android N will not supported until the   official Android release)    Preferred resolution of 720x1280 pixels   (Not optimized for tablet)    Strong internet connection (Wi-Fi, 3G, or   4G)    GPS and Location Services    Intel CPUs are not supported      My device is a , which has a 1.5GB RAM and Quad-Core processor. It runs fine for the most part, but a majority of the features heavily lags and are sluggish while I've seen the same features run smooth on other devices.  What is the minimum/recommended RAM for Pokemon Go to run more smoothly?


My site is a search engine for jobs - it crawls website where jobs posted and indexing that content (similar to indeed.com, for example).  I notice that my website constantly has low SEO rating (e.g. I just not getting traffic, despite the fact that I displaying very quality and useful content).  Obviously, since my website is a search engine, it has no content of its own - all content comes from other websites (job boards, agencies, job postings of employers, etc).  I suspect that my low SEO ranking is due to fact that all content on website is "duplicate" - coming from other websites.  Am I right about my suspicions? Is there something I can do about (e.g. some best practices for such scenario).

This is a general, community wiki question regarding duplicate content.  If your question was closed as a duplicate of this question and you feel that the information provided here does not provide a sufficient answer, please open a discussion on .     What does Google consider to be duplicate content? Will the way I am presenting my content result in a duplicate content penalty? How can I avoid having my site's content treated as duplicate content?


as the question says.  how can i check if a player modifies a file such as maps or spells in my rpg games that will be located as "/cache/spells", "/cache/maps" or "/cache/entities" and you get the point.  all the files are going to be written in .xml if that matters and the game will be an online game made in java. not a browser game btw

In a client-server game architecture, what are the possible ways to verify that the client has not modified things like gfx assets or client side scripts?  Obviously no solution is perfect, but I would love to hear some ideas.  I am thinking something like an hash on all the files in the resources directory. Does that sound feasible?


My keyboard switches the (German) keys [^] and [<], so I want to switch the two keys.  I identified the keycodes using xev and created a file ~/.xmodmap containing  keycode 94 = asciicircum degree keycode 49 = less greater   When executing xmodmap ~/.xmodmap hardware key 94 now correctly outputs "^" instead of "<". Unfortunately the other key does not output any character at all.   xev returns the following output when the key is pressed  KeyRelease event, serial 32, synthetic NO, window 0x2e00001,     root 0x4b, subw 0x0, time 258843335, (169,-12), root:(185,111),     state 0x4000, keycode 49 (keysym 0x0, NoSymbol), same_screen YES,     XLookupString gives 0 bytes:      XFilterEvent returns: False   do you know what the problem might be?  As far as I understand it the  says that remove only works for modifiers, but I don't care for modifiers, I want to switch regular keys. Might there be another problem that is not related to that 'possible duplicate'?

I have a Macbook Air that runs Linux. I want to swap the alt and super keys in both sides of the keyboard with each other.  How do I do this with cli tools?  Update  Following Drav Sloan's answer I used the following:  keycode 64 = Alt_L keycode 133 = Super_L remove Mod1 = Alt_L remove Mod4 = Super_L add Mod1 = Super_L add Mod4 = Alt_L  keycode 108 = Alt_R keycode 134 = Super_R remove Mod1 = Alt_R remove Mod4 = Super_R add Mod1 = Super_R add Mod4 = Alt_R


After I allowed Ubuntu on my notebook to upgrade to 13.4, it lost Wi-Fi connection. Network menu does not show wireless access points, but according to syslog it establishes connection. Also, the wireless router provides IP address to the host. I don't want to spend time on debugging and solving the problem that most probably will reappear with new update, so I decided to reinstall 12.10 version. It recognized Broadcom Wi-Fi modem right after the boot, and everything went great, until today I powered it on and suddenly found that it is running 13.4 and all my problems are back!  Is it possible to instruct it to stay with 12.10 until I decide to upgrade?

How to disallow Ubuntu to upgrade from like 11.10 to 12.04?  I know that its your wish if you want to upgrade, but I don't want the message in update manager that says a new release is available to get displayed.  All help will be appreciated


Suppose that time could flow in either direction, forward or reverse, similar to a movie. How could our brain possibly record that time had moved backwards? Would there be any way to tell if time had run forwards and backwards countless numbers of times? Isn't it true that our brains only function in one direction of time?

This is an attempt to gather together the various questions about time that have been asked on this site and provide a single set of hopefully authoritative answers. Specifically we attempt to address issues such as:   What do physicists mean by time? How does time flow? Why is there an arrow of time?


What is the benefit of the acceptance-function when you have the vote-function? Currently the acceptance-function belongs to the user asking the question, not the community as the vote-function does.  As I ask in Ask Different Meta  there is also an issue with this since if a user is deleted, there will be no acceptance. Making acceptance-function a function for the community in some form would enable acceptance even if the user is deleted.  Removing the acceptance-function will also solve this issue.  All solutions have both ups-/down-sides. This is why I raise this question so that we could reflect upon it.

From time immemorial, prominent placement for accepted answers has been baked into Stack Exchange.  The reason is that, by accepting an answer, the OP is saying "I did that and it worked for me; I don't need any more help".  That signal is valuable.  So we pin that answer to the top of the list, so viewers will see it first.  (Except for self-answers, because of concerns over gaming the system.) There have been lots of meta posts about whether this pinning is actually a good idea when there are other, higher-voted answers.  No really, lots.  For example:     (see links there to several more)         This cluster of problems has been  and probably others on the team.  Discussions of moving the accepted answer are controversial, even if we provide . All of this raises what, to me, seems a more basic question that we ought to answer first: what does it actually mean, today, and in practice rather than in theory, when somebody accepts an answer?  'Cause that's the signal that we'd be disrupting if we change how pinning works. I'm dubious about the theory, in two ways:  On many sites that weren't even a glimmer in Joel's eye when he launched Stack Overflow, answers aren't actually testable or verifiable.  I think that sometimes people pick answers that worked for them in some fuzzy way, and other times they pick answers that they like for their own reasons.  Subjective-leaning sites can be especially prone to this (as ).  On the parts of the network I frequent, people still answer questions that already have accepted answers.  (I had been under the impression that this doesn't much happen on SO, but I was wrong.  More on that in a bit.)  So the fact that the original asker has been helped might not mean much to the community, which is supposed to address the question for future readers too.   I don't know how to systematically investigate my first point, but we can science the second one.  I used  (h/t msh210) to answer the question: how often do questions with accepted answers get new answers?  (The query reports separately on positively-scored new answers, but this isn't a big difference on most of the sites I tested.)  Deleted answers don't count in this query. I ran the query on the top five sites by number of questions and a smattering of other non-tiny sites.  I was surprised by what I found:  Approximately half of the questions with accepted answers got newer answers on: Stack Overflow, Mathematics, Ask Ubuntu, English Language & Usage, Emacs, and Chemistry.  Approximately one-third of the questions with accepted answers got newer answers on: Super User, Server Fault, Programmers, Mi Yodeya, and Skeptics.  I didn't find any in my sample with drastically higher or lower proportions.   That's a lot of answering for questions that the OP said he's done with. So, to restate the question: What signal do we intend acceptance to deliver?  What are people who see the pinned answer with the green check mark expected to do with that information?  How should it modify behavior?  Here's the data I collected: Site            Qs w/accept     w/newer A       A upvoted SO              5891756         2860654         2277478 Super User      131019          47618           36618 Server Fault    107697          34887           27483 Mathematics     279096          169396          150686 Ask Ubuntu      70594           35399           27346 English         34726           17995           15557 Programmers     27608           9788            8740 Mi Yodeya       6342            2532            2362 Chemistry       5197            2529            2331 Skeptics        3116            945             871 Emacs           2787            1586            1450


Let $X$ be a set, $\mathcal F$ a $\sigma$-field of subsets of $X$, and $\mu$ a probability measure on $X$. Given random variables $f,g\colon X\rightarrow\mathbb{R}$ such that $$\int_\mathbb{R}hd{\mu_f}=\int_{\mathbb{R}}hd\mu_g$$ for any Schwartz function $h$. I want to show that $\mu_f=\mu_g$.   there is a proof that the statement is true even if we restrict ourselves to test functions, but the proof looks quite complicated. Since Schwartz functions form a larger class, is there an easy proof for this statement?

Let $X$ be a set, $\mathcal F$ a $\sigma$-field of subsets of $X$, and $\mu$ a probability measure on $X$. Given random variables $f,g\colon X\rightarrow\mathbb{R}$ such that $$\int_\mathbb{R}hd{\mu_f}=\int_{\mathbb{R}}hd\mu_g$$ for any Schwartz function $h$. Is it necessarily true that $\mu_f=\mu_g$?


From SR we know that the measurement of space and time are relative to the specific reference frame of the observer.   What about measuring energy content?  When an object is accelerated to a near light speed, constant velocity it takes allot of energy to get there, and that energy is essentially 'stored' within the object, right?  If I'm within the reference frame of that object, but have no knowledge of the history of being accelerated (say I was in cryo-sleep), is there any way as an observer I can measure or determine that the energy within the object I'm traveling with has increased?  If not, then how do we know here on earth, or as a whole solar system or galaxy, that we are not traveling near light speed?

For the sake of simplicity, let's imagine that the entire universe is empty except for a single lump of (classical) matter with mass $m$. In its center of momentum frame, it is clear that the total energy is simply $E_\text{CoM}=mc^2$. However, in a frame moving relative to it with speed $v$, we have $E_\text{moving}=\sqrt{m^2c^4+p^2c^2}> mc^2$ for all nonzero $v$.  Are we to infer that the energy content of a system can be different relative to the observer? Does this not violate the first law of thermodynamics?


Let $X$ be a group and $Y$ a normal subgroup of $X$. I am interested in the following two statements:        If $Y$ and $X/Y$ are commutative, then so is $X$.      and        If $Y$ and $X/Y$ are cyclic, then so is $X$.      For 1, I am able to conclude $b^{-1}a^{-1}ba \in Y$ for all $a,b \in X$. Similarly $a^{-1}b^{-1}ab \in Y$. I think the quotient of the dihedral group $D_6$ divided by the group of rotations provide a counterexample to 1.  For 2, I am not aware of any potential counterexamples. If 2 is false, then it immediately follows that 1 is false.  The converse to both of these statements are true.

I tried to prove it by proving that if $\frac GH$ is cyclic, there is $gH$ such that $(gH)^n=e_{(G/H)}=e_{(G)}*H$. Since $(gH)^n=g^nH$, $g^n=e_G$. So $G$ is cyclic.   I don't think it's correct since I didn't use the condition that $H$ is cyclic but I couldn't figure what's wrong. Would be great if someone can point out what I'm doing wrong and maybe point me in the right direction.   Thanks in advance.


Is the var type an equivalent to Variant in VB? When object can accept any datatype, what is the difference between those two?

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


I'm trying to blast open the crack in the wall in the orehole mine in boring springs, but I can't find all 3 dynamite. I got 2 from the trader, but can't find the last one. Where do I get it?

I've gotten the first stick by learning Dickerin' through the book mom gives, then the second through trading a needle. How the heck do I get a third?


I want to keep all .z files of zsh under a directory. Is there a way to do that, if yes, how ?  The two files I see are -   $ ls .z .zcompdump  .zshrc   Could there be anymore. Could I just put a directory, call it .zsh and dump these files in it or would there be something more than that. I have no idea what .zcompdump is supposed to do -  A listing of the contents inside gives me this -  $ head .zcompdump #files: 823 version: 5.3  _comps=( '-' '_torsocks' '.' '_source' '5g' '_go' '5l' '_go' '6g' '_go' '6l' '_go' '8g' '_go'   If I'm not wrong, it seems to be some sort of completion (similar to what bash-completion did) or am I reading it wrong.   Looking to know more.   Update - This is what I have done -   /etc/zsh $ tail zshenv           # output or assume the shell is attached to a tty. # # Global Order: zshenv, zprofile, zshrc, zlogin  if [[ -z "$PATH" || "$PATH" == "/bin:/usr/bin" ]] then     export PATH="/usr/local/bin:/usr/bin:/bin:/usr/games" fi  export ZDOTDIR="/home/shirish/.zsh/"   Then in /home/shirish -  /home/shirish $  mv .zcompdump .zsh/ /home/shirish $ mv .zshrc .zsh/   Then I went to .zsh/ expecting the two dot files to appear there but didn't see them -  /home/shirish/.zsh $ ls -lh  total 0   Am confused by what went wrong.

I use/enjoy zsh and have used oh-my-zsh in couple. While it's all nice and cool, I do get irritated that I have to constantly update the oh-my-zsh script every 15 days/month .   Now I have put zsh as a prompt on another machine. Now the good thing about my oh-my-zsh is that instead of putting everything in .zshrc which when you install .zsh does, it does it in multiple directories with .zsh extension.   While I do not want to go that whole hog, is there a way I can put multiple *.zsh files under say ~/.zsh/ and strive to have a similar working environment.   Can this work or am I missing something ?   Running zsh on debian 64-bit.   Update - There are only two files which can be in my zsh installation -  think-debian% pwd /home/shirish  think-debian% ls .z .zcompdump  .zshrc   Any ideas ?


I am adding dynamic content to a php page using jQuery. I don't have a problem adding the content I just can't seem to find a way to make the new content respond to a click event.     For example (I'm using a div here but could be a button or other type).  $("#oldstuff").after('
Some content that should respond to click event
');   Edit: I am currently using jquery 1.9.1, I was using 1.6.2 but I am checking out magnific-popup which required a newer jquery version.  I didn't post my failed attempts (   $("#newstuff").click(function() {...  $("#newstuff").live('click', function() {...  binding the click event, etc.   because I assumed that I am missing something fundamental that a more seasoned jQuery user would spot without the noise of broken code.

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.


The single answer I received to a question led me to understand how I really wanted to ask the question and to be more specific.  I've edited and expanded my question, but by now, the bulk of users looking at new questions have already viewed it, and only saw the old version of my question.  Do large edits 'bump' the question nearer to the top of the pile, so to speak, so that it will be viewed again?

Many times in the past I've edited a somewhat recent answer—say, from 30 minutes ago—and noticed that the concomitant question didn't bump to the top.  I just confirmed it with ; the question is currently sorted in the JavaScript page based on when it was asked, not my edit.  I've never made edits just to bump a question to whore rep—my original answer was wrong which was why I fixed it—but my understanding is that the CW self-edit trigger exists to prevent  edit-then-bump-then-score-rep—profit! activity.    If non-ancient edits no longer bump a question, should the self-edit CW trigger be brought inline with this?  Should an answer be made CW if you make 10 edits that actually bump the question?  and to avoid any implication of impropriety, I'm already capped on SO, so I'm not looking for any sort of "meta effect" on my answer


Is there a way to make \setsansfont conditional on the font being available, or to skip over that line if it gives an error?  I'm using fontspec with XeLaTeX to use the  font for a document, but I'd like to revert to the default font if that font isn't available, so that if someone else compiles the document but doesn't have that font installed, they get something that's readable, rather than just an error.  A minimal example:  \documentclass{article}  \usepackage{fontspec} \setsansfont{TeX Gyre Heros}  \begin{document}  {\sffamily blah}  \end{document}   Update: it was reported that this is a duplicate of "", but really that question concerns whether individual characters are available in a font or not.  What I want to know is: can I test whether the whole font is available or not, and go with the default if it's not available.

Because I began to use many Unicode characters (Japanese, some unusual diacritics, etc.) I switched from LaTeX to XeLaTeX to render my documents. Unfortunately, if a font is missing, the letters are simply left out (for example, when I had forgotten to specify the font for Japanese) without any error (and I can't seem to spot a warning either). I will read the result, but I prefer to get some early warning if some character isn't available. Is there any way to get a warning about characters that have not been rendered? An error would be even better.


I want to write down some notes in a .bat file.  What codes can be added to the notes so that they will not be treated as commands to be run?

What's the equivalent of # for Windows cmd console sessions, to create a comment?   The operating system is Windows XP.


The boys are Liam and Ethan.  My eight year old student is explaining her choice of 'are' rather than 'were' in this sentence from a past tense recount of her weekend, stating that the boys are still friends, so using 'were' would imply there had only temporarily been friends.  So, is 'are' correct or should it still be 'were'?

I'm describing a situation that happened in the past. To explain it, I want to use a description that is both true now and true when the situation happened.  Specifically, I want something like:     She touched me where my neck met my collarbone.   Since my neck is still attached to my collarbone (thankfully), I'm wondering if I shouldn't use the present tense here instead:     She touched me where my neck meets my collarbone.   Which is preferable, and why?


I've always transcribed "pink" and "ring" with the vowel /I/ (lax) vs. the tense /i/, and my students have never argued with me about it, but suddenly I've been getting a good number of students arguing for the /i/.  They seem to have a vowel somewhere in between perhaps--sometimes it sounds like straight /i/.      Just wondering if you've heard about this happening in certain parts of the country or if this has always been a sort of variant.  Most of my student are from the midwest (Michigan)

I have observed some English speakers in North America who seem to produce this assimilation in words like running /ˈrʌnɪŋ/ (as [ˈrʌnin]) or winning /ˈwɪnɪŋ/ (as [ˈwɪnin]). I'm specifically interested in when the final vowel becomes [i] or [iː] and not /ɪ/ (as in some Southern American English accents, which produce [ˈrʌnɪn] and [ˈwɪnɪn]). Is this a regional accent? I found some additional anecdotal discussion at the following links:   (a site for English learners)


Ubuntu 16.04 is installed on my laptop.    Yesterday I installed Windows 7 in unallocated space. When I restart my laptop, I don't get any menu to choose what OS to boot into. It just automatically boots into Windows.   I thought I might have accidentally removed Ubuntu and so I wrote Ubuntu on a USB and tried reinstalling. That installer says I already have Ubuntu and is making me choose whether or not I want to erase and reinstall, so it isn't removed.  How can I boot into it?

I installed Ubuntu on a Dell XPS 13 laptop that had Windows 10 preinstalled on it. I installed it from a USB flash drive on a partition. When I boot my computer I can only boot into Windows 10 and Ubuntu is nowhere to be seen.  If I boot into my USB then I can see that Ubuntu is installed, but I can't get to it from the BIOS boot menu.


I have multiple domains hosted on a VPS. Hotmail seems to reject email from certain domains (it does not even arrive in the spam folder), but accepts email from other domains (on that same VPS). What could be the problem? I already set up spf and DKIM. I guess this could not be a problem related to blacklisted ip's since all domains point to the same ip address. What could be the reason that not all mail is received by hotmail (it works for gmail)?  Thanks

This is a  about how to handle email sent from your server being misclassified as spam.  For additional information you may find these similar questions helpful:                    Sometimes I want to send newsletters to my customers. The problem is, that some of the emails get caught as spam messages. Mostly by Outlook at the client (even in my own Outlook 2007).  Now I want to know what should be done to create "good" emails. I know about reverse lookup etc., but (for example), what about a unsubscribe link with an unique ID?  Does that increase a spam rating?


I came across the concept of interitence vs composition and did a bit of reading(mostly on the internet). So summarizing what I've learned.  Using inheritence can make your life easier since you do not have to re-implement the behaviors that does not need to change (not be overwritten). But if the behavior of the class grows / need changing, it can be a pain since you have to go through all of the classes that ahs overwritten a function from the base class.  Composition, on the other hand, keeps its component as a member variable, so there isnt a lot of dependency compared to inheritences.   My first question is, am I missing any important things in terms of pros and cons of either inheritence or composition?  And secondly, what are some examples where you would prefer one over another? The only one that I can think of is, 'if you need to inherit multiple classes, I should use composition instead of inheritences'. Or is it more subjective on when to use what?

Why prefer composition over inheritance?  What trade-offs are there for each approach?  When should you choose inheritance over composition?


My next question follows on  where I asked how to sum up the data from different files.   In this case I have e.g. two data files, consisting of m (here e.g. m=3) columns and a fixed number of rows n (here e.g. n=3), seperated by a semicolon (see minimal example):  What I want to plot in a tikzpicture is an elementwise division, e.g  Yvalues(1)=D1(1,2)/D2(1,3) Yvalues(2)=D1(2,2)/D2(2,3) Yvalues(3)=D1(3,2)/D2(3,3) ... for all n rows   The Xvalues shoud be the first column of one of the two loaded files (they are the same).  Maybe someone can use the defined makro 'mergetables' from the link above. Maybe the document could look something like this:  \documentclass{article} \usepackage{pgfplots, pgfplotstable} \usepackage{filecontents}  \begin{filecontents}{D1.txt} 0.1;10;10 0.2;20;12 0.3;30;14 \end{filecontents}  \begin{filecontents}{D2.txt} 0.1;3;5 0.2;3.5;10 0.3;4;15 \end{filecontents}  \begin{document}  \begin{tikzpicture} \begin{axis}     \addplot [Xvalues=first column of any file (D1 or D2),               Yvalues= e.g. 2nd column of file D1 devided by 3rd column of file D2] \end{axis}  \end{tikzpicture}  \end{document}   edit:  My problem is to access to the single columns of each loaded file. In my oppinion the new command, lets call it again \mergetables, should look something like:  \mergetables{D1}{0,1}{D2}{2}..{Di}{col1,col2}{\datatable}   This command should create a new table \datatable with the first column D1(0), the second column D1(1) and the third column D2(2) seperated by a semicolon. Maybe each column of the new \datatable should have a columnname X,Y1,Y2,... so when I want to plot them I can call them using their columnames like:  \addplot table [x=X, y expr={Y1./Y2}] {\datatable};

I've a certain amount of inputfiles (.txt) for the final definition of the y-data of my axis environment. The x-data come from a different file. The goal is to sum up each row of the input files (necessary for my y-data) and multiply them by e.g -1.   So the files needed for my Y-data could look like the following:  \begin{filecontents}{n1b1_f1.txt} 2 3 \end{filecontents}  \begin{filecontents}{n1b2_f1.txt} 4 5 \end{filecontents}  \begin{filecontents}{n1b3_f1.txt} 6 7 \end{filecontents}  \begin{filecontents}{n1b4_f1.txt} 8 9 \end{filecontents}   And the file for the X-data like  \begin{filecontents}{X.txt} 1 2 \end{filecontents}   Now the final goal is to plot a x-y diagram with x(i)=X(i) and y(i)=(n1b1_f1(i)+n1b2_f1(i)+n1b3_f1(i)+n1b4_f1(i))*-1 where i gives the number of the current line.  The number of inputfiles needed for my y data could change, but not be greater than 9 and its now problem if I have to do this kind of adoptions 'manually'  I general I do not know the number of lines before. I would have to look them up, but it would be nice if it would work for any number i of lines automatically


I had the blue screen, downloaded Ubuntu using universal USB...  In a new USB, formatted and when I inserted it in my laptop I got the error in the title of my post. Any help there?

This is the third time I've tried to install Ubuntu Server 14.04.03 64-bit on the same laptop, and each time it caused different problems.  Each time I wrote the same iso image to a USB flash drive by using a different application and OS.   Universal USB Installer (pendrivelinux.com) from Windows WinImage writer from Windows built-in image writer from Linux Mint 17.2    The iso image is the same in all three cases, the USB flash drive is the same, and the laptop is the same. However each time the installation of Ubuntu gave me different installation options. For example, the last time I installed Ubuntu, it didn't show all the packages to choose while installing (Basic Ubuntu server, etc.).


I recently downloaded AVG PC Tuner, and performed a disk check on my 1 TB external drive. When it completed, it found no issues. However, my hard drive is now almost full when I had about 200‑300 gigabytes free before.    I tried running "Disk Cleanup", but it showed nothing to delete.  I then downloaded and ran  to try and see what's using up the space, but it says I have used only 607 GB: (click for full size)    Can anyone help me reclaim my lost storage space?

I have a 1TB* external HDD which comes out at 931GB total space on windows explorer (run as admin).  When I look at free space it lists only 183GB free with 747GB used. However, there is not this much used space. When using WinDirStat (run as admin) this drive only uses 472GB of space.  I have cleared the shadowstorage down to the latest shadowstorage using DiskCleanup which increased the free space to the 183GB free. Now I can't think of anything else  that could be causing this 275GB discrepancy.   I had used this external drive on an old laptop, could there be an issue with that?   Thanks for any advice.


In this example, I'd like to vertically center "3" within the "list-li" element since the sibling element has a dynamic height. I tried using:  position: relative; top: 50%;    ..but it doesn't seem to work.  HTML:

             3

             Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur venenatis, lectus cursus cursus elementum.

   CSS:  .list-1 {     font-size: 20px;     list-style: none;   }  .list-1 li {     margin-bottom: 70px;     overflow: hidden;     text-align: left;     list-style: none; }  .list-1-num {     float: left;     font-size: 25px;     margin-right: 20px; }  .list-1-content {     background-position: 0 50%;     background-repeat: no-repeat;     background-size: 45px 40px;     float: left;     width: 300px;     line-height: 25px; }   Codepen Demo:

I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS needed for this to work on all common browsers?

testing...


In Objective-C, id<protocol> or NSObject<protocol> are frequently used for delegate declaration.  What are the main differences between id and NSObject? When do you want to use one versus the other?

In Objective-C, what's the difference between declaring a variable id versus declaring it NSObject *?


I wrote this code in WinBUGS but I can't run it! It says 'multiple definitions of node tau'  model {for(i in 1:N) {IQ[i]~dnorm(mu,tau)} mu~dnorm(90,tau.mu) tau~dgamma(35.64,5022.8) sigma2.mu<-sigma2/22 tau.mu<-1/sigma2.mu tau<-1/sigma2 } #Initial values list(mu=0,tau=1) #Data list(N=4, IQ=c(96,98,77,66))   Can someone help me find the mistake?

So this question is about the BUGS modeling language. So you either know it or have no clue. I'm a newbie to this so it's been driving me mad. I want to define a simple two-state hidden Markov model (HMM) where the emission of each state follows a Normal distribution. I have an array data of Nxl dimension where each row is a subject and column is a continuous variable Time associated with the subject. So in WinBUGS, I would define the model as:   for(i in 1:N) { # for each subject     # Sample the initial observation     Time[i, 1] ~ dnorm(mu[State[1]], tau[State[1]])      for(j in 2:l[i]) { # for each observation         # Sample the observed variables         Time[i, j] ~ dnorm(mu[State[j]], tau[State[j]])         # Sample the hidden states         State[j] ~ dcat(P[State[j-1], ])     } }  # P is the transition matrix of the hidden Markov chain P[1, 1:2] ~ ddirch(Pinit) P[2, 1:2] ~ ddirch(Pinit)  # Set the initial states State[1] ~ dcat(Pinit)  # Sample the initial params mu[1] ~ dnorm(200, 1.0E-6) mu[2] ~ dnorm(400, 1.0E-6)  # The precision params tau[1] ~ dgamma(0.001, 0.001) tau[2] ~ dgamma(0.001, 0.001)   Initial values have also been provided via R2WinBUGS. The model is syntactically correct. But when I run, I got this error: "multiple definitions of node State[2]"  Can you please tell me why and how to solve this? I've searched around on the error but each has their own specific case and there's not a generic solution or explanation as to why this arises.


I don't want secure password for my desktop. Instead I use just two letters for quick typing. I can change password in terminal by running:  passwd   But terminal gives me:   Failed global policy "com.apple.defaultpasswordpolicy"  Password change failed because password does not meet minimum quality requirements   The same limitation is when trying to set it by preference panel obviously.  Until now in last versions of system, only solution I found was installing of Server application from Apple and basically modifying you osx by it to be   a server, so you can access one setting for password characters policy and be able to set whatever password you like.  So is there other option ?

I just installed macOS Mojave and put in my usual short desktop-only password I've been using for years (yes, you read that right). Now though, the operating system rejects setting a password less than 4 characters. It also does not allow having no password at all.  I am completely comfortable using the shell if need be.  How can I change the password policy to allow quite short passwords?


Suppose I have a vector and I include a new item on it at every time step. This item has one of $k$ different classes, each class has probability $\frac{1}{k}$ of being selected.  Suppose now I stop when my vector has at least one item of each of the $k$ classes and let's call the length of this complete vector $n$.  What is the expected value of n?

What is the average number of times it would it take to roll a fair 6-sided die and get all numbers on the die?  The order in which the numbers appear does not matter.  I had this questions explained to me by a professor (not math professor), but it was not clear in the explanation.  We were given the answer $(1-(\frac56)^n)^6 = .5$ or $n = 12.152$  Can someone please explain this to me, possibly with a link to a general topic?


note: sorry about the bad formatting, I'm new to stack overflow If I had a piece of code that started like this,   import java.util.Scanner; public class MyProgram {   public static void main(String[] args)     {     Scanner Input = new Scanner (System.in);     System.out.println( "Write either yes or no." );     String message = Input.nextLine();    and wanted to check the String variable "message"'s contents in an if statements, how would I do that? I am thinking about something like this: if( message == "yes" )  By this, I mean checking what the user wrote when prompted to, which is stored as message.

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 would like to know whether this is correct:  He uses a car instead of a bus. What does he use a car instead of?

Like many others, I commonly find myself ending a sentence with a preposition.  Yes, it makes me cringe.  I usually rewrite the sentence, but sometimes (in emails) I just live with it.  To, with... you know who you are.  Should I keep fighting myself on this one, or is it okay in some circumstances?


$\mathbb{R}$-real. $\mathbb{N}$-natural. Is it true that the set $P$ of all injections $\mathbb{N} \to \mathbb{N}$ is equal to the set $R$?

I need to find if set $I$ of all injective functions $\mathbb{N} \rightarrow \mathbb{N}$ is equinumerous to $\mathbb{R}$. Still, I have no idea how to work with set of functions, it's something new to me since I have only encountered sets of numbers before.


Let's say, for example, I summon a  this turn. Am I allowed to tap the Gemhide sliver for it's ability the moment it enters into the field, or is it affected by summoning sickness?

Note: this is intended to be a canonical question about summoning sickness.  "Summoning sickness", broadly, is the rule that stops you from attacking or paying {T} costs with a creature that you just played. But how exactly does it work? How does it interact with other rules and effects?  For example, if I'm trying to figure out how a creature is affected:   Does the status matter (tapped/untapped, face down/face up, etc.)? What if it came into play, but I didn't cast it? What if it's a token? What if it was on the battlefield when my turn started, but it wasn't a creature? What if it stops being a creature? What if it's a creature and also another card type? What if it's a double-faced card that just transformed? What if it changes control? What if it's a copy of another creature? Which of the creature's activated abilities can I use? Are any of its other abilities affected? Can I tap the creature to pay a cost that is not a {T} cost?   (These examples are primarily taken from questions about summoning sickness that have already been asked on the site)


First of sorry for my english. I need some help here guys. I'm trying to boolean cut (operation: difference) a hole on a pipe-like shape with cylinder but doesn't work. I made two kind of this pipe-like shape one from a plane and another from a cylinder. Both failed.  Here's a screenshot of what i'm trying to do.   Here's a link to the file on my gdrive:

Whenever I try to cut out a circular hole in either a cylinder or sphere the polygons around the circular hole always have distorted normals after smoothing. Is there anyway to fix this. I've tried using the remesh modifier but wind up with some pretty ugly results.


Being new to the site I have already witnessed a hell lot of work and responsibility a moderator has to undertake (at the least)... Just wanted to know what does happen when someone flags a moderator's comments? Is the moderator himself/herself supposed to act on or is there a kind of judiciary link to check upon a moderator's actions? NOTE: Here I imagine the judiciary being like a commune of SE moderators that check upon every other moderator's actions .. Or does SE itself being a motherly body does so?

Is it possible that, when you flag a moderator's actions, they can action the flag themselves? Or does it get escalated even higher to staff? I suppose the question then is, who would deal with the staff's flags?


The answer I'd like to receive upon my question is this:     It is my 4th.   The question I'd like to ask is something like this:        What timeth is it you are trying to do this?, or   What timeth you are trying to do this?, or   How many timeth ... (1.) and (2.)      I hope I am clear.  I still cannot find out how I should edit my question in a few examples that would yield the answer I want. Could you help? This has been for so long on my mind, at last I found a place to ask help

How to ask the position(?) of a president (like 10th) of a country, correctly?


In my program, I have created a menu bar which allows the user to switch between three programs using file chooser. However, it does not seem to be compiling or working. I am pretty sure my code is incorrect however, I could only find a few examples to work with. I have copied the code that for when "Basic" is clicked on, it is supposed to open BasicCalculator.java. Any help would be appreciated.   JMenuBar menuBar = new JMenuBar(); JMenu calculatorMenu = new JMenu("Calculator"); menuBar.add(calculatorMenu); JMenuItem basic = new JMenuItem("Basic"); JMenuItem intermediate = new JMenuItem("Intermediate"); JMenuItem scientific = new JMenuItem("Scientific");  basic.addActionListener(new ActionListener(){     public void actionPerformed(ActionEvent e){         if (e.getActionCommand().equals("Basic")){             JFileChooser fileChooser = new JFileChooser();             fileChooser.setCurrentDirectory(new File(System.getProperty("BasicCalculator.java")));             int result = fileChooser.showOpenDialog(frame);             if (result == JFileChooser.APPROVE_OPTION){                 File selectedFile = fileChooser.getSelectedFile();                 System.out.println("Selected file: " + selectedFile.getAbsolutePath());             }         }     } });

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?


please help ...  I want to restore MYSQL database using .frm and .ibd files (that's all I am having). here is additional information..     I reinstalled same version of WAMP without taking backup of mysql data. Now i am remain with "BIN" directory which contains some .frm and .ibd files. When i opend phpmyadmin i can find  My old database and table names in browser but when I click on it it says "'xyz'table doesn't exist". But exceptionally one of table is working and displaying it's data. all my tables were of  innoDB.

I have previously saved a copy of /var/lib/mysql/ddms directory ("ddms" is the schema name). Now I installed a new MySQL on a freshly installed Ubuntu 10.04.3 LTS by running apt-get install mysql-server, I believe version 5.1 was installed. After I copy the ddms directory under /var/lib/mysql, some of its tables work fine, these are the tables with an associated set of three files: a .frm file, a .MYD file and a .MYI file.  However, there are two tables with a different set of files: a .frm file and a .ibd file. These two tables didn't show up in the table list in phpMyAdmin. When I look at the error log, it says:  [ERROR] Cannot find or open table ddms/dictionary_item from the internal data dictionary of InnoDB though the .frm file for the table exists. Maybe you have deleted and recreated InnoDB data files but have forgotten to delete the corresponding .frm files of InnoDB tables, or you have moved .frm files to another database? or, the table contains indexes that this version of the engine doesn't support.   Please help with restoring these two tables. Thanks.


I upgraded to latest version of iOS and link my debit card to apply pay a few days ago. After that I start receiving a very suspicious invite on my iPhone calendar. I ignored it and on advice from my friend, disabled "Events found in apps". However, 2 days later, when I wake up, I received the same event again, and most shockingly the phone was at the payment screen, waiting for me to authorise the payment of $19,99 through my thumbprint. Unfortunately I did not take a screenshot of this as I immediately turn off and on my phone to get rid of it.  I checked both my gmail and yahoo mail accounts that are linked to my phone, including the spam folder, but did not find any suspicious email.  I had contacted apple support, but they did not even know about the disable event found in apps feature. Really worried about the security of my phone now and thinking of deleting apple calendar or removing apple pay. Any advise will be appreciated.

Today I've suddenly received spam calendar invitation for $19.99 Ray Ban sunglasses (never subscribed, checked, searched or visited any related site, so clearly spam) and it has other visible email accounts within the invitation. I'm wondering if I should be worried whether my accounts been compromised or a simple email from anywhere just plops this in my calendar without review. Questions to be answered:  What should I check/setup in order to make sure my iCloud account is safe? How can I delete this invitation without sending a notification to the sender, so as to prevent them from knowing my email address is live? How can I prevent these notifications in the future?  Here's an image:


These two PHP MySQL queries work.  mysql_query("DELETE FROM videos WHERE id='10';"); mysql_query("DELETE FROM comments WHERE videoId='10';");   This single query fails due to a MySQL syntax error pertinent to the latter DELETE operation.  mysql_query("DELETE FROM videos WHERE id='10';DELETE FROM comments WHERE videoId='10';");   I've stared hard and can't see the syntax error. What is it?

So I have an SQL dump file that needs to be loaded using mysql_query(). Unfortunately, it's not possible to execute multiple queries with it.  -> It cannot be assumed that the mysql command-line client (mysql --help) is installed -- for loading the SQL file directly  -> It cannot be assumed that the mysqli extension is installed  /* contents of dump.sql, including comments */ DELETE FROM t3 WHERE body = 'some text; with semicolons; scattered; throughout'; DELETE FROM t2 WHERE name = 'hello'; DELETE FROM t1 WHERE id = 1;   The explode() below won't work because some of the dump content's values contain semicolons.  $sql = explode(';', file_get_contents('dump.sql')); foreach ($sql as $key => $val) {     mysql_query($val); }   What's the best way to load the SQL without modifying the dump file?


Here is how I derived this...  $$1+2+3+4+...=-\frac{1}{12}$$ $$2+4+6+8+...=2(1+2+3+4+...)=2(-\frac{1}{12})=-\frac{1}{6}$$ Thus $1+3+5+7+...=-\frac{1}{6}-(1+1+1+...) $ because $S_{odd}=S_{even}-(1+1+1+...)$   Also $S_{odd}=(1+2+3+4+...)-(2+4+6+8+...)=-\frac{1}{12}+\frac{1}{6}=\frac{1}{12}$  Thus $\frac{1}{12}=-\frac{1}{6}-(1+1+1+...)$ $$1+1+1+...=-\frac{3}{12}$$  What I think my mistake was (if I have one) is where I assume the sum of all numbers is half the sum of all even numbers; although, it should work since there is nothing two times infinity.   Please leave  simple solution (im only 15 years old) to why this is false: Wikipedia says that .  Edit: I know now that the above notion is false. I recently watched a  video proving $\sum_{n=1}^{\infty} n = -\frac{1}{12}$. I followed the same line of reasoning to derive the untrue $\sum_{n=1}^{\infty} 1 = -\frac{3}{12}$ I'll admit; I was ignorant in believing so and I apologize for wasting your time.  Thanks for the answer kindly explaining why I was wrong. I guess I should watch this  to un-brainwash me. Sorry again.

On  we find $$\displaystyle \bbox[5px,border:1px solid #F5A029]{1 + 1 + 1+\dots =\sum_{n=0}^\infty 1 = -\frac{1}{2}}$$ using (the rather complicated) zeta-function regularization.  I asking for an elementary derivation possibly based on the idea that on average  $$ \sum_{n=0}^\infty (-1)^n  =  \begin{cases} 1 & \text{ if }n\text{ is odd} \\ 0 & \text{ if }n\text{ is even} \\ \end{cases}  = \frac{1}{2} $$  There is a  discussion that uses very general "cutoff" functions, but I am having a hard time specializing to the case at hand.    A serious question is to qualify where the basic properties of addition break down:   $(a+b)+c = a+(b+c)$ associativity $a+b = b+a$ commutativity $a + 0 = a = 0 + a$ addition by zero   This example obviously shows we can't use these axioms infinitely many times without generating contradictions.  A   even has $\sum 1 = 0$.


Couldn't find an explicit description of what's happening so thought i'd bring this up to the community.  public class Temp { static int i; int j; int sum = i+j; }   public class Main{ public static void main(String[] args){  Temp obj = new Temp(); obj.i = 1; obj.j = 2; System.out.println(obj.sum); //returns '0'  }}   Is it because both integers i and j were empty during instantiation that the 'sum' variable is empty?  Thanks in advance!

Consider this:  public class TestClass {      private String a;     private String b;      public TestClass()     {     a = "initialized";     }      public void doSomething()     {     String c;          a.notify(); // This is fine     b.notify(); // This is fine - but will end in an exception     c.notify(); // "Local variable c may not have been initialised"     }  }   I don't get it. "b" is never initialized but will give the same run-time error as "c", which is a compile-time error. Why the difference between local variables and members?  Edit: making the members private was my initial intention, and the question still stands...


I'm implementing a set of data structures and decided to try an implementation of a maxheap through an array, since it is one of the common implementations for maxheaps. To do that, I have an interface called MaxHeap<T> which accepts Comparable types T and the following class signature:   public class ArrayMaxHeap<T extends Comparable<T>> implements MaxHeap<T> {   T has to be Comparable, or else I won't be able to compare the elements with one another when doing additions and removals from the heap. The problem lies with the constructor of the class:  public class ArrayMaxHeap<T extends Comparable<T>> implements MaxHeap<T> {      private T[] data;     private int last;     private static final int INIT_CAPACITY = 10;      /**      * Creates an empty ArrayMaxHeap with the default capacity.      */     public ArrayMaxHeap(){         data = (T[])(new Object[INIT_CAPACITY]);         last = 0;     }   The type casting of data is throwing a ClassCastException, because the downcasting from Object, which is not Comparable, is unsafe. I've hit a wall with this and am not sure how I would go about implementing the constructor. Any help would be appreciated.

Due to the implementation of Java generics, you can't have code like this:   public class GenSet<E> {     private E a[];      public GenSet() {         a = new E[INITIAL_ARRAY_LENGTH]; // error: generic array creation     } }   How can I implement this while maintaining type safety?  I saw a solution on the Java forums that goes like this:  import java.lang.reflect.Array;  class Stack<T> {     public Stack(Class<T> clazz, int capacity) {         array = (T[])Array.newInstance(clazz, capacity);     }      private final T[] array; }   But I really don't get what's going on.


I am just messing around and trying to make some kind of object that has a bunch of hearts on it. I have an image of a simple heart and I tried mixing it with a checkerboard texture and it wasnt working. I'm just making sure I'm not wasting my time and trying to do something that isnt possible. I'm still very new to blender!!

TL;DR  How to take a shape or Image Texture and multiply it with random Location, Rotation and Scale along object:    Background  I have created my first procedural shape on my own from this function: $(x^2 + y^2 - 1)^3 - x^2y^3 = 0$   (big yay for math idiot)   Here is the result:    And I want to do something useful with it.  Research  I've tried to find something similar over the web (this is trending right now) and I'm surprised that this question wasn't asked before or I'm looking with wrong terms. I've tried random pattern, duplicating texture, populating image, random tiles, custom tiles and such. There is a lot about tiling textures but each and every Q&A I've stumbled upon are about non overlapping ones. For example:            Tryout:  The only way I can think of this is to duplicate shape as a group and manually change values in Mapping Nodes:    As you can see this is... Well. Bad.  I've tried messing with Modulo, mixing Noise between vectors, using custom node groups for LocRotScale (thanks Gandalf) but results was none, thus nothing even to show.  Question  I want to populate this shape (or any other) along the object with random Location, Rotation and Scale - with control over its number/density and maybe variation strength.  Edit: I'm not looking for alternative methods of creating this setup such as Particles, Image Textures generated in 3rd party software, OSL shaders (CPU only) and such. My intention is to use this in procedural texture generation in Cycles with GPU support.  Blend file  Nothing really needed for this question but here - have this heart from me :)


I have a select box (Specie) and a typeAhead input field(Breed), Which i need to update on the change of selectbox, I have the following code.
     <select class="form-control select_field_style specie-breed" id="species" name="species" required>         <option disabled selected>Select a Species</option>         <option value="Dog">Dog</option>         <option value="Cat">Cat</option>         <option value="Horse">Horse</option>     </select>

     <input id="breed" type="text" class="form-control charsonly" name="breed" placeholder="Breed">
   $(document).on('change', '.specie-breed', function() {     let specie = this.value;     $('#breed').typeahead({         source:  function (query, process) {             return $.get('/get/breeds/' + specie, { query: query }, function (data) {                 console.log(data);                 return process(data);              });         }     }); });   Its working but for the first time, The second time change doesn't change the values of the typeahead,  What am i missing here ?

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 have been wondering, why can I not write my code like so:  char myChar[50]; myChar = "This is a really cool char!";   Or at least like this:  char myChar[50]; myChar[0] = "This is a really cool char!";   The second way makes more sense that it should work, to me, seeing that I would  start the array at the point I want it to start moving the letters into each spot in the  array.  Does anyone know why C++ does not do this? And can you show me the reasoning behind the right way to do it?  Thank you all in advance!

I have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value.  I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax?


I have Zorin OS and Elementary OS installed on my laptop. I'd like to install Ubuntu  16.04 and replace Zorin OS. My question is, in the Ubuntu installation program, when it says "You have Zorin OS and Elementary OS installed on your computer", will it give me an option to write Ubuntu over just one of them (in this case Zorin OS) and leave eOS alone?  Hope I made sense... Thanks.

I'd like to see the full How-To on how to use manual partitioning during Ubuntu installation. The existing guides (at least those I found here) cover only automatic part and leave untouched the manual part (or extremely short and contain no pictures).  I'd like to cover such situations:     If your disk contains other systems:


I recently started looking into building custom commands in latex to make life easier and one thing that I wanted to do was create a command that outputs a diagonal matrix from the specified input values, which are the diagonal entries of the matrix. However, there arises an obvious problem which is that the dimensions will doubtless be different for each matrix that I want to define. I don't want to have to make a command for matrices of specific dimensions, so I was wondering if there was any way to make a command in order to print a matrix of a certain dimension depending on the number of variables that are input into the command. Or is the solution just to make a different command for the different matrices of different dimensions? For example: I may want to create a 3 x 3 diagonal matrix with entries a1, a2 and a3, so I would like to be able to write this matrix for example like this: \diagmatrix{a1}{a2}{a3}. At the same time, if I later wanted to create a 2 x 2 diagonal matrix, with entries b1 and b2, I would like to be able to do so with the same command like this: \diagmatrix{b1}{b2} So far I have managed to make the command for a 5 x 5 matrix, but it obviously would not work for any matrix of different dimension. This is the code for it: \documentclass{article}  \usepackage{amsmath}  \newcommand{\diagmatrix}[5]{% \begin{pmatrix} #1&0&0&0&0\\ 0&#2&0&0&0\\ 0&0&#3&0&0\\ 0&0&0&#4&0\\ 0&0&0&0&#5 \end{pmatrix}% }  \begin{document}  $\diagmatrix{1}{2}{3}{4}{5}$  \end{document}  Is there any way to extend this to make it work for any dimension? I am also aware that, in any case, the maximum number of supported variables is 9, so I would not be able to make matrices larger than 9 x 9 with a command like this, but it would still save time for the smaller matrices.

I'm currently working on writing something in latex that requires many usages of diagonal matrices of form   $\begin{bmatrix*}     \lambda_1 & 0 & 0\\     0 & \lambda_2 & 0\\     0 & 0 & \lambda_3\\  \end{bmatrix*}$   with a variable number of parameters \lambda.  Previously, I've found a script that helped me create vectors with multiple parameters and therefore save me from rewriting the matrix for them:  \newcommand{\vect}[1]{% \begin{bmatrix} #1\checknextarg} \newcommand{\checknextarg}{\@ifnextchar\bgroup{\gobblenextarg}{ \end{bmatrix}}} \newcommand{\gobblenextarg}[1]{ \\ #1\@ifnextchar\bgroup{\gobblenextarg}{ \end{bmatrix}}}   While this script works for vectors, I can't think of a generalized way to make something similar to this for diagonal matrices. Finding a script like that will save me a ton of time. I've tries using lualatex for this but I'm inexperienced with it and this doesn't help with trying to have a variable amount of parameters and a corresponding amount of 0s. What I hope for is for the example above, I would simply be able to do something like $\diagmat{\lambda_1}{\lambda_2}{\lambda_3}$ for any amount of parameters, similar to what I can do with \vect. While I'm not sure if this is possible, anything that can save me time and space in writing these matrices would be appreciated.


I have read many articles  and even the original paper, yet the actual proof of the formula escapes me.  I'd really appreciate it if someone can outline the logical skeleton of the proof, but my question goes even beyond that: What I mean is that the quantity of energy in one electron is a scalar that has no justification or reason, neither mathematical, nor logic, like the number of beans in a jar, how can its value be derived mathematically (from what formula[e]) or inferred logically (from what premises?)  Edit after the closure:  I did read the quoted links, what I am questioning here is the epistemology of those articles and links, what scientific value does such a proof have, if any?

Most people know the famous equation:    What were his steps of thinking for this equation that helped us discover so much about our world?


Let $p > 2$ be an odd number and let $n$ be a positive integer. Prove that $p$ divides $ \left(1 ^ {p^ n} + 2 ^ {p^ n} +\cdots+ (p-1)^ {p^ n}\right) $.  This is a question from Titu book on number theory and solution straightly goes to below one line. And I have no idea how it resulted.  Define $k = p^n$ and note that $k$ is odd. Then  $$d^k + (p-d)^k = p\left[d ^{(k-1)} - d ^{(k-2)}(p-d) + \cdots+ (p-d)^{(k-1)}\right] $$  Summing up the equalities from $d = 1$ to $d = \frac{p-1}{2}$ implies that $p$ divides $$\left(1 ^ {p^ n} + 2 ^ {p^ n} +\cdots + (p-1)^ {p^ n}\right)$$  Please provide me an intuitive and simple explanation and that I can understand. I found the same question at  but still I am not able to get it.

Let $a > 2$  be an odd number and let $ n $ be a positive integer. Prove that $ a $ divides $1^{a^{n}} + 2^{a^{n}} + ... + (a-1)^{a^{n}}$ ? (ref. Titu Andreescu, Number theory, page no. 5).  I am not getting any clue as to how to approach the solution.


I am developing a set of scripts, which I want to be present for all users, when I set up a server. But I don't want them in the standard locations like /usr[/local]/[bin],[sbin] etc.  Is there some existing convention for where such scripts should be placed?

I have six directories with command files. These are /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin and /usr/local/sbin.  What are the differences between these? If I'm writing my own scripts, where should I add them?    Related:


I recently removed the hash from the URLs of my website built with AngularJS. Now I would like to remove the old URLs from the Google search results to avoid duplicate content.   Problem is, when I try to do this via the Webmaster Tools' URL removal tool, the hash gets removed from my input and Google tries to remove my root URL from the index.  Also, when I add Disallow: /#/ to my robots.txt file, ALL requests are being blocked.  Should I just be patient and wait until Google recognizes the change or is there a way to remove these URLs?  PS: Calling the hash URLs will not lead to a 404, they are just forwarded to the non-hashed page automatically. But no hash URL is included in my sitemap nor linked anywhere on my page.  PPS: I found a similar question , but it's not exactly the same as I didn't switch to hashbang URLs but instead I'm taking advantage of Googles relatively new ability to query AngularJS pages properly.

My old site used to write the URLs without !.  Eg: www.example.com/#/products  But it has been more than 6 months since I changed it to include ! in the URL like so:  www.example.com/#!/products   But unfortunately Google search results still show my old URL schema.  There is no way I could enter in the Google Removal Tool (via their Webmaster Tools) to remove www.example.com/#/products since Google will complain about an invalid URL.  All I want is to remove www.example.com/#/products and Google to show the one with /#!/products in the results instead.


Definition of the Division Algorithm: if $a,b \in \mathbb{Z} \setminus \{0\}$, then there exist unique $q,r \in \mathbb{Z}$ such that $$a=qb+r, 0 \leq r < |b|$$.  My questions are: (1) is this statement provable? i.e can we prove that such q,r exist? (2) i understand that $r$ can be zero (when $b$ divides $a$) but why is that $r$ must be less than the absolute value of $b$?

This theorem is obviously correct. Now I try to prove it by well-ordering principle.  But I don't know where to start the proving....


My HTML code is below: My question is, why does it show "before" dialog when clicking Button 1, but show "after" dialog when clicking Button 2?  <html>     <body>         <button id="b1">Button 1</button>         <button id="b2" onclick="OnClick();">Button 2</button>          <script>             var OnClick = function(){alert("before");};             document.getElementById("b1").addEventListener("click", OnClick);             var OnClick = function(){alert("after");};         </script>     </body> </html>   JSFiddle link:

The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself).  Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this?


Yours sincerely or Your's sincerely which one is correct when yyandou write complimentary close and how?

"Yours" is usually a possessive pronoun with an implicit noun. What is the implicit noun in the case of "yours sincerely"?


I have studied on it and the most practical way I found was to create a procedure. The procedure adds an id, delete duplicate rows, and finally adds an id column to newly formed table. I wonder, there must be an easier way. Here's the code, it works...  --my table  create table dublicateTable ( name varchar(30) )   --duplicatedly inserted rows  insert into dublicateTable values('Kerem') insert into dublicateTable values('Taner') insert into dublicateTable values('Mehmet') insert into dublicateTable values('Serhat')   --first situation  select * from dublicateTable   name ----- Kerem Kerem Kerem Taner Taner Mehmet Mehmet Mehmet Mehmet Serhat Serhat Serhat   --dynamicaly formed sql code procedure  USE [myDataBase] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO create procedure [dbo].[usp_delete_duplicate] as declare  @add_id_text nvarchar(50), @delete_id_text nvarchar(50), @command_text nvarchar(100) begin set @add_id_text='alter table dbo.dublicateTable add id int identity(1,1)' set @command_text='delete from dbo.dublicateTable where id not in(select min(id) from dbo.dublicateTable group by name)' set @delete_id_text='alter table dbo.dublicateTable drop column id' exec sp_executesql @add_id_text exec sp_executesql @command_text exec sp_executesql @delete_id_text exec sp_executesql @add_id_text end   --final situation.it works..  exec usp_delete_duplicate   select id,name from dublicateTable   id      name ---     ----  1      Kerem  2      Taner  3      Mehmet  4      Serhat

What is the best way to remove duplicate rows from a fairly large SQL Server table (i.e. 300,000+ rows)?  The rows, of course, will not be perfect duplicates because of the existence of the RowID identity field.  MyTable  RowID int not null identity(1,1) primary key, Col1 varchar(20) not null, Col2 varchar(2048) not null, Col3 tinyint not null


Beamer (beamer 2018/02/20 v3.50) overlays are nor aligning anymore. How to fix it?  MWE:  \documentclass{beamer} \title{Foo}    \begin{document} \begin{frame}[t]\frametitle{Foo}     \begin{figure}         \includegraphics<1>{figure1.pdf}         \includegraphics<2>{figure2.pdf}         \includegraphics<3>{figure3.pdf}         \includegraphics<4>{figure4.pdf}         \includegraphics<5>{figure5.pdf}                     \includegraphics<6>{figure6.pdf}     \end{figure}     \end{frame} \end{document}

I'm trying to create a beamer presentation with several images replacing each other on consecutive slides. I've gotten it to work with overprint and \onslide, but cannot get the images centered on the slide.  \begin{center}   \begin{overprint}     \onslide<2>\includegraphics[scale=0.3]{images/stack1.pdf}         \onslide<3>\includegraphics[scale=0.3]{images/stack2.pdf}     \onslide<4>\includegraphics[scale=0.3]{images/stack3.pdf}     \onslide<5>\includegraphics[scale=0.3]{images/stack4.pdf}     \onslide<6>\includegraphics[scale=0.3]{images/stack5.pdf}     \onslide<7>\includegraphics[scale=0.3]{images/stack6.pdf}     \onslide<8>\includegraphics[scale=0.3]{images/stack7.pdf}   \end{overprint} \end{center}   Anything outside of the overprint environment gets properly centered, but not the images themselves.


When I installed the Ubuntu 12.04 Server in my VM, I chose to manually update security.  My question is how can I enable it again? I know there are other packages that do auto update, but I'm just looking for a simple solution to turn it back on.

I want to be sure if automatic updates are enabled on Ubuntu 12.04 server.   How exactly can I check this?   And how can I disable automatic updates if it's enabled?


I have been reading  and the only difference I can find between the two is that they have ever so slightly different pooled standard deviation values but I don't understand how changing these SD values is meant to improve the accuracy of the estimate of effect size.  The differences in standard deviation are the following ($SD_{pooled}$ is the pooled SD for Cohen's d and $SD^{*}_{pooled}$ is for Hedges' g):  $SD_{pooled}=\sqrt{\frac{n_1 SD_1^2+n_2 SD_2^2}{n_1+n_2-2}}$  $SD^{*}_{pooled}=\sqrt{\frac{(n_1-1)SD_1^2+(n_2-1)SD_2^2}{n_1+n_2-2}}$

For an effect size analysis, I am noticing that there are differences between Cohen's d, Hedges's g and Hedges' g*.    Are these three metrics normally very similar?   What would be a case where they would produce different results?  Also is it a matter of preference which I use or report with?


Without solving the following initial value problem, determine the interval in which the solution is certain to exist: $$\dfrac{dy}{dx}+(\tan x)y=\sin x, \ \ \ y \left (\frac{\pi}{4} \right )=0.$$   Please help me also solve (if you can) under what conditions the solution of the first-order ordinary differential equation exists?  This question is different is differenr from the previously asked queston in a way that it has two parts furthermore, the equation given is completely different from the previously asked question.  It is sad that none of the repliers have answered the question yet whereas they have accepted that they know answers. I am extremely disappointed with this forum which was suggested to me by my friend. Leaving it right now. Good Bye.

Given the following problem:     Determine (without solving the problem) an interval in which the solution is certain to exist for the initial value problem $y' + (\tan t)y = \sin t, \space y(2\pi) = 0$.   I was able to get the right answer, but I do lack the understanding as to why it is the right answer. I simply took $2\pi$, and added and extracted $\frac{\pi}{2}$ to get $[\frac{3\pi}{2},\frac{5\pi}{2}$]. Seeing as it is the right answer, I understand that both $\tan t$ and $y(2\pi) = 0$ are essential parts, but the text does not explain this properly.


I’m doing this project for a company I’m working on / at / for.  Which one should I use?

Which is the correct way to tell where I'm working?        I'm working in XYZ company.   I'm working for XYZ company.   I'm working at XYZ company.      Or is there any difference in the meaning?


The alignment of the "Learn more" button in the "Next privilege" popup is not really well aligned with the edge of the black square:  It is also too close to the text showing how near you are to your next privilege.  Compared to the next badge popup:  The former's alignment is suboptimal.  I think it would look better 5, maybe 6px away from the edge, and the same horizontally.  Or can we just make it a bit more like the "Next badge" menu?

The popup when you click on your newest badge in your user profile has a "Learn more" button, but its alignment is suboptimal; it's too close to the top of its container:  It looks better with a 4px top margin:


How would you prove that $f_n(x) = x^{1/n}$ converges pointwise to $1$ for $x \in (0, \infty)$? It's obvious if you take the limit as $n \to \infty$ but how would you prove it using epsilon?

Prove that $\lim_{n \to \infty} a^{\frac{1}{n}} = 1$ if $a >0$.  In my textbook, we are given a suggestion to let $a^{\frac{1}{n}} = (1+h_n)$ and then show that the $h_n$ term goes to zero using a Theorem that states the following conditions:  $\lim_{n \to \infty} = \infty,$ if $a >1, 1,$ if $a = 1,$ and 0, if $\vert a \vert < 1$. I apologize for not formatting the above cases appropriately; I could not figure out how to use a giant left brace to group them altogether.  If I rewrite it as $a^{n^{-1}}$, then I thought that this might help, but I don't think the Binomial Theorem would then apply since the exponent is negative. Furthermore, the problem is only concerned with the positive, real $n$-th roots. I am quite stuck on this problem and any suggestions or advice would be greatly appreciated.   I am using the textbook Introduction to Analysis by Arthur Mattuck.


I have the task of trying to automate a email where if two conditions are met, then send the email. I am mostly there. Code is as follows: function dateSender() {   var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("emails");     var Lastrow =sheet.getLastRow();   for (var i = 2;i<=Lastrow;i++){       var person = sheet.getRange(i,8).getValue();   var Emails = sheet.getRange(i,2).getValue();   var body = sheet.getRange(i,9).getValue();   var currentValue = sheet.getRange(i,3).getValue();     var Date = sheet.getRange(i,5).getValue();   if (currentValue == ("'Open'") && Date == today){      MailApp.sendEmail(Emails,person,body)   } } }  it works as far as the if cell is open then sends, but when I ad the date portion things don't send. I want it to be if the cell value is open, and the date is equal to today, then send the email. Thanks in advance.

Can someone suggest a way to compare the values of two dates greater than, less than, and not in the past using JavaScript? The values will be coming from text boxes.


I have Ubuntu version 14.04.2 installed and want to upgrade to 14.04.3 (Kernel 3.19 has few fixes for me)  When I do  cat /etc/lsb-release   I get  DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"   But I still have 3.16 Kernel, I never got any message about upgrade and when I do   do-release-upgrade   (either with -d or -p) I get  Checking for a new Ubuntu release No new release found   I tried to reboot, for the case that I missed the upgrade, but nothing  I also have set  Prompt=lts   in  /etc/update-manager/release-upgrades   How can I get the upgrade?  Thanks ^^

I am not looking for a workaround or a hack.  I am just confused.  14.04.1 has been released now for a week, and one of my machines which is on 12.04, and another one which is on 14.04 both don't have the upgrade options.  I see there is a 14.04.5 release on august 7th but I am not sure what a candence event is.    It is hard to believe that it is not an issue that is going to be resolved otherwise I would hope this would be posted on the Ubuntu blog.  I cant be the only one on the last LTS waiting for it to update so I can finally go to the latest kernel and properly use my core i7 graphics.


I know that when you use lenses made for full frame cameras on a APS-C camera, you should calculate the crop factor. E.g., a 35mm lens designed for a full frame camera mounted on a APS-C body should give a field of view as if you used a 50mm lens on a full frame camera.  But there are lenses designed for APS-C cameras. For example, the AF-S DX Nikkor 35mm f/1.8G. When I was reading reviews, everywhere they mentioned that this lens is equivalent to a 50mm lens used on a full frame camera.  I am confused here, because this lens is made for a crop camera. And I think that when I am shooting a 35mm lens, I will actually get a 35mm field of view.  Let's say it otherwise: Does a 35mm DX lens mounted on a APS-C camera have the same field of view as a 35mm lens (made for full frame) mounted on a full frame camera?  Edit: Sorry for my grammar but my English is not native, and I am not so fluent with it. Basicaly my question is the following:  If I am shooting with my crop camera with a lens build for crop camera on it at 35 mm focal lenght, should I have same picture result as if Someone is shooting with Full-frame camera packed with full frame lens at same focal lenght of 35mm  This confusion became to me, as I was reading a lot of reviews for a lenses build for crop camera, where they keep saying that if I use lens for crop camera on a crop camera, I have to keep on mind that it is equivalent of shooting with 50mm lens (full frame lens) on a full frame body.

I have a Canon 7D, which has a crop factor of 1.6x.  When using a Canon EF-S lens I get the focal length stated on the lens, when using a Canon EF lens I get the focal length times 1.6 when used on the APS-C body. At least that's what I thought.  I just compared two lenses:   Canon EF-S 15-85mm f3.5-5.6 Canon EF 70-200mm f4   .  The top photo is shot with the 15-85, the bottom photo with the 70-200 - both lenses are set to 70mm. Now why do they look the same?  I thought I would get 112-320mm (70mm*1.6 crop factor). What did I misunderstand about the crop factor calculation? Lightroom also displays the photos as having "70mm" and not 112mm.


I want do sorting by property ALL data in my db and ONLY AFTER that use LIMIT and OFFSET.  Query like this:  SELECT select_list     FROM table_expression     [ ORDER BY ... ]     [ LIMIT { number | ALL } ] [ OFFSET number ]    I know the sorting ends as soon as it has found the first row_count rows of the sorted result. Can I do sorting all data before calling LIMIT and OFFSET?

Is there a way to make an Oracle query behave like it contains a MySQL limit clause? In MySQL, I can do this: select *  from sometable order by name limit 20,10  to get the 21st to the 30th rows (skip the first 20, give the next 10). The rows are selected after the order by, so it really starts on the 20th name alphabetically. In Oracle, the only thing people mention is the rownum pseudo-column, but it is evaluated before order by, which means this: select *  from sometable where rownum <= 10 order by name  will return a random set of ten rows ordered by name, which is not usually what I want. It also doesn't allow for specifying an offset.


I currently have dual boot with Windows and Ubuntu 15.04  When I try to upgrade using Software Updater, it shows that your software is up to date.  I do not want to do it directly using external cd/usb with ubuntu 16.04 image.  UPDATED IMAGE :     After clicking on upgrade button it closes and nothing happens.

Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found:  $ sudo apt-get install vlc Reading package lists... Done                Building dependency tree        Reading state information... Done     E: Couldn't find package vlc


I am doing one hobby project, using STM32F103R8T6 Micro controller for my project, now I am using JTAG pins to program the controller. I will keep on modifying the firmware for my project, in this case which terminology is helps me to keep on updating my firmware. I am looking just plug and program kind of solution.  1) USB transceiver  2)Boot loader   Having USB transceiver is easy option or Having bootloader is easy option

I am doing one hobby project, using STM32F103R8T6 Micro controller for my project, I would like to use USB transceiver for this micro controller,  does this helps me to update my firmware program through USB interface or do I need to have separate programmer for uploading firmware to microcontroller.


There are a few "XKCD password" generators out there, but the task seems so straight forward, so I wanted a compact and simple solution. My requirements were:   One-line alias (or few-line function) to put in .profile Standard Unix commands (require no packages) Column output (like pwgen) Titlecase words (for readability)   (I'm happy to renounce command line options in exchange for simplicity.)  for i in {1..32}; do grep -E "^[a-z]{4,8}$" /usr/share/dict/words | gshuf -n4 | gsed 's/.*/\u&/' | tr -d '\n' | awk '{print $1}'; done | column   Current problems:   shuf requires brew install coreutils on macOS (which I also use) sed requires brew install gnu-sed (ditto) tr -d '\n' | awk '{print $1}' seems silly.   How can I make a short, yet readable command line that works on both Linux and macOS?  On a side note I found that by using SCOWL, which has a range from short word lists with common names to long word lists with obscure words, you can trade-off memorability Vs. entropy.

For start, we know how can we output random lines from a txt file:   perl -MList::Util -e 'print List::Util::shuffle <>' words.txt   But we need a general solution (perl is usually installed on every unix-like OS) to output 4 random words from a txt file, how can we do it?    $ cat words.txt ... alpha beta gamma delta epsilon ... $   The "..." represents many other words.   Example output (without newline between them, but one unix newline is needed at the end, spaces should separate them):  $ perl SOMEMAGIC words.txt gamma alpha delta beta $   Using only perl, the shortest possible solution (oneliner).   It will be used as human memorable password generator:    Since afaik perl is enough good to be named "random generator".   Example common english wordlist with 32768 unique lines:


I would like to fit a model to a dependent variable distributed like the one below (see picture).    The distribution is a count of people (with specific characteristics) in various districts. This means that, there are no negative numbers; in the great majority of districts the variable is 0, but there also exists very large numbers (up to 80,000) with very low frequency.  Following Moti Nisenson's advice, I edit some graphs into this post that make the distribution clearer. If I drop all 0, the graph looks the same because there are a lot of 1's, 2's, etc.  If I drop all < 100, it looks like this:    If I drop all < 1000, it looks like this:     If I drop all < 5000 it looks like this:     My goal is to find a regression that does well in predicting the zeros and, more importantly, the extreme values in the right tail of the distribution.  I understand that Ordinary Least Squared is not ideal here. I have looked into Poisson regressions which seem to be a great deal more adequate for my purposes.   Is there any regression model that is even more appropriate? Which else options might be helpful?  Additional edit: These are the summary stats. The Variance is much (much) higher than the mean which according to  is a sign that Poisson is not appropriate.   Additional edit 2: Here is the distribution of the variable in log as requested.

I am struggling to understand zero inflated distributions. What are they? What's the point?  If I have data with many zeroes, then I could fit a logistic regression first calculate the probability of zeroes, and then I could remove all the zeroes, and then fit a regular regression using my choice of distribution (poisson e.g.).  Then somebody told me "hey, use a zero inflated distribution", but looking it up, it does not seem to do anything differently than what I suggested above? It has a regular parameter $\mu$, and then another parameter $p$ to model the probability of zero? It just does both things at the same time no?


Following Rinzwind's kind advice as to how to detect a pending scheduled shutdown, I hit the following problem (on a fairly fresh Ubuntu 64bit 16.04.1 server install):  root@m________a:~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 16.04.1 LTS Release:    16.04 Codename:   xenial root@m________a:~# shutdown +5 Shutdown scheduled for Sun 2016-10-16 20:18:40 BST, use 'shutdown -c' to cancel. root@m________a:~# systemctl status systemd-shutdownd.service ● systemd-shutdownd.service    Loaded: not-found (Reason: No such file or directory)    Active: inactive (dead) root@m________a:~#    Yes, I have systemd-suspend.service, and also -halt, -poweroff, and -reboot services.  Where is the shutdown service?  Shutdown still works!

Before systemd, one used to be able to see a shutdown process in the list of processes (e.g. ps -ef | grep shutdown).  Now however, the most recent advice I can find is to use systemctl status, but I'm not having any luck:  root@m________a:~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 16.04.1 LTS Release:    16.04 Codename:   xenial root@m________a:~# shutdown -r 14:00 Shutdown scheduled for Mon 2016-10-10 14:00:00 BST, use 'shutdown -c' to cancel. root@m________a:~# ps -ef | grep "shutdown" root     10584 10508  0 13:44 pts/0    00:00:00 grep --color=auto shutdown root@m________a:~# systemctl status systemd-halt.service ● systemd-halt.service - Halt    Loaded: loaded (/lib/systemd/system/systemd-halt.service; static; vendor preset: enabled)    Active: inactive (dead)      Docs: man:systemd-halt.service(8) root@m________a:~# systemctl status systemd-reboot.service  ● systemd-reboot.service - Reboot    Loaded: loaded (/lib/systemd/system/systemd-reboot.service; static; vendor preset: enabled)    Active: inactive (dead)      Docs: man:systemd-halt.service(8) root@m________a:~# systemctl status systemd-poweroff.service  ● systemd-poweroff.service - Power-Off    Loaded: loaded (/lib/systemd/system/systemd-poweroff.service; static; vendor preset: enabled)    Active: inactive (dead)      Docs: man:systemd-halt.service(8)   I would be very grateful if anyone can explain how I can detect a pending scheduled shutdown and, indeed, why such a shutdown doesn't seem to show up using systemctl


Is the operator $(\cdot)^{\frac{1}{p}}$ subadditive for $1<p<\infty$? I am aware that the square root operator is subadditive for positive numbers, as for $a,b > 0$: $\sqrt{a+b}\leq \sqrt{a}+\sqrt{b}\iff a+b\leq a+2\sqrt{a}\sqrt{b}+b$ and the last statement is trivially true since $\sqrt{a}\sqrt{b}\geq 0$. How can I generalize this proof for $p\in (1,\infty)$? Is the assumption on non-negativity of $a$ and $b$ necessary?

Let $f: [0, \infty) \to [0,\infty)$ be concave, meaning;  $$ f(tx + (1-t)y) \ge tf(x) + (1-t)f(y)$$  for $t \in [0,1]$. Also, assume $f(0) = 0$. I trying to show $f(x+y) \le f(x) + f(y)$ but I fail. Is there any advise you can give me for help? I appreciate.


If I have two cards called  in hand and I play my first, Sin Collector (A). I use its triggered ability.   "When Sin Collector enters the battlefield, target opponent reveals his or her hand. You choose an instant or sorcery card from it and exile that card."  Now, I play Sin Collector (B), I use B's triggered ability.  But now my question. Does Sin Collector (A)'s ability trigger again as well? 'Sin Collector' entered the battlefield again, right?

Many abilities in MTG use a permanent's name in the ability. Does this mean that if I have 2 copies of that permanent, the ability will affect both permanents?  Activated ability example:  - If I activate the ability of one of my Vector Asps, can I choose which of them gain infect until end of turn? Or will they both gain infect?  Triggered ability example:  - If I cast a second Sin Collector, when it enters the battlefield, will each Sin Collector trigger and allow me to exile a total of 2 cards instead of 1?


In the lectures by Prof. Leonard Susskind, he mentioned that the total angular momentum squared operator can be represented by  $$ L^2 = L_z^2 + L_z + L_- L_+ $$  ($L_+, L_-$ being ladder operators). He then used it to show the $L^2$ of $|m\rangle$ is $m(m+1)$  ($m$ stands for magnetic quantum number). Finally, he proposed that if $L_-$ commutes with $L^2$ (which is true) then all $(2L+1)$ states will have same $L^2$. However if I apply $L^2 = L_z^2 + L_z + L_- L_+$ to $|m-1\rangle$ directly, it will give me $m^2-m+1 != m(m+1)$  I would like to know where is the flaw in my calculation.

I am watching Susskinds's lecture , in which he introduced square angular momentum operator $L^2$, which can be written as $$ L^2=L_z^2+L_-L_++L_z $$ where $$ L_\pm=L_x\pm iL_y $$  Besides, he argued that the spectrum of $L$ can only be $m,m-1,\cdots,-m+1,-m$ in which $m$ is an integer or half-integer. If we denote $|m\rangle$ the eigenvector corresponds to eigenvalue $m$, we have $$ L_\pm|l\rangle=|l\pm 1\rangle\;\text{or}\;0 $$  In the lecture he showed that $L^2|m\rangle=m(m+1)|m\rangle$ for $m$ the highest eigenvalue, by $$ \begin{align*} L^2|m\rangle&=L_z^2|m\rangle+L_-L_+|m\rangle+L_z|m\rangle\\ &=m^2|m\rangle+0+m|m\rangle\\ &=m(m+1)|m\rangle \end{align*} $$  Then he left an exercise to show that for any $-m\leqslant l< m$, we also have $|l\rangle$ is an eigenvector of $L^2$ with eigenvalue $m(m+1)$.  In the lecture, he hinted by showing that it suffices to show that $L^2$ commutes with $L_i$ for $i=x,y,z$, which gives us $$ L^2|m-1\rangle=L^2L_-|m\rangle=L_-L^2|m\rangle=L_-m(m+1)|m\rangle=m(m+1)L_-|m\rangle=m(m-1)|m-1\rangle $$  I believe it is true since I find the   online.   However, my question is that, why the following proof is wrong.  I tried to mimic the proof for $|m\rangle$ to have that  $$ \begin{align*} L^2|k\rangle&=L_z^2|k\rangle+L_-L_+|k\rangle+L_z|k\rangle\\ &=k^2|k\rangle+L_-L_+|k+1\rangle+k|k\rangle\\ &=k^2|k\rangle+|k\rangle+k|k\rangle\\ &=(k^2+k+1)|k\rangle \end{align*} $$  which shows that $|k\rangle$ does not have eigenvalue $m(m+1)$ but $k^2+k+1$ for $k<m$.


I created one new class which is publicly inherited from the string class. I wish to overload the  < (less than) operator in the derived class. But from the overloaded function I need to call the parent class < operator. What is the syntax for calling this function? I would like to implement the operator as a member function if possible.  In Java there is super keyword for this.  My code is given below.  #include<iostream> #include<string> using namespace std;     class mystring:public string     {      bool operator<(const mystring ms)      {       //some stmt;       //some stmt;       //call the overloaded <( less than )operator in the string class and return the value       }      };

How do I call the parent function from a derived class using C++? For example, I have a class called parent, and a class called child which is derived from parent. Within  each class there is a print function.  In the definition of the child's print function I would like to make a call to the parents print function.  How would I go about doing this?


I have a database table and two columns are being saved differently.  Table  id     title             description ----------------------------------------------------------- 1      Test - ñ          &lt;p&gt;&ntilde;&aring;&lt;/p&gt;   As you could see the title was being saved as is and no encoding is being done. The description however is saved as an encoded string (it stands for
ñå
).  I'm having a bit of trouble displaying them correctly on a page.  Here are my approaches so far:  Title   echo $data['title']; - doesn't work and displays as Test - Ã±. echo html_entity_decode($data['title'], ENT_QUOTES, "UTF-8"); - still doesn't work and displays as Test - Ã±. echo html_entity_decode($data['title'], ENT_XML1, "UTF-8"); - still doesn't work and displays as Test - Ã±.   Description   echo $data['description']; - just shows
ñå
. echo html_entity_decode($data['description'], ENT_QUOTES, "UTF-8"); - doesn't work and just displays Test - Ã±. echo html_entity_decode($data['description'], ENT_XML1, "UTF-8"); - THIS SEEMS TO WORK although I'm not sure why setting ENT_XML1 fixes the problem with the description but not on the title.   Anyways, I'm not really knowledgeable about character encoding and HTML entities and special characters. Could you help me solve this problem so that both the title and description displays well. I'm not sure I'm doing the proper steps here but I was just trying different combinations of solutions.

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


In the analysis of Harmonic Oscillator, it is claimed that $\langle\hat H\rangle$ cannot be zero,  why is it so?  I mean $\hat H = \frac{ \hat p^2 }{2m } + \frac12 k \hat x^2$, and  $$\left<x^2\right> = \int dx (x\psi(x))^\dagger (x\psi(x)) = 0$$ would imply that $x\psi(x) = 0 \quad \forall x.$ In particular, this is true when $x = 0$, so we have two options; either $\psi(x) = 0$ or $\psi(x) = \delta(x)$.  So, why can't $\psi(x) = \delta(x)$ in the case of Harmonic oscillator ?  Note: $\hat H = \frac{ \hat p^2 }{2m } + \frac12 k \hat x^2 $

Hm, this just occurred to me while answering another question:   If I write the Hamiltonian for a harmonic oscillator as $$H = \frac{p^2}{2m} + \frac{1}{2} m \omega^2 x^2$$ then wouldn't one set of possible basis states be the set of $\delta$-functions  $\psi_x = \delta(x)$, and that indicates that the size of my Hilbert space is that of $\mathbb{R}$.  On the other hand, we all know that we can diagonalize $H$ by going to the occupation number states, so the Hilbert space would be $|n\rangle, n \in \mathbb{N}_0$, so now the size of my Hilbert space is that of $\mathbb{N}$ instead.  Clearly they can't both be right, so where is the flaw in my logic?