I had uploaded an arxiv paper about 4 months back which developed an algorithm. After uploading the preprint we got some good feedback from a colleague, following which we have added additional simulation results and a more detailed discussion.   In this span of 4 months, the paper has been cited a couple of times. The original work was primarily theoretical, whereas the papers which cited our work successfully applied our algorithm (with minor modifications) to power systems. Hence, when submitting to the journal, I would like to cite these papers to show that our methods have practical application.  My question is: would this form a citation loop which is undesirable? They have cited my work, and I cite their work. Is this firstly even allowed?  Field of research: Intersection of applied mathematics, engineering, and computer science. The paper is likely to be submitted to a SIAM journal.

In a  on how to deal with submitting several papers on similar subjects at the same time, one of the (good) practices suggested by the answers is make sure that they cite each other, and that each result appears as original only in one of them.  One may want to put informative references from one to the other; for example:    paper A "An application of this result is in paper B";  paper B: "We apply this result from paper A".   From the point of view of providing all the relevant context to the reader, this might be the most informative thing to do. However, the other use of citations is for computing metrics, and in this respect this practice could be seen as a dishonest way to improve one's citation count, since you get two (self-)citations instead of the one you'd normally get if the two paper were not written simultaneously.  Hence, the question in the title: Is this practice recommendable and/or acceptable? Or should I decide an implicit temporal order for my simultaneous papers, and only cite older ones from newer ones?


Reading the koma script source code (more precisely tocbasic.sty), I found, starting at line #623, this:  \DefineFamily{KOMAarg} \DefineFamilyMember[.toc]{KOMAarg} \newcommand*{\DeclareNewTOC}[2][]{%   \newif\iftb@nt@float   % ...   \def\tb@nt@tocentrystyle{default}%   % ...   The syntax of this command according to the manual: \DeclareNewTOC[options]{extension}.  What is the role of the @ (in this context) and what does the \tb@nt@ expand to, if I called the command i. e. like \DeclareNewTOC[float]{foo}?   The reason is that I want to change the last command I added (addtocentrystyle).  Thanks for any help in advance.

Many LaTeX “hacks” begin with \makeatletter and end with \makeatother. What do these commands do?


Let $a,b,c$ be positive real numbers such that $abc(a+b+c) =3$. Prove that $$(a+b)(b+c)(c+a)\ge 8$$ and determine when equality holds.

Given that $a,b,c \in \mathbb{R}^{+}$ and $abc(a+b+c)=3$,   Prove that $(a+b)(b+c)(c+a)\ge8$.   My attempt: By AM-GM inequality, we have  $$\frac{a+b}{2}\ge\sqrt {ab} \tag{1}$$  and similarly  $$\frac{b+c}{2}\ge\sqrt {bc} \tag{2},$$ $$\frac{c+d}{2}\ge\sqrt {cd} \tag{3}.$$  Multiplying $(1)$, $(2)$ and $(3)$ together we reach  $$(a+b)(b+c)(c+a) \ge8abc.$$  Now, I need to show that $abc = 1$.  Again by AM-GM inequality we have  $$\frac{a+b+c}{3}\ge\sqrt[3]{abc} \implies \frac{\frac{3}{abc}}{3}\ge\sqrt[3]{abc} \implies abc\le1$$    Now if we show somehow that $abc\ge1$, we are done and that's where I am stuck. Can someone please explain how to show that?  Other solutions to the above question are also welcomed.


My teacher asked me this question. But I  think this is wrong. Anyone found this, before me? I do not know. Anyway, Is my solution correct?  ${x^{x^{x^{x^x}}}}^{...}=2$  $x^2=2$  $x=\sqrt 2$  ${\sqrt2^{\sqrt2^{\sqrt2^{\sqrt2^\sqrt2}}}}^{...}=2$  Now,  Let, ${x^{x^{x^{x^x}}}}^{...}=4$  $x^4=4$  $x=\sqrt2$  ${\sqrt2^{\sqrt2^{\sqrt2^{\sqrt2^\sqrt2}}}}^{...}=4$  Contradiction!

Find $x$ in   $$ \Large 2 = x^{x^{x^{\:\cdot^{\:\cdot^{\:\cdot}}}}}$$   A trick to solve this is to see that $$\large 2 = x^{x^{x^{\:\cdot^{\:\cdot^{\:\cdot}}}}} \quad\implies\quad 2 = x^{\Big(x^{x^{x^{\:\cdot^{\:\cdot^{\:\cdot}}}}}\Big)} = x^2 \quad\implies\quad x = \pm \sqrt{2} $$  Are these solutions correct? If not, why? If yes, are there other solutions?    PS: An extension of this discussion can be found in


I have an array with 3 items "AAA", "BBB" & "CCC"  I have a string and its value is "CCC"  I am looking for a condition that will take this string and check if its in the array.  I get the array via:  string[] departmentArray = newDepartment.Split(',');   and the string  string department = "CCC";

What would be the best way to look in a string[] to see if it contains a element. This was my first shot at it. But perhaps there is something that I am overlooking. The array size will be no larger than 200 elements.  bool isStringInArray(string[] strArray, string key) {     for (int i = 0; i <= strArray.Length - 1; i++)         if (strArray[i] == key)             return true;     return false; }


How can I assign hotkey for a keyboard layout, as showed on screenshot from windows ?  I want to turn on Turkish on Ctrl + 1 and Tatar on Ctrl + 2

In windows in keyboard switch settings there is an option that you can switch keyboard language with unique combination for each one.  For example, Ctrl + 1 - for english, Ctrl + 2 - for russian, Ctrl + 3 for ukrainian etc.  It would be super handy, if there is an option to set this thing in Ubuntu.   Are there any options?


Footer of the first page of every chapter is not bold, but it should be. All the others are bold.       \usepackage{fancyhdr}      \setlength{\headheight}{40pt}     \setlength{\parindent}{0pt}      \makeatletter     \setlength{\@fptop}{0pt}     \makeatother     \renewcommand{\topfraction}{1.0}     \renewcommand{\bottomfraction}{1.0}     \renewcommand{\textfraction}{0.0}     \pagestyle{fancy}     \renewcommand{\chaptermark}[1]{\markboth{#1}{}}      \renewcommand{\sectionmark}[1]{\markright{#1}}      \clubpenalty = 10000      \widowpenalty = 10000      \displaywidowpenalty = 10000      \fancyhf{}     \fancyhead[EL]{\textsc{\leftmark}}     \fancyhead[OR]{\textsc{\rightmark}}      \fancyhead[ER]{}     \fancyhead[OL]{}     \rfoot{}     \lfoot{}     \cfoot{\bf \thepage}

I'm using the package fancyhdr to format my footers and headers, with my name in the header and a n of m pages format for the footer. Like so:  \pagestyle{fancy} \fancyhf{} % clear all header and footer fields \fancyhead[C]{Name} \fancyfoot[C]{\footnotesize Page \thepage\ of \pageref{LastPage}}   By default, the fancy page style only affects the pages after the first page. I know I can set the first page to the fancy page style using \thispagestyle, but I only want the first page to use the footer, not the header. Is there a way to create a custom style that just the first page will use?


I'd like to have Outlook check my email less often. I know about Send/Receive Groups, but as I understand it, if it's checking email through Exchange, that setting doesn't matter and email checking is instantaneous. To avoid workflow disruption, I'd like it to only show me new emails every 30 or 60 or whatever minutes. Is there a way to do that from the user's end (I am not an admin)? I can do it manually by clicking "work offline," but I'd like to have Outlook do this for me.  thanks, Ben

Outlook from time to time makes an operation 'Send and Receive.' This can sometimes be quite slow and Outlook hangs while this is done.    Is is possible to set different intervals for different mail accounts (if user has multiple accounts configured within Outlook, e.g., main Exchange account and one or more IMAP accounts) If yes (or even if only for some [e.g., IMAP accounts], where in the settings it can be configured?  (e.g., Outlook 2007)


I ran to some problems with c++11 alias templates. As you can see below, I want to create an alias to A::B from class C. Before instantiation is made the compiler (gcc 6.1) cannot assert that V has a member type B, therefore giving the error:  error: expected ‘;’ before ‘<’ token   template<typename ValueT> using B = typename V::B<ValueT>;   Does not his go against the usual way templates are dealt with in C++, that is assuming that the template type provides all necessary functionalities until proven otherwise by an instantiation?  template<typename T> class A{     T a; public:     template <typename ValueT> class B {         ValueT b;     }; };  template <typename V = A<int>> class C { public:     template<typename ValueT> using B = typename V::B<ValueT>; };

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template<typename U> struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion<U> dummy;      };     template< > struct inUnion<T> {     }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> {     // ...     template<typename U> struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template< > struct inUnion<T> {     }; };   The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?


I am a newbie programmer in Android, I am Stuck Here, Achieving this, Wanted to Print Out Url Contents In an EditText With this Chunk.  private class MyTask extends AsyncTask<String, Void, String> {     Activity activity;      @Override     protected void onPreExecute() {         super.onPreExecute();     }      @Override     protected String doInBackground(String... strings) {         String url = strings[0];          try {             StringBuilder sb = new StringBuilder();             URL link = new URL(url);             BufferedReader in;             in = new BufferedReader(new InputStreamReader(link.openStream()));             String inputLine;             while ((inputLine = in.readLine()) != null)                 sb.append(inputLine);             in.close();             return sb.toString();         } catch (Exception e) {             e.printStackTrace();         }          return null;     } @Override     protected void onPostExecute(String s) {         super.onPostExecute(s);         EditText editText = activity.findViewById(R.id.edittext);         editText.setText(s);     }   And Main Activity (onCreate): as Follows          new MainActivity.MyTask().execute("http://yahoo.com");   And here is my fancy looking Error :/     06-20 19:09:08.466 31168-31175/? E/art: Failed sending reply to debugger:        Broken pipe       06-20 19:09:09.563 31168-31168/com.curiosityworks.www.weatherlite        E/AndroidRuntime: FATAL EXCEPTION: main       Process: com.curiosityworks.www.weatherlite, PID: 31168       java.lang.NullPointerException: Attempt to invoke virtual method         'android.view.View android.app.Activity.findViewById(int)' on a null object  reference                                                                                at com.curiosityworks.www.weatherlite.MainActivity$MyTask.onPostExecute(MainActivity.java:102)                                                                                at com.curiosityworks.www.weatherlite.MainActivity$MyTask.onPostExecute(MainActivity.java:70)                                                                                at android.os.AsyncTask.finish(AsyncTask.java:667)                                                                                at android.os.AsyncTask.-wrap1(AsyncTask.java)                                                                                at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:684)                                                                                at android.os.Handler.dispatchMessage(Handler.java:102)                                                                                at android.os.Looper.loop(Looper.java:163)                                                                                at android.app.ActivityThread.main(ActivityThread.java:6377)                                                                                at java.lang.reflect.Method.invoke(Native Method)                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)   Please Guide me, I am Wasting a lot of precious time to figure it out, it will be a big help.

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


I got edited on Stack Overflow because I used "I'm", "you're" and "I'd" instead of "I am" etc.   Is it considered rude to use contractions like that in informal conversations on the internet? I would not use them in papers but, I thought on Stack Overflow it was okay.

How compelled should I feel to use non-contracted forms (do not rather than don't and so on) when writing in a rather formal text, say an academic paper? In one case I am afraid to seem too stilted, in the other, too casual. Are there good guidelines?  And are there differences in this regard between British and American English?  (In this  there was not much more than "Contractions are more frequent in informal than formal contexts".)


I have a number of  I would like to use in a project. The problem is that they're not quite powerful enough so I've been trying to come up with ways to increase the their pulling force without increasing the voltage.  I was thinking that I could add a permanent magnet to the bottom of the plunger so in addition to the the core being pulled into the coil the magnet would be repulsed by the coil and add to the force the plunger has.  Would this actually work? And if so what strength of magnet should I use? Should the magnet sit on the outside of the coil or just inside?

I have a number of  I would like to use in a project. The problem is that they're not quite powerful enough so I've been trying to come up with ways to increase the their pulling force without increasing the voltage.  The solenoids use a core that is tapered on the end. I would think that would lower the pulling power when the solenoid first engages. If I replace the core with a one that has the same thickness would I be right in thinking that the initial pull when the solenoid engages would be stronger?  If this would work what type of core should I use? If I just google "steel rod" there is a lot of types available. Is there some in particular material I should be looking for?


If you regress randomly generated independent variables on a randomly generated dependent variable, is the expected R squared value simply a function of n (the # observations) and k (the # of independent variables)?   If so, why is this?    In some old regression course notes I was re-reading, I see that the expected R-squared in this case is k / (n-k-1).  I tried this with some randomly generated data (e.g. n=100 and k=20) and indeed got a value very close to 0.2532, but I don't understand how it can be this simple.  Thanks for any color anyone might have.

What is the distribution of the coefficient of determination, or R squared, $R^2$, in linear univariate multiple regression under the null hypothesis $H_0:\beta=0$?  How does it depend on the number of predictors $k$ and number of samples $n>k$? Is there a closed-form expression for the mode of this distribution?  In particular, I have a feeling that for simple regression (with one predictor $x$) this distribution has mode at zero, but for multiple regression the mode is at a non-zero positive value. If this is indeed true, is there an intuitive explanation of this "phase transition"?    Update  As @Alecos showed below, the distribution indeed peaks at zero when $k=2$ and $k=3$ and not at zero when $k>3$. I feel that there should be a geometrical view on this phase transition. Consider geometrical view of OLS: $\mathbf y$ is a vector in $\mathbb R^n$, $\mathbf X$ defines a $k$-dimensional subspace there. OLS amounts to projecting $\mathbf y$ onto this subspace, and $R^2$ is squared cosine of the angle between $\mathbf y$ and its projection $\hat{\mathbf y}$.  Now, from @Alecos's answer it follows that if all vectors are random, then the probability distribution of this angle will peak at $90^\circ$ for $k=2$ and $k=3$, but will have a mode at some other value $<90^\circ$ for $k>3$. Why?!    Update 2: I am accepting @Alecos'es answer, but still have a feeling that I am missing some important insight here. If anybody ever suggests any other (geometrical or not) view on this phenomenon that would make it "obvious", I will be happy to offer a bounty.


How do you solve this? What does mod mean and how will I solve it? I understand that it can be solved but how? 5 to some exponent equals the (mod of 9797) what is the answer to this?

The general discrete logarithm problem is to find $x$ given $a, b$ and $n$ such that $$a^x \equiv b\pmod{n}.$$ Normally one can use the "baby-steps giant-steps" algorithm to solve it fairly quickly. But when $\gcd(a,n) \neq 1,$ it is not possible to compute $a^{-1}\pmod{n},$ which the algorithm requires.  What algorithms are available to solve this problem in this case (apart from brute force of course)? Are there any theoretical limits on how fast such an algorithm could run?


I have an NVidia 1080 ti and would like to add a second.  It looks like the only thing on the NVidia site is the Founder's Edition - and they're unavailable.  So my question is:  Would a 1080 ti made by, say, EVGA give the same results as my current card if they were used together on the same render?  I understand that they'll certainly work with Blender but my concern is for the quality of the render.  I've seen tons of SO questions regarding whether multiple cards will work but I'm curious to know if there are any significant differences under the hood which would yield a poorer render than going with two identical cards.  Using Blender 2.79 + Cycles  Regarding "Marked as duplicate" designation:  This question refers specifically to the results obtained from the use of different cards.  Other questions, such as the one linked in the duplicate notice, simply address the support of multiple cards.

I have a GTX 1060 6GB in my current build, and I also have a GTX 960 2GB in storage. I was wondering if I got , and got both of my GPUs in one build (not SLI or CrossFire, just in the same system) would I be able to use both GPUs for rendering simultaneously? I don't care if this means having them both render separate tiles in one instance of Blender, or rendering separate frames in two instances. I'm using Cycles for everything I do.


$$f(z)=\cot z - \frac{1}{z}=\frac{z \cos z - \sin z}{z ~ \sin z}$$ having poles at $z=n \pi$ with residue $1$ at each pole. Also $f(z)$ has a removable singularity at $z=0.$ All these are asked to calculate and I've done that. If $C_N$ is the circle enclosing all the poles having the center at the origin and radius $R_N,$ how can I show that $f$ is bounded on $C_N$ for a suitable $R_N$ ?  Any help is much appreciated.   Edit: Note that

I am getting stuck with the problem given from the book Schaum's outlines p.240 Q.110  Given $f(z)=\cot(z)-\frac1z$ where $z$ lies on a circle of radius $R=(N+\frac12)\pi$ and centered at the origin. Prove that $|f(z)|\le M$ where $M$ is independent of $N$.


How to Calculate time difference between two dates in php?  $date1=date('Y-m-d H:i:s'); $date2=date('2015-03-06 45:06:03');(Db)   am trying to do once time difference between 2 hours send Mail to user.Current datetime and Db datetime difference between 2 hours mean Send Mail to user.How to Check?

I have two dates of the form:  Start Date: 2007-03-24  End Date: 2009-06-26   Now I need to find the difference between these two in the following form:  2 years, 3 months and 2 days   How can I do this in PHP?


Referring to the comment I made here   Trying to use # someTag did not work so well for me in the comments and same thing goes for this post, edit this post and you will see ` # someTag`  I assume this is on purpose, can anyone enlighten me?

In my comment here:    I needed to have a : symbol with a leading space, but I couldn't figure out how to get it.  And for some reason it converts differently in this question to how it would in a comment - as you can see, in the comment box ` :` wasn't turned into code block at all.  Is it impossible, by design, to have leading or trailing space in a codeblock?


I have a sharepoint list employee with column first and second. First has a value ( A,B,C,D) and second has value (1,2,3,4) respectively. first = drodpwn second = textbox i need that when i select "A" in dropdown then "1" should get populated in second field. values should be coming from list fields. Please help with c#. Thanks  This is not exact cascading, i have one dropdown and next is textbox. I want c# code like method "ontextselected"

I am new to SharePoint 2013. What I need to figure out is based on the following situation. I have several school districts with multiple schools within the school district. I would like to create a cascading dropdown that 1st lists the districts and then will automatically populate a list of schools within a particular district when the district is selected. Can someone tell me if this is possible and if so what steps do I take to achieve it?    Thank you!


Is both parts of the hypenative word Hands-on capitalized in an ad with bullets.

Do you capitalize both parts of a hyphenated word in a title?  "My Ex-Wife Hates Me"  or  "My Ex-wife Hates Me"


I was banned from questioning a long time ago. Till now I have gained a lot of reputation points. According to help center 'The ban will be lifted automatically by the system when it determines that your positive contributions outweigh those questions whicha were poorly received.' But how much contributions should I give?

If you are reading this, you may have been affected by one of our post quality bans. If so, it is important that you  to understand what has happened and how to regain the permissions that you lost. While trying to ask a question, one could see:  We are no longer accepting questions from this account. See  to learn more.  Likewise, for answers:  We are no longer accepting answers from this account. See  to learn more.   Why am I getting this message? Are deleted posts taken into account too? Is a question/answer ban the same as a suspension? How do I avoid getting a question ban? How long do I have to wait before I can post again? What can I do to release the ban? How can I reactivate my account? Can I simply create a new account? I'll just ask somewhere else on the SE network, and they'll migrate my question to the correct site! Will a ban on one Stack Exchange site affect my standing on other sites in the network? Does this apply to meta sites too? My account is in good standing. Why am I still blocked?


I'm having trouble using underscores in parts of sequence diagrams made using pgf-umlsd.  This is particularly perplexing as I have not had this problem in the past, though I've not used the package in maybe almost a year or so.  Here is a minimal example:  \documentclass{article}  \usepackage{pgf-umlsd}  \begin{document}  \begin{sequencediagram} \newthread{process}{process} \newinst{hash}{hash\_store}  \begin{sdblock}{Startup}{}   \mess{hash}{{list\_manifest()}}{process} \end{sdblock} \end{sequencediagram}  \end{document}   That underscore in list_manifest generates this error:  ! Missing \endcsname inserted. <to be read again>                     \protect  l.12   \mess{hash}{{list\_manifest()}}{process}   Take out that underscore and the figure generates as expected.  Previously I have made such diagrams with underscores in precisely that fashion.  I could not determine what's going wrong, or any simple way to wrap and hide that underscore.  Note that the underscore in the component instance label hash_store does not cause a problem.  I'm using pgf-umlsd version 0.6 or 0.7 (I think the \ProvidesPackage was not updated):  % History: % v0.7 2012/03/05 \ProvidesPackage{pgf-umlsd}[2011/07/27 v0.6 Some LaTeX macros for UML   This is with pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/Arch Linux), texlive-core 2013.33063-1.  What's changed and how should I rework that label?

I'm drawing a sequence diagram with  and I want to incorporate a greek letter in a message description.  Something like \mess[1]{a}{Message $\alpha$}{b}. While pgf-umlsd seems to allow $ for using the math mode, it apparently does not allow any \ (so I can't write e.g. \alpha).   \protect also doesn't work. Furthermore, I've defined a variable with \def\alph{$\alpha$}, and used it with \mess[1]{a}{Message \alph}{b}, but also to no avail. If the definition is set to \def\alph{$alpha$}, it works fine but of course doesn't produce an alpha. So, \ is apparently not generally prohibited inside pgf-umlsd message descritiptions.  Is there a possibility to somehow use greek letters?  Here is a minimal example of the problem:  \documentclass{article}                                                                                \usepackage{pgf-umlsd}                                                                                \begin{document}                                                                                \begin{figure} [ht!]                                                                                \def\alph{$\alpha$}                                                                                \def\bet {$beta$}                                                                                \begin{sequencediagram}                                                                                \newthread{a}{Alice}{Alice}                                                                                \newthread{b}{Bob}{Bob}                                                                                \mess[1]{a}{Message \alph}{b} %This doesn't compile                                                          \mess[1]{a}{Message \bet} {b} %This compiles but generates no greek letter                               \end{sequencediagram}                                                                                \end{figure}                                                                                \end{document}


I am a Pakistani national having a valid single entry valid Schengen visa and currently in Istanbul and plan is to go to North Cyprus. Do I need to take visa for North Cyprus? If, yes, could you please guide me from where I can get the visa and if online any website is available?

I am a Pakistani National currently residing in Hungary with a Hungarian residence permit that allows me to travel visa-free throughout the Schengen zone. I also know that i can travel to south Cyprus using that residence card. Will I be able to cross into northern Cyprus or do I need a separate visa for that?


what its happening here? i just want to rotate R 360/5 but if do that the math function turns in to something like R [1/(360)]  even more if i divide by one i get 3282.81º    if i want to do a simple math i need to do  R ** <backspace> 360/5 and that way works, but versions ago I only need to type R 360/5 and that was it.  I remember something about this change months ago but i really don't understand it and also didn't find anything at the reference.       Rotation   To specify a value for clockwise rotation, press R, (0 - 9), then Return to confirm. To specify counter-clockwise rotation press R, Minus, (kbd:0 - 9), then Return to confirm. Note that 270 degrees of clockwise rotation is equivalent to -90 degrees of counter-clockwise rotation.       source:

I have a problem that's kind of weird. The numpad operation keys (+, -, *, /) dont work as expected. I cant do the math when transforming objects.   For example hitting G while object is selected, then X then 2 + 2 doesn't move the object 4 units on the X axis, instead - it moves it 22 units, like if that + hit was ignored.   I've noticed it when moving from Blender 2.68 to later versions. (actually after installing 2.68 after the installation of 2.75, the 2.68 also works that way)  Is there anyway to get back the old functionality?


Give an example of an ideal that is not a subring, and a subring that is not an ideal. For the latter part, let $\mathbb{Q}$ be a ring and consider $\mathbb{Z}$ as a subring of $\mathbb{Q}$. Then we observe that $\mathbb{Z}$ is not an ideal of $\mathbb{Q}$ since the multiplication of integer and rational number gives rational number. But for the first part, I have no idea. Can anyone guide me ?

Exercise: Give an example of a subring of a finite commutative ring $R$, that is not an ideal of $R$.   I recently learned the following: Let $2^\Omega$ be the power set of an arbitrary set $\Omega$. For $A, B \in 2^\Omega$ we define $A \oplus B := (A\setminus B) \cup (B\setminus A)$ and $A\odot B := A \cap B$. Then $(2^\Omega, \oplus, \odot)$ is a commutative ring.  This ring has the following properties: Zero corresponds to $\emptyset$. One corresponds to $\Omega$. The additive inverse of $A \in 2^\Omega$ is $A$.   Now let's take $\Omega = \{a, b, c\}$. Define $M := \bigl\{\emptyset, \{a, b\}, \{c\}, \Omega\bigr\}$. Then $(M, \oplus, \odot)$ is a subring of $(2^\Omega, \oplus, \odot)$, but not an ideal: $$\{a\} \odot \{a, b\} = \{a\} \not\in M \, .$$  Is that correct?  Are there easier examples?


What is the difference between "downvote" and "downvoted"? Here is a screen shot from the Reputation sub-screen on the User tab:

When I visit the reputation tab of my profile, I see a lot of stuff. I can make out some of it, but not all.   What do all the event types mean? Why do some events show an odd reputation gain or not show any reputation change at all? Why are some events sometimes highlighted in yellow? My reputation suddenly dropped, but I don't see anything. What happened? Why do some events disappear from my reputation history?


This is what it tells me anywhere I try, the store and terminal  *Setting up spotify-client (1:1.0.80.480.g51b03ac3-13) ... dpkg: error processing package spotify-client (--configure):  installed spotify-client package post-installation script subprocess returned error exit status 1 Errors were encountered while processing:  spotify-client E: Sub-process /usr/bin/dpkg returned an error code (1)*   So I want to know how to fix this and get this to work on my computer iv tried many things but nothing seems to work, i have also purged the Spotify client and reinstalled, and then it says the same thing I need some help, my computer runs Deepin if that helps

A while ago Spotify (the streaming music service) came out with a preview for Linux of their client.  So what should I do?


I'm really new to programming and I've been searching for days for a solution to this lab I'm working on. The lab is pretty simple and I believe I have the logic down, however when executing my code, I'm not getting the desired results. The program asks for input of three integers and one character. If the character is an 'S' the program will print the sum of the first 3 integers, if the character is a 'P,' the product, 'A,' the average, and any other character prints an error.  Below is my code. It asks for three integers and a character but the result is always an Error, even if i type in an 'S,' 'P,' or 'A.'  Any help would be greatly appreciated.  Thanks, Joe      int n1, n2, n3;     String numberFromKB;     String charFromKB;     Scanner keyboard = new Scanner (System.in);      numberFromKB = JOptionPane.showInputDialog("Enter the first number.");     n1 = Integer.parseInt(numberFromKB);      numberFromKB = JOptionPane.showInputDialog("Enter the second number.");     n2 = Integer.parseInt(numberFromKB);      numberFromKB = JOptionPane.showInputDialog("Enter the 3rd number.");     n3 = Integer.parseInt(numberFromKB);      charFromKB = JOptionPane.showInputDialog(null, "Enter a character:");     if (charFromKB = "s")     {         System.out.println("Sum of integers is: " + n1 + n2 + n3);     }     else if (charFromKB = "p")     {         System.out.println("Product of integers is: " + n1 * n2 * n3);     }     else if (charFromKB = "a")     {         System.out.println("Average of integers is: " + ((n1 + n2 + n3)/3f));     }     else      {         System.out.println("ERROR!");     }  }   }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I'm using  5.5.39, and it seems like it is forgetting the max id of the auto-incremented primary key if I delete all rows from the table and then too much time passes before another row gets inserted. Here's the schema according to :  CREATE TABLE `submissionqueue` (     `SubmissionID` BIGINT(20) NOT NULL AUTO_INCREMENT,     `JSON` TEXT NULL,     PRIMARY KEY (`SubmissionID`), ) COLLATE='latin1_swedish_ci' ENGINE=InnoDB AUTO_INCREMENT=354;   The original AUTO_INCREMENT was probably 1, HeidiSQL is probably just indicating what the code would be to create the table right now.  I'm using this table as a queue to hold submissions until approval, where the id column is auto incremented.  Later, the queue is processed leaving this table empty. When a new submission occurs, if the table is functioning correctly, a new row is inserted into this table and it receives a new auto increment ID that is higher than the IDs of all previously inserted rows (even though most "previous rows" were deleted long ago).  Over time, more than 600,000 rows have been processed from this queue. So you'd expect the auto increment id to be in the 600,000s.  However, for some time now, the auto increment IDs keep becoming reset. And when I go to process this queue, the auto increment IDs have started over at 1.  It seems like, when I empty that table, and too much time passes before another row is added to it, MariaDB is forgetting the max auto increment ID that was previously in that table and instead the IDs start over at 1.  This is a problem because during processing, any rows deleted are first moved to another table with the exact same schema. Because the auto increment IDs have started over, the program errors out because the ids are no longer unique in respect to all previously processed rows.  For years this program worked flawlessly, but at some point the database started forgetting the correct auto id, starting over at 1 instead.  This table, I'm experiencing this with, has never been dropped. The only thing I do, is remove all the rows that are in the table each time the queue is processed. After this, if I immediately go insert a row, it will received the proper Auto Increment ID (respecting all the previous ids that use to be in the table). Again, however, if too much time passes before an insert occurs, the increment starts over instead of respecting previously existing row's auto IDs.  I'm just using plain old delete statements like:  delete from tableName where id < 600000

I need a way to keep auto-increment counter between mysql service restart.   As docs states by default after restart mysql autoincrement counter start from max(id)+1. How can I keep the last autoincrement value?  This is a big problem for me. I'm using envers to keep entities audits. I get as many errors as many "last rows" I delete.  Suppose I'm starting insert data into an empty table. Suppose to insert 10 rows. Then suppose to delete the last 8. In my table I will have as result 2 entities, with id 1 and 2 respectively. In the audit table I will have all 10 entities, with id from 1 to 10: entities with id from 3 to 10 will have 2 action: create action and delete action.  auto-increment counter is now setted to 11 in main table. Restarting mysql service auto-increment counter goes to 3. So if I insert a new entity, it will be saved with id 3. But in audit table there is already an entity with id = 3. That entity is already marked as created and deleted. It result in an assertion failure during update /delete action because envers cannot handle this inconsistent state.  Thanks


I am trying to Install Ubuntu on my HP ProBook which runs off of Windows Enterprise (64 bit). I am diligently trying to follow the directions, but some of the steps are greek to me. I installed Rufus and I even installed Universal USB installer on a 2 GB flash drive. I am attempting initially to have a dual boot option, but will most likely move forward with using Ubuntu permanently. Can someone please help? Thank you.

I would like to see a full how-to guide on how to install Ubuntu.


How do I use pascals identity:  $${2n\choose 2k}={2n-1\choose 2k}+{2n-1\choose 2k-1}$$ to prove that  $$\displaystyle\sum_{k=0}^{n}{2n\choose 2k}=\displaystyle\sum_{k=0}^{2n-1}{2n-1\choose k}$$  for every positive integer $n$ ?

I'm repeating material for test and I came across the example that I can not do. How to calculate this sum: $\displaystyle\sum_{k=0}^{n}{2n\choose 2k}$?


I just got approved for a MasterCard. It was only for 300. Can I increase that amount by adding my own extra money to it

Today, I  paid a $1000 bill with a credit card that has a $1500 credit limit. (Note, I have changed the numbers slightly here, but the ratios are roughly correct.) The bill has not yet been posted to my account. Can I add $1000 to my account now, knowing that that $1000 bill will show up soon?  The reason for wanting to do this: I understand that it can hurt your credit to carry a balance on a credit card that exceeds 20% of your total credit limit. From  I understand that it's a good idea to pay off your bill multiple times per month to keep this ratio low (I've been doing that for years anyway). I'm considering buying a house within the next few months, so I'm being extra paranoid about my credit rating.


What is the most suitable word for a person who doesn't feel shame in telling a lie? Or is always lying?  Is 'Proud Liar' a good word?

I'm looking for an idiom or expression for describing people who tell lies out of habit (so you cannot trust them at all).   I know that these people are called , but I'm not looking for psychological terms.  Is there any idiom or expression for describing such people?   For example:     "Did X tell that to you?! Come on, don't believe him/her. Don't you know he/she ___ (=is a habitual liar)?"


I know I can check this using congruence, which is how I should be approaching this problem.  There are so many ways I can go about the problem, but I keep getting stuck on the $11^{106}$ term.  To reduce the exponent I have tried many things: I know $11^{106}\equiv -2^{106}\pmod {13}$ Which I can then make into $-2^{106}\equiv 4^{53}\pmod {13}$, but because 106 only has factors of 1, 2, 53 and 106 I have no idea how to reduce to make the number feasible to work with.  Obviously doing without calculator, any help is appreciated.

I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two:   $13^{100} \bmod 7$ $7^{100} \bmod 13$   I've also heard of this formula:  $$a \equiv b\pmod n \Rightarrow a^k \equiv b^k \pmod n $$  But I don't see how exactly to use that here, because from $13^1 \bmod 7$ I get 6, and $13^2 \bmod 7$ is 1. I'm unclear as to which one to raise to the kth power here (I'm assuming k = 100?)  Any hints or pointers in the right direction would be great.


I have rendered the scene into a texture, and then I want to save it into a bitmap, but after lock the texture, I found there is no pixel data in the lock area. The texture can be displayed correctly on the screen. I am not sure why? 1> the format is incorrect? A8R8G8B8 has been used. 2> have I missed some important steps before get the pixel data?

I need to figure out how to get the data from D3D textures and surfaces back to system memory.  What's the fastest way to do such things and how?    Also if I only need one subrect, how can one read back only that portion without having to read back the entire thing to system memory?  In short I'm looking for concise descriptions of how to copy the following to system memory:   a texture a subset of a texture a surface a subset of a surface a D3DUSAGE_RENDERTARGET texture a subset of a D3DUSAGE_RENDERTARGET texture   This is Direct3D 9, but answers about newer versions of D3D would be appreciated too.


I guess, the title can describe the real problem.  I know that upgrading from 12.10 to 14.04 require step by step upgrades from 12.10 to 13.04 to 13.10 to 14.04 LTS.But after the EOL of 12.10, 13.04, 13.10,  I still can't update neither upgrade. I guess that one of the manual solutions are:  1- Downgrade to 12.04 LTS and then jump to 14.04LTS, is it really possible ? 2- Upgrade to 14.04LTS via DVD, is it possible??  The last question, is there any solution to upgrade from 12.10 to 14.04 LTS directly that can be expected in the near future??  Thanks for helping

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


(I am a beginner) Hello, I would like to know how to extend or cut a solid until another INCIDENT geometry. In other words, what I want to know is how to connect these two following solids:  in this following way:  Thank you and sorry for my bad english!

I'm trying to find a simple way to create vertices where two objects intersect and delete the leftover internal planes + then join the meshes so that I have one hollow mesh to sculpt. The reason I need to know this is that on my first sculpt I just joined the meshes, but it didn't create vertices at the intersecting points so when I went to sculpt it just overlapped the meshes as you can see here in the neck.  Here is what I am working on now, it needs to be 1 hollow mesh


I am not certain but I believe this story was in an anthology with other stories about humans trading with alien civilizations.  The specific story I am looking for starts with an alien king waking up and his "god" reminds him its time to dredge the harbor. There's another scene where a tradesman consults with his "god" on a fair price for his goods.  Then there's a scene where the humans are sitting around talking and one of them says that the aliens are not actually sentient, that the "gods" they hear are actually some kind of highly advanced instinct.

I would have read this about 20-25 years ago.  I believe the subject was an alien individual, but it could have been a non-standard human instead.  The hook of the story was that the subject lacked an organ like the  that allows the halves of the brain to communicate efficiently, allowing the illusion of a single consciousness.  The subject is conscious, and has thoughts, but is subject to hearing commands like "Wash your hands!" "Fetch water!" within its head.  I recall the subject (and others like the subject) believing that the voices are their gods talking to them.  To the reader it becomes clear that this is a separate part of the subject's own mind that is responsible for long-term planning and simply can't communicate with the rest of the mind in the way a "normal" human is accustomed to.


In Clean Code, Uncle Bob states that switch statements almost always break Single Responsibility and Open/Closed Principles. So does this mean that I should rarely (the only case he proposes is when switch is buried in an Abstract Factory to create polymorphic objects) use Switch Statements and therefore Enumerations? This brings the question that are Switch Statements really necessary to have in an OO Language?  Swift language for instance seems to favour enumerations (they can carry data and so on). Minimising their usage would be a major decision. Swift being an OO Language, do the same rules apply?

I've always been of the opinion that large switch statements are a symptom of bad OOP design.  In the past, I've read articles that discuss this topic and they have provided altnerative OOP based approaches, typically based on polymorphism to instantiate the right object to handle the case.  I'm now in a situation that has a monsterous switch statement based on a stream of data from a TCP socket in which the protocol consists of basically newline terminated command, followed by lines of data, followed by an end marker.  The command can be one of 100 different commands, so I'd like to find a way to reduce this monster switch statement to something more manageable.  I've done some googling to find the solutions I recall, but sadly, Google has become a wasteland of irrelevant results for many kinds of queries these days.  Are there any patterns for this sort of problem?  Any suggestions on possible implementations?    One thought I had was to use a dictionary lookup, matching the command text to the object type to instantiate.  This has the nice advantage of merely creating a new object and inserting a new command/type in the table for any new commands.    However, this also has the problem of type explosion.  I now need 100 new classes, plus I have to find a way to interface them cleanly to the data model.  Is the "one true switch statement" really the way to go?  I'd appreciate your thoughts, opinions, or comments.


Loosely speaking, the mode is the highest bump, the median is where half the area is to the right and half is to the left, and the mean is where the histogram would balance, were it a solid object cut out of a uniform block of metal   is the source.

I saw a sentence like this:     Wilkinson is contesting the release, and threatened to sue should it be released.   I could understand it but do you know what do they call this kind of use of "should" in grammar?


Even when we apply two different forces $(F_1 > F_2)$ at the ends of an ideal rope, the tension produced in the rope is constant throughout the length of the string rather than being a function of its length. I can't understand this concept, I mean taking any arbitrary element in the rope the element would be experiencing two unequal forces at its two ends so how does that make a common tension? Why is tension not equal to the net resultant force $(F_1 - F_2)$? Is tension different than a force?

So according to me in this situation there are two forces acting on A at the moment, one is the reactive force of 70 N by newton's third law and the other is the force of 60 N exerted by B. Now don't you think the tension should be the sum of the two pulling forces experienced by A (i.e. 70+60=130 N)...Please tell me where my thinking process is going wrong.


Let $q = \frac ab$ be any rational number such that $a < b$. What is the smallest positive integer $n$ such that $\frac ab \times  \left(2^n-1\right)$ is an integer?

I noticed that , given an operation like $\frac{n}{m},\;n,m \in N$ that result in a periodic decimal number, computes really fast the length of the period.  E.g. $\frac{3923}{6173}$ has a period of 3086: .  I was wondering how this computation is done: is there some method to do this (except the trivial one of executing the division and looking for a sequence repetition) ?


I have an idea of blender plugin [in details] where can i post this idea hope some one make it real


Let $A, B$ be two subsets of a set $X$, and let $f : X \rightarrow Y$ be a function. Show that $f(A \cup B) \subseteq f(A) \cup f(B)$, $f(A) \setminus f(B) \subseteq f(A \setminus B)$. Is it true that the $\subseteq$ relation can be improved to $=$?  I proved $f(A \cup B) \subset f(A) \cup f(B)$ and $f(A) \setminus f(B) \subset f(A \setminus B)$. But i'm not sure when we improved the $\subseteq$ by $=$. Can anyone give me some examples when the relation is $=$?

Let $f: A\longrightarrow B$ be a function.   1)Prove that for any two sets, $C,D\subseteq A$ , we have $f(C) \setminus f(D)\subseteq f(C\setminus D)$.  2)Give an example of a function $f$, and sets $C$,$D$, for which $f(C) \setminus f(D) \neq f(C\setminus D)$  First time exposed to sets.. how would I go about proving this? What assumptions should I make?


I am using the beamer template miniframes with the following specifications:  \documentclass[xcolor=x11names,compress]{beamer} \useoutertheme[subsection=false,shadow]{miniframes} \useinnertheme[shadow=true]{rounded} \usefonttheme{serif}   One aspect is, there are dots at the top of the page in the header, one dot corresponding to  every frame. As I progress through this, the active dot keeps moving along (I'm sure most readers must have seen this template).   Is there any way to prevent one specific frame from appearing amongst the dots?  I.e. all others are as usual, just one specific frame doesn't show up there.  {frame}* doesn't seem to be working.   Any work-arounds?

I'm making a beamer presentation using the miniframes outer theme, with navigation bullets, and the subsection=false option, meaning the bullets are all on a single row. The problem I have is that, if one section has too many pages, the bullets overflow to the next section:  Section 1 Section 2 oooooooooooooooooooo   I tend to have many frames, some of them just asking a question, leading to the next detailed frame. I don't really need those frames to be represented by navigation bullets, and removing them would fix the problem. Any idea how to do that?  I could cheat by using overlays to have the question and the answer on the same frame, but that would be a mess...  Code example to answer percusse's question: this should give you one circle per frame, not one per subsection. If you add many frames in one subsection, the circles will overflow over the next section.  \documentclass[compress]{beamer} \useoutertheme[subsection=false]{miniframes} \begin{document} \section{S1} \subsection{SS1} \frame{1} \frame{2} \frame{3} \subsection{SS2} \frame{1} \frame{2} \frame{3} ... \end{document}


I have an 29" LaPierre Hardtail. What is the difference between 29" wheels and smaller ones?  I'd like to know this not only for single trails but also on the road and / or downhill trails.

I was wondering what advantages 29" wheels give. From what I understand they are well suited to mountain biking. Are they any use on road bikes perhaps?


I just updated Filezilla, but now it moved strangely out of the screen bounds. CF screenshot.  I haven't found any way to make it appear entirely: the upper bar is unreachable and the app edges can only resize it! Anyone knows?  Thanks.

I encountered a strange problem today. I downloaded FileZilla and on first launch the title bar was above my mouse pointer's reach. Making the window unmovable.  Here is a screenshot of my situation.    Is there a way to fix this? I've tried reopening the application and rebooting.


How can I clean a USB flash drive from infections safely without losing files/documents inside?  When I connect USB drives, there are shortcuts, exe files and hidden files, so I want to make un-hidden, cleaned from viruses and safe docs and files too.

I work at an embedded software company. This morning I found a USB stick in the parking lot in front of the building. With all the stories of "dropped USB stick attacks" in mind, I'm obviously not going to just plug it into my laptop. OTOH, I'm curious to know whether this was actually an attempt to compromise our systems, or it's really just an innocent case of somebody accidentally losing a USB stick. How do I safely inspect the USB stick without risking exposure?  I'm worried not just about malware and crafted file system images; there's also stuff like power surge attacks:.  EDIT: Many of the answers seem to assume I want to keep the drive and use it afterwards. I have no interest in that at all, I know USB sticks are cheap, and that it wouldn't be mine to keep anyway. I only want to know whether this was indeed a semi-targeted attack, partly out of curiosity whether this actually happens in real life and not just in security papers, but also so that I could warn my coworkers.  I want to know how I would figure out whether the stick contains malware. And that's not just a matter of looking at the drive contents and seeing a suspicious autorun.inf or a carefully crafted corrupt file system - I very much also want a way to inspect the firmware. I sort-of expected that there were tools for extracting that and comparing to known-good or known-bad binaries.


I have one question, is it possible to download .apk file from Google Play directly to the PC (without any ADB or device emulators?) I have tried this one ->  but I can't download the app that I need. (I want to download it for my research, but I can't do it ), Also I have read about Chrome/FF extension which helps to download apps, but i need to insert my credentials to this extension (GMail for account + device id), and I don't think that is a good idea for safety.  So does anyone have any other ideas about my question?

I can't download apps from the Play Store on my Android device (maybe due to a network issue), so I'm wondering how could I download the APK file of an app on my PC from ?


I have Solaris 8 OS installed in French.  I have a computer with Solaris 8 OS and French language installed. This computer isn't in my office; to access it I use Exceed. I have to switch the installed language from fr_FR.UTF-8 to en_US.ISO8859-15  How can I do that?   P.S :Even when i try to edit /etc/default/init and reboot : nothing happens.

I have Solaris 8 OS installed in French.  Is it possible to switch from French to English without reinstalling the OS ? If yes how ?  When locale -a i have this :  POSIX common en_US.UTF-8 C iso_8859_1 en_CA en_CA.ISO8859-1 en_US en_US.ISO8859-1 en_US.ISO8859-15 en_US.ISO8859-15@euro fr_CA fr_CA.ISO8859-1 iso_8859_15 th th_TH th_TH.TIS620   Even when I try to edit /etc/default/init with :  LANG=en_US.ISO8859-15 LC_COLLATE=en_US.ISO8859-15 LC_CTYPE=en_US.ISO8859-15 LC_MESSAGES=en_US.ISO8859-15 LC_MONETARY=en_US.ISO8859-15 LC_NUMERIC=en_US.ISO8859-15 LC_TIME=en_US.ISO8859-15 LC_ALL=en_US.ISO8859-15   and reboot : nothing happens.  To verify the result i always use date and when i reboot : i also have the date in french.  P.S : I have to do this configuration in a computer which isn't here in my office, so i have to this manipulation in a an another computer here in my office and if it works, i'll do it to the other computer.  So the computer here is configured in English and i have to switch it to French. Here is the content of my ~./dt :  C                     errorlog              sessionlogs Desktop               errorlog.old          sessions Trash                 errorlog.older        simulateur.dtwmrc appconfig             help                  startlog appmanager            icons                 startlog.old asr.dtwmrc            outils.dtwmrc         startlog.older bin                   palettes              tmp bookmarks             sdtfonts              types dtwmrc                sdtpcaction.conf      wsmenu en_US.ISO8859-15      sdtpcaction.conf.bak   Thanks


I read this a few years ago, I think it was written in the '90s or later. The style is Terry Goodkind's Sword of Truth (well, to me). The name of the author might be similar, too.  The story revolves around the prince of a medieval-type kingdom, one of over ten in an area of fragile peace. The people (of all the kingdoms) are waiting for a warrior(?) to reveal himself as some sort of 'Chosen One' with a special name. There are hints that the protagonist might be him, but it later seems he does not have one of the foretold requisites (something to do with his birth?). At the end of the first book, after a huge battle, the prince's father dies but the prince loses his kingdom because the majority of the warlords saw his battlefield behaviour (incorrectly) as unbecoming.  The second book tells of how the prince, in the company of a small band of followers, including his wine-loving friend, Marat (or Marad) travels looking for that ‘leader’ or something.  I only got partway through the second book but am curious to read the rest. Could someone identify the series for me, please?

I'm trying to remember the name of a book series of which I remember only the following, with Google yielding no results.   the name of the author starts with a Z   the main character is a knight in an household with a name sounding like Malachai who goes on a quest with six others guys and girls (a bard, another knight, a priest, etc.) and each of them finds a stone of colour which has a power on various things (like fire, their mood or water) and then they set toward a quest to beat some ancient evil. I used to find the book at the local library 10 years ago in France (but it was translated).


I have the following code:  The page Login.php    <?PHP       session_start();       include("conexion.php");       $conn = conexion();       extract($_POST);        $password = md5($pass);       echo $password;       $sql1="Select * from miembro where user='".$user."'and pass ='".$password."'";       $re= mysqli_query($conn,$sql1);      $numrows1 = mysqli_num_rows($re);       echo $sql1;       echo $numrows1;      if ($numrows1==0 or $numrows1>=2){         $_SESSION['session'] = "no";       header('Location:' . getenv('HTTP_REFERER'));      }else{         $row = mysqli_fetch_array($re);         $_SESSION['nombre'] = $row["nombre"];         echo $_SESSION['nombre'];         $_SESSION['codigo'] = $row["codigo"];         $_SESSION['pass'] = $row["pass"];         $_SESSION['apellido'] = $row["apellido"];         $_SESSION['telefono'] = $row["telefono"];         $_SESSION['user'] = $row["user"];         $_SESSION['cargo'] = $row["cargo"];         $_SESSION['correo'] = $row["correo"];         $_SESSION['session'] = "si";         $_SESSION['last_time'] = time();         header("Location: ./actions/perfil.php");       }     ?>     And perfil.php (where the user is taken once logged in)    <?php  include("./menu_actions.php");  include("../conexion.php");  if($_SESSION['session'] != "si"){   header("location: ../home.php");  }   $us = $_SESSION['user'];     $sql="select * from miembro where user = '$us';";    echo $sql;    $query = mysqli_query(conexion(),$sql);    $row = mysqli_fetch_array($query);    session_start();   if(isset($_SESSION["user"])){     if((time() - $_SESSION['last_time']) > 10){ //After 10 sec     header("location:logout.php");     }   }   else{     header('Location:login.php');   }   ?>    //HTML     It's not working and I don't understand why. The time of the start of the session is kept in a variable and analyzed later with an if loop, so if the time exceeds 10 seconds, the user should be forced out and taken to the login page again, but I can't make it work. Could somebody help me, please?

I need to keep a session alive for 30 minutes and then destroy it.


My python code creates a huge hash table (60GB+) on which a number of heavy readonly operations are to be performed. To speed things up I fork the process a few dozen times once the hash table has been created so that each operation can be done concurrently (48-core machine).   Once all these forked children are done with their thing I wish to merge their output, so I need a way for the parent process to be able to wait for more than one pid. How do I achieve that?  Forking is a key part here as I rely on the forked processes' memory pages being mapped to the parent's address space to reduce footprint. The hash table is being created by another library so modifying its implementation isn't an option.  children = [] for index in batch:     tracks = batch[index]     pid = os.fork()     if pid == 0:         # forked process         run_batch(tracks, index)     else:         # main process         children.append(pid)         print('spawned child ', pid)

A python script need to spawn multiple sub-processes via fork(). All of those child processes  should run simultaneously and the parent process should be waiting for all of them to finish. Having an ability to set some timeout on a "slow" child would be nice. The parent process goes on processing the rest of the script after all kids are collected.  What is the best way to work it out? Thanks.


Isn't it true that the concept of length exists only within the universe? Are we simply measuring the observable universe, that is to say, the spatial limits of our observation?

Ok, from astronomical observations we can tell that the observable matter is separating - so rewind the clock about 13.7 billion years and it was all at a single point.  However, how do we distinguish between the following two options:     Universe is expanding   Matter distribution is increasing into infinite void   Clarification 1: (My notion of) The traditional notion is that all time/space/matter was created at the instant of the big bang.  I.e. BB was inital conditions of: $t=0$, $V=0$, $E=very big$  People say "the universe is expanding", rather than "observable matter is separating".  Why is this?  How do we know that the big bang event wasn't started by all matter condensed at a single point within a larger (otherwise empty) universe?  How do we know that BB wasn't: $t=0$, $V(universe)>0$ but $V(matter)=0$, $E=very big$?


I want to go to Prague for a few days and do there some geocaching. I need therefore SIM card with internet package or internet flat rate. I don't think the traffic generated while geocaching will be more that 50MB a day, so 200-300MB package instead of flat rate would be also reasonable.  So I want to use only internet, only for a few days, I want to pay as little as possible and the SIM card should be relatively easy to purchase (on train station, for example).   What's the SIM card that fulfills my criteria at best?

Next month I am traveling to country X, where I would need Y minutes of calls, Z text messages and most importantly Q megabytes of data. How can I find the cheapest/most reliable SIM card for my needs?


I need to add a small text in the title page at the upper right corner. Does anyone know how to do that? I tried to search online, but I couldn't do that.

I have written in TeX the following:  \section{A} ... somethingA ...  \begin{picture}(100, 100)(-250, -110) \includegraphics[scale=1]{face.png} \end{picture}  \section{B} ... somethingB ...   I have put specific parameters in picture (-250, -110) so that the picture is added in the top right of the created page. Although this works just fine, face.png appears where I want it, the problem is that there is a big gap between somethingA and somethingB. So I have something like this in the created document:  ... somethingA ...      ... somethingB ...   Any ideas how to solve this?


I have a question about pixels. I made a background for a poster for a party. Put i think when i make the picture larger you will see a lot of pixels. Can someone help me to fix this? If you can help me it would be wonderful!    I made this in photoshop cs6.  thx jenten

I am using Paint to draw some swords for a character I have. I am not very experienced and this is my first time trying to draw swords.  My question is how large (Preferably in pixels) do I need to make the picture to make the curves on the sword to look smooth. I am using current scale of 100 pixels = an inch. For the first sword I made this worked fine as there were few curves and they were small but the one I am working on now have a larger curve. (A good reference is .)   EDIT: I only have access to paint. I would use other programs if I could.


I have been using my laptop for the longest time with blender. I recently got a new PC. When I copied the .blend file and dropped it in my new PC, no materials were on my mesh. How do I fix this??

I'm moving all files to a new computer, via an external hard drive. I am certain that broken links will be a concern. What can I do to fix this? Is there a 'Best Practices' kind of way to prevent this problem beforehand? I have many hundreds of .blend files, and of course, I fear losing them.


My doubt is on using Stack Overflow. Is there a way I can save a Stack Overflow post which I like on my profile page, so that they can be my future references?  I mean a function similar to Facebook likes or Pintrest pins.

What does bookmarking a question mean? How do you bookmark a question? Do users get updates on their bookmarked questions? Are my bookmarks publicly visible? How do you see your own bookmarks? How do you see other users' bookmarks? How do you see which users have bookmarked a particular question? What impact does the bookmark system have on the voting system? Can I "un-bookmark" a question? Can I search within my bookmarks?


Assume that $f$ is Riemann-integrable on the interval $[a,b]$ and $\epsilon$ is a positive number.    Prove that there exists a continuous function $g$ such that $\int_a^b|f-g| \lt \epsilon$ .    Note : The problem is the existence of the function. I don't know how to show it. Any hint or clue would be useful. An answer would be great.    Thanks in advance.

I have proved that if $f \in R[a,b]$ and given $\epsilon > 0$ there exists a continuous function $g$ such that $$\int_a^b |f-g| < \epsilon$$ I was wondering if using this fact there is some way to show that there is also some continuous function $h$ such that $$\int_a^b |f-h|^2 < \epsilon$$ Any help will be appreciated, thanks :)


Theorem: $\forall n, m\in\mathbb N$ such that $\gcd (m,n)=1, $ the cyclic group $C_{nm}\cong C_n\times C_m$.   This is a corollary of Chinese Remainder Theorem.   The theorem can be recast as saying that doing cyclic permutation on a list of all elements in the product is equivalent to doing so to each of the components. So, there has to be a more direct and intuitive approach. In other words, my goal is to find a constructive proof by explicitly constructing an isomorphism without using CRT (maybe by induction over $n$?), but I don't know where to start since I'm not familiar with permutations. Can anybody give me a hint?

Say you have two groups $G = \langle g \rangle$ with order $n$ and $H = \langle h \rangle$ with order $m$. Then the product $G \times H$ is a cyclic group if and only if $\gcd(n,m)=1$.  I can't seem to figure out how to start proving this. I have tried with some examples, where I pick $(g,h)$ as a candidate generator of $G \times H$. I see that what we want is for the cycles of $g$ and $h$, as we take powers of $(g,h)$, to interleave such that we do not get $(1,1)$ until the $(mn)$-th power. However, I am having a hard time formalizing this and relating it to the greatest common divisor.  Any hints are much appreciated!


$$\frac{1}{n+1}< \log(1+ 1/n)$$  Any ideas? I tried estimating the difference between $1/n$ and the logarithm and comparing with $1/n-1/(n+1)$ but I miserably failed.


Since \sout  does not work in math mode, what can I use instead?  I don't want the diagonal strikeout like with cancelf

I would like to find a way to cross out a term in a mathematical expression with a diagonal arrow pointing from lower left to upper right and with a little "zero" next to the pointy end of the arrow.


Two old gamblers alternate at rolling a fair 6-sided die until the first 6 comes up. Compute the probability of the first player winning.  Let X be the number of trials the first one can one. Then P(X=1)=$\frac {1}{6}$  P(X=3)= $(\frac {5}{6})^2$* $\frac {1}{6}$  P(X=2n+1)=$(\frac {5}{6})^{2n}$* $\frac {1}{6}$  I am not sure how to conclude from this.

Question: Players A and B play a sequence of independent games. Player A starts and throws a fair die and wins on a "six". If she fails then player B throws the same die and wins on a "six" or fails otherwise. If she fails then player A gets the die and throws again, and so on. The first player to throw a "six" wins. Find the probability that player A wins.  Here is what I have done:  A wins right away: $\dfrac{1}{6}$  A fails B wins: $\dfrac{5}{6}\times \dfrac{1}{6}$  A fails B fails A wins: $\dfrac{5}{6}\times \dfrac{5}{6}\times \dfrac{1}{6}$  Unlike another similar question which the player B can win on "five" and "six" after player A fails on the first throw, in this case, the games do not seem to have an endpoint. How should I calculate the probability that player A wins then?


Friends  I want to split the one string after some specific symbol in java script(JS) this this was dynamic come anything but i want to separate it with = sign   Like  var string = "Hello = World" i want to split it using = sign  like   string[0] = Hello; string[1] = World;   Please Give me a Solution.

I have this string  'john smith~123 Street~Apt 4~New York~NY~12345'   Using JavaScript, what is the fastest way to parse this into  var name = "john smith"; var street= "123 Street"; //etc...


Prove that $|||A||| \leq |||I|||$ for every doubly stochastic matrix $A \in M_n$. Let $|||\cdot|||$  be a unitarily invariant norm on $M_n$.    Do you (experts) agree with these proofs? Please correct me if I am making any mistakes. Thank you so much in advance.  Proof#1: Utilizing , the doubly stochastic matrix $A$ can be described by a convex combination of permutation matrices, i.e.,  $$A = \sum_i \alpha_i P_i , $$ in which $\sum_i \alpha_i = 1$, $\alpha_i \geq 0 \ \forall i$, and $P_i$ are the permutation matrices (with norm $1$).   So, by utilizing the properties of the matrix norm $$|||A||| \leq \sum_i |\alpha_i| \ \underbrace{|||P_i|||}_{=|||I|||} = |||I||| \sum_i \alpha_i = |||I|||. $$   Proof#2: See herein

Let $\left\| {\left| . \right|} \right\|$ be a unitarily invariant matrix norm on $M_n$.  Why does $\left\| {\left| A \right|} \right\| \le \left\| {\left| I \right|} \right\|$, for every doubly stochastic matrix $A \in M_n$ ?


I've tried that example   In a new document and I get gnuplottex package working, however, when I include gnuplottex package in my project doesn't work properly and it is the package because when I remove it does work fine. With package loaded I get that message:  ! Package catchfile Error: File `<projectname>.gnuploterrors' not found.   and this one:  Runaway argument? \ifx \gnuploterrors@ \@empty \else \PackageWarningNoLine {gnuplottex}\ETC. ! File ended while scanning use of \gnuploterrors@eatpar.   Does anyone use gnuplottex usually? Thank you so much!

Whenever I try to use the gnuplottex package, I get the following error messages:  /usr/share/texlive/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty:79: Argument of " has an extra }. [...te\write18{rm -f "\jobname.gnuploterrors"}] /usr/share/texlive/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty:79: Paragraph ended before " was complete. [...te\write18{rm -f "\jobname.gnuploterrors"}] /home/myDocument.tex:118: Package catchfile Error: File `myDocument.gnuploterrors' not found. [\end{document}] TeX STOPPED: File ended while scanning use of \gnuploterrors@eatpa\ifx \gnuploterrors@ \@empty \else \PackageWarningNoLine {gnuplottex} TeX reports the error was in file: myDocument.tex   Line 79 of gnuplottex.sty reads \immediate\write18{rm -f "\jobname.gnuploterrors"}, so it not being executed seems to be the cause for the other errors.  Everything worked fine before, but I upgraded to Xubuntu 16.04 LTS lately, so this may be the cause. I already tried removing gnuplot and TeX Live completly and installing them again, but the error remains.  Edit:  I'm using pdflatex and Version 0.9.1 of gnuplottex. All it needs to produce this error is just a \usepackage{gnuplottex}, so for example this document doesn't compile:  %!TEX options = "--shell-escape"  \documentclass[a4paper]{article}  \usepackage{gnuplottex}   \begin{document} \end{document}   However, I noticed that with this minimal file, only the last 3 lines of the error message from above are shown. All 5 lines are only shown if I also add \usepackage{ngerman}.


I need to tar-gzip files below a certain size in a directory. I tried the command suggested from  and it works, but when I changed the argument for find -size to -1G, it ignores some files even when the file size is below 1GB. When I supplied -100M and even -900M those files were not ignored. Some information about the files: The files in the directory consists of several medium-sized files (1-200 MB) and thousands of tiny files (<1 MB each). The medium-sized files are executables (.exe extension). The tiny files are just some random files with either no extension or .lat extension. When I supplied -900M, all the tiny and medium-sized files are returned as the result. However, when I supplied -1G, all the medium-sized files and many tiny files are missing from the result. Question: Is there anything I miss here about the usage of -size -1G? Other (possibly useful) info: I'm running Ubuntu 15.04 as a VM on my Windows 8.1. If anyone suspects it has something to do with the files I'm working with, please let me know and I will upload the all the files in question. I'm rather new to Unix/Linux and this is my first question in superuser forum so if I have unintentionally violated any rules please kindly let me know.

I noticed that the these two commands to list files below 5 GiB produce different results:  find . -type f -size -5368709120c find . -type f -size -5G   Specifically the one that uses kilobyte unit (5368709120c) returns additional files that are larger than the maximum file size returned by the one that uses the GiB unit (5G).  From the find manual page I read the following:  -size n[cwbkMG]           File uses n units of space.  The following suffixes can be used:           `b'    for 512-byte blocks (this is the default if no suffix is used)           `c'    for bytes           `w'    for two-byte words           `k'    for Kilobytes (units of 1024 bytes)           `M'    for Megabytes (units of 1048576 bytes)           `G'    for Gigabytes (units of 1073741824 bytes)  The size does not count indirect blocks, but it does count blocks  in sparse files that are not actually allocated.  Bear in mind that the `%k' and `%b' format specifiers of -printf handle sparse files differently.   The  `b'  suffix always denotes 512-byte blocks and never 1 Kilobyte blocks,  which is different to the behaviour of -ls.   So, given that the unit of G is 1073741824, 5G should be 5368709120c. Is the issue due to how sparse or indirect blocks are counted?  Thanks in advance for the help.


Find the generating functions in variables $r,b,g$ for the number of ways to paint a dodecahedron red,blue and green.   For example the coefficient of $r^5b^4g^3$ should be the number of ways to paint the dodecahedron with 5 red faces, 4 blue faces and 3 green faces.  I know that we should use Polya's enumeration theorem but I have no idea how to continue. Any solutions are appreciated.   Also it is allowed to be that r=0,or b=0 or g=0

I found some months ago that there are the Polya's enumeration theorem to compute number of colorings of dodecahedron. I got interested to find how to show by using only Burnside's lemma that there are 9099 ways to color dodecahedrom by three colors. How can I do the computation?


I wonder if there is a way to calculate the  $$S_n=\sin x + \sin 2x + … + \sin nx$$   but using only derivatives ?

How can we sum up $\sin$ and $\cos$ series when the angles are in arithmetic progression? For example here is the sum of $\cos$ series:  $$\sum_{k=0}^{n-1}\cos (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \cos \biggl( \frac{ 2 a + (n-1)\cdot d}{2}\biggr)$$  There is a slight difference in case of $\sin$, which is: $$\sum_{k=0}^{n-1}\sin (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \sin\biggl( \frac{2  a + (n-1)\cdot d}{2}\biggr)$$   How do we prove the above two identities?


Find the value of the series $$\sum_{n=0}^\infty \frac{n^{2}}{2^{n}}.$$ I tried the problem but not getting the sum. Please help.

I'd like to find out why  \begin{align} \sum_{n=0}^{\infty} \frac{n^2}{2^n} = 6 \end{align}  I tried to rewrite it into a geometric series  \begin{align} \sum_{n=0}^{\infty} \frac{n^2}{2^n} = \sum_{n=0}^{\infty} \Big(\frac{1}{2}\Big)^nn^2 \end{align}  But I don't know what to do with the $n^2$.


We are planning to migrate an application from AWS cloud to on-prem. For our application, we were using AWS ALB. For on-prem deployment, we are planning to use an Nginx load balancer. But I'm not sure about what configuration is required for hosting the load balancer because in the cloud (AWS) we are not concerning about the machine specs.   What are the criteria for selecting a machine as a load balancer? I mean the RAM, CPU, etc. I'm afraid that if I choose a 4GB machine will that be enough for the load balancer? How can I choose the machine?

This is a  about  Related:      I have a question regarding capacity planning. Can the Server Fault community please help with the following:   What kind of server do I need to handle some number of users? How many users can a server with some specifications handle? Will some server configuration be fast enough for my use case? I'm building a social networking site: what kind of hardware do I need? How much bandwidth do I need for some project? How much bandwidth will some number of users use in some application?


I know that in Jackson's Fellowship of the Ring Bilbo greets Gandalf as an old friend that he hasn't seen for many years. That implies that it's the first meeting between the pair since Bilbo returned from his adventures at the end of The Hobbit.                                  In the books there is no such meeting. Biblo simply gives Gandalf a hand loading the fireworks off the cart and then later has a discussion with Gandalf about meaning to follow through with his plan.     At Bilbo's front door the old man began to unload: there were great bundles of fireworks of all sorts and shapes...When the old man, helped by Bilbo and some dwarves, had finished unloading, Bilbo gave a few pennies away...   (Fellowship of the Ring, Chapter 1, A Long-Expected Party).   There's no indication in that snippet of whether this is the first time Bilbo has seen in many years.  Did Bilbo see Gandalf between the end of The Hobbit and the meeting above in The Lord of the Rings?  I'm interested in an answer based on the books. I'm only going off the movies since I don't have a copy of The Hobbit on me.

It has been a while since I read the Lord of the Rings novels (don't have a copy at the moment) but I seem to recall he went to Hobbiton at least once, as the young hobbits were always excited to see him.   Did he travel there often?


I'd like to setup auto download of some Anime using an RSS feed, but only 720p versions. The format never changes and it always looks like below.  [Blahblah] Blahepisode - 12 [720p].mkv  Here is the regex I have come up with but cannot get to work properly.  /.\+[720p]+/g   Any help would be appreciated!

I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?


Well I got it from a competitive exam paper from 2012. $$ {  } $$ Let $a_n$ be the number of all $n$ - digit positive integers formed by digits $0,1$ or both such that no consecutive digits in them are $0$. Let $b_n =$ number of such integers ending with $1$ and  $c_n =$ number of such integers ending with $0$.  $$ {  } $$ Then I made a table: $$1$$ $$10,11$$ $$101, 110, 111$$ $$1010, 1011, 1101, 1110, 1111$$ $$10101, 10110, 10111, 11010, 11011, 11110, 11111$$ $$....\text {etc.} $$ While $c_n=F_n$ is clearly the Fibonacci sequence, $b_n=F_{n+1}$ and $a_n=F_{n+2}$. How? Is there a way to prove it? I thought perhaps we could use combinatorics but, just a thought, no way out. Any help/suggestions are welcome. Thanks!

For this problem, I used a proof by induction. My base case was essentially defining $b_1 = 2$, $b_2 = 3$, and then proceeding to the inductive step.  In the inductive step, I use strong induction. I assume the claim holds for $n=1,2,...i-1$ and show it holds for $i$.  We have by the inductive hypothesis $b_{i-1}$ is the number of $i-1$ length binary strings with no consecutive $1's$. To each of these such strings, we can add $0$ to generate $i$ length binary strings with no consecutive $1's$. We now have $b_{i-1}$ binary strings that end with $0$ and have no consecutive $1's$.  We have by the inductive hypothesis $b_{i-2}$ is the number of $i-2$ length binary strings with no consecutive $1's$. To each of these such strings, we can add $01$. These new strings are distinct from the strings we created above, as these strings end with a $1$, but the above strings end with a $0$. So, we have $b_{i-2}$ binary strings that end with $1$ and have no consecutive $1's$.   We note a binary string $B$ can be classified as such:  Ends with a 0: Last two digits are 10, 00. Case 1 considers all these strings  Ends with a 1: Last two digits are 01, 11. Case 2 considers all strings of the former case. The latter case is a violation, and each case ignores it.  Thus, $b_i = b_{i-1} + b_{i-2}$.   My problem here is:  1) Is my argument classifying the strings and then showing we counted correctly sufficient?  2) Is the proof by induction correctly formatted? I notice I am not using the fact $b_{i-1} = b_{i-2} + b_{i-3}$, but I do not know how to derive the conclusion without working on the assumption that $b_{i-1},b_{i-2}$ are indeed the correct number of binary strings without consecutive $1's$. It seems I am using induction right now to work under the assumption that the claim holds for all values $<i$, but could I not use induction and still work under this same assumption?


Let $V$ be a finite-dimensional vector space over a field $K$. Let $T$ be a linear operator on $V$. Prove that there exists a unique sum $V=V_{0}+V_{1}$ such $T(V_{0}) \subseteq V_{0}$, $T(V_{1}) \subseteq V_{1}$, $T|_{V_{0}}$ is nilpotent, and $T|_{V_{1}}$ is invertible.   Is this exercise related to invariant spaces and direct sums? I was reading the theory, and I can't see how start the problem.

I know that if $V$ is a finite-dimensional vector space and $T$ is a linear operator on $V$, then $T$ is a direct sum of a nilpotent operator and an invertible operator.   My question is: Is there an infinite-dimensional vector space $V$ over a field $\mathbb{F}$ such that every linear operator $T$ on $V$ can be written as a direct sum of a nilpotent linear operator and an invertible linear operator?  I mean "There are subspaces such that $V=M\oplus N$ where $T$ is invertible on $M$ and $T$ is nilpotent on $N$"?


I've seen it a lot in python/Lib source code but I don't know what it is for.  I thought it was used to limit accessible members of of a module. So only the elements at __all__ will show up when dir(module).  I did a little example and saw it was not working as I expected.  So... What's the python __all__ module level variable for?

I have been using Python more and more, and I keep seeing the variable __all__ set in different __init__.py files.  Can someone explain what this does?


I am slowly teaching myself how to code and have come across something that has stumped me  I am getting a nullpointer exception when using setImage to change an image around.  I am aware this is possibly down to the imageview not being initialized when I am making the change, but I am not sure if that is the case.  I currently have this piece of code which is dealing with my scene switches  public void initSceneSwitch(String scr) {         try {             Parent root = FXMLLoader.load(getClass().getResource("/main/resources/fxml/" + scr + ".fxml"));              sceneDisplayed = new Scene(root);             sceneDisplayed.getStylesheets().add(getClass().getResource("/main/resources/css/GameTheme.css").toExternalForm());                       primaryStage.setScene(sceneDisplayed);             primaryStage.show();             sceneChange(scr);          } catch (IOException e) {             e.printStackTrace();         }     }   This will deal with image switches, in the long term, with the possibility of more variables which determine which image to display  public void sceneChange(String newScene) {         switch (newScene) {             case "UILoadingScreen":                  break;             case "UIMainScreen":                 UIMainScreen uiMS = new UIMainScreen();                  Image img= new Image("/main/resources/icons/test.png");                 uiMS.getImageView().setImage(img);                 uiMS.getImageViewAnchorPane().getChildren().add(uiMS.getImageView());                 break;                           default:                  break;         }      }   The nullpointer exception occurs on uiMS.getImageView().setImage(img);.  This is where I am confused, from thinking about how my code is running "along a line", I would think that both my controller and fxml file would have been loaded and initialized before I am making the method call to change images around.  Can anyone point me in the general direction of what I need to be looking at, because my brain hurts

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


In Windows OS I used to have 2 partitions:   partition #1: Windows OS partition #2: WorkPlace  Please take a look at my current partition set up:   Partition    | File system   | Mount Point | Flags =================================================== /dev/sda1    | btrfs         | /           | boot /dev/sda2    | extended      |             |    /dev/sda5  | btrfs         | /home       |    /dev/sda6  | linux-swap    |             |   Questions:    How do I know if all my personal files such as: videos, musics, work docs, php scripts, web templates, etc .... are been saved in sda5/home? How can I make sure Ubuntu is installed on sda1?

In Windows there’re perhaps only a couple of important folders (by important I mean important in my logical picture of the Windows file system) in the installation drive (in my case C:\). Namely Program Files and Windows. I simply stay away from Windows folder and the “add remove program files” is good enough to handle the program files folder of Windows. Of course there’s a folder named Users where the users (who are not admins) can access only their folders.  Thus there’s a clear picture at some level in my mind of the Windows file system. In Ubuntu, when I reach the location /, there’s a huge list of folders, most of which I have no clue as to what they contain. The /bin folder seems to be the equivalent of the Windows folder in windows. The /usr folder seems like it’s the equivalent of the Users folder in Windows. But even the /home folder looks like it can fit the bill.  Please understand that I do understand, that Ubuntu (Linux) has a different character than that of Windows, i.e., there need not be exact equivalent of Windows functions, in Ubuntu. All I am looking for is a bit more clearer picture of the Ubuntu file system.   This question is a part of a bigger question which I am splitting up to make it more answerable. The original question can be found here:


var string = 'a,b,c,d'; var array = [];   As we can see above I have one string values with separator*(,)*. I want to split these values and wants to push in the array. At last I want to read my array by using for loop. Please suggest.

I have this string  'john smith~123 Street~Apt 4~New York~NY~12345'   Using JavaScript, what is the fastest way to parse this into  var name = "john smith"; var street= "123 Street"; //etc...


Take this non-FTL scenario, involving a phone call and the postal service.  I send a postcard to my friend in Paris, asking whether they would like to visit me.  Since it will take some time to arrive, I decide to telephone instead and ask the same question.  I mention there is a postcard on the way, and my friend says yes, they would like to visit me.  After we finish speaking, my friend realises we didn't agree on a date for the visit, so my friend sends me a postcard to ask which date suits me best.  After realising that it will take some time to arrive, I get a telephone call from my friend asking the same question.  We agree on a date for the visit and hang up.  Some time later a postal worker in Paris is very confused, as they first see a postcard thanking the recipient for the invitation to visit, and then a few days later they see a second postcard inviting the same person to visit.  Somehow they have received the reply before the invitation.  They decide to telephone both my friend and I as our phone numbers are listed on the postcard, but we explain to the postal worker that we used the telephone to convey the information some time ago, and the postcards are arriving out of order due to the speed of the postal service.  Shortly afterwards, my friend receives my letter, and a day later I receive my friend's letter.  None of this violates causality, despite the postal worker seeing the events out of order, by getting the response before seeing the invitation.  Now if my friend was located in a distant star system, the postcard and postal service was replaced by a message sent at the speed of light, and the telephone was replaced by an instant FTL communication device, what exactly would change?  Apparently FTL communication allows things like the reply to arrive before the message was sent, but I cannot see how this would happen any more than telephoning before a postcard arrives results in time travel.  Even if my friend was travelling close to the speed of light (relative to me), experiencing a slower ticking clock, I cannot see how this would result in causality violation.  Sure, when I call my friend on the FTL-phone they'd hear my voice sound like a chipmunk because I am experiencing time faster than they are, but I can't see how any of this could result in anything going backwards in time.  Sorry to ask yet another of these questions but all the other answers I can find seem to involve a certain element of hand waving that avoids the key points of the issue.  In the hopes of avoiding this question being flagged as a duplicate, here are similar questions and my reasons why they don't answer this question:    States you will arrive before you leave but doesn't explain why.  Says the speed of light is constant no matter your reference frame, but seems to assume the speed of a spaceship travelling at c is also constant regardless of the reference frame.  That doesn't seem right to me, I can't see how a spaceship would "speed up", just because you view it from a different vantage point that happens to be moving in the same direction as the ship.  Photons may not be able to go slower than c under any circumstances, but a space ship sure can.  Seems to consider two frames with different clock speeds as synchronised, so a message sent at T1 = 10 will arrive at T2 = 10 even though T2 might be running at half the speed.  Explains that there is no universal timeline.  None is needed if you can calculate the speed of your friend's clock relative to your own.  Sadly I lack the physics degree required in order to understand the answer here.   I would really appreciate a detailed example showing exactly how FTL could produce a paradox and more specifically, why the paradox cannot be avoided.  Thanks in advance for any help you might be able to provide to help me wrap my head around this!

I've always heard people saying, "Faster than light information transfer can't happen because it would violate causality!  Effects can precede their causes!"  However, I'm trying to think of a situation where this would happen.  I'm sure it has something to do with relativity or something like that.  I sort of understand that people going faster perceive time slower.  Can someone help illuminate this for me by showing a scenario where causality is clearly violated due to FTL information transfer?


When i create a runnable  jar file from a java source code file from eclipse, i believe it creates a class file which then can be run by the JVM.   The reason i am asking this is because i am going to be making an java application that keeps all my passwords. The app is going consist of an interface that asks for a password and then if the password is correct show the passwords. Here are my questions on this subject:   What exactly does a runnable *jar file* consist of? If the runnable jar file consists of a class file, can that class file be interpreted in anyway to be able to see the source code which would revile the passwords? when you run the runnable jar file from cmd and type "java -jar xxx". and "xxx" meaning the file name, does "-jar" mean you are going to run a jar file and "java" means run this following file in the JVM?  Is this like .exe files, which can't be un done to readable source code when turned into the .exe file.

What program can I use to decompile a class file? Will I actually get Java code, or is it just JVM assembly code?  On Java performance questions on this site I often see responses from people who have "decompiled" the Java class file to see how the compiler optimizes certain things.


I'm trying to fix an uncompleted installation of a two-way switch.  One switch, the light and all the wiring have been installed by someone else, with whom we can't have any contact soon.  I bought the second switch and tried to install it. I blindly tried different combinations and had those results:   With some wire combinations, it didn't work at all. With some others, it worked 3/4 times, but in some positions, one switch didn't work until I reached the other one. When bridging all wires of the second switch together, the first switch controlled the lamp (ON/OFF) -- but I now doubt it, maybe some of them wasn't wired correctly?   In no case was it working fully as expected, but I didn't try all combinations.  I have a basic understanding of the way it should work when everything is wired correctly.  I tried to systematically understand the consequences of inverting wires in all combinations, and came to the conclusion that it should either   work as expected work 3/4 times everything is shortcut and the light is always on   So, if I understand correctly, the wiring is wrong. The colors seem random and non-standard, so I can't rely on that.  Is this correct? Is this something I can easily fix?  UPDATE: each switch is connected to 3 wires coming out of the wall.  UPDATE 2: I'm living in Belgium, but the colors of the wires in my walls don't seem to be the national, or even less the European ones ;-)

Below is a diagram that I drew to help me rewire a couple of switches. The left switch is a standard 3-way switch. The right switch Cooper 275W-BOX combination single pole and 3-way switch. The single is the top switch; the 3-way is the bottom switch. They share a single power source.   The single pole switch works. The 3-way PARTLY works. The right 3-way will only control the ceiling fan/light if the left 3-way is in the up position. What did I do wrong?  I had 2 existing, separately wired and powered single pole switches. One went to a light in a foyer and the other to the ceiling fan (the light and fan are wired together, so not separate switches). I disconnected and capped off the power wire that was powering the ceiling fan/light, and rerouted the wire to the other switch for the 3-way.   Since I was using existing wires coming up from the switches, I added some junction boxes and tied into those wires rather than pulling new wire. (The electrician stapled the original wiring to the studs everywhere he could. That coupled with insulation in the exterior walls made it very difficult for me to pull new wire.)  The original home wiring was 12-2, and the new wire I ran is 12-3. I did not use any of the ground wire.  If this wiring diagram is accurate, then I may have made a mistake in one of the junction boxes, and will need to figure out where I messed up. I hope it's something I can fix without getting back into the attic.


Here is my code   import javax.swing.JFrame; public class Server { //----------------------------------------------------------------- // Creates and display the main program frame. //-----------------------------------------------------------------     public static void main (String[] args)     {         JFrame frame = new JFrame ("exit");         frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);         ServerPanel panel = new ServerPanel();         frame.getContentPane().add(panel);         frame.pack();         frame.setVisible(true);     } }   And its panel  import java.awt.*; import java.awt.event.*; import javax.swing.*; public class ServerPanel extends JPanel {  private JButton push;    public ServerPanel () {  push = new JButton ("Click this button to close the server....."); push.addActionListener (new ButtonListener());  add (push); setBackground (Color.red); setPreferredSize (new Dimension(500, 500)); }   private class ButtonListener implements ActionListener {  public void actionPerformed (ActionEvent event) {  System.exit(0); } } }   I just want to create a simple GUI that will show a button that if its clicked, it will immediately close the program ,but every time I try to run the Server.java it gives me this:  Exception in thread "main" java.lang.NullPointerException        at java.awt.Container.addImpl(Unknown Source)        at java.awt.Container.add(Unknown Source)        at ServerPanel.<init>(ServerPanel.java:20)        at Server.main(Server.java:12)   Can anybody fix it?


I want to change the folder colors on my home screen. Can it be done?

I've just upgraded to iOS 7 on an iPhone 4S. I prefer a completely black wallpaper, but I noticed that making it so will turn the backgrounds of folders and the dock grey.    I am looking for a combined wallpaper color and folder/dock background to make them as close as possible to all black. If someone has a jailbreak solution, that's great, but that won't work for me as I prefer not to change the OS in that way.  Are there solutions to achieve this visual effect?