Currently I can't ask questions in my Stack Overflow account. So I followed the given instructions and edited my old posts. But still I can not ask questions on the site. Please can I know what should I do to avoid this question ban. Any suggestions will be appreciated.

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 lived in mainland China as an English teacher from August 2006 to August 2008.  At that time, it was pretty easy for a US citizen to obtain a Chinese tourist visa in Hong Kong (I myself got a tourist visa to re-enter China for the Beijing Olympics after my residence permit expired).  I haven't been back to China since leaving in August 2008 and am now planning a trip with the family (myself, my wife, and three children) for Summer 2017.  I know that you can get multiple-entry visas at a Chinese Embassy in the US that are good for ten years but they are quite expensive, particularly for a family of five, and we really don't need a 10-year visa.  Given that we'll be traveling in Asia for a couple of months this summer (I've got a ten week sabbatical!) and will likely be visiting Hong Kong for a few days anyway, I'm considering waiting to get our visas until we are there.  Is it still easy to get a visa in Hong Kong?  How much does it cost and how long is it good for?

I know standing in line to get a visa is never fun, but was wondering if any Americans had experience getting a standard tourist "L" visa in Hong Kong.   I'm leaving on a RTW trip in less than two weeks and I plan on being in China around June. So I either need to get a 6 or 12 month multi-entry visa before I leave the USA - which would entail booking all my flights and accommodation and securing an invitation letter in the next few days - or just fly to Hong Kong before going to China in June.   Hong Kong seems like the simplest answer, but China usually doesn't allow Americans to get visas outside of their home country (HK seems to be an exception). I just wanted to know if any Americans had done it successfully.  Update: The Chinese Visa Office in HK currently has this notice on their website: "If you don't reside or work in Hong Kong permanently, you are required to apply Chinese visa from the Embassy or Consulate-General of Peoples' Republic of China in your resident country." It seems practices may have changed. Any Americans with experience care to contradict this?  Link:


i'd like to customize the citation style for secondary citations. At the moment it looks like this:  but i want to look the citation like this:   Is there any chance to create a citation style which is doing this? Here is an minimal example of the code i'm using including the customization for using 4 letters and the "-" for the cite.  \documentclass[fontsize=11pt, oneside, parskip=half+, numbers=noenddot]{scrreprt} \usepackage[ngerman]{babel}  \usepackage[utf8]{inputenc}  \usepackage{filecontents}   \begin{filecontents}{Minimalbeispiel.bib}  @book{Bechte.1984,     author = {Bechte, Wolfgang},     year = {1984},     title = {{Steuerung der Durchlaufzeit durch belastungsorientierte      Auftragsfreigabe bei Werkst{\"a}ttenfertigung. Diss. Univ. Hannover}},     address = {D{\"u}sseldorf},     volume = {2},     number ={70},     publisher = {VDI-Verlag},     series = {{Fortschritt-Berichte}} }  @book{Wiendahl.2005,     author = {Wiendahl, Hans-Peter},     year = {2005},     title = {{Betriebsorganisation f{\"u}r Ingenieure}},     address = {M{\"u}nchen},     edition = {5. aktualisierte Aufl.},     publisher = {Hanser},     isbn = {3446228535}     } \end{filecontents}   \usepackage[babel, german=quotes]{csquotes} \usepackage[ backend=biber,  style=alphabetic,  pagetracker=true,  maxbibnames=99, backref=false,  natbib=true,  firstinits=true,  sorting=nyt,  isbn=false, url=false, doi=false]{biblatex}   \AtBeginBibliography{%      \renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}     \renewcommand*{\labelnamepunct}{\addcolon\addspace} } \DeclareNameAlias{default}{last-first}  \DeclareLabelalphaTemplate{     \labelelement{         \field[final]{shorthand}         \field{label}         \field[strwidth=4,strside=left,ifnames=1]{labelname}         \field[strwidth=2,strside=left,ifnames=2]{labelname}         \field[strwidth=1,strside=left]{labelname}     }     \labelelement{          \literal{-}      }      \labelelement{         \field[strwidth=2,strside=right]{year}     } } \renewcommand*{\labelalphaothers}{}    \addbibresource{Minimalbeispiel.bib}   \begin{document} Interesting stuff. \cite{Bechte.1984} quoted in \cite[S. 266f.]{Wiendahl.2005}  \par  Interesting stuff. [Bech-84 quoted in Wien-05, S. 266f.]  \printbibliography \end{document}

This question is about author-year citations using biblatex where citations are set inline in parentheses.  Sometimes, it is necessary to cite two authors and to specify some connection between them using a 'joining word'. [Is there a technical term for this?]  For example:     Marvin 2009, citing Arthur 2007   or:     Marvin 1333, interpreting Dent 1245   More specifically, I want this typeset as an in-text citation in parentheses:     (Marvin 2009, citing Arthur 2007)   or:     (Marvin 1333, interpreting Dent 1245)   I cannot figure out how to do this at all, or at all elegantly, using biblatex. The closest I've come is    a version which uses a semicolon rather than a comma; a long-winded hack which fails if one of the entries has no author.     \documentclass{article} \usepackage[citestyle=authoryear-comp,bibstyle=authoryear,backend=biber]{biblatex} \addbibresource{biblatex-examples.bib}  \begin{document}    Desired output is (CTAN 2006, interpreting Gillies 1933).    The following are almost correct except that they use the default delimiter (of course) so I have a semicolon rather than a comma: \autocites{ctan}[interpreting][]{gillies} or \parencites{ctan}[interpreting][]{gillies}.    The following is a bit long-winded. Worse, it fails if an entry does not actually have an author: \parentext{\citeauthor{ctan} \citeyear{ctan}, interpreting \citeauthor{gillies} \citeyear{gillies}}.  \end{document}   Note that redefining the delimiter between citations from a semicolon to a comma is not a good solution as the semicolon is correct for almost all occurrences of multiple citations (all bar 2 in my paper). Only when there is a special 'joining word' do I want the comma instead.  I'm wondering if I need to define a new citation command. That's fine but I'd like to know that I'm not missing something before I reinvent the wheel and end up with a lop-sided parallelogram instead of the roundish circle I could more easily have used.  It seems surprising if there is no straightforward way to do this as it seems like a fairly common thing to want to do. Hence, I suspect I'm missing some obvious solution and just can't find it.  What is the most elegant way to arrange such citations?


I am solving this $$u^{''}+u+\epsilon u^3=0$$ where $ u(0) =1$ and $u^{'}(0)=0$ I tried this $$u''u'+uu'+\epsilon u'u^3=0$$ $$\frac{d(u')^2}{2}+\frac{d(u)^2}{2}+\epsilon\frac{d(u)^4}{4}=0$$ Integrating both side $$\frac{(u')^2}{2}+\frac{u^2}{2}+\epsilon\frac{u^4}{4}=c$$ where c is some constant. but I do not have idea how to solve with power over derivative. Please help me to solve this.

The question is to find an approximate solution, up to the order of epsilon of following problem.  $$y'' + y+\epsilon y^3 = 0$$ $$y(0) = a$$ $$y'(0) = 0$$  I tried to solve the given problem using perturbation theory.  $$y(t) = y_0(t) + \epsilon y_1(t) + \epsilon^2 y_2(t) + \cdots$$ $$t = w(\epsilon)t = (1 + \epsilon w_1 + \epsilon^2 w_2 + \cdots )t$$  However, i failed to find an appropriate approximate solution... help me!!


Based on what I found  and on other links on stackoverflow, we should always define a virtual destructor in the base class if we plan to use it polymorphically. I want to know if there is an exception to this rule.   I have seen production code that does not define virtual destructor for the pure abstract base classes and in one of cppcon 2014 video , around 10:06 the  BoolExp struct defined is a pure abstract class and has no virtual destructor.   So for a pure abstract class defined like this    class Base {       public:          virtual foo() = 0;          virtual bar() = 0;      }   My question is it absolutely must that we define a virtual destructor for "Base" class, even though it does have any data members? Are there any exceptions to the virtual destructor rule?  Thanks in advance.  Best, RG

I have a solid understanding of most OOP theory but the one thing that confuses me a lot is virtual destructors. I thought that the destructor always gets called no matter what and for every object in the chain. When are you meant to make them virtual and why?


I'm running the  plugin at . It fetches videos using the youtube api and displays them on your website.  Within the plugin script, there is the following sequence:      if (empty($items)) {$ret .= " 'No new videos.'";}     else foreach ( $items as $item ) :   Is it possible to change the wordpress post status from published to draft if "No new videos" are found?  I am thinking the solution is using the wp update post function and something along the lines of the following:          <?php         // Update post         $my_post = array();         $my_post['ID'] = $id;         $my_post['post_status'] = 'draft';          // Update the post into the database         wp_update_post( $my_post );         ?>

I have similar problem as described in  Answer there is to hook into save_post and change post type. How can I do it? I try to use wp_transition_post_status but it doesn't work for me...  function myHook( $post_ID, $post ) {      wp_transition_post_status('pending', $post->post_status, $post );  }  add_action( 'save_post', 'myHook', 10, 2 );   Edit: I have clear wordpress installation without any plugins, additional code and similar


I'm 17 years old, Sudanese, and I live in the UAE. I registered for a German course in Munich, and I got an invitation from a family friend who is German and applied for a tourist visa. It got refused; the reasons:     You have not provided proof of sufficient means of subsistence, for the duration of the intended stay or for the return to the country of origin or residence, or for the transit to a third country into which you are certain to be admitted, or you are not in a position to acquire such means lawfully.   [and]   The information submitted regarding justification for the purpose and conditions of the intended stay was not reliable.   I really don't understand; what do they mean? How can I appeal this?

Schengen refusal formulae can be difficult to understand sometimes.  Sometimes an applicant receives a refusal with:       Justification for the purpose and conditions of the intended stay was not reliable.     often accompanied by:       Your intention to leave the territory of the Member States before the expiry of the visa applied for could not be ascertained.   What is meant by this refusal reason?  What are they trying to say?


If I have a differentiable function $f:\mathbb{R}\to\mathbb{R}$ satisfies $f(x+1)-f(x)=f'(x)$ and $\lim_{x\to\infty}f'(x)=A$. Can I show $f(x)=ax+b$?

The question is:     When $f(x+1)-f(x)=f'(x)$, what are the solutions for $f(x)$?   The most obvious solution is a linear function of the form $f(x)=ax+b$. Is this the only solution?  Edit  I should add that $f:\mathbb R\to\mathbb R$ to the question.


I voted to close this question  as "Unclear what you're asking". However, I googled a bit and found a duplicate some time later.  I was wrong, so maybe it is a good idea to let the caster change the reason of his close vote?

Was voting to close a question as 'Not a real question', but my mouse slipped to 'Blatantly Offensive'. Would it be possible to have some means of changing my close reason, before the related question gets closed?


concatenate two arrays into single dimensional array?  For example:-  Take two arrays  Array1[10] = {3,3,3}  Array2[10] ={3,2,1}   output  Array3[] = {33,32,31}   How will I get this output ?

I need to concatenate two String arrays in Java.  void f(String[] first, String[] second) {     String[] both = ??? }   What is the easiest way to do this?


I want to hide Open with Explorer ribbon button only those users has View Only permission and it should appear for other permission user.  I've tried with below custom action reference by this   <CustomAction Id="RemoveExplorerButton" Location="CommandUI.Ribbon" RegistrationType="List" RegistrationId="101" Rights="ViewListItems"> <CommandUIExtension>   <CommandUIDefinitions>     <CommandUIDefinition       Location="Ribbon.Library.Actions.OpenWithExplorer" />   </CommandUIDefinitions> </CommandUIExtension>     It's working and removing Open with Explorer button for all the permission users. Is there any way that just remove only for View Only Permission user.  Question : I mean Ribbon button should appear if user have read only or edit permission or any other permission except user has View Only.

I would like to disable the "Open with Explorer" option in my SharePoint 2010 sites based on user permissions.  Basically only those users with Full Control should have the option of using the "Open with Explorer" feature.  I ran across something that said OwE was dependant on the "Browse Directories" permission, but after disabling that permission for Contributers OwE was still working for them.  Is there a way to restrict the use of "Open with Explorer" with permissions?  Edit:  has a detailed explanation of how to change the permission that Open with Explorer needs.  This is pretty much exactly what I want, since I can reassign OwE to use a permission that only Owners have.  So now I have a new question in addition to the previous one: Is making changes in the 14 hive like this safe enough to carry out on a production server?


I want to prove that fact.  Let $\mu X < \infty$ Then $d(f_n,f) \to 0$ $\Leftrightarrow$ $f_n \to f$ in measure. When $d(f,g) = \int \frac{|f-g|}{1+ |f-g|}d\mu$  I know that if $f_n \to f$ hold iff $\mu \{|f_n-f| \ge \varepsilon\} \to 0 \ \ \forall \varepsilon > 0$. But how to deduce that $d(f_n,f) \to 0$ Do I use a Chebyshev's_inequality?

Let $(X,\mathcal{M},\mu)$ be a measure space. We say that $\{f_n\}$ converges to $f$ in measure if, for any $\epsilon>0$   $$ \lim\limits_{n \to \infty} \mu\Big(\{x\in X: |f_n(x)-f(x)| \ge \epsilon  \}\Big)=0.$$         Show that $\{f_n \}$ converges to $f$ in measure if $$\lim\limits_{n\to \infty} \int_X \frac{|f_n(x)-f(x)|}{1+|f_n(x)-f(x)|}d\mu(x)=0.$$   Suppose $\mu(X) < \infty$. Show that    $$\lim\limits_{n\to \infty} \int_X \frac{|f_n(x)-f(x)|}{1+|f_n(x)-f(x)|}d\mu(x)=0$$   if $\{ f_n \}$ converges to $f$ in measure.


I need to run a .sh file from my Java code with out passing any arguments. I already tried doing it with  Runtime.getRuntime().exec("src/lexparser.sh");   and  ProcessBuilder pb = new ProcessBuilder("src/lexparser.sh"); Process p = pb.start();   Both of the above methods didn't work. Is there any other method to run a .sh file form Java?

It is quite simple to run a Unix command from Java.   Runtime.getRuntime().exec(myCommand);   But is it possible to run a Unix shell script from Java code? If yes, would it be a good practice to run a shell script from within Java code?


Prove that for any positive integers $a,b$   $(a+\frac{1}{2})^n + (b+ \frac{1}{2})^n$ is an integer for at most finite number of integers $n$.  Here is what I tried ; I tried to use mathematical induction to prove it, for $n+1$ and I'm stuck here  $(b+\frac{1}{2})^n (1\frac{1}{2} + b) + (a + \frac{1}{2})^n(1\frac{1}{2} + a)$

Show that if $a$ and $b$ are positive integers, then $$\left(a +\frac12\right)^n + \left(b+\frac{1}{2}\right)^n$$is an integer for only finitely many positive integers $n$.   I tried hard but nothing seems to work. :(


I have to download multiple csv reports from the Internet throughout the day, make a tiny change to them, and save the change.  Excel adds 3 completely unnecessary dialogs to what should really be a 5-second operation.   It makes you select a file name in a "Save As..." dialog, even though you just want to save  the existing file It makes you confirm the file name, because it thinks you're overwriting the original file It asks you if you really want to save in the CSV format   Is there a way to kill at least one or two of these dialogs, but ideally all of them?  This is completely infuriating.

I work with many CSV files, and am constantly annoyed by the Excel dialog that pops up when I try to save a file:  "[your spreadsheet] may contain features that are not compatible with CSV (Comma Delimited).  Do you want to keep the workbook in this format?"  My answer is always going to be YES.  Is there a registry setting to suppress this confirmation dialog?


I make a simple contact form for WordPress using ajax and php mail() but my maximum mail is going to spam folder. what is wrong with my code? or any other solution ? like SMTP.  <?php $errorMSG = ""; // NAME if (empty($_POST["name"])) {     $errorMSG = "Name is required "; } else {     $name = $_POST["name"]; }  // EMAIL if (empty($_POST["email"])) {     $errorMSG .= "Email is required "; } else {     $email = $_POST["email"]; }  // Subject if (empty($_POST["subject"])) {     $errorMSG .= "Subject is required "; } else {     $subject = $_POST["subject"]; }  // MESSAGE if (empty($_POST["message"])) {     $errorMSG .= "Message is required "; } else {     $message = $_POST["message"]; }  //receiver email address $EmailTo = "info@mydomain.com";  $Subject = $subject; $form  =  $name; // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $name; $Body .= "\n"; $Body .= "Email: "; $Body .= $email; $Body .= "\n"; $Body .= "Message: "; $Body .= $message; $Body .= "\n";  // send email $headers  = "From: " .($email) . "\r\n"; $headers .= "Reply-To: ".($email) . "\r\n"; $headers .= "Return-Path: ".($email) . "\r\n";; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $headers .= "X-Priority: 3\r\n"; $headers .= "X-Mailer: PHP". phpversion() ."\r\n"; // send email $success = mail($EmailTo, $Subject, $Body, $headers);   // redirect to success page if ($success && $errorMSG == ""){    echo "success"; }else{     if($errorMSG == ""){         echo "Something went wrong :(";     } else {         echo $errorMSG;     } }

This is a tricky one and I've always relied on techniques, such as permission-based emails (i.e. only sending to people you have permission to send to) and not using blatantly spamish terminology.  Of late, some of the emails I send out programmatically have started being shuffled into people's spam folder automatically and I'm wondering what I can do about it.  This is despite the fact that these particular emails are not ones that humans would mark as spam, specifically, they are emails that contain license keys that people have paid good money for, so I don't think they're going to consider them spam  I figure this is a big topic in which I am essentially an ignorant simpleton.


I went to CTAN.org and this huge message popped up on my browser.  I think I'm certain that it only applies for today, April, 1st 2016.  Can anyone confirm?     Dearest customer,  we   are pleased to announce that we can offer our combined product range   at unbeatably low prices to you. Latex Productions International Ltd.,   Shanghai has acquired the world wide exclusive rights on tex from   Donald F. Knuth. Now we will join our forces with ctan and tug for   your benefits. We are also getting in contact with many other latex   user groups world wide. This will allow us to gain even more momentum   and offer an even further extended set of latex packages to you.   Please note that we intend to continue the presence of the former site   ctan.org. Nevertheless we would like to inform you that we will rename   it to Comprehensive Latex Artefact Novelties (CLAN) which is   considered more appropriate. Thus you will be redirected to our new   site soon. Keep on visiting this site in order not to miss the change   and the new packages with exiting and innovative latex artefacts. We   are looking forward for your orders of our high-quality products and   extended, long-term business relations. You can help latex to rule the   world! Latex Productions International Ltd., Shanghai Thank you

Today I clicked in this link in TeX StackExchange  and I got this message (screenshot below).  In particular, what does it mean that "Latex Productions International has acquired  the world wide exclusive rights from D.F.Knuth" !?   Obviously ctan.org changed hands or something, what happened to ctan.org?  what would be a good link to use for TeX packages?


Its well known that the removal of countably many points from the euclidean plane doesn't affect path-connectedness.I am interested to know that if I remove a countable collection of pairwise disjoint closed balls from the plane,will it remain path connected or not.Any help would be highly appreciated,thanks in advance!

Let $\{D_n\}_{n=1}^\infty$ be a family of pairwise disjoint closed disks in $\mathbb{R}^2$.  Is the complement   $$ \mathbb{R}^2 -\bigcup_{n=1}^\infty D_n $$   always path connected?   Here “disk”  means a round, geometric disk.  (As shown below, the answer is no if we allow arbitrary topological disks.)  Note that the union $\bigcup_{n=1}^\infty D_n$ can be dense in the plane.  For example, it's possible to find a collection of disjoint closed disks of positive radius whose union contains $\mathbb{Q}\times\mathbb{Q}$.  It is easy to show that the complement of a countable set of points in the plane is always path connected. In particular, if $S \subset\mathbb{R}^2$ is countable, then there is always  path between any two points in $\mathbb{R}^2-S$ consisting of two line segments.  It is not true that the complement of a countable set of disjoint line segments  is path connected, as shown in the following figure.    By thickening the line segments slightly, one can find a countable collection of disjoint topological disks whose complement is not path connected.


I noticed that the de facto standard for array manipulation in Python is through the excellent numpy library. However, I know that the Python Standard Library has an array module, which seems to me to have a similar use-case as Numpy.  Is there any actual real-world example where array is desirable over numpy or just plain list?  From my naive interpretation, array is just memory-efficient container for homogeneous data, but offers no means of improving computational efficiency.    EDIT  Just out of curiosity, I searched through Github and import array for Python hits 186'721 counts, while import numpy hits 8'062'678 counts.  However, I could not find a popular repository using array.

If you are creating a 1d array in Python is there any benefit to using the NumPy package?


Hi How to effective Battery charge in MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports).  As per my previous experience , i was using MacBook Air and i charge it 100 % and wait till drain then again Charge it. I used it two years, with in two years. Battery got damaged.I am worry about my new MacBook Pro.  My Doubts are-  1- Charge it 100% and wait upto 20 % and again charge full.  2- Charge 100% and Wait till it drain 1% and again charge it.  2- Always Charge MacBook Pro, when it is in use  3- How to increase Battery life of MacBook Pro  I have gone through it  . but really not able to understand key points.  Please help me out to increase Battery life of my mac book pro

Platform: OS X: Yosemite 10.10.4; MacbookPro 15" Retina (mid-2015). Fact: There is aging for battery in any case - using or not. But while using - there is difference of how to use. My questions - in order to minimize battery degradation:    How often should I totally discharge battery ? Is degradation rate is a matter of full cycles or it doesn't matter to what highest and lowest level I charge or discharge laptop ? Most (99%) of the time I am connected to power - which leads to 100% charge level always. But many sites say, like following link:  say, that better to keep battery 40% charged than 100%. How to achieve that (there is no ability, as far as I know, to manually limit charging battery level) ? Do you have empirical evidences to prove or disapprove this expectations ? I ask this since to replace battery in Macbook Pro is hard to be done - many screw types, many modules do disassembly, using glue to grasp components without moving inside. And therefore I prefer doing this rarest I can. How much time (how many years) it typically takes upon your experience to get to buttery degradation of 40% capacity compared to Day-1 of using your Macbook Pro ? After 2 minutes of laptop using - the internal temperature (CPU, RAM, Battery) gets to 85-90 degrees (Celsius) and stays so till I turn off (sleep) laptop - for 12 working hours every day. Is there something I can do about heat (both in general, and regarding battery especially)?   What else should I do or know to not be frustrated later ?


How can I use $_ to store my string, and then use another scalar variable to store the substituted string such that I have both the copies. Do we have a modifier to copy the default argument in some another variable?  #! /usr/bin/perl/ use warnings; use strict;  $_ = "X is a good boy. X works daily and goes to school. X studies for 12 hours daily \n";  s/X/Sam/g; print $_, "\n";   What I want in the end is the original $_ and the substituted string as well.  Edit: I used   my $new = s/X/Sam/gr   But I get an error related to build, and it doesnt solve the issue. I am using version 5.10.1  perl --version  This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

In Perl, what is a good way to perform a replacement on a string using a regular expression and store the value in a different variable, without changing the original?  I usually just copy the string to a new variable then bind it to the s/// regex that does the replacement on the new string, but I was wondering if there is a better way to do this?  $newstring = $oldstring; $newstring =~ s/foo/bar/g;


I went through the top answer to this question: , and I read specfically the following:     With disown  the job is still connected to the terminal, so if the   terminal is destroyed (which can happen if it was a pty, like those   created by xterm or SSH, and the controlling program is   terminated, by closing the xterm or terminating the SSH   connection), the program will fail as soon as it tries to read from   standard input or write to the standard output.   It looks like disown cannot prevent a job from being killed if the terminal closes.  nohup can, but it can  only be used when the job starts.  Assuming that I understood this correctly, what can I do to make sure that a job that I started without nohup does not get killed when I close my terminal, terminate my SSH connection?    Would issuing setopt NO_HUP from the command line do it? And if so, wouldn't that affect all running jobs that I started from the same terminal?

I have a running program on a SSH shell. I want to pause it and be able to unpause its execution when I come back.  One way I thought of doing that was to transfer its ownership to a screen shell, thus keeping it running in there.  Is there a different way to proceed?


This looks :  for i in package1 package2 package3; do   sudo apt-get install -y $i done   but with the packages listed in a file:  package1 package2 ..   each on its own line.  Looking for simplest script to read, performance not really an issue.  Of course, the odd package will require some human intervention during install to agree or for configuration.  As an aside, what's the "real" way of dealing with large lists of packages to be installed?  I'm just looking for monkey-see-monkey-.

I have a fresh install of Lubuntu and would like to install packages from a given list, without having to type sudo apt-get install package_name. Is it possible?  I'm not talking about the post-install scripts, that is something entirely different.


I'm using a glm poisson regression in R, and I did a model diagnostics after my model fitting, but the residual distribution is so wierd.

I am trying to fit data with a GLM (poisson regression) in R.  When I plotted the residuals vs the fitted values, the plot created multiple (almost linear with a slight concave curve) "lines".  What does this mean?   library(faraway) modl <- glm(doctorco ~ sex + age + agesq + income + levyplus + freepoor +              freerepa + illness + actdays + hscore + chcond1 + chcond2,             family=poisson, data=dvisits) plot(modl)


Sorry if this question has been asked to death, but it doesn't make sense to me why we use a extremely rare isotope of hydrogen even though we have a much more abundant isotope. I am somewhat new to fusion, I just thought it'd be more cost efficient to use only deuterium?

I would like to know why scientists try to use deuterium and tritium for  and not just the ordinary  ${}^1H$?


I first installed the centos on the virtual box and only assigned 8GB to it. Now I've extended the VIRTUAL BOX file system and it has around 25gb.  As you can see below it's showing as tmpfs when I do "df -h" command and when I do "lsblk" it's showing root file system has 20gb. How can I extend the centos-root file system?  And, what is tmpfs?

I have an EC2 instance which has 2 EBS (1 x 200G, 1 x 100G).  Below is the output of lsblk  NAME                MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT xvde1               202:65   0  200G  0 disk / xvdj                202:144  0  100G  0 disk  └─xvdj1             202:145  0  100G  0 part    └─data-www (dm-0) 253:0    0   50G  0 lvm  /var/www   So my understanding by reading this is 2 disks, xvdj has a partition called xvdj1 which uses the full capacity of the disk of xvdj. My end goal is to set the LVM data-www to use the full capacity of xvdj1.  pvdisplay Output    --- Physical volume ---   PV Name               /dev/xvdj1   VG Name               data   PV Size               50.00 GiB / not usable 2.97 MiB   Allocatable           yes (but full)   PE Size               4.00 MiB   Total PE              12799   Free PE               0   Allocated PE          12799   PV UUID               pIA4pl-HON1-ZKTu-cLZP-b0Xf-c0rc-AeFdvG   df -h output  Filesystem            Size  Used Avail Use% Mounted on /dev/xvde1            197G   12G  176G   7% / tmpfs                 1.7G     0  1.7G   0% /dev/shm /dev/mapper/data-www   50G   40G  9.5G  81% /var/www   lvdisplay output   --- Logical volume ---   LV Path                /dev/data/www   LV Name                www   VG Name                data   LV UUID                VUqXne-IX7g-H5wV-DNGd-32ZV-kYzX-XnBybh   LV Write Access        read/write   LV Creation host, time topaz.zyber.co.nz, 2014-03-14 10:37:49 +1300   LV Status              available   # open                 1   LV Size                50.00 GiB   Current LE             12799   Segments               1   Allocation             inherit   Read ahead sectors     auto   - currently set to     256   Block device           253:0   I am simply lost on what needs to be done. the LVM that needs extending, already has data. Best case scenario would be to extend it without data loss.


Context: The linear regression Y = mX + c  Intuitively, it seems to me that swapping the independent variable and dependent variables won't change the test statistic for the significance of the coefficient for the dependent variable (the null hypothesis is that the coefficient is zero).  i.e. for the same $X$ and $Y$, $$Y = \hat{\beta_0}  + \hat{\beta_1}  X\\   X = \hat{\beta_0}' + \hat{\beta_1}' Y$$  is it true that, $$ \hat{\beta_1} /\mathrm{SE}(\hat{\beta_1} )  = \hat{\beta_1}'/\mathrm{SE}(\hat{\beta_1}')$$  Such that either way I do the hypothesis test, $$\mathrm{H}_0 : \beta_1  =    0 \\   \mathrm{H}_1 : \beta_1  \neq 0 \\   \mathrm{H}_0': \beta_1' =    0 \\   \mathrm{H}_1': \beta_1' \neq 0 $$  I will reject/accept with the same $p$-value, and obtain the same $R^2$ for the model?  I've tested this out on a data set that is available to me, and it seems to be true, but I'm not sure about the mathematics of it.

The Pearson correlation coefficient of x and y is the same, whether you compute pearson(x, y) or pearson(y, x). This suggests that doing a linear regression of y given x or x given y should be the same, but I don't think that's the case.   Can someone shed light on when the relationship is not symmetric, and how that relates to the Pearson correlation coefficient (which I always think of as summarizing the best fit line)?


now the phone is stuck in logo screen for upgrading failed, and now I can only enter the fastboot mode. Is there any way to re-install the Ubuntu touch for my phone? Looking forward to your feedback, thanks in advance.  Later, I trying Ubuntu-device-flash command to rescue, but the error say "Can't boot recovery image", any feedback is highly appreciated. Noted: I have flash the recovery-turbo.img to the phone for fixing the "Failed to enter recovery" issue.

I have bought Meizu Pro 5, the Flyme OS version.  I want to install Ubuntu Phone on it.  How can I do it and where can I get the needed firmware and tools?   Thank you very much!


I don't know anything about Star Trek except for the fact that it's about spaceships.  In  the person only wanted to watch the TV series. I want to watch every movie and TV series there is about Star Trek but I don't know where to start. I found this page on  which is about a time line. Do I need to watch it in this order? Are the movies and TV series related?

I haven't seen any of the stuff in the Star Trek franchise, except for one of the movies, and now I want to remedy the situation. I am not interested in the movies, just the TV series. However, since the show has many seasons, I am not interested in watching the show start to finish. So, where (i.e what series/season) should I start with? Do I really need to see the series in real-world chronological order?   Note: I am somewhat familiar with Star Trek, that is I know the basic premise - ships in space, with war between different space-faring sentient species.


Help me with problem at the comment, please. I'm newbie with java8. It would be great too if you give me some keyword for searching.  public class aClass{     public Function<String,String> f;     private void doSomething(){         System.out.println("done");     }     public void addF(Function<String,String> f){         this.f = f;     } }  public class bClass{     public String func(String str){         System.out.println(str);         //Call doSomething();         //Can I do that?      }      public static void main(String[] args){         aClass a = new aClass();         a.addF(this::func);     } }

In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), public, protected and private, while making class and interface and dealing with inheritance?


Im very beginner in Java servlets... i have tried to connect servlet with database but NullPointerException  I tried to resolve this problem ,but no luck...   Error is     java.lang.NullPointerException     JDBCServlet.service(JDBCServlet.java:(42)   import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.sql.DriverManager;//1 import java.sql.Connection;//2 import java.sql.SQLException; import java.sql.Statement;//3 import java.sql.ResultSet;//4  public class JDBCServlet extends HttpServlet {     Connection con;      Statement st;     ResultSet rs;     String sql;      protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {         System.out.println("JDBC Servlet Invoked");          //1st step: load JDBC MySql Drivers         try {             Class.forName("com.mysql.jdbc.Driver");             System.out.println("Drivers Loaded");         } catch (ClassNotFoundException e) {             // TODO Auto-generated catch block             e.printStackTrace();         }          //2nd Step: create a connection         try {             con = DriverManager.getConnection("jdbc:mysql://localhost:3306/webtech1", "root", "123456");         } catch (SQLException e) {             // TODO Auto-generated catch block             e.printStackTrace();         }          String sql = "select * from user";         try {             st = con.createStatement();             rs = st.executeQuery(sql);              while(rs.next()){                  System.out.println(rs.getInt("id"));                 System.out.println(rs.getString("firstName"));                 System.out.println(rs.getString("lastName"));                 System.out.println(rs.getString("email"));                 System.out.println(rs.getString("password"));                 System.out.println(rs.getString("createdate"));             }          } catch (SQLException e) {             // TODO Auto-generated catch block             e.printStackTrace();         }        } }

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


How do I keep the following constant and true? (In other words globals?)    UP    ::  Direction DOWN    ::  Direction LEFT    ::  Direction RIGHT   ::  Direction dirs =  [UP,    DOWN,   LEFT,   RIGHT]   My attempt:  #global definitions UP = True DOWN = True LEFT = True RIGHT = True dirs = [UP, DOWN, LEFT, RIGHT]

I'm mainly a C# developer, but I'm currently working on a project in Python.  How can I represent the equivalent of an Enum in Python?


Hello I am trying to improve my circuit schematic and I am looking for suggestions on how to make it more readable, I have read design rules on this forum and I am trying my best to follow them. The circuit is a light chaser that uses a digital pot that connects to a raspberry pi, that uses a voltage regulator to dim the leds if needed.   The voltage regulator has the highest voltage which is 10V, the 555 timer has 9 volts and the digital pot has 5 volts, so I placed the voltage regulator at the top, the 555 timer in the below the voltage regulator and the digital pot below that, The two other chips get 9 volts but seemed to work best at the bottom and the ground which is the lowest of the voltages is the bottom of the diagram.

There are a lot of poorly drawn schematics here. A few times people have actually asked for critiques of their schematics. This question is intended as a single repository on schematic drawing rules and guidelines can point people to. The question is  What are the rules and guidelines for drawing good schematics?     Note: This is about schematics themselves, not about the circuits they represent.


So I have a new set up: 2 large screens (top left and top right), my macbook pro (centre), and my ipad (left). I'm a coder, I like to have my coding environment in the centre, with research on the top left, results (e.g. created webpages) top right. Certain apps like Postman are on the left on the ipad. Sometimes, as we all do, I reset my computer. When I do this, upon login, all my apps will open on the same screen. Is there a way (maybe an Alfred script), to move all my applications to the desired monitor (and the desired desktop on that monitor)? It would save SO much time I can't even begin to say. Thanks.

I am running Mac OS X (Version 10.10.5) on a MacBook Pro (13 Inch, Mid 2010) and want to arrange an external monitor of the same type to different positions.  First, let me explain my setup:   monitor at my office: DELL U2312HM (located above the MacBook's screen) monitor at home: DELL U2312HM (located left of the MacBook's screen)   As you can see, I am using different monitors of the same type (they have different serial numbers displayed in the System Overview window). However, they are located either above or left of the internal screen.  Since the only way I know to arrange an external monitor is draging the blue boxes in the monitor section of the system preferences, I need to do this every morning after connecting my monitor in the office and every evening after coming home. The monitor arrangement does not depend on the monitor's serial number but on the model since saving the arrangement of different models works as desired.  So is there a way, a hidden setting, a hidden setting accessible through the terminal or even a third-party app which enables different monitor arrangements for the same monitor model but based on the monitor's serial number as shown in the system overview?  The behavior which seems to be a system default is very annoying and does not feel very apple-like.


Can I opt in to get the Ubuntu 17.10 daily builds from within I Ubuntu 17.04 or will I have to install the daily build/ beta from a USB bootable device?

How do I upgrade to the unreleased version of Ubuntu for testing?


Does anybody know a source when class rebalancing should be considered?  Say one has a very small dataset. About 70 observations. When would class rebalancing make sense?  When the 0/1 ratio is 70/30, 80/20, ...  For such small sample sizes, would e.g. bootstrapping even be appropriate?  Best

We already had multiple questions about unbalanced data when using , , ,  and a number of other similar questions, what makes it a very popular topic! Unfortunately, each of the questions seems to be algorithm-specific and I didn't find any general guidelines for dealing with unbalanced data.  Quoting , dealing with unbalanced data     (...) heavily depends on the learning method. Most general purpose   approaches have one (or several) ways to deal with this.   But when exactly should we worry about unbalanced data? Which algorithms are mostly affected by it and which are able to deal with it? Which algorithms would need us to balance the data? I am aware that discussing each of the algorithms would be impossible on Q&A site like this, I am rather looking for a general guidelines on when it could be a problem.


Consider the following markdown:  ab**cd**ef  あい**う**えお  அஆ**இஈ**உஊ   Here is the same markdown without four leading spaces:  abcdef  あいうえお  அஆஇஈஉஊ  Here is what this looks like (at the time of writing), in preview (e.g. when editing a question, writing a new answer, etc):    Here is what this looks like (at the time of writing), in actual questions and answers:    There is a clear inconsistency between what appears in the markdown preview and what actually appears in the question, but only for some strings of characters. This is a mild annoyance over at Japanese.SE (and possibly elsewhere), where this sort of bolding is often desired (yes, I'm aware that you can work around it by using <b>...</b> or wrapping the **...** in zero-width spaces, but people generally don't expect to have to do that).  To clarify, I'm not saying that intra-word **...** should produce bolding; I'm saying that the markdown preview should reflect the fact that intra-word **...** doesn't produce bolding.

Have a look at   One of the bolds works, and the other one just turns up as ** in the actual post.  This is the string that isn't working: **x**ml n**ib**  Which renders as: xml nib


In Episode IV, Tarkin says to Vader:     The Jedi are extinct, their fire has gone out of the universe.  You, my friend, are all that's left of their religion   This struck me quite a bit, because the question arises that if Vader is part of 'their religion', then surely the Emperor is also.  My question is then, why did Tarkin say that Vader was all that was left of the 'religion' of the Force, when Emperor Palpantine would equally be part of that religion?

I always wondered why Admiral Motti and Governor Tarkin in the movie  insinuate that the Force is an old, dead religion?  :     The Jedi are extinct, their fire has gone out of the universe. You, my friend, are all that's left of their religion.   :     Don't try to frighten us with your sorcerous ways, Lord Vader. Your sad devotion to that ancient religion has not helped you conjure up the stolen data tapes, or given you clairvoyance enough to find the rebels' hidden fortress...   Tarkin, as human, must be around age 50, so, if in Episode IV Luke is about 20, when he was just born at the end of Episode III, Tarkin must have been around 30, so a perfect young man in a Galaxy that used to know Jedis, Jedi Council, Force etc..  Why, 20 years later, he just looks like someone who never saw a Jedi/Sith? Also, besides from Force sensitives (Obi-Wan, Yoda, Vader, the Emperor), nobody else looks like they ever heard of the Force ... that's really weird, isn't it?


How do I extend the partition size of /dev/sda5 by merging it with unallocated space of 20.0GB    EDIT:   When I try to create a new partition(using the unallocated space) I get the following error  It is not possible to create more than 4 primary partitions

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


Say you have a plain text:      How are you today?   and you encrypt it so it becomes:      LKD03Loel03skj1Q03   Now you have multiple people that need to know the plain text of this cipher text but you do not want them to have the same key. It might be they each come up with their own password or they all have a key which identifies that individual.  Now one way of doing this would be adapting  so every user encrypts the one key with their own key so you'd get ten encrypted files (for ten people) of the same key. (I don't know if this is good practice but I think it's a secure option.)  Are there any other ways of having different people using different keys to get the same plain text from the same cipher text (and vice versa)? Is there a special algorithm for this?

Is there any way to share an encrypted file with a group? In the other words, can I encrypt a file with a public key so that each person in a group decrypt it with his/her private key?  Is there any way that I have a public key and some different private key for it?  I want to find a way to encrypt a file with a public key, and then produce some private keys from this public key, so that whenever I wanted to share that file with some person, I gave him/her a private key from this set to decrypt my file.


I bough a brand new PC loaded with Ubuntu 18.04 O/S. Is FEniCS software in Ubuntu PPA?

How can I install applications like Google Chrome on Ubuntu?  Are there any commands to install an application?    Index of answers:


I am trying to prove its not UFD. I started by assuming   x=ab in K[v] , where v=v(xw-yz) then  x-ab=(xw-yz)f, for some f in K[x,y,w,z]  I tried to say that deg of a, and b is less or equal 1, and then try to do a non-matching degree argument, but I could not see why a,and b should have deg leess or equal 1, how should I define degree in K[v]. Any help on how to prove this? Thanks.

I want to show that $k[x,y,z,w]/(xy-zw)$, the coordinate ring of $V(xy-zw)\subset\mathbb{A}^4$, is not a unique factorization domain.    Morally, all we need to do is find some nonzero element that can be written in two distinct ways as a product of irreducible elements, but nothing is coming to mind immediately. Thoughts?


I want to fetch the text between ** and **.  This is what I am trying with:  /\**(.*)\**/ig   This is the sample string  ** The ** *quick* ~~brown~~ fox ** jumped **   please ignore the space after ** and before **  As a result, I am getting the whole string fetched

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


I am looking for a word but I'm not sure if it's a real word or if I just don't know it. I am discussing George Orwell's novel, 1984, and how the titles oppose all the things they describe. For instance, the "Victory Cigarettes" fall apart and are horrible, not the victor of anything. The "Victory Mansions" are small and crappy apartments. The word "victory" is describing something that is the opposite of victory. It's like a euphemism but instead of using it to lighten the blow, is is completely wrong and opposite of what it really is.

Like the group "Anonymous," they are not REALLY anonymous since they are all over media outlets. Is there a word for that?   Edit: Autoantonym almost sounds right but that seems to imply it has two meanings like left the airport vs going left. This one doesn't mean well known, it is the complete opposite of the actual word.


I have a latex document in which i have a variable whose value i am passing from different file. Following is the main latex .tex file.      %Project information     \newcommand*{\Title}    {Build document}     \newcommand*{\Document}     {None}     \newcommand*{\Rev}      {False}      %VCS     \newcommand*{\VcsInstance}      {xyz}     \newcommand*{\VcsLabel}     {sample}     \newcommand*{\VcsBranch}        {${//my_branch/my_documentation}$}   when \VcsBranch is desplayed on pdf i get its value as:  //mybranch/mydocumentation   The underscores are missing in it and its format is not correct. Variable  "\VcsBranch" gets its value from a python script and it is actually contains the perforce branch details, so its sometimes e.g "//depot//file" or it can be "//stream_2015//example_2.15".So, i want "VcsBranch" to be set in a way that if value contains underscore it should also handle them properly.So suggest me what shall i add to the latex .tex document to get value printed in well format

How can I produce the text Word_one_two in LaTeX?  I tried:  Samp\_Dist\_Corr   But, it doesn't quite look right. Also, I want it in the typewriter font, so actually, I'm doing:  \texttt{Samp\_Dist\_Corr}   I find it looks a bit like the underscore is merging in to the bottom of the "D", but maybe it's just because of the typewriter D?


Why do discs, like rings of Saturn and the spiral shape of our galaxy form around massive objects, instead of just a (spherical?) cloud of matter?

I always see pictures of the solar system where our sun is in the middle and the planets surround the sun. All these planets move on orbits on the same layer. Why?


I wrote some code to update the Initial Response field on a case when an outbound email is sent. I can't seem to get enough coverage to deploy the trigger handler. Here's my code Trigger trigger EmailMessageTrigger on EmailMessage (after insert){ System.debug('Trigger Settings' + TriggerSettings__c.getInstance('EmailMessage')); if (TriggerSettings__c.getInstance('EmailMessage') == null ||      TriggerSettings__c.getInstance('EmailMessage').Disable_Triggers__c == null ||      TriggerSettings__c.getInstance('EmailMessage').Disable_Triggers__c == false) {     EmailMessageTriggerHandler.handleOutboundCaseEmails(); } }  EmailMessageTriggerHandler public class EmailMessageTriggerHandler {  public static Boolean isPortal = ([Select ContactId from User where Id =:UserInfo.getUserId()].ContactId==null?false:true); public static void handleOutboundCaseEmails(){          Map<Id,Case> mapUpdates = new Map<Id,Case>();     List<ID> CaseID = New List<ID>();      List<Case> caseToUpdate = new List<Case>();     for(EmailMessage em :(List<EmailMessage>)Trigger.new){         System.debug(em);         if(em.Incoming == false){             if(em.ParentId != null){                 if(em.ParentId.getSObjectType() == Case.SObjectType){                     CaseID.add(em.ParentId);                     if(!isPortal){                         mapUpdates.put(em.ParentId, new Case(Id=em.ParentId,Waiting_on_Customer__c=true));                     }                     System.debug('Case ID: ' + CaseID);                     List<Case> caseList = [Select Id, Initial_Response__c FROM Case Where Id = :CaseID];                     System.debug('Case List: '+ caseList);                     if(!caseList.isEmpty()){                             for(Case c : caseList){                             ID cas = c.Id;                              System.debug(cas);                             AggregateResult[] initialResponseDate = [Select Min (CreatedDate) initialResponseDate from EmailMessage where ParentId = :cas And Incoming = false];                             System.debug(initialResponseDate);                                 c.Initial_Response__c = date.valueOf(initialResponseDate[0].get('initialResponseDate'));                             System.debug(c.Initial_Response__c);                             caseToUpdate.add(c);                         }                         System.debug(caseToUpdate);                         update caseToUpdate;                     }                 }             }         }     }         update mapUpdates.values();   }  } My trigger is getting 50% coverage where the two lines above handleOutboundCaseEmails() is not getting any coverage and the triggerhandler coverage is at 38% where code below if(em.Incoming == false) is not getting any coverage. How can I achieve at least 75% coverage so that I can deploy my code? Test Class     @isTest static void Outbound() {     TriggerSettings__c triggerSet = new TriggerSettings__c();     triggerSet.Name = 'EmailMessage';     triggerSet.Disable_Triggers__c = false;     insert triggerSet;     EmailMessage message = new EmailMessage();     message.ToAddress = 'lbejjani@fuze.com';     message.Subject = 'Test';     message.TextBody = 'Testing';     message.Incoming = false;          message.ParentId = sc.Id;     //message.ParentId = '5006s000000hGHZAA2';     insert message; }

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How is code coverage obtained and calculated? How do I increase my coverage?  Why can't I cover these lines? Why isn't the body of my loop or conditional statement covered?


I has been using Ubuntu 11 Beta, I want to verify I have the stable version. I read that I should use update manager to update, and read that the was supposed to be an "upgrade platform" or similar button, something I used when I updated from Ubuntu 10.10 to 11 beta. But this time, I dont see that, just normal updates. I tried   cat /etc/issue  Ubuntu 11.04 \n \l   Is it the latest?

I have been doing so many sudo apt-get update/(dist-)upgrade since yesterday and  something happend - so that I am confused now whether I am using still beta or the stable version.   How do I figure that out?


What is the benefit using different type when creating an object in java?  If i have 2 classes:  public class Animal {      public Animal() {     }      public void move() {         System.out.println("Moving...");     } }   public class Bird extends Animal {      public Bird() {     }      public void fly() {         System.out.println("Flying...");     } }   When i should use:  Animal bird1 = new Bird();   and  Bird bird2 = new Bird();   I still can not understand if Bird extends Animal, why using Animal as variable type?

I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible?


I need a large family of  objects of the following (for MWE reasons) simplified type .   %  \section{  Whatever description for  $F_{q  \raisebox{-.1cm}{\tikz[scale=.25] {  \draw [red,double] (1,0) -- (0,1) ;   \draw [blue,double, ] (0,0) -- (1,1) ;    \draw [violet,double] (2,0) -- (1,1) ;     \draw [green,double, ] (1,0) -- (2,1) ;  }}r}$ %  }  %  \subsection{  Whatever description for  $F_{q  \raisebox{-.1cm}{\tikz[scale=.25] {  \draw [red,double] (1,0) -- (0,1) ;   \draw [blue,double, ] (0,0) -- (1,1) ;  }}r}$ %  }     If I uncomment these lines, thus putting them in (sub)sections, I get errors.   \documentclass[a4paper,10pt]{amsart} \usepackage[utf8]{inputenc} \usepackage{tikz} %openin  \begin{document}      \section{  Whatever description for  $F_{q  \raisebox{-.1cm}{\tikz[scale=.25] {  \draw [red,double] (1,0) -- (0,1) ;   \draw [blue,double, ] (0,0) -- (1,1) ;    \draw [violet,double] (2,0) -- (1,1) ;     \draw [green,double, ] (1,0) -- (2,1) ;  }}r}$     }      \subsection{   Whatever description for  $F_{q  \raisebox{-.1cm}{\tikz[scale=.25] {  \draw [red,double] (1,0) -- (0,1) ;   \draw [blue,double, ] (0,0) -- (1,1) ;   }}r}$      }   \end{document}   How to type them correctly, so that they can appear in the headings (and TOC). The latter seems to be the problem:  \@writefile{toc}{\contentsline {section}{\tocsection {}{1}{ Whatever description for $F_{q \unhbox \voidb@x \let \reserved@d =[\def \par }$ }}{1}}

I have defined the following command to typeset 'C++':  \newcommand{\Cpp}{C\raisebox{-.23ex}{\texttt{++}}}   Using the command in a paragraph works as expected. However, I can't use it in a section title. I seems like it has something to do with \raisebox.  Here an mwe:  \documentclass[11pt]{article}  \newcommand{\Cpp}{C\raisebox{-.23ex}{\texttt{++}}}  \begin{document}     \section{\Cpp} % doesn't work! because of \raisebox ? \Cpp-Compiler \end{document}   How can I redefine the \Cpp command to work in a section title?


I’m currently reading George Martin’s A Song Of Ice And Fire novels in English. As a non-native speaker (I’m German), I stumbled upon some grammatical constructs that I’ve never seen before, one of them being the Why at beginning of sentences.  Examples:   Tyrion gave the rotting head a second look. Why, it almost looks as if those lips are smiling. Did he use that word? Why, the boy has a singer's soul . . . though if you believe that song, you may well be dimmer than the first Reek.   These kind of sentences are obviously different from sentences like Why is the sky blue?  I’d like to know if that construct is archaic, or could be used in everyday language, and how one could rephrase that kind of sentences. Can it be rephrased at all? To me it seems like the Why is just used to give the sentence a kind of “cynical” taste.

Examples:        Why, I'd love to.   Why, of course!      I get the concept of starting a sentence with a word not completely related to the overall response, but this one seems to be a particularly odd choice — is there any semantic meaning I'm missing?


I am having the following issue, trying to set up the SSL certificate.  When opening the root domain name example.com the browser shows the green sign and all is fine. However trying to open with www version www.example.com I see the following message     www.example.com uses an invalid security certificate.      The certificate is only valid for example.com      (Error code: ssl_error_bad_cert_domain)   From this message I am guessing that the SSL was issued for example.com only (please correct me if Im wrong), now except buying another certificate, that would include both versions, is there another way to avoid that warning, namely kind of to redirect all traffic to example.com before even "showing" to the browser the certificate ? So, when the user types https://www.example.com it would redirect to https://example.com, where the certificate is already valid.  I have this in my site file  <VirtualHost *:80>         ServerName example.com         ServerAlias www.example.com         Redirect / https://example.com/ </VirtualHost>  <VirtualHost *:443>         ServerName example.com         ServerAlias www.example.com         DocumentRoot /home/username/www/example          SSLEngine on         SSLCertificateFile /etc/apache2/ssl/example.com.crt         SSLCertificateKeyFile /etc/apache2/ssl/example.com.private.key         SSLCertificateChainFile /etc/apache2/ssl/example.com.intermediate.crt </VirtualHost>   I tried to put a redirect condition inside VH, however it did not help.  RewriteCond %{HTTP_HOST} ^www.example.com RewriteRule ^/(.*)$ https://example.com/$1 [L,R=301]   Apache 2.2.22, Debian 7.9  Thanks

We're using setup with an nginx on one machine and (currently) one application server on apache in the back.  For multiple domains we got ssl certs, but only for the domain itself. So without subdomain www. Everything works as expected, we do not use the  anywhere. But we have customers who are typing this in by hand, resulting in a warning in the browser on the clientside. ..and a new seo guy insisting on working www subdomain WITH ssl.  What am i looking for: A creative solution which does not require new certificates for 20+ domains.  I already thought about getting certificates from let's encrypt for our www subdomain, then 301 to domain.tld.. but it's still in beta.  Any ideas ?


I have this class for querying the table in the database.  class QueryBuilder {      private $pdo;     public function __construct($pdo) {         $this->pdo = $pdo;     }     public function getAll($table) {         $stm = $this->pdo->prepare("select * from :targetTable");         $stm->bindValue(':targetTable', 'albums', PDO::PARAM_STR);         $stm->execute();         return $stm->fetchAll();     } }   I returns an empty array every time I use bindValue function. If I turn the error reporting mode it states     PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''albums'' at line 1   When I use simply     $stm = $this->pdo->prepare("select * from albums");   It works like intended. Function is called by  $query->getAll('albums');   Thanks for help

Why can't I pass the table name to a prepared PDO statement?  $stmt = $dbh->prepare('SELECT * FROM :table WHERE 1'); if ($stmt->execute(array(':table' => 'users'))) {     var_dump($stmt->fetchAll()); }   Is there another safe way to insert a table name into a SQL query? With safe, I mean that I don't want to do  $sql = "SELECT * FROM $table WHERE 1"


Assume $f:\mathbb{R} \to \mathbb{R}$ is a differentiable function such that $\left|f '(x) \right |< M$ for all $x \in \Bbb R$. Show that $f$ is uniformly continuous.  I have no idea on how to approach this question, can someone help me?

Suppose that $f$ is a real-valued function on $\Bbb R$ whose derivative exists at each point and is bounded. Prove that $f$ is uniformly continuous.


I have a method that I use to convert strings to generic enums. The resulting value can be assigned to fields that may be nullable.  For the non-nullable case the following works fine, but I can't figure out how to correctly adjust it to allow for a nullable return type, say in the case that the argument is null, or indeed how to allow for a return type that may be either null or non-nullable (maybe this isn't possible?). Every permutation of Nullable<T> and T? that I've tried still results in red squiggleys on both the return values and the method name  private static T ConvertStringToEnumValue<T>(string value) {     // Converts string to a given enum-type T value.     T EnumValue;     try     {         EnumValue = (T)Enum.Parse(typeof(T), value);         if (!Enum.IsDefined(typeof(T), EnumValue))         {             return default(T); // 0 for enum         }     }     catch (Exception e)     {         return default(T); // 0 for enum     }     return EnumValue; }

I'm building a function to extend the Enum.Parse concept that  Allows a default value to be parsed in case that an Enum value is not found Is case insensitive  So I wrote the following: public static T GetEnumFromString<T>(string value, T defaultValue) where T : Enum {     if (string.IsNullOrEmpty(value)) return defaultValue;     foreach (T item in Enum.GetValues(typeof(T)))     {         if (item.ToString().ToLower().Equals(value.Trim().ToLower())) return item;     }     return defaultValue; }  I am getting a Error Constraint cannot be special class System.Enum. Fair enough, but is there a workaround to allow a Generic Enum, or am I going to have to mimic the Parse function and pass a type as an attribute, which forces the ugly boxing requirement to your code. EDIT All suggestions below have been greatly appreciated, thanks. Have settled on (I've left the loop to maintain case insensitivity - I am using this when parsing XML) public static class EnumUtils {     public static T ParseEnum<T>(string value, T defaultValue) where T : struct, IConvertible     {         if (!typeof(T).IsEnum) throw new ArgumentException("T must be an enumerated type");         if (string.IsNullOrEmpty(value)) return defaultValue;          foreach (T item in Enum.GetValues(typeof(T)))         {             if (item.ToString().ToLower().Equals(value.Trim().ToLower())) return item;         }         return defaultValue;     } }  EDIT: (16th Feb 2015) Christopher Currens has posted  below, which is well worth a look, and an upvote. I will remove this edit if the solution bubbles further up the page. EDIT 2: (13th Apr 2021) As this has now been addressed, and supported, since C# 7.3, I have changed the accepted answer, though full perusal of the top answers is worth it for academic, and historical, interest :)


I live in Texas and I'm 17. A lot of my family and friends live in California. For my 18th birthday my family planned a trip to California. The problem is my license expires on my 18th birthday while I'll be in California, and with Texas I can't apply for my normal license until my 18th birthday or afterwards.  So since I'm turning 18 while on my trip and my only real form of ID will expire during it, will I have problems on my return flight using a recently expired ID? Will having my birth certificate, social security card, and diploma help?  Thanks for any answers you can provide!

The company I work for has asked me to attend a training class on the other side of the country.  However my situation is my drivers license expired a few days ago. I do however have a separate printed email stating that the license has been renewed.  This drivers license is my only ID that shows both my name & photo.  Is it possible to be able to board a flight with the expired drivers license and the printed email showing that it was renewed?


I have read that you cannot explicitly invoke the destructor on integral types: using myint = int; int a = 3; a.~myint();  Why does this compile?

In C++ the following code gives a compiler error:  void destruct1 (int * item) {   item->~int(); }   This code is nearly the same, I just typedef the int to another type and something magic happens:  typedef int myint;  void destruct2 (myint * item) {   item->~myint(); }   Why does the second code work? Does an int get a destructor just because it has been typedefed?  In case you wonder why one ever would like to do this: This comes from refactoring C++ code. We're removing the standard heap and replacing it with selfmade pools. This requires us to call placement-new and the destructors. I know that calling destructors for primitive types is useless, but we want them in the code nevertheless in case we later replace PODs with real classes.  Finding out that naked int's don't work but typedefed ones do was quite a surprise.  Btw - I have a solution that involves template-functions. We just typedef inside the template and everything is fine.


I would like to generate a 3*6 digits, that can form an array of 3rows*6cols. but I don't want a duplicated to be found in any column. They can be anywhere, in the same row, but in each column, there shouldn't be any duplicate of the same number. Is there an algorithm for generating that ?

How do I generate a random int value in a specific range? I have tried the following, but those do not work: Attempt 1: randomNum = minimum + (int)(Math.random() * maximum);  Bug: randomNum can be bigger than maximum. Attempt 2: Random rn = new Random(); int n = maximum - minimum + 1; int i = rn.nextInt() % n; randomNum =  minimum + i;  Bug: randomNum can be smaller than minimum.


I have just started out learning about fields and had tried practicing solving some questions. However, when I encountered this question, I wasn't really sure how to tackle it.     Let $\mathbb{F} = \{0,1,a,b\}$ be a field with four elements.   Prove that $1 + 1 = 0$.    I wanted to show that $1 + 1 = a$, $ 1 + 1 = 1$, and $1 + 1 = b$ would all result in a contradiction. So, I started with supposing that $1+1= a$.  Since I have already proved that $a \cdot b =1$, $a^2=b$, and $b^2=a$, I thought about using at least one of these pieces of information to arrive at a contradiction, but I can't seem to figure how to use them in this case.  In the question, a hint is also given which suggests showing how assuming that $1+1 =a $ will let us make use of $1+a$ and $1+b$ to arrive at $a^2 =0$, which is impossible. But I can't seem to understand how to use it.  Any help would be appreciated.

If $\mathbb{F}=\{ 0,1,x,y\}$ is a field with four elements, why is the characteristic 2?   In a field with four elements, the characteristic is 2 or 3(since it has to be a prime). Is there any way to determine precisely the characteristic of this field, and in general any finite field?


Does time really dilate, or is it only how we perceive time, which is in the form of light waves. When an object moves away from another object at very high speeds, the light takes longer to reach it so it gets Doppler shifted longer, creating the illusion of time for the object slowing down. Likewise observing a moving beam of light requires light from the beam to reach the eyes, so it won’t appear to go as fast as it really is going.  My question asks whether this Doppler shift is what slows time down in relativity.

It is said that we can verify time dilation by flying a very accurate clock on a fast jet or spaceship and prove that it registers less time than the clocks on earth. However, the clocks on earth would be moving relative to the clock on the spaceship, and since time always dilates and never goes faster regardless of the direction of relative motion,  the clocks on earth should register less time than the clock on the spaceship.  Is this true? Whenever there is a fast-moving object such as a rocket do all clocks on earth really become slow?  If the rocket with the clock landed after moving at relativistic speed, would its clock and the earth's clock again show the same time since during its travel both appeared slow to each other?  Or is all this just an illusion, ie. the clocks just appear to be slow to each other but in actually run at normal speed, and neither is behind when the rocket actually lands?


I tried to make a send request after I stop writing in the search box i don't understand this part of the code  return function(...e){ // i don't understand this line and from where we get ...e         clearTimeout(timeout)         timeout=setTimeout(()=>fn.apply(this,e),time)     }   this debounce function work correctly but I don't understand why we return a function(...e) in it function debounce(fn,time){     let timeout     return function(...e){ // i don't understand this line and from where we get ...e         clearTimeout(timeout)         timeout=setTimeout(()=>fn.apply(this,e),time)     } } searchBox.addEventListener('input',debounce((e)=>{     searchTerm=e.target.value;    loadAllVideo(sortBy,searchTerm)    },500))

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.


has anyone installed Linux on an HP Proliant 365 G1 server?  I can't because it doesn't detect hard drives (Raid5).  Any compatible version?  He read a lot and I think HP Smart Array SCSI driver comes from this but I can't find the solution.

I've an HP Proliant DL360 G5 server with two 72gb HDD in RAID and 2 150gb HDD in RAID.  I've Windows Server installed on the 72gB HDD and I'm now trying to overwrite it with a fresh installation of CentOS 7 x64.  When I try to install it it says that I need to manually configure the hard disks but when I open the partitioning tool no HDD are detected. I'm using the ~4GB DVD installer.  How can I fix this problem?


The FAQ says:     Each room has owners, who can change various room settings and transfer ownership to other users.   And:     There are not a lot of responsibilites connected to room ownership, just a few extra permissions: The owner can add and remove RSS feeds being posted into the room, change room name and description, and similar things.   So what is the full extent of their powers?  Plus, besides revoking ownership, do moderators have any more chat room powers than a room owner?

Chat is an offshoot of the main site, and using it is  during their time here.  Chat is our place for:        Real-time collaboration   Meeting fellow members of the community   Less structured, casual (but still roughly on-topic) conversation      Our chat system exists to serve the main site; users of each site can gather and commune with each other.  When in chat, we expect all users to abide by our  policy, which means that we expect community members to treat each other with respect.    While it is a place where the community can go to interact on a more casual level, chat still needs to be moderated by the community and there are tools in place to help with the moderation. This raises a few questions, that are addressed here:


Let $(A_n)$ be a seqeunce of sets, I am trying to show that   $$ \limsup_{n \to \infty} \chi_{A_n} = \chi_{\limsup_{n \to \infty}A_n}$$  $$ \liminf_{n \to \infty} \chi_{A_n} = \chi_{\liminf_{n \to \infty}A_n}$$  I am stuck trying to show these identities. I was thinking if let $A = \limsup A_n$, then a good strategy to prove this would be to bound $| \chi_{A_n} - \chi_A | $?? Any ideas would be greatly appreacited. thanks.

So first let me state my homework problem:  Let $X$ be a set, let $\{A_k\}$ be a sequence of subsets of $X$, let $B = \bigcup_{n=1}^{+\infty} \bigcap_{k=n}^{+\infty} A_k$, and let $C = \bigcap_{n=1}^{+\infty} \bigcup_{k=n}^{+\infty} A_k$. Show that (a) $\liminf_k\; {\xi_A}_{_k} = \xi_B$, and $(b)$ $\limsup_k \;{\chi_A}_{_k} = \chi_C.$  I know that, in the context I am familiar with, that $$\liminf_{k\rightarrow +\infty}\; X_k = \bigcup_{k=1}^{+\infty} \bigcap_{n=k}^{+\infty} X_n$$ and $$\limsup_{k\rightarrow +\infty}\;X_k = \bigcap_{k=1}^{+\infty} \bigcup_{n=k}^{+\infty} X_n.$$   I also know that the characteristics (indicator) function is defined as $\chi_A(x) = \begin{cases} 1, & x \in A \\ 0, & x \notin A .\end{cases} $  So I wrote out $B$ in some of its `glory': $B= (A_1 \cap A_2 \cap A_3 \cap \cdots) \cup (A_2 \cap A_3 \cap \cdots) \cup (A_3 \cap A_4 \cap \cdots) \cup \cdots$, and as the first argument is the smallest, with increasing size to the right, the last term in the expression for $B$ would be $B$, which would be the largest.  So if I replace the $X_k$'s above with $\chi$'s I still don't see how I can get the correct answer - though it looks pretty clear from the definition of $B$ and that of $\liminf$ being basically the same, except in this case for the $\chi$.  Any direction would be greatly appreciated. By the way, I have checked out  but I was somewhat confused by the topology, the meets/joins, etc.  Thanks much, Nate


Using type casting to convert string into integer   string str="123456"; int buffer[str.length()]; for (int i=0; i<str.length();i++) {     buffer[i]=(int)str[i];     cout << buffer[i]; }   Getting following result    495051525354  which is DEC form of Symbol 123456  But i want "123456" as a result. Please help!!

What's the C++ way of parsing a string (given as char *) into an int? Robust and clear error handling is a plus (instead of ).


When passing all http and https traffic through squid3, is it possible if a user requests http://www.example.com I could redirect to a different url?  Would this only be possible for HTTP or HTTPS too?  Thanks

I have deployed squid 3.4.8.  It's primary purpose is to redirect users to internal landing pages since no Internet access is permitted or enabled on this network.  Instead of letting browsers time out, we want to notify users immediately.    I have no problems redirecting HTTP to a landing page (stop.html). The squid proxy listens on 8888.  The landing pages listen on 10.5.5.100:8000   How do I redirect all outbound HTTPS requests and redirect them to a landing page?  My squid access.log shows the following error for an HTTPS request:    TCP_DENIED/302 321 CONNECT  The relevant squid.conf file is as follows:  acl internaltraffic dst 10.0.0.0/8  #internal traffic only acl CONNECT method CONNECT http_access deny CONNECT all http_access allow internaltraffic http_access allow localhost deny_info http://10.5.5.100:8000/stop.html all deny_info 302:http://10.5.5.100:8000/stop.html CONNECT http_access deny all http_port 8888


We have:  $$p(x) = x^3+x+1\in\mathbb{Z}_5[x]$$  First of all, I tried to prove that there are no roots in $\mathbb{Z}_5$, so I tried all of them:  $$p(0) = 1\\p(1) = 3\\p(2) = 1\\p(3) = 1\\p(4) = 4$$ So since there are no roots, I can't reduce this polynomial to a linear polynomial times a 2nd degree one. T

I want to argue that argue that $\pi(\alpha)=\alpha^3+3\alpha+3$ is an irreducible polynomial over the finite field with 5 elements $\mathbb{F}_5$. My approach was just to check that $\pi$ has no roots in $\mathbb{F}_5$. Is this right?


Since I renamed my home folder I've gotten many bugs including the following one where the calendar in my Arc-Black theme appears to be white and unreadable, also, you have the Themes I'm using right now in the Tweeks screenshot down below

I have just started to customize my Ubuntu a little bit and found the Arc-Dark theme to be exactly what I am looking for. There are some small things though. The color of the calendar on top is still white, and the font of the notifications and inside the calendar are off. This is what it looks like right now:  I would like to see the calendar being the same darker color, and maybe having the day numbers font in white. Also the font color of the search bar is off. There is text, but it is just as dark as the background.  It's only visible when you hover over the search bar.  How would I go about changing/tweaking these things? Or did I do something wrong during the installation? Edit: UnKNOWn has answered my question (accepted answer). The css-file was, in my instance, found at /usr/share/themes/Arc-Dark/gnome-shell/gnome-shell.css. I made the small changes to .calendar and .search-entry, saved the file (with sudo rights) and reloaded the theme by simply re-applying it with Gnome-Tweaks!


Kind of confused as to how I should implement a simple entity hierarchy in OOP style C. For example, here's the equivalent C++ code:  class Entity { protected:     float x, y;      Entity(float x, float y) : x(x), y(y) { }      virtual void update() = 0;     virtual void render() = 0;     virtual ~Entity() { } };  class Player : public Entity {     Player(float x, float y) : Entity(x, y) { }       void update() {      }      void render() {      } };   So right now I have a structure Entity that has two function pointers that will point to the update and render functions. Then I would have a Player structure which would have a pointer to the Entity structure so it can access the members.  One thing I'm kind of confused about is how allocation would work... would I have a new_entity function perhaps that allocates an Entity structure? Could I have a new_player function that allocates an Entity ptr, and returns the Player structure, and will set the functions to point to the player_update, play_render functions, etc?

What are some ways to write object-oriented code in C? Especially with regard to polymorphism.    See also this Stack Overflow question .


I've seen the property   $$f_{n+1} f_{n−1} = f_n^2 + (−1)^n, n ≥ 2.$$   for Fibonacci numbers at Abstract Algebra book of Thomas W. Judson. I've tried it for a few Fibonacci number, and I've really liked how the pattern goes. I've tried to prove it by induction, however I failed to do so. I would appreciate, if someone could prove and explain to me.   I would also like to state that, I'm not a math major. Therefore I would be really glad if you prove it as simple as possible.   Thanks.


I don't know how to be clearer that a moderator deleted my old account.   Yesterday when I logged on Money, I saw "Join this community", but I never deleted my Money account. I then clicked "Join this community".  Screen shot beneath undeniably proves this wasn't my old account. I asked at least 5 questions. It's unquestionably false that "you have not asked any questions."   Please reinstate my old account?    I can't post on Money Meta. Please don't betray private details.

Edit I found the email that proves a moderator deleted my account. And nobody appears to believe me before? Even if you suspend me, why dissociate my questions and answers? How can I manage or track them, or accept answers?  Original  Moderator messaged me at Personal Finance S.E. How am I supposed to see if when they deleted my account? When I click on "moderator message", I get 404 not found page.  Why is this being down-voted?   Many people don't believe me that a moderator deleted my old account.  Yesterday when I logged on, I saw "Join this community", but I never deleted my Money account. I then clicked "Join this community" to see what happened.  Screen shot beneath undeniably proves this wasn't my old account when I asked at least 5 questions. It's unquestionably false that "you have not asked any questions."  Please reinstate my old account? I want to keep track of my posts.   I can't post on Money Meta. Please don't betray private details.    and:


I get this error "Unhandled exception at 0x00007FF982801B5F (ntdll.dll) in ConsoleApplication3.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF" while trying to initialize a dynamic 2D array inside a class. Here is my class     class Board { private:     int boardSize;     char** board = new char*[boardSize]; public:     Board() {         for (int i = 0; i < this->boardSize; i++) {             this->board[i] = new char[this->boardSize];         }         for (int i = 0; i < this->boardSize; i++) {             for (int j = 0; j < this->boardSize; j++) {                 this->board[i][j] = '-';             }         }     }     /*Board(int boardSize) {         this->boardSize = boardSize;         for (int i = 0; i < this->boardSize; i++) {             this->board[i] = new char[this->boardSize];         }         for (int i = 0; i < this->boardSize; i++) {             for (int j = 0; j < this->boardSize; j++) {                 this->board[i][j] = '-';             }         }     } */     Board(int boardSize, int c1r, int c1c, int c2r, int c2c) {         this->boardSize = boardSize;         for (int i = 0; i < this->boardSize; i++) {             board[i] = new char[this->boardSize];         }         for (int i = 0; i < this->boardSize; i++) {             for (int j = 0; j < this->boardSize; j++) {                 board[i][j] = '-';             }         }         this->board[c1r][c1c] = 'C';         this->board[c2r][c2c] = 'C';         this->board[boardSize / 2][boardSize] = 'B';     }      ~Board() {         for (int i = 0; i < this->boardSize; i++) {             delete[] this->board[i];         }         delete[] this->board;     }     void print_board() {         for (int i = 0; i < this->boardSize; i++) {             for (int j = 0; j < this->boardSize; j++) {                 std::cout << board[i][j] << "|";             }             std::cout << "\n";         }     } };  and this is my main function int main() {     Animals duck;     duck.move('d');     std::cout << duck.getColumn() << "\n";     Board playing_board(12, 2,2,4,4);     playing_board.print_board(); }  Thank you

I know that the compiler will sometimes initialize memory with certain patterns such as 0xCD and 0xDD.  What I want to know is when and why this happens.  When  Is this specific to the compiler used?  Do malloc/new and free/delete work in the same way with regard to this?  Is it platform specific?  Will it occur on other operating systems, such as Linux or VxWorks?  Why  My understanding is this only occurs in Win32 debug configuration, and it is used to detect memory overruns and to help the compiler catch exceptions.  Can you give any practical examples as to how this initialization is useful?  I remember reading something (maybe in Code Complete 2) saying that it is good to initialize memory to a known pattern when allocating it, and certain patterns will trigger interrupts in Win32 which will result in exceptions showing in the debugger.  How portable is this?


I use Blender 2.8 cycles. I rendered my animation from frame 1 to 35 than I, stopped the render because I heard that I can render in more sessions if I render each frame as a picture. Now when I click the render button it starts from frame 1 not from 35. What can I do? I can render each frame, but this it means that I must click render at every frame.

I've stopped my animation that was rendering at 224 frames (out of 250) and I can't find a way to start rendering again from where i left off. I've been told to change the start frame (under frame range) to where I last left off but it just starts the render from the beginning (restricted to 224-225 frames). Please help, I just need a few more frames 😭


Find the cardinality of set $A$: $$A = \{x \subseteq \mathbb R : |x| < \aleph_o \}$$   I have thought about it for a while and I've come to the conclusion that the cardinality of this set will be at least continuum, because every real number singleton is in this set. However, the only upper-bound of this cardinaltiy that I can think of is $\mathbb R^{\mathbb R}$ whose cardinality is more than continuum.   Any suggestions and hints would be most appreciated.

Find the cardinality of the set of all finite subsets of $\mathbb{R}$.    I have proved that the set of all finite subsets of $\mathbb{N}$ is countable . But I cannot find the cardinality of the set in case of $\mathbb{R}$ .  My Attempt:   First I have considered the set $$A_k=\{\{a_1, a_2, ..., a_k\}| a_i \in \mathbb{R}  \ and\ a_1<...<a_k  \}$$  Then $S=$ The set of all finite subsets of $\mathbb{R}=\bigcup_{n=1}^{\infty}A_{n}$, and now in the case of $\mathbb{N}$, I could show that this $A_k$ is countable and consequently the set of all finite subset of $\mathbb{N}$ is countable.  But in this case I cannot say anything like this...In this case the set will be of the cardinality as that of $\mathbb{R}$ (I think). But cannot prove it.  I appreciate your help.  Thank you.


Help So, I'm still a starter on python and I decided to make a simple program that, when you tell it the ingredients you have in your home, it tells you some recipes to make. I decided to make it based on a text file, which means I will have a text file with the ingredients sorted out on it, and if the ingredients the person typed in match the ones on the file, it will read the line under them, which will contain a path for another text file which will have the full recipe for the person to read. The code works IF there is no line under the line with the path to the file. Which is weird, because when I changed it to print, not open the file path, it printed it out correctly, but when I try to make python open it, it displays this error message: Traceback (most recent call last):  File "C:/Users/nailu/PycharmProjects/Recipe find yes/find rcipe.py", line 66, in <module>  g = open(file.readline())  OSError: [Errno 22] Invalid argument: 'C://Users//nailu//Desktop//Projeto receita//Receitas//receita bolo de maca.txt\n'  please help, it keeps saying theres a \n in there when there isnt! Here is the code in case you guys need some context word=input("Digite aqui:")   count = 1 count2 = 1    s=" " while (s):     s = file.readline()     L = s.split()     if palavro in L:         print("I found a recipe for you!")         time.sleep(1)         see=input("Would you like to see it?  y/n")         if see=="y":             g = "a"             g = open(file.readline())             h=" "             while (h):                 h = g.readline()                 print(h)                 count2= (count2+ 1)                 time.sleep(1)         else:             print("Ok, going over to the next recipe...")         time.sleep(0.5

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


I am currently running 16.04 version of Ubuntu bash on Windows 10 Pro (v1803) using WSL. But, I couldn't install the newly released 18.04 Ubuntu on my machine from the windows store. Need some help.   I tried to install the 18.04 version from Windows Store. The store app just refreshes. Nothing else happen.  Tried removing v16, turned off WSL feature and started all over again. Still the same.   Tried the method from this link from . It installed only 16.04 version. Not the latest 18.04.   Resetting windows store didn't work too.

Why do we need to install ubuntu when we already enabled WSL?


An email address I frequently type into web forms is srs@.... Yesterday auto-correct started changing the srs to sis as soon as I typed @. While keeping the rest of auto-correct working I would really like it to leave srs alone.  In my searching for an answer I found  But I'm not making a typo.  I found a variety of answers for both OS X and iOS, but none seemed to the point. The worst was decrypting a substitution file maintained by Safari to edit?!

I'm running into an annoying issue with OS X's automatic spelling correction where the word nala gets automatically corrected to napa.  I've tried adding nala to my custom dictionary under ~/Library/Spelling/LocalDictionary but it still reliably makes the correction anyway.  How do I configure OS X to not automatically correct a given word short of turning off automatic correction entirely which is not really desirable?


when I use sudo update-manager -c -d to update the system, it returns the following:  /usr/bin/update-manager:28: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.   from gi.repository import Gtk Traceback (most recent call last):   File "/usr/bin/update-manager", line 38, in <module>     from UpdateManager.UpdateManager import UpdateManager   File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 43, in <module>     import dbus   File "/usr/lib/python3/dist-packages/dbus/__init__.py", line 82, in <module>     import dbus.types as types   File "/usr/lib/python3/dist-packages/dbus/types.py", line 6, in <module>     from _dbus_bindings import ( ModuleNotFoundError: No module named '_dbus_bindings'   Can anyone please help me?

I was trying to update my Python and messed up my whole system.   I am currently now able to start my Software Centre. I tried Googling multiple fixes but nothing helped. My Software Centre can't start.   When I try starting it up, this error shows:  astephen@localhost:/usr/bin$ ./software-centerGtk-Message: Failed to load module "gtk-vector-screenshot" Traceback (most recent call last): File "./software-center", line 36, in <module> from softwarecenter.utils import ( File "/usr/share/software-center/softwarecenter/utils.py", line 19, in <module> import dbus ImportError: No module named dbus   I tried reinstalling dbus using:  apt-get install --reinstall dbus   But it did not help.  astephen@localhost:/usr/bin$ sudo apt-get install --reinstall dbusReading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not      upgraded. Need to get 0 B/231 kB of archives. After this operation, 0 B of additional disk space will be used. (Reading database ... 676272 files and directories currently installed.) Preparing to unpack .../dbus_1.6.18-0ubuntu4.3_amd64.deb ... Unpacking dbus (1.6.18-0ubuntu4.3) over (1.6.18-0ubuntu4.3) ... Processing triggers for ureadahead (0.100.0-16) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Setting up dbus (1.6.18-0ubuntu4.3) ...


In my case i am using the shematics in a truck, i have the ground everywere on the truck body. I would like to control a led strip using mosfet (N or P) as a pwm switch on VCC (transistor beetween battery +12 and led's + wire).  Is it possible ?  Edit I have tried the solutions 1 and 2 of the possible duplicate link without success, any idear why and how to fix this ? My pwm command signal comes from an arduino 5V.

I think, it is time I understand working principle of MOSFET transistors...    Suppose that;   I want to switch voltage on a resistive load by a MOSFET transistor.   Any control signal between -500V and +500V can be easily generated.   The transistor models in the picture are not important, they can be of any other appropriate model as well.   Question #1 Which of the driving techniques are feasible? I mean, which of these four circuits would work with correctly applied control signals?  Question #2 What is the range of the voltage level of the control signals (CS1, CS2, CS3, CS4) that loads and unloads the resistor? (I understand that exact boundaries of on and off states must be calculated individually. But I'm asking for approximate values to understand the working principle. Please give statements like "In circuit (2), the transistor turns on when CS2 is below 397V and turns off when above 397V.".)


I could easily prove   $\neg P \lor Q$ entails $P \rightarrow Q$.  It is well known that   $P \rightarrow Q$ entails $\neg P \lor Q$  but I couldn't find a way to prove it.   Although there is the same question;  ; it's a little bit confusing and I need to see step by step solution.  Could you show me the way by using Natural Deduction?

In my book about Logic, which is called 'Language, Proof and Logic', by the way, there is explained that the conditional $ P \rightarrow Q $ is equivalent with $\neg P \lor Q$.   that gives as answer: 'just compare the truth tables and you can see that they are equivalent'. However, I would like to know how to prove this using formal propositional logic. This should be possible, right?


What is the difference between will and shall in modern spoken English?  For example I have the following sentences:     He will arrive on Tuesday.        He shall arrive on Tuesday.    Are there any rules specifying usage of will and shall?  Reopen note:  I looked at this question here:      But that question is about the use of the first person with will and shall. In addition one of the comments under here states that will and shall are NOT used in the same way in modern English. The linked-to question says they ARE. Which of these is correct and why?

When I studied English, I was taught that shall is used to express the future tense for the first person (singular, or plural), and will is used for the same purpose in the other cases.  When I look for shall on the NOAD, I read the following sentence, in a note about the usage of shall:     In practice, however, shall and will are today used more or less interchangeably in statements (although not in questions).   Does that mean shall and will are used with almost the same meaning?  Does I shall return have the same meaning of I will return?