Good day,  I am having the problem said in the title when app runs on a tablet. My intention as shown in the layout is to show to the right, an empty framelayout the first time user enters the app so nothing is displayed. So far so good.  Then user clicks on an item of the listview on the left pane, so its detail is displayed on the right pane. This is well captured in the listener in the Activity below that triggers the else part, and tries to add the FragmentDetail programatically, that has its corresponding layout.   @Override public void onItemSelected(Uri wifi) {     mWifi = wifi;     if (wifi != null)     {         if (!mDualFragments)         {             Intent intent = new Intent(this, DetailActivity.class);             intent.setData(wifi);             startActivity(intent);         }         else         {             // add fragment programmatically to the framelayout             FragmentDetail fd = new FragmentDetail();             getFragmentManager()                     .beginTransaction()                     .add(R.id.mFragment_detail, fd)                     .commit();             fd.updateFragmentDetail(wifi, true);         }     } }   Then, the following method in FragmentDetail is called, and the error occurs in the setTitle getActivity(). Looks that the error is in the FragmentTransaction in the caller activity.      public void updateFragmentDetail(Uri wifi, boolean dualFragments)     {     mCurrentWifiUri = wifi;     mDualFragments = dualFragments;     if (mCurrentWifiUri != null)     {         getActivity().setTitle(R.string.title_editor_activity);         if (!dualFragments)         {             getLoaderManager().initLoader(EXISTING_WIFI_LOADER, null, this);         }         else         {             getLoaderManager().restartLoader(EXISTING_WIFI_LOADER, null, this);         }     } }   This is the Layout for tablet  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:baselineAligned="false" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:context="eu.javimar.wirelessvlc.MainActivity" tools:showIn="@layout/activity_main">  <fragment     android:id="@+id/mFragment_list"     android:layout_weight="30"     android:layout_width="0px"     android:layout_height="match_parent"     class="eu.javimar.wirelessvlc.view.FragmentList" />  <FrameLayout     android:id="@+id/mFragment_detail"     android:layout_weight="70"     android:layout_width="0px"     android:layout_height="match_parent">     <TextView         android:layout_height="wrap_content"         android:layout_width="match_parent"         android:gravity="center"         android:layout_gravity="center_vertical"         android:layout_margin="16dp"         android:textSize="25sp"         android:text="Empty View, Click on a Wi-Fi" /> </FrameLayout>     Thanks!  UPDATE I am confused. How is this related to a NPE Q&A as the one you mention @gabe-sechan?  I know this is a NPE issue and that getActivity() is creating it. But this is solely an issue related to FragmentTransactions,  asynchronicity, and that it won't be attached to the Activity, as well answered by @mike-m.  Perhaps I'm missing something?

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


I have a Windows 7 machine, and I have it set to only manually allow updates from Windows update  There is this exploit that needs to be patched.    I'm looking at my Windows Security Essentials version on Windows 7, and it's v1.1.13701.0, meaning it's still vulnerable.  I want it to be up to v 1.1.13704.0, which is not vulnerable to that exploit.  I downloaded and installed the Windows Malicious Software Removal Tool x64 - May 2017 (KB890830) update, and restarted my machine.  I figured that was the update.  After rebooting, I'm still on v1.1.13701.0.  The update I just mentioned is listed as installed.  There is no information that I can find online.  The microsoft documents online are utterly worthless, not telling me how to actually manually do an update myself:    Does anybody know what specific actual update I have to apply to patch my Windows Security Essentials on my machine?

According to  the patch for this will be installed automatically. I've checked just now and all pending important updates have indeed been installed on the machine, with a subsequent reboot.  The relevant diagnostic is Windows Defender engine version.  'Advisory Details' says 1.1.13701.0 bad, 1.1.13704.0 good.  I've checked Windows Defender on my machine (Windows 7 x64), and it says 1.1.13701.0 even though all pending important updates are installed.  'Suggested Actions' says 'For affected software, verify that the Microsoft Malware Protection Engine version is 1.1.10701.0 or later.' This contradicts the table earlier on the page.  Which of these is correct? If the first one is correct, what are you supposed to do when Windows says all important updates are already installed?


I am in need of a program that lets me edit gerber zip file. I have several PCB to be sent to  but individually ordering them will cost me quite an extra (30$). Although that may not be much to some, but I don't like spending money where it can be avoided.  All that I am looking for is for me to be able to edit the board edge of my individual projects so that I can panel them in a one big square/rectangle panel.    I have tried doing it in the program I am using to create these files (PROTEUS 8.9) but it would seem there is no feature yet to combine project files. Long story short. Something will always break if I try to combine project files.  EDIT: I have tried the solutions from another question    Both of the answers did not work for me. On the marked as correct answer, no gui opens upon executing the program, if it is ment to be that way it would be really hard for me to use it. On the second answer it does come with a GUI and a guide on how to use it. Unfortunately the gerber from proteus upon creating an instance would not show up, but the gerber viewer it came along with can open it no problem

I am planning on ordering a panel with four different designs on it. Two were made in Altium, while the other two were made in Eagle.  Altium has a great tool for panelizing boards designed in it, but I don't believe it can put designs from other programs on the panel.  How can I panelize these PCBs?


I've heard few explanations, but none in good detail that make it clear to those with less mathematical knowledge on the equations of complex physics.  I would like to think that since you are on the surface of the Earth, for example, everything, at least from my introspection, seems to be "pulled" towards the center of the celestial body itself.  If that is true, and everything, including me, is being pulled towards the center, and our (human, for example) bodies use skeletal muscles to maintain supportive structure to fight the gravity all the time (when awake), how can there be no gravity within the very center of the Earth?  It just seems hard to believe that something attracts you to it with energy, yet it has no energy in its core (gravity) to do this. Where and why does gravity stop at the center, and how does that make good, detailed sense for an average to relatively understand?  Also, taking in to accounts with centers of mass, wouldn't the Earth's core be the "center of mass" in this sense?  I mean if the energy or force "gluing" us to the Earth is not caused by the Earth itself, how come we are "pulled" towards Earth in particular?

Would the effect of gravity on me change if I were to dig a very deep hole and stand in it? If so, how would it change? Am I more likely to be pulled downwards, or pulled towards the edges of the hole? If there would be no change, why not?


Let's say we have the following dataset:  $data = [   'Newcastle Upon Tyne, Tyne and Wear, England' => 18,   'Gateshead, Tyne and Wear, England' => 17,   'Sunderland, Tyne and Wear, England' => 3,   ... ];   I want to map through the function and change the keys to look like this:  $data = [   'Newcastle Upon Tyne' => 18,   'Gateshead' => 17,   'Sunderland' => 3,   ... ];   I thought I might be able to use array_walk like so...  return array_walk($this->_cities, function(&$key, $val) {   substr( $key, 0, strpos( $key, ',' ) ) = $b; });   But that produces the error:   Can't use function return value in write context    So instead I'm doing it like this:  $cleaned_data = []; foreach ( $this->_cities as $city => $count )   $cleaned_data[ substr( $city, 0, strpos( $city, ',' ) ) ] = $count; return $cleaned_data;   Is it possible to do this using array_walk or a similar function?

I have an associative array in the form key => value where key is a numerical value, however it is not a sequential numerical value. The key is actually an ID number and the value is a count. This is fine for most instances, however I want a function that gets the human-readable name of the array and uses that for the key, without changing the value.  I didn't see a function that does this, but I'm assuming I need to provide the old key and new key (both of which I have) and transform the array. Is there an efficient way of doing this?


In a course I had, we have been given two statements P and Q and their "boolean table" :     While I completely understand P and Q and P or Q values, I can't understand the first two lines for P->Q, why is the result true even when P is false ?  Thank you.

I am studying entailment in classical first-order logic.  The Truth Table we have been presented with for the statement $(p \Rightarrow q)\;$ (a.k.a. '$p$ implies $q$') is: $$\begin{array}{|c|c|c|} \hline p&q&p\Rightarrow q\\ \hline T&T&T\\ T&F&F\\ F&T&T\\ F&F&T\\\hline \end{array}$$  I 'get' lines 1, 2, and 3, but I do not understand line 4.      Why is the statement $(p \Rightarrow q)$ True if both p and q are False?  We have also been told that $(p \Rightarrow q)$ is logically equivalent to $(~p || q)$ (that is $\lnot p \lor q$).  Stemming from my lack of understanding of line 4 of the Truth Table, I do not understand why this equivalence is accurate.       Administrative note. You may experience being directed here even though your question was actually about line 3 of the truth table instead. In that case, see the companion question  And even if your original worry was about line 4, it might be useful to skim the other question anyway; many of the answers to either question attempt to explain both lines.


The answer to my question might be obvious to you, but I have difficulty with it.   Which equations are correct:  $\sqrt{9} = 3$  $\sqrt{9} = \pm3$  $\sqrt{x^2} = |x|$  $\sqrt{x^2} = \pm x$  I'm confused. When it's right to take an absolute value? When do we have only one value and why? When two and why?   Thank you very much in advance for your help!

It is perhaps a bit embarrassing that while doing higher-level math, I have forgot some more fundamental concepts. I would like to ask whether the square root of a number includes both the positive and the negative square roots.  I know that for an equation $x^2 = 9$, the solution is $x = \pm 3$. But if simply given $\sqrt{9}$, does one assume that to mean only the positive root? And when simply talking about the square root of a number in general, would one be referring to both roots or just the positive one, when neither is specified?


I was trying to install ubuntu 13.04 on a mini notebook acer, but an error occurred while almost completing the installation...Now it doesn't charge, only if I enter the Windows 7 partition.How do I start the process?Or can I uninstall the ubuntu to start again to install it? Thank you in advance for your answers.

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


For some strange reason, when this data:  // data visitorsTemplate: [{   text: '',   type: 'buttons',   children: [{     name: 'email',     method: (e) => { this.sendEmail(e) }   }] }]   Is cloned:  // watch console.log(this.visitorsTemplate) const visitorItem = clone(this.visitorsTemplate) console.log(visitorItem)   With this function:  // utils export const clone = (...args) => {   return JSON.parse(JSON.stringify.apply(null, args)) }   the method attribute disappears. Here are the console.logs:  [{   text: "",   type: "buttons",   children": [{     name: "email",     method: f method(e)   }, {     name: "delete",     method: f method(e)   }] }]  [{   text: "",   type: "buttons",   children": [{     name: "email"   }, {     name: "delete"   }] }]   Update: I found out JSON.stringify is removing the methods but I need to create a new array. So how to avoid removing the methods?

What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but . I've done things like obj = JSON.parse(JSON.stringify(o)); but question the efficiency.  I've also seen recursive copying functions with various flaws.  I'm surprised no canonical solution exists.


One thing to note is: I need to get the variable's name, not the property's name.  I have a scenario where I need to pass in either List<int> or List<double> to a view. So in the partial view I bind the model to dynamic:  @model dynamic  var nameOfParameter = Web.Controllers.MemberInfoGetting.GetMemberName(() => Model);  @foreach (var value in list) {      <td>@Html.Editor(value, "DoubleTemplate", new { Column =  count, Switcher = (YearOfProgram >= count)})</td>      sum += (double)value;     ++count; }   And this is how I call the partial view from the main view:   @Html.Partial("_myPartial", Model.CategoryList)   Then I found that I have to know the name(CategoryList) of the list which is passed into the partial view.  Here I found many posts talking about using something like this:     public static class MemberInfoGetting     {         public static string GetMemberName<T>(Expression<Func<T>> memberExpression)         {             MemberExpression expressionBody = (MemberExpression)memberExpression.Body;             return expressionBody.Member.Name;         }     } }   This code doesn't work for me as the result of (nameOfParameter )calling it will always be "Model", rather than "CategoryList".  So, is it possible to achieve what I want?    Update1  The reason why I need to pass in the name of the list is because I need the name of the list to form the name on the html element into something like: CategoryList_1. So Razor knows I am trying to bind the value of the textbox into the 1st element of a property in my view model.  class MyViewModel { ................ public List<double> CategoryList {get; set;} ................ }     Update2    @Html.RenderPartial("_VerificationSummarySection",new { ListName = "PracticeEvaluationCreditsVerifiedList", List = Model.PracticeEvaluationCreditsVerifiedList})   I'm now trying to pass in the name of the list by using RenderPartial. But, I cannot find the right way to use it.

Let me use the following example to explain my question: public string ExampleFunction(string Variable) {     return something; }  string WhatIsMyName = "Hello World"; string Hello = ExampleFunction(WhatIsMyName);  When I pass the variable WhatIsMyName to the ExampleFunction, I want to be able to get a string of the original variable's name. Perhaps something like: Variable.OriginalName.ToString()  Is there any way to do this?


public class Cust_Details_address extends Fragment{    String operator;    EditText operator_name;    @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,                          Bundle savedInstanceState) {     View view = inflater.inflate(R.layout.details_customer_2, container, false);       Intent intent=getActivity().getIntent();      operator = intent.getStringExtra("operator");      operator_name = (EditText)view.findViewById(R.id.operator_id);      operator_name.setText(operator);     Toast.makeText(getActivity().getApplicationContext(),"operator"+operator,Toast.LENGTH_SHORT).show();      return view;   } }   In Toast its showing the operator name but EditText is blank thank you in advance.

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


I'm Colombian and need to know, if I'm going to travel from Colombia to Switzerland and transfer in Toronto, do I need a Canadian visa?

I'm passing through Canada, on my way to somewhere else. I'm staying only a short time.   Is there a website, or some other way of find out out if I need a visa?


Currently I'm using ubuntu 9.04. I need to update this to a recent version 12.04, 12.10 or 13.04? Is this possible? Can someone point me to a instruction page to do this?

I am currently using Ubuntu 10.04. I know there is a 10.10 release, but can I upgrade directly to 11.04? Could you walk me through the steps please?


Here is a problem:  Suppose $f,g: [a,b]\rightarrow \mathbb{R}$ are both continuous and of bounded variation. Show that the set $\{(f(t),g(t))\in\mathbb{R}^2: t\in [a,b]\}$ CANNOT cover the entire unit square $[0,1]\times [0,1]$.  Thanks for all helps!

Suppose $f,g : [a, b] \to R$ are both continuous and of bounded variation. Then can set $\{(f(t),g(t)) \mid t\in [a,b]\}$ cover the entire square $[0,1] \times [0,1]$ ? And what if we remove the condition both $f,g$ are of bounded variation ?


I have been looking to install spell checkers on LibreOffice but I could not find any stand alone Grammar checkers for LibreOffice.  Does anyone know any Grammar checker, like Grammarly, for Ubuntu?  There was a solution posted on  but that required Java to be installed.  I am looking for a Grammar checker that does not need additional features installed.

Is there a tool for checking grammar in LibreOffice?


A more general form of this question has been answered  for example, but I want to know what makes a good poster presentation in physics and/or engineering conferences.  Obviously the poster must be visually appealing as discussed in various posts here, but I have seen cases where the most stunning posters (looks really good and well-written) did not win poster prizes when judged by professors at the conferences. Can you give reasons as to why this happens? Are there some special conditions or requirements in physics/engineering for such presentations?

Should one create slides similar to those that one uses in a good powerpoint presentation? Or are there things that a poster should include that a powerpoint should not include? (and vice versa)


I've downloaded a couple SRTM DEMS from  and when I load some of them into QGIS, there is a noticeable edge between 2 of the tiles (see image).     Why does it happen? These are both from the same datasource, why don't they match up? Is there a good way to correct for this in QGIS?

I have 268 hgt-files from  that I'm using to create an elevation model, but each of the files has its own min and max-value in Layer Properties - Symbology - Band Rendering.  Currently it looks like this:    I found I can set the min and max of each layer manually, to get an uniform scale, but this is a hassle for all 268 layers. So I was wondering if I'm missing an option somewhere, or if im doing something completely crazy?


root@host [/backup/2013-08-15/accounts]# cd /home1 root@host [/home1]# ls /bin/ls: reading directory .: Input/output error root@host [/home1]#   Suddenly /home1 doesn't work. It used to work just fine. Yes I put one of my most demanding sites there. Then I started getting these errors. Is it possible that the disk can't handle the load?  My provider insist that it's user's error though     Actually, I think this was a case of user error. Your hard drives are   all fine, and I've confirmed I am able to read and write files to all   mounted partitions (/home, /home1, /home2, /home3 and /home4). I did   need to run an fsck to fix several errors on your filesystem, and it   also appears you have a whole load of unresolved links leading all   over your system (fsck tried to clear some of these manually, all may   not have been fixed). This system appears to have been very poorly   maintained, however as of right now all disks and all filesystems are   accessible. I will put this system back online shortly and let you   know when I've confirmed it is back online.   So we have a system that's working just fine for now and then suddenly crash for no reason.  After doing some check my host provider says that NOTHING is wrong with the server. I got my server back and yea everything is working.  How can this happen?  So after all those checks and reboot, the server is running fine, including the drive. However, I am afraid of moving stuff to the server again. If it broke again it can cost me hundreds of dollars.  What should I do to make sure nothing else go wrong? How com input/output is in error but then it works again just fine now?  What kind of error is this that works now and then fail latter?  Call dmesg and got this:  I run dmesg and this is what I see:  EXT4-fs (sda1): warning: mounting fs with errors, running e2fsck is recommended EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts:   Here is the stuff in context  EXT3-fs (sdd1): using internal journal EXT3-fs (sdd1): mounted filesystem with ordered data mode EXT4-fs (sda1): warning: mounting fs with errors, running e2fsck is recommended EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts:  EXT4-fs (sdb1): warning: maximal mount count reached, running e2fsck is recommended EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts:  EXT4-fs (sdc1): warning: maximal mount count reached, running e2fsck is recommended EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts:  Adding 4194296k swap on /dev/sdd2.  Priority:-1 extents:1 across:4194296k SSD kjournald starting.  Commit interval 5 seconds EXT3-fs (loop0): warning: maximal mount count reached, running e2fsck is recommended EXT3-fs (loop0): using internal journal EXT3-fs (loop0): mounted filesystem with ordered data mode   What should I do?

Today, on my Centos server I tried to add a user but got the following error:  -bash: /usr/sbin/useradd: Input/output error   How do I fix it?


I want to write IRC Twitch bot. I have never used Pirc library before, so i wrote this simple bot to get started.   BasicBot class :  public class BasicBot extends PircBot{  public BasicBot(String name){     super();     this.setName(name); }  protected void onMessage(String channel, String sender, String login, String hostname, String message) {      if(message == "2/10"){          sendMessage(channel,"YAYO");       }      System.out.println(message + (message == "2/10"));  } }   but when message 2/10 appears on chat this is what i see in console :  2/10false   I don't know why "2/10" == "2/10" is false. I tried also other strings like "banana" or "apple" and result was similar. Please help.

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


I have code like this:  def reverse(text):     l=len(text)     while ((l-1)!=0):         print (str(text[l-1]))          l=l-1     print (str(text[0]))     a=reverse("abc!de@fg")   The output is:  g f @ e d ! c b a   but I want to combine these individual characters and want out put like this:  gf@ed!cba

I'd like to do it in Python. What I'd like to do in this example in C: #include <stdio.h>  int main() {     int i;     for (i=0; i<10; i++) printf(".");     return 0; }  Output: ..........  In Python: >>> for i in range(10): print('.') . . . . . . . . . . >>> print('.', '.', '.', '.', '.', '.', '.', '.', '.', '.') . . . . . . . . . .  In Python print will add a \n or space, how can I avoid that? Now, it's just an example, don't tell me I can first build a string then print it. I'd like to know how to "append" strings to stdout.


Consider a six-sided die with numbers from $1$ to $6$. Imagine you have a jar with $99$ of such dice. You throw all dice on the floor randomly. You look at one of the dice on the floor at a time. For each die, you do the following:   If it landed at an even number $(2,4,6)$, you turn the die so that it lands on the number $1$. If the die landed on an odd number $(1,3,5)$, you throw the die up in the air, so it can land on any number.   After you finish doing the above for all dice on the floor, you come back to the first die and repeat the entire process again. You keep on doing this until eternity (for a billion years, let’s say). If I come into the room after a billion years, how many dice on the floor will have even numbers up?


Ubuntu 14.04 will not start. I can get is far as the Grub menu but when I select Ubuntu I immediately get a black screen and nothing happens. I can boot normally when I use an older Linux version but unity will not work. Any advice?

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


I am working with the Gaussian integral at the moment, and all the proofs I have seen involve a step where it is said that $\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-(x^2+y^2)}dxdy=\int_{0}^{2\pi}\int_{0}^{\infty}re^{-r^2}drdϕ$. I can see why that $might$ be the case, but I don't really understand it. Could anyone explain how exactly one arrives at this result?

Consider the following Gaussian Integral $$I = \int_{-\infty}^{\infty} e^{-x^2} \ dx$$  The usual trick to calculate this is to consider $$I^2 = \left(\int_{-\infty}^{\infty} e^{-x^2} \ dx \right) \left(\int_{-\infty}^{\infty} e^{-y^{2}} \ dy \right)$$  and convert to polar coordinates. We get $\sqrt{\pi}$ as the answer.   Is it possible to get the same answer by considering $I^{3}, I^{4}, \dots, I^{n}$?


I am not a very active member of stackoverflow. My reputation is veeeery low. I've just found an answer to somebody's question, that solves my problem too! But I would like to add a very tiny bit of code (4 chars actually) that the person who answered obviously hadn't thought of. Well, I can't post a comment with my extra piece of code because of my low reputation. I can edit his answer though! But not quite... I have to add more than 6 characters (or something).  So my only option is either to leave his post as is, or add my 4 characters inside his code and also add some crappy sentence below, explaining why I did this. In my humble opinion, this doesn't make sense.  Thank you for you time.

I have been reading Stack Exchange for years - mostly not logged in, and have never posted (this is my first). I'm simply not very talkative, and very good at googling.  Recently a few occasions have come up when I've wanted to comment on a question.  I wanted either to ask for, or provide, clarification which did not warrant a new answer.  How do I gain enough reputation to comment without:   asking questions which have already been answered or that I can figure out on my own, or posting my comment like as an answer (i.e. being  rude)?


An error occurred while checking for updates in my PC. Terminal and software updates are not opening.

I am a new Ubuntu user running Ubuntu 13.04.  I've been trying to install and use a DeDRM tool, but I've been having problems doing so. I was following some directions that said I needed a version of Python 2.7, but not anything Python 3.0 or later (because 3.0 versions are missing some necessary libraries?). I tried to install Python 2.7.5.6, but it didn't work. I thought it was probably because I had the later version of Python, so I went through terminal and removed Python 3.3, so I could install the earlier version of Python.  Now that I've uninstalled Python 3.3, a lot of applications no longer work, including the terminal and the Ubuntu Software Center. I have no idea how to fix this problem now.


I need to set 3 columns (idUser, idLab, idProfile) as identity, but when I change one of them all the others set identity as "No" and only the latest one sets to "Yes".  Already checked its data type and all are set to "int"

I need to have one column as the primary key and another to auto increment an order number field. Is this possible?  EDIT: I think I'll just use a composite number as the order number. Thanks anyways.


Is using   import java.util.*   not favorable compared to calling on the specific packages? I was wondering if its significantly inefficient to a program to call on all the packages, rather than listing them out specifically such as:   import java.util.Scanner;  import java.util.Math;   etc. I am preparing for interviews and want to make sure I have good coding practices.

It is much more convenient and cleaner to use a single statement like  import java.awt.*;   than to import a bunch of individual classes  import java.awt.Panel; import java.awt.Graphics; import java.awt.Canvas; ...   What is wrong with using a wildcard in the import statement?


I am currently learning Recursion with Micheal.T.Goodrich's "Algorithm and DataStructure with Python". The author suggests a better approach to computing the nth Fibonacci number using recursion without the space complexity of the usual approach. But I just can't wrap my head around the intuition of the program. Can someone explain this:  Normal Recursive function to find nth Fibonacci number  def Fibonacci(n):     if n < = 1:        return (n)     else:        return Fibonacci(n - 1) + Fibonacci (n - 2)           Optimized solution:  def Fibonnaci(n):     if n <= 1:        return (n, 0)     else:        (a, b) = Fibonacci(n - 1)        return (a+b, a)  Can someone help me in understanding the optimized solution?

I had originally coded the program wrongly. Instead of returning the Fibonacci numbers between a range (ie. startNumber 1, endNumber 20 should = only those numbers between 1 & 20), I have written for the program to display all Fibonacci numbers between a range (ie. startNumber 1, endNumber 20 displays = First 20 Fibonacci numbers). I thought I had a sure-fire code. I also do not see why this is happening.  startNumber = int(raw_input("Enter the start number here ")) endNumber = int(raw_input("Enter the end number here "))  def fib(n):     if n < 2:         return n     return fib(n-2) + fib(n-1)  print map(fib, range(startNumber, endNumber))   Someone pointed out in my Part II (which was closed for being a duplicate - ) that I need to pass the startNumber and endNumber through a generator using a while loop. Can someone please point me in the direction on how to do this? Any help is welcome.    I'm a learning programmer and I've run into a bit of a jumble. I am asked to write a program that will compute and display Fibonacci's Sequence by a user inputted start number and end number (ie. startNumber = 20 endNumber = 100 and it will display only the numbers between that range). The trick is to use it inclusively (which I do not know how to do in Python? - I'm assuming this means to use an inclusive range?).  What I have so far is no actual coding but rather:   Write Fib sequence formula to infinite Display startNumber to endNumber only from Fib sequence.   I have no idea where to start and I am asking for ideas or insight into how to write this. I also have tried to write the Fib sequence forumla but I get lost on that as well.


I used a lightning:fileUpload to insert a file into the Attachment object: <lightning:fileUpload       recordId="{!v.patientId}"       aura:id="fuploader"      name="files"       multiple="false"       onuploadfinished="{!c.handleUploadFinished}"/>                               The insertion happens fine, a progress bar opens and file is uploaded to attachment and I am getting the id of the created attachment. The problem is, I want to open the file outside of the salesforce (ie, for people who are not logged into salesforce). After some research, i found out that  and  can be used to create a public url for files. So, my question is how can I generate public url for an attachment using ContentVersion or is there any other way to do that?

I am trying to get the image addresses from Salesforce Files using the following query in workbench. There are thousand files, but no results are displaying.  Select Id, ContentDocumentId, ContentDownloadUrl, DistributionPublicUrl  from ContentDistribution  where ContentDocumentId='0691000000FOq3nAAX'`   The result I would like to achieve is the address a user gets each time he/she right-clicks an image and click the Copy Image Address option.  Would appreciate if someone could help me with this inquiry.


I have Drupal version 9.1 but the  module is not available for Drupal 9.x, so I need to downgrade to the latest version of Drupal 8.x. Is it possible to do that through Composer?

Given I have Drupal 9 composer installation with composer-patches plugin and given a contrib module with a stable v8 release, but no v9 release (not even dev branch) and given that contrib module has a working v9 patch in the issue queue  is there any method to install that module + patch in composer? Even if I manually add both, the package and patch, to my composer.json, I still can't require or update this module with composer due conflicting versions. I really want to avoid duplicating /contrib code into my project's /custom codebase. My current workaround is:  forking that module to my own, private git repo applying patch there creating a new composer.json in my private git, and changing the package vendor to my custom_private_vendor adding my private git as VCS repo in the D9 project's composer.json and then composer require custom_private_vendor/contrib_module  This fulfills my goal of not duplicating the contrib module in my project's custom codebase, but every time I do this I feel the urge to wash my dirty hands. Is there something more elegant like composer require drupal/contrib_module --apply-patch-first or can I somehow target drupal.org's git with a specific patch included?


I'm a member of the community (StackOverflow).  This community is here to discuss that community.  Why, even though I'm a 10k+ user on the real community, am I treated like a second-class citizen here?  It seems kind of cliquey.  I want to volunteer my time to StackOverflow, but not usually through meta discussions.  But when something hinders my ability to work on SO, I want to be able to discuss it here without being stifled.  I also understand that this community has unique considerations from a moderation standpoint.  An SO moderator might not make a good meta.SO moderator.  I suggest we draw a line between permissions that facilitate participation and those that facilitate moderation.  Here are the ones I think primarily facilitate participation:   Leave comments Vote up Flag offensive Edit community wiki posts Vote down Show total up and down vote counts (because it allows you to guage the actual popularity of an opinion).   Allowing anybody to leave comments was a great first step.  My proposal is that the above permissions would either be granted to all people who have the equivalent permission on SO (or even another sister site?) or to all people (i.e. no rep requirement).  Incidentally, since votes in SO often are used to guage the popularity of a suggestion, I don't think there should be penalties for downvoting but that's another, related topic.  It just makes no sense to me that you can have people that have full participation rights on meta.SO even though they have never really participated on SO, meanwhile I'm a very active member on SO and am hindered from talking about it here.  It's like having a town hall meeting but only inviting the people who hang around town hall.    To sum up some of the comments, in reality much of what I'm talking about you already get from account association so I'd be totally satisfied if we lowered the vote down and vote split rep requirements to 100.

Honestly, I feel handicapped not being able to edit other people's posts here on Meta (and until recently could not even retag questions).  Why does our hard-earned reputation on SO not count in Meta?  There are already a lot of questions that need editing, and there are practically no users (aside from the mods) that can do that at the moment.  The  question itself contains so many spelling and grammatical errors that it's down right irritating not being able to edit it (on SO it would have been cleaned up in two seconds).  There should definitely be some conversion rate - or at least just carry over the privileges, if not the rep itself.


Two women rescued a child who was kidnapped by his neighbour.   or     Two women rescued a child who had been kidnapped by his neighbour.   Which one is correct and why?

Which is correct to use in the following example, simple past or past perfect?        We were completely in the dark after the wind blew the candle out.   We were completely in the dark after the wind had blown the candle out.


I am looking for an adjective that can be used to describe something that is somewhere between ephemeral, transient or temporary and persistent, permanent or continual in length of time. That is, I want to give the impression that something can last for a while (not fleeting), but that can change at any time and can or will have an ending. Thus even persistent sounds too permanent for what I'm looking for.   Some ideas I've come across so far that seem too long / too permanent:  preserved, protracted, prolonged, lasting, long-lived (maybe medium-lived?), durable. And some that I think are potential candidates: retained, sustained, maintained, stable, durational. My current favorite is durational, which seems to give the right feel. On the other hand, it feels awkward to me when I use it in a sentence. I'd love to hear other suggestions or recommendations.  Also, please let me know if you agree or disagree with my interpretation of the choices mentioned here or in the comments.    I'm looking to contrast a temporary selection (like a user doing a mouseover or hover to see a tooltip) with a durational selection that implies the user has chosen some things to look at for a time, but may modify that selection at any time as they desire.  So which of these sound like something that will last a while, but you're free to modify or delete or undo whenever you like:   a retained selection a sustained selection a maintained selection a stable selection a durational selection an impermanent selection a semi-permanent selection an epochal selection (ok that does sound long!)

Is there an adjective that is somewhere between near and far?


I would like to get the page count in my LaTeX document such that I do not need to do manaually do it.  Pseudocode  \documentclass{article} \usepackage{hyperref} \begin{document}  Page count: % TODO here  \end{document}   Doing the thing with \usepackage{lastpage} ... \ref{LastPage} puts a hyperlink (blue) there, output in Fig. 1.  I want it without the hyperlink and in black.   Fig. 1

I want to add a footer to my document displaying the current number out of total number of pages. How do I do that?


When rendering my mesh, I noticed that not all the textures for the body are the same as they are in the 3D view. In my body mesh, there are two textures- one for the head, and one for the rest of the body. The head texture shows up fine during rendering, but the body texture appears to have its UVs somehow warped.        As you can see from the body texture on render, the body texture IS being used to texture the body since the blue on the arm is present (not found in the face). However, it would appear that the UVs are different on render than in the 3D view. Any ideas?

I'm noticing a significant difference between when my objects are observable in the 3D View and when the objects are rendered.  Both objects have a material with toon settings and each have materials (incorrectly?) added to the object. the human mesh has separate textures for the head and body. The sword and the human mesh both have mapping > coordinate set to UV and Mapping > Map set to UVMap, however only the head texture seems to show up properly, and the sword texture doesn't show up at all.


There's a sentence within a novel that I don't understand. Can you break it down for me?     The boy with fair hair lowered himself down the last few feet of rock   and began to pick his way toward the lagoon. Though he had taken off   his school sweater and trailed it now from one hand, his grey shirt   stuck to him and his hair was plastered to his forehead. All round   him the long scar smashed into the jungle was a bath of heat   What scar? Is the scar "the bath of heat"? Why does it say all round and not "all around"?

All round him the long scar smashed into the jungle was a bath of heat.   English is my second language, my first language is Spanish.  I don't understand this sentence at all. Please explain.


My study involve 73 subject. I want to carry out a multiple linear regression in order to form a predicting formula. However my dependent variable is not normally distributed according to a normality test. It is close to normal distirubtion in the p-value of normality test and it looks like normal distributed data in histograms.  In this case should I continue using multiple linear regression or Should I transform the variable/using non-parametric regression method?  If I can continue using multiple linear regression, is there any statistical journal that I can cite for explaining why I can do that? Do you have some key words that I can google for?

This issue seems to rear its ugly head all the time, and I'm trying to decapitate it for my own understanding of statistics (and sanity!).   The assumptions of general linear models (t-test, ANOVA, regression etc.) include the "assumption of normality", but I have found this is rarely described clearly.   I often come across statistics textbooks / manuals / etc. simply stating that the "assumption of normality" applies to each group (i.e., categorical X variables), and we should we examining departures from normality for each group.   Questions:     does the assumption refer to the values of Y or the residuals of Y?  for a particular group, is it possible to have a strongly non-normal distribution of Y values (e.g., skewed) BUT an approximately (or at least more normal) distribution of residuals of Y?   Other sources describe that the assumption pertains to the residuals of the model (in cases where there are groups, e.g. t-tests / ANOVA), and we should be examining departures of normality of these residuals (i.e., only one Q-Q plot/test to run).  does normality of residuals for the model imply normality of residuals for the groups? In other words, should we just examine the model residuals (contrary to instructions in many texts)?  To put this in a context, consider this hypothetical example:   I want to compare tree height (Y) between two populations (X).   In one population the distribution of Y is strongly right-skewed (i.e., most trees short, very few tall), while the other is virtually normal  Height is higher overall in the normally distributed population (suggesting there may be a 'real' difference). Transformation of the data does not substantially improve the distribution of the first    population.  Firstly, is it valid to compare the groups given the radically different height distributions? How do I approach the "assumption of normality" here? Recall height in one population is not normally distributed. Do I examine residuals for both populations separately OR residuals for the model (t-test)?     Please refer to questions by number in replies, experience has shown me people get lost or sidetracked easily (especially me!). Keep in mind I am not a statistician; though I have a reasonably conceptual (i.e., not technical!) understanding of statistics.  P.S., I have searched the archives and read the following threads which have not cemented my understanding:


I am trying to determine the distance between object being photographed and the mobile camera which is capturing the photo. The only device that is used is mobile phone, can we get depth or distance value from sensors?

I came across an application that:     [...] shows the distance to objects seen through the camera lens of your   [device]. Simply aim your [device] to any object in your   surroundings, and [the application] displays the distance towards that   object on top of the camera image. [...]      How does it work? [The application] uses the height of the camera lens and   its tilt angle to calculate the distance to the object.   I am confused. How does the height of a camera lens and a tilt angle allow to calculate a 3D distance? I thought that a point on a 2D space (what a camera sees) represents a line in 3D so it's impossible to calculate real distance with 1 camera and no objects of reference.


When the Oathbreakers did not come to Isildur's aid as they had sworn to do, Isildur cursed them to be bound to Middle-Earth, unable to leave even after death until they fulfil their oaths to his line.  The Gift of Man is Illuvatar's blessing to grant to all mankind, good or evil. How is Isildur able to deny Illuvatar's gift to the Oathbreakers simply because of some earthly oath made to a royal Númenorean who possesses no divine power?

The swarms of dead men fighting for the good side always seemed wrong to me. I know they did it to be released from their plight, but.... It's one thing to curse somebody, it's quite another to back it up. How did Isildur back up his curse on the oath breaking men of Dunharrow?


I want create an object-like macro from the concatenation of token and macro. I have this code:  #define alfa vita /* Code below is broken. */ #define gamma delta##alfa gamma   The gamma is replaced with deltaalfa. I want it replaced with deltavita. How can I do this?  I don't want the gamma to be a function-like macro.     This question is very broad. It isn't focused on my problem and the first answer doesn't address it either.

As mentioned in many of my previous questions, I'm working through K&R, and am currently into the preprocessor. One of the more interesting things — something I never knew before from any of my prior attempts to learn C — is the ## preprocessor operator. According to K&R:     The preprocessor operator ##   provides a way to concatenate actual   arguments during macro expansion. If a   parameter in the replacement text is   adjacent to a ##, the parameter is   replaced by the actual argument, the   ## and surrounding white space are   removed, and the result is re-scanned.   For example, the macro paste   concatenates its two arguments:      #define  paste(front, back)  front ## back      so paste(name, 1) creates the token   name1.   How and why would someone use this in the real world? What are practical examples of its use, and are there gotchas to consider?


In a recent document I'm working on, when using certain math symbols they are duplicated over themselves:    This happens exclusively when I use \bm{}. It happens in inline math, equations, and aligns. Has anyone else seen this happen?  Here are the relevant packages I'm using  \usepackage{amsmath,amssymb,amsfonts} \usepackage{bm}   And also the documentclass from .  \documentclass{aes2e}   EDIT: Here is a MWE  \begin{equation}     \text{bm: }\bm{x}\quad\text{boldsymbol: } \boldsymbol{x}\quad\text{regular:} x \end{equation}     Edit 2: Thanks to everyone for your help, this is indeed a duplicate question. After searching through the journal of interest it appears that nobody uses \bm or even \boldsymbol, but instead they use \mathbf. This leaves me with a bit of a problem for bold symbols as the duplication still happens, even with \pmb. My current solution is from  which suggests switching to CM for greek symbols, but it looks less bold than Times.

When I using the \bm package, all the letters are overprinting like below.  I could not find the problem.


Is it possible to view an array in the Visual Studio debugger?  QuickWatch only shows the first element of the array.

If you have a statically allocated array, the Visual Studio debugger can easily display all of the array elements.  However, if you have an array allocated dynamically and pointed to by a pointer, it will only display the first element of the array when you click the + to expand it.  Is there an easy way to tell the debugger, show me this data as an array of type Foo and size X?


I have a new Linux utility that I'd like to get a small handful of folks to try out...   It would be appropriate for the readers on ServerFault.   But, I don't think it meets the guidelines for posting on that site.  Where would it be appropriate to post this?

Stuff like polls, recommendations based on subjective constraints, puzzles, webcomics etc. do not belong on the serious main SE sites, where professionals should be considered at work and having just a few spare minutes ("code's compiling") to answer questions, so they should not be distracted by such things. However, I'd also like to have a home for these things still using the SE engine. For the reason I mentioned before, this needs to be a separate place though. Let's call it four.[sitename-here].com.


Let $f,g$ be entire functions on $\mathbb{C}$. If $|f(z)|\leq |g(z)|$ for all $z\in\mathbb{C}$, then prove there exists constant $c$ such that $f=cg$.   I have no idea... I intend to apply Liuville Theorem but this requires $f/g$ to be an entire function. Is there any version of improved Liuville Theorem?

Suppose $f:\mathbb{C}\rightarrow\mathbb{C}$ is an entire function. Let $g:\mathbb{C}\rightarrow\mathbb{C}$ be an entire function, which has no zeros.    I have shown that $\vert f(z) \vert \leq \vert g(z) \vert$ for all $z\in\mathbb{C}$ implies $f(z)=Cg(z)$ for some constant $C\in\mathbb{C}.$  I have to decide if this also holds if $g$ is allowed to have zeros. Help?


In the following python script, why the second assert goes through (i.e., when adding 0 to 257 and stores the result in y, then x and y become different objects)? Thanks!  x = 257 y = 257 assert x is y  x = 257             y = 257 + 0 assert x is not y

Why does the following behave unexpectedly in Python?  >>> a = 256 >>> b = 256 >>> a is b True           # This is an expected result >>> a = 257 >>> b = 257 >>> a is b False          # What happened here? Why is this False? >>> 257 is 257 True           # Yet the literal numbers compare properly   I am using Python 2.5.2. Trying some different versions of Python, it appears that Python 2.3.3 shows the above behaviour between 99 and 100.  Based on the above, I can hypothesize that Python is internally implemented such that "small" integers are stored in a different way than larger integers and the is operator can tell the difference. Why the leaky abstraction? What is a better way of comparing two arbitrary objects to see whether they are the same when I don't know in advance whether they are numbers or not?


I'm pretty new to Java and this website, and I'm sorry if this question has already been asked  but if it isn't to hard, an answer would be extremely helpful.

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.


My daughter and I are dual citizens (US and German).  When we book a flight to Germany from the USA, the airline asks for passport details.  I understood to use the passport that lets you legally enter.  Thing is, it's a round trip so does it matter which one I reserve ticket with?   At the US airport counter - show German passports. Exiting Immigration, if checked - show US Passports. Arriving Immigration Germany - show German Passports.  My wife is US citizen only, can she use the EU line with us?  At German airline check in - show US Passports. Departing Immigration - show German Passport. Arriving Immigration - Show US Passport   Looking for confirmation of above and thought on the online ticket reservation details from anyone who knows or is familiar.

I am a citizen of two different countries, and have two passports.  How should I use my passports when traveling?


Say that there is a time based workflow on creation which updates something after 1 day. Two records are created via two different API calls (say we exposed a REST service), these two different calls may be very close in time. They trigger two separate transactions but what happens when the time-based workflow expires? Is there any circumstance in which we would have 1 transaction with 2 records?

The environment setup is as follows: 1) there is a workflow triggered by some criteria which has a time dependent action which will update a field on the object. 2) With apex-code I update a List of 10 of such objects so that the criteria will fire for all of them  When the time countdown expires, will there be 10 different transactions or will there be 1 transaction with the 10 objects?


X unbiased coins. What is the probability that half of them exactly are heads. Please answer question where X= 20, 30, and 20000.

A question in probability by a non-mathematician:  A fair coin is tossed $2N$ times. Is it unlikely that we get exactly $N$ heads and $N$ tails?  From one side, this must be the most likely result! But intuitively, if someone reports to me that they threw 2,000,000 coins and got exactly 1,000,000 heads and 1,000,000 tails I would be a little suspicious.  If this really is suspicious, how does it compare to biased results? Obviously, 2,000,000 heads is a much more suspicious result. But, for what value of $K$ is $N+K$ heads and $N-K$ tails as suspicious as $N$ heads and $N$ tails?  Equations are very welcome, but please try to provide some aid in understanding them.  ADDED: Henning Makholm's answer helped me understand better what I want to ask: I always assume a fair coin and would like to compare the probability of the split N/N with the probability of getting either more than more than N+K or less than N-K heads. By ncmathsadist's answer , the probability for the N/N split goes like 1 over the square root of N.  What about the probability to get more than either more than N+K or less than N-K heads? For what value of K (approximately) does it equal to 1/sqrt(n pi)?  CLARIFICATION: If f(N) is the probability to get an N/N split in 2N tosses of a fair coin, and g(N,K) is the probability to get more that N+K heads or less than N-K heads in 2N tosses of a fair coin, then I am asking for a formula which, given N, approximates the values of K for each f(N) is closest to g(N,K). This is a formula that takes N and returns K so we can call it h(N)=K. Which kind of function is h? My guess from a little experementing with the online software in Brian M. Scott's answer is that the function h is apporximately the SQRT function, multiplied by some constant, or something like that.


I want to know how I can parse a website using VB.net. Basically There is a table in a page that I need to update the database with what is inside it. So I need to be able to capture whatever is within   and then get all the columns and rows and put them in a datatable object. Any help is appreciated

I would like to know if there is a simple way to parse HTML in vb.net. I know that HTML is not sctrict subset of XML, but it would be nice if it could be treated that way.  Is there anything out there that would let me parse HTML in an XML-like way in VB.net?


I went on a locked post like  one. I tried to upvote one of the comments, and this error message popped up.  I tried flagging one comment.  It actually worked! I flagged it! I think you should disable flagging, or change the error message.  PS: Sorry mods, please ignore this useless flag. I was just testing.

When trying to upvote a comment made on a locked post (ordinary lock, not historical lock which remove the vote arrows and flag altoghether) we are greeted with such error message:        Or in words:     This comment is not eligible for voting or flagging   Being the curious type, I went straight away and tried to flag, fully expecting the same message... just to see the flag dialog open up just fine:        I was able to flag as well.  Can the error message please be changed to just "This comment is not eligible for voting"? Or of course, if it's not the intended behavior really disable the option to flag?  The original post on which I experimented is now deleted, but  you can play with.


We have a client who is FINALLY convinced to convert their site / web-based application to responsive.  Our biggest issue right now is how to handle their extensive data tables.  The biggest offender is the results page (they provide results data for sporting events around the world).  Columns include: Country, name, class, event, category, score / result, region, discipline (maybe more).    Our first idea was to just switch to content blocks on mobile and move the labels in front of or on top of their pertaining data.  Is there a better way?  Go easy on me. I'm just a designer trying to solve a UX issue! :D . I don't speak code.  Thanks!

I am doing a proof of concept with responsive design. One web page that I am modifying has some extremely wide tables. I really don't know how to shrink the tables width so there is no horizontal scroll bar in a mobile browser.  I was just wondering if anyone had the same issue with wide tables and what they did to overcome a horizontal scroll bar in a mobile browser using responsive design. Oh and I wanted to add that I can not hide columns in the table.


I was tasked with combinatorically evaluating the sum $\sum_{k=0}^{n} (-1)^k \frac{1}{k + 1} {n\choose k}$. Evaluating it computationally tells me the answer converges to approximately $\frac{1}{n + 1}$, but I don't know how to prove this with combinatorics. Can someone help?

Find the value of $\sum_0^n \binom{n}{k} (-1)^k \frac{1}{k+1}$.  Writing out several terms, I think the answer is $1/(n+1)$, but I'm struggling to prove this. I would greatly appreciate it if someone could show how to prove this.


Please excuse me if I am not clear while asking questions. I will try my best to be very clear while asking questions.   While learning Embedded Linux, we are setting an environment for our project. We wrote a shell script to set the environment which is similar to this:  export PROJECT=example-sys export PRJROOT=/home/karim/${PROJECT} export TARGET=powerpc-linux export PREFIX=${PRJROOT}/tools export TARGET_PREFIX=${PREFIX}/${TARGET} export PATH=${PREFIX}/bin:${PATH} cd $PRJROOT   Saved the script as prjenv.sh. As I practiced running the scripts or any executable using ./xyz.sh or ./abc, I ran ./prjenv.sh and the shell did not complain but when I gave export -p to see if the variables were exported or not, I could not find them in the list.  Later I noticed, I was expected to use . prjenv.sh, after I ran the script, it set the environment variables.  May I know what is the difference between . and ./ and when to use which one?  Please let me know if you need more information.  PS: This is my first time working with Linux so I apologize if some of the technical terms I used are wrong.

Possible Duplicate:          I was trying to figure out how to export my environmental via script instead of changing my .bashrc file.   I found  that said:     Variables can only be exported to subordinate processes, you can't   pass them back up to the parent. If you really want your script to   affect the parent shell's environment, run the script as  . ./yourprogram    I just want to know what the difference is between . ./script and ./script?  When I look at it, they booth mean to me, run the script from the current directory?


I have seen this definition of expectation of a nonnegative random variable in many places. I do not quite understand how it is gotten. $$E[X]=\int_0^{\infty}P(X>t) dt $$ I know $E[X]=\int_0^{\infty}x f(x) dx $ This is used to prove the basic version of markov inequality

I'm taking an intro course in Probability theory, and we have just defined expectation for a random variable as $E(X) = E(X^+) - E(X^-)$ if either of them is finite (extending the definition first from simple positive rv to positive rv, and then to all rvs, positive or not).  Then I came across this result for the expectation of a positive random variable. Let $(\Omega, \mathcal{F}, P)$ be a probability space and $X \ge 0$ be a positive rv:  $$ E(X) = \int_{\Omega} X dP = \int_\Omega \int_0^\infty \mathbf{1}_{\{X > t\}} dt  \, d P = \int_{0}^\infty P(X > t) dt. $$ Actually, I'm familiar with this result, and the proof I've seen before involves converting $\int^\infty_0 P(X > t) \, dt$ to a double integral. What I'm struggling with is the step $ \int_{\Omega} X dP = \int_\Omega \int_0^\infty \mathbf{1}_{\{X > t\}} dt  \, d P $, and also the formal definition of an expectation itself.   I have no previous with integration or a "hard analysis" background, and the material covered so far in the course I'm taking has only used $\int_\Omega X dP$ as a notational device for $E(X)$. In general, any pointers to literature or "intuitive" explanations are more than welcome.  Thanks in advance!


Voldemort's plans all seemed to be focused on the wizarding world in the UK, mainly on trying to deal with Harry Potter and gain freedom.   Did Voldemort have ambitions beyond controlling the UK? If he had been successful at taking out Harry and taking over Hogwarts would he then have turned his eyes to Europe and beyond?

Did Voldemort ever plan to extend his rule to the other wizarding societies outside of Great Britain and then eventually topple the International Statue of Secrecy and take over the Muggle world as well?


Find the sum of the series $ \sum_{n=1}^{\infty} \frac{n^2}{n!} $ $My \ attempt :$ $$   \sum_{n=1}^{\infty} \frac{n^2}{n!} \\  = \sum_{n=1}^{\infty} \frac{n}{(n-1)!} \\  = \sum_{n=0}^{\infty} \frac{n+1}{n!}  = \sum_{n=0}^{\infty} \frac{1}{(n-1)!} + \frac{1}{n!} $$ But I don't know if this will take me anywhere.

Evaluate the limit of:  $$\sum_{n=1}^{\infty}\frac{n^2}{n!}$$  Hints I am given:  1- The exponential series of type $\sum_{n=0}^{\infty}\frac{x^n}{n!}$ converge into $e^x$ for any $x\in R$  2- Any series of type $\sum_{n=0}^{\infty}\frac{P(n)}{n!}x^n$ , being $P(n)$ a polynomial of any level and $\forall x\in R$, it also converges.  3- $\sum_{n=1}^{\infty}a_{n-1}=\sum_{n=0}^{\infty}a_{n}$  What is the limit of this series?  According to the hints it is convergent, this is what I tried so far:  $\sum_{n=1}^{\infty}\frac{n^2}{n!}=\sum_{n=1}^{\infty}\frac{n^2}{n(n-1)!}=\sum_{n=1}^{\infty}\frac{n}{(n-1)!}$  Applying hint 3:  $\sum_{n=0}^{\infty}\frac{n+1}{n!}$  Split the series in 2:  $\sum_{n=0}^{\infty}\frac{n+1}{n!}=\sum_{n=0}^{\infty}\frac{n}{n!}+\sum_{n=0}^{\infty}\frac{1}{n!}$  Applying hint 1, with $x=1$ to the second part:  $\sum_{n=0}^{\infty}\frac{n+1}{n!}=e+\sum_{n=0}^{\infty}\frac{n}{n!}$  I dont know how to keep going, I know that the series $\sum_{n=0}^{\infty}\frac{n}{n!}$ converges into $e$ therefore the result of the whole series is 2 times $e$ but I dont understand why!


I've been having a problem on my new laptop recently which is familiar but baffling the usual fixes. I'm running Windows 8 with an onboard Realtek soundcard. It's similar to the one on my older computer running Windows 7.   The problem is, when I'm in Skype or Mumble, Windows changes the sound output to lower everything else automatically. I've disabled the communications sound change option on the communications tab within sound devices and checked all the applications settings to insure that they are not responsible. They aren't, and I noticed something else. When I'm in the sound properties dialog, and I switch to the microphone tab, the same audio output reduction occurs. This seems to say to me that the microphone must be responsible in some way, but seeing as I uninstalled all the drivers and installed windows drivers instead, I'm confused as to why this would be occurring.   Any thoughts?  EDIT: I just tried disabling the built in microphone and the sound no longer get changed. More confused now? As soon as I turn it back on, the sound gets dropped again.  Incidentally, the fix for this on windows 7 was this question:  I've got my computer set that way and it doesn't work.

OS: Windows 8.1  I'm noticing that when playing something from VLC (though it happens when playing audio from Chrome) that my sound will pseudo-randomly become quiet.   Chiefly it happens on the 'new tab' screen of google chrome, as well as google searches through windows chrome. It will occasionally happen when I open other applications - though I've not yet found any rhyme or reason to it.  Device is the built-in realtek device through my headphone jack, driver is most current according to their website.   Not really sure how to diagnose or fix this. Help appreciated.  EDIT: Logging in as a different user fixes the issue. Disabling all extra chrome extensions does not. Still looking for a solution for my regular user account.  Related:   List of things causing the issue:   Chrome Launching a windows 7 virtualbox VM (not VBox manager though) Mumble Will update with more as found NOT Foobar2000 (I had suspected the issue may be coming from applications that play sound?) Installed Skype to test, during the initial 'setup' of my account (for sound/mic/video) my audio was hushed, despite that I have the 'communications activity' set to 'do nothing'.


When I'm typing my own documents, it's often the case that an awkwardly placed theorem environment near the end of the page will jump to the next because it's too large to fit in one page. When this happens, a large blank space is created at the end of the first; of course, this looks remarkably ugly.  In particular, consider the following image:    As a stylistic choice, I don't want to allow the theorem boxes to split across pages, which causes the following problem.   On the other hand, I noticed that no author has this problem in their books; they somehow always manage to fit their environments and text in such a way that every page is filled to the brim (so to speak) and no theorem environment is broken across a page. My question is: how do these authors do this? Is there a way to remedy the situation above automatically, or do I have to manually fill in the gap with extra content?   Thanks.  Edit: An example as suggested in the comments:  \documentclass{article} \usepackage{lipsum} \usepackage{amsmath} \usepackage{amssymb} \usepackage[margin=4cm,includefoot]{geometry}  \usepackage{newpxtext} \usepackage{newpxmath}  % theorem styles \usepackage{mdframed} \usepackage{xcolor}  \mdfsetup{skipabove=5pt,skipbelow=5pt,nobreak}  \definecolor{pale}{HTML}{FFB5CE} \definecolor{redbrown}{HTML}{A52A2A}  \mdfdefinestyle{paleStyle}{%     linecolor=pale,     backgroundcolor=pale,     innertopmargin=0pt,     innerbottommargin=10pt,     innerrightmargin=10pt,     innerleftmargin=10pt,     frametitleaboveskip=5pt,     font=\itshape }  \mdtheorem[style=paleStyle, frametitleaboveskip = 10pt, frametitlebelowskip = 10pt, frametitlefont = \normalfont\large\fontfamily{pag}\selectfont, theoremseparator = {\quad}]{MDtheorem}{Theorem}   \newenvironment{theorem}[1][]{     \ifstrempty{#1}{\begin{MDtheorem}}{\begin{MDtheorem}[#1]} }{%     \end{MDtheorem}% }% \newenvironment{theorem*}[1][]{     \ifstrempty{#1}{\begin{MDtheorem*}}{\begin{MDtheorem*}[\normalfont#1]}% }{%     \end{MDtheorem*}% }%   \begin{document}  \lipsum[1-4]  Another strip of text another strip of text Another strip of text another strip of text Another strip of text another strip of text another strip of text another strip of text another strip of text another strip of text   \begin{theorem}[Riemann Hypothesis] \lipsum[2] \end{theorem}  \end{document}   In this case, I have the "nobreak" setting on, so the theorem environment is forced to the next page, leaving a large white space below the text.

How to influence the position of float environments like figure and table in LaTeX?   This is a general question and should collect useful answers for all users. I hope we can use this as a reference


Trying to get this script to work how ever I get an error no matter how I try to set the varibles. After checking the varibles are not being set from the files that the information is in.

Trying to get this bash script to work:  #!/bin/bash  for result in $(cat ./fn7); for dip1 in $(cat ./fn4); for dip2 in $(cat ./fn5); for dip3 in $(cat ./fn6); for ip in $(seq 0 255); ifconfig > ./fn1; cat ./fn1 |grep "broadcast" > ./fn2; cat ./fn2 |cut -d " " -f10 > ./fn3; cat ./fn3 |cut -d "." -f1 > ./fn4; cat ./fn3 |cut -d "." -f2 > ./fn5; cat ./fn3 |cut -d "." -f3 > ./fn6; echo $dip1.$dip2.$dip3. > ./fn7; ping -c 1 $result.$ip > ./results   It fails with a error of:  ./IP-Sweeper.sh: line 4: syntax error near unexpected token `for' ./IP-Sweeper.sh: line 4: `for dip1 in $(cat ./fn4);'


In , the OP asked about a recommendation for a set of tools to use LaTeX on a Mac. But that was 4 years ago, and the landscape may have changed.   I'm hoping to install LaTeX on a Mac as well. I have a few idiosyncracies:   I will be working on a book, on homework assigments for a course, and for materials unrelated to each of these. When I work on the book (think "a thousand pages, with diagrams and photos on most pages"), I will want to use certain macros; when working on homework assignments, I'll need to use others; when working on the outside materials, I'll need a third. (Working under Linux, I used to do things like set my TEXINPUTS environment variable to handle this, but that's not so easy to do on a project-by-project bases with something like TeXworks, for instance. I'd prefer an integrated environment if possible. I like things like Kile under linux, in which when you type "\begin{align}" automatically fill in the "\end{align}" for you, and I've found working with Texworks under windows has been OK as well (aside from the problem mentioned above).    I've found that working with XEmacs makes my hands and wrists hurt, so AucTex, nifty though it is, isn't really a good alternative.   Does anyone have suggestions about reliable, well-maintained systems that run on a mac, and which might be well suited to my needs as described above?

What editors/IDEs are available for easing the process of writing TeX/LaTeX documents? Please state some useful features like code completion, spell checking, building final DVI or PDF files, etc.  This question is undergoing a systematic refurbishment, see  on Meta. If you’d like to see another editor feature covered here or to take care of an editor that’s not covered yet, share your ideas in that meta question.  List of editors Links to answers.


I have a continuous dependent variable which has a somewhat skewed distribution and hence I want to apply a log transform to it. But the problem is that the target variable can have negative values.   To counter this, I added the minimum(target variable) +1 to the target variable and then did a log transform. This was done on the training data.   The problem with this approach is that in my holdout data, I can have a value that is lower than the minimum value and in that case, I'll be attempting a log transform on negative data which will return an error.  Is there a way I can log transform a continuous dependent variable that may have negative values without having to bother about them?

If I have highly skewed positive data I often take logs. But what should I do with highly skewed non-negative data that include zeros? I have seen two transformations used:   $\log(x+1)$ which has the neat feature that 0 maps to 0. $\log(x+c)$ where c is either estimated or set to be some very small positive value.   Are there any other approaches? Are there any good reasons to prefer one approach over the others?


What do I have to do to switch from writing in one language (such as English) to another (such as French) on Lubuntu 18.04.1 LTS? I use French and I need to use Arabic.

I was using Ubuntu 16.04. There it was so easy to change the text entry option. Settings > Text entry.  But when I switch to Ubuntu 18.04 I can't find such option. So how can I write in another language? How to change text entry i.e. by super+shift or something like that?


I have a dual-boot system with both Windows 7 and Ubuntu. Windows normally provides me detailed system information like what type of RAM is used. However, I am currently troubleshooting the PC and I cannot currently use Windows. How can I find out using Ubuntu what type of RAM I is being used (DDR2, DDR3, etc.)? Please keep in mind it does not state what type on the RAM cards themselves.

How shall I find out the frequency and type of my current RAM? My OS is Ubuntu 12.04.


Is there a way to kill the current X server using a keyboard combination?  Is it possible to do so without having sudo permissions?

Ctrl+Alt+← can usually be set to restart X, however I can't find the option to allow this (it is disabled by default).  I have looked in System->Preferences->Keyboard and System->Preferences->Keyboard Shortcuts but I can't find an option to enable it.  Where can I change this setting?


I have cron running for rails application on EC2 instance, but it fails with error -   /bin/bash: bundle: command not found   if I run bundle command with ubuntu user or sudo user that works. I have added cron using crontab -e command.  Some Troubleshooting I did (displays same result with sudo as well) -   > which ruby /usr/local/bin/ruby  > which bundle /usr/local/bin/bundle   But if add these command as which ruby and which bundle in crontab and output it over logs, it shows -   Cron has -   * * * * * /bin/bash -l -c 'which ruby >> /home/ubuntu/logs/cron.log 2>&1' * * * * * /bin/bash -l -c 'which bundle >> /home/ubuntu/logs/cron.log 2>&1'   Output -   /usr/bin/ruby /bin/bash: bundle: command not found   so basically my cron is taking wrong ruby from system, what should I do to correct that ? I want to take ruby from my /usr/local/bin/ruby and then it can find bundle as well.  Thanks !!

This is a  about using cron & crontab.   You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question.  The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below.  This addresses the cron system with the crontab highlighted.


I am writing a C program and my operating system is MacOS.  I am wondering how to add a macro in order to compile my C program under different operating system, mainly Windows and Linux?  Thanks a lot for providing me an idea on this question.

I need my code to do different things based on the operating system on which it gets compiled. I'm looking for something like this:  #ifdef OSisWindows // do Windows-specific stuff #else // do Unix-specific stuff #endif   Is there a way to do this? Is there a better way to do the same thing?


I just started using Drupal, so I'm still learning myself how to configure it. I have seen some older tutorials where there's a module(?) installed where you can click on "Hello %user%" in the top right corner and select which user you want to preview the page as. Is there a module for this or some built in setting I have overlooked?

Am loving using Drupal 6 for creating a site with more than one user "type", with different Content Profiles, different Roles with associated Permissions, different access to nodes etc. My current site has 3 different roles - Recruiters, Candidates and a Simple Administrator (as a reduced feature subset administrator, to limit the amount of damage that a non-technical administrator can do to the site, yet still do things like edit the outgoing emails, add/remove users etc).  I was wondering... when I am testing, I am currently using multiple browsers (dev in Firefox, Testing one user type in Chrome, one in ie9) to get around the "current" session issue (you can only be logged in as one user). What techniques do people use to test on multiple roles simultaneously? Is there, for example, a Firefox plugin or something else to isolate different browser based session cookies in different tabs?


I need help showing that $\mathbb{R}$ cross $\mathbb{R}$ is equinumerous to $\mathbb{R}$.  I know that you need to show a bijection, however need help on that part.

Possible Duplicate:             Does $\mathbb R^2$ contain more numbers than $\mathbb R^1$? I know that there are the same number of even integers as integers, but those are both countable sets. Does the same type of argument apply to uncountable sets? If there exists a 1-1 mapping from $\mathbb R^2$ to $\mathbb R^1$, would that mean that 2 real-valued parameters could be encoded as a single real-valued parameter?


A user can click on a button and jQuery will make an ajax request to the server, which will return a form. My problem is, that the form elements like file input or checkboxes lose their default events. I can't check/uncheck the checkbox and the input won't open a file dialog anymore.  Is there any way I can reassign these events to the elements?  I'm not talking about events I wrote myself. Do the standard events have a specific name in jQuery, so I can use .on()?

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


I use  \pgfdeclareplotmark{mymark}   {\shade[draw=none,ball color=green!70] (0pt, 0pt) circle [radius=2pt];}   Why has \addplot3 table [only marks, mark=mymark] no effect?  What have I to do?     \documentclass[tikz, margin=5pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} %\usetikzlibrary{plotmarks}  \pgfdeclareplotmark{mymark}   {\shade[draw=none,ball color=green!70] (0pt, 0pt) circle [radius=2pt];}  \begin{document} \begin{tikzpicture}[] \begin{axis}[] \addplot3[variable=\t, mark=mymark]({t^2},{t},{-3}) node[pos=0.3,above]{marks good};;   \addplot3 table [x=Y,y=X, z expr=0,  only marks, mark=mymark] { X Y  0 2 1 0 } node[right]{marks bad}; \end{axis} \end{tikzpicture} \end{document}

In my MWE below, I am not getting the markers of the plots to colors that I wanted.  Also, I would like to change the red squares in the last plot to cyan circles.  Thanks.  Here is my code:  \documentclass{book} \usepackage{tikz} \usepackage{pgfplots} \usepackage{filecontents}  \begin{filecontents*}{data.csv}   Iter   Abs1   Abs2      x      y      1, 0.9317521, 1.1849326, 1.6130556, 0.8022207      2, 1.8946202, 1.1228282, 1.8964566, -0.5353802      3, 1.5243302, 1.0372991, 1.4375012, 0.9719003      4, 1.5797030, 1.1346832, 1.8717142, 0.3138737      5, 1.8814457, 1.0529187, 2.0568468, -0.5509391      6, 2.0435003, 1.0470546, 2.0621956, -0.3565483      7, 2.0373926, 1.1215579, 2.1836100, 0.3360301      8, 1.9797077, 1.1632352, 1.8299063, 0.3871091      9, 1.9972528, 1.1952478, 1.8133509, -0.0867033     10, 1.8320176, 1.0625633, 1.0727495, 1.7256738 \end{filecontents*}  \begin{document} \begin{tikzpicture} \begin{axis}[width=14cm,height=8cm, title = {\emph{(a) $P_{T}$ over different samples}}, xlabel={$x~Position$},ylabel={$y~Position$}]  % Graph column 2 versus column 0 \addplot+ table[x index=3,y index=4,col sep=comma, only marks,mark=*,mark options={scale=2, fill=white}] {data.csv}; %\addlegendentry{Column 3}% y index+1 since humans count from 1  \end{axis} \end{tikzpicture}  \begin{tikzpicture} \begin{axis}[width=14cm,height=8cm, title = {\emph{(b) RSLE Parameter Errors in terms of Recursions RSLE}},xlabel={$Number~of~Recursions$},ylabel={Absolute Parameter Error}]  % Graph column 1 versus column 0 \addplot table[x index=0,y index=1,col sep=comma, green, only marks] {data.csv}; \addlegendentry{$\delta_{r2}$}  % Graph column 1 versus column 0 \addplot table[x index=0,y index=2,col sep=comma, cyan, only marks] {data.csv}; \addlegendentry{$\delta_{r3}$} \end{axis} \end{tikzpicture}  \end{document}


This code:  \documentclass[twoside,symmetric,notoc,justified]{tufte-book}%  \usepackage[utf8]{inputenc} \usepackage[latin]{babel} \usepackage[OT1]{fontenc} \usepackage{lipsum}   \geometry{   %showframe,   paperwidth=145mm,   paperheight=215mm,   inner=16mm,   outer=10mm,   top=10mm,   bottom=40mm,   marginparsep=3mm,   marginparwidth=40mm,   includemp,   includehead, } \fancyhf{}% \fancyhead[LE]{\bfseries\thepage\quad$\bigg|$\quad\leftmark} \fancyhead[RO]{\bfseries\rightmark\quad$\bigg|$\quad\thepage}  \begin{document}  \tableofcontents  \chapter*{Introduction} \addcontentsline{toc}{section}{\textbf{Introduction}} \lipsum[1-5]  \chapter{Chapter1} \section{Section1} \lipsum \section{Section2} \lipsum \section{Section3} \lipsum \chapter{Chapter2} \section{Section4} \lipsum \section{Section5} \lipsum \end{document}   gives this:   As you see, the headings still show "Index", but it is already "Introduction". How to fix it? I want it to show "Introduction" on the page where it is. Thank you.

I need to display the chapter name with the \chapter* command to the left side of the header. This is one example of what I tried:      \documentclass[12pt,a4paper,oneside]{book}     \usepackage{fancyhdr}     \pagestyle{fancy}     \lhead{}     \chead{}     \rhead{\fancyplain{}{\textit{\leftmark}}}      \begin{document}     \chapter*{\centerline{Chapter Name}}      \end{document}   How can I do this?


Appending to array  How do I append to an array in Javascript

How do I append an object (such as a string or number) to an array in JavaScript?


My uncle warns me to use laptop after charge.But sometimes I use it during charging,like...when I am watching videos or working my homework.I want to know that is that good to use laptop during charge for long??Because I sometimes can't give time to charge battery.So I have to use it in that way.And I don't want my battery to damage.Thank you.

Basically, I'm looking for some do's and don'ts. Is it bad to keep my laptop plugged in when I'm not using it (majority of the time)? Is it bad to plug it in once I've finished using it (with it having something like 30% or 70% life left)?     This question comes up often and the answers are usually the same. This post is meant to provide a definitive, canonical answer for this problem. Feel free to edit the answer to add additional details.


Suppose $M$ is a n-dimensional free module over a commutative ring with identity , is the number of elements in every linearly independent set less than or equal to n?  I have prooven it is right when R is an integral domain. Because the ring has fractional field, then we can proof that the columns of a matrix $A_{n \times m}$ is linearly dependent when $n＜ m$.  This is a classic question:   I really like the answer by Robin: . His proof shows that the columns of a matrix $A_{n \times m}$ over a commutative ring is linearly dependent when $n ＜m$. The most important is that this proof doesn't need other backgroud except pure matrix theory.  P.S:  I also construct an example about a linearly independent element in a 2-dimensional free module over an integral domain can not be expanded to a basis.

I'm trying to prove that if $A\neq 0$ is a commutative ring and there is an injective $A$-module homomorphism $A^m\hookrightarrow A^n$ then $m\leq n$ must necessarily hold.    This is exercise 2.11 from Atiyah and MacDonald's Introduction to Commutative Algebra, but unfortunately all the solutions available online are either very sparse with regard to this question or seem to use (to my surprise) a generalized version of Cramer's rule. Is there perhaps some other "cleaner" approach to solving this problem?


This is a command of a working /give potion. It places a potion of the desired colour in the inventory.  What I'm having a problem with is when putting it inside a chest that I'm spawning, the command does not work. Can you help me? I am trying to put it inside of a shulker box  /give @p minecraft:potion 1 0 {Potion:"minecraft:water",CustomPotionColor:16777215,CustomPotionEffects:[{Id:9,Duration:100}],display:{Name:"Custom Name"}}]}}

I am making a Minecraft Mini Game adventure map, and one of the levels has a /setblock command, I am using the command in a way to spawn an item in a chest (Wooden Button) I need the wooden button to have CanPlaceOn tag so it can be placed on a log. I have tried this command: setblock 294 5 -1251 minecraft:chest 0 replace {Items:[{Count:1,Slot:0,id:minecraft:wooden_button,CanPlaceOn:[log]}]}`


I have a Macbook Air Early-2015 model since 2017. Like 4 or 5 months ago, I updated from High Sierra to Mojave. Initially there was no problem. But after a few weeks my Macbook started to shutdown suddenly at about %15 (in changes time to time, sometimes it can be 5%). And when it is closed, I couldn't open it without connecting charge cable. Because of the quarantine I stuck at home and using it while charger is connected, even it has 100% charge, but not for too long like 1 month or so. But I don't think that's the reason. Anyway. I controlled battery health with coconutBattery and it was about 80-85%, I can't remember clearly, maybe even more, but I'm sure it was not less. Then I did a research and found SMC & NVRAM reset. I did those resets and calibrate the battery by charging to 100% and draining until it shuts down itself. The sudden shutdown problem seemed to be solved, but after a few days the Service Recommended warning started to appear. And when I checked with coconutBattery, it said 55% battery health. Still same value with small changes. I mean, how this can be possible? The cycle count is not even close to its limit, it just have 350 cycle. I have friends who has same computer for more than 5 years and more than 800 cycle without changing the battery and their batteries' health are much better than mine. It seemed like a software problem to me. Before try formatting or downgrading to High Sierra I just wanted to ask you. Thus I won't waste my time by backing up and formatting if it won't make a difference. Now I have to charge it like every 4-5 hours. And I realized that sometimes the battery percentage is going up. Like, I am looking the percentage and it shows 65% and I am going back to my work, write something in Word etc. 5 minutes later when I check that again, it shows 66%. That's odd. I don't want to buy a new battery, I can't spend that much money right now. I apologize for the long text, I just wanted to explain everything :) Thanks in advance.

Recently my Macbook Pro Retina Late 2013 has started to shut down unexpectedly while running on battery. I thought it was because of my CPU was too hot but it was not the case. When checking it further, I found that my battery status is "Service Battery". I used coconutBattery to check and found that the Full Charge Capacity of my Mac is insanely low. I could be sure that it was around 90% last week and suddenly now it dropped to 46.9% of the Design Capacity.    I tried resetting SMC like many other said but unfortunately, it did not work for me. One symptom I saw before having this issue is that my Macbook temperature was quite high. I could feel the obvious difference in temperature between my Macbook and others' at the office when touching my hand on it, I guess my Mac was about 10 degree Celsius higher than others.  Is anyone here had this issue before? Should I replace my battery completely? Is it possible to replace the battery only on this Mac, I think it is nonremovable?


Well I was working on a program using constructors for understanding it and I encountered a problem. Here is the code.Sorry if the code is too long.  import java.util.Scanner;  class Employee {      int id,sal;     String name;     String desig;      Employee()     {         id=001;         name="Paul";         desig="VirtualWorker";         sal=10000;     }      Employee(int def, String message)     {         System.out.println("How to fill in details(Example):");         System.out.println("ID:"+id);         System.out.println("Name:"+name);         System.out.println("Designation:"+desig);         System.out.println("Salary:"+sal);         System.out.println("Default value:"+def);         System.out.println("Default message:"+message);     }      void input()     {         Scanner in=new Scanner(System.in);         System.out.println("");         System.out.println("Welcome to SS Enterprises!");         System.out.println("What is the id?");         id=in.nextInt();         System.out.println("What's the name of employee?");         name=in.next();         System.out.println("What's the designation?");         desig=in.next();         System.out.println("What's the salary?");         sal=in.nextInt();     }      void print()     {         System.out.println("");         System.out.println("ID:"+id);         System.out.println("Name:"+name);         System.out.println("Designation:"+desig);         System.out.println("Salary:"+sal);     }      public static void main(String args[])     {         Employee emp=new Employee();         Employee emp2=new Employee(929,"Message in constructor.");         Employee emp3=new Employee();         emp3.input();         emp3.print();     }        }   when the values of the parameterized constructor is printed in the output, i don't get the values given in the default constructor. I get default values like 0 or null.  Is there any way I can take the values of the default constructor and use it in the parameterized constructor?  Thanks in advance

Is it possible to call a constructor from another (within the same class, not from a subclass)? If yes how? And what could be the best way to call another constructor (if there are several ways to do it)?


I recently fixed an old iMac (early 2008) that was showing lines during boot and then going into white screen, I installed Ubuntu Server first and the problem seemed to have gone away, then i tried installing Debian but it broke it so I reinstalled it with Ubuntu Desktop. The problem seemed to be gone, so then I reinstalled it with OS X 10.9 and updated it up to 10.10 and then 10.11, it ran ok, even supporting Minecraft OptiFine 1.9. Then after shutting it down normally, it started showing lines (sometimes CYMK, sometimes RGB, sometimes black and cyan) again as if I hadn’t done anything. Help?  UPDATE: It seems to work perfectly when i hold the escape key during startup (but not when i don't), im not sure whats going on...? Doesn’t Work anymore, ig I’ll have to turn it into parts

For some reason my iMac keeps turning off around 5 to 10 minutes into boot.  Also just recently it turns on but has shaded lines going down the screen. I have not installed any weird programs and i have not used it in around 3 months.   Any ideas on what the issue is, i don't have any other information about the issue besides whats happening when i use it.  The image i'm showing you was found on google but this looks exactly like mine does.  The model of my imac is the late 2011 model.


This question is as simple as it gets. There's a symbol used for certain polynomials in my area of expertise that I'm completely unfamiliar with, and I'm not sure how to look up the code for the symbol, so I figured I'd ask here.

I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?


Suppose I ask a question which for one reason or another might have multiple valid answers. Maybe it's subjective, maybe it's a problem that could have multiple solutions, maybe there are just different ways to explain the same idea. I get some answers, and one is definitely the most helpful or useful to me, among other good answers. Should I accept it? Or is that bad, because I'd be declaring it to be the one true correct answer?  Note that I'm asking this in the context of StackExchange as a whole, where this is a more common occurrence than on SO. For example, on cooking, a lot of questions can have multiple good answers. Also, I know this is a historically contentious topic, but I'm looking for fresher answers, not pointers to questions from years ago, when we didn't know what to do with subjective questions and didn't have so many diverse sites.

I asked  that turned out to have multiple correct answers. How do I pick between them to determine which to accept?  All of the answers were different. They were not the same answer given multiple times.


Given a series:  $$\frac{1}n+\frac{1}{n+1}+\cdots+\frac{1}{2n-1}$$  What are these types of questions called and what is the strategy for them?   The next step in the solution manual is:  $$\frac{1}{n} \left(1+\frac{1}{1+\frac{1}{n}}+\cdots+\frac{1}{1+\frac{n-1}{n}}\right)$$  And final answer for this specific question is:  $$\int_1^2 \frac{1}{x} \rightarrow \left[\ln x \vphantom{\frac 11} \right]_1^2 $$

What is the sum of the 'second half' of the harmonic series?  $$\lim_{k\to\infty}\sum\limits_{n=k+1}^{2k}{\frac{1}{n}} =~ ?$$  More precisely, what is the limit of the above sequence of partial sums?


I'm quite new in Blender and I have encountered a problem while I was editing a video with Blender Video Editor. Blender makes the colors of my video worse and wrong. Before rendering the video I didn't notice that, but after rendering there was a remarkable difference between the original and rendered colors. I tried some suggestions given on the internet but they didn't work, anything didn't change in both preview and render. I will give an instance here:    In the image above, in comparison to the real one, Blender rendered video has completely wrong colors. It makes my video white to gray. As I mentioned, it is not only happening in the render section, also occurs in the video preview. So while editing the video I can see the difference. When you once noticed that you cannot prevent looking for the wrong colors and it became really terrible situation for me. I have already tried to change my output settings, I tried nearly all the options about video. Also, I tried rendering it as an image in different image formats. But it still occurs and nothing is changing. Do you have any other suggestions about this problem? What are your thoughts about it?

When I tried rendering the scene with white background in filmic blender, I'm getting grey coloured background. But I'm able to achieve this with standard colour management options.  P.s: I have edited light source to match the filmic blender.


I have a jquery calendar wich it takes events from a php file wich is feeding json data. I want to bind a function on every event added to calendar. And I did this:  $(this).bind("mouseenter", function(){         alert("a");         });   It works, but only on second rollover on each event. First time I roll over nothing happens.

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


Recently, during conversation, a colleague and I were debating why it's common to see "one column, two column", and not "one column, two columns".  There are several other words like this, where their singular is used instead of their plural.  Examples of its usage:   That building is held up by 2 columns That building has a 2 column layout        <------- Why is this not columns?   Why is it so?

I am a little bit confused about using units in English, sometimes I hear that people use singular units for plural things, sometimes they use plural ones. Which one is correct?   3 meter(s) long? during a 2 week(s) period? 0.5 dollar(s)


I am tring to prove the following equality :  $\displaystyle \sum_{k=0}^n {k+l \choose l} = {n+l+1 \choose l+1} $  However, I did not manage to find a proof... Do you have any ideas ?  Thanks !

Let $n$ be a nonnegative integer, and $k$ a positive integer. Could someone explain to me why the identity $$ \sum_{i=0}^n\binom{i+k-1}{k-1}=\binom{n+k}{k} $$ holds?


I want to give validation to EditText using AwesomeValidation inside Fragment. On button click the validation should be check but app stops on button click and giving error like this: java.lang.NullPointerException: Attempt to invoke virtual method 'android.text.Editable android.widget.EditText.getText()' on a null object reference  Here is my Code:  AwesomeValidation awesomeValidation; edtxtfullname = (EditText) view.findViewById(R.id.edtxtfullname); btnNext = (Button) view.findViewById(R.id.btnNext); awesomeValidation = new AwesomeValidation(ValidationStyle.BASIC); awesomeValidation.addValidation(getActivity(),R.id.edtxtfullname, "^[A-Za-z\\s]{1,}[\\.]{0,1}[A-Za-z\\s]{0,}$", R.string.nameerror); btnNext.setOnClickListener(new View.OnClickListener() {     @Override     public void onClick(View view) {         if (awesomeValidation.validate())         {             Toast.makeText(getActivity(), "Validation Successfull", Toast.LENGTH_LONG).show();         }     } }); return view;

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?