Best way to capture historical changes between levels in a dimensional hierarchy

What is the cleanest way to capture changes between levels in a dimensional hierarchy?  I have the dimensional hierarchy [Area] > [Region] > [Location], where Area is the parent to Region and Region is the parent to Location. Location is lowest level of the hierarchy, and is associated with the fact table.  The business rules are: Locations are able to change the Region they are assigned to based on business need. Furthermore, Regions are able to change the Area they are assigned to.  We want to capture those changes so that when we do historical analysis, we can compare business metrics before and after a Location changed its Region, and a before and after a Region changed its Area.  What is the best way to do this?  The four ways that I have come up with all seem to have major drawbacks:   Using a bridge table between hierarchy levels requires that you use time bounds (effective start/end dates) to correctly identify which parent a child belongs to as you walk up the hierarchy. That makes queries prone to error, especially with hierarchies with many levels. Versioning a child record whenever its relationship to its parent changes (e.g., versioning Region A when it moves from Area A to Area B) and then cascading that change all the way down the hierarchy (e.g., creating new versions of Locations tied to Region A so that they are tied to the new Region A). Updating the child record's reference to the parent record, making you use time bounds to reassemble the correct history (prone to error). Always use time bounds when querying up the hierarchy to make sure Location A is associated with the correct Region (likewise, Region A is associated with the correct Area) for the moment of the fact being analyzed.   None of these seems clean to me.  Is there a better way?  Thanks a lot


Let A $\subset$ S, B $\subset$ S prove the following:  A $\subset$ B if and only if A $\cup$ B = B  I don't know how to prove this.....


I cannot change my username because I have images in the description

Consider the following story: User Alice has a Stack Overflow account having a good reputation. When Alice creates a new account on another site from SE platform she will get 101 points of reputation because of association bonus (that is 100). On Stack Overflow Alice has images in profile description. On the new account the Stack Overflow profile will be cloned having the same images. In the new account Alice opens a bounty of 100 points and award the points to Bob. Alice remains with 1 point of reputation. Now the problem: Alice wants to change her username. She changes her username in the textbox and clicks Save Profile button. She will get the following error:  Oops! There was a problem updating your profile:  we're sorry, but as a spam prevention mechanism, new users aren't allowed to post images in their profiles. Earn more than 10 reputation to post images.    Is really Alice a new user not to be able to post image in her profile just because she awarded a bounty of 100 points to Bob? Is this a good reason for what Alice will have to change her profile description? Why until changing her username was Alice allowed to have images in her profile description even she had only 1 point of reputation? I do not agree with this...


Why do floating-point numbers have roundoff errors?

I have been struggling to understand the concept of roundoff errors in Java with floating-point. While I understand that double is not supposed to be used for financial calculations, I don't understand why the 'd' variable does not come out to 0.0. How can I get this to print out the first println?  package zetcom;  public class floatingComparison { public static void main(String[] args) {     double r = Math.sqrt(2);     double d = r * r - 2;      if (d == 0)     {         System.out.println("sqrt(2) squared minus 2 is 0");     }     else     {         System.out.println("sqrt(2) squared minus 2 is " + d);     }   } }   Any explanation would be appreciated.


Continuous function, mapping of a set to itself

Let $f: [0,1] \rightarrow [0,1]$ be continuous. Any idea on how we can prove that it is not possible for $f$ to map $[0,1]$ onto $[0,1]$ exactly two-to-one. That is, there is no continuous $f$ as above such that for each $y \in [0,1]$, there are exactly two values $x_1$ and $x_2$ such that   $$y = f(x_1) = f(x_2)$$


How to interpret F- and p-value in ANOVA?

I am new to statistics and I currently deal with ANOVA. I carry out an ANOVA test in R using  aov(dependendVar ~ IndependendVar)   I get – among others – an F-value and a p-value.   My null hypothesis ($H_0$) is that all group means are equal.   There is a lot of information available on , but I don't know how to read an F-statistic and how F and p are connected.   So, my questions are:   How do I determine the critical F-value for rejecting $H_0$? Does each F have a corresponding p-value, so they both mean basically the same? (e.g., if $p<0.05$, then $H_0$ is rejected)


Null pointer exception in setting font in Java

I am encountering some issue while trying to set font for drawing string function in Java. My goal is to draw something on image using function drawString(text, posLeft, posTop); where text is the string, and posLeft and posTop are positions of it from left and top of the screen. In that purpose i have following code:          Icon icon = new ImageIcon(image);                             image.getGraphics().setFont(new Font("Arial", Font.BOLD, size));         image.getGraphics().setColor(c);         image.getGraphics().drawString(text, posLeft, posTop);                  image.getGraphics().dispose();   where image is instance of java.awt.BufferedImage class object, icon is instance of javax.swing.Icon with constructor of class javax.swing.ImageIcon.ImageIcon(Image image). Font is of the class java.awt.Font. Then i'm getting graphics with image.getGraphics(), however null pointer exception occurs while trying to set font part, in line image.getGraphics().setFont(new Font("Arial", Font.BOLD, size)); . The error message is only java.lang.NullPointerException: null. I tried changing font but it is still the same. Would very appreciate any help regarding this! (hope i didn't miss some important part) Both image and image.getGraphics() are working, since i checked it in the code and got following: BufferedImage@3c52b5ae: type = 5 ColorModel: #pixelBits = 24 numComponents = 3 color space = java.awt.color.ICC_ColorSpace@35069130 transparency = 1 has alpha = false isAlphaPre = false ByteInterleavedRaster: width = 659 height = 587 #numDataElements 3 dataOff[0] = 2 ---- sun.java2d.SunGraphics2D[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12],color=java.awt.Color[r=255,g=255,b=255]] ----  where first part above--- is image, and later is image.getGraphics(). Also, I tried using Font f=new Font('Arial',Font.BOLD,size), and there i firstly got null pointer exception and some null value occurring there.


How can this be proven? $$ \int_0^1 \int_0^1...\int_0^1 min(x_1,x_2,...,x_n) dx_1dx_2...dx_n = \frac1{n+1} $$  I tried to split the last integral in $$\int_0^{min(x_1,x_2,...,x_{n-1})} x_ndx_n + \int_{min(x_1,x_2,...,x_{n-1})}^1 min(x_1,x_2,...,x_{n-1})dx_n$$  And then continue in this manner.  So the function that remains to be integrated satisfies this recurrence relation $$ f_n = (1-x)f_{n-1} + \int f_{n-1}  $$  I then thought to use the following notation   $$I_n = \frac{ (-1)^{n+1}x^n }{n} +  \frac{ (-1)^{n}x^{n-1} }{n-1} $$  If we compute the last integral, the n-1 integrals apply to $I_2$ If we apply another integral we get $I_3+I_2$ and so on, which will look like Pascal's triangle. But I can't go any further.


I know that it is a very old question but still I don't find any satisfactory solution for . Please explain me the fundamentals of Achilles paradox in terms of stage wise distance covered. Note that it is easily solvable in terms of time, but if you start analysing this event in terms of time, then there is not at all any paradox. So please explain in terms of stage wise distances only.


Infinite loop when calculating compound interest

I'm learning to code in python and I created a code to calculate the amount of a debt its compound interest and the instalments to pay the debt. The code works fine with small amounts but if I go over 10k with the debt the program gets into an infinite loop, can anyone help? Code below: print('Debt')  a = float(input('Debt amount: $ ')) b = float(input('interest rate: % ')) c = float(input('monthly instalment: R$ ')) b /= 100 x = 0 div = a ttp = 0  while div > 0:     inte = div*b     div = (div + inte) - c     x += 1  ttp = (c*x) + div print ('The total of months to pay out the debt was: %d\nThe total paid was: R$%.2f ' % (x, ttp)) print('The total paid in interest was: $ %.2f' % (ttp-a))


Book, it follows a guy in a dystopian future

I think the guy was a private investigator. He has a sex change girlfriend, takes pills to get different boosts of sorts and has pills to give them a softer let down, I remember triangle and star shaped pills I think? I was thinking the triangle pills were blue.   Most also have a jack in port in their head that lets them gain new info and know things. This might be wrong, but I think he was one who had avoided getting a brain port, but in the course of the book he got one. I do remember that at the end he gets in a fight and plugs a black chip into his port and goes feral. He doesn't remember anything, but they tell him it looks like an animal had killed everyone there, everyone he knew was disgusted with it and left him basically under the power of the manipulator who had gotten him the black chip.  I found out later that this is part of a series of books, not sure how long. I read it 15 years ago or so, sorry if my details are lacking.


Prove that if I is a prime ideal of R then I[x] is a prime ideal of R[x]

Prove that if $I$ is a prime ideal of $R$ then $I[x]$ is a prime ideal of $R[x]$.   This is homework. I have been trying to assume that there is an $fg$ in $I[x]$ such that neither $f$ nor $g$ is in $I[x]$. Hence $f$ and $g$ have at least one coefficient not in $I$. I was trying to show that $fg$ would then have a coefficient not in $I$, obtaining a contradiction. But I don't see how to control the terms. If $f$ and $g$ had only one coefficient not in $I$, then I think I could use the properties of the ideal to complete the proof. The problem is not being able to know for certain which if any of the coefficients of $f$ and $g$ are in $I$.  Perhaps my approach is wrong to begin. Please help. Even a hint in the right direction will much appreciated.


characteristic function in probability theory

Suppose $\mu$ is a probability measure and $f$ is its characteristic function. Suppose $f$ has finite first order derivative at $t=0$, can you conclude that $\mu$ has finite expectation?  I know that if $f$ has a finite derivative of even order $k$ at $t=0$, then $\mu$ has a finite moment of order $k$. But I am not sure whether $\mu$ has finite expectation and how to prove it.  Can anyone help me?


Java postfix calculator. Cannot push to stack?

I am trying to make a postfix calculator in Java. I am using a Java stack. Everything seems to work fine except that I seem to be unable to push onto the stack. Here is my method that would push to the stack and calculate the given equations:      private void jButtonEqualsActionPerformed(java.awt.event.ActionEvent evt) {                                                   // TODO add your handling code here:     //Postfix calculations done here     Stack<String> jStack = new Stack<>();     String field = jTextField1.getText();     char ch = 0;       for (int c = 0; c < field.length(); c++)      {          ch = field.charAt(c);          System.out.println(field );          System.out.println(ch );           //check for an integer, if its valid, push it onto stack          if (ch >= 0 && ch <= 9)          {              System.out.println("pushing an integer to the stack." );              jStack.push(Character.toString(ch));          }           //check for operators and calculate accordingly          else if( Character.toString(ch) == "+" )        {             System.out.println("popping from stack" );             int rVal = Integer.parseInt(jStack.pop());             int lVal = Integer.parseInt(jStack.pop());              jStack.push(Integer.toString(rVal + lVal));          }           else if( Character.toString(ch) == "-" )        {              int rVal = Integer.parseInt(jStack.pop());             int lVal = Integer.parseInt(jStack.pop());              jStack.push(Integer.toString(lVal - rVal));          }           else if( Character.toString(ch) == "*" )        {              int rVal = Integer.parseInt(jStack.pop());             int lVal = Integer.parseInt(jStack.pop());              jStack.push(Integer.toString(rVal * lVal));          }           else if( Character.toString(ch) == "/" )        {              int rVal = Integer.parseInt(jStack.pop());             int lVal = Integer.parseInt(jStack.pop());              jStack.push(Integer.toString(lVal / rVal));           } else {                           //       }     }      if ( !jStack.empty())      {         String result = jStack.pop();         System.out.println( result );         jTextField1.setText(result);      }      else {          System.out.println( "Your stack is empty and it shouldnt be." );      } }    No matter what I enter, I always get the message that my stack is empty at the end, and none of my Prints trigger that tell me it is pushing or popping. Have I missed some vital step?


Find Java classes implementing an interface

Some time ago, I came across a piece of code, that used some piece of standard Java functionality to locate the classes that implemented a given interface. I know the functions were hidden in some non-logical place, but they could be used for other classes as the package name implied. Back then I did not need it, so I forgot about it, but now I do, and I can't seem to find the functions again. Where can these functions be found?  Edit: I'm not looking for any IDE functions or anything, but rather something that can be executed within the Java application.


If every eigenvector of $T$ is also an eigenvector of $T^{*}$ then $T$ is a normal operator

Let $V$ be a finite-dimensional inner product space over $\mathbb{C}$ and $T: V \to V$ a linear transformation.   Show that if every eigenvector of $T$ is also an eigenvector of $T^{*}$ then $T$ is a normal.   We need to show that $\forall v \in V,\ TT^*v=T^*Tv$.  I started by picking $v$ to be an eigenvector of $T$, hence $Tv=\lambda_1 v$, and $T^*v=\lambda_2 v$. Therefore: $$TT^*v=T(\lambda_2 v)=\lambda_2 Tv=\lambda_1 \lambda_2 v=...=T^*Tv$$  But I'm stuck when $v$ is not an eigenvector.  (Also, this question is taken from a chapter about Jordan forms, but I can't see how it relates)


Prove the following floor function identity

The identity is this: $\lfloor 2x \rfloor + \lfloor 2y \rfloor \geq \lfloor x \rfloor + \lfloor y \rfloor + \lfloor x+y \rfloor$  I am truly stumped. Help is appreciated. Thank you!


Remove Element from Object list using JavaScript

How can I remove an element from an object list?  I wish to remove the element Kristian from someList. For example:  someList = {"Kristian":"2,5,10",              "John":"1,19,26,96"};   I want to achieve:  someList = {"John":"1,19,26,96"};   This is similar to , but it's implemented differently and the solutions does not work.


How to customize the frame background color and borderline width

I wish to customize the background color and the weight and color of the border using titlesec (not using mdframed).  %-----------------------------------------------------------------------------------% \documentclass[11pt,a4paper,reqno,fleqn,xcolor=x11names]{book} % %---------------------------------------------------------------------------------- % % \usepackage{amsthm,amsmath,amsfonts} % \usepackage{titlesec} % \usepackage[dotinlabels]{titletoc} % more advanced but essential here \usepackage[english]{babel} %  \titleformat{\section}[frame] % {\bfseries\itshape\fontsize{12.8}{14}\selectfont}         {}{8pt} {\;\;\thesection\hskip 0.7em}  \begin{document}  \chapter{This is Chapter No 1}  \section{A titletec section in a frame - too tall and not shaded}  \end{document}


Orientation of vertices in a triangle and its area

given an arbitrary triangle, its area can be computed easily by finding the determinant of this matrix: $$ \frac{1}{2}\left( \begin{matrix} x_1 & f(x_1) & 1 \\ x_2 & f(x_2) & 1 \\ x_3 & f(x_3) & 1 \end{matrix} \right) $$ I understand its derivation; what I don't understand (and I have been looking for the answer for the past couple of hours) is that why is the determinant negative if we list the points in the clockwise direction. Please, does anyone know?


SQL Server Trigger DELETE only a few records

I have a table:  | id(int) | isActive(bit) |   and then I delete some records from the table.  delete from table  where id in (1, 5, 8, 3)   Now I'd like to have a trigger or some other functionality which checks if you try to delete some ids which are active and skip those.  Sure I could create a stored procedure, but what if someone deletes something from the table not using that stored procedure?  And I could do a rollback in the trigger if any record was active.  But I'd like the user to be able to delete those that was not active and just "cancel" the delete on the records that was active.  Or is this even possible?


Why won't Webmaster Tools let me set a preferred domain? (says to verify, but it should already be)

I've got a domain that I apparently forgot to set a preferred domain for, so I just tried to do it. Webmaster Tools instead popped up a little box:     Part of the process of setting a preferred domain is to verify that you own http://www.example.com/. Please verify http://www.example.com/.   I'm running into some problems following these instructions:   As far as I can tell I already did verify sometime in the past. There's a TXT DNS record with the gibberish Google tells you to set for it that I couldn't have come up with myself. …and nothing is telling me this information is bad. So let's assume the site is somehow not actually verified. All  instructions start with "click the Manage Site button next to the site you want, and then click Verify this site." That button doesn't even exist on my screens. (It presumably goes away when you successfully verify?) Those instructions were all updated pretty recently, and the DNS one in particular just a couple weeks ago so it seems a bit unlikely they're inaccurate.   I am not using Apps, and won't be, so can't try out the verification .   Note that I also have another domain that I have not done any verification for which is showing the same behavior(no such button, being told to verify when it seems impossible etc.) so something appears to just be broken.  I already have a no-www process in place server-side, so we can skip that. I'm just trying to get the box checked off in GWT.  If I don't get any resolution, I'll eventually scrap the TXT record and see if the site gets un-verified(or whatever since it thinks it isn't), and see if I can just restart the process.  It's not urgent so I'm just trying to figure out if I've gone blind to something or what. Did the button move?


What’s the worst that can happen if i put a switch in the neutral instead of the phase?   I just found out that 3 light bulbs sockets in my home  are connected this way, it first came to my mind to fix it but then I recalled the flow of current from positive to negative is just a convention since the electrons are charged negatively and they actually flow from N to L so i cant really find an solid excuse to mess with the wiring for the next 2 hrs


In non-relativistic QM, does it make a difference if an energy shift is applied to the systems's Lagrangian or Hamiltonian?


Is it safe to remove the extra local disk after upgrading to Windows 10 version 1803?

I upgraded Windows 10 to version 1803 recently, and I discovered that I now have an extra local disk (drive D) which only has about 500 MB space.  After checking in the Disk Management interface, I found that it is a small partition at the front of my drive. I remember this is where Windows stores a copy of the previous version and it should not be visible.  Is there anything wrong with my installation? Should I delete this partition?  Update  Based on discussions on SU and other sources from the Internet, this is a minor issue with the Windows update, and the partition can be hidden easily. Please check the answer section.


Any tips on where to start learning quantum computing?

I am very interested in this field right now, due to the quantum advantage  and would like some helpful nudges in the right direction i.e. where should I start from.  P.S: I have some background in software engineering and subpar knowledge in math and physics.


Php json_encode returns "??????" instead of unicodes?

I am new to php and I am trying to create an API service out of it. I have saved the data in Nepali language in the database but when trying to print the json using json_decoded it returns "???????" characters. This is what is stored in db:  This is what is printed:  and this is my code: header('Content-Type: application/json; charset=utf-8');  // Create connection $conn = new mysqli($servername, $username, $password, $dbname);  // Check connection if ($conn->connect_error) {   die("Connection failed: " . $conn->connect_error); }  $sql = "SELECT * FROM example"; $sth = mysqli_query($conn, $sql); $rows = array(); while($r = mysqli_fetch_assoc($sth)) {     $rows[] = $r; } print json_encode($rows); $conn->close();  So whats the error here? My database collaction is "utf8_general_ci".


Possible missing firmware /lib/firmware/i915/* for module i915

I am getting these warnings every time I update my initramfs image(-s) with  on my Dell PowerEdge T20 server running    10.0. Is there a fix?    W: Possible missing firmware /lib/firmware/i915/bxt_dmc_ver1_07.bin for module i915 W: Possible missing firmware /lib/firmware/i915/skl_dmc_ver1_27.bin for module i915 W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1_04.bin for module i915 W: Possible missing firmware /lib/firmware/i915/cnl_dmc_ver1_07.bin for module i915 W: Possible missing firmware /lib/firmware/i915/glk_dmc_ver1_04.bin for module i915 W: Possible missing firmware /lib/firmware/i915/kbl_guc_ver9_39.bin for module i915 W: Possible missing firmware /lib/firmware/i915/bxt_guc_ver9_29.bin for module i915 W: Possible missing firmware /lib/firmware/i915/skl_guc_ver9_33.bin for module i915 W: Possible missing firmware /lib/firmware/i915/kbl_huc_ver02_00_1810.bin for module i915 W: Possible missing firmware /lib/firmware/i915/bxt_huc_ver01_07_1398.bin for module i915 W: Possible missing firmware /lib/firmware/i915/skl_huc_ver01_07_1398.bin for module i915


Currently I am using Windows 7, 32- Bit. I downloaded "ubuntu-17.10.1-desktop-amd64" Please tell me how to create Bootable USB to install Ubuntu Linux on Windows 7, 32- Bit.


What do the column of 1's signify when calculating the area of an image using the determinant?

When calculating the area of an image such as that given by the three coordinates (4,3), (4,10), and (-4,-3), why when writing it out as a matrix is there an extra column of 1's?  $$         \begin{matrix}         4 & 3 & 1 \\         4 & 10 & 1 \\         -4 & -3 & 1 \\         \end{matrix} $$ I understand that it is not possible to find the determinant of a non-square matrix, so my questions are:  1) Are 1's just used to make the matrix a square? 2) If so, is there any reason why 1's and not 0's are used?


Unable to extend Ubuntu 20.04 partition installed along with Windows 10 using dual booting

I've freed some space on my Windows partition as you in the screen. I've 5 GB of clean unallocated memory that is ready for use. When I try to resize my Ubuntu partition, I've the option to shrink the storage space but not to augment it as you in the second screen. I've browsed through the whole related question but I can't find a clear answer as to why I can't allocate the free space to my Ubuntu partition which is "filesystem Partition 5". I would be really gratefull to anyone who can guide me combine that 5 GB with the memory space initially allocated to Ubuntu. First image:  Second image:


Given a set of bounded integers; find number combinations which sums to S

Consider that I am given a set of $n$ integers $a_1, a_2, \ldots a_n$, which can take any value in the interval $1\leq a_i\leq t$, where $t$ is a positive integer, how can I find the number of combinations so that the sum of these $n$ integers is equal to $S$.  As an example, for 4 integers bounded as $1\leq a_i\leq 4$, the number of unordered (i.e. sequence does not matter) combinations so that $S=13$ is 3, given as (4,4,4,1), (4,4,3,2), (4,3,3,3).  It can be assumed that $t$ is choosen such that there exist an assignment of $a_i$, such that $\sum_{i=1}^n a_i= S$ is always true.


Why did the process of sleep evolve in many animals? What is its evolutionary advantage?

The process of sleep seems to be very disadvantageous to an organism as it is extremely vulnerable to predation for several hours at a time. Why is sleep necessary in so many animals? What advantage did it give the individuals that evolved to have it as an adaptation? When and how did it likely occur in the evolutionary path of animals?


Prepaid SIM card for short term - Canada

I've checked questions like:        They don't really address my problem.  I will be in Montreal for 4 months. I'm looking for a SIM card. Most of the plans I saw are with commitment of at least one year or so. The most important part of the plan is data (for Skype calls and apps for messaging). 3 to 5 GB/month would be perfect.  What are the best options I have?


Today I tried to upgrade to Ubuntu 15.04 from 14.04. I did the folowing commands:  sudo apt-get update sudo apt-get upgrade sudo do-release-upgrade  But during the last command, after lots of get messages I get the following error:  Error authenticating some packages. Continue?   It was not possible to authenticate some packages. This may be a  transient network problem. You may want to try again later. See below  for a list of unauthenticated packages.   gettext  lib32stdc++6  libatomic1  libfftw3-single3  libgfortran3  libgomp1  libitm1  libquadmath0  libstdc++6  libtsan0  onboard   Restoring original system state  Aborting   How can I upgrade without these errors? I have tried similar questions but with no success.


What are the advantages and disadvantages to completing a Masters program before applying to a Ph. D program?

I've been considering applying to graduate school of some form or another in Mathematics. During my undergraduate years, I did decently on my undergraduate coursework (mostly A-s, some As, a B) but not stellar, and it wasn't until I started taking graduate courses as a senior that I started buckling down and getting solid As or higher. I also had no research experience at this time.  I eventually want to apply to a Ph. D program in pure mathematics. Since I didn't really click until later in undergraduate years, so I was considering applying to 2-year masters programs in mathematics, and then based on my performance there, decide whether I'm fit to work towards a Ph. D.      My question is, what are the advantages and disadvantages to completing a master's program before applying to a separate Ph. D program?   I know masters degrees are sometimes considered terminal degrees. Would doing well in masters coursework be advantageous in applying to Ph. D programs later on as opposed to immediately after undergrad years? Does strong performance as a masters student make one a more attractive candidate, or do programs have less interest in applicants who already have a masters? Is it wiser to apply for a Ph. D directly? I'm sorry if this question is considered too much of a soft question. Thank you.


Linux AMI's version of OpenSSL is 1.0.1k but PCI compliance requires 1.0.1p

I run a linux AMI on AWS with version 1.0.1k of openssl  $ openssl version -v OpenSSL 1.0.1k-fips 8 Jan 2015   PCI compliance requires a version greater than 1.0.1p because they claim that there are known security issues with older versions. When I try to update the openssl package on the machine using 'yum' I am told that openssl is up to date.  $ sudo yum update openssl No packages marked for update    Does anyone else have a similar problem? Is it possible to install the latest openssl on the Linux AMI? Is the Linux AMI not capable of being PCI compliant?  For background, I am using Amazon Linux AMI release 2015.09  $ cat /etc/*-release Amazon Linux AMI release 2015.09


Can importlib import a module from any directory (non-packages)?

I am trying to import python files programmatically using importlib.  For instance, given a file "a/b/some_file.py", and given also there are no __init__.py files in any of those directories (nor can I add them), what is the best way to import it?  What I tried doesn't seem like it's correct: (After lunching the prompt from "a"'a parent directory and adding it to the path)   >>> importlib.import_module('a.b.some_file') ImportError: No module named a.b.some_file   I also tried a relative import but the result is the same.


Underscores in Citation > Error missing $

Problem: Underscores in my citation file causes the error "missing $ inserted"  Issue: I need to keep those underscores (there are too many of them) because they link to the IEEEabrv file which replaces these codes with the abbreviated journal name etc....  Question: Do you have a solution that lets me keep tags like "IEEE_J_JLT" and have latex recognize that this, text mode, is different than the math mode without having to edit all of the instances and replacing _ with \ _ (backslash underscore)?  Example bib file entry:  article{test:2013,     Author = {Test, D. and Tesssst, J.},     Journal = {IEEE_J_JLT},     Month = {April},     }


A few weeks ago I posted a simple answer to a question. Ever since that day, that one specific answer receives dozens of "suggested edits" per day. And every single one of them is where the "edit" deletes my entire post, and replaces it with hundreds of product names, each of which is a link to some dodgy-looking website.  Why in the hell is this happening? And why only this one particular answer? (I've been a user for several years, and only this one specific answer is being hit.)


How do I print a double value with full precision using cout?

In my  I was printing a double using cout that got rounded when I wasn't expecting it.  How can I make cout print a double using full precision?


I use GSAM battery monitor. i have flashed a few roms,    I get this reading:   ~91% battery. 460ma current consumption with regular use(full brightness). 3:40 hours time left(avg last 5 minutes).   So this means that my 91% battery should hold around 1800mah-2000mah (460*3:40) , but this is strange because my battery is a 4100mah battery, and i have it only for 8 months.  Another strange thing: when i look at Android's battery statistics, the sum of percenatges of the battery that goes towards each app(including screen) is only at ~50%.   As a fix, i tried to recharge my phone to 0% and than fully charge. but the problem stays the same.   So what does this mean ? and are my battery problems due to software or hardware?


What will happen if I will beam a ray of light in dark vaccum?

My question is this what will happen if I will flash a beam of light just say in an dark area where nothing is present ( vaccum ) there to reflect light. Just say I am standing and someone flashed a light in front of me would I be able to see that light.( As there is no particle there to reflect light. )


why a error? \mathbb allowed only in math mode

\usepackage{amsfonts}  Пусть \mathbb {N}  LaTeX Error: \mathbb allowed only in math mode


I am trying to create a schema page in LaTeX. It shall look like this.   How can I create schema code which look like this image? There should be also a click to go function. When the user clicks on the user_schema link he should be redirected to that page.  What classes I can use for this? Any suggestions would be appreciated.    \documentclass{article} \usepackage[utf8]{inputenc}  \begin{document} \maketitle  \section{User schema} \mySchema{Users} {     _id: ObjectId - Id do registro     name: String - Nome do usuário     date: Date - Data de Cadastro     ren_date: Date - Data de renovação do Cadastro     email: String - Lorem ipsum dolorsitamet, consecteturadipisicingelit, sed do eiusmodtemporincididunt ut labore et dolore magna aliqua. Ut enim ad minimveniam, exercitationullamcolaborisnisi ut aliquipexeacommodoconsequat. Duisautereprehenderit in voluptatevelit esse cillumdolore eu fugiatnullapariatur. Occaecatcupidatat non proident, sunt in culpa quiofficiadeseruntmollit.     access_log: Array [          {              date: String - Data da ocorrência.             user: ObjectId - Usuário que executou.             action: String - Ação Executada.         }         {              date: String - Data da ocorrência.             user: ObjectId - Usuário que executou.             action: String - Ação Executada.         }     ]     \link{group}{group_id}: ObjectId - Id do grupo. } \end{document}   Here is the image how should it appear:


Why can I not use the member function AppendText for RichTextBox with a string variable but it works fine with text written as the argument?

Please help me figure out what is wrong I can't find anything about this and haven't found the definition of this function C# keeps coming up and it doesn't apply.       for (auto& p: fs::recursive_directory_iterator("c:"))         {             richTextBox1->AppendText("This works fine\n");         }      for (auto& p: fs::recursive_directory_iterator("c:"))         {             std::string pathString;              fs::path path = p.path();              pathString = path.string();              //I don't know why it doesn't work like this VS won't compile if I try this. I have tried              //multiple different formats of string to no avail              richTextBox1->AppendText(pathString);         }


We have some guide text on our website that reads:     This email will send daily to members whose vouchers are expiring in 10 days time   However a colleague is insisting that the time period is possessive so the sentence should read:     This email will send daily to members whose vouchers are expiring in 10 days' time   Which sentence is grammatically correct?


Is there a power saving application similar to Jupiter?

I'm trying to install the Jupiter power settings app but, I read it is no longer compatible with the new kernel. Is there a similar program or a way to manage the power settings on 13.04?


a way that most people think {is / it is} wrong

I was reading definition/meaning of the word "perverse" in , came across :     showing deliberate determination to behave in a way that most people think is wrong, unacceptable or unreasonable   Shouldn't it be :     showing deliberate determination to behave in a way that most people think it is wrong, unacceptable or unreasonable


How do I provide internet access only to a single Android app?

I am currently using Android Smartphone.  I am currently having internet access for my Android Smartphone. I would like to provide internet access to only a single android application, for example: WhatsApp. I do understand that I need to provide internet access to some essential default system apps for the functioning of the phone. Is it possible to selectively provide internet access to few apps and not for other apps?


Unable to mount a hard drive due to windows 8 hibernation

I have installed Ubuntu 14.04 on my laptop, and I had a problem when I want to mount a hard drive due to windows 8 hibernation.  The problem is that when I was partitioning my hard drive I formated the drive which contained Windows 8 without shutting down Windows, I only did a hibernation, so now I can't resume and shutdown Windows fully.  Now I can only mount my hard drive as read-only.  How can I solve this problem ??


In what cases does a @comment reach a user?

Background  An edit on one of my posts was suggested. I reviewed and rejected it. I looked up the user and saw similar minor (approved) edits I @commented the user to ask him/her to do more substantial edits  Question But I am not sure if a @comment will reach the user. What if there are multiple users with the same displayname? How does the system know whom sending the comment? So the question is: What participation in a post leads to a @notification?  The user must be the poster or a commentor a previous editors? a (rejected) reviewer? a closer? a deleter? ... doesn't matter? All with the same name get the notification?


How to analyze the following complex number?

$f(T) = \int_{0}^{1}e^{-iT\lambda(s)}ds$, where $\lambda(s)$ increases monotonously. I want to show that  $|f(T)|$ has an upper bound that decreases with $T$ for $T \gg 1$. For example, if $\lambda(s) = s$ then $|f(T)| \le 2/T$. This question comes from numerical analysis of my research. It's the expression of error analysis in adiabatic evolution. More specifically, the digital error has expression : $\sum_{k=1}^{L}e^{-iT\sum_{j<k}\lambda_{j}}/L$, where $\lambda_{j}$ equals $\lambda_{j} = \lambda(j/L)$. From numerical result I am sure it has an upper which bound decays with $T$. However, I don't know how to prove that. I wonder if there is related formulas in complex analysis and fourier series.


How to make my Mac sleep when I close the lid while connected to an external display?

Having an external monitor connected prevents my Mac from sleeping when I close the lid. Is there any way to opt out this feature?


What is the explanation for this unexpected results in Python??!;  from math import * >>>log(1000,10) ## expecting 3.0 2.9999999999999996 >>>1000**(1/3) ## expecting 10.0 9.999999999999998


Why do I not get a p-value and F value from ANOVA in R?

I am asked to determine using an appropriate test whether the internal concentration of isoleucine is statistically different between appropriate experiments. So I constructed a data frame in R as follow: dat <- data.frame(experiment = c('no glu', 'glu', 'gluFCCP', 'gluV', 'gluN', 'gluNV'),internal_concentration = c(2.38, 8.57, 3.42, 6.17, 4.58,3.51))  print(dat) experiment     internal_concentration 1     no glu                   2.38 2        glu                   8.57 3    gluFCCP                   3.42 4       gluV                   6.17 5       gluN                   4.58 6      gluNV                   3.51  I chose to perform an ANOVA test: model<-lm(dat$internal_concentration~dat$experiment)  anova(model)  Analysis of Variance Table  Response: dat$internal_concentration                Df Sum Sq Mean Sq F value Pr(>F) dat$experiment  5 25.558  5.1117                Residuals       0  0.000    I need the F and p values to determine if there's a significant difference, but this result is not working. How should I interpret this error and any suggestion on how to change the code/the test used? I just have one value for the concentration for each experiment.


Changing the selected option with jQuery

I'd like to change the selected option with jQuery.  <select name="nameSelect" id="idSelect">     <option value="0">Text0</option>     <option value="1">Text1</option>     <option value="2" selected>TextSelected1</option> </select>   I'm trying with $("#idSelect").val(); or similar, but it doesn't work.  Regards


How to import sextante(processing) for QGIS 1.9 (2.0)

In the current QGIS development snapshot the SEXTANTE toolbox has been merged into QGIS and is now known as "processing". This is a good step, but the previous import command doesn't work anymore.  from sextante.core.Sextante import Sextante # returns an import error   How can i import the sextante bindings in current development versions and the upcoming QGIS 2.0 ?


I've been facing this problem with Blender - Ive been trying to render the scene with the animation, but instead all that appears in the final image is black. Ive tried on differend machines, and none of them work. I have been working with the beta version, but i did try using the latest one as well, nothing seemed to be working. I have reinstalled differend versions of render. It seems to have been a problem with my file only, as other people using the beta dont have this issue.  Ive also tried adding differend lighting sources so it couldnt be that. Could you help me find out what the issue could be, is it in the machines? Can it be some file thats missing in the version or something? Thank you for your time!


I would like to label an equation with an arbitrary symbol, rather than a number, or letter.  Is this possible?


jQuery select descendants, including the parent

Consider the following HTML:
    I should be changed red
       I should not be changed red.
I should be changed red.

   Given a DOM element obj and an expression, how do I go about selecting any children and possibly obj?  I'm looking for something similar to "select descendants" but also including the parent, if it matches the expression.  var obj = $("#obj")[0];  //wrong, may include siblings of 'obj' $(".foo", $(obj).parent()).css("color", "red");  //wrong -- excludes 'obj' $(".foo", obj).css("color", "red");  //correct way, but it's annoying var matches = $(".foo", obj); if ($(obj).is(".foo")) matches = matches.add(obj); matches.css("color", "red");   Is there a more elegant solution to this?


Imagine you have 12 balls. They are all the same color. We know that one ball is different in weight from the others but we dont know is it heavier or easier. You have a beam scale without measurements on it. Just two sides where you can put any number of balls on it. In three steps find the ball that is different in weight from other balls.


How to calculate free wheeling current value

In the below mentioned circuit which is used for automotive EMR braking. We are facing freewheeling diode burn out (FR607 is currently being used).     We are still clueless about the cause. But as per design this is a 6 A rated diode with surge value of 300 A which according to my design team is well enough. But we suspect that this ampere rated diode is not OK.  We need to find the maximum freeweeling current in this circuit. How to calculate this current value. The coil resistance is 0.8 amps. Load of the circuit is 30 amps and the supply is a 24 V DC battery source 200 Ah.


Windows 7 usb created using ubuntu image writter not booting

Using ubuntu 18.04 and 19.04 I created a windows 7 install usb using image writter.   It will not boot.   Ie: boots into the grub for ubuntu but no way does the win7 usb get booted.   I am new to ubuntu.   I can not get unetbootin to install.   Added repository and all.   So can someone point me to something that will help or tell me if it's possible to create windows install usb on ubuntu?   I do not have a windows computer only ubuntu.   I have set boot order ect ect.   Pleaae respond and thank you.


I am a US citizen, convicted of a non-violent drug offense. I was sentenced to 3 years in prison. It has been 10 years since my release and completion of probation.  Can I travel to the UK?


$$f(x) =f'(x) f''(x)$$ Find the polynomial function $f:\Bbb R\to \Bbb R$, with $\deg(f) =n$. I have found that the degree is $3$ but just replacing gives me that $f(x) =\frac{x^3}{18}$


Collaborating (online) with researchers from other institutes/countries

I am a first year graduate student in a completely theoretical field. How does one go about collaborating online or otherwise with researchers from other institutes/universities? In particular, if I am interested in a problem or an area which is not very well represented at my current institution, how do I approach researchers from other institutes to start a collaboration assuming I have the basic background to start research? Should I have a very particular problem/idea in mind while contacting a potential collaborator, or is it unusual if I approach a researcher just because I am interested in his work and would like to learn more and work on it with no particular problem in mind?


Sometimes, on the internet, particularly in online games, I see people using the  indefinite article before someone's name: "I see a Joey" or "I hug a Polly". I know some of these people and I'm positive that they are from English-speaking countries, which means it is not a mistake, they do it intentionally.  I was always taught that articles are not used in front of people's names. Maybe it is some sort of slang? What does it mean, when the indefinite article is put in front of someone's name?  Edit: There is a group of people standing somewhere. And somebody, named Joey, appears. They all know Joey. And someone in this group says "I see a Joey". So it is used when someone sees his or her friend. But I don't understand why they use the indefinite article here.


Do I need a visa to visit the UK with my EU partner?

I am not from EU. I have Spanish partner and we live in Spain and, because of our official relationship, I have a Spanish family resident permit. We are going to travel to the UK together for tourism. I am confused whether I need an EEA family permit or not.  I will not live there and I'm going to travel with my partner. I was told that I don't need a visa, that showing our civil union document will be sufficent. Is this correct, or do I need a visa to enter the UK?    Thank you so much for your answer. Let me give you more detail.  I hold Turkish citizenship.  My resident card exactly says that Residence Card of a Family Member of a Union Citizen " tarjeta de familiar de la union.   my case is like For example, a non-EEA spouse of a German national living in Germany will usually hold a residence permit issued under German domestic law. Therefore, a United Kingdom EEA family permit is required for travel and entry to the UK , therefore I should consider that I need to EEA Family Permit even if for touristic trip with my partner.


Interpretation of the p-value of the y-intercept coefficient in a linear regression

I am trying to interpret one of the p-values in a one variable linear regression.  Some of the answers I've seen for similar questions were not worded as thoroughly as I would have liked.  My interpretation is deliberately verbose because it will aid my understanding if faults are found within it.  From Microsoft Excel the linear regression formula from 90 samples of (x,y) pairs is   y = 0.514x + 0.00087   and the p-value of the first coefficient is 4e-16 (scientific notation) and for the second it is 0.0027.  Would it be correct to say that the interpretation of the p-value of the 0.00087 term is:     Under the assumption that the true value of the y-intercept is zero   and the first coefficient is 0.514, random sampling of the same number   of (x,y) pairs, specifically 90, would result in a least squares best   fit line with a y-intercept at least as extreme as 0.00087, with a   probability of 0.0027.   If not, then what would be the correct interpretation?  Not so importantly, but just to be complete, I am also inquiring if it would be more accurate and complete to put the relevant phrase as      "at least as extreme as 0.00087 in the same direction, that is,   positive".   Edit: The Excel funcion is Tools > Data Analysis > Regression in Office 2003 with service pack 2. Excel regression p-values on coefficients are 2 sided.  Edit: Regarding differentiation from this question : The most up voted answer there discusses the p-value of a hypothesis, which seems ill defined or at least not specific.  I am not interested in that.  I am interested in the p-value of a coefficient that is not the coefficient of an independent variable. I am being very specific.


I am writing an article for the first time with Latex, I am using Overleaf as an online editor. I want to avoid unecessary spaces in my article which are the result of figures and adjustment. For example:  We can see how there are many vertical space between the figure and the text, for the next page is the output also in this way:  Solution that I've tried:  Reduce the size of the image: not optimal because it won't be readable Change the float position of the figure from [H] to [h]: it didn't fix the problem, spaces still persist The code used for the first figure and text is :      \begin{figure}[H]     \begin{center}     \setlength{\belowcaptionskip}{0pt}     \includegraphics[scale=0.8]{images/comparison2.png}     \centering     \caption{ORKG Interface for comparison between contribution}     \vspace{-1.5em}     \label{fig18}     \end{center}     \end{figure}      \noindent{ORKG allows users to specify the structure of type's composition to describe research contributions. Templates are used to facilitate the organization of data by adding, editing or deleting attributes and their allocated information. For example, \autoref{fig19} highlights the specification of the features of describing a dataset:}


How to set the header font size using fancyhdr package?

Basically, I want the header fonts to use a different (smaller) font size than the size I set using \documentclass. What should be the option I'd be using ?  \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[margin=1in, headsep=10pt]{geometry} \usepackage{fancyhdr} \pagestyle{fancy}  \fancyhead[L]{Personal Statement} % What other option should I use to get a custom font size ?


Error when installing Xubuntu: 'grub-efi-amd64-signed'package failed to install into /target/

I'm trying to install Xubuntu on a computer with windows7. I downloaded Xubuntu and made a bootable USB key with success. During installation process I got a message like this and then it stopped     The 'grub-efi-amd64-signed' package failed to install into /target/. Without the GRUB boot loader, the install system will not boot.   What am I supposed to do here?


how to determine the certain number of clusters your data contain?

I was wondering if I can find a certain way that show me the number of clusters my data has by its nature.I don't want to find the optimal number of clusters for clustering, I want to know the number of clusters my data has by its nature not what i wanted it to be.  Any little help would be greatly appreciated.


I've installed Ubuntu 13.04 (using something else) and now I cannot boot windows 8

Hello everyone I'm new to Ubuntu so I probably messed something up. When I installed Ubuntu on my windows 8 hp laptop it did not give me the option to install Ubuntu alongside windows so I installed it using the something else option.   I think I may have messed up during the partitioning but I'm not sure.  When I turned on the PC it at first directly booted up Ubuntu without showing me the grub screen, eventually I was able to get the grub screen to appear but it does not recognize windows. I ran boot repair and I was given this url :  . Boot-repair did not solve my problem.   Thanks for any help guys I really want to be able to run windows alongside Ubuntu and access the files that are in windows.


Why does legal English sometimes repeat the antecedent noun after "which"?

Here's a standard English sentence:     The folder which is missing from the principal's office contained the answers to today's exam.   (Separate question, discussed elsewhere I'm sure, whether it should really be "which" or "that".)  But simpler is usually better, so I would actually just write:     The folder missing from the principal's office ...   But my question is: I have seen legal statements which would write:     The folder, which folder is missing from the principal's office, contained ...   Assuming that the writer is actually correct in thinking that s/he's adding some value by repeating "folder" after the "which", what value is s/he adding?


I've been trying to work out how to edit the bash profile for the login shell in Ubuntu 18.04. Being new to linux and the forum being my friend, i found that it is located in .profile as oppose to bash_profile previously. I'm not sure which profile i should be amending as i cannot find bash_profile.  I'm trying to add a line for virtualenvwrapper so that it can be sourced every time a new terminal session is launched but it isn't working.   nano .profile  Then adding...  source .local/bin/virtualenvwrapper.sh  to the end  Saved and exited but it doesn't work. Have i missed something or do i have to add anything in the script?  Thanks as always.


Last July I went on a holiday to Dubai and have bought my very first iPhone from there, the Gold iPhone 6 plus. Recently I decided to start using Facetime but for some reason I cannot find the app. I am using my iPhone in Malta, in the middle of the Mediterranean with a Vodafone carrier.   Can anyone please show or explain how can I have FaceTime on my phone?   I tried finding various videos on YouTube but could not find the right one.


Code Coverage not Displaying in Developer Console

Before '14 release there was a invaluable feature in salesforce to check the covered/uncovered code segments of a particular class or trigger. They were clearly showed with pink and red color so that developers can easily manage the code coverage. But recently forums say it has been moved into developer console. But I can't find that feature even in the console. Please help if anyone know the job.


Where should the "preferences" item go in a desktop application?

I find that the "preferences" menu item is always in a different place, and often under an arbitrary name which always makes it a pain to locate unless you're already familiar with the software.  I have seen it under the file, edit, window, help, and options menu (probably more) and is either called "preferences," "settings," or "options."  Has there been any studies or evidence to suggest where the application settings should go? And I am referring to the application settings, not file/project/whatever specific settings. I already know that putting it under "file" is wrong for application global settings, and under "edit" is probably wrong in all circumstances. But what about besides that? Is it better to just have an entire options menu to further break it down? Should it be under the "window" menu since it is, after all, its own window? What about window > options? Is it ever right to put it under the "help" menu?  I'm talking mostly in terms of usability (which place users look first), but also semantically (as in, the file menu doesn't make sense). I personally never start with file, edit, or help -- even though that's often where the menu item is -- but rather search high and low through other menus first. Is this a common behavior?


What's the best way/practice to get the extension of a uploaded file in PHP

I have a form that allow users to upload files, I however need to get the file extension, which I am able to get, but not sure if I'm using the most effective solution  I can get it using the following ways  $fileInfo = pathinfo($_FILES['File']['name']); echo $fileInfo['extension'];  $ext = end(explode('.',$_FILES['File']['name'])); echo $ext;   Which method is the best to use or are there even better solutions that would get the extension?


Punctuation marks in math mode in xetex/mathspec

I am using XeTeX and have the following short document:  \documentclass[a4paper,12pt]{article} \usepackage{amsmath,amsthm} \usepackage[MnSymbol]{mathspec} \usepackage[no-sscript]{xltxtra} \defaultfontfeatures{Mapping=tex-text} \setallmainfonts{Minion Pro}  \begin{document}  $\phi, \varphi, \delta \ldots A \vee B$  \end{document}    Now no matter what font I am using the punctuation marks in math mode (commas, dots, \ldots etc.) come out in Computer Modern. Is there a way to change this?


Proper resolution for large scale printing

I'm not savvy at all when it comes to any of this.  We need a photo of our dog that will be blown up to go on a van wrap. My photographer has a camera with 24 mega pixels which is a 4000x6000 resolution.  Will this be sufficient?


How do I get files found by command-line 'find' ordered by modification date in OS X?

Using the Mac OS X Terminal, how do I write a find command that orders results by modification date (most recent first)?  There are similar questions already, but they refer to GNU find and POSIX, but I do not know whether Mac OS X is GNU or POSIX or something else.


Difficulties installing apache web-server on Ubuntu 16.04

I was wondering if I can get some assistance here to install an apache2 web-server on my Ubuntu 16.04. I have followed the instructions, such as : opening the terminal, and typing : sudo apt-get update, then press "enter".  I receive the following message : password. Which password is it referring to ? I really need help.


I overstayed on a UK Visa (a couple of years) for personal reasons, then I've decided to leave voluntary, without telling them I'm leaving , I bought the ticket and left in 2018, I did check in, none of them told me anything, no immigration control, no passport check, no stamp nothing at all,  My question is :  Will they know I have overstayed? In the future will this bring me a problem to enter the UK?  How to check if I'm allowed or not to enter in the future?


A complex ordinary differential equation

I’m trying to see what instruments I could use to analyse the following ODE in the complex plane: $ \dot{z} = \exp(it)\cdot \bar{z}$. Where $z$ is a function of real valued time.  ${{}}$


I added the following line to /etc/environment:  ML="$HOME/ml"   After I re-logged in for the script to take effect, running printenv ML prints $HOME/ml and running cd $ML prints   bash: cd: $HOME/ml: No such file or directory   What is the correct way to set a new system wide path variable and be able to use it as a shortcut directory address?


How do I restrict scaling to a specific axis?

Im new to Blender but have some experience with 3dsmax. In blender, when i select some polys and try to scale them, i have no control on the amount and especially relative axis on which the scale would happen, where as with 3ds max i could scale restricted to x, y, z or any combination of using the handy widget. Is there a way to replicate this, or to get any control over the scale ?  thanks,


I'm having space problems in the root folder and one of the folders that contains many files is /usr/share/doc/texlive-doc, I would like to know, there is a way for me to use a command that goes through the entire folder and deletes only file with .pdf extension? This is on Ubuntu 16.04.


How do I prove that if A is onto then its transpose is one-to-one?

I want to prove that if A is onto then its transpose is one-to one. Here $A\in R^{nxm}$.


Stop a regex matching *everything* after what I want to actually match!

I am quite new to the whole Regex thing and tried to do a preg_match_all in PHP which, kind of the results I wanted but the problem is it matches everything after what I actually wanted... like so:  String: This is something Some code here and more Match from Regex: Some code here and more Wanted match from Regex: Some code here  Here is my regular expression that I'm using: /(.*)<\/code>/  I think its something to do with the beginning and ending / delimiters but I'm not entirely sure.  Any help would be appreciated, thanks!


Is a one-time pad still breakable on a depth of 2+ if the plaintext is completely random?  I'm assuming this idea is wrong, mostly because it occurred to me, but let me walk you through my logic so you can concisely correct me:   A one-time pad is unbreakable on a depth of 1 because a comprehensive brute-force attack will yield numerous reasonable plaintexts. Upon a depth of 2 or more (e.g., the same pad used with multiple plaintext messages) it becomes breakable:  Brute-forcing message $A$ may result in (say) 10 plaintexts Brute-forcing message $B_n$ may result in 10 plaintexts each The key that commonly results in valid plaintexts is probably the one-time pad used.  If the plaintext is completely random, then this attack won't work, as there is no way to discriminate between "plaintext output" and incorrect outputs.   I was thinking of ways to pass encryption keys and IVs - which, if properly generated, should be very random data - between two systems.  Let's presume they have a trusted channel by which they can exchange the one-time pad, but wish to use an untrusted channel for exchanging more voluminous data.  They can use symmetric encryption to protect data across the untrusted channel if they have away to agree upon the keys used for the symmetric encryption.  If a one-time pad could be used to securely exchange symmetric keys across that untrusted channel, then the sparse use of the trusted channel (exchanging the one-time password) could enable encryption across the untrusted channel.  Would this, instead of a one-time pad, be a shared secret? A key derivation function?  Some "please don't beat me up" caveats:   Yes, I realize this sounds like I'm breaking the "never invent a new cryptosystem" rule, and I realize the importance of that rule.  Rather, I'm using this as a gedankenexperiment to understand encryption better, and/or as a way of identifying an existing model that describes what I'm suggesting. Yes, I realize SSL is the appropriate model for what I'm suggesting - the certificate exchange and handshaking is the "trusted channel", enabling symmetric encryption of the general data over the "untrusted channel".  I have reason to contemplate lighter-weight solutions.   I humbly appreciate any edification you can give me.


How to run a server on port 80 as a normal user on Linux?

I have Googled about a solution for quite some time, but couldn't find an answer.   I am on Ubuntu Linux and want to run a server on port 80, but due to security mechanism of Ubuntu, I get the following error:      java.net.BindException: Permission denied:80   I think it should be simple enough to either disable this security mechanism so that port 80 is available to all users or to assign required privileges to the current user to access port 80.


This remark appears in Terence Tao's Analysis I     Remark 3.3.6. Strictly speaking, functions are not sets, and sets are not functions; it does not make sense to ask whether an object $x$ is an element of a function $f$, and it does not make sense to apply a set $A$ to an input $x$ to create an output $A(x)$. On the other hand, it is possible to start with a function $f : X → Y$ and construct its graph $\{ (x, f(x)) : x \in X \}$ , which describes the function completely: see Section 3.5.   In a lot of books I checked (almost all of them about Set Theory) do consider $f$ to be a set defined as $f = \{ (x, f(x)) : x \in X \}$ which is included in $X \times Y$ (i.e The Cartesian product of $X$ and $Y$) and I don't see why Tao sees it as nonsensical?  One other thing, lets consider this two definitions:  (1) For each element $x \in A$, there exist at most an element $y$ in $B$ such that $(x,y) \in f$, $y = f(x)$, or $x f y$ depends on the notation used.  (2) For each element $x$ in $A$, there exist a unique element $y \in B$ such that $(x,y) \in f$, $y = f(x)$, or $x f y$ depends on the notation used.  In almost all French books I checked (1) is a definition of a they call "fonction" (i.e Function in English apparently), and (2) is for what they call "application" (I don't know what it should be translated to in English, I think 'map' would do), but in English books I checked they don't make this distinction, they define function, map...etc as in (2) and consider (1) to a not be a function.  My question is which one I should consider as a the definition for a function? even though (2) would make the most sense for me, because why would you include elements that not have an image in the domain of $f$?


I have a 32 GB USB stick. I was in Mac (VMWare) putting some stuff on. Then accidentally removed the drive. I put it back in, and wanted to format it. Using disk utility, I chose 1 partition, it automatically filled in 312 GB and I just clicked format or whatever. It didn't take long, then I could see the progress bar hanging at "Waiting for device to reconnect". Nothing happened for a while so I ejected it. Now comes the problem:  In Disk Utility (Mac): No sign of the USB drive.  In Paragon Partition Manager (Windows): No sign of the USB drive.  In Disk Manager (Windows): I can see that it's there. But it says: Disk 1 Removable (D:) No Media. When I right click it, I can only assign drive letters to it. No way to format.  In diskpart (Windows): diskpart list will show me the following: Disk 1, Status: No Media, Total Size: 0 B. When I eject the drive, the disk 1 will disappear. So I know that it's this drive. If I type clean, it will say that "There is no media in the device".  In HDD Low Level Format Tool 4.25 (Windows): Doesn't detect it at all.  In Device Manager (Windows): It is detected as USB Mass Storage Device.  In Gparted (Linux): Doesn't detect it.  In HP USB Disk Storage Format Tool 2.1.8 (Windows): It detects device as: "GENERIC USB Mass Storage 1.00 (0 MB) (D:)". When I press Start it gives me this error: "There is no media in the specified device"  In BIOS: Detected  In Spinrite (Live Boot): Doesn't detect it  Any help is appreciated.


Mismatch between analytical and simulation way for Bayesian estimation of binomial data

In short, Below, I'm asking why the analytical way of getting the posterior for the difference between two proportions (binomial data) and simulation way of the same don't match?   (Note: All code is R code)  Details  Suppose I have the following information for two groups (g1 and g2) of binomially distributed data:  g1.trials = g2.trials = 100  g1.success = 55                   ;    g2.success = 45 g1.fail = g1.trials - g1.success  ;    g2.fail = g2.trials - g2.success    with prior information for a beta distribution:  alpha1 = alpha2 = 1.1  beta1 =  beta2 = 1.1   My goal is to obtain the posterior probability distribution for $\Delta~(p_1 -p_2)$ i.e., the difference between "true proportion in group 1 - true proportion in group 2".  Simulation solution:  It is widely known the the posterior for each group is:  set.seed(0) post.p1 = rbeta(1e6, alpha1 + g1.success, beta1 + g1.fail) post.p2 = rbeta(1e6, alpha2 + g2.success, beta2 + g2.fail)   And their difference i.e., $\Delta~(p_1 -p_2)$ is:  delta.p = post.p1 - post.p2  # the difference  hist(delta.p, freq = FALSE, xlab = bquote(Delta[~(p[1]-p[2])]))  med = median(delta.p)                    # 0.09822197 CI = quantile(delta.p, c(0.025, 0.975))  # -0.03834067  0.23272198    Analytical solution:  We follow the usual Bayesian way (i.e., for each group: prior x likelihood):  prior1 = function(x) dbeta(x, alpha1, beta1);  like1 = function(x) dbinom(g1.success, g1.trials, x);     k1 = integrate(function(x) prior1(x)*like1(x), 0, 1)[[1]];  post1 = function(x) prior1(x)*like1(x) / k1;  prior2 = function(x) dbeta(x, alpha2, beta2);  like2 = function(x) dbinom(g2.success, g2.trials, x);     k2 = integrate(function(x) prior2(x)*like2(x), 0, 1)[[1]];  post2 = function(x) prior2(x)*like2(x) / k2;  kdelta = integrate(function(x) post1(x) - post2(x), 0, 1)[[1]];  postdelta = function(x) post1(x) - post2(x) / kdelta;  curve(postdelta, xlab = bquote(bold(Delta[~(p[1]-p[2])]))) # completely different! (mode = optimize(postdelta, 0:1, maximum = TRUE)[[1]]) # 0.4500863 Completely different                                                         # from simulation median!!!!!


What does ISO (as in the disk image format) stand for?

Just a question for curiosity's sake; what do the letters ISO stand for?    I know that ISO files follow ISO-9660, the ISO in which stands for International Standards Organisation, but a lot of file formats will presumably follow some ISO standard, so that seems incorrect.  I couldn't find any answers to this on Wiki / Google  My best guess so far is: Image Standard Optical.


Are players creatures? What are creatures?

The cleric ability Preserve life says the following:     Starting at 2nd level, you can use your Channel Divinity to heal the badly injured.      As an action, you present your holy Symbol and evoke Healing energy that can >restore a number of hit points equal to five times your cleric level.      Choose any creatures within 30 feet of you, and divide those hit   points among them. This feature can restore a creature to no more than   half of its hit point maximum. You can’t use this feature on an Undead   or a construct.   I can't seem to find a straight definition of "creature." Can the cleric heal Player Characters, humanoid NPCs, etc? A layman definition of 'creature' to me would mean any non-humanoid / monstrous enemy to the characters. But it doesn't make much sense to be able to heal only your enemies.  So are the players considered creatures?


How do I theme the maximized window buttons with Unity?

I use a custom Gtk theme along with the default Ambiance window controls. Using my theme, the Unity panel shows its very ugly default buttons when my window is maximized. Since I have the same window theme, I am assuming this comes from the Gtk theme. I tried copying and pasting a few things from Ambiance's gtkrc, but nothing has stuck so far.  What must a theme author do to gain pretty looking window buttons in Unity's panel?


Let $a,b \in {\mathbb{Z_+}}$ such that $a|b^2, b^3|a^4, a^5|b^6, b^7|a^8 \cdots$, Prove $a=b$

Let $a,b \in {\mathbb{Z_+}}$ such that $$a|b^2,  b^3|a^4, a^5|b^6, b^7|a^8 \cdots$$  Prove $a=b$


when I use nio, serverSocket.accept() throws IllegalBlockingModeException

When I code like this:        ServerSocketChannel ssc = ServerSocketChannel.open(); InetSocketAddress sa = new InetSocketAddress("localhost",8888); ssc.socket().bind(sa); ssc.configureBlocking(false); ssc.socket().accept();   the ServerSocket.accept() method throws java.nio.channels.IllegalBlockingModeException. Why can't I call accept(), even though I set blocking to false?


why the executing shell within cron job will take longer time than normal?

I have a shell script which will run project consist of multiple JUnit tests.  Then I call this shell within cron job every a period of time. In this case, I observe the following:   Time to complete executing this shell is longer than directly calling this shell.   I don't know why!?  They must have the same run time, mustn't they?


Local timezones on servers considered harmful?

I'm curious as to what other administrators' experiences with timezones, in the context of remotely administered servers, are. In my career I've come across several conventions;   Always, always, always use UTC.   Always, always, always use the timezone of wherever base HQ is. Use the local time of the people who happen to be administering.  Use the local time of the server location.    In some places, I've come across multiple and conflicting conventions. My own preference has been to use UTC, always - with no daylight savings. But for one reason or another, it seems that most people prefer to use some concept of local time, with daylight savings. Although it seems like a straightforward technical matter, discussions around changing conventions always seem to trend towards religious schisms.  What are you using? What do you consider to be the advantages and disadvantages of each approach?


"No space left on device" when installing packages, yet I have space left

Whether through update manager, or through terminal, I error out.  When I try sudo apt-get update && sudo apt-get upgrade:  Fetched 1,024 kB in 20s (51.0 kB/s)  Reading package lists... Done  Reading package lists... Done  Building dependency tree Reading state information... Done  You might want to run 'apt-get -f install' to correct these.  The following packages have unmet dependencies: linux-headers-generic :  Depends: linux-headers-3.13.0-29-generic but it is not installed  E: Unmet dependencies. Try using -f.   And When I try sudo apt-get -f install:  Unpacking linux-headers-3.13.0-29-generic (3.13.0-29.53) ...  dpkg: error processing archive /var/cache/apt/archives/linux-headers-3.13.0-29-generic_3.13.0-29.53_amd64.deb  (--unpack): unable to create /usr/src/linux-headers-3.13.0-29-generic/include/config/inotify/user.h.dpkg-new' (while processing./usr/src/linux-headers-3.13.0-29-generic/include/config/inotify/user.h'): No space left on device  No apport report written because the error message indicates a disk full error dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)  Errors were encountered while processing: /var/cache/apt/archives/linux-headers-3.13.0-29-generic_3.13.0-29.53_amd64.deb  E: Sub-process /usr/bin/dpkg returned an error code (1)   When I open Ubuntu software center, I get the following text:     New software can't be installed because there is a problem with the   software currently installed. Do you want to repair this problem now?   I get the option to 'repair' or 'cancel'. If I hit 'repair', I get the following error:  Package operation failed the installation or removal of a software package failed. (Reading database ... 417598 files and directories currently installed.)  Preparing to unpack .../linux-headers-3.13.0-29-generic_3.13.0-29.53_amd64.deb ...   Unpacking linux-headers-3.13.0-29-generic (3.13.0-29.53) ...  dpkg: error processing archive /var/cache/apt/archives/linux-headers-3.13.0-29-generic_3.13.0-29.53_amd64.deb  (--unpack): unable to create /usr/src/linux-headers-3.13.0-29-generic/include/config/bug.h.dpkg-new' (while processing./usr/src/linux-headers-3.13.0-29-generic/include/config/bug.h'): No space left on device  No apport report written because the error message indicates a disk full error dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)  Errors were encountered while processing: /var/cache/apt/archives/linux-headers-3.13.0-29-generic_3.13.0-29.53_amd64.deb  Error in function: dpkg: dependency problems prevent configuration of linux-headers-generic: linux-headers-generic depends on linux-headers-3.13.0-29-generic; however: Package linux-headers-3.13.0-29-generic is not installed. dpkg: error processing package linux-headers-generic (--configure): dependency problems - leaving unconfigured  dpkg: dependency problems prevent configuration of linux-generic: linux-generic depends on linux-headers-generic (= 3.13.0.29.35); however: Package linux-headers-generic is not configured yet. dpkg: error processing package linux-generic (--configure): dependency problems - leaving unconfigured   The disk full error is odd, because none of my disks are full. I know this because when I run df, I get the following:  Filesystem 1K-blocks      Used Available Use% Mounted on  /dev/sda6   36178648  13162504  21155332  39% / none               4         0         4   0% /sys/fs/cgroup udev         3873544        12   3873532   1% /dev tmpfs         776860      1384    775476   1% /run none            5120         0      5120   0% /run/lock none         3884300     25276   3859024   1% /run/shm none          102400        68    102332   1% /run/user /dev/sda2  124327968  42583252  81744716  35% /media/sudoer/48AEC994AEC97B48  /dev/sda3  807468724 121812996 685655728  16% /media/sudoer/New Volume   What do I do at this point? Thanks in advance.


Windows has this nifty little shortcut for running commands. Press Windows+r.  Problem is, is there an easy way to have the commands I run in that dialog to prompt for a UAC credentials dialog and get consent from a admin user.  Right now, I'm trying to run this command in the Run dialog runas /user:admin "regedit.exe"  It works when I run this though: runas /user:admin "cmd"


I noticed that in very soft gradients, the 24-Bit colordepth is not enough as you can see the transitions of the color. This pops out the most in dark scenes or night skies.   Why doesn't anybody change the colordepth to two bytes per channel? I know that would be alot of work and a lot of hardware would have to be repalced, but I find it a bit annoying. I really don't think that the technology of the hardware isn't mature enough.   So why is no one doing that?   Here's a picture of "The War Z" where you can see what I mean:


I love "how" or "that"(?) you take care of the dog

I love how you take care of the dog.   I love that you take care of the dog.      Which is correct?  If they're both correct, do they mean the same thing? What's the difference between how and that in sentences like these?


Concatenate multiple files without header

I have several directories ("amazon", "niger",...), in which I have several subdirectories ("gfdl", "hadgem",...), in which I also have several sub-directories ("rcp8p5", "rcp4p5",...). In this last subdirectories I always have two folders ("historical", "projected") that contain thousand of tables having the same frame. Therefore, I would like to concatenate those tables (present in the two folders of the last sub-directories) in order to have just one big table with only one header and not an header each time that a table has been concatenate. Does anyone knows how to do that?  I am currently using the following loop structure:  #!/bin/bash # usage:cat_dat dirname  data_dir=/scratch/01/stevens/climate_scenario/river  for river in tagus   do    for gcm in gfdl-esm2m hadgem2-es      do       for scenario in rcp8p5 rcp4p5 rcp6p0 rcp2p6         do           find "${data_dir}/${river}/${gcm}/${scenario}" name \*.dat -exec cat {} + >> "${data_dir}/${river}/${gcm}/${scenario}.dat"       done    done done   but I can´t get rid of the header with that! Any helps is greatly appreciated! Thanks!


Correct punctuation to introduce a supporting quote

What is the correct way to punctuate the end of a sentence before a quote that directly supports the statement? I assume either a colon or a semicolon, but I have no idea which is correct.  For example:     Waldo is a better hide-and-seek player than Clem; "Waldo was   the winner of the past ten annual hiding awards" (Where's Waldo 13).      Waldo is a better hide-and-seek player than Clem:  "Waldo was   the winner of the past ten annual hiding awards" (Where's Waldo 13).   (Excuse the silly example, but I didn't have a better one.)


We got this question in homework (excuse my poor translation):  This question deals with counting functions between two sets: A. How many functions exist between the set $[1,2,...,n]$ and the set $\{1,2\}$? How many of them are onto? B. How many functions exist between the set $\{1,2\}$ and $[1,2,...,n]$? How many of them are injective?  I don't really know where to start. I tried summing the Binomial coefficient, but it repeats sets. Any ideas to get me going? Thanks!


Network adapter not working with Dell Vostro 1500 Ubuntu 14.04

I installed 14.04 on Dell Vostro 1500 but my network card isn't recognized.  How do I get this installed? Was installed via USB that worked with no issues when OS is ran from USB stick.  0c:00.0 Network controller [0280]: Broadcom Corporation BCM4311 802.11b/g WLAN  [14e4:4311] (rev 01)   Subsystem: Dell Wireless 1390 WLAN Mini-Card [1028:0007]   Kernel driver in use: wl


How do I install node from the file "node-v10.15.3.tar.gz"

I wanted to download the latest version of nodejs(v10.15.3) but installing with the terminal states "v10.15.2" as the latest which is giving me issues.  Anyway I downloaded the file "node-v10.15.3.tar.gz" from the official node.js website. The problem is I don't know how I install this version of node in my machine after I downloaded and extracted the file.  There isn't an apparent installation file and the readme.md file tells me to look at a file "BUILDING.MD" which I did not find in that folder.


How can I give an app permanent permission so it doesn't ask for my password every time?

I am using an application called Hostbuddy to manage entries in my hosts file. It works great, the only problem is that is asks for my password every time I use it, which adds up to a lot of inconvenience. How can I permanently give Hostbuddy the permission it needs? The two things it asks for the password for are to modify the hosts file and to flush my DNS cache.  PS, I understand the security implications of this, and I trust the app.


Apex: Is there a way to strip out non-alphanumeric characters from a string?

In order to store results in the newly released (Winter 16') Platform Cache, I need an alphanumeric string, but currently have a String with the report name that I'm attempting to store, some of which have spaces, hyphens, parenthesis, etc. (i.e. "Sales - Actual Results (TY)").  I'm not sure in APEX how I would strip all these unwanted characters from the string to convert it into the alphanumeric key that I need.  Please & Thank you!


Is it possible with TileMills and CartoCSS?


How to set environment variables for GUI program?

I am using texstudio, a latex editor, on Ubuntu 14.04. When I start it from bash $ texstudio, and click the compile button, it works fine. However, if I start it by clicking the icon in the launcher, I receive   Error: Could not start the command: xelatex -synctex=1 -interaction=nonstopmode   I know the reason is that in the settings, the build command is set to latex -src -interaction=nonstopmode %.tex, so it can be found if texstudio is opened from bash, since it inherits the environment variables I set in .bashrc: export PATH=/my/path/to/latex:$PATH.  My question is, is there a file in which I can set the environment variables for GUI programs?


How can my module add xml sitemap entries?

I have a module with a page callback handler for the path "products". So if the user navigates to products/apples then the module presents a page about our apples, and if they go to products/oranges then etc. These pages include detail about the various products.  I would like XML Sitemap to be populated from my module. After all, it's my module that knows what products exist, their descriptions etc.  Any hook or anything I can use for that?


I want to make a mesh with the shape of the transparency of a PNG image

I want to create the shape of the png image excluding the alpha as an object. This means arranging the vertices to follow the outline of the image(like text objects). Could you teach me if there is a good method or add-on that will process it automatically?


ORACLE SQL I am having problem with a select statement that should show the MAX balance for every branch

Hi guys and thanks to everyone will help me.  I have this query:  SELECT  c.accNum.bID.bID AS "Branch ID", --c.accNum.accNumber AS "Account Number", --c.accHolder.PrintFullName() AS "Customer Name", MAX(c.accNum.balance) AS "Balance" FROM tabCustomersAccounts c GROUP BY c.accNum.bID.bID--, c.accNum.accNumber, c.accHolder.PrintFullName(), c.accNum.balance ORDER BY c.accNum.bID.bID;     When I change the code to this:  SELECT  c.accNum.bID.bID AS "Branch ID", c.accNum.accNumber AS "Account Number", c.accHolder.PrintFullName() AS "Customer Name", MAX(c.accNum.balance) AS "Balance" FROM tabCustomersAccounts c GROUP BY c.accNum.bID.bID, c.accNum.accNumber, c.accHolder.PrintFullName(), c.accNum.balance ORDER BY c.accNum.bID.bID;     From this results you can see that I they are wrong because I want only the MAX balance to be displayed for each Branch.


I'm trying to change the value of $JAVA_HOME & I just can't seem to find in which file is it being set currently. I can't remember where did I set it the last time.  Already tried  but I need(ed) a list of files where the variable can be set.


Why ./home/Desktop is incorrect and ./Desktop is correct?

I'm learning about Linux, started yesterday. I have a question which I couldn't answer from my book or Google. What is the difference between  ./ and / in the shell?  I'm asking this because when I run, for example, the command ./home/yogesh/Desktop/Books, I get this error:  bash: ./home/yogesh/Desktop : No such file or directory   However, on removing the dot it gives  /home/yogesh/Desktop/Books : Is a directory   Or, if I run /Desktop, it returns   /Desktop : No such file or directory   But on adding a dot before /, I get  ./Desktop: is a directory   What is the difference between ./ and /?


I'm making some slides where I want to show permutations with little diagrams of dots and arrows. Here is my attempt to depict the permutation 12345 --> 31245:  \documentclass{article}  \usepackage[all]{xy}  \begin{document} \[ \left( \xymatrix@R=1 em@C=1 em{ \bullet \ar[rrd] & \bullet \ar[ld] & \bullet \ar[ld] & \bullet \ar[d] & \bullet \ar[d]  \\ \bullet & \bullet & \bullet & \bullet & \bullet } \right) \] \end{document}   As you can see, there is a lot of white space at the top. How can I get the height of the xymatrix to only go up to the top of the dots?


Are there any distinct finite simple groups with the same order?

In finite group theory, it's often quite easy to show that there are no simple groups of a given order $n$.  My question is different: is there some natural number $n$ such that there are two non-isomorphic simple groups of order $n$?  The two easiest families of finite simple groups - $\mathbb{Z}_p$ for $p$ a prime and $A_n$ for $n\ge5$ - clearly don't yield any examples.    It should be possible to check this using the , but I don't know enough about the fabled 'sixteen infinite families of groups of Lie type' to do the check myself.  Also, if the answer is 'no', I'd be much more interested to see an elementary(ish) proof than I would be to see a proof that relies on over 3,000 pages of non-stop hard group theory.


I have always been surprised how confident Luke seemed to be when trying to rescue Han Solo from Jabba's palace.   It is fair to assume that training with Yoda boosted his Jedi skills. My understanding is that all that he trains with Yoda is what we see on screen, since in The Return of the Jedi he asks Yoda about what Vader told him in Bespin, a question Luke not refrain to ask when he had the chance (so there is no "off camera" training with Yoda between episodes 5 and 6).  I know that it is impossible to know how much training with Yoda improved Luke's abilities, but maybe it is possible to know for how long he trained with him?  My recollection from watching The Empire Strikes Back is that there is no good or reliable way of measuring the time our heroes spend either imprisoned in Bespin or in Dagobah, but maybe I missed something or there are other sources that can answer the question of how long does Luke Skywalker train with Yoda?


I am having trouble understanding the following:  "the achievable rate of the optimal AF scheme performs close to the cut-set like bound obtained in this paper"  I think that the word "like" (above) is intended to be used as a suffix to express the fact that the bound is "cut-set"-like.  My question is what to do in such a case to show the connection between the words. Is it  (a) "cut set-like" (b) "cut-set-like" (c) "cut set(en dash)like" (d) something else  Please help me.


I'm new to D&D and most of the stuff is easily understood (though might require some time spent reading the rules). What has me flummoxed is how casting of bless works for my cleric. I can't figure out how I determine if the cast was successful. I understand the mechanics for attack spells and spells requiring saving throws. But can anyone shed some light on how I determine if the cast for Bless was successful?


Determinant of elementary permutation matrix

Why is the determinant of an elementary permutation matrix equal to $-1$?  I am brand new to determinants and I've tried expanding it and using cofactor expansion, but it's messy and complicated. I would prefer if someone could show me using expansion, but alternative methods are welcome. Thanks.


What could cause a "hash sum mismatch" error when doing an apt-get update serverside?

I have several apt repositories for different versions of Ubuntu, they are all pretty similar except for the one I just made for xenial servers. When a xenial server does an apt-get update and talks to my repo, it gets a "hash sum mismatch" error for Packages.gz. What could cause that?  I do not think that this is a duplicate of  because the answers there all assume that the problem is with the client, but in my case the problem is on the server, so no matter what you do on the client it doesn't fix the problem. Unsurprisingly, none of the answers to that question worked.


Java: (Error) Exception in thread "main" java.lang.NullPointerException at Main.main(Main.java:14)

I realize this is a common error, and I have tried to solve it using the other questions asked about this exact error, however I could not come up with a solution. I made an array of 10 cars, and am setting the make, color, and year of each of them.  The getter and setter methods are in another class called "Car". I'm not sure where something is set to null.  Thank you in advance for any help.  Error: Exception in thread "main" java.lang.NullPointerException     at Main.main(Main.java:14)  import java.util.Random;  public class Main {  public static void main(String[] args) {      //Array of 10 cars     Car[] cars;     cars = new Car[10];      //Assign random colors and makes of my choice     cars[0].setMake("Toyota");     cars[1].setMake("Kia");     cars[2].setMake("Porsche");     cars[3].setMake("Ferrari");     cars[4].setMake("Honda");     cars[5].setMake("Jaguar");     cars[6].setMake("Lexus");     cars[7].setMake("Nissan");     cars[8].setMake("BMW");     cars[9].setMake("Tesla");      cars[0].setColor("Black");     cars[1].setColor("Green");     cars[2].setColor("Silver");     cars[3].setColor("Red");     cars[4].setColor("Yellow");     cars[5].setColor("White");     cars[6].setColor("Blue");     cars[7].setColor("Orange");     cars[8].setColor("Purple");     cars[9].setColor("Gold");      //Randomly selected years for the cars     int maxYear = 2015;     int minYear = 2010;     int maxYear2 = 2009;     int minYear2 = 1990;      Random r = new Random(1234);     cars[0].setYear(r.nextInt(maxYear - minYear + 1) + minYear);     cars[1].setYear(r.nextInt(maxYear - minYear + 1) + minYear);     cars[2].setYear(r.nextInt(maxYear - minYear + 1) + minYear);     cars[3].setYear(r.nextInt(maxYear - minYear + 1) + minYear);     cars[4].setYear(r.nextInt(maxYear - minYear + 1) + minYear);     cars[5].setYear(r.nextInt(maxYear2 - minYear2 + 1) + minYear2);     cars[6].setYear(r.nextInt(maxYear2 - minYear2 + 1) + minYear2);     cars[7].setYear(r.nextInt(maxYear2 - minYear2 + 1) + minYear2);     cars[8].setYear(r.nextInt(maxYear2 - minYear2 + 1) + minYear2);     cars[9].setYear(r.nextInt(maxYear2 - minYear2 + 1) + minYear2);  }  }


Did they check the ticket anytime in HP?

It's something that I'm not sure if it was put in the books or was left outside the book for people to guess but... In any moment of the books, during the travel from the train between King Cross and Hogwarts, did they ask or checked the ticket? I remember the scene on first year/book that Hagrid almost forgot to give Harry the ticket, even when he did not tell about the 9 3/4, but I'm not sure if it was mentioned if they really need the ticket.


Exercise numbering with overlays in beamer

In would like to use the exercise package in a beamer presentation (this allows me to keep the conventions I use in the corresponding paper document).  This works well except that exercise numbers are changing with overlays. How can I avoid Exercise counter to be affected by beamer overlays ?  Here is a simple example:  \documentclass{beamer} \usepackage{exercise}  \setbeamercovered{transparent}  \begin{document}   \begin{frame}   \frametitle{Title}    \begin{Exercise}    This is the content of my exercise.   \end{Exercise}   \pause   \begin{block}{A block which appears later}    This is the content of my block.   \end{block}  \end{frame}  \end{document}


Is Google's 72 qubit device better than D-Wave's machines, which feature more than 2000 qubits?

Google recently announced the Bristlecone 72 qubit quantum computer. However, D-Wave already announced quantum computers featuring more than $2000$ qubits.  Why is Google's new device newsworthy then? Is it better than D-Wave's machine in some respects? If so, how?


Can anyone help me in finding this integral? Without using differentiation under integral sign.

Solve the integral $I$ = $\int_0^{\infty} \frac{\sin x}{x} dx$


Random number generation and probability

I recently ran into two problems:   given a rand() function that generates 0 and 1 with 50% probability respectively (binary outcome), how to write some code to generate 1 with 90% of the chance and 0 with 10%? There is a society where people will NOT stop having babies until they have a boy. What's the ratio of boys and girls in that society? Consider it's equal probability to have either a boy or a girl.   If possible, please advise what kind of background prob/stats materials these relate to. Thanks!  UPDATE: Here are some thoughts on the two questions:  1.since rand() only generate 0 or 1, it's useless to write code like the following:   if (rand() < 0.1) {      return 0; } else {      return 1; }   I guess this involves Bernoulli trial and Binomial distribution, but the question asks for EXACT distribution for 90% of 1 and 10% of 0. I'm puzzled how to proceed.   2.I put it the wrong way - my bad.  My initial thoughts on this is as follows:  Suppose $\text{P}(B) = \text{P}(G) = 0.5$ B' = boys in the society    $$\text{P}(B') = \text{P}(B) + \text{P}(B|G) + \text{P}(B|G,G) + \text{P}(B|G,G,G) + ...$$   But I didn't see how to derive this equation into computable format.   UPDATE 2 (from @David Marx):   Problem 1  think of this as a binary number with 4 bits (n) - represents range [0, 15] with each equal probability of 1/16.  Now to get 1 with 90% probability, we can write something like this:  if (n < 9) {     return 1; } else if (n == 9) {     return 0; }   This way, Prob(n in range[0,9)) = 9/16; Prob(n = 9) = 1/16; So the returned value will be 1 at 90% of the time.    Problem 2   The reminding of Geometric Series is appreciated! The equation indeed matches my initial thoughts on the summation of conditional probabilities -- I failed to recognize it as geometric series.   So I guess the ratio should be the result for that summation:    $$\text{P}(B') = (1/2) + (1/2)^2 + (1/2)^3 + ...        = 1/(1-(1/2)) - 1       = 1. $$  So the ratio of boys in the society will be 100%? Anything wrong here?


How can I display result Stream<int[]> allResults = list.stream();  I try:  allResluts.forEach(System.out::println);


I use a Bluetooth keyboard with my iPad. When I am sending messages through the Messages app, the enter key does not initiate a "send" the way I expect (it, instead, just returns down to the next line). Is there a way to make the "enter" key send the message instead of dropping down to the next line? Some magic key combination perhaps?


How to read a text file reversely with iterator in C#

I need to process a large file, around 400K lines and 200 M. But sometimes I have to process from bottom up. How can I use iterator (yield return) here? Basically I don't like to load everything in memory. I know it is more efficient to use iterator in .NET.


I understand that as your velocity approaches the speed of light, the amount of energy required approaches infinity.   So, hypothetically, you are in a space craft travelling just 3mph below the speed of the light. If you attempted to run the direction the craft is travelling, would you not be able to move? Or is there some special relativistic effect that comes in to play?


How put a math expression in chapter heading?

I have trouble when put an equation with exponents in the \chapter.  \documentclass{scrbook} \usepackage{classicthesis-ldpkg} \usepackage{amsmath}  \begin{document}  \chapter{Sistem A: $L(\dot{q}_2,\dot{q}_2)=\dot{q}_1^2+\dot{q}_2^{2}$}  \end{document}   But it gives me multiple errors that doesn't appear when I compile, in the index contents appears the equation if I change \chapter for \section instruction, but I need put this in the chapter. Any help?


Example where $\int_{\text{Int} S} f$ exists and $\int_S f$ does not.

Let $S$ be bounded in $\mathbb{R}^n$, let $f:S\rightarrow \mathbb{R}$ be bounded continuous function. Give an example where $\int_{\mathrm{Int} S} f$ exists and $\int_S f$ does not.   Notice this is not the same as given $\int_\bar{S} f$ exists and $\int_S f$ not.  I think the key is the following theorem:  Let S be bounded on $\mathbb R^n$, $f:S\to \mathbb R$ be bounded continuous. Let $E$ be the set of points $x_0$ of $\partial S$ (the boundary of $S$) for which $$\lim_{x\to x_0} f(x) \ne 0$$ fails to hold. Then $f$ is integrable over S if $E$ has measure zero.


Let $p$,$\ q$ be prime numbers and $n\in \mathbb{N}$ such that $p \nmid n-1$. If $p \mid n^q-1$, then $q \mid p-1$.

Attempted Proof:  Let $S = \{k: n^k-1 \equiv 0 \pmod{p}, k\in \mathbb{N}\}$. Minimal element $r$ exists by Well-Ordering. we show $r=q$.  We note, $\gcd(p,n)=1$, otherwise $p \mid n^q-1 \implies p \mid 1$.  We have:  $n \not\equiv 1 \pmod{p}\implies n^2 \not\equiv n \pmod{p}$ ; [since $p , n$ are coprime and  $p$ prime ]. Now, for any $0<j< i < r,$  $n^i \equiv n^j \pmod{p} \implies n^j(n^{i-j}-1) \equiv 0 \pmod{p} \implies (n^{i-j}-1) \equiv 0 \pmod{p} $, contradicting the minimality of $r$.   Now, we proceed to show that, all elements of $S$ are integral multiples of $r$. (Claim 1)  We have, $n^{tr} \equiv 1 \pmod{p} \implies n^{tr+l} \equiv n^l \pmod{p} $, for $0\leq l <r$. Now, for any two such $l$, say $c$ and $d$, with $d<c$ ,   $n^{tr+c} \equiv n^{tr+d} \pmod{p} \implies n^{tr+d}(n^{c-d}-1) \equiv 0 \pmod{p}$, which again contradicts our assumption that $r$ is the least element of $S$. Hence, Claim 1 is established. But, it implies that $q$ is composite (an impossibility); hence $r$ must be equal to $q$ .   Finally, by Fermat's Little Theorem, we have $n^{p-1} \equiv 1 \pmod{p}$ [ it holds, since $\gcd (p, n) =1$].   Therefore, $p-1$ must be an integral multiple of $q$, i.e. $q \mid p-1$.   PS: I am aware of the duplicates, but I want my solution checked. Thank you.


I bought a 4 pound pork tenderloin and put it immediately in the freezer.  It was there a week or so.  Then I took it out and placed it on the counter Monday night to thaw.  I don't have central heat and my internal thermometer hasn't gotten above 40-45 in days.  I forgot about the tenderloin for about 20 hours.  I was prescribed a medication that made me rather violently ill the last two days.  When I remembered on Tuesday evening, I ran and grabbed it and threw it in the fridge.  It was cool (like it had been in the fridge) to the touch.  It was vacuum packed.  I took it out today to roast after asking for advice in a group I am in.  Everyone there said it would be fine.  I even read that the door in a fridge can get up to 59 degrees, so food stored there spoils faster.  I opened the roast and it had a slight smell.  I rinsed it and there was zero smell.  It is not slimy.  It isn't stinky.  Think it's okay to roast and eat?