How to cast an integer to a boolean in a MySQL SELECT clause?

I'm new here so be kind to me. I have the following scenario:  I have many tables which, for the sake of simplicity, are represented in a View in my MySQL database. My problem is that I need a value in this view representing if it is one kind of event or another (a simple boolean), which I tried to achieve with:  `gu`.`StoppingUnitEventME` = `ese`.`MonitoringElement` AS `IsStopingEvent`   The result is represented as int, and so is read by Entity Framework. The problem is that I really need a boolean return value, which I tried to achieve with:  CAST((`gu`.`StoppingUnitEventME` = `ese`.`MonitoringElement`) as boolean) AS `IsStopingEvent`    This resulted in an error, one that is not displayed to me in MySQL Workbench (I only receive that annoying "You have an error in ...").  Can you guys please help me out?  Tried to solve it in my application, but I really preffer this solved in the database, since it will be used by other software later.


A.S. The question  answers only a part of my question as already mentioned in "EDIT" made shortly after this question was asked & answers here (below) are much detailed, in-context & easy to understand. Definitely not a duplicate; marking as duplicate for 2-3 points     I am reading a book on Arduino & I just do not understand the concept of push-up resistor, following is a quote from the book:           Why do we need the resistor R1? R1 guarantees that the Arduino’s digital input pin 7 is connected to a constant voltage of +5V whenever the push button is not pressed. If the push button is pressed, the signal on pin 7 drops to ground (GND), at the same time the Arduino’s +5V power is connected to GND, we avoid a shorted circuit by limiting the current that can flow from +5V to GND with a resistor (1 - 10 KΩ). Also, if there was no connection from pin 7 to +5V at all, the input pin would be “floating” whenever the pushbutton is not pressed. This means that it is connected neither to GND nor to +5V,  picking up electrostatic noise leading to a false triggering of the input.      Another book called it Arduino's pull-up resistance because it pulls current towards 5V, which confuses me even more - how can a resistor increase voltage, shouldn't the voltage drop?     Edit - thanks to @Golaž for pointing to helpful material at  , in comments (this edit was inserted on Mar 30 at ~6).      So, what is this whole concept? And which term push-up/pull-up is correct?  Also, with reference to that circuit above -   What is floating pin? How does R1 avoid a shorted circuit? Why does it count as short cicuit & not closed circuit. After all GND is a sink. Is a short circuit serious problem at mere 5V   I have already read:       But I still don't quite grasp it.


Correlation between two ordinal categorical variables

What is the best statistical test for investigating if there is any correlation between 2 categorical variables? Both are satisfaction scores: 1st variable is:  Overall satisfaction with the service. 1: Not at all satisfied; 10: Completely satisfied  2nd variable is:  Satisfaction with the availability of information for the service" 1: Not at all satisfied; 10: Completely satisfied.


Is there a command for this symbol in Latex? |=. If I use | and = in the source code, then in the pdf there is a big gap between them.  The symbol is from math (from logical clauses). I'm not exactly sure how to translate it in english, it kinda means "resolves" and it used like this c |= C.


"thanks for flagging" popup gets messed up when the comment is automatically deleted

For some comments, the comment is automatically deleted when you raise a flag. This includes certain keywords and short +1 comments. But when you raise that flag with the new comment flag interface, the "thanks for flagging" shows up in the top right when the comment is deleted:      As opposed to what happens when you raise a flag on a comment that doesn't auto-delete:


Prove $\exists \xi \in (a,b):f'(\xi)<1+f^2(\xi)$

Problem $f(x)$ is defined over $[a,b]$ and differentiable over $(a,b)$, where $b-a\geq 4.$Prove that there exists $\xi \in (a,b)$ such that $f'(\xi)<1+f^2(\xi)$. My Proof Since $b-a \geq 4$，we can obtain $$\exists x_1,x_2 \in (a,b):x_2-x_1>\pi.$$ Denote$$F(x):=\arctan f(x).$$ Obviously, $F(x)$ is continuous over $[x_1,x_2]$ and differentiable over $(x_1,x_2)$. Thus, By Lagrange's Mean Value Theorem，$$\exists \xi \in (x_1,x_2) \subset (a,b):F(x_2)-F(x_1)=F'(\xi)(x_2-x_1).$$ Further, $$\frac{f'(\xi)}{1+f^2(\xi)}=F'(\xi)=\frac{F(x_2)-F(x_1)}{x_2-x_1}\leq \frac{|F(x_2)|+|F(x_1)|}{x_2-x_1}<\frac{\frac{\pi}{2}+\frac{\pi}{2}}{\pi}=1,$$ Which implies $$f'(\xi)<1+f^2(\xi).$$ AM I RIGHT? HOPE TO SEE OTHER PROOFS. THX.


I have Canon EOS R which use SDXC cards, what is easier solution and light weight for do backup during travel?  I have 2 cards SANDISK SDXC EXTREME PRO 128GB and just in case would like to do additional backups of my cards to not lost all photo/video recorded during traveling for few weeks.


$\mathrm{Hom}$ and $^*\mathrm{Hom}$ for graded modules: Exercise 1.5.19(f) of Bruns-Herzog

Assume $R$ is a graded ring and $M$ and $N$ graded modules. Denote by $^*\mathrm{Hom}_R(M,N)$ the set of all homogeneous $R$-linear maps from $M$ to $N$. How can I prove that if $M$ is finitely generated then $^*\mathrm{Hom}_R(M,N)=\mathrm{Hom}_R(M,N)$? Do you have a counterexample of a not finitely generated module $M$ such that this equality doesn't hold?


Getting different answers when integrating using different techniques

Question:  Is it possible to get multiple correct results when evaluating an indefinite integral?  If I use two different techniques to evaluate an integral, and I get two different answers, have I necessarily done something wrong?    Often, an indefinite integral can be evaluated using different techniques.  For example, an integrand might be simplified via partial fractions or other algebraic techniques before integration, or it might be amenable to a clever substitution.  These techniques give different results.  For example, looking over a few other questions on MSE:      From : evaluate $$ \int x(x^2+2)^4\,\mathrm{d}x. $$    Via the substitution $u = x^2+2$, this becomes $$ \int x(x^2+2)^4\,\mathrm{d}x       = \frac{1}{10}x^{10} + x^8 + 4x^6 + 8x^4 + 8x^2 + \frac{32}{5} + C.     $$ However, multiplying out the polynomial and integrating using the power rule gives $$ \int x(x^2+2)^4\,\mathrm{d}x       = \frac{1}{10}x^{10} + x^8 + 4x^6 + 8x^4 + 8x^2 + C    $$     From :  evaluate   $$ \int \frac{1-x}{(x+1)^2} \,\mathrm{d}x. $$    Simplifying the integrand using partial fractions then integrating gives $$ \int \frac{1-x}{(x+1)^2} \,\mathrm{d}x       = \frac{-2}{(x+1)} - \ln|x+1| + C.    $$ Via integration by parts, we get $$ \int \frac{1-x}{(x+1)^2} \,\mathrm{d}x       = \frac{x-1}{(x+1)} - \ln|x+1| + C.    $$     From : evaluate   $$ \int \frac {\tan(\pi x)\sec^2(\pi x)}2\,\mathrm{d}x. $$    Using the substitution $u = \sec(\pi x)$, this becomes $$ \int \frac {\tan(\pi x)\sec^2(\pi x)}2\,\mathrm{d}x       = \frac {\sec^2(\pi x)}{4\pi} + C.    $$ Using the substitution $u = \tan(\pi x)$, this becomes $$ \int \frac {\tan(\pi x)\sec^2(\pi x)}2\,\mathrm{d}x       = \frac {\tan^2(\pi x)}{4\pi} + C.    $$


Why we do not use least squares in logit model?

I am very wondering why we do not use least squares instead of maximum likelihood?  for example we have 3 choices k= 1, 2 ,3  $minimizing: (e^{\beta_{i} X}/(1+\sum e^{\beta_{i} X})- Y)^{2} $   for i=1,2,3


I'm an Indian citizen. I want to transfer $20,000 to my son-in-law, who is a Canadian citizen living in US. My daughter is an Indian passport holder currently living in US on a H4 visa. I want to transfer the money as a gift. Can you please help me with the following questions:   Can I gift this whole amount to my Daughter/Son-in-law or what is the maximum limit of Gift amount? What will be the tax liability on me and on my Son-in-law in case of Gift? Whether I have to show it in my Income Tax Return?


I'm having some issues with the following validation rule:  AND(  OR( ISCHANGED(Sales_Rep__c), ISCHANGED(Secondary_Rep__c) ),  $User.Id<>"005A0000005sOAv", /*User1 */  $User.Id<>"005A0000007TTqR" /*User2 */   )   The intended function is that it is supposed to restrict the editing of either sales rep field, unless you're one of the 2 listed users trying to edit it. If you are one of these two, editing of the field is allowed.  Initial error resolved, was comma.  Issue to be resolved: Is there a way to reference a user in a validation rule other than by their ID? In Apex I know I can query. How should I go about not hard-coding in a validation rule?


gnome-sushi doesn't work after upgrade to 19.04. I tried to reinstall it, but no effect. After pressing space bar I catch this errors in dmesg  [116847.106625] sushi-start[5011]: segfault at 0 ip 00007f5364b2505f sp 00007ffd5aca7a90 error 6 in libgjs.so.0.0.0[7f5364aec000+66000] [116847.106632] Code: 00 e8 55 f7 00 00 4c 8b 04 24 48 8d 0d 4d 47 03 00 48 8b 7c 24 18 89 c6 31 d2 31 c0 e8 1a a0 fc ff 48 8b 7b 18 e8 a1 8d 00 00 <41> c7 07 01 00 00 00 e9 82 00 00 00 0f 1f 44 00 00 48 8b bb 78 01


Do the rules on counterspells make it possible to virtually ensure your spell is always cast?

Do the rules on counterspells essentially make it possible to always have your spells succeed?   (i.e...thus making high level one-on-one “cage match” wizarding duels simply a race to be first?)  In 5e, casting Counterspell requires a Reaction. Additionally, each character only gets one reaction.  Theoretically, that would mean that a wizard duel between two 20th level wizards could proceed like this:   Mage A casts a spell (Power Word Kill) using their Action Mage B casts Counterspell using their Reaction Mage A casts Counterspell using their Reaction Mage B has no Reactions left so the original spell is cast.  Mage B dies because the average wizard has less than 100hp.   Does this mean in mage-versus-mage combat, that a character casting a spell can essentially always ensure their spell gets cast as long as they have slots to cast counterspell at a level equal to their opponent’s?


Many words have several meanings and some even have two converse meanings. Two examples of such words are amateur and literally as illustrated by the following:   She is an art amateur. This is amateur work.   and   Don't take my remarks literally. He literally lost his mind for a few seconds.   Which other words from the common vocabulary do display this feature? (Less common examples are also welcome!) Does this feature have a name?


What is the safest way to complete String digits with zeros in Java?

Let's suppose the following inputs for Java 8 method:  String a = "12345678";  String b = "123456";   What's the most elegant and safe way to have this as a result?  a -> "0012345678"; b -> "0000123456";   I want to have a fixed size String variables that are completed with zeros to the left.


Can I make something like a 'snapshot' of the loaded packages?

Currently may document is not very big, however when using Texworks and have a look at the output prompt what is showing what latex currently does when compiling, nearly 90% of the compilation time it is loading all of the packages and styles mentioned in  the preamble.  Could there be a way in dramatically speed up the process of compiling in let him load all of the packages and options and save this 'state' in some way? Looking at the externalize of tikzpicture he compile the tikz code once when something has changed and then pack it in a .pdf  Is there a way doing the same with loaded packages? I would say the packages will not change after each compile so reload them every time is redundant?  I hope you see what I mean, but maybe I am fault here as still being very nooby.


I'm pretty new to all of this and I apologize in advance if (as, I'm sure it has) this question has been asked and answered a million times previous, but I couldn't find anything through searching (which might speak to my less than ideal google-fu).   I understand intuitively that the Vigenere cipher is insecure because the fact that the keyword is shorter than the plaintext will inevitably lead to repeated patterns and that probabilistically you can then crack the whole thing. Then, using , we know that the KEY must be at least just as long as the PLAINTEXT and therefore key-sharing gains us nothing.  But, what would be the problem with sharing some resource as our keyword. Like for instance, what if we agreed that our keyword would be Moby Dick? Then, we only need to share the TITLE of the book and then we have access to something that could be longer than the plaintext? Or, even more secure, what if we pick a de dicto key - something that picks out a changing element. For instance, if we choose "The Leftmost Column of the NY Times" - that changes on a day-to-day basis, but is always going to be secure?  I'm just a bystander curious about what he's missing and/or misunderstanding. Thanks.


Applying for UK visa. Can I add one more application to the same envelope?

Thank you in advance for your help with this matter! I've been struggling with the VFS website for days!  So I created separate applications on the website for me, my husband, and my daughter. Then I was asked to register at VFS. Unfortunately, I registered my daughter's application before I create the family application. As a result, there is no way I can add her to the family "bundle." When I purchased the round-trip courier service, only my husband's and my GWF numbers are there. Can I still use the shipping labels for all three of us? The three of us will go for the biometrics appointments together, and the labels themselves do not show GWFs. Thanks!!


I know, this problem is quite ordinary, and given enough time, I might be able to figure this one out myself, but I am also a little bit pressed for time. I'd like to include the following sentence in an application paper for a conference:  The philosophical question What is truth?, and the seemingly “moral” question What is good (behavior)?, ultimately refer to the same process...  Simple question: Is the punctuation admissible in formal english?  Thanks and best regards


What should I scale my banner down to and at what resolution?

I am making a banner for my company at about 8 x 4.5 feet. I'm wondering what I should scale the format down to and what resolution it would require for the company to be able to scale it and print it that big?


Transit visa or air transit visa via London Heathrow

I am a research student from India working in European funding project in University of Pisa, Italy.  My Schengen visa will expire on Jan 8 2017. But I have scheduled to stay until February 8 2017 in Italy.  I am travelling from Pisa to Delhi via London Heathrow on February 8th 2017. Transit time of 2 hours 30 minutes before I catch the connecting flight via British airways. I don't even need to cross immigration area or leave the airport. Though my visa will expire, I still hold the valid residence permit issued by Italy until February. Having this card am I eligible to be exempted from needing a transit visa or air transit visa? I am using British Airways.


Why does $E = 0$ inside conducting sphere?

Given this picture, I've understood that giver r>R, E = q/(4πεR^2) but I just can't get why inside the sphere, E equals 0? And the notes don't explain something. I've tried to look it up on the web and found similar examples that don't explain it either...


Can't install Lubuntu  the 'grub-efi-amd64-signed' package failed to install into / target/. without the grub bootloader the installed system will not boot  On a Macbook Air late 2010?


How do I comprehend the usage of *(3,4) in a.reshape(3,*(3,4))?

import numpy as np a = np.arange(36) print a.shape   (36,)  a = a.reshape(3,*(3,4)) print a.shape   (3,3,4)  Firstly, I think *(3,4) may be a parameter. So I  help(np.reshape).  a : array_like     Array to be reshaped. newshape : int or tuple of ints     The new shape should be compatible with the original shape. If     an integer, then the result will be a 1-D array of that length.     One shape dimension can be -1. In this case, the value is inferred     from the length of the array and remaining dimensions. order : {'C', 'F', 'A'}, optional     Read the elements of `a` using this index order, and place the elements     into the reshaped array using this index order.  'C' means to     read / write the elements using C-like index order, with the last axis     index changing fastest, back to the first axis index changing slowest.     'F' means to read / write the elements using Fortran-like index order,     with the first index changing fastest, and the last index changing     slowest.     Note that the 'C' and 'F' options take no account of the memory layout     of the underlying array, and only refer to the order of indexing.  'A'     means to read / write the elements in Fortran-like index order if `a`     is Fortran *contiguous* in memory, C-like order otherwise.   I can not find the correct parameter which can match *(3,4).So how can I comprehend the usage of *(3,4) in this way?


Can the notion of vector space or algebra over a field be meaningfully extended to fractional dimensions, so that for example $\mathbb{R}^{-2/3}$ makes sense? Has this been explored somewhere?  I know that super vector spaces can be thought of as one way of generalizing vector spaces to negative integer dimensions. Is there a similar concept for dimensions that are rational numbers? I'm not talking about Hausdorff dimension, because it doesn't allow for negative rationals, and I'm rather looking for extensions from a more algebraic point of view (dimension as the trace of the identity map), without recurring to a given metric.


LaTeXiT only renders the bottom half of the equation

When I try to use LaTeXiT it only shows the bottom part of the equation, I have no idea what is causing this problem, I've searched the web about it but can't find anything related. It occurs not only on math eqs. but anything. I am on mac OS High Sierra.  Thanks


I have a symmetric matrix $B$ (actually a covariance matrix of a set of variables) and I want to write it in the form of $AA^{T}$. How can I get $A$? Thanks.


Add the “review” link in the topbar on "private beta" sites if I am able to review any review queue

I committed and joined  in private beta. As per private beta privilege page casting close and reopen votes requires only 1 reputation. So anyone is able to access close votes and reopen votes review queues. But there is no link of the review page in the top bar or anywhere. So I thought I am not able to access any review queue. I opened the review page by typing the URL manually (to see review statistics for curiosity). But I found that I can access close & reopen votes review queues.        Probably I won't be able to access any review queue if I have less than 350 and the site goes to public beta. But during private beta off topics, unclear, or closable questions are likely to come. So it is very important to close/reopen them during private beta.  So can we please add the "review" link in the top bar if I am able to review some queues?


I've received an email from a native English-speaking colleague containing the following bit:  Can anyone help with the request? If so, let George and I know.  It really seems wrong to me, and I want to change I for me. What is the correct way and why?


I have a user configuration GPO (nothing on the computer side and computer configuration is disabled), linked to a user only OU.  I need to filter the users on which the GPO apply. When using specific users or groups in the security filtering, the GPO is not applied on the user side : "Not applied (unknown reason)." When using the default "Authenticated users" group the GPO is applied.  I'm on a W 2012 R2 domain with W10 clients.  I'm lost. Any ideas ?


What was the first bit of mathematics that made you realize that math is beautiful? (For children's book)

I'm a children's book writer and illustrator, and I want to to create a book for young readers that exposes the beauty of mathematics. I recently read Paul Lockhart's essay  and found that I, too, lament the uninspiring quality of my elementary math education.  I want to make a book that discredits the notion that math is merely a series of calculations, and inspires a sense of awe and genuine curiosity in young readers.  However, I myself am mathematically unsophisticated.     What was the first bit of mathematics that made you realize that math is beautiful?   For the purposes of this children's book, accessible answers would be appreciated.


I am teaching myself python and am writing a few scripts to better understand certain things.  I was wondering why this returns 0 rather than 27.  If this were java I beleive it would return 27 (I initialized a variable and later called a function that changed the variable). What is going on?  result = 0;  def cube(x):     result = x * x * x  cube(3)  print(result)


Hi, As we know that C# does not support multiple inheritances in classes. But I need to do add the feature of both ClassA and ClassB in MyClass:   public class ClassA {     public long Account_ID { get; set; } } public class ClassB {     public string Name { get; set; } } // I want to  achieve Something like this public class ClassC : ClassA, ClassB {     Public String AccountName {Get;Set;}     // To do Other Stuff }      I am getting This error:  C# Class cannot have multiple base classes: and  Is there any way I can achieve this? Thank you very much :)


How to prove that this polynomial is larger than another for positive reals?

Let $a, b$ and $c$ be positive real numbers. Prove that   $$a^2 b + b^2 c + c^2 a + ab^2 + bc^2 + ca^2 \ge 6abc$$   I have tried factoring with no success for the better part of an hour or so.  How can I go about this?


I just made an image of a freshly installed dual boot (Ubuntu and Windows) using this command (which I've been using for a while for smaller images):  dd if=/dev/sda | gzip > /mnt/drive.img.gz   On this drive less than 60G out of 500G are used. Nevertheless that image-file now is 409G big.   How is that? Shouldn't gzip manage to compress all those zeros? As I said, it is a freshly installed system. It couldn't be that cluttered.  Now I didn't expect for the file to be 60G, but 400G seems very huge to me.


How to elevate PowerShell without closing the actual one?

Ok, so this is something that tends to happen that involves trying to run a command such as "rm -r" or something alike, and you realize you are not elevated to admin rights on that PowerShell window. Normally you'll have to open the start menu, select the PowerShell icon, and rightclick it to select "run as admin". So, how do I avoid all that steps?


If time is the 4th dimension, which is more accutate?

If time is the 4th dimension, I can think of 2 ways to describe the flow of time. Either matter is moving forwards along the t axis, or space is. In the former, each particle has its own time and "exists" only once, while in the latter, everything Big Bang to Heat Death already exists, and space is just going through it, like frames in a movie. Are  any of the 2 correct? Do we even know? And, if neither are, how does it actually work?


Is there a pattern using Linq to dynamically create a filter?  I have the need to create custom filtering on a list, in the past I would just dynamically create the SQL...it doesn't seem like this is possible with Linq.


Does Quantum Mechanics say that anything is possible?

I may be incorrect in this, but doesn't Quantum Mechanics state that everything has a probability of occurring (with some probabilities so low that it will essentially never happen)?  And if I am correct in my thinking, could it mean that, quite literally, anything has a possibility despite a potentially low probability?  (A version of my idea, which I admit closely borders on fictional magic, would be:  It is completely possible to walk through a wall, but the probability is so low that you need to walk into a wall for eternity before it can be done.)


Python: updating a single item in a list, updates the entire list

I have a piece of code that should be updating a single item in a list but instead updates the entire list.   Here is the code  a = [   [(0, 0), (3, 4)] ] board = [[0] * 5] * 5  for solution in a:     for _x, _y in solution:         board[_x][_y] = 1  print(board)   Expected output:  1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0   Actual output:  1 0 0 0 1  1 0 0 0 1  1 0 0 0 1  1 0 0 0 1  1 0 0 0 1


Is there a way to force Windows to create all Thumbnails for a Directory?

As default Windows (or in my case Windows 7) creates the Thumbnails for Files based only on the "current view position" of the Explorer Window. And you need to scroll for more Thumbnails being created. But I want it to create all of the Thumbnails for the Files inside a Directory when I open this Directory in Explorer so I dont need to trigger it manually by scrolling down and wait for them to be created. Is there a way to configure Windows or by using a Extension to make this work?


Please pause the timer when hovering question in "Realtime Questions" on Stack Exchange

There is cool  tab on Stack Exchange portal, showing questions as they're being asked or modified. So far so good. There is a timer running live (got much worse, used to be every 10 seconds in the past) that will update the list, adding new questions on top and pushing all the rest down. Suppose I saw something interesting and I want to click it - I'm not quick enough and while I'm hovering it ready to click, the timer is executed and push it downwards. Fail. Now it's a game of "catch me if you can" which might be fun... or not. Can the timer please be paused while we're hovering the list of questions, at least for a certain amount of time? (in case we just leave the mouse there by mistake) Another option is adding a pause icon:


Finitely generated $\mathbb{C}$-subalgebras of $\mathbb{C}[x]$.

So I am to prove that every $\mathbb C$-subalgebra of the ring $\mathbb C[x]$ is a finitely generated $\mathbb C$-algebra.  So.. what I know is:   $\mathbb C$ is Noetherian and thus $\mathbb C[x]$ is too. Every finitely generated $\mathbb C$-algebra is a quotient of $\mathbb C[x_1,...,x_n]$.   Well, I am not even sure how to use these two things to begin with. Any help?


Determine if inside \lstinline or ordinary lstlisting environment

My editor requires me to have a non-white background in my code listings. In order to make my code listings look nicer, I use the literate setting of listings to change underscores (which are very wide in the T1 font encoding) into narrower rules. Since I want the reader to be able to copy code from the PDF into a text editor and get syntactically valid code out, I am currently inserting an "invisible" textual underscore in addition to the rule.  I make the underscore invisible by using \textcolor to make it the same color as the non-white code listing background. However, this doesn't work when I typeset code with \lstinline where the background is white.  Thus I want the color of the underscore to change: In the lstlisting environment it should be grey, and in \lstinline it should be white. How do I achieve this?  Minimal Working Example:  \documentclass{article} \usepackage[T1]{fontenc} \usepackage{color,listings} \lstset{backgroundcolor=\color[rgb]{0.85,0.85,0.86},         literate={_}{\niceunderscore}1} \newcommand{\niceunderscore}{%   % Invisible underscore that can be copied in the PDF:   \makebox[0pt][l]{\makebox[3pt][c]{%     \textcolor[rgb]{0.85,0.85,0.86}{\_}}}%   % Visible, noncopyable rule:   \rule[-0.4pt]{3pt}{0.4pt}} \begin{document} This is what \lstinline+foo_bar+ looks like: \begin{lstlisting} foo_bar \end{lstlisting} \end{document}     As you can see, the underscore is visible as a grey character below the black rule in the inline text, but in the lstlisting environment, it is invisible like I want it to be.


Limit Comparison Test for Series when n is in the Exponent

I am really struggling with coming up with comparison series for doing the Limit Comparison tests, especially when $n$ is in the exponent.  For the series $$\sum_{n=0}^\infty  \frac{n +2^n}{n+3^n} $$  Could some walk me through how to find a comparison series for this question to determine convergence or divergence? I can only use the comparison test and not another test.  I want to compare it to $$\sum_{n=0}^\infty  = \left(\frac{2}{3}\right)^n $$ Which is a convergent geometric series with $|r| = \frac{2}{3}<1$, but this answer is wrong and I am stumped.


gcd and lcm from prime factorization proof

How should I approach obvious proofs like these    I have been trying but couldn't find an elegant way to work these. Any help is highly appreciated ! Especially looking for a nice proof/hint for first problem


My friend has a 2011 iMac from his Dad, we play a computer game which has had an update which now means his old OS wouldn't run it, it needs at least Mountain Lion, so after lots of research he took the plunge and bought Mountain Lion from the Mac Store for £20... however once he received the email with the download link and pressed it, it asked for a password... however the login account does not have a password and his Dad does not know what the password could be...  Is there a way to download this new OS system which we have paid for without the password?


How to start SharePoint Workflow programmatically using CSOM

I am trying to start share-point workflow using CSOM(Client side object model) by following means of code. But i got the following error from the line mark in comment. Please help me to figure out this error.     Error :- Cannot invoke method or retrieve property from null   object. Object returned by the following call stack is null.   "GetWorkflowDeploymentService new   Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager() "    public bool StartWorkFlow()  {     string workflowName = "UpdateDealStatus";     // connect to the workflow services via a CSOM client context    var workflowServicesManager = new WorkflowServicesManager(_sharepoint,                  _sharepoint.Web);    // connect to the deployment service    var workflowDeploymentService = workflowServicesManager.GetWorkflowDeploymentService();    // get all installed workflows   var publishedWorkflowDefinitions =    workflowDeploymentService.EnumerateDefinitions(true);             _sharepoint.Load(publishedWorkflowDefinitions);     try    {       _sharepoint.ExecuteQuery();//Error thrown from this line    }    catch (Exception ex)    {      }     // find the first workflow definition    var firstWorkflowDefinition = publishedWorkflowDefinitions.First();     // connect to the subscription service    var workflowSubscriptionService = workflowServicesManager.GetWorkflowSubscriptionService();     // get all workflow associations    var workflowAssociations = workflowSubscriptionService.EnumerateSubscriptionsByDefinition(firstWorkflowDefinition.Id);     _sharepoint.Load(workflowAssociations);    _sharepoint.ExecuteQuery();     foreach (var association in workflowAssociations)    {        Console.WriteLine("{0} - {1}",        association.Id, association.Name);    }     return true; }


Which spells are "on the sorcerer spell list" for an Aberrant Mind or Clockwork Soul sorcerer?

Some magical items, such as spell scrolls, work only if a given spell is on the caster's spell list. For example, the description of a  states:  A spell scroll bears the words of a single spell, written in a mystical cipher. If the spell is on your class’s spell list, you can read the scroll and cast its spell without providing any material components. Otherwise, the scroll is unintelligible. [...]  The 's  feature and the 's  feature (TCoE, p. 67-68) grant access to additional spells not on the general sorcerer spell list:  You learn additional spells when you reach certain levels in this class, as shown on the [Psionic/Clockwork] Spells table. Each of these spells counts as a sorcerer spell for you, but it doesn't count against the number of sorcerer spells you know.  Additionally, it is possible to swap these spells at level up:  Whenever you gain a sorcerer level, you can replace one spell you gained from this feature with another spell of the same level. The new spell must be [a divination or an enchantment spell/an abjuration or a transmutation spell] from the sorcerer, warlock, or wizard spell list.  Do the additional spells from the Psionic/Clockwork spell tables count as being on the Aberrant Mind or Clockwork Soul sorcerer's spell list? What about the spells that can be learned by swapping the Psionic/Clockwork Spells out?


apache2 https redirect to http without ssl cert

We have an apache server which hosts multiple domains from, which  some have https enabled and some do not.  Now the problem is that if I access  I will come to the content of .  I would like to  forward the user from  to  on all domains whithout https. I have tried to create a redirect rule in virtualhost *:443 but this creates the following error:  Server should be SSL-aware but has no certificate configured  The problem is that I cant change "Listen 443" to "Listen 443 http" as this would break my hosts with ssl enabled.  Is there a way I could have a redirect without a ssl certificate ?  Or if not possible  can you propose an alternative which would ensure that   does not show the content of   .  My ports.conf   NameVirtualHost *:80 Listen 80 NameVirtualHost *:443 Listen 443   mi site condfig:  <VirtualHost *:80>  DocumentRoot /path/to/dr  ServerName  exampleWithoutHttps.com  ServerAlias www.exampleWithoutHttps.com </VirtualHost>  <VirtualHost *:443>  ServerName  exampleWithoutHttps.com  ServerAlias www.exampleWithoutHttps.com  Redirect permanent /   http://www.exampleWithoutHttps.com/ </VirtualHost>


How do I remove home folder from the desktop?

I don't know how I changed this, after a restart I found this home folder on the desktop. I don't want it there - how do I remove it? Left click does not show an option to delete it.  Here's a screenshot:


Show an entire function with $f(z) = f(z+1), f(z) = f(z+i), $for all $z \in \mathbb{C}$ is constant

Suppose an entire function $f$ exists with the properties: $$f(z) = f(z+1)$$  $$f(z) = f(z+i)$$ For all $z \in \mathbb{C}$. Show that $f$ is a constant.  I think I must inspect the unit square and show that it characterizes the whole function (rigorously i suppose), and show that $f$ is bounded in that unit square and hence $f$ is bounded, and by Liouville's theorem $f$ is then constant.   I am not sure how to show f is bounded in the unit square, is it possible for an analytic function to be unbounded/have its absolute value get arbitrarily large at any point?


What was the reason Yoda did not continue his fight with Sidious?

In Episode 3 Yoda fought Sidious and in the end, ran away. Why?  Did he realize that Sidious is stronger than him OR did he realize he is not meant to defeat him?  Wasn't Yoda able to tell how strong his enemies are, or more tell how strong the Force is?


What are E(max(X1, X2)) and Var(max(X1, X2)) when the Xs are normal random variables?

Let X = (X1, X2) be normally distributed random variables with mean m = (m1, m2) and covariance matrix S. Y = max(X1, X2) = X1 + max(0, X2 - X1) = X1 + D (X2 - X1), where D = 1 if X2 > X1 and 0 otherwise (bivariate). What are E(Y) and Var(Y)? What if X1 and X2 are independent and what if X2 = c, a constant? Thank you for sharing your brilliant insights into these matters!


Can I turn internal storage hard disks on and off individually?

I'm considering building a new Windows-based work PC.   Some of my work requires vast amounts of storage. Currently I'm serving that need by using a number of external USB drives.  Given that I never need those external drives anywhere else, for the new machine, I'd prefer a solution where those drives are fixed inside the PC, next to the SSD that will contain the system partition and the most essential work data.  However, because I live off the grid (and because HDDs can get loud!) I would like the storage hard disks to strictly remain turned off (ideally even when starting up!) until I need them - just like I would plug in a USB hard drive when I need it.  From what I've gathered, this is not possible using Windows' built-in energy saving features itself: its "power saving" features will affect either all hard disks at once, or none.  Is there a software, BIOS, or hardware solution that helps achieve this goal?


Difference between "with" and "at" when it comes to percentages

I have a problem in using "at" and "with" in describing graphs and percentages. I have read many samples in different books, but I am not quite sure that I can use them properly. I even find a similar topic on this  but it did not help either. So I provide here some examples from different books so that you can answer them:      Shopping came next at 10%, although this was much less popular than socializing, at 20%.    Can we use "with" instead of "at" in the above sentence?      Socializing was next at 20%, which was twice as popular as shopping, with 10%.    Can we replace "at" with "with" in the above sentence, and vice versa?      Both alcohol and drug sales peaked in 1980 with figures of $186 billion and $102 billion respectively.    Can we change it to:     Both alcohol and drug sales peaked in 1980 at $186 billion and $102 billion respectively.       Indonesia was responsible for about one third of rice production, at just over 46 million tonnes.     Can we change it to "with"?      No change was seen in jogging at 31% in the two older age groups for women.    Can we change it to "with"?


MS Access + SQL Server for 1160 users - Is it worth it? (Please Help!)

Our school in Delhi (India) wants to develop a professional and robust in-house database (SIS) that should handle vast amount of student information, including admissions, registration, re-enrollment, student behavior management and grading. We noticed that over-the-shelf products are unable to complete our specific tasks without major customization and costs. Hence, we decided to develop this ourselves since we have full control as to how we want our information to be reported to our education board (as per their specifications) and have control on our complex grading system (which is continuously updated to meet the dynamic benchmark needs of our education board).   We have begun using MS Access and is still in the primary stages of development. We want to know whether we should use MS Access as a front-end and SQL Server as a back-end DB since we want to accomplish the following:   Ability for 80+ employee users to simultaneously access, post, update and delete customer records within the SIS DB (on campus). Ability for our SIS DB to have web-based functionality with a student login portal integrated within our school website so 1080+ students can simultaneously access a specific web-based DB form from their homes (by using the student login portal) for updating personal records, checking grades, and other performance summaries. Ability for our SIS DB to be highly secure and functional 24/7 without interruptions and security breeches (we read that MS Access alone cannot accomplish this). Ability to integrate our SIS DB with another in-house database that will provide digital learning materials to students within the comfort of their homes (also accessed through student login portal). The digital learning materials DB is another DB we are creating that should have ability to store 100 GBs worth of multi-media materials. Ability for data to be quickly pulled from tables to the GUI without delay.   A major factor for our school in this matter is COST. They want to create the DB under USD 1,500 and would like to have many users being able to access this system at the same time. Please help me to decide how I should go about this situation, both performance-wise and cost-wise. I apologize for the long details provided. I am really confused and would deeply appreciate if any one could help me on this matter.  In addition, we wanted our forms to be professional like the ones seen in major DB systems. We noticed that Access can create forms but only to a certain extent. Is there any other system programming-friendly platforms we can use for creating highly complex and professional DB forms (lke Visual Studio, for example)? Help on this subject as well will be extremely appreciated.  Ankith


Would Dr Hannibal Lecter allow himself to be a consultant with Clarice if Miggs hadn't behaved improperly to her?

In The Silence of the Lambs while Clarice first comes to visit Dr Lecter for his assistance, he drives Clarice away. But seems to change his mind when he sees Miggs (the next cell prisoner of Dr Lecter) throw his semen on her.   Did Dr Lecter decide to help Clarice only because this incident happened to Clarice? If nothing happened while Clarice retured, would Dr Lecter completely ignore her?


How can I compile a text file into a C++ program as a const string?

I have a C++ program which I'd like to have output a certain text file at some point.  Of course I could have it open, read, and output the text file, but then I have to keep the binary and the text file in sync and located together.  I'd rather just compile the file in as a string in some part of my build process.  I've seen things like this done as parts of various IDEs.  However I'm building from the command line with gcc or clang.  Of course I could just write my own script that produces a temporary .cpp file at compile time and make that a build step in my Makefile, but I was wondering if there was a more established option for doing this.  I would prefer not to take on a lot of other dependencies just to do this.


A condition for the image of a metrizable space to be metrizable

I noticed this problem on a previous exam that I completely missed, and I was wondering if anyone could help me out.     Suppose $f: Y \rightarrow X$ is a continuous mapping of a separable metric space $Y$ onto a compact Hausdorff space $X$. Show that $X$ is metrizable. Furthermore, give an example of a continuous mapping of a separable metric space onto a mon-metrizable Tychonoff space.   Any help would be greatly appreciated!


What's the difference between "stone" and "rock"? When exactly I can use the first word and when the second one?  As far as I understand, if the matter is a part of our planet, you must call it rock and can't call it stone. But how do you define when it is a part of planet and when it is a separate matter, which just stick into the planet?  Also, do you always call "stone" a peace of matter, which is clearly separated from the planet? Or you can call it "rock" in some cases?


Why interface really needed when normal class can do the same work

I have been wondering the real use of interface. please check the below code.  interface Animal {     public void eat();     public void travel(); }   public class MammalInt implements Animal{      public void eat(){         System.out.println("Mammal eats");     }      public void travel(){         System.out.println("Mammal travels");     }       public int noOfLegs(){         return 0;     }      public static void main(String args[]){         MammalInt m = new MammalInt();         m.eat();         m.travel();     } }    in the above code if i remove implements Animal from class declaration still the code works fine without any difference. So what is the actual use of interface. ?


How can I run apps in an isolated environment on my smartphone?

I have apps that I don't trust or that I just want to try. The problem is that even after deleting them they might leave files/spyware/malware/etc. What are my options? I have Xiaomi mi4c on MIUI with google apps but will soon format it and might replace the ROM.


Number of surjective functions from A to B

Am I on the right track? I am not sure about my reasoning... Number of surjective functions from $A$ to $B$ $$A = \{1,2,3,4\} ; B = \{a,b,c\}$$ We must count the surjective functions, meaning the functions for which for all $b \in B$, $\exists~a \in A$ such that $f(a) = b$, $f$ being one of those functions. In order for a function $f:A\rightarrow B$ to be a surjective function, all 3 elements of $B$ must be mapped. We need to count how many ways we can map those 3 elements. We will subtract the number of functions from $A$ to $B$ which only maps 1 or 2 elements of $B$ to the number of functions from $A$ to $B$ (computed in 4.c : 81). Only 1 element of $B$ is mapped The first $a \in A$ has three choices of $b \in B$. The others will then only have one. Total functions from $A$ to $B$ mapping to only one element of $B$ : 3. Exactly 2 elements of $B$ are mapped Similarly, there are $2^4$ functions from $A$ to $B$ mapping to 2 or less $b \in B$. However, these functions include the ones that map to only 1 element of $B$. So there are $2^4-3 = 13$ functions respecting the property we are looking for. In the end, there are $(3^4) - 13 - 3 = 65$ surjective functions from $A$ to $B$.


I should determine reflection matrix over a line through the origin with direction vector $\vec{v}=\left(a,b\right) ^{T}  $  I dont understand this really good and couldnt find anything helpful on internet. I only found in one book the following:  A is the matrix with reflection over a line through the origin with direction vector $\left(\cos(\frac{\alpha }{2} ) , \sin(\frac{\alpha }{2} ) \right) ^{T} $  $A=\begin{pmatrix} \cos(\alpha )  & \sin(\alpha ) \\ \sin(\alpha )  & -\cos(\alpha )    \end{pmatrix} $   I am not sure how to connect this from book to solve my example, because there is another direction vector. I would be thankful if someone  could give me some tips or something like that.


How to synchronize the data from one local server to another local server?Specially from MySQL Database.


Update This just happened. I waltzed into the PHP room, and sure enough:  If this isn't evidence that we need a room star creation reputation minimum, I don't know what is. Alternative While I believe functionality in this proposal would be optimal, it is perfectly understandable that such an implementation may be too large for reasonable expectations. Alternatively, as has been discussed elsewhere and in the comments (and additional notes) below, a reputation minimum for room star creation may be satisfactory to prevent clutter. This could be broken into two functions:  create a room star increment an existing room star  Since the fundamental issue is with room star creation, a reputation minimum should only be required for that; perhaps something on the order of 500. However, a lower minimum could be required to increment existing room stars; perhaps something on the order of 100. Proposal Continuing with the frustration from , I'm wondering if a distinction between personal stars and room stars would help manage the way we mark content as "interesting". While there aren't any specific guidelines on star etiquette (please correct and link accordingly if I'm wrong), the tendency of regulars in various rooms is to star content that has some sort of permanence and relevance to the rest of the room. Occasionally, however, an unfamiliar face will wander in and start starring things left and right. The stars are relevant only in the context of their conversation (typically regarding a problem about which they've visited the room for guidance) and only to themselves.  This would permit people to track their bookmark content on-site, without it "polluting" the room stars. As stars are inherently public, personal stars could be visible publicly on a given users'  profile.  Additional Notes  A minimum reputation requirement (something reasonable, 200? 500?) could be required to create room stars, whereas personal stars can be created by anyone able to chat. For this to be effective, the default behavior of starring a message would need to be "personal", unless both options were provided beside one-another.


How do native speakers think about sentences like "The window does not open"

Note: I'm aware that there is also a site "English learning". I thought a while about whether it would be a better fit there, and eyes quickly glancing over some passages of this text might think that. But I have doubts. I know how to use that aspect of the language, I don't need to learn it. I rather want to dive a little deeper, perhaps, and have a suspicion that the average native speaker who might easily help on the learners' site might not precisely know about this subject. It might rather be "language enthusiasts" thinking about this kind of topic, and apparently, that's what this site is for?  So - What do I mean, by sentences like "The window does not open."?  I mean sentences that seem to be indicating that the noun was somehow active, even though it is factually a passive object that something needs to be done to by someone or something else.  Well, at least that's what I, native speaker of a related language that does not have this (German), think when seeing/hearing something like that.  Another example: Think of a text file which contains program code of a programming language. The code has a syntax error somewhere. You try to run the program code, but the interpreter indicates the error. A native speaker might say: "The source file did not parse".  This seems extremely odd to me. I can only speak for myself, but I would guess the same for many other native German speakers. (maybe less so for the youngest generations who started to learn English at earlier ages) We would never say this. Rather, it would be: "The window cannot be opened" or "The window is not openable" and "The source file could not be parsed" or "The intepreter failed to parse the source file", clearly indicating the factually passive object as a thing that something is done to (or not). Wheras "the window does (not) open" makes it seem as though the window was something that, potentially, does things by itself. (let's restrict this to classical windows, not windows in maybe Elon Musk's home ;)) Even more obvious is the source file, which most certainly does not do things by itself, like parse.  It's as though someone said, to indicate the location of certain information within a given book: "The information finds on page 42" instead of "The information can be found on page 42". If I'm not mistaken, this would seem weird to a native speaker of English, too; i.e. it is not common to say / wrong.  What do native English speakers actually think when hearing or uttering such a sentence? Does it feel to you like those objects were active things? Or is there maybe some example that would clearly show that these sentences do not indicate activity on the part of the objects / some way to show me I fell into a trap of thought by the language conventions / expectations I'm used to?


How to tile windows without going into full screen?

Currently, if I want to tile two instances, I press the green button on the top-left and place the instance accordingly. However, each of the tiled instances always go into full screen mode. For a chrome instance, this is annoying as it means it's not possible to see the tabs. How do I tile windows without making them go  full screen?


Nullpointerexception and no compilation errors. Can't find cause

been struggling with this problem since a couple of hours. Including looking through the previous questions answered. (Im really new in Java, basicly started a couple of days ago)  it keeps giving me NullpointerExceptions between Register.läggTillhund(nyHund); in the first class and hundRegister.add(nyHund); in the second class.  I have no idea what might be causing them. Does anyone have Ideas?   The purpose of the code (when finished) is to add an object from the 3rd class, into a list in the secondclass using the firstclass as the "main program".  Thanks for the help! Oskar  First Class (Main)  public class testning {      public static void main(String[] args) {         Hund nyHund = new Hund("Daisy", 13, "labrador", 22.3);         System.out.println(nyHund.toString());         System.out.println(nyHund);         Register.läggTillHund(nyHund);            }  }   Second Class:  import java.util.ArrayList;  public class Register {       private static ArrayList<Hund> hundRegister;        public static void läggTillHund(Hund nyHund){         hundRegister.add(nyHund);         System.out.println(nyHund);         }             public Register(){              hundRegister = new ArrayList<Hund>();     }   }   Third Class  public class Hund {      private String namn;     private int ålder;     private double vikt;     private String ras;      public Hund(String hundnamn, int hundålder, String hundras, double hundvikt) {         this.namn = hundnamn;         this.ålder = hundålder;         this.ras = hundras;         this.vikt = hundvikt;     }      public String getNamn() {         return namn;     }      public int getÅlder() {         return ålder;     }      public double getSvanslängd() {         if ("tax".equals(ras)){             return 3.7;         }else{             return ((vikt*ålder)/10);         }     }      public String toString() {         return namn + "\n" + ålder + "\n"+ras+"\n"+vikt+"\n"+getSvanslängd();     } }


I have a website and consider the situation where users are using it. I push new code on production with new css. Consider the situation where users close their browser and open and come to the same page again, they are still getting old css here. And thus the page does not appear properly.  How can i make sure that new css is loading too. It does not work with chrome, it works with mozilla. When i do ctrl+F5, it works. But users wont refresh the cache right. Even if i close browser and open again, it is old css unless i remove the cache/cookies.  Can someone help me out on this.


What's the best way to extract prices from string in one line?

What's the best way to extract numbers (with dot in between sometimes)from string in one line?  var str = "ghjkhjgbkhj123.45khgbkhjgk67   8kjhgkj hg13.99sads";   I need an array of [123.45, 67, 8, 13.99];  str.match(/\d+/g)  returns slightly different results - it doesn't count ".".


error in SMOTE function for categorical data

I have a categorical data with target variable as factor.  mydata <- data.frame(x = c(rep("good", 3), rep("bad", 3)), target =  c(rep("yes",5), "no"))  > mydata      x target 1 good    yes 2 good    yes 3 good    yes 4  bad    yes 5  bad    yes 6  bad     no   So one can say that we have imbalanced target variable here. I now try to use SMOTE function from DMwR package.  SMOTE( target ~ . , mydata)  But I get the following errors.  Error in factor(newCases[, a], levels = 1:nlevels(data[, a]), labels = levels(data[,  :    invalid 'labels'; length 0 should be 1 or 2 In addition: Warning message: NAs introduced by coercion    What is happening here ?


How can I protect MySQL username and password from decompiling?

Java .class files can be decompiled fairly easily. How can I protect my database if I have to use the login data in the code?


private static data member + template class

I have this code:    in a.h file:  #ifndef A_H_ #define A_H_  class Class_Hierarchy{ public:     std::map<const Type*, std::set<const Type*>> map;     Class_Hierarchy(){             std::map<const Type*, std::set<const Type*>> map;     }  };  template<class T> class BASE_Polymorphic {     friend T; //only the actual type can register this class at the CASTS data structure.  private:     void Register_Inheritence(const Type *base); public:     virtual ~OOP_Polymorphic() {}     static const Type *Get_Type();     virtual const Type *My_Type(); };  class CASTS{ private:     static Class_Hierarchy classHierarchy; public:     static void Register_Inheritence(const Type *derived, const Type *base);      template<typename Dst, typename Src>     static Dst new_static_cast(Src src);      template<typename Dst, typename Src>     static Dst new_dynamic_cast(Src src);  };  #include "a.cpp" #endif /* A_H_ */   and in a.cpp file:  #ifndef A_CPP_ #define A_CPP_  #include "hw5.h" #include <type_traits> #include <typeinfo>  inline void CASTS::Register_Inheritence(const Type *derived, const Type *base) {     std::map<const Type*, std::set<const Type*> >::iterator it;     it = CASTS::classHierarchy.map.find(derived); }  #endif /* A_CPP_ */   I have another file called test.cpp which #includes a.h and uses it's code.  At first I had map as a static private data member in CASTS and had it's initialization in a.cpp, but I had undefined reference to BASE_Polymorphic member functions, so I included a.cpp in a.h.  Then I had another problem, I couldn't initialize map (private static data member of CASTS class) in the cpp file because I started getting multiple definition error. Therefore I tried making Class_Hierarchy which has map as a public data member and make a static instance of Class_Hierarchy in CASTS class to use its map, but I'm getting undefined reference to CASTS::classHierarchy.  I can't think of a solution for both problems, How can I keep the template class in the header file and have a static member in CASTS class?  Right now the only error I have is undefined reference toCASTS::classHierarchy'`.  EDIT:  I had an error of multiple definition for every member function, so I added #include guards on a.cpp file.


Searching for some users on SO returns a list sorted by incorrect order

Some username search results are not correctly sorted by highest reputation on Stack Overflow. Steps to reproduce:  Visit   In the Users Search Box enter the following username for example; RobC  The list of users returned is currently as follows:  Note:  User RobC listed in sixth position from the top, i.e. the one at the bottom in the screenshot above, has a weekly reputation increase of 88. The first five listed users all have a weekly reputation of 0.    Expected Result:  Users with a higher reputation to be listed above/before users with a lower reputation.  Given the scenario provided in the aforementioned section, I expect user RobC who is currently listed in sixth position from the top, i.e. the one at the bottom in the screenshot above, who has the highest weekly reputation increase of 88 to be listed at the top.   Additional Info  Regardless of whether the Reputation is sorted by either; week, month, quarter, year, or all - the list returns in the incorrect sort order.  Other examples of usernames (randomly chosen and at time of writing) that also show the incorrect sort order are; Peter, and Sarah. However many usernames do seem to return correctly sorted.  This incorrect sorting started to occur approx 3-4+ weeks ago.


Unable to log in to Cinnamon session 18.04

I used to use Cinnamon as my desktop environment on 17.10. After I updated to 18.10 I reinstalled Cinnamon using sudo apt-get install cinnamon-desktop-environment but can no longer log in to that specific environment.  After I type in my password there is a pause, the screen goes black, and then returns to the original log in screen.   I am able to start Cinnamon from the terminal when I am already in another session (I use xfce otherwise) using cinnamon --replace and everything works as expected.  I have also tried lightdm and gdm3 both with the same result (in fact gdm3 won't let me boot into xfce, but it will let me boot into gnome). And setting the ownership of my home directory with chown -R $USER:$USER /home/$USER  I am not sure what sort of error log information I should add to this post that would help, but I can add any suggestions from the comments.


Why does hot air rise?  I did an experiment:  I made a model of hot air and cool air with marshmallows and toothpicks. The hot air had more volume than the cold air. Then, I weighed it. They both weighed the same, even though they had a different volume.  So I don't understand why does hot air rise?


Is there any possibility to put some lines of code automatically to the terminal?  E.g. when I want to start Hamachi through the terminal and don't want to write long expressions every time.  Maybe this problem is easy to solve, but I am a beginner and would be thankful for help.


Has there been any news from the maintainers of Ubuntu packaging of Ruby as to whether they'll be releasing a package for Ruby 2.0? If so, have they indicated whether they'll be releasing any packages for Ruby 2.0 on 12.04?


Mathematician wants the equivalent knowledge to a quality stats degree

I know people love to close duplicates so I am not asking for a reference to start learning statistics (as ).   I have a doctorate in mathematics but never learned statistics. What is the shortest route to the equivalent knowledge to a top notch BS statistics degree and how do I measure when I have achieved that.   If a list of books would suffice (assuming I do the exercises lets say), that's terrific. Yes, I expect working out problems to be an implicit part of learning it but I want to fast track as much as realistically possible. I am not looking for an insanely rigorous treatment unless that is part of what statistical majors generally learn.


How can I automatically fetch dependencies when installing a Debian package?

If I download a Debian .deb package because it is not available through apt, I will usually try to install it using the command sudo dpkg -i package.deb. However dpkg, whilst being excellent at it's job, has one fatal flaw - it doesn't resolve dependencies. So if I have a package foo-1.0.0.deb which depends on packages bar-0.1.0 and baz-1.2.3, then bar and baz will not be installed, meaning I then must run sudo apt-get install bar baz to make foo work.  How, using one command, can I install a Debian package file and resolve it's dependencies?


Im trying to identify a bike with the serial numbers ACL8L35099 can someone help me ive been trying like crazy

I am trying to identify a chrome bike similar to a dyno orroyce union


Can you use woks on an electric induction cooktop in an apartment?

Can I use woks on my electric  induction cooktop at home? My guess is NO. Because  woks are designed for Chinese restaurant gas ranges with tremendous BTU, and woks must rest inside the range and the flame envelops the wok. If I use a wok on electric induction cooktop, induction just heats the bottom, not the side of, the wok. I live in an apartment. I don't have a gas wok range like Chinese restaurants.


Is it 'an' humiliating, or 'a' humiliating defeat?

I was looking at the papers and saw 'The Government suffered a humiliating defeat.'  It just felt wrong and I seem to recall it should be 'an' humiliating defeat, although I'm not certain.  I had a search but couldn't find anything.   Please could someone explain why it is one or the other.


Faces get distorted when scaled or moved

As you can see in the image, the selected face (on the right) is distorted. I have four questions here:  (1) Why does it happen?  (2) Does it affect the final output when rendering?  (3) How to fix it?  (4) Is it a bug? (If so, should I report it or is that already done by someone?)


When a charge starts moving, does it's electric field change into magnetic field?

If the electric field does change into magnetic field, how does it happen? And if it doesn't happen, then what happens to the electric field?


Check if remote port is reachable using Centos

On Dubian, I can do the following using netcat (aka nc, ncat):  michael@pi1:~ $ nc -zv 10.120.11.1 20 21 22 23 24 nc: connect to 10.120.11.1 port 20 (tcp) failed: Connection refused Connection to 10.120.11.1 21 port [tcp/ftp] succeeded! Connection to 10.120.11.1 22 port [tcp/ssh] succeeded! Connection to 10.120.11.1 23 port [tcp/telnet] succeeded! nc: connect to 10.120.11.1 port 24 (tcp) failed: Connection refused michael@pi1:~ $   man nc on Dubian shows the following:   -z      Specifies that nc should just scan for listening daemons, without sending any data to them.  It is an error to use this option in conjunction with the -l option.   On Centos7, I didn't originally have nc, so added using sudo yum install nmap-ncat.x86_64.  But, the -z flag is not supported.  [michael@box1 ~]$ nc -zv 10.255.255.1 22 nc: invalid option -- 'z' Ncat: Try `--help' or man(1) ncat for more information, usage options and help. QUITTING. [michael@box1 ~]$


How is moving the last digit of a number to the front and multiplying related to multiplicative orders?

There seems to be a relationship between  and a puzzle Presh Talwalkar gave a few days ago at   I'm hoping someone can give a more rigorous explanation of the pattern I see.  $\bullet\textbf{ The Puzzle }\bullet$  He states the puzzle as: "What Positive Number Doubles When Its Last Digit Becomes Its First Digit?"  For example, the smallest solution - assuming base-10 representation - is $105263157894736842$. Which means that $$(2)\cdot105263157894736842 \quad\ \ \ $$ $$||$$ $$210526315789473684$$  Naturally, one can proceede to find solutions in other bases. The base-5 solution is $$(2)\cdot102342_5 \quad\ \ \ $$ $$||$$ $$210234_5$$  $\bullet\textbf{ Multiplicative Order Connection }\bullet$  The base-10 solutions is $18$ digits and the base-5 solution is $6$ digits. I wrote a program to generate the smallest solution in all bases and then counted the number of digits in each such solution. Here's the sequence, starting with base-2 $$2,4,3,6,10,12,4,8,18,6,11,20,...$$ $$\uparrow \quad\quad\quad\quad\ \uparrow \quad\quad$$ $$\text{Base-} 5 \quad\quad\quad \text{Base-} 10 \quad\quad$$ A quick search on  shows that these numbers are the multiplicative order of  $$2\ (\text{mod } 2B-1)$$ where $B$ is the representation base we are working in. See   This puzzle can be further generalized by finding numbers that triple instead of double upon moving the last digit to the front. Let's introduce an arbitrary multiplying factor: $k$  So the solutions mentioned above and Talwalkar's puzzle are a particular case when $k=2$  For a different example, let's look at $k=5$ in base-7. The smallest solution is $$(5) \cdot 1013042156536245_7 \quad\ \ \ $$ $$||$$ $$5101304215653624_7$$  This solution is $16$ digits long. As we did before for base-10, we can write out a sequence of the number of digits in each base's solution starting with base-2 $$6,6,9,2,14,16,4,5,42,18,...$$ $$\uparrow\ \ $$ $$\text{Base-}7\ \ $$ Another search on  quickly shows that these numbers are the multiplicative order of  $$5\ (\text{mod } 5\cdot7-1)\quad\text{or rather}\quad 5 \ (\text{mod }34)$$  $\bullet\textbf{ A Conjecture }\bullet$  The pattern might be clear now. After checking other cases, it seems that the smallest positive number in any base $B$ - which is $k$ times the value gotten by moving it's last digit to the front - has a number of digits equal to the multiplicative order of  $$k\ (\text{mod } Bk-1)$$ I can see how multiplicative order would be related to this problem. But I can't find an exact reason why this relationship should be so. Is there an intuitive reason?


Detect whether a polygon is well formed or not (Google Map Android)

I have now two polygons as in the screen.  The first is "well formed", in a form that contains data (the one in blue) the second one has an intersection and, for that reason, is not well formed and I would like to delete it if it has intersections.  Any idea of how to detect the intersection? Thanks!


I want to use Firefox Developer Edition separated from the normal Firefox so I need two short cuts for the launcher, one for the regular Firefox and another one for Firefox Developer Edition. I am following the guide posted , being a complete newbie, just moving the firefox folder to /opt/firefox_dev/ was a challenge, now I've managed to get to here:  Notice that I made some changes from the original code to the code on my Terminal to make directories match. What do I do now? I thought that pressing Enter would be it, but I'm stuck at this point, what do I do next to follow the guide posted?


How can I prove that $\lim_{n \rightarrow \infty} \sqrt[n]x=1$

How can I prove that $$\lim_{n \rightarrow \infty} \sqrt[n]x=1$$ for all $x>0$  I know I've got to use the monotone convergence theorem somehow. It's easy to show that $\sqrt[n]x$ is bounded, but having trouble showing that it is strictly increasing for $0<a<1$ and strictly decreasing for $a>1$. Also how can prove the infimum and supremum is 1 for the two cases?


Series of Natural Logarithms Raised to Powers

It's easy to see that for $Re(s)>0$,  $$\zeta(s)=\displaystyle\sum_{n=1}^{\infty}\displaystyle\sum_{k=0}^{\infty}(-1)^k\frac{\ln^k(n)s^k}{k!}$$  from the series definition of the Riemann Zeta function and the Maclaurin series for $n^{-s}$ in terms of $s$. This gives the series representation of the coefficient for the $k$th term (i.e., the constant by which the term $s^k$ is scaled):  $$(-1)^k\frac{1}{k!}\displaystyle\sum_{n=1}^{\infty}\ln^k(n)$$  This begs the immediate question,  $$\displaystyle\sum_{n=1}^{\infty}\ln^k(n)=?$$  It should be noted that this series is divergent, but any way to analytically find an answer that would make sense would be great, like something along the lines of the method by which $\zeta(0)$ or the p-adic definition of $\sum_{n=0}^{\infty}2^n$ is found.  If you are not able to answer this question but are able to give me a representation of the Maclaurin series of the Riemann Zeta function without a double summation, that would be very nice too.


How can I create a new label for enumitem with tikz?

Question How can I create a new label for list items in the enumitem environment with tikz that include a variable (a counter in this case)? Problem Code does not compile. Runaway argument?.... Example \documentclass{article} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage{fontspec} \usepackage{graphicx} \usepackage{tikz} \usepackage{enumitem} \newcommand{\redcircle}[1]{% \begin{tikzpicture}[font=\sffamily\bfseries]     \node[shape=circle,fill=red,text=white] at (0,0) {#1}; \end{tikzpicture} }%  \begin{document}     \begin{enumerate}[label=\redcircle{\arabic*.}]         \item Test     \end{enumerate} \end{document}


To this question     there's an answer on how to create certificates, but there isn't one on what to do if apache can't start https when you make the necessary changes to the virtual host file.  I'm interested in that situation, what we should we do?  I have used all necessary steps to achieve this.  I'm using Ubuntu 16.04 with Apache/2.4.18 as a web server. After I was enable ssl, I follow this next steps to include valid ssl certificate in web server  ()  sudo apt-get update sudo apt-get install software-properties-common sudo add-apt-repository ppa:certbot/certbot sudo apt-get update sudo apt-get install python-certbot-apache sudo certbot --apache certonly   After that I get fullchain.pem certificate as a file and key file privkey.pem.  Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/myserver.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/myserver.com/privkey.pem   When I included those lines in default-ssl.conf file and enable virtual host using these commands in terminal:  a2dissite default-ssl.conf a2ensite default-ssl.conf service apache2 reload/restart   I get error that ssl certificate is not valid and Apache web server couldn't start https.  How can I resolve this situation with Ubuntu & certbot to get valid ssl certification for 30 days?  virtual host file:    < IfModule mod_ssl.c>     < VirtualHost _default_:443 >         ServerName mysite.com                         ServerAdmin webmaster@mysite.com          DocumentRoot /var/www/html          ErrorLog ${APACHE_LOG_DIR}/error.log         CustomLog ${APACHE_LOG_DIR}/access.log combined          SSLEngine on          SSLCertificateKeyFile /etc/letsencrypt/live/mysite.com/privkey.pem         SSLCertificateFile /etc/letsencrypt/live/mysite.com/cert.pem         SSLCertificateChainFile /etc/letsencrypt/live/mysite.com/fullchain.pem         Include /etc/letsencrypt/options-ssl-apache.conf          <FilesMatch "\.(cgi|shtml|phtml|php)$">                 SSLOptions +StdEnvVars         </FilesMatch>         <Directory /usr/lib/cgi-bin>                 SSLOptions +StdEnvVars         </Directory>     </VirtualHost> </IfModule>


Invoking static methods containing Generic Parameters using Reflection

While executing the following code i gets this error "Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true."   class Program {     static void Main(string[] args)     {         MethodInfo MI = typeof(MyClass).GetMethod("TestProc");         MI.MakeGenericMethod(new [] {typeof(string)});         MI.Invoke(null, new [] {"Hello"});     } }  class MyClass {     public static void TestProc<T>(T prefix)      {         Console.WriteLine("Hello");     } }   The above code is just a scaled version of the actual problem i am facing. Please help.


If the absolute value of a function is continuous, is the function continuous?

If $|f(x)|$ is continuous at $a$, is $f(x)$ continuous at $a$?  I tried doing it using composite functions. If $g(x)= |x|$, then $g\circ f(x)= |f(x)|$. Since $g(x)$ and $g\circ f(x)$ are continuous, $f(x)$ is continuous.  I don't know if this is correct. Please help.


find command with negated condition still considers the given directory

Wanting to find for files except for those, that are in /home directory (directly or in one of subdirectories of any level), I run the following command: find / ! -path '/home/*'  However, I get error messages with "Permission Denied" message, like the following: find: '/home/user/here/is/some/file': Permission denied  I don't care that it is "permission denied" per se, what I don't like is that it even tries to search there. At first I thought that could be because there is some symbolic link from other places on FS, that references a directory inside /home/user/, but then I tried with -H option like this: find -H / ! -path '/home/*'  and it still listed those files/directories inside /home/*. Any ideas, how to rectify that?


The new 17.10 only has 64 bit ISOs. However 32 bit is still supported, there just are no live ISOs for it.  I have a 32 bit machine with WIFI, and I need to install from a USB disk. I tried the "mini.iso" but it doesn't have WIFI support.  What options do I have?  (PS I don't want another distro, and I can't use ethernet for installation, must be WIFI).


alt+shift can't be set to toggle language

I recently did a fresh installation of Ubuntu 13.10; but there is something bothering me, which I don't quite understand.   When I first tried to toggle the keyboard language(I usually switch between Persian and English) using the good old "Alt+Shift" shortcut it didn't work. Then, I went and checked the Keyboard shortcut settings and found out that it had been set to "Super+Space"(which BTW didn't work either). So I tried to change it back to "Alt+Shift" but it just doesn't work; when I press "Alt+Shift" to set it up as the toggle-language shortcut, the box automatically resets itself to its previous value(without any errors whatsoever). As far as I've checked I couldn't find any thing obvious corresponding to the shortcut "Alt+Shift" either.  I've currently set up the shortcut as "Ctrl+Space"; so I can toggle the language. My question is why I cannot set it up to just "Alt+Shift"?


Something other than looping through array?

My question is, how can I make the program do something if some variable is equal to any element in an array? Is there any other simpler way than just looping through the entire array?  For example: Suppose there is a variable, line = 0; and an array, characters = [1,2,3,4];  So, what I want to do is that, if the variable "line", changes to any of the four elements in the array "characters" (i.e. 1,2,3,4), then the program needs to do something specific.   (The array can be way bigger than that and the elements in the array might be created during the program not beforehand.)


Should dupehammer wielders use their powers to wipe obviously incorrect close-as-duplicate votes?

Occasionally, a user will cast a close-as-duplicate vote that's clearly incorrect. If that vote closes the question as duplicate, a gold tag badge user in a tag for the question ("dupehammer user") can then, as I understand it, unilaterally reopen it (thus overriding all the previous votes).  My question is about what happens in cases where the incorrect close vote does not close the post. In such a situation,  in order to clear the close votes on the question. This is clearly somewhat abusive if there are no close-as-duplicate votes, but in the case where all the close votes on the post are close-as-duplicate, doing this at least somewhat seems to tie into the dupehammer's regular functionality.  My question is not really about whether/when I can do this, but rather, when I should; under what circumstances should I as a dupehammer holder close and reopen a post in order to clear incorrect duplicate votes from it? Given that this is a fairly hidden feature at the moment, there's no obvious guidance for the circumstances under which I should use it.  In particular, is it my "duty" as a dupehammer user to clean up incorrect duplicate votes? Or the opposite: should I stay out of using the dupehammer to mess with vote totals, and only use it when the post is actually incorrectly open or closed? Or is the answer somewhere in between?


MacBook Pro crashes randomly after dropping it on the floor

A few days ago my MacBook Pro slipped out of my hands and fell onto the tile floor. The outside got banged up quite a bit and the Touch Bar no longer lights up but still responds to touches sometimes but not all the time.   Anyway, since then it will randomly restart every once in a while with a kernel panic. I have the log posted below and wanted to know if anyone could tell me what is causing the panic?


How do you create a bootable USB stick using windows 7

I've downloaded Ubuntu desktop (the .iso file that is) on a windows 7 machine and want to create a bootable USB stick in order to install it onto a laptop which currently has no OS. Is there a way to do this?


Proof of "well-founded iff there is no sequence $x_n$ s.t. $(x_{n+1}, x_n) \in R$"

I tried to do the following exercise from a book I'm reading, can you tell me if my solution is correct? Thanks!  Theorem 2: Let $R$ be a binary relation on a set $X$. Then $R$ is strictly well-founded iff there is no sequence $(x_n)_{n \in \mathbb N}$ of elements of $X$ such that $(x_{n+1}, x_n) \in R$ for all $n \in \mathbb N$.  Exercise:  (i) Formulate an analogue of Theorem 2 for  well-founded relations.   (ii) Prove Theorem 2.    (i) Theorem 2': Let $R$ be a binary relation on a set $X$. Then $R$ is well-founded iff there is no sequence $(x_n)_{n \in \mathbb N}$ of elements of $X$ such that $(x_{n+1}, x_n) \in R$ and $x_n \neq x_{n+1}$ for all $n \in \mathbb N$.  (ii)   $\implies$: Assume there is a sequence $x_n$ with $(x_{n+1},x_n) \in R$ for all $n \in \mathbb N$. Then the set $Y = \{x_n \mid n \in \mathbb N\}$ and hence $R$ is not well-founded since for every element $x_n$ there is $x_{n+1} \in Y$ with $(x_{n+1},x_n) \in R$.  $\Longleftarrow$: Let $R$ be strictly well-founded. Assume we have a sequence $x_n$ with $(x_{n+1},x_n) \in R$ for all $n \in \mathbb N$. Then by the same argument as above $R$ is not well-founded, hence there cannot be such a sequence.   I must be missing something but I can't seem to figure out what.


tikzcd doesn’t work in custom environment

I have a document class test.cls, in which I have defined a custom environment myenvironment using the environ package as follows:  \NeedsTeXFormat{LaTeX2e} \ProvidesClass{test} \LoadClass{article} \RequirePackage{changepage} \RequirePackage{environ} \NewEnviron{myenvironment}{     \begin{adjustwidth}{10pt}{10pt}         \BODY     \end{adjustwidth} }   Now if I try to use tikz-cd inside myenvironment, it fails, e.g. this gives an error:  \begin{myenvironment}     \[\begin{tikzcd}         1 \ar[r] \ar[d] & 2 \ar[d] \\         3 \ar[r] & 4 \\     \end{tikzcd}\] \end{myenvironment}   On the other hand, if I simply write it like this—that is, I substitute what the environment would do—, everything is fine:  \begin{adjustwidth}{10pt}{10pt}     \[\begin{tikzcd}         1 \ar[r] \ar[d] & 2 \ar[d] \\         3 \ar[r] & 4 \\     \end{tikzcd}\] \end{adjustwidth}   What could be the problem?


Find the linear fractional transformation that maps the circles |z-1/4| = 1/4 and |z|=1 onto two concentric circles centered at w=0?

I am very close to the solution I think. Since the circles cross the real axis, I want to find mappings from $z \to w$ such that $1/2 \to m$ and $0 \to -m$ and $-1 \to n$ and $1 \to -n$. Using $$ w = \frac{az+b}{cz+d}$$ we get $$ \frac{a+2b}{c+2d} = -\frac{b}{d}$$ and $$ \frac{b-a}{d-c} = - \frac{a+b}{c+d}$$ but where do we go from here? I am a little lost in the simplifying algebra here to solve for the $a,b,c,d$ in the transformation.


Size of class with virtual keyword and character in it

I ran the following code.  #include <iostream> using namespace std;  class Base {       char c;      public:          virtual ~Base()         {         } };  int main() {      cout << sizeof(Base) << endl;   return 0; }   1) The size is 4 (for vptr) + 1(for char). But the result is 8. Why is it so ?  2) I replaced char with a int variable, still the output is 8. Can someone explain me what has caused this issue?


If the set A is smaller than the set B, then is the powerset of A smaller than the powerset of B?

I'm looking for a proof that, given two sets $A$ and $B$, the cardinality of $A$ is less than $B$ implies the cardinality of the powerset of $A$ is less than the cardinality of the powerset of $B$.   In short, does $\overline{\overline {A}}<\overline{\overline {B}}\ \ $  imply   $ \ \ \overline{\overline {P(A)}} < \overline{\overline {P(B)}}$?  There seems to exist a clear method of proof for when $A$ and $B$ are finite (nonempty) sets, since there cannot exist a bijection between a finite set and a proper subset of itself, and hence $\overline{\overline {A}}<\overline{\overline {B}}$ implies there exists a bijection between $A$ and a proper subset of $B$, which one could use to construct a bijection between $P(A)$ and a proper subset of $P(B)$ and then apply the fact that there exists no bijection from $P(B)$ to a proper subset of itself.   But what about when $A$ and $B$ are infinite? How would we know that the proper subset of $P(B)$ which is bijective to $P(A)$ is not also bijective to $P(B)$?


Meaning and derivation of "so-and-so would know from X"

A couple of times I've seen a phrase much like "that's horrible coding — and I would know from horrible coding!" This seems extremely peculiar to me (if only because of how ungrammatical it is), and while I can guess that it's supposed to be some emphatic way to indicate the subject's authority on the matter, it's pretty unusual and I don't fully grasp it.  Unfortunately, I don't have a good verbatim example on hand, so it's possible my memory is muddling the context of the phrase slightly.  Anyway, what does this bizarre turn of phrase mean exactly and where does it come from?


I'm writing a document which I want to split into several chapters, each chapter in its own .tex file.  My main document has the preamble and I use \include commands to include each chapter.  My question is, when I'm working on the chapter, say, ch1.tex, is it possible to compile ch1.tex so I can see the output and continue working on it that way until I'm done with it?  As I understand it, ch1 should have no preamble, right?  Would I have to make a common preamble file so that I can \include it in each chapter when I work on it, compile as necessary, and then comment it out when I'm ready to put the entire document together including all chapters?  My apologies if this question is confusing, or if it has been answered before.  EDIT: Per request of comments below, the editor I'm using is TeXShop on Mac OS X Yosemite


Direction of Friction on two stacked boxes

I have box 2 stacked on box 1. Box 1 is on a frictionless table and accelerated by a force. However, there is friction between box 1 and box 2. Now, I was told that this is the diagram for that problem:  I thought that since m1 and m2 are moving to the right, then the frictional force between box 1 and 2 will be to the left, opposite to the direction of motion. Can someone confirm what is the actual direction of friction for the frictional force between box 1 and box 2? Also, is the action-reaction pair of forces between box 1 and box 2 the normal force of box 1 and the negative normal force of box 1? It is the same issue with another problem I saw online:  In one of the free-body-diagrams, the friction seems to be going to the right (which makes sense since the movement is to the left), but in the lower free-body diagram the friction appears to be going to the right (in the same direction of movement). How is this possible?


I'm novice @Java Programming. I have been working for SaveFile, for my game. Load and Save data. I got 2 following errors:   java.io.EOFException at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at Clicker.LoadFile.<init>(LoadFile.java:17) at Clicker.mainClass.main(mainClass.java:21)   java.lang.NullPointerException     at Clicker.SaveFile.<init>(SaveFile.java:17)     at Clicker.mainClass$1.run(mainClass.java:26)     at java.lang.Thread.run(Unknown Source)   I have got MainClass, where i put in SaveClass and LoadClass :  package Clicker;   import javax.swing.JFrame;  public class mainClass {   public static void main(String[] args) {       ClickerGame game = new ClickerGame();          JFrame frame = new JFrame("CarCollectionarV1");         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);          game.addComponentToPane(frame.getContentPane());          frame.pack();         frame.setVisible(true);         frame.setResizable(true);         frame.setSize(1000, 700);          LoadFile load = new LoadFile();   Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {          public void run() {         SaveFile save = new SaveFile();         }     }));  }   Full "SaveClass" code:    package Clicker;  import java.io.*;  public class SaveFile{      ClickerGame CG = new ClickerGame();{  try{     File SaveFile = new File("SaveFile.sav");     if(!SaveFile.exists()) {         SaveFile.createNewFile();     }      FileOutputStream saveFileSub = new FileOutputStream(SaveFile);     ObjectOutputStream save = new ObjectOutputStream(saveFileSub);      save.writeObject(CG.CarMain.Money);     save.writeObject(CG.CarMain.MoneyClicks);     save.writeObject(CG.CarMain.Boxes);     save.writeObject(CG.CarMain.BoxesClicks);     save.writeObject(CG.CarMain.PlayerLevel);     save.writeObject(CG.CarMain.BoxLevel);  save.close();     }     catch(Exception exc){     exc.printStackTrace();     }     } }   And Full "LoadClass" code:  package Clicker;  import java.io.*;  public class LoadFile {      ClickerGame CG =new ClickerGame();{          try{             File SaveFile = new File("SaveFile.sav");             if(!SaveFile.exists()) {                 SaveFile.createNewFile();             }              FileInputStream SaveFileSub = new FileInputStream(SaveFile);             ObjectInputStream load = new ObjectInputStream(SaveFileSub);              CG.CarMain.Money = (int) load.readObject();             CG.CarMain.MoneyClicks = (int) load.readObject();             CG.CarMain.Boxes = (int) load.readObject();             CG.CarMain.BoxesClicks = (int) load.readObject();             CG.CarMain.PlayerLevel = (int) load.readObject();             CG.CarMain.BoxLevel = (int) load.readObject();              load.close();             }             catch(Exception exc){             exc.printStackTrace();             }             }


Externaly limiting number of CPU cores used

I need to externally limit a process/session to a certain number of cores.  Are there any other possibilities than CPU affinity (I don't like the need to specify the actual cores) and cgroups (hard to integrate into our project)?


Select records from a table that they don't exist in another table

How to get table2 records that don't exists in table1 (date filtered)  SELECT e.event_id, e.start_time, te.*  FROM table1 te, table2_tmp e  WHERE te.book_id = 45  AND (DATE(STR_TO_DATE(e.start_time,"%Y%m%d%H%i%s")) BETWEEN DATE(DATE_SUB(NOW(),INTERVAL 1 YEAR)) AND CURRENT_DATE)   table1  ID      event_id  start_time      book_id 10000   1_1005    20191222135100  45  <-- date Filtered & Doesn't exists in t1 10001   1_1006    20200123139100  45 10002   1_1007    20200124145100  45 10003   1_1010    20200125135100  45 10004   1_1015    20200325135100  46   table2  ID      bk_event_id   11111   1_1006    11112   1_1007          11113   1_1015 11113   1_1016   Expected result  ID      event_id   10000   1_1016


Search in file names but exclude certain file extensions using grep

grep --exclude=\*.{mp3,jpg,pdf,png} -i "size\|log" | cut -c 32-|grep -v name1 |grep -v name2  it's not working for me i want to do something like ls -la |  grep --exclude=\*.{mp3,jpg,pdf,png} -i "size\|log" | cut -c 32-|grep -v name1 |grep -v name2  but it's not excluding those extensions ls -la |  grep -i "size\|log" | cut -c 32-|grep -v name1 |grep -v name2 |grep -v "*.mp3"  is not working the -r flag gives me the result but with the content of the file, i just wanna grep filename


When should "person" be preceded by "a" or "the"?

The king said that the/a person who shows kindness to people whenever they can will wear a crown of gold.  Our sergeant said that the/a student who works hard to improve will rise through the ranks.  The poor boy asked the king on behalf of the/a person who was devoted to the king … At the award ceremony, it will be said to the/a person who received an award, “Stand up and sing.”   Questions    Which article is correct to use in these sentences?    Does the meaning change if I use either?  What’s the difference?


Minimal and characteristic polynomial have same set of irreducible factors

Let $V$ be a vector space over a field $F$ (not necessarily algebraically closed), and $T:V\rightarrow W$ be a $F$-linear map. If $c(T)$ and $m(T)$ denote the characteristic and minimal polynomial respectively, then I want to show that $c(T)$ and $m(T)$ have the same set of irreducible factors.  I know that the claim is true if $F$ is algebraically closed, because then the two polynomials have the same roots. The typical reasoning one gives when $F$ is not algebraically closed is: Take an algebraic closure of $F$, say $K$, and look at $m(T)$ and $c(T)$ in $K$ to conclude the proof. But as far as I know, the proof that any root of $c(T)$ is a root of $m(T)$ requires the fact that $V$ is a $K$-vector space. But we only know that $V$ is an $F$-vector space. I can't understand how to proceed after this.


Difference between $R^\infty$ and $R^\omega$

I know $R^\omega$ is the set of functions from $\omega$ to $R$. I would think $R^\infty$ as the limit of $R^n$, but isn't that $R^\omega$? The seem to be used differently, but I can't tell exactly how.


Why adding objects to a static Collection causing a NullPointerException?

I am attempting to add 2 sub-class objects to a static Collection of super-class objects. However, when I try to add the objects to the Collection, I'm receiving a null pointer exception and I'm trying to figure out why.  public class MoverLogic{     static Collection<Super> superCollection;      public static void main(String[] args) {     SubAlpha sub1 = new SubAlpha();     SubBeta sub2 = new SubBeta();     superCollection.add(sub1); //I'm getting the null pointer exception here     superCollection.add(sub2); }


How to move messages in "Social" or "Promotions" into "Primary"

I never remember how to do this. My e-mails are categorised in "Social" or "Promotions". I would like these e-mails to be organized into "Primary".   What is the easiest what to do this?


You use a runat="server" attribute everytime you want to access a html control (div,span,H1) from the server, you then also have to set it everytime you use an asp.net web control (<asp:Button/>).  My question is, for the asp.net web controls (all those beginning with <asp:) why haven't the asp.net team just removed it and set the property up in the background?  It makes no sense to have to set it every time, as there is no other option than server.  Is there is a point behind all of this, or an exception to the rule am I not aware of?


Isomorphism between $\mathbb{Z}[i]/{p}$ and $\mathbb{F}^2_p$

Say $p$ is a prime number such that $p=4k+1$. I need to prove that $\mathbb{Z}[i]/p$ (quotient ring) and $\mathbb{F}^2_{p}$ are isomorphic. I know that since $p \equiv 1 \mod4$ I can say that $p=xy$ where $x,y$ are conjugate prime numbers in $\mathbb{Z}[i]$, so I tried using the CRT (Chinese remainder theorem) - so I know that $\mathbb{Z}[i]/p$ is isomorphic to $\mathbb{Z}[i]/x\times\mathbb{Z}[i]/y$, but I wasn't able to take it from there. Any hint would be helpful.


I accidentally made my laptop unbootable using dd

The story so far...   I was experimenting with Unix's dd program on my Ubuntu laptop, trying to find a quick method to wipe a micro SD card securely. I set dd in motion, came back a few minutes later, and the whole system had crashed. When I try to reboot, I get a screen saying "checking media" and then a notification that the boot has failed.   What I'd like to achieve...   There's a modicum of data - a couple of GB - that I'd like to recover if at all possible. Also, I'd like to be able to use the laptop as before this calamity, but without deleting any data.   More information   I am able to boot from a USB, but, if I try to re-install Ubuntu, the only option it gives me is to wipe everything on disk at present. dd was only running for long enough to wipe, at most, 100 GB of a 1 TB disk. So there must be some recoverable data, right?


I am using Ubuntu 13.04 VPS and have installed LAMP (apache2). Now I have uploaded my web files (WordPress) in /var/www. But I dont have permissions to write in files.  When I run WordPress install, it says that it could not write on wp-config php file. So I execute this command over SSH  su cd /var/www sudo chown www-data:www-data -R * /etc/init.d/apache2 restart   (www-data is my apache user).Still itv cant write into files. I also cannot upload files using FTP (transfer failed error).  The permissions for directories in /var/www are 755 and for files are 644. Setting permissions 777 resolves the problem but I dont want to CHMOD it 777.  Please help me out.. Thx.


Get IIS6 to serve JSON files (inc. POST,GET)?

By default, IIS6 does not serve .json (no wildcard MIME type).  Therefore a 404 not found is thrown. I then add a new MIME type (.json, text/plain or application/x-javascript or application/json) which works fine.  However, when you then add a new mapping (Home Directory -> Configuration -> Add) with .json, C:\WINDOWS\system32\inetsrv\asp.dll, "GET,POST" and try to browse to the file, you get a 404.   If you remove the mapping and try and POST or GET to it, you get a 405.  ...  Suggestions?


I am running a generalized linear model. The dependent variable is binomial and independent variables are categorical and continuous variables. My question is : 1. Does the continuous independent variable have to be normally distributed?  2. Do I need to check for the normality of residuals of the continuous variables?                                               These are images of the model residuals. The model is as follows. B and A are categorical variables with two levels each and F is continuous.            t1<-glm(B ~ A + F, family = binomial, data = d, na.action = "na.fail") sm<-standardize(t1) model.set<-dredge(sm) model.set top.model<-get.models(model.set, subset=delta<2) top.model #model averaging u<-summary(model.avg(top.model), revised.var = T) u confint(u, full = T) plot(density(resid(t1)))  qqnorm(resid(t1))  qqline(resid(t1))   @Harlan Nelson, I have added the graphs.


Dummy coding for contrasts: 0,1 vs. 1,-1

I'm seeking your help in understanding the difference between two different contrasts for dichotomous variables.  On this page:  under "Dichotomous Predictor Variables", there are two ways to code dichotomous predictors: using the contrast 0,1 or the contrast 1,-1. I kind of understand the distinction here (0,1 is dummy coding and 1,-1 adds to one group and subtracts from the other) but don't understand which to use in my regression.  For example, if I have two dichotomous predictors, gender (m/f) and athlete (y/n), I could use contrasts 0,1 on both or 1,-1 on both. What would be the interpretation of a main effect or an interaction effect when using the two different contrasts? Does it depend on whether my cells are of different sizes?


On-the-fly computation of AES Round Keys for decryption?

The usual implementation of AES first computes all the Round Keys sequentially starting from the key, and stores them in RAM for later uses. However, when enciphering a single block with a key that will be used for that purpose only, or when RAM is very sparse, or perhaps in hardware, it is advantageous to use the Round Keys a they are being generated, rather than store them. Quoting the :     The key schedule can be implemented without explicit use of the array W[Nb*(Nr+1)]. For implementations where RAM is scarce, the Round Keys can be computed on-the-fly using a buffer of Nk words with almost no computational overhead.   It is said this also works for deciphering:     The key expansion operation that generates W is defined in such a way that we can also start with the last Nk words of Round Key information and roll back to the original Cipher Key. So, calculation ’on-the-fly' of the Round Keys, starting from an “Inverse Cipher Key”, is still possible.   However, the how-to is left as an exercise to the reader. In particular: Can the last Round Key (the first used when deciphering) be computed directly, rather than sequentially?


Why score test, Wald test, Likelihood Ratio Test etc?

It is known under regularity conditions, Maximum Likelihood Estimator is asymptotically normal. But why do we use score test, Wald test, Likelihood Ratio Test instead of $Z$ test?  If for an MLE $\hat{\theta}$ we can use z-tests of $\theta=\theta_0$ based on $\hat{\theta}$ having approximately a standard normal distribution, why do we use chi-square tests based on Wald, score, or maximum-likelihood ratio statistics?


Book: dystopian future with games and sex changes

I am trying to recall a book I read quite a while back.  The book revolved around people that no longer faced death I believe as, of I remember correctly, one of the main characters was well over one hundred years old. There was no longer a need for people to work so instead people played games and did as they pleased.   Another random detail was that sex changes were very common and were performed on a whim.