NullPointerException creating SQLite using name from SharedPrefs

What I'm trying to do: I have the first login activity, where user login using Google account. Then I save user data to SheredPreferences:  private void handleSignInResult(GoogleSignInResult result) {     if (result.isSuccess()) {         GoogleSignInAccount acct = result.getSignInAccount();         String userName = acct.getDisplayName();         String userPhotoUrl = acct.getPhotoUrl().toString();          String userEmail = acct.getEmail();          UserPreference userPreference = new UserPreference(this);          userPreference.setName(userName);         userPreference.setEmail(userEmail);         userPreference.setPhoto(userPhotoUrl);          Intent mainIntent = new Intent(this, MainActivity.class);         mainIntent.addFlags(                 Intent.FLAG_ACTIVITY_CLEAR_TOP).addFlags(                 Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);         startActivity(mainIntent);         finish();     } }   My preferences class:  public class UserPreference {  SharedPreferences prefs;  public UserPreference(Activity activity) {     prefs = activity.getSharedPreferences("USER_PREFERENCES",Activity.MODE_PRIVATE); // error line 15 }  void setEmail(String email) {     prefs.edit().putString("userEmail", email).apply(); }  String getEmail() {     return prefs.getString("userEmail", "userEmail"); }  ...   And my DBHelper class (I try to create individual db for each user):  public class DBTools extends SQLiteOpenHelper {  public DBTools(Context applicationContext, String name){      super(applicationContext, name+"-database.db", null, 1);  }  ...   But when I try to use it in my MainActivity:  DBTools mDBTools = new DBTools(this, new UserPreference(this).getEmail()); // error line 36 MainActivity   I get this error:     Process: com.package, PID: 21667  java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.package/com.package.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2334)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483)  at android.app.ActivityThread.access$900(ActivityThread.java:153)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5441)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference  at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:181)  at com.package.UserPreference.<init>(UserPreference.java:15)  at com.package.MainActivity.<init>(MainActivity.java:36)  at java.lang.Class.newInstance(Native Method)   I'll apreciate any help or hint


Best way to generate nice function plots in LaTeX?

Which is the best way to put function plots into a LaTeX document?


I am trying to turn on a LED for 5sec every 12 hours. I tried:  #include <mega16.h> #include <delay.h>  void main(void) {     DDRC.0 = 1;     PORTC.0 = 0;      while(1)     {              unsigned long i;        unsigned long j;        PORTC.0=1;         for(i=1; i<432; i++)        {              delay_ms(100);          }         PORTC.0 = 0;         for(j=1; j<100; j++)        {            delay_ms(50);          }     } }   but the LED was on for about 2 hour every week.


How many downvotes for a question are enough?

Suppose I read a question that has a net vote level of -3.  Maybe it's even been flagged.  Would it be overkill to downvote it?  Does the answer depend on whether it's a brand-new user?  Is there a negative number at which you would hesitate to downvote?  In minigolf, there's usually a suggested maximum number of strokes per hole, to prevent people from getting too discouraged.


Find all solution of the following equation : $3^{m}-2^{n}=1$

problem :   Find all solution of the following equation :      $$3^{m}-2^{n}=1$$   Where $m,n\in\mathbb{N}$   My try but not complete :   In first we see that $m=n=1$ is a solution   Also: $m=2,n=3$ a solution  But I don't know if have another solution or no   Is this equation has many solution ?


Why does  tag always require  to make js file loads? Why doesn't the  work?

I don not see any reason why the close tag "/" at the end of  never works when you need to import a JavaScript. I had to go through a thousand line code just to find that this was the bug. Shouldnt HTML automatically parse the end of tag closes?


How to redirect STDIN of background process?

In my Ubuntu, i run java application in background. I use bash script to run it and now it looks like:  nohup java -jar app.jar & exit 0   The problem that i want to be able to write an input string to my application, without making it foreground, from different terminals/sessions. Something like  echo "mytext" > /appdir/in   How should i change my script?


Finding the roots of a 3rd order polynomial

I have a fucntion of $x^3 -x - r=0$ for $r>0$ and I need to find its roots.   How can I do this ..?


Can I play WoW without buying the latest expansion?

I do not plan to buy the Warlords of Draenor expansion any soon.   Can I still enjoy playing the game up to Mists of Pandaria, if I would pay the subscription fee? I do own all the previous expansions. How to patch the game in that case? I played one year ago the last time.


Re-import updated CAD model into blender, retain existing surface materials and settings

Good day everyone.  I am an Architect who primarily works in Archicad, Revit and SketchUp. I recently started to learn my way around Blender as I would like to use it as an Architectural visualization tool.  I can export a building from Archicad just fine, import it into blender, apply materials, lights etc. just fine and render it.   The problem I'm running into is that whenever I have to make changes to the Archicad model I don't know how to go about re-importing the updated CAD file to blender without having to redo everything in blender ( materials, lights etc.)  Is there a way to do this in Blender similarly to programs like Lumion and Artlantis?  Regards,  Hanrich


I've Win8/Ubuntu Dual boot. I already have 4 partition so i cannot create a new partition and mount it elsewhere. So, this () question did not help.  Here's a screen shot of my Gparted (run on Ubuntu Live)   How can I extend /dev/sda6  so that  i can make use of unallocated space ?  (w/o failing my current grub)


I would like to travel from Montreal, Canada to Japan, but a plane ticket is expensive so I want to minimize travel costs.   I like to explore and visit new places so alternative routes through unconventional means, multi-modal transport or through other countries are definitively fine. If possible I would like to avoid crossing the ocean by boat as it is likely to be prohibitively long, but otherwise boats are fine.  Is there a way to travel from Canada to Japan that's cheaper than the most direct flight routes?  My guess is: hitchhike from Montreal to the west coast and take a plane to Japan from there?  Note: I don't think it's a duplicate as I don't want to restrict answers to air travel only, all forms of transport should be considered if they can reduce the overall cost. Travelling to a neighboring country and taking a bus/ferry/train/etc. is a perfect example.


I've been trying to use the gather* environment for non-aligned centered equations within enumerate but I would like to prevent the new line that gather* inserts at the beginning of each item. Is there any easy way to do this? I tried inline gathered but it does not center the equations in the middle of the line like gather* does.


Don't bring nothing vs Don't bring anything

My friend came to visit me and asked  If I wanted something. I wanted to tell him to not bring anything. In this context what is the the right sentence to tell him among two of the following:   a) Don't bring nothing!  b) Don't bring anything!


Change multiple button colors when clicked

I need help making getting multiple buttons to change color when clicked and go back to the previous color when clicked a second time.  Here is my code:  <!DOCTYPE html> <html> <head>   <style>     .choices{       background-color:#F0F3F4;       padding:15px 32px;       display:inline-block;       font-size:16px;       font-family:century gothic;       font-weight:bold;       margin:6px 4px;       cursor:pointer;       border-radius:12px;       border:2px solid #5D6D7E;     }      .choices:hover{       background:#D0D3D4;     }   </style>   <script>    </script> </head> <body>   <div>     <button class="choices" type="button" id="button" >Grapes</button>     <button class="choices" type="button" id="button">Bananas</button>     <button class="choices" type="button" id="button">Strawberries</button>     <button class="choices" type="button" id="button">Apples</button>   </body> </html>   I'm not super experienced with javascript so I think I just need help figuring out how I can use javascript to solve the problem.


What is Windows Automatic Maintenance? and How can I manually disable it?

It really frustrates me and I can't disable it! Automatic Maintenance seems to take forever and reaches 80% in CPU usage or more, if it's ran automatically it stops as soon as I touch the Touchpad but if I run it manually it'll never finishes!  What does it do exactly and is it necessary for it to be enabled to let Windows 8.1 Pro's Optimize Drive feature TRIM my SSD regularly ? I hope Automatic Maintenance does not try to Defragment anyway, because that'd be stupid considering Optimize Drive (previously called : Disk Defrag) is AWARE that I'm using an SSD and uses TRIM instead.  Also, is there a way to disable Automatic Maintenance anyway, it really frustrates me in the night when the fan starts spinning too loud when I leave the computer on. I'm a power user and I run Windows Update and can clean my computer manually.  UPDATE: I'm also asking whether one of Automatic Maintenance tasks is defragmenting directly or it'll execute the "Optimize Drive" application ? this is an important thing.  UPDATE: I am still looking for an answer and solution to this problem! I believe it's not a duplicate because I "Disable “automatic maintenance” in Windows 8" does NOT work, therefore a solution has yet to be found for disabling this "Automatic Maintenance" thing, which is still annoying me everyday when I leave my computer standby for lunch.


Does the Big Bang theory directly imply that there is a much larger structure in which our universe is embedded? If this is not true then where did the Big Bang happen? Where did the material before the Bang exist?


Why didn't Dumbledore show his memory of Barty Crouch Jr's confession to Cornelius Fudge?

Why didn't Dumbledore show his memory of Barty Crouch Jr's confession to Cornelius Fudge to confirm his point that Voldemort returned? Wouldn't that just prevent all the mumbo-jumbo happening in the 5th book?


How do you easily horizontally center a  using CSS?

I'm trying to horizontally center a <div> block element on a page and have it set to a minimum width. What is the simplest way to do this? I want the <div> element to be inline with rest of my page. I'll try to draw an example:  page text page text page text page text page text page text page text page text                -------                | div |                ------- page text page text page text page text page text page text page text page text


I have installed LAMP SERVER IN UBUNTU 13,04 .But could not login to phpmyadmin,showing the error message #1045 Cannot log in to the MySQL server,  and Connection for controluser as defined in your configuration failed.  Please give me a solution


To obtain WB status, should I renew my ESTA (it was used for a tourist travel before)?

Note: As kindly mentioned by Jan Doggen, this question is new, because I specifically talk about diffrence between business vs. tourist ESTA and how to obtain WB status.  I (german) applied for ESTA Dec 2015, it is valid until Dec 2017. I used it for a tourist trip in Dec 2015, and all information are according to that. I can only update the adress of my residence in the US.  I will go to the US again in May 2017 as visiting researcher for less than 90 days and hope to obtain Waiver Buisiness (WB) status uppon arrival.   Should I renew my ESTA to update all information (contact person, residence, travel reason, and so on) or should it also work with the current ESTA?


How to disable DirectWrite in Google Chrome 37?

Today Google Chrome 37  and well... the fonts looking ugly. It looks unsharp like on most .NET programs. Is there a way to disable DirectWrite and get back to Chrome <= 36 font rendering?  EDIT: To show you what I mean, I took two screenshots of this website:     DirectWrite On:            DirectWrite Off:         As you can see, with DirectWrite activated the vertical lines are sometimes unsharp. Without DirectWrite the vertical lines are mostly sharp and exact on the pixels of the screen.


Is it possible to overwrite an object after being passed?

See the following example:    var foo = { bar : 0 };  function modify(obj) {     obj = {}; }  modify(foo);  console.log(foo);     My first object in the global scope remains unchanged. Because the function did not replace the object but a copy of the reference.  So my question is simple. Does anyone know of a work-around way, or are there ECMAScript features in currently development or have there been attempts to make this possible at all?  Thanks.


Where should I ask a question about networking

I have a problem with my router (Networking) and was wondering where would be a good place to ask my question? Obviously not on stackoverflow =).   Sorry this question is short.


Verb agreement in "[adjective] and [adjective] [noun]" constructions

Context: I am writing a short text to explain the main differences between Spanish passive sentences with "ser" and "estar", one of which is verb choice: sometimes the adjectival form should be chosen, and sometimes the participle form should. Those are generally the same, but sometimes they differ. The problematic sentence goes like:     Some examples where the participle and the adjectival form differ are: [and a list follows]   In a previous , it was explained that the noun (form) can be either in singular or plural. Because the noun was a general thing, I decided to go with the singular form, but then a verb followed (differ). Now, my question is:    Should the verb be conjugated in third person singular (differs) or plural (differ)?   Common sense tells me that it should be a plural (since there are two forms), but "differ" after "form" doesn't sound right (or does it?). I know I could just change form to forms, but I would like to keep it singular. Besides, I really am interested in knowing how the verb should be conjugated in this kind of phrases when the noun is to be kept in singular.


If Amy Pond's parents were absorbed by the time rift, how is Amy alive?

Whilst reading the answers to  question, I wondered.. If during the Doctor Who Season 5 story arc, the cracks in the universe absorb a number of creatures, erasing them completely from time and two of these casualities are Amy Pond's mother and father: how if they were erased and therefore never born, does the daughter of two beings who were for all intents and purposes unmade, exist?  It's been mentioned in the afore mentioned question that Amy has some kind of resistance to Space/Time anomolies due to her being the center of a fair few during her childhood, but surely that cannot counter her creators being unmade!?


What's the difference between centre of mass & centre of gravity for massive bodies?

My book says:     For most of the small objects, both are same. But for mammoth ones, they are really different ones. And in a gravity-less environment, COG is absent; COM still exists.   Ok, what's the big deal when things are small and big? How these two :  & ?


Python - How can I force print statement before entering a never-ending loop?

I was debugging some code that had some never-ending loop issues, and I sometimes couldn't figure out how to make informative print statements to help identify which loop was broken.    An example case is:  def fake_function():     print 'I am about to enter a broken loop.'      while True:     #  Doesn't matter what I'm doing here.         _ = None   When I then call fake_function, I don't get any output until I halt it.  A slightly larger example that might show why I wanted this looks like:  def another_fake_function():      #  This loop is fine and not broken.       print 'I am entering a loop that might be broken.'         leave_loop = False     while not leave_loop:         #  Do a thing.         leave_loop = True      #  This loop actually is broken.     print 'I am about to enter a different loop that might be broken.'     while True:         #  Doesn't matter what I'm doing here.         _ = None   So, is there any way to really force python to print something immediately?    Thanks!


How to avoid messages from applications which I ran with a &?

I ran dolphin like this:  dolphin . &   I see messages in the console like these:  QPixmap::scaled: Pixmap is a null pixmap   How can I keep the console clean or silent?


I need to permanently disable the touchscreen input - Ubuntu 16.04

Recently I installed Ubuntu 16.04 on my HP Envy 17t and everything works fine. However, I need to disable the touchscreen input permanently and I tried everything I could found but nothing works.  The closest thing I could manage was to make a shell script that will run at startup (the shell script calls xinput set-prop "Touchscreen Input Name" "Device Enabled" 0 command).   However, this script will not run until I log in. My touchscreen needs to be disabled at the log-in screen.  How can I solve this? I tried modifying the 10-evdev.conf file but all I got is a purple screen and a broken Ubuntu setup.


Two boxes, one is gold and the other silver. The sign on the gold box reads, "The portrait is not here." The sign on the silver one reads, "Exactly one of the two statements is true." Guess where the portrait is. What I want to see is how you reason the problem.


Can we let users with privileges on one site have them on another?

I have almost 4k reputation on Arqade. On Stack Overflow, I have to suggest edits and can't hit the close button. But I want to help with the close queue, which is at 62k at the time of this writing.  While I realize that people may be inexperienced with the system, I think I am experienced enough. If I want to edit something, I have to let it sit in the queue and get robo-reviewed. Yes, I know more about gaming than about coding. But I think I would know if this question is a duplicate of that, and if this question is off topic.  So, my request is that we should have the same privledges on every site, based on the site that we have the most reputation in. I am not asking that all the reputation be merged.


Proof of centripetal acceleration formula ($a_c = v^2/r$) for non-uniform circular motion

The formula for centripetal (radial) acceleration is well known, and there exist many proofs for it: $$||a_c|| = \frac{||v||^2}{r}$$  However, all the proofs I've seen rely on the fact that it is uniform circular motion and the magnitude of the tangential velocity vector does not change. For instance, take the classic proof using similar triangles — the similarity can only be established if the final tangential velocity vector and the initial one are of the same length.  In addition, take  calculus based proof from Khan Academy, outlined as follows:     For this proof to work, $(d\theta / dt)$ must be considered a constant, $\omega$, that does not depend on time. In the case of non-uniform circular motion, however, this is not always true as since there exists a tangential acceleration along with a radial one, $\omega$ must depend on time and is not necessarily a constant value.  Intuitively I understand that the centripetal/radial acceleration depends only on the difference in orientation between two tangential velocity vectors, and that their magnitudes do not matter -- hence the formula intuitively holds true in the non-uniform case. However, how would you go about modifying either of the proofs presented so that they are still valid in this case? Or alternatively, is there another proof that holds valid even when there exists tangential acceleration?    As per the suggestion of one of the answers, I let $\omega$ vary with time and took its derivative as $\alpha(t)$. This is my work so far. Unfortunately, I am stuck after the last step.  \begin{align} \overset{\rightharpoonup }{p}(t) &= r \cos (\theta (t))\cdot\hat{i}+r \sin (\theta (t))\cdot\hat{j} \\ \overset{\rightharpoonup }{v}(t) &= -r \sin (\theta (t))\cdot\omega(t)\cdot\hat{i}+r \cos (\theta (t))\cdot\omega(t)\cdot\hat{j} \\ \overset{\rightharpoonup }{a}(t) &= (-r \cos(\theta(t))\cdot\omega(t)^2 - r \sin(\theta(t))\cdot\alpha(t))\hat{i} \\ &+ (-r \sin(\theta(t))\cdot\omega(t)^2 + r \cos(\theta(t))\cdot\alpha(t))\hat{j} \end{align}     From here on, $\theta(t)$ is represented as just $\theta$ for brevity   and clarity   $$\overset{\rightharpoonup }{a}(t) = -\omega(t)^2(r \cos\theta\cdot\hat{i} + r \sin\theta\cdot\hat{j}) -\alpha(t)(r \sin\theta\cdot\hat{i} - r \cos\theta\cdot\hat{j})$$


Installing Ubuntu on Toshiba Satellite with Windows 8

All I want to do is install Linux Ubuntu 12.04 LTS as another OS on my laptop (which already has Windows 8). I realize this thread might be deemed as a duplicate of  but I don't care about back-up or Lubuntu, nor can I disable UEFI because I can't get into BIOS no matter how hard I try.  I found out about this option in Windows 8, which for some reason has something to do with recovery: "Change advanced start-up settings"/"Advanced startup". Seems like at this point I do not have to deal with BIOS, UEFI, and Secure Boot, nor do I want to; this installation process is already complicated enough. (I'm writing this because I don't know if this is relevant to the problem I'm about to address.) I boot from the DVD with Ubuntu .iso image properly burnt on it. At the start-up I saw a suspicious line:  Could not open "\EFI\BOOT\fallback.efi": 14   Then it moves on to the boot partitions menu without Windows 8 on it. Now I'm booting into the trial mode of Ubuntu. Even during the installation process it does not recognize Windows 8:    On  the author says that she "had to manually partition the hard drive, because the Ubuntu installer didn't recognize that Windows 8 was already on the computer." I don't know if this is safe for an amateur like myself to carry it out, considering that partitioning cannot be undone and I don't know how to do it right:    Problem/question: How do I get it to recognize Windows 8 so that I can partition the memory correctly?  Hope I didn't put up too many findings. Any help would be appreciated.


Remove extra vertical space in amsmath's align environment

If I use \begin{align*}...\end{align*} and out of it I write a text then there is a big vertical space between the text and the mentioned environment. Why is there that space? And how can I erase it? Also in this case I think that the vertical space is too much. For example in tabular environment or other environments there is much less vertical space. Why is align environment different?  \documentclass[12pt]{article} \usepackage[top=0.3in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}  \usepackage{multicol}  \usepackage[utf8]{inputenc}  \setlength{\parindent}{0cm}  \usepackage{setspace}  \usepackage{xltxtra} \usepackage{xgreek} \setmainfont[Mapping=tex-text]{GFSDidot.otf} \setsansfont[Mapping=tex-text]{GFSDidot.otf}  \usepackage[fleqn]{amsmath} \usepackage{unicode-math}  \setlength{\mathindent}{0cm}  \newcommand{\3}{\vspace{0.3cm}}  \title{} \author{} \date{}  \begin{document}  \begin{multicols*}{2}   70 \begin{align*} &e^{jz}=\cos z+j\sin z\\ &\cos z=(1/2)(2\cos z)=\\ &=(1/2)(2\cos z+j\sin z-j\sin z)=\\ &=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\ &=(1/2)(e^{jz}+e^{-jz}) \end{align*}   \end{multicols*} \end{document}     70  \begin{align*} &e^{jz}=\cos z+j\sin z\\ &\cos z=(1/2)(2\cos z)=\\ &=(1/2)(2\cos z+j\sin z-j\sin z)=\\ &=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\ &=(1/2)(e^{jz}+e^{-jz}) \end{align*}


I'm working on making a triple glazing corner sample, and I want to be able to mitre the profile at 45 degrees so I can duplicate it, rotate it and join them to make an elbow. I've muddled through making the profile, but now I'm stuck on how to get that 45 degree angle.  I've had a look around Google, perhaps I'm not phrasing my question correctly but I cant find any answers. I did try creating a cube to use as a sort of cutting form, but Blender wouldn't let me use a Boolean modifier to do it. Any thoughts?  Thank you!  What I'm trying to achieve:    What I have at the moment:


a and c are Integer constants, where a<c.  x belongs to the set of Natural Numbers.  How to maximize the result of (a*x)%c?   if we assume that b=0 then the solution given in the answer doesn't work.  Suggested Answer for maximization of (ax +b)%c:-  if(0 != (c-b)%a) ) {max = c-((c-b)%a);} else {max=c-a;}  Suppose a=15,c=21 and b=0 then according to this post the answer should be:-  max = 21-((21-0)%15)  max = 21-(21%15)  max=21-6  max=15  but for x=4 we get the result ax%b as 15*4 % 21 which is 60%21 or 18.


Should I flag a vague question, or ask the member to add more detail if I can't?   If I should flag it, what should I flag it as?


How to recover from chown on all the files?

I've just chowned all the computer. I wanted to chown a folder completely so I used the option -R. I forgot that I had used su root before and I was in the folder where everything is (/ isn't it ?)  So, I chowned everything. When I did, there was no problem, I thought mine fixed (my folder was chowned... since everything was..) but when I restarted, ubuntu is dead.  Now that I want to reinstall it, I couldn't install it because when I went to something else (so I could change the partitions), I was unable to delete the partition of the old Ubuntu because it was mounted and being used (or being busy I don't know). It was mounted on /cdrom.  Did I kill my computer? How can I reinstall Ubuntu or Fedora or anything...


How to find the type of an img file and mount it?

I have to mount a .img file but I don't know what type of .img it is. How can I figure out what type of .img file it is?  # mount -t auto -o ro,loop gmapsupp.img /mnt/iso/ mount: you must specify the filesystem type # file -k gmapsupp.img  gmapsupp.img: x86 boot sector, code offset 0x0 #


Product of $\min$ and $\max$ of $n$ i.i.d. random variables.

Let $X_1, \ldots, X_n$ be i.i.d. continuous uniform random variables on $\left[\vartheta-\frac{1}{2},\vartheta+\frac{1}{2}\right]$ for some $\vartheta \in \mathbb R$.    I am trying to solve $\mathbb E[(T-\vartheta)^2]$ where $T(X) = \frac{1}{2}\left(\min_{1 \le i \le n} X_i + \max_{1 \le i \le n} X_i\right)$ or simplify it such that it becomes clear that it is independent of $\vartheta$.   I have tried to approach this by a variety of conversion but always end up with a term that involes $\mathbb E\left[\left(\min_{1 \le i \le n} X_i\right)\left(\max_{1 \le i \le n} X_i\right)\right]$.  I can't find a way to actually calculate it. Do you have a hint or another way of approaching the task?


Why not generalize the Intermediate Value Theorem

So I know the IVT says that given a continuous function on a closed interval [a,b] then if $f(a) < \gamma <f(b)$ then there is $c\in(a,b)$ such that $f(c) = \gamma$.  Is there any reason for not replacing the image of the end-points with the image of the maximum and minimum of $f$ on $[a,b]$. In other words, why isn't the mean value theorem stated as above but with $f(a)$ replaced by the minimum value of $f$ taken on $[a,b]$ and similarly $f(b)$ replaced with the maximum value of $f$ taken on $[a,b]$?


Can the complete graph $K_9$, be 2-coloured with no blue $K_4$ or red triangles?

I am working on the following problem on 2-coloured complete graphs:     $K_9$ is coloured red and blue and contains no red triangle and no   blue $K_4$ then every vertex must have red degree 3 and blue degree 5.   Is this possible?   I am pretty sure the answer is 'no' but I am not sure how to explain my answer.  Any help would be greatly appreciated!


I know DES is outdated, but will is is secure in CBC mode? Can anyone help me understand why not?


Does anyone know of a way to dynamically set the relay host when sending mail through Postfix? At what point does Postfix set the relay host? Is there some way that I can tell Postfix to use a relay host for a particular email (that is outside of global settings)?  Basically, when an email is to be sent to an outbound email address (Gmail, Outlook.com, etc.) I want to be able to choose which relay host to use based on which one has the best deliverability rating. And this could possibly change within seconds so it can't be a "global" postfix setting.  I've thought about creating a content filter which would lookup the "To", find the right relay host and then send the email using another application. However, that seems very awkward to do since we are already in Postfix.  Any help would be greatly appreciated!  Thanks.


How to restore update settings after accidentally changing it with dist-upgrade and pantheon desktop environment

I wanted to try out pantheon desktop in Ubuntu 20.04. I ran: sudo add-apt-repository ppa:elementary-os/daily sudo add-apt-repository ppa:elementary-os/os-patches sudo apt update sudo apt dist-upgrade  I changed my mind, but I discovered that software-properties-gtk no longer worked, so I couldn't remove the PPAs via the UI. I removed them manually in /etc/apt/sources.list.d (also tried add-apt-repository --remove and ppa-purge) Still software-properties-gtk was not working, until I manually fixed /etc/lsb-release  and /etc/os-release by replacing the text mentioning elementary with the Ubuntu parts. Right now most seems to be working again. My two questions:  What exactly caused my mess (I guess sudo apt dist-upgrade is to blame) and what has been changed (like /etc/lsb-release)?  Is there a way (beside reinstalling) to cleanup the issues completely? (I just saw that files like /etc/issue and /etc/issue.net are also changed)


Analog of \pdfelapsedtime for LuaTeX and XeTeX

In pdfTeX, the \pdfelapsedtime primitive gives access to the time since this pdfTeX run was started, in "scaled seconds" (1/65536 seconds). This is useful to benchmark code: repeat it many times, and test the time it takes.  \newcount\benchmarkcount \long\def\tenfold#1{#1#1#1#1#1#1#1#1#1#1} \long\edef\thousandfold{\tenfold{\tenfold{\tenfold{#1}}}} \long\def\benchmark#1{%   \benchmarkcount\pdfelapsedtime   \thousandfold{#1}%   \typeout{\the\dimexpr\pdfelapsedtime sp-\benchmarkcount sp miliseconds}% }   Is it possible to have access to the time in a similar way in XeTeX and/or LuaTeX?


The limit of a convergent Gaussian random variable sequence is still a Gaussian random variable

I'm trying to prove this conclusion but have some problems with one of the steps.  Assume $X_1,\ldots,X_n,\ldots$ is a sequence of Gaussian random variables, converging almost surely to $X$, prove that $X$ is Gaussian.  We use characteristics function here. Since $|\phi_{X_n}(t)|\leq 1$, by dominated convergent theorem, we have for any $t$  $$ \lim_{n\rightarrow\infty}e^{it\mu_n-t^2\sigma_n^2/2}=\lim_{n\rightarrow \infty}\phi_{X_n}(t) = \lim_{n\rightarrow \infty}\mathbb{E}\left[e^{itX_n}\right] = \mathbb{E}\left[e^{itX}\right] = \phi_X(t) $$  this is the step that I cannot figure out: $e^{it\mu_n-t^2\sigma_n^2/2}$ converges for any $t$ if and only if $\mu_n$ and $\sigma_n$ converges.   Let $\mu=\lim_n \mu_n$, and $\sigma=\lim_n\sigma_n$, then $\phi_X(t)=e^{it\mu-t^2\sigma^2/2}$, which proves that $X$ is a Gaussian random variable.  Why can we get that $\mu_n$ and $\sigma_n$ converge? This looks intuitive for me, but I cannot make a rigorous prove.


There must be some scientific reasons for why earth is a spheroid but what are they? If Earth would be a cuboid, Would it matter?


how to solve Canon Pixma G2000 driver problems on Ubuntu 16.04?

I just bought this new printer Canon PIXMA G2000, and I can't find any driver for my Ubuntu. I research this printer and this is the first canon printer with ink-tank.   How long it will take usually for canon to release an official driver for linux?  I try using the printers app and on dash home, and search for printer driver to download. But, no matches found.   Is there any universal driver for canon printer on 16.04?


Comparing lengths of three segments in triangle ABC

I would like to ask if someone could help me with solving the following task.  The middle triangle is KLM (hatched). Prove that $|AK| = |KL| = 3|LB_1|$.   Thank you in advance.


since I'm new to Java I have a lot of problems with my code. My goal is, to create a small application, where u can enter a name into the terminal and the program will give you the age, height, and gender of the person. I've already created a class called Person, with the following properties: String name, int age, double height, boolean, isMale. It was my idea to make a list with objects of this class (persons), ask the user for input (using the Scanner), then loop through the list and search in the persons[i].name category for the value the user entered. However, there is a problem. I don't know why, but it seems like, a value the user enters through the Scanner is not the same as the same Text, let me explain. To test this, I've printed out user(the value the user entered) == "Name", to my surprise, the application printed false when user = "Name". But "Name" == "Name" is true and since user = "Name", i thought the outcome should be true too. But for some reason, user("Name") != "Name". I'm very confused at this point. I hope somebody can help me with this problem, thanks in advance. Your sincerely Eric import java.util.Scanner;  public class names {     public static void main(String[] args) {         Person persons[] = { new Person("Eric", 15, 1.75, true), new Person("Bent", 16, 1.85, true) };          Scanner sc = new Scanner(System.in);         System.out.print("Enter name: ");         String user = sc.nextLine();         sc.close();          String test = "name";          System.out.println("USER: " + (user.toLowerCase()).toString() + " " + user.length());         System.out.println("TEST: " + (test.toLowerCase()).toString() + " " + test.length());         System.out.println(test == user);       }  static class Person {     String name;     int age;     double height;     boolean isMale;      Person(String name, int age, double height, boolean isMale) {         this.name = name;         this.age = age;         this.height = height;         this.isMale = isMale;     } }  } Output: Enter name: name | User: name 4 | Test: name 4 | false


Could there exist a situation where a system of electrons is well-described by a classical Dirac field?

This question has been bugging me for a long time now. So the field equation for the electromagnetic field operator in QED is, brushing aside concerns about gauge fixing, Maxwell's equations. Similarly, in non-relativistic QM, the momentum operator obeys Newton's second law. In both these cases, there are situations - in the "classical limit" - where real physical experiments can be well-approximated by just doing classical mechanics with these differential equations: classical particle mechanics and classical electromagnetism work fairly well to describe a large number of physical situations. Now, when you do QFT, the situation for the electron field looks very similar to the EM field: you have a field equation (i.e. the Dirac equation) for the field operator. However, I have never seen anyone try and use the Dirac equation as a classical field equation. I've seen full QFT calculations performed with the aid of "classical solutions" (thinking of instantons used for Euclidian Green's functions), but that's a bit different to just doing classical mechanics with the Dirac equation. Overall, while in the case of non-relativistic particle mechanics and the EM field the "classical limit" seems to be a really important, physical phenomenon, with the Dirac field it seems to be a highly formal mathematical oddity. So my question is, does there exist a principle why the "classical limit" of the Dirac equation can never actually be reached, or is it a contingent issue to do with the sorts of physical situations we are actually interested in/can be produced in a laboratory?


what is $I(2n) =\int \tan^{2n}x\mathrm{d}x$  Thanks


Opening a text document with Windows Notepad

Often (but not always) when I open a text file using Windows Notepad, it does not recognize the line breaks.  If I open the file using Windows Wordpad, and then save it as a text file, and then open it with Notepad, the line breaks are recognized.  What causes this, and what is the easiest way to view/edit the file using Notepad?


I looked around a bit for some solutions first, but they didn't seem to work due to another issue.  first of all, i freshly installed ubuntu 13.10 yesterday, did my updates and upgrades etc.  so this is a fairly new/fresh system.  when i try to install skype I get this error:  The following packages have unmet dependencies: skype : Depends: skype-bin E: Unable to correct problems, you have held broken packages.   when I add the canonical partners using this line:  apt-add-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"   and update, I get this:  W: Failed to fetch gzip:/var/lib/apt/lists/partial/fr.archive.ubuntu.com_ubuntu_dists_saucy_main_binary-i386_Packages  Hash Sum mismatch  E: Some index files failed to download. They have been ignored, or old ones used instead.   apt-get -f install didn't do anything.  How can I fix this?


To reverse the scrolling of Mighty Mouse in Windows 10

I read this  but there is no Device Settings in my mouse configurations.   How can you reverse the scrolling of mighty mouse in Windows 10?


The game does not seem to make a difference in male/female, judging from the merchants that visit my town. Before I buy some animals I would like to know:   How many animals do I need to make them mate / breed them?  How long does it take for a baby animal to be born?


How to get rid of fireflies in my metallic materials / cycles (principled bsdf)

i've been working on this Project for a while now and i am struggling with fireflies all over my metallic materials, I can easily get rid of them inside Photoshop but i would like to render an animation of the scene so i need cycles to render free fireflies frames.  I've tried: -Increasing my samples and no matter how high i go fireflies keep apearing, they even appear more one my frame has reached 4000 samples  -tweaking my material node  -deactivating my reflective caustics   -tweaking light (scene is iluminated by an hdri, a sun lamp and 2 point lamps)  I think it may have something to do with the roughness map or maybe lightpaths or max bounces since there are a lot of reflective materials inside the scene but im not an expert in either so i cant find a solution


What are the rules for parsing negation before "all", "any", and "every" in English?

My question is about how a negated "all", "any", and "every" statements are usually and correctly understood in English. I have just realized an apparent parsing ambiguity in all such statements (i.e., two different possible readings). Consider the following examples, each containing not and then all/any/every:   "The giraffe was not standing on all/any/every one of its legs." "The talk was not understood by all/any/every member(s) of the audience." We do not live far from all/any/every one of the best museums in the city.   The ambiguity is, in each case: (1) is either "The giraffe was standing on none of its legs" or "The giraffe was standing on less than 4 legs"; (2) is either "The talk was was lost on everyone" or "The talk was lost on at least one person"; (3) is either "We live close to every museum" or "We live close to at least one museum."  But the word choice all/any/every seems to give some indication:   Using all seems to imply less than 4 legs. Using any seems to imply 0 legs. Using every one could go either way for me. Using all seems to imply at least one person was lost. Using any seems to apply everyone was lost. Using every could go either way. This one breaks the pattern. Using all, any, or every one all seem to imply being close to every museum.   So my question: What general rules can be used to determine which of the two interpretations is valid? What are the patterns involving all, any, and every? What are the patterns based on the placement of not within the sentence?  Bonus: Is there any data on the usage and interpretation in English of negation before an all/any/every statement?    Postscript  P.S. It may clear things up to consider the logical parsings of the statement. The two interpretations of (1) are (roughly)  (The giraffe) (was not) (standing on all of its legs)   and  (The giraffe) was (not standing) (on all of its legs).   Although it is confusing to wrap one's mind around the two readings, they both seem equally valid to me and the logical form makes it clear they are distinct (I hope I have also communicated that to some degree in the examples above).  Postpostscript  I originally noticed this based on an excerpt from a  defining unattended vehicles:     Motor Vehicle...That is left unattended on or along a highway or other public property for more   than forty-eight (48) hours and does not bear all of the following:      a. Valid registration plate.      b. A current certificate of inspection.      c. An ascertainable vehicle identification number.   So I asked . Amusingly, the answer they gave contains exactly the same not...all ambiguity as in my original excerpt. So I decided to take it here, with more simple and clear examples.


Chrome browsers crashed and unable to restore

my chrome browsers crashed and I had a lot of tabs open, im unable to restore them. can someone please help?!


Orthonormal set in $L^2(0,1)$ that is not complete

I'm trying to solve the part (b) of the following exercise:  Let consider the space $L^2(0,1)$ and define $r_0(t)=1$ and $$r_n(t)=\sum_{k=1}^{2^n}(-1)^{k-1}\xi_{\left[\frac{k-1}{2^n},\frac{k}{2^n}\right]},\quad\forall n\in\Bbb{N},$$ where $\xi_E$ denotes the characteristic function of a set $E$. (a) Show that $r_n(t)=\text{sgn}(\sin(2^n\pi t))$, for all $t\in[0,1]$. (b) Show that $\{r_n(t)\}_{n=0}^{\infty}$ is an orthonormal set in $L^2(0,1)$ but that it is not complete.  The part (a) is ok, also that $\langle r_n,r_n\rangle=1$, for all $n$, but I don't see how to conclude that $\langle r_n,r_m\rangle=0$, when $m\ne n$. Thanks for any help.


1 modem connect with 2 device, can it in the same network?

My ISP provide me a moderm that has 4 input and I can plug lan cable in it  the modem model:   So I have attempt like this before  --> moderm --> router --> notebook                       --> pc   it works perfectly as expected, they are in the same network.  However, recently I need to move my pc away, so I connect like this:  ---> moderm --> router---> notebook             --> pc   Although both pc and notebook can connect to internet, it no longer in the same network, any workaround to this? Thanks


"I leaked nothing to nobody." - SAE? AAVE? Deliberate double negative?

"" (around 3:42 in the video)   Is the sentence above from Susan Rice grammatically correct in standard American English (SAE)? Seems like it should be:      I leaked nothing to anybody/anyone.   If not SAE, is it maybe African American Vernacular English (AAVE)?  If not AAVE, would the double negative make it a positive? Maybe weasel wording or understatement (litotes)?


Is the series $\sum_\limits{n=1}^\infty\frac{n}{n^3+1}$ convergent or divergent?

Is the series $$\sum_\limits{n=1}^\infty\frac{n}{n^3+1}$$ convergent or divergent? My answer is the following. Could anyone tell me if it is correct? Since $$0<\frac{n}{n^3+1}<\frac{1}{n^2}\;\;,\;\;\;\;\forall n\in\mathbb{N}$$ and the series $$\sum_\limits{n=1}^\infty\frac{1}{n^2}$$ is convergent, by applying comparison test, we get that the series $$\sum_\limits{n=1}^\infty\frac{n}{n^3+1}$$ is convergent too.


Do I need the installer first before texlive install?

I want to execute apt-get install texlive-full but do I need to do anything before this like install an installer or anything?


Use MacBook Pro as second monitor for iMac?

Is it possible to use a MacBook Pro as a second monitor for my iMac? Both of them have a Thunderbolt port.  If not, is there any other way?


How do I make JSP tag files NOT ignore all whitespace?

I'm really stumped on this one. I want to output a list and have the tag file take care of commas, singular versus plural, etc. but when I display the list it completely ignores whitespace so everythingrunstogetherlikethis. I tried using the HTML entities "thinsp", "ensp" and "emsp" (I can't use "nbsp", these have to be breaking), but they're all hideously wide on IE except thinsp which is way too skinny on everything else.  Edit:  won't work. The output from the tag has no spaces at all. Although any content in the JSP has normal spacing. Obviously I could just put everything in the JSP but this is code that goes on multiple JSPs, so tag files would make a lot of sense.


Where is the `--` (double dash) argument documented?

There are some utilities that accept a -- (double dash) as the signal for "end of options", required when a file name starts with a dash:  $ echo "Hello World!" >-file  $ cat -- -file Hello World!  $ cat -file                      # cat - -file fails in the same way. cat: invalid option -- 'f' Try 'cat --help' for more information.   But some of those utilities don't show such an option in the manual page.  The  doesn't document the use (or validity) of a -- argument in any of the OS'es. This is not meant to be a Unix - Linux flame war, it is a valid, and, I believe, useful concern.  Neither cat, mv, ed (and I am sure many others) document such an option in their manual page that I can find.  Note that ./-file is a more portable workaround to the use of --. For example, the source (dot) command (and written as .) doesn't (generally) work well with an -- argument:  $ echo 'echo "Hello World!"' >-file  $ . ./-file Hello World!  $ . -file ksh: .: -f: unknown option ksh: .: -i: unknown option ksh: .: -l: unknown option ksh: .: -e: unknown option Usage: . [ options ] name [arg ...]  $ . -- -file         # works in bash. Not in dash, ksh, zsh. ksh: .: -file: cannot open [No such file or directory]


How could Kylo Ren move Luke's lightsaber in The Last Jedi when he couldn't in The Force Awakens?

In Star Wars: The Force Awakens, before the battle between Kylo Ren and Rey we watch Kylo trying to force pull Luke's blue lightsaber but without success. Now, in The Last Jedi, Kylo uses the Force to move Luke's Lightsaber and      kills Supreme Leader Snoke.    What has changed and why can Kylo move the lightsaber now?


Short story about entity that suppresses human intelligence on trip to Mars

I'm looking for a short story about the first human trip to Mars.   In it, the further the astronauts go from Earth the smarter they get. At the halfway point they have super-intelligence and realize that there are entities on Earth that suppress our intelligence. They then start losing their intelligence as the Mars based entities begin to exert their influence on them.


Do people read literature in Harry Potter? Fiction books are rarely mentioned in the series, and none of the characters seem to read novels. We understand that a majority of teenage students aren’t prone to pick up Chaucer just for the fun of it, but you would think a bookworm like Hermione would occasionally peruse Dickens, especially since other forms of entertainment, such as television and computers, aren’t common in the magical world.


Should I format some code in the title of a question?

I always try to avoid inserting some function name (or class, method, etc.) in the title of the question, but sometimes I just can't.  In those cases, how should I format the function name? For example, should it be    or just  Difference between mod and rem in Haskell?  There are some scenarios where it is obvious you're including some function name in your question (like Problems with print() Python, etc.), but in my example, it isn't.


Suspension not bouncy raleigh activator 2

Hi i got a preowned raleigh activator 2 with front suspension and rear tube dampening system but the front and back suspensions dont seem as bouncy as i thought is there a way to get them to do their job properly.i am 10stone in weight and height 5,10 if its to do with the weight.


I've had a lot of difficulty summoning the wall of flesh. The first time I summoned it when I was new to the game I died. I waited for my guide to respawn so I could try again but he never spawned. I made a house for him to stay in but he still has not come. It's been 4 weeks and he has not come. Is there any way to make him come back that I don't know of, or is this some glitch


Suppose $G$ is a finite group and G acts transitively on  sets $X$ and $Y$. Let $a$ and $b$ belongs to $X$ and $Y$ respectively and $G_{a}$  be stabilizer of $a$ in $X$ and $G_{b}$ be stabilizers of $b$ in $Y$.Let $G$$=$$G_{a}$.$G_{b}$ then show that $G$$=$$G_{x}$.$G_{y}$ $\forall x \in X$, $\forall y \in Y$  Edit:$G_{x}$  denotes stabilizer of $x$ in $X$ and $G_{y}$ denotes stabilizers of $y$ in $Y$


Let $k$ be a field and $f, g$ be irreducible monic polynomials in $k[X]$.  Suppose $k[X]/f \stackrel{\sim}{=} k[X]/g$.  Then does $f = g$?  If so, how can this be generalized?  Otherwise, how should I modify the  condition so that $f = g$?


I'm trying to find the metric describing the spacetime around an infinite cylinder of radius $\rho$ and mass density $m$. Since the spacetime is  and cylindrically symmetric, the metric must be of the following form:  $$\mathrm{d}s^2 = a(r) c^2 \mathrm{d}t^2 - b(r) \mathrm{d}r^2 - c(r) \mathrm{d}z^2 - r^2 \mathrm{d}\theta^2$$  Using  I obtained the following :  \begin{align} G_{tt} &= \frac{a(r) \left(c(r) \left(r b'(r) c'(r)-2 b(r) \left(r c''(r)+c'(r)\right)\right)+2 c(r)^2 b'(r)+r b(r) c'(r)^2\right)}{4 r b(r)^2 c(r)^2} \\ G_{rr} &= \frac{\left(r a'(r)+2 a(r)\right) c'(r)+2 c(r) a'(r)}{4 r a(r) c(r)} \\ G_{zz} &= -\frac{c(r) \left(r b(r) a'(r)^2+a(r) \left(r a'(r) b'(r)-2 b(r) \left(r a''(r)+a'(r)\right)\right)+2 a(r)^2 b'(r)\right)}{4 r a(r)^2 b(r)^2} \\ G_{\theta\theta} &= -\frac{r^2 \left(a(r) c(r) b'(r) \left(c(r) a'(r)+a(r) c'(r)\right)+b(r) \left(-a(r) c(r) \left(a'(r) c'(r)+2 a(r) c''(r)\right)+c(r)^2 \left(a'(r)^2-2 a(r) a''(r)\right)+a(r)^2 c'(r)^2\right)\right)}{4 a(r)^2 b(r)^2 c(r)^2} \end{align}  with all nondiagonal components equal to zero. From the , the  is $$T_{\mu\nu} = \frac{c^4}{8\pi G} G_{\mu\nu}$$  How can I proceed from here? Can the equations be simplified any further?


Is there a difference between these “definitions” of confidence interval

Today, my instructor was going over some of the misconceptions about confidence interval, e.g., how it's frequently incorrectly stated that "a 95% confidence interval that there is a 95% chance that the population parameter is in the confidence interval." He further said that "95% confidence intervals mean that if you were to create $n$ sets of samples drawn from this population, and construct a separate confidence interval for each of the $n$ sets, then we would expect 95% of these confidence intervals to contain the population parameter." This seems to be what's regurgitated on this website. So he concluded with (1) A 95% confidence interval does not mean that there is a 95% chance that the population parameter is in this confidence interval. It's either in it, or it's not in it, there's no probability associated with that. This makes sense to me. (2) A 95% confidence interval means that it has a 95% chance of containing the population parameter. ???? Someone brought up that (2) sounds the exact same as (1), but just worded differently (and I agree). Doesn't (1) = (2), or is (2) somehow different from (1)? I tried to apply a simplified analogy where we consider a set of numbers $S$ and some target number $x$. According to (1), it's saying that $x$ has a 95% chance of being in $S$. According to (2), it's saying that $S$ has a 95% chance of containing $x$. These two literally sound the same to me.


How to make this template for an article?

I want to separate the address of the authors with a box where I will put the abstract according to the graphic template below. Right alignment is important.


(1) Evaluation of $\displaystyle \tan \left(\frac{\pi}{7}\right)\cdot \tan \left(\frac{2\pi}{7}\right)\cdot \tan \left(\frac{3\pi}{7}\right) = $ (2) Evaluation of $\displaystyle \tan\left(\frac{\pi}{11}\right)\cdot \tan\left(\frac{2\pi}{11}\right)\cdot \tan\left(\frac{3\pi}{11}\right)\cdot \tan\left(\frac{4\pi}{11}\right)\cdot \tan\left(\frac{5\pi}{11}\right) = $  $\bf{My\; Try::(1):}$ Let $\displaystyle \frac{\pi}{7} = \theta\Rightarrow \pi = 7\theta\Rightarrow (\pi-3\theta) = 4\theta\Rightarrow \tan(\pi-3\theta) = \tan(4\theta)$ So $\displaystyle \tan (3\theta) = -\tan (4\theta)\Rightarrow \frac{3\tan \theta - \tan^3\theta}{1-3\tan^2 \theta} = -\left(\frac{2\tan 2\theta}{1-\tan^2 2\theta}\right) = \frac{4\tan^3 \theta-4\tan \theta}{1+\tan^4 \theta-6\tan^2 \theta}$ So $\displaystyle \left(\frac{3-\tan^2 \theta}{1-3\tan^2 \theta}\right) = \left(\frac{4\tan^2 \theta-4}{1+\tan^4 \theta-6\tan^2 \theta}\right)\Rightarrow \tan^6\theta-21\tan^4 \theta+21\tan^2 \theta-7=0$ Now Let $\displaystyle \tan \theta = y\;,$ then eqn. convert into $\displaystyle y^6-21y^4+21y^2-7=0$ and equation has a roots $\displaystyle y = \tan \left(\frac{\pi}{7}\right)\;,\tan \left(\frac{2\pi}{7}\right)\;,\tan \left(\frac{3\pi}{7}\right)\;,\tan \left(\frac{4\pi}{7}\right)\;,\tan \left(\frac{5\pi}{7}\right)\;,\tan \left(\frac{6\pi}{7}\right)\;$. So Product of Roots is $\displaystyle \tan \left(\frac{\pi}{7}\right)\cdot \tan \left(\frac{2\pi}{7}\right)\cdot \tan \left(\frac{3\pi}{7}\right)\cdot \tan \left(\frac{4\pi}{7}\right)\cdot \tan \left(\frac{5\pi}{7}\right)\cdot \tan \left(\frac{6\pi}{7}\right) = -7$ Now $\displaystyle \tan\left(\frac{4\pi}{7}\right) = \tan\left(\pi-\frac{3\pi}{7}\right)=-\tan\left(\frac{3\pi}{7}\right)$ Similarly $\displaystyle \tan\left(\frac{5\pi}{7}\right) = -\tan\left(\frac{2\pi}{7}\right)$ and $\displaystyle \tan\left(\frac{6\pi}{7}\right) = -\tan\left(\frac{\pi}{7}\right)$ So $\displaystyle \tan\left(\frac{\pi}{7}\right)\cdot \tan\left(\frac{2\pi}{7}\right)\cdot \tan\left(\frac{3\pi}{7}\right)=\sqrt{7}$ I did not understand how can i calculate $(2)$ one using the same method:, bcz it is very lengthy can we solve the $(1)$ and $(2)$ question any other method. If yes then plz explain me, Thanks :: Thanks


Python pass in function as argument, print the function name and results

If I want to pass a function func1 as argument in another function, but want to return the function name, what shall I do?  let say  def func1(x):     return x**2  def main_function(func1,x):     .....     return ___(name of func1),value of func1(x)___   which means I want things like:  func_name, result = main_function(func1,2)  print(func_name) func1 print(result) 4


This is not a duplicate of the questions posted   and   It is a duplicate of the question posted  however there is no answer to that question and one of the commenters is wrong about the direction of sharing. I am posting this again to hopefully get a solution for this.  I have enabled internet sharing in OSX via settings -> sharing then clicking on internet sharing. I have tried this using wifi which works just fine, however I am no longer allowed to create a wifi network because security.   My new plan is to use the iPhone USB option to share my Mac's ethernet connection with my iPhone. The setup seems simple and I have selected "Share your connection from: Ethernet" "To computers using: iPhone USB". I don't currently have a connection to the internet. Is there something else I need to do?


If a sequence $\{X_n\}_{n\in\Bbb N}$ satisfies $X_{n+1} - X_n \to 0$, must $\{X_n\}_{n\in\Bbb N}$ be a Cauchy sequence, thus convergent?   Intuitively, if a sequence is convergent (Cauchy), then as $n$ gets larger, the difference between two terms will shrink to $0$. But I feel that $\{X_n\}_{n\in\Bbb N}$ needn't to be Cauchy if $X_{n+1} - X_n \to 0$. I have no idea how to approach it.


Razr Maxx HD, How to wipe data with broken screen

My screen is totally destroyed, it's black and unresponsive. The phone turns on just fine, though. I just got my new phone and I have to send this one back now.  I want to wipe the phone before I send it back, but I'm not sure how. I don't care too much about sending back a rooted phone, it seems Asurion doesn't really care about that from what I've read, but I don't want my personal data on the phone when I send it in.  What are my options to wipe the phone without a screen? I've already read a lot of threads on other forums and here on the subject, but everyone seems to say to wipe through ADB shell. Well, I can see the phone in ADB, but I am unable to enter SU through ADB shell. I assume it's because the screen is locked, and I have no way to unlock it. Others have also said to wipe through fastboot in ADB, but I am seeing conflicting recommendations and I'm not sure how to proceed. I'm not that proficient with ABD, so I want to make sure I don't mess this up.  Any advice would be greatly appreciated.


Ubuntu 12.04 Dual Boot fails to load (black screen)

I have a dual boot Windows 7 + Ubuntu 12.04 system (64 bit).  About a week ago, using GRUB to load into Ubuntu resulted in a freeze at the loading screen.  I could still run into recovery mode, so using the console from that I tried a few solutions I found on the web.     sudo apt-get update     sudo apt-get upgrade     sudo apt-get install fglrx     sudo aticonfig --initial     sudo reboot No luck there. Then I tried updating the Nvidia drivers (GTX 760):  sudo apt-get update sudo apt-get purge nvidia-* sudo apt-get install nvidia-current-updates   Still nothing. In fact, now I just get a black screen with a blinking cursor when I boot into Ubuntu regularly.  I can still boot into recovery mode, and can not find a solution.  Text appears when I shut down off the blinking cursor screen  (it turns purple, and says something like "terminating ubuntu").  I am a new user to linux, and the most advanced thing I've done in terminal is using the nano editor.  This may be important, so about a week before this error started, I used a partition tool to increase Ubuntu's main partition to 100 gigs.  After that, both Ubuntu and Windows still worked normally, until the error described above.  Windows still works fine (Posting this question while in Windows on the same machine).


Do other wizarding schools have different houses?

At Hogwarts, there are four houses: Slytherin, Gryffindor, Hufflepuff, and Ravenclaw.  Do any of the other wizarding schools, like Durmstrang or Beauxbatons, sort their students into separate houses?


If $z$ lies on the circle $|z-1|=1$ then$\frac {z-2} z$ is a purely imaginary number

If $z$ lies on the circle $|z-1|=1$ then $\frac {z-2} z$ is a purely imaginary number. This is what by book states. Did'nt understand why. Can someone help?  Actually I was thinking of a more geometrical approach to the problem, as pointed out by @did and the answer below. I also remembered the method that if $\bar z = -z$ then $z$ is purely imaginary. But can it also be done by visual geometry? Ok, I drew a circle centred at $1$ with radius $1$. The statement given implies $\frac {z-2} z$ equals any point on the semicircle. After that how do we prove its imaginary from there?


Can anyone confirm this: in a SOQL Where clause, when comparing an ID field to a 15-character string variable, the comparison works.  I didn't expect it to work, but it does and I am surprised.  I can't find any documentation to confirm it.  I thought 18-character ID was always in effect, and comparing 18-char ID to 15-char string would fail.  Example (Country__c is a lookup field):  String tmpID = 'a1he0000000EkAi'; Account acct = [select ID from Account where Country__c = :tmpID];


Connect an Apple 24" LED Cinema Display to a PC

Is it possible to connect an Apple 24" LED Cinema Display to a PC?


How can I get a overview and manage the default applications for file types?

Most OSs show a nice summary about which application will be used to open a certain file type. Android does not seem to have such a function.  How can I track and manage the default applications?


From $n=2$ to $n$-ary Euclid lemma $\ p\mid a_1\cdots a_n\Rightarrow\ p\mid a_1\,$ or $\,\cdots\, p\mid a_n$

How to prove a generalized Euclid lemma par induction after proving Euclid lemma? I want to prove the generalized lemma, to prove by rearranging the product of number and use Euclid lemma as a model. A proof will be nicer if it can use induction principle.


In python, how do i create a program that simply gives the list position of whatever is in my list?

For example, lets say I have a list example=[A,B,C,D]  How do I return the value of the position? So for A, I would want a returned value of 0. B would be 1, C would be 2, D would be 3.


I have a lot of necessary files and documents on USB Drive. when i connect it to other PC it gets to as hidden and .EXE. Are there any way to make  them un hidden and cleaned?


How do I iterate over keyframes in python?

I'm trying to export animation data, but my bones never get updated from keyframe to keyframe. This is how I iterate over my actions and keyframes:  for action in bpy.data.actions:     armature.animation_data.action = action     bpy.ops.screen.frame_jump(0)     bpy.context.scene.update()     while {'FINISHED'} == bpy.ops.screen.keyframe_jump():         bpy.context.scene.update()         for boneName in bones_index:             bone = armature.pose.bones[boneName]             mat = glob_mat * mathutils.Matrix(bone.matrix)   The 'mat' variable is the bone matrix for each bone. Per frame, the 'mat' variable doesn't seem to change. For example, if I only look at the bone "Leg", the leg pose matrix doesn't seem to change keyframe to keyframe. The matrix is the correct matrix for frame 0, and it is different from my base pose. Am I not getting the pose matrices correctly? Or am I not correctly changing the scene? In the blender console, bpy.ops.screen.keyframe_jump() does exactly what I want, so I don't think that's the issue.


So, you can use the * as a wild card for all files when using cp within context of a directory.  Is there a way to copy all files except x file?


With all the down voting going on why not have the number next to your profile picture also reflect negative reputation that people including you can't see? Why isn't there a box where they can put why they down voted only you can see?  I notice even if I have a positive reputation after a long year long suspension I still have to be very careful not to get flagged. It is not like when you first start where you can make a few mistakes and get a day or week. If you get suspended it is for another year for any mistake you make. I am trying to fix my early errors but only receive more down votes or something that keeps me in a perpetual state of bans and suspensions. I just want to start fresh.


According to the terse documentation I managed to find, each file in /proc/$PID/fd is supposed to be a symlink to the actual file associated with that file descriptor. However, that doesn't appear to be what's happening.  # ls -l /proc/5678/fd lr-x------ 1 root root 64 Oct 17 13:31 0 -> /dev/null l-xw------ 1 root root 64 Oct 17 13:31 1 -> pipe:[15967534] lr-x------ 1 root root 64 Oct 17 13:31 10 -> pipe:[54468] lr-x------ 1 root root 64 Oct 17 13:31 11 -> pipe:[876576] lrwx------ 1 root root 64 Oct 17 13:31 14 -> anon_inode:[eventpoll] lrwx------ 1 root root 64 Oct 17 13:31 16 -> /lolrus/write.lock lrwx------ 1 root root 64 Oct 17 13:31 3 -> socket:[5487432] lrwx------ 1 root root 64 Oct 17 13:31 4 -> anon_inode:[eventfd] lr-x------ 1 root root 64 Oct 17 13:31 5 -> /dev/urandom ...etc...   Of these, the only paths that actually exist are /dev/null, /dev/urandom and /lolrus/write.lock (which is a normal, regular file).  What the heck are all those other things? I can't find any documentation about them.


What exactly was the nature of the relationship between Jabba the Hutt and Princess Leia?

Jabba the Hutt did a couple of things to Princess Leia, that seem rather unusual for the giant worm-like creature that he is, namely:   Make her wear a metal bikini. Kiss her   Given these two things, what was the full nature of the relationship between them? Specifically, did Jabba make Leia perform some sort of sexual acts with him, or was there something else going on?  From "" we know that a reason for the way Leia was displayed might have to do with a) status and b) Jabba being considered a pervert by some of his fellow Hutt. But this doesn't answer if went any further than this.


converting 1-D list into a 2-D list in Python

Assuming I have a the a list of 9 items,  I want to convert it into a list of 3 by 3 items  from [1,2,3,4,5,6,7,8,9] -> [[1,2,3],[4,5,6],[7,8,9]]  this is the code:  def main():      L = range(1,10)     twoD= [[0]*3]*3     #creates [[0,0,0],[0,0,0],[0,0,0]]      c = 0     for i in range(3):         for j in range(3):             twoD[i][j] = L[c]              c+=1   for some reason this returns   twoD = [[7, 8, 9], [7, 8, 9], [7, 8, 9]]   and I have no clue why, what is making it do this?


When I compiled the code below, the compiler showed an undefined reference to itoa() function. But, when I searched; I found that itoa() is standard. Why is it so?     #include <stdio.h>  #include<stdlib.h>  int main() {    int i;   char buffer [33];   printf ("Enter a number: ");   scanf ("%d",&i);   itoa (i,buffer,10);   printf ("decimal: %s\n",buffer);   return 0;  }


Will the inverse mapping also be continuous?

Suppose a map $f:A\to B$ is continuous and invertible. Will the inverse map $f^{-1}:B\to A$ be always continuous also?


What is the single most influential book every designer should read?


I have following html that is contained in my webpage.
      x      MY TEXT HERE
   How to extract 'MY TEXT HERE' from this html using jquery?  Note: I intend to convert this flashmessage to fancybox popup.


Application use java. When run script, it returns  ./browser.sh ./browser.sh: 7: ./browser.sh: java: not found  I check java version:  java -v The program 'java' can be found in the following packages:  * default-jre  * gcj-4.8-jre-headless  * openjdk-7-jre-headless  * gcj-4.6-jre-headless  * openjdk-6-jre-headless Try: sudo apt-get install <selected package>   Which package should I install?


How to Measure the ROI from SEO Campaigns

How can I measure SEO activities ROI: including on-page and Off-page SEO.  As you know any big business has a common organic traffic growth.  also, SEO can affect direct traffic.  so is there any way to measure SEO ROI campaigns?


A story about a computer virus and blinking network card lights

So, I'm trying to find this story about some two engineers in a lab or server room which are detecting some unusual network anomalies but can't pinpoint them. Eventually they see that an old network card which has blinking LED-s is indicating some traffic is happening, and they manage to find a virus in the network. But it is completely benign, not doing any outages or harm, just running in the background and slowly spreading. Whatever they try, they can't remove it, almost like it's learning how to bypass their countermeasures. The story ends with the hard truth that they just let it be, and hope it doesn't evolve into something evil. Does someone remember it? Or know where to find it? I've seen it on some old-looking site, having just text, much like RFC specifications (e.g. )


Why did Mycroft have to break into a facility that he has authority over?

In The Final Problem, Sherlock, John and Mycroft trick their way into the facility at Sherrinford. Once captured, Mycroft reveals himself and begins to demand an account of events from the governor.  Since the whole facility is accountable to Mycroft anyway, why does he have to trick his way into Sherrinford?


Why does the log transformation bring data closer to normal distribution?

Quite often in published research we see researchers apply log transformation to their data, and some claim that this makes the data closer to normal distribution. My questions are:  Mathematically, why this might be true? In particular, it would be great if you could illustrate how log transformation brings the characteristics of the sample or data (such as: dispersion, skewness, etc. ) closer to those of a normal.  Does it always bring data closer to normal (Or, are there situations in which it fails)?


how to declare a structure with large structure arrays inside it

#include <stdio.h> #include <stdlib.h> #include <string.h>  #define     MAXNO   1000  typedef struct {     int     n;     char    site[4]; } stru;  typedef struct {     stru t1[MAXNO];     stru t2[MAXNO]; } struall;  int main() {     struall tmp;     int i;     printf("%d\n",i);     return 1; }   Hi everyone, I am trying to declare a structure variable which has two structure array members inside it. If the array size (MAXNO) is small, i can compile successfully. However, if the array size is very large (define MAXNO as 1000000), the declaration fails with segmentation fault.  Can anyone tell me the reason?  Thanks a lot!


suggested-edit doesn't show correct edit

The  was rejected by community.    However, the edit shows incorrect.  I added the line which shows    and your call would be  ShowMessage(message As String, type As MessageType)     This line was put into the answer, but my edit was rejected.  I'm not sure what happened and why the edit shows incorrect.  Can someone explained what happened here?


Why does SharePoint always prompt me to download SharePoint Designer when I already have it installed?

For example, if I click Edit page -> Edit in SharePoint Designer from within my SharePoint site, I'm always presented with a dialog prompting me to download Designer.  I already have Designer installed.  Seems like it should a.) launch it for me, or b.) at least stop prompting me to  download it.  UPDATE: Turns out this stemmed back to the 64-bit IE compatibility issue that was causing me grief here:


In the following definition of Almond Joy, should "from" or "of" be used?     a type of chocolate bar in the US which is made from/of coconut and almonds   I'd appreciate your help.


Not enough empty space for isolation gap, can a pcb cut works as substitute?

I have a pcb that needs an isolation gap where no components, pads, taces, or copper must be placed. But due to board space limitation, a cetain area of the isolation gap must have pads in them. This would compromise the isolation. To get back the isolation specification, I was thinking of placing a slit in that area as a substitute. Because i would assume that air has better insulation than the PCB FR4 material. In the image below the hight of the gap is 10mm. So i am thinking of placing an air gap of aroun 1-2mm thickness and make sure that the shortest route between pad-pad around that slit is more than 10mm  Am i doing think correctly?


When should I publish in interdisciplinary versus subject-specific scientific journals?

Most science research is published in subject-specific journals, of which there are many. However, there are a relatively small number of interdisciplinary journals, some of which are the most highly cited of all journals (Nature, Science); others have impact factors comparable to subject-specific journals (e.g., PLOS ONE, J. R. Soc. Interface, etc.).  If we discount arguments around open science and similar business model arguments (which could favor journals like PLOS ONE), and assume that the purpose of publishing is simply to get your research read (and cited) by the largest "relevant audience", when should one publish in an interdisciplinary journal versus a subject-specific journal (assuming they have comparable impact factors)? (Are there any papers out there that compare the fate of publications [or their authors!] in the two different types of journal?)  Thanks in advance.


Given the hash of a blob, is there a way to get a list of commits that have this blob in their tree?


I'm in need of help with this problem. I've been reviewing for an exam and I'm terrible with estimations.  $X_1,X_2,\dots,X_n$ be an i.i.d sample from continuous uniform distribution on the interval $(0,\theta)$ with parameter $\theta>0$. Let us consider $Y=\max(X_1,X_2,\dots,X_n)$ has a c.d.f $F(y) = P(Y \le y) = (\frac y \theta)^n$; $0<y<\theta$.  Is $Y$ an unbiased estimator for $\theta$?  I've made attempts but I think I'm going the opposite directions.  My attempt so far:   $$n\over{(n-r)!(r-1)!}[F(y)^{r-1}][(1-F(y))^{n-r}]f(y)$$


how can you tell which version of an Ubuntu package includes a particular patch?

If a system requires a patch that I found upstream, how can I tell which version of an Ubuntu package contains the commit that includes that patch?


Why would one drive LEDs with a common emitter?

I've seen tutorials aimed at beginners suggest the way to drive an LED from something without enough current drive is this:   (option A)  but why not this:   (option B)  Option B seems to have some advantages over option A:   fewer components the transistor does not saturate, leading to a faster turn-off the base current is put to good use in the LED, instead of making the base resistor warm   and the advantages of option A seem to be few:   brings the load closer to the supply rail   but when Vcc is significantly greater than the forward voltage of the LED, this hardly matters. So, given these advantages, why would option A be preferred? Something I'm overlooking?


How can I recover deleted photos from memory card?

A few days back I found that the photos I have saved in my memory card have been lost. I don’t know what is the reason behind the deletion of photos but I just want them back.   How can I restore my lost photos?


Add text from file into root owned hosts file

I am trying too add some text into my host file. I tried this. echo xx | sudo -S cat AddTo_hosts.txt >> /etc/hosts  I still get permission denied. How can I get it to work?


Adverb placement, before or after the verb

first time on this side of the StackExchange.  Quick question:     My dream is to code a chess game, and then have the AI I developed   checkmate me legitimately.   vs.      My dream is to code a chess game, and then have the AI I developed   legitimately checkmate me.   Also, is that comma okay to add pacing to the sentence?


wiring a bathroom exhaust fan to a continuous circuit

We are adding a bathroom fan to our bathroom that never had one.  We found power from the attic that we may be able to use.  This power joins the hallway ceiling light to the hallway switch.  We would be using a 2 pole switch (top switch for vanity light and bottom switch for exhaust fan). Is it possible to take power from that attic power? If so how and would we need 12/3 wire.


Duplicate content concerns for directory listings?

I run a local business directory site with client profile pages structured geographically. I also have a media network to share our listings across other directory sites.   Does having our client page content distributed to a broader media network of sites affect our SEO?   Are their duplicate content concerns with sharing client descriptions with directory sites across the web?


De Moivre Complex Roots: Definition of $i$ or $\sqrt {-1}$

Does $\sqrt{-1}=\pm\sqrt{-1}$ since it has 2 solutions for roots? Note the link says there are two complex square roots for -1 which are $i$ and $-i$ .


Initialize a matrix (that is, a list of lists) in Python

I wish to initialize a list of lists using something like [[0]*n]*n. But something happened that I don't quite understand -- see the interactive iPython session below for my problem:      In [1]: a=[[0]*3]*3  In [2]: a Out[2]: [[0, 0, 0], [0, 0, 0], [0, 0, 0]]  In [3]: a[1][1]=3  In [4]: a Out[4]: [[0, 3, 0], [0, 3, 0], [0, 3, 0]]   ==> WHY setting a[1][1] resulted in the above? (That is, it is setting the whole COLUMN to 3)  In [5]: b=[[0, 0, 0], [0, 0, 0], [0, 0, 0]]  In [6]: b Out[6]: [[0, 0, 0], [0, 0, 0], [0, 0, 0]]  In [8]: b[1][1]=3  In [9]: b Out[9]: [[0, 0, 0], [0, 3, 0], [0, 0, 0]]   ==> That is working fine!


Sightseeing in Japan as an Indian Citizen holding a US F-1 visa

I currently have a US F-1 visa who needs to travel to India. I was hoping to take a layover in  Japan. Will I require a transit visa to go sightseeing in Japan and how can I get one in the USA or can I get one at Japanese airports as well?  I have been told by the Consulate General that they require my I-20 and F-1 visa as well. Why is all this documentation required?


I have this nut that is attached to my bed. However, I don't have access to the bed and hence need to guess the size of this nut so that I can buy the tools for it. Anyone know roughly how big this nut is and what size spanner I would need?   I'm planning on buying this wrench set and would like to know if one of them would fit this nut.   Thanks in advance :)


Not logging in with correct password and username

My ubuntu 18.4.1 is not logging in. I tried to change it from root user from grub menu but after doing this successfully the result is same .When i login with tty3 with same password it is login in but not login in GUI screen


Why my website doesn't appear in Google search results?

I've made a simple website for a friend's bakery and it doesn't appear in Google's search results even if I search for the whole domain name of the site.  What can be the problem?  How to make it appear?


I want to downgrade my iPhone from iOS7 to 6.1.3 and I need help.. I keep getting an error 3194 when I do it. I tried everything and doesn't work!!!


I want to to shift  a signal which is varying from 1.2 to 3.3 volts ( a shifted square wave) to some other ground. I don't how to do this. Frequency of this signal is 10 kHz with duty cycle around 10-60%. And signals should be galvanic isolated.


Can I specify both, the function prototype and function definition in a header file (in C++)?

I would like to clarify if I can specify, both the function prototype and the function definition in a header file?   Is it necessary for me to create a source file to define the functions which are declared in a header file?   Thank you...


PHP Results in Email with Cyrillic characters

I have used a php form for a while now and have got good results.   From here:   Issue I now have is that I have users now in Russia and results are coming to me in some garbled format such as "Ð¥ÐµÐ»ÑŒÑÐ¸Ð½ÐºÐ¸" instead of Russian text.  Can anyone advise how to edit the php from that link above so that the results would come to me as plain text email including Russian characters?  I guess its something to do with not having any reference to UTF-8 but I have no idea how to implement that.  Thanks ...


Permissions error on mounted symbolic link

Ive created a symbolic link to a mounted NFS drive to Apache's "images" folder:  ls -ltr /var/www/html/images   /var/www/html/images -> /mnt/mount_name/images   Edit: Ive added the namei command output as @Thomas suggested:    namei -olm /mnt/mount_name/images/   f: /mnt/mount_name/images/   dr-xr-xr-x root       root       /   drwxr-xr-x user user mnt   drwxrwxrwx user user mount_name   drwxrwxrwx user user images   When i trying to access an image on that path i am receiving the error below:       Permission denied because search permissions are missing on a component of the path.   I tried to look for solutions to the problem but encountered several different solutions, Please advice.  Regards, Yarone


Conditional Probability vs Dependent Events

I'm conceptually/intuitively confused about when we would use the joint probability (multiplication rule) versus a conditional probability, specifically when the dependent event has no chance of occurring without the other event. Here's an example that illustrates my confusion: Suppose we have a weird city, where there's a 20 percent chance of rain (so a 80% chance of any other weather). Now suppose that it can only rain frogs when it rains, and there's a 10% chance of frogs. Why can we not use bayes rule to model: $$Pr(frogs | rain) = \frac{Pr(rain | frogs)\cdot Pr(frogs)}{Pr(rain)} = \frac{1 \cdot 0.1}{0.2}$$ I know the correct way of doing it would be the multiplication rule, but why can we not use a conditional probability? We know that the probability of raining frogs is 0.1 because it cannot occur in any other scenario other than when it rains, and if there are raining frogs, we must have rain so $Pr(rain | frogs)=1$. And we also have $Pr(rain)=0.2$, so it seems like we have everything we need for conditional probability. The correct answer would of course be $0.2\cdot0.1=0.02$. What am I missing aside from the nonsensical results? Edited for sensical numbers, but assume that the probability of raining frogs is just the proportion of days on which it rains.


Why does unlocking bootloader require erasing userdata?

I unlocked the bootloader in my OnePlus 5 right after it was delivered, so there was nothing to erase. Then I flashed TWRP and SuperSU. It comes with DM-Verity (and /data force encrypted). I tried re-locking, but later I have to erase all data again before unlocking bootloader. So the questions are:   Why is it required to erase all data when unlocking bootloader? Even with device encryption on? Can I avoid the erase?


I cannot install google-musicmananger-beta via apt-get (Hash sum mismatch error)

Please refer to the "screen capture" below.  When trying to install google-musicmanager-beta via apt-get, I get a "Hash sum mismatch". Any ideas what could be wrong?  edit1: I deleted all contents of the apt cache and run apt-get update again and still not working.  sudo rm -rf /var/lib/apt/lists/*   edit2: I downloaded the .deb file shown when running apt-get install and I was able to successfully install it!  screen capture  root@chiyo-VirtualBox:~# cat /etc/apt/sources.list.d/google.list  deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main deb http://dl.google.com/linux/musicmanager/deb/ stable main  root@chiyo-VirtualBox:~# apt-get --quiet --yes update Hit:1 http://au.archive.ubuntu.com/ubuntu xenial InRelease Hit:2 http://au.archive.ubuntu.com/ubuntu xenial-updates InRelease Hit:3 http://au.archive.ubuntu.com/ubuntu xenial-backports InRelease Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease Ign:5 http://dl.google.com/linux/musicmanager/deb stable InRelease Get:6 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB] Hit:7 http://dl.google.com/linux/chrome/deb stable Release Hit:9 http://dl.google.com/linux/musicmanager/deb stable Release Fetched 94.5 kB in 1s (61.3 kB/s) Reading package lists...  root@chiyo-VirtualBox:~# apt-get --quiet --yes install google-musicmanager-beta Reading package lists... Building dependency tree... Reading state information... The following additional packages will be installed:   libqt4-opengl libqtwebkit4 The following NEW packages will be installed:   google-musicmanager-beta libqt4-opengl libqtwebkit4 0 to upgrade, 3 to newly install, 0 to remove and 0 not to upgrade. Need to get 4,362 kB/13.7 MB of archives. After this operation, 55.1 MB of additional disk space will be used. Get:1 http://dl.google.com/linux/musicmanager/deb stable/main amd64 google-musicmanager-beta amd64 1.0.243.1116-r0 [4,362 kB] Err:1 http://dl.google.com/linux/musicmanager/deb stable/main amd64 google-musicmanager-beta amd64 1.0.243.1116-r0   Hash Sum mismatch Fetched 4,362 kB in 2s (1,971 kB/s) E: Failed to fetch http://dl.google.com/linux/musicmanager/deb/pool/main/g/google-musicmanager-beta/google-musicmanager-beta_1.0.243.1116-r0_amd64.deb Hash Sum mismatch  E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?  root@chiyo-VirtualBox:/var/lib/apt/lists$ cat dl.google.com_linux_musicmanager_deb_dists_stable_main_binary-amd64_Packages Package: google-musicmanager-beta Version: 1.0.243.1116-r0 Architecture: amd64 Maintainer: Google Music Team <googleplay-support-music@google.com> Installed-Size: 16490 Pre-Depends: dpkg (>= 1.14.0) Depends: libc6 (>= 2.16), libexpat1 (>= 2.0.1), libflac8 (>= 1.3.0), libgcc1 (> = 1:4.1.1), libidn11 (>= 1.13), libqt4-network (>= 4:4.5.3), libqtcore4 (>= 4:4 .8.0), libqtgui4 (>= 4:4.8.0), libqtwebkit4, libstdc++6 (>= 4.6), libvorbisfile 3 (>= 1.1.2), xdg-utils (>= 1.0.2) Conflicts: google-musicmanager Replaces: google-musicmanager Provides: google-musicmanager Section: net Priority: optional Filename: pool/main/g/google-musicmanager-beta/google-musicmanager-beta_1.0.243 .1116-r0_amd64.deb Size: 4361868 SHA1: 8a8e9434f3ccb778c761f983ec1196ad4a4701c0 MD5sum: 4537c0f2bdf57eee7d576b7b0a42d083 Description: Google Music uploader.  Google Music Manager is a simple application for adding the music files on your computer to your Music library.


I need to have a uniq map object to store key-vlaue globally. So I created a class with a static unordered_map as the member, my code as following please: class PopMap {     public:         static unordered_map<string, string> dataMap;         PopMap(){};         ~PopMap(){}; }; int main(){     PopMap::dataMap["name"]="Tom";     return 0; }   But I got the following exception: undefined reference to PopMap::dataMap


Setting the DPI value in rendered images

I'm in trouble with finding a way to set DPI value of files within Blender. I have set up an automated workflow to generate image files for printing, but the volume is too high to open and change the DPI value of each image separately. (PNG for example)


Sorry, I am new to this , but the app I am developing keeps on crashing after I go to a certain menu, can you teach me on how to fix it? Here is my logcat together with my coding and xml file below:  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference         at com.example.TTTTT.ifelse.alarm.onCreate(alarm.java:27)   Code:          btnAlarm1 = (Button) findViewById(R.id.btnAlarm);         btnstop = (Button) findViewById(R.id.btn1);         txtSeconds1 = (EditText) findViewById(R.id.txtSeconds);          btnAlarm1.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View view) {                 try {                     int i = Integer.parseInt(txtSeconds1.getText().toString());                     Intent intent = new Intent(alarm.this, AlarmReceiver.class);                     PendingIntent pendingIntent =                             PendingIntent.getActivity(alarm.this, 2, intent, PendingIntent.FLAG_CANCEL_CURRENT);                     AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);                     am.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + (i * 1000), pendingIntent);                      if (mToast != null) {                         mToast.cancel();                     }                     mToast = Toast.makeText(getApplicationContext(), "Alarm set in:" + i + "seconds", Toast.LENGTH_LONG);                     mToast.show();                  }catch (NumberFormatException e)                 {                     if (mToast != null)                     {mToast.cancel();}                     mToast = Toast.makeText(alarm.this, "Enter Number", Toast.LENGTH_LONG);                     mToast.show();                     Log.i("MainActivity", "Number format exception");                 }             }          });         btnstop.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 Intent intent = new Intent(alarm.this, AlarmReceiver.class);                 PendingIntent pendingIntent = PendingIntent.getActivity(alarm.this, 2, intent, PendingIntent.FLAG_CANCEL_CURRENT);                 AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);                 am.cancel(pendingIntent);                  if (mToast != null) {                     mToast.cancel();                 }                 mToast = Toast.makeText(getApplicationContext(), "Alarm Cancelled!", Toast.LENGTH_LONG);                 mToast.show();             }         });      }   }  *Xml file here    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context="com.example.TTTTT.ifelse.Alarm">     <EditText     android:id="@+id/txtSeconds"     android:inputType="number"     android:layout_width="match_parent"     android:layout_height="wrap_content" />     <Button     android:text="Set Alarm"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:id="@+id/btnAlarm"     android:layout_below="@+id/txtSeconds"     android:layout_centerHorizontal="true" />      <Button     android:text="Stop Alarm"     android:id="@+id/btn1"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_below="@+id/btnAlarm"     android:layout_centerHorizontal="true" />       </RelativeLayout>*


Get agent to move using commands stored in separate file?

I have a script that allows a cube to be moved using WASD. I'd like to avoid having to use actual keyboard input for that and thought about creating a separate file with commands like "Wkey" and such. I'd then have a function read through the file and have the agent respond to the commands in the file accordingly. Is this possible/if so, how would I go about doing it? (New to blender/still relatively new to python honestly)  Script below:   import bge   def main():      cont = bge.logic.getCurrentController()     own = cont.owner      keyboard = bge.logic.keyboard      wKey = bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.WKEY]     sKey = bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.SKEY]     aKey = bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.AKEY]     dKey = bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.DKEY]      if wKey:          own.applyMovement([0,0.2,0],True)      if sKey:          own.applyMovement([0,-0.2,0],True)      if aKey:          own.applyMovement([-0.2,0,0],True)      if dKey:          own.applyMovement([0.2,0,0],True)  main()


Hello i'm very new to C++ and have run into quite a problem, so i have written a simple function to return a players x, y & z origin, here it is:  float Orgx, Orgy, Orgz; const float* ReturnORG(Vector3 Blah) {     float Orgx = Blah.x;     float Orgy = Blah.y;     float Orgz = Blah.z;      return (float)((Orgx), (Orgx), (Orgx)); }    the problem is that i get an error saying:  "Error: return value type doesn't match function type"   I Can't seem to figure out what I'm doing wrong, any suggestions?


Irreducibility check for polynomials not satisfying Eisenstein Criterion.

My Question is to check Irreducibility for polynomials not satisfying Eisenstein Criterion.  As an Illustration, to check whether $x^{p-1}+.....+x+1$ for p a prime is irreducible or not, we replaced $x$ by $x+1$ and by using Eisenstein's Criterion for the resulting polynomial we conclude that resulting polynomial is irreducible and so is the original polynomial.  In general, for a given irreducible polynomial $f(x)$ with coefficients in a known U.F.D, is there some element $a$ such that we can apply Eisenstein's criterion to $f(x+a)$?  I am sure there would be no general structure for this but I expect there to be at least some special cases.   Any Reference/suggestion would be appreciated.  Thank You.


How do I filter all HTML tags except a certain whitelist?

This is for .NET. IgnoreCase is set and MultiLine is NOT set.  Usually I'm decent at regex, maybe I'm running low on caffeine...  Users are allowed to enter HTML-encoded entities (<lt;, <amp;, etc.), and to use the following HTML tags:  u, i, b, h3, h4, br, a, img   Self-closing <br/> and <img/> are allowed, with or without the extra space, but are not required.  I want to:   Strip all starting and ending HTML tags other than those listed above.  Remove attributes from the remaining tags, except anchors can have an href.   My search pattern (replaced with an empty string) so far:  <(?!i|b|h3|h4|a|img|/i|/b|/h3|/h4|/a|/img)[^>]+>   This seems to be stripping all but the start and end tags I want, but there are three problems:   Having to include the end tag version of each allowed tag is ugly. The attributes survive. Can this happen in a single replacement? Tags starting with the allowed tag names slip through. E.g., "<abbrev>" and "<iframe>".   The following suggested pattern does not strip out tags that have no attributes.  </?(?!i|b|h3|h4|a|img)\b[^>]*>   As mentioned below, ">" is legal in an attribute value, but it's safe to say I won't support that. Also, there will be no CDATA blocks, etc. to worry about. Just a little HTML.  Loophole's answer is the best one so far, thanks! Here's his pattern (hoping the PRE works better for me):  static string SanitizeHtml(string html) {     string acceptable = "script|link|title";     string stringPattern = @"</?(?(?=" + acceptable + @")notag|[a-zA-Z0-9]+)(?:\s[a-zA-Z0-9\-]+=?(?:([""']?).*?\1?)?)*\s*/?>";     return Regex.Replace(html, stringPattern, "sausage"); }   Some small tweaks I think could still be made to this answer:   I think this could be modified to capture simple HTML comments (those that do not themselves contain tags) by adding "!--" to the "acceptable" variable and making a small change to the end of the expression to allow for an optional trailing "\s--". I think this would break if there are multiple whitespace characters between attributes (example: heavily-formatted HTML with line breaks and tabs between attributes).   Edit 2009-07-23: Here's the final solution I went with (in VB.NET):   Dim AcceptableTags As String = "i|b|u|sup|sub|ol|ul|li|br|h2|h3|h4|h5|span|div|p|a|img|blockquote"  Dim WhiteListPattern As String = "</?(?(?=" & AcceptableTags & _       ")notag|[a-zA-Z0-9]+)(?:\s[a-zA-Z0-9\-]+=?(?:([""']?).*?\1?)?)*\s*/?>"  html = Regex.Replace(html, WhiteListPattern, "", RegExOptions.Compiled)   The caveat is that the HREF attribute of A tags still gets scrubbed, which is not ideal.


Why is the normal vector to the surface $f$ given by $\text{grad}(f)$?

According to my lecture notes, the normal vector to a surface $f$ is given by $\text{grad}(f) = \underline{\nabla} f$. However, surely the normal vector to the surface $f$ should be perpendicular to the vector $\underline{\nabla}f$?


Prove that $f$ is one-to-one iff $f \circ h = f \circ k$ implies $h = k$.

Let $f: A \to B$ be a function. Prove that $f$ is one-to-one if and only if $f \circ h = f \circ k$ implies $h = k$, for every set $C$ and all choices of functions $h: C \to A$ and $k: C \to A$.  Here is my work:  Assume that $f$ is one-to-one and let $A = \{x_1, x_2\}$ for two arbitrary $x_1, x_2$. So we have $f(x_1) = f(x_1)$ and $x_1 = x_2$. Assume $h$ and $k$ are one-to-one. (Is that okay assume that they are one-to-one?) And let $C = \{z_1, z_2\}$ so we have $h(z_1)=h(z_2) = x_1$ and $k(z_1) = k(z_2) = x_2$ since $h: C \to A$ and $k: C \to A$.  If we substitute $h(z)$ and $k(z)$ into $x_1$ and $x_2$ respectively, we have $f(h(z)) = f(k(z))$. It follows $f \circ h = f \circ k$ implies $h = k$.  Conversely, we assume that $f \circ h = f \circ k$. It follows $f(h(z_1))=f(k(z_2))$ follows $z_1 = z_2$. Hence we can conclude that $h$ and $k$ are one-to-one. Since we know $h: C \to A$ and $k: C \to A$, ($x_1$ and $x_2$ are elements of $A$) and $h(z_1) = x_1$ and $h(z_2) = x_2$. Since $h(z_1)=k(z_2)$ implies $x_1 = x_2$ and since these two elements are in $A$, $f$ is onto.  I know it is hard to read, but I really need your help to check my ambiguous proof. I know some part are wrong, so please let me know. Thank you very much.


How to delete parent folder on Windows 7 VM, without deleting child files first?

UPDATE: I know this has been marked as a duplicate, but none of the following duplicate answers have worked (including restarting):        This works: , but my original post is asking how to get around this specific hack...  My setup: OSX Mountain Lion, Parallels, Windows 7 VM, Visual Studio Ultimate 2013  The problem that I have is that when I open Visual Studio to make a new solution/project, whether or not I add files or work for however long, then close Visual Studio completely, and I want to delete the root solution/project folder that was created by Visual Studio, Windows tells me that I cannot delete that folder and tells me "You'll need to provide administrator permission to delete this folder".  However, if I go into that same root solution/project folder and delete all the files in there first, which it lets me do no problem, then back up, it then allows me to delete the root solution/project folder without issue.  I have no idea how to delete that folder without going in and doing that hack.  I should note that I am also a programming teacher who creates multiple solution/project folders everyday and then deletes them afterwards, so this is really getting annoying at this point.  Is there something I am missing with: Windows permissions, Visual Studio settings, special hidden files, locked files, etc. that is creating this situation?  I have asked people who use Visual Studio 2013 and Windows 7 without VM and they have never seen the issue, so I suspect it has something to do with the VM part of this...   Note: I am an administrator on both systems and installed everything myself.  If I turn on the "Owner" column in Windows Explorer, it shows that I am the owner of all files created in the folder.  Using Visual Studio itself, I've had no problems; only this problem exists.  Screenshots:


Is 172.20.0.2/24 an ip address or subnet?

Can we also assign a subnet to a computer as an ip address?