Subscribing to C# EventHandler events from C++\CLI

I have the following C# code, which uses the generic EventHandler delegate:  public class EventSource {     public event EventHandler<MyEventArgs> SomethingHappened; }   I'm trying to subscribe to this event from a C++\CLI code:  public ref class EventSink { public:     void Handler(Object^ sender, MyEventArgs^ args)      {          DoSomthing(args);     } };  class Manager { private:     gcroot<EventSource^> _eventSource;     gcroot<EventSink^> _eventSink;  public:     Manager()     {         _eventSource = gcnew EventSource();         _eventSink = gcnew EventSink();          _eventSource->SomethingHappened += // What do I put here?     } }   How do I instantiate a EventHandler delegate to pass to the _eventSource->SomethingHappened.Add property?


Is it possible to run more than one command in a someapp.desktop file?

i am just trying to find a way to run an extra command when opening an app (Firefox), but i am failing miserably...   The original question is .  I tried to add my command after the app command as in the following line:  Exec=firefox %u & /bin/monitor_process.sh firefox   But this results in the monitor_process.sh being opened by FF, showing an "open file with..." dialogue box.  I tried ; & && but to no avail...  So, any idea how to handle multiple commands in .desktop files?  Also,  Said:     that also won't work. Exec= has to have exactly one statement, no ; is allowed.


Prove that the center of group G is a subgroup of G.

By definition, the center of G is the set:  $Z(G)$ = {$g\in G|g^{-1}xg=x$ for all $x\in G$}  We need to show that:   The identity element exists It is closed under the operation For every element $g$, there exists in $G$ the inverse element $g^-1$   My attempt:   Since it is defined that:   $g^{-1}xg=x$  Thus implying that $g^{-1}\in G$.   For the identity element $e$ and any element $x\in G$, since the identity element is its own inverse, it then implies:   $e^{-1}xe=x$  Hence $e\in G$.   Now by multiplying by $g$ on both sides, we get:   $g(g^{-1}xg)=gx$  $(gg^{-1})xg=gx$  $(e)xg=gx$  $xg=gx$  Thus, it is closed under the operation, hence implying that $Z(G)$ is a subgroup of $G$. Your help and feedback would be really appreciated.


I am trying to send email through OpenSSL as below :  Client > openssl s_client -crlf -connect smtp.mail.yahoo.com:465 SERVER > 220 smtp.mail.yahoo.com ESMTP ready Client > HELO localhost SERVER > 250 smtp.mail.yahoo.com Client > auth login SERVER > 334 VXNlcm5hbWU6 Client > aC5rYW1yYXZh SERVER > 334 UGFzc3dvcmQ6 Client > bXlQYXNz // It's not my real password :) SERVER > 235 2.0.0 OK Client > MAIL FROM: <h.kamix@yahoo.com> SERVER > 250 OK , completed Client > rcpt to: <h.kamix1@gmail.com> SERVER > 250 OK , completed Client > data SERVER > 354 Start Mail. End with CRLF.CRLF Client > subject: Test title Client > Hello this is a test email. Client > . Client >  SERVER > 250 OK , completed Client > quit SERVER > 221 Service Closing transmission SERVER > closed   Everything looks fine, but it doesn't send any email and gets me Service Closing transmission error at the last step!   I think it's clear enough.  Please tell me what am I missing here?


Where to view error log for already finished tar archive command?

I ran below command:  tar cvf ~/data.tar /home/user/data/   It showed lot of filenames on the screen, after 10 minutes I see:     tar: Exiting with failure status due to previous errors   Where can I see the error log for tar (is it somewhere under /var/log). I can see that there is 100 Mb difference between the tarred version and the original. I want to know the names of missing files from newly created archive.  du -sh data.tar /home/user/data 5.7G     data.tar 5.8G      /home/user/data   Using GNU tar 1.27.1


Is the auto generated serialVersionUID always the same for all instances of the same class?

The reason I ask this is because I am currently getting this error     java.io.InvalidClassException: com.my.package.TestObject; local class incompatible: stream classdesc serialVersionUID = 8401131515464509133, local class serialVersionUID = 581907934314849590   I get this because I am reading an old version of an object from a Redis cache but I have changed the object to have a new field - the old version of the class did not originally have a serialVersionUID so it's using this auto-generated one.  e.g old version  public static class TestObject implements Serializable {         String id;         String name;     }   new version  public static class TestObject implements Serializable {         String id;         String name;         String newField;     }   Q - So my question is if I add private static final long serialVersionUID = 8401131515464509133L to the class will it be a problem for other instances of the object?  EDIT: the main question I am asking is does the value that was computed for the auto-generated serialVersionUuid each time a class is compiled?  or can I rely on it been the same every compile? (when no new fields are added)?


I'm trying to download Photoshop CS6, but I can't find Setup.exe on my computer. I'm still new to Ubuntu, so I need help. Any advice would help me right now.  I've followed instructions on the forum, but I don't know where to find Setup.exe if I even have it! Where is it found? And what do you do if it isn't there? I'm desperate for Photoshop now, and since my Wacom is coming soon, I'd like to have Photoshop to work with it.


Database Recovery Model - Simple vs. Full

Does the SIMPLE Recovery Model perform the same transaction logging as FULL Recovery Model? i.e. keep record of each insert/update/delete transaction?  If this is the case, then why should FULL Recovery model be used? In SIMPLE Recovery, Checkpoints run every minute on a busy database, so the data is written to disk.  Where does the data loss potentially occur on SIMPLE Recovery Model?  Thanks!


Can someone tell me what LaTeX typeface this is?

It's the font used for the examples on the Texpad website, it's not one of the default fonts, but I can't seem to find what it is. I'm hoping someone would recognise it, thanks.


Did you know how to model this bevel ? I need to reproduce them but i can't.  Best regards, A Frenchman in shit


How come dont get a NullPointerException when I call w.getX() in constructor Turtle(...) but when i call it in method getX() i do.  I'm guessing it has something to do with the public and private statements?  public class Turtle {     int x, y;     private boolean pen;     private double rikt;     private SimpleWindow w;      public Turtle(SimpleWindow w, int x, int y) {         w.moveTo(x, y);         System.out.println(w.getX());         rikt = Math.PI / 2;         pen = false;     }      public int getX() {         return w.getX();     }      public int getY() {         return w.getY();     }  }   The main looks like this:   public class TurtleDrawSquare {      public static void main(String[] args) {         SimpleWindow w = new SimpleWindow(600, 600, "TurtleDrawSquare");         Turtle t = new Turtle(w, 300, 300);         t.penDown();         for (int i = 0; i < 4; i++) {             t.forward(100);             t.left(90);         }     } }


Changing variable assignment to boolean value like in Python, but this time in Java

I would like to know why I get this following error in the terminal:  Users-MBP:~ user$ javac Testing2.java Testing2.java:18: error: variable result is already defined in method main(String[])     boolean result = true;             ^ 1 error   When I try to run the following program:  public class Testing2 {      private static int TwiceRepetition(int[] elems) {        ///      }         public static void main(String[] args) {          ///     } }   In fact, the desired output is that it prints true if there's a consecutive repetition length two of any element. Otherwise, it prints false.  The error states that variable result is already defined. Yes. But can't you redefine it just like in Python?  For example, in python, I'm allowed to do this (meaning there's no errors that prevent me from redefining the variable result to true if the conditions is satisfied):  def p1(x):       result = False      i = 0      while i < len(x) - 1:        if x[i]== x[i+1]:             result = True        i = i + 1      return result   But in java, it doesn't work, why?


$f:\mathbb R \to \mathbb R$ be a continuous such that $f(f(f(x)))=x,\forall x \in \mathbb R$ , is $f(x)=x , \forall x \in \mathbb R$?

Let $f:\mathbb R \to \mathbb R$ be a continuous function such that $f(f(f(x)))=x,\forall x \in \mathbb R$ , then is it true that $f(x)=x , \forall x \in \mathbb R$ ? I can see that $f$ is bijective , hence strictly monotone . But I cannot progress further . Please help. Thanks in advance


Nested summations and their relation to binomial coefficients

As the festive seasons is coming to a close and we've seen out all twelve days of Christmas I found myself thinking about the famous carroll of the same name. Namely, how many presents  in total did my true love give to me? This is can be given by the nested summation $\sum \limits_{i=1}^{12} (\sum \limits_{j=1}^i j)$ , where the inside sum is the number of presents received each day (i.e a partridge in a pear tree on the first day, two turtle doves and a partridge in a pear tree on the second day, etc.) and the outside summation sums over the days. This can be found to be 364, but what about in general for $n$ days of Christmas?  Well we can generalise the summation by just inserting $n$ into the summation and solving it. $\sum \limits_{i=1}^{n} (\sum \limits_{j=1}^i j)$ Using the well known solution of the sum $~ \sum \limits_{i=1}^{n}i = \frac{n(n+1)}{2}  ~$ we can obtain a non-nested sum, $ = \sum \limits_{i=1}^{n} \frac{i(i+1)}{2} = \sum \limits_{i=1}^{n} (\frac{1}{2}i^2 + \frac{1}{2}i )$ , which we can split into separate summations $ = \frac{1}{2} \sum \limits_{i=1}^{n} i^2 + \frac{1}{2}\sum \limits_{i=1}^{n}i = \frac{n(n+1)(2n+1)}{12}+ \frac{n(n+1)}{4} = \frac{n(n+1)(2n+1) + 3n(n+1)}{12} = \frac{2n^3 + 6n^2 + 4n}{12} = \frac{n(n+1)(n+2)}{6}$ which we notice can be written as the binomial coefficient, $ = {n+2\choose3}$. This doesn't really come as any surprise since this kind of problem seems like the prime candidate for one which could be solved using some fancy combinatorics to yield a binomial coefficient. But if we notice now that we can write the standard arithmetic series sum as a binomial coefficient, eg., $~ \sum \limits_{i=1}^{n}i = \frac{n(n+1)}{2} = {n+1\choose2} ~$ we might notice a similarity between them.   Similarly it can be shown that for a twice nested sum we have, $\sum \limits_{i=1}^{n} (\sum \limits_{j=1}^i (\sum \limits_{k=1}^j k)) = {n+3\choose4} $.  In general it seems for an $(m-1)$-th nested sum (i.e, one which has $m$ summation symbols) we have, $\sum \limits_{i_1=1}^{n} \sum \limits_{i_2=1}^{i_1} \sum \limits_{i_3=1}^{i_2} \dots \sum \limits_{i_m=1}^{i_{m-1}}i_m = {n+m\choose1+m} $ and this is likely provable with induction.    My question is to you is, how can this relationship between binomial coefficient and summations be thought of? That is to say, why would taking the number of possible pairs of $n+1$ elements happen to give you the sum from $1$ to $n$? And how does this somehow seem to extent with nested summations; the number of ways you can take 3 elements from $n+2$ gives you the first nested summation and so on? I'm sure some combinatorics whizz will be able to rearrange the way we count these sums somehow to yield the answer. Anyway at the very least it's interesting to think about - happy holidays!


Invite users to inline edit not only on hover?

It's very common to indicate to the user that they can "edit in place" by changing the style of the editable content when hovered over (e.g. adding a yellow background, "click to edit" tooltip, pencil icon appearing, etc).  This means the user doesn't discover the functionality until they just happen to hover over something editable.  In my web application, I have a page that has upwards of 25 editable fields.  I want the user to know just by looking at the page that they can make edits.  Additionally indicating the ability via hover would just be an added bonus.  I've thought about dotted underlining each editable content, as this usually implies "hint" or "hover on me" (like the image below):    The problem with this though is that it doesn't imply "i'm editable", it instead just encourages the user to hover (without them knowing why), and then the hover will have the indicator.  Maybe this is OK?  At least they'll discover it faster.  But is there a better way?  NOTES: The reason the page isn't a permanent edit form is because users want to view-only the information just as often as they want to edit it.  But when they do want to edit, they usually just want to quickly edit a single field.  Also, I am not worried about mobile, as my users are solely on desktops.


I attempted to extend my ubuntu partition using windows disk management, but quickly realized that you cannot extend a volume with this file system using that method.   I want to be able to extend my ubuntu partition to use the unallocated space.


Is there any difference in meaning between the following terms? Can they be used interchangeably?   terminal console shell command line interface   If any, what are the differences?


What is wrong with this custom command sign?

When I try give myself my custom command sign using a command block, it says this:  [14:16:02] Data tag parsing failed: Unexpected token 'H' at: Honjo Masamune\\",Lore:[\\"The Honjo Masamune is the finest sword ever made.\\",\\"It was created by Masamune,the best swordsmith to ever live\\"]},AttributeModifiers:[{AttributeName:\\"generic.movementSpeed\\",Name:\\"generic.movementSpeed\\",Amount:40,Operation:1,UUIDMost:70725,UUIDLeast:981697},{AttributeName:\\"generic.attackDamage\\",Name:\\"generic.attackDamage\\",Amount:140,Operation:1,UUIDMost:84742,UUIDLeast:31325}],ench:[{id:0,lvl:120},{id:1,lvl:120},{id:2,lvl:120},{id:3,lvl:120},{id:4,lvl:120},{id:5,lvl:120},{id:6,lvl:120},{id:7,lvl:120},{id:8,lvl:120},{id:16,lvl:120},{id:17,lvl:120},{id:18,lvl:120},{id:19,lvl:120},{id:20,lvl:120},{id:21,lvl:120},{id:32,lvl:120},{id:34,lvl:120},{id:35,lvl:120},{id:48,lvl:120},{id:49,lvl:120},{id:50,lvl:120},{id:51,lvl:120}],HideFlags:7,Unbreakable:1}\"}}"   Here is the command I'm trying to use:  /give @p sign 1 0 {BlockEntityTag:{Text1:"{\"text\":\"Honjo Masamune\",\"color\":\"gray\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/give @p iron_sword 1 0 {display:{Name:\\"Honjo Masamune\\",Lore:[\\"The Honjo Masamune is the finest sword ever made.\\",\\"It was created by Masamune,the best swordsmith to ever live\\"]},AttributeModifiers:[{AttributeName:\\"generic.movementSpeed\\",Name:\\"generic.movementSpeed\\",Amount:40,Operation:1,UUIDMost:70725,UUIDLeast:981697},{AttributeName:\\"generic.attackDamage\\",Name:\\"generic.attackDamage\\",Amount:140,Operation:1,UUIDMost:84742,UUIDLeast:31325}],ench:[{id:0,lvl:120},{id:1,lvl:120},{id:2,lvl:120},{id:3,lvl:120},{id:4,lvl:120},{id:5,lvl:120},{id:6,lvl:120},{id:7,lvl:120},{id:8,lvl:120},{id:16,lvl:120},{id:17,lvl:120},{id:18,lvl:120},{id:19,lvl:120},{id:20,lvl:120},{id:21,lvl:120},{id:32,lvl:120},{id:34,lvl:120},{id:35,lvl:120},{id:48,lvl:120},{id:49,lvl:120},{id:50,lvl:120},{id:51,lvl:120}],HideFlags:7,Unbreakable:1}\"}}"},display:{Name:"Custom Sign"}}


How to remove iCloud alert badge from macOS settings icon

How can I get rid of this annoying red badge on the Settings icon? I want to see such a badge when there is an update available, not for making me use iCloud if I don't want or need it.


I have problem with calculate limit of $(a^n-b^n)^{1/n}$ where $b>a$ When $a>b$ it's easier. Is true that $\lim_{n \to\infty} (-1)^{1/n}=1$? If so how prove it. I think that need to take the proof in complex number.


I downloaded Norton for my MacBook Pro 2018 13 inch a few months ago, and after uninstalling it, according to the instructions given by the official Norton FAQ, some files remained in my computer that couldn't be deleted by dragging them to the bin. I ran another program designed by Norton to exclusively eliminate any leftover files from the antivirus program itself, and I still can't get rid of one final file: NortonForMac.kext. My MacOS is in Spanish, so the directory in which it appears to be stored in is /Macintosh HD/Biblioteca/StagedExtensions/Library/Extensions. Can someone help me delete it?


How do I find work done by friction over a curve represented by a polynomial?

I am facing a problem in Physics.   Problem: What will be the work done by the frictional force over a polynomial curve if a body is sliding on this polynomial($a+bx+cx^2+dx^3+\ldots$) curve from rest from the height $h_1$ to height $h_2$ (where $h_1 > h_2$).  I tried to solve this as follows:  frictional force $F = k mg \cos\theta$, where $mg \cos\theta$ is  normal force at that point. $k$ is coefficient of friction  Total work done=Line Integration over the polynomial(dot product of F and displacement).  But to go ahead from this point,i do not know.


Is there any package which can be used for avoiding hyphen in text?  Regards


Why does this Python cube root give a wrong answer?


How can I enable USB tethering through ADB?

I was going through this . but I can't find a way to enable USB tethering through adb. Is there any other way I can do it?


Bad performance with ReLU activation function on MNIST data set

I'm quite new to neural networks and currently I'm trying to train a non convolutional neural network on the MNIST data set. I'm observing some behaviour I don't quite understand.   This is the code written with keras as the library:  # the data, split between train and test sets (x_train, y_train), (x_test, y_test) = fashion_mnist.load_data()  y_train = keras.utils.to_categorical(y_train, 10) y_test = keras.utils.to_categorical(y_test, 10) model = Sequential()  early_stopper = EarlyStopping(patience=3)  model.add(Flatten(input_shape=(28,28))) model.add(Dense(128, activation="relu")) model.add(Dense(128, activation="relu")) model.add(Dense(10, activation="softmax")) model.compile(loss="categorical_crossentropy", optimizer="adam", metrics=["accuracy"])  model.fit(x_train, y_train, epochs=20, validation_data=(x_test, y_test), callbacks=[early_stopper])   This gives me a validation_acc of around 20%. The funny thing is, when I change the activation functions to "sigmoid", the loss function to "mean_squared_error" and the optimizer to "sgd" my performance improves to around 85% after 50 epochs.   Having read  I wonder what's the reason for the bad performance of the network I presented in the code. ReLU, cross-entropy and a dynamic optimizer like Adam all seem to improve on the idea of a very vanilla neural network with stochastic gradient optimization, mean squared error as loss and sigmoid activation functions. Yet I get a really bad performance and if I increase the number of nodes in the hidden layers I often get a network that doesn't learn at all.   EDIT: I figured out it has something to do with me not normalizing the input to values between 0 and 1 ... but why is this the problem?


How can I get GOOGLEFINANCE to return only the historical price of a stock and not an array?

I'm trying to figure out the cost basis of some stock that I sold last year and I can't quite get GOOGLEFINANCE to do what I want. The stock was purchased through a DRIP so there are about five shares that get added every quarter over a long period of time.  I have the settlement dates and number of shares but, before 2003, I don't have the purchase price. So, I'm trying to use the GOOGLEFINANCE function to figure out the price but if I write   =GoogleFinance("GOOG", "PRICE", 3/3/2000)   I get a 2x2 array rather than just the historical price.  Is there any way to chain GOOGLEFINANCE into another function that would return just the value in the lower right cell?


trying open blender but getting error failed to set 44100hz, got 48000hz instead.and crashing. what to do?

I am new to blender and installed it for the first time in my computer.   And when i started it  showed a error "Error AL lib: UpdateDeviceParams: Failed to set 44100hz, got 48000hz instead.". And the error closed automatically and blender did not open at all.   I looked around on internet and found the most common solution to this problem was deleting the config files in appdata. But the thing is there is no Blender Foundation folder in my appdata\Roaming  What should i do?. My blender is 2.79


Multivariable limits: $f(x,y)=\frac{\sin(x y)}{x}$

$f(x,y)=\frac{\sin(x y)}{x}$ if $x\neq0$ $f(0,y) = 0$ Find the limit at $(0,0)$ if it exists, or prove the limit doesn’t exist.


Can a dictionary be used to pass variables to a function?

I have a class with an init function that needs ~20 variables passed to it. Instantiations of the class are rather ugly:  some_var = MyClass(param1=mydict('param1')                    param2=mydict('param2')                    param3=mydict('param3')                    ...                    param20=mydict('param20')   I keep all of those parameters in a dictionary for easy handling already. Not all parameters are necessary so I don't want the class to accept only a dictionary object I don't think.  I'm wondering if I there's a nice trick to clean this up by specifying that the parameters to init are to be taken from the dictionary?   I'm just looking for tips and tricks on tidying this up a little. I have quite a few long/ugly instantiations of this class.


Simplify $\frac{1}{1\times2\times3} + \frac{1}{2\times3\times4} +\frac{1}{3\times4\times5}+\cdots+\frac{1}{n(n+1)(n+2)}$

This is a very interesting word problem that I came across in an old textbook of mine. So I know its got something to do with sequencing and series, which yields the shortest, simplest proofs, but other than that, the textbook gave no hints really and I'm really not sure about how to approach it. Any guidance hints or help would be truly greatly appreciated. Thanks in advance :) So anyway, here the problem goes:     Simplify $$\frac{1}{1\times2\times3} + \frac{1}{2\times3\times4} +\frac{1}{3\times4\times5}+\cdots+\frac{1}{n(n+1)(n+2)}$$


I'm getting a NullPointerException for the code below, and I don't quite understand why (or how to fix it). I know that my first node (next) is null, and that I can't call any methods on it without causing a null pointer exception, but I can't make it 'not null' without calling any methods on it :(. The null pointer exception is thrown in the first for loop in the insert function.   Here's my node class:  public class Node {  public Node next; public String word;  public Node(String word){     this.word = word; }  public void display(){     System.out.println (word); }  public String toString(){     return word; }   And here's my linked list class  public class WordLinkedList {  private int size; //integer to store the size of the linked list (# of words) private Node firstnode; // reference to first node  public WordLinkedList(){     size = 0;     firstnode = new Node(null); // setting first node to null - dummy node ... I think ???!!! }     public WordLinkedList(String[] arrayOfWords){     for (int i = 0; i < arrayOfWords.length; i++){         this.insert(arrayOfWords[i]);     } }   public void insert(String newword){     Node newNode = new Node(newword);     for (Node iterator = firstnode.next; iterator != null; iterator =        newNode.next){         if (iterator.word.compareTo(newword) < 0){             if (iterator.next.word.compareTo(newword)>0){                 newNode.next = iterator.next;                 iterator.next = newNode;             }         }         if (iterator.word.compareTo(newword) > 0){             iterator.next = iterator;             firstnode.next = newNode;         }     } }  public void display(){     Node theNode = firstnode;      while (theNode != null){         theNode.display();         System.out.println("Next node: " + theNode.next);         theNode = theNode.next;         System.out.println();     } }   }


Examples of 'almost' vector spaces where unitary law fails

I was looking at the definition on wikipedia of a vector space (similar/equivalent definitions are everywhere, but I thought I'd list it here for completion):  A vector space over a field $F$ is a set $V$ together with two binary operations that satisfy the eight axioms listed below. Elements of $V$ are called vectors. Elements of $F$ are called scalars. In the two examples above, our set consists of the planar arrows with fixed starting point and of pairs of real numbers, respectively, while our field is the real numbers. The first operation, vector addition, takes any two vectors $v$ and $w$ and assigns to them a third vector which is commonly written as $v + w$, and called the sum of these two vectors. The second operation takes any scalar a and any vector $v$ and gives another vector $av$. In view of the first example, where the multiplication is done by rescaling the vector $v$ by a scalar $a$, the multiplication is called scalar multiplication of $v$ by $a$.  To qualify as a vector space, the set $V$ and the operations of addition and multiplication must adhere to a number of requirements called axioms. In the list below, let $u$, $v$ and $w$ be arbitrary vectors in $V$, and $a$ and $b$ scalars in $F$.   Associativity of addition: $u + (v + w) = (u + v) + w$ Commutativity of addition: $u + v = v + u$ Identity element of addition: There exists an element $0 ∈ V$, called the zero vector, such that $v + 0 = v$ for all $v ∈ V$. Inverse elements of addition: For every $v ∈ V$, there exists an element $−v ∈ V$, called the additive inverse of $v$, such that $v + (−v) = 0$ Compatibility of scalar multiplication with field multiplication: $a(bv) = (ab)v$ Identity element of scalar multiplication: $1v = v$, where $1$ denotes the multiplicative identity in $F$. Distributivity of scalar multiplication with respect to vector addition: $a(u + v) = au + av$ Distributivity of scalar multiplication with respect to field addition: $(a + b)v = av + bv$   I was wondering if there were any examples of vector spaces where only the law for the identity element of scalar multiplication fails? The only one I could think of would be to redefine a true vector space's scalar multiplication to multiply the result by a constant factor. Are there others?


How shall I install and invoke IDLE for Python3?

In Ubuntu, I tried to invoke IDLE  $ python3 -m idlelib ** IDLE can't import Tkinter. Your Python may not be configured for Tk. **   How shall I solve the problem?  I attempted to install idle by sudo apt-get install idle, but after that, running idle will invoke a shell for Python2.7 not for Python3.  Thanks.


Segmentation fault (core dumped) error (C)

I've been working on this code for hours but it always gives me error, I don't really know what to do. This code should return a string of 1s and 0s, reading a tree. I'll put in here both code and structures. When i try to execute it it gives me segmentation error, i don't know where's the problem. I want it to return char* .  struct info{     int frequency;     char symbole; }info;  typedef struct info* pinfo;  struct node{     struct info* in;     struct node* right;     struct node* left; }node;  typedef struct node* pnode;    struct tree{     pnode root;     int frequency; };  typedef struct tree* ptree;  char * codage(char c, pnode pn){     char cl[]=" ";     char cr[]=" ";     if(pn->in->symbole==c){         return "";     }else{         printf("testtttK\n");         if(pn->left==NULL){             return "3";         }else{             strcpy(cl,strcat("1",codage(c,pn->left)));             strcpy(cr,strcat("0",codage(c,pn->right)));         }     }     char* res;     if (cl[strlen(cl)-1]=="3"){         res=cr;         return res;     }else{         res=cl;         return res;    } }  char* compress(char* txt, ptree pt){    int i;    char* res="";    for(i=0;i<(int)strlen(txt);i++){        res=strcat(res,codage(txt[i],pt->root));    }    return res; }


'Interiors of these houses' or 'interior of these houses'?

If 'interior' is not wrong (or even preferred), then how about 'wife of these men' (instead of 'wives of these men')?


In principals of mathematical analysis on page 32, Rudin defines (definition 2.18e-f): a point $p$ is an interior point of $E$ of there is a neighborhood $N$ of $p$ such that $N\subset E$, $E$ is open if every point of $E$ is an interior point of $E$  By this definition, shouldn't $\mathbb{Z}$ be open? Because $\forall n \in \mathbb{Z} \exists m \in \mathbb{Z}s.t. |n-m|>0$ and so $m$ is in a neighborhood of $n$ and in $\mathbb{Z}$


I tried to install Ubuntu 13.04 beside Windows 7. At the point where it gave me the option to increase or decrease partition space, I couldn't figure out which side was the Windows partition and which was the Ubuntu partition. Can you help? Left or right is Windows?    I have 350 GB of disk space and only want to allocate 40 GB to Ubuntu.  However, I don't want to make a mistake and allocate the 40Gb to Windows instead.


I wan't to create a segmentation map for machine learning. For that I have a list of colors like:  clouds  #aaaaaa cow     #4f445b grass   #1dc331   It is from absolute importance that the render has the exact same colors.  I tried:   And:   But in the render the colors are off. How can I get a render with the exact colors I give?


How can I pass filenames with spaces as arguments?

I have a Python script which accepts string arguments.  $ python script.py "one image.jpg" "another image.jpg"   This works as expected.  Python argparse: ["one image.jpg", "another image.jpg"]    If I need to pass filenames I would do,  $ python script.py $(ls "/some/dir/*.jpg")   Python argparse: ["one", "image.jpg", "another", "image.jpg"]  If use the -Q of ls command, I can wrap results between double quotes. However, quotes stay escaped in Python script, ie.  $ python script.py $(ls -Q "/some/dir/*.jpg")   Python argparse: ['"one image.jpg"', '"another image.jpg"']    How should I expand ls filenames into proper strings to use as arguments? (as in my very first example)


Why does this character ⚫ crash Whatsapp?

I received a WhatsApp forward that reads:  If you touch the👇black point then your whatsapp will hang <⚫> 👈🏻          ereh-hcuot-t  Surprisingly on touching the black dot, it crashes WhatsApp (The whole screen hangs and we have to wait till WhatsApp closes). Is there any reason for this crashing behaviour? (Attaching screen shots for reference)   This crashed on my Android (8.1) Phone. My friend who uses an iPhone claims that it doesn't crash on his phone. (I hope this is the right place to post the question)


I have a long equation in LaTeX, which I need to break up into more lines. I've done this, although its not quite what I was looking for. Here is a MWE showing my problem:  \documentclass[10pt]{article}  \usepackage[T1]{fontenc} \usepackage{amsmath, amsthm, amssymb} \usepackage[ansinew]{inputenc}  \begin{document} \begin{equation}   \begin{aligned}         \alpha &= 1 &&+ 2     \\                &    &&- 3 + 4 \\                &= 4 \\                &=5-1,   \end{aligned} \end{equation} \end{document}   So there is a long equation broken into 2 lines, followed by 2 short lines. Here is what I desire:   There should be an equation label for each equality sign, so 3 in total. At the moment there is only one The "+2" and "-3+4"-parts are aligned right, which distorts the whole equation. I'm not quite sure why it is doing that, I haven't told it explicitly to do so.   Is there a way to correct these errors?    EDIT: Original output looks like


Thought experiment relating acceleration to rate of change of momentum in Newton's Second Law

I just thought of something I have no good  way of ruling out in my mind. Say someone is in free-fall, and is meant to, unfortunately, splat on the ground. Due to it accelerating, its speed will be increasing constantly with time. However, by considering two different definitions of Newton's Second Law, $\vec F = m \vec a$, and $\vec F = \dot p$, I seem to find a contradiction with my knowledge. According to the first definition, the force on the person in free-fall is constant (which I would agree with). However, when the person hits the ground, the force that which it imparts on the ground will have to do with its final velocity, I would think. One would say if the person is falling with a force of $50 \ N$ it will apply $50 \ N$ to the ground on impact, but this seems to be the case without considering how long the person was experiencing $50 \ N$ before hitting the ground I've found, or, at least when I've done exercises about these sorts of things. The final speed of the object, its mass, and the time in which the mass comes to a stop should determine the force felt by the ground, not just the force on the person falling. Is my confusion getting through? I feel like when I've considered the force a falling object applies on impact, it's merely the force experienced on the falling object applied to the ground, but I feel like this is misleading - whether the object falls for $1$ second or $10$, the force on it is the same, but its momentum would not. Perhaps this is just an oversimplification of my high school. Am I correct in thinking that the things I've listed are actually the important factors and not just the theoretical force experienced by the free-falling object?


What command do I use to do map algebra on rasters from the QGIS python console?


I installed apache2 using this command sudo apt-get install lamp-server^ but now when I start it by typing localhost in browser I only see message Index of / and there is no any files or folders.  Tried to create index.html and index.php but I got same results. Is there any fix for this?


Produce parentheses around number of equation

Is there any direct command which can help me to put the number of a equation in the parentheses, for example if I write the following:  \begin{equation} \label{eq:1} this is my equation  \end{equation}  I need this equation: \ref{eq:1}   I need to produce the following      I need this equation: (1)   I need that (1) .


Last Sunday or Monday  I posted a question that boiled down to:; How to install 18.04?  say, starting by 15 April.  My desktop is having trouble with 17.04 and 17.10.  Screwy!  Okay, I'll try again.  I messed up 7.04 And 7.10 on my largest desktop. (I'm writing this on my laptop.)  What I want to do is install 18.04 Om my desktop and go from  there.  I've been using Ubuntu since 5.04 LTS And have stuck with it.  A disability limits me to the use of only my left hand. A friend who lives 2000 miles away configured a RAID when he was here last Fall.  He is a new father and cant fly back until 2019. He said that Installing Ubuntu 18.04 Would be "very difficult".  Considering my hassles With 17.04 And 17.10, I thought installing 18.04 LTS and staying there Would be my best bet.  This is one of the few times I've had this much troubles with Ubuntu;  previously I have  waited at least until the middle of April.  To Anybody: Do I have to create a DVD  with 18.04?  What is a "Start Up Disk"?  Thanks to Richard G for his suggestions.  Gary Kline  PS:  The above was my post within the past week++; it is for anybody in the Ubuntu community.  What's the best way of upgrading to 18.04?  I have only        2 DVDs left!


I was reading this today:  We look forward to following your progress.  Am I correct in thinking that it is missing a be or that -ing should be removed?  So  We look forward to be following your progress.  or  We look forward to follow your progress.  Interestingly I get the same jarring feeling when reading the examples here


Find two random variables X and Y such that E(XY) does not equal E(X)E(Y)?

This is from a review for my exam tomorrow. From what I understand E(XY) = E(X)E(Y) if X and Y are continuous and independent. How do I find such two variables that are not independent? Im stuck here, please help! Thanks


I can't get rid of the Super Secret Settings, even after restarting

I've already read some of the similar topics here but none of the suggestions work. No F4, no fn+F4, no restarting the game. Actually, even after months, Minecraft still looks like Super Secret Settings is enabled no matter which world I play in.    I have no idea if it is relevant but I'm using Ubuntu. The problem occurred with several versions of the game already (since its been months).


If I ask someone this question:  What have you been doing in the last two hours?  is it the same if I asked: What were you doing two hours ago?  If it is different, what is the difference can you explain?  Thanks


How can I find $f(0)$, $f'(0)$, and $f'(x)$ given that  $f(x+y)=f(x)+f(y)+x^2y+xy^2$  and  $\lim_{x\to0}\frac{f(x)}{x}=1$.


Use Mathematical Induction to prove that $\frac{1}{1 \cdot 2} + \frac{1}{2 \cdot 3} +...+\frac{1}{n(n+1)}=1-\frac{1}{n+1}$

Use Mathematical induction to prove that for all integers, $n$ is greater than or equal to $1$. I am confused on what to do after I do the the basis step that is using $n$ as $1$.   $$\frac{1}{1 \cdot 2} + \frac{1}{2 \cdot 3} +...+\frac{1}{n(n+1)}=1-\frac{1}{n+1}$$


When I try to connect to chat, either Meta or SE chat, I get an "ERR_CONNECTION_REFUSED" error. Using Chrome latest.      Aaaand it's back. Thank you, oh SE dev :)


Where should I ask my not so specific question?

I want to know which forum, in the Stack Exchange multiverse, is the most appropriate to ask questions like...      I am new to working with csv files in perl, Can someone please point me to any good references on the subject?   I know questions like these are less specific and I will get yelled at on most of the forums I use within Stack Exchange.


I have just installed Windows 7 (for the 10th time), installed all my required software,  made all the little tweaks that I want in Windows.  I want to be able to save this condition of my computer so that in the future when things go kaput, and I reformat, I can get back to this state without having to install and tweak everything again..  Possible?


Please explain in simple terms what the bitwise negation (~) operator does in bash

I am studying bitwise operations in bash and understand all the other operations, but this one. It will be a great help if someone can explain (with examples) what the negation (~) operator does in bitwise operations. Couldn't understand from what I read here and elsewhere. TIA!


How to create Windows / Linux bootable USB on Ubuntu [GUI style]

Since some laptops doesn't have an optical device and it is faster and easier to create bootable USB than DVD (especially if something go wrong) I have decided to post this question. Answers should be GUI based so anyone can understand them.  How to create Windows / Linux bootable USB?


This is probably really simple, but currently I've been writing installer packages for OSX.   As of now, I was just writing things using specified paths that were always set (I.E /Users//Shared) But I'd like for these to run anywhere as long as the files are in the same directory.   Here is what I've been trying:  pushd `dirname $0` > /dev/null SCRIPTPATH=`pwd` popd > /dev/null  BASEDIR="$( dirname "$0" )"  dmgpath=$(cd "${0%/*}" && echo $PWD   All three of the above are different variations I've tried. I've found most of these here but none seem to work, not sure what I'm doing wrong. Here is a sample of actual code I'm working with:   dmgpath=$(cd "${0%/*}" && echo $PWD)  cp $dmgpath/<install>.plist /Library/Preferences installer -pkg $dmgpath/<Install.pkg> -target / shutdown -r now   I've tried a few things, but keep getting the same error return "path resolved to null value" or "directory not found", "command not found". I've tried placing "" around areas where I'm using the variable, but no go. Most of the scripts are like that.   First time posting here, but I've always found most threads to be super helpful! Thanks in advance!


Users with display name format "user\d+"

I frequently see users across all communities with a display name of "user" followed by a bunch of numbers, or in terms of a regex, user\d+. This doesn't seem like an elaborate username choice, so what's going on?


Report/process only using the last entry made by the user in Google Forms

I have a form where students can enter choices: for instance the specialisation they want to pursue, and the semester when they will start that specialisation.   , but it has not much interest, other than add addition data to the . You can copy the sheet locally to edit it, and it will still pull the form data over.   I decided not to use the option on the form to allow only one entry per student as students often change their mind, make a new entry several months later. They were told that only their last entry will be considered at a specific deadline.  I wish to have some reporting in place that shows an overview of all choices, lists the students per specialisation etc... but only taking into account their last entry, and without deleting previous entries made.   To look up the last entry for a specific user, it is easy using:  query(importrange("1L3V0HIN69aVvCV-4Hx7m39w6zsuBZEaK2L0JDULP0NY","Form Responses 1!A:E"),"select Max(Col1), Col2, Col3, Col4 where Col2 contains '"&C1&"' group by Col2,Col3,Col4 order by Max(Col1) desc limit 1",0)   The e-mail (or part of it would be stored in C1). The trick is the limit 1 clause at the end combined with the order by clause.  But this no longer works when trying to filter for the whole cohort following a specialisation at a specific start date, or counting the amount of students per specialisation, etc.   This is where I could use some help. Maybe adding a column "outdated" and filling that in via an array formula could be an option, but I struggled with making that work on the original response spreadsheet.


I am trying to delete several rows from a MySQL 5.0.45 database:  delete from bundle_inclusions;   The client works for a while and then returns the error:  Lock wait timeout exceeded; try restarting transaction   It's possible there is some uncommitted transaction out there that has a lock on this table, but I need this process to trump any such locks.  How do I break the lock in MySQL?


Limit of integration can't be the same as variable of integration?

I am told that an expression like $$ \int_a^x f(x)dx $$ is not well formed, i.e. it should be $$ \int_a^xf(t)dt $$ or similar.  Why is it that the limits of integration can't depend on the variable of integration?


Reduce font size only for all display equations

Is this possible to reduce the fontsize for display equations smaller than the normal text font size. I'm using the following tags:  \documentclass[10pt]{book} \usepackage{amsmath} \begin{document}  This is for test \beign{align} a+b=c \end{align}  \begin{gather} a+b=c \end{gather}  All amsmath environments follows... \end{document}   Giving each equations \small is a tedious way...


Ability for user to flag or select multiple nodes from view listing

I am creating a page where I have a view listing about 100 nodes of a specific content type and then underneath that I have a contact form. When visitors (logged out users) come to my site I would like them to be able to select some nodes from this view that they like. Either with a checkbox next to each one of them or by some other flagging system. When they then complete my form the specific nodes they have chosen will be sent with the form submission.   Possible Solutions:   Create a template file for the view and add in a checkbox in front of each node. Use the flags module and pass the selected nodes when submitting.    I've never done something like this before so any help would be appreciated!


Are diagrams describing the warping of space misleading?

I am beginning to study general relativity and one of the preconceptions that I have is that massive objects will warp space in a similar way to that described by the photo below  However my understanding is that massive objects in fact warp spacetime and that in a time and spatial coordinate system straight lines might not be straight due to the presence of massive objects.  Does this imply the warping of space as above? And if not, how can you explain the bending of light around massive objects?


I get 'package is of bad quality' error while installing CrossPlatformUI for MBlaze

My system is 64-bit Ubuntu 13.04. I'm trying to connect through USB 3.0 port. Output of lsusb  Bus 003 Device 005: ID 12d1:1446 Huawei Technologies Co., Ltd. E1552/E1800/E173 (HSPA modem)   I want to access MTS Mblaze for internet. I was not able to create connection so I googled and found out that 'crossplatformui-v2.1.2-sstl-all-ubuntu.deb' would solve the problem.  I downloaded this package and tried to install but I'm getting Package is of bad quality error.


Is there a way I can copy/paste or download old DM's from my iPhone 6? I can not see DM's as far back as I need on my computer.


How to show $f$ is continuous at $x$ IFF for any sequence ${x_n}$ in $X$ converging to $x$ the sequence $f(x_n)$ converges in $Y$ to $f(x)$

Let $f : (X, d_X) \to (Y, d_Y )$ be a map between two metric spaces. Recall that $f$ is called continuous at $x ∈ X$ if for any open ball $ B_f(x)(ϵ)$ of radius $ϵ$ around $f(x)$ there exists a ball $B_x(δ)$ of radius $δ$ around $x$ such that $f(B_x(δ))⊂B_f(x)(ϵ)$. Show that $f$ is continuous at $x$ if and only if for any sequence ${x_n}$ in $X$ converging to $x$ the sequence $f(x_n)$ converges in $Y$ to $f(x)$. Hint: imitate the proof of the corresponding statement for functions $R → R$.


I need a mathematical description of what happens to the spectrum of a signal when that signal is processed to divide its frequency.  As an example, construct an input signal as the sum of two sine waves of different frequencies (as commonly used in a "two tone" test). Processing this signal with a buffer that changes state at the rising zero crossings of the input signal produces a squared wave whose frequency can be divided by a flip-flop:   The spectrum of the the input signal comprises tones at 102kHz and 105kHz:  "Squaring" the input preserves the two equal tones, albeit with added side tones (spaced at the difference between the two original tones) that result from removal of the amplitude envelope and added harmonics from the squaring:   Passing the squared signal through a flip-flop produces a second square wave which in which the two-tone nature is no longer present:   The single dominant tone is at 1/2 the frequency of the higher of the original two tones, while the spacing between the peaks continues to be the spacing between the two original tones.  Passing the squared result through an LC low-pass filter produces a sine wave with cycles that are half as frequent as the input:   with the same general spectral distribution as the squared output:   Can someone, please, explain what happened to the other tone?


Find which web sites have a link to a specific web site?

Is there any way to find which web sites have a link to a specific web site, using Google search?


How to make right redirect from www ssl to non-www ssl using NGINX?

I'm using NGINX and I have ssl cert for example.com And I don't have ssl cert for www.example.com.  In brief: I tried to configure NGINX to redirect from all the www requests to non-www (from **http**://www.example.com and **https**://www.example.com to https://example.com). Nevertheless I used a tone of different answers to more or less similiar questions, I get either no result or the server stops answering :(  That was the problem in general, now I'll dive into details:  Now my NGINX config looks like:  upstream puma_example_production {    server unix:/var/www/example/shared/tmp/sockets/puma.sock fail_timeout=0; }  #server { #    listen 80; #    listen 443 ssl; #    server_name www.example.com; #    return 301 https://example.com$request_uri; #}   server {   listen 80;   listen 443 ssl;   ssl on;   ssl_certificate /var/certs/ssl.crt;   ssl_certificate_key /var/certs/sslkey.key;    server_name example.com;   root /var/www/example/current/public;   try_files $uri/index.html $uri @puma_example_production;    client_max_body_size 4G;   keepalive_timeout 10;    error_page 500 502 504 /500.html;   error_page 503 @503;    # return   301 https://example.com$request_uri;    location @puma_example_production {     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;     proxy_set_header Host $host;     proxy_redirect off;     proxy_set_header Upgrade $http_upgrade;     proxy_set_header Connection "Upgrade";     proxy_set_header X-Forwarded-Proto https;     proxy_pass http://puma_example_production;     # limit_req zone=one;     access_log /var/www/example/shared/log/nginx.access.log;     error_log /var/www/example/shared/log/nginx.error.log;   }    location ^~ /assets/ {     gzip_static on;     expires max;     add_header Cache-Control public;   }    location = /50x.html {     root html;   }    location = /404.html {     root html;   }    location @503 {     error_page 405 = /system/maintenance.html;     if (-f $document_root/system/maintenance.html) {       rewrite ^(.*)$ /system/maintenance.html break;     }     rewrite ^(.*)$ /503.html break;   }    if ($request_method !~ ^(GET|HEAD|PUT|PATCH|POST|DELETE|OPTIONS)$ ){     return 405;   }    if (-f $document_root/system/maintenance.html) {     return 503;   } }   I commented the lines with approaches which cause errors. Now  I have proper server work for non-www requests, but with www requests I get browser warning that I have no ssl cert (NET::ERR_CERT_COMMON_NAME_INVALID) (and that's true).  I hope that there's the right way to redirect from www to non-www. Could youhelp me out, please?


Limits with cubic root without L’Hopital’s Rule: $\lim_{x\to 1}\frac{\sqrt[3]{x}-1}{x-1} $

I need to solve   $$\lim_{x\to 1}\frac{\sqrt[3]{x}-1}{x-1} $$  But without using L’Hopital’s Rule, could someone help me?


Find all $m, n \in \mathbb{N}$, such that $1! + 2! + 3! + ... + n! = m^2$

Find all $m, n \in \mathbb{N}$, such that  $$1! + 2! + 3! + ... + n! = m^2$$  I'm sure answer is two couples $(1,1)$ and $(3, 3)$, but I don't know how to prove that this equation is wrong for $n > 3$.


I have the following problem, for which I am having trouble finding a solution:  A manager is interviewing 3 applicants for a job. The duration of each interview follows an exponential distribution  with parameter 1/2, time being measured in hours. The interviews are scheduled to begin at 10:00, 10:15, and 10:30. Assume that the job candidates arrive exactly on time.  For each of the three candidates, what is the probability that he/she will have to wait before his/her interview begins?  I think that the first applicant won't have to wait, the probability that the second has to wait is P(First Interview > 15min) and I am having trouble with the third.   My best guess is that he will have to wait if the sum of the remaining time for the first interviewee and the time for the second interviewee is greater than 15 minutes. Suppose that $X$ is first interviewee's remaining time, $Y$ is the second interviewee's time and $Z = X + Y$.  $$P(Z \ge 15) = 1 - P(Z \le 15)$$  and   $$P(Z \le 15) = \int_{0}^{15}\int_0^zf_x(x)f_y(z-x)dxdy$$   I'm not sure about that last integral. My idea is to using convolution integration to integrate everything that adds up to a certain sum and integrate that sum between 0 and 15. I'm having trouble with integration limits though. I used o and z in the inside integral because $z-x \ge 0$ (support of the exponential distribution) and so $z \ge x$.


Re-entering Europe with a French "long séjour" visa

I am a national from Mexico, currently an exchange student following a program in France and have a "long séjour" residence permit (multiple entry visa). During the summer holidays, I plan to travel outside Europe, and then I will return to Europe to continue my studies but I want to enter from Spain (my French visa will be still valid). Will this cause any trouble? Or do I need to re-enter Europe on the country that issued my visa (i.e. France)?  Also, is any visa issued from any Schengen country considered as a "Schengen visa"?


How can I write the following thing?  a^(b_c), b being a superscript of a, and c being a subscript of b.


TikZ Angle Label - Help it "fit" better?

I have the following drawn with TikZ    using the code  \documentclass{article} \usepackage{tikz} \usepackage{tkz-euclide} \usetkzobj{all} \begin{document} \begin{tikzpicture} \coordinate (O) at (0,0); \draw (O) circle (3); \coordinate[label = above left:$M$] (M) at (130:3); \coordinate[label = above:$N$] (N) at (80:3); \coordinate[label = below:$A$] (A) at (240:3); \coordinate[label =below right:$B$] (B) at (300:3); \draw (A) -- (M) -- (B); \draw (A) -- (N) -- (B); \tkzMarkAngle[draw = black, fill = white, opacity=1](A,M,B) \tkzLabelAngle[pos = 0.8](A,M,B){$x$} \tkzMarkAngle[pos = 0.2,draw = black, fill = white, opacity=1](A,N,B) \tkzLabelAngle [pos=0.8](A,N,B){$27 ^{\circ}$} \end{tikzpicture} \end{document}   Notice however, tht the 27 degrees does not fit in very nicely. How can I adapt the code to try and move the 27 a bit "lower" so that it fits in better, as well as the angle mark?  Also, how can I get two "double arrows" in the middle of lines AM and BN, to indicate that they are 'parallel'?


Assign value to variable - Simplify existing code

The code is as follows. this.requiredVehicle = order.vehicle       ? order.vehicle       : order.required_vehicle_type && order.required_vehicle_type;  If vehicle is present in the order, that value should be assigned else if required_vehicle_type is present, it should be assigned. How to simplify the above code ?


I'm trying to prove it, but I can't find how.  If a divides b, and c divides d, then a*c divides b*d


Understanding the question from Shiryaev: $B_m$ be the event in which each of the events $A_1,\dots,A_n$ occurs exactly $m$ times

§2, exercise 5, p.17:     Let $A_1,\dots,A_n$ be events, and define $S_0,S_1,\dots,S_n$ as   follows: $S_0=1$   $$\begin{alignedat}{1}\begin{split}S_{r}=\sum_{J_{r}}P\left(A_{k_{1}}\cap\cdots\cap > A_{k_{r}}\right),\end{split}  & 1\leq r\leq n\end{alignedat}$$ where   the sum is over the unordered subsets   $J_{r}=\left[k_{1},\dots,k_{r}\right]$ of $\left\{ 1,\dots,n\right\}$   .      Let $B_m$ be the event in which each of the events $A_1,\dots,A_n$   occurs exactly $m$ times. Show that   $$P\left(B_{m}\right)=\sum_{r=m}^{n}\left(-1\right)^{r-m}C_{r}^{m}S_{r}$$   I don't understand what $B_m$ is!? (my understandings lead to wrong result, tested with particular values of $m$, and $n$)  The original Russian texts:     Пусть $B_{m}$ - событие, состоящее в том, что одновременно произойдет в точности $m$ событий из $A_{1},\dots,A_{n}$.   What is the Russian texts actual meaning? (I want to know if there was problem with translation or it's my fault)  I found an answer from a , which said that:     (google translator): This is indeed a bit incomprehensible, because here m * n events are combined into one   but, I don't know how to interpret the question like that.    P/S: I found an answer, my question could be marked as duplicated:   Indeed, I found that the combined result of the online translators (Google, Yandex, Bing, PROMT) is closed to the exercise posted in the link above:     machine translation: Let $B_{m}$ be the event, which consists simultaneous occurrence of exactly $m$ events of $A_{1},\dots,A_{n}$


MATE desktop has recently migrated, as of version 1.6, from using mateconf-editor to gsettings. This breaks traditional solutions for changing MATE's window manager to Compiz.


How should one set DCs in Roll For Shoes? Do I use active or passive opposition?

I have yet to play RfS yet, mostly because I'm concerned about difficulties.. how do I know if that door's lockpicking DC of 5 is too much or too little? Should I use a passive or active opposition?  I'm very confused as to how I should set DCs in a microsystem like this  Edit: I don't think this is a duplicate because I'm talking about passive opposition as well, not just "how many dice do I roll", but rather "Is a pre-established X DC too much" too


We have to design our own HashSet class. (not using the JAVA api).  I implemented it, but I have a problem with printing it.  I think there is a problem with the iteration constructor. any advice?  Hash set:  package CountWords;  import java.util.Iterator;  public class HashWordSet implements WordSet  {      private int size = 0;                         private Node[] buckets = new Node[8];          public class Node {      Word value;     Node next = null;      public Node (Word w) { value = w; }     }      private class HashWordIterator implements Iterator<Word> {          private int pos, index = 0;         private Word[] words = new Word[size];         private Node node;          public HashWordIterator()         {             for(int i=0; i<words.length;i++){             words[index++]=node.value;             node = node.next;             }         }          public boolean hasNext() {             if (size > pos)//root != null && root.next != null)                 return true;              return false;         }          public Word next() {             return words[pos++];         }          @Override         public void remove() {             // TODO Auto-generated method stub         }     }      @Override     public int size() {         return size;     }      @Override     public void add(Word word) {         int pos = (word.hashCode() % buckets.length);                 Node node = buckets[pos];          while (node != null) {             if (node.value.equals(word))                 return;             else             node = node.next;         }          node = new Node(word);         node.next = buckets[pos];         size++;             if (size == buckets.length)             rehash();         }         }      private void rehash() {         Node[] tmp = buckets;         buckets = new Node[2*tmp.length];                             size = 0;                  for (Node n : tmp) {             if (n == null) continue;             while (n != null) {                 add(n.value);                 n = n.next;             }         }     }      @Override     public boolean contains(Word word) {         int pos = (word.hashCode() % buckets.length); //         Node n = buckets[pos];          while (n != null) {             if (n.value.equals(word))                 return true;             else                 n = n.next; // stega fram i listan         }         return false;     }      public String toString () {         StringBuffer sb = new StringBuffer();          for (int i = 0; i < buckets.length; i++) {             sb.append(buckets[i].value.toString());         }          return sb.toString();     }      @Override     public Iterator<Word> iterator() {         return new HashWordIterator() ;     }  }   Main:  package CountWords;  import java.io.File; import java.io.FileNotFoundException; import java.util.Arrays; import java.util.Iterator; import java.util.Scanner;   public class WordCount2Main {      public static void main(String[] args) {         File file = new File("/Users/sa/Documents/workspace/1DV007/src/CountWords/Words.txt");          HashWordSet  Hset = new HashWordSet ();         //TreeSet<Object> Tset = new TreeSet<Object>();         TreeWordSet Tset = new TreeWordSet();         Scanner Scan;         int i=0;         try {             Scan = new Scanner(file);              while (Scan.hasNext()) {                 String text = Scan.next();                 Word Y=new Word(text);                 Hset.add(Y);                 i++;             }              System.out.println("TreeSet: " + "\n");         } catch (FileNotFoundException e) {             e.printStackTrace();         }          System.out.println();         Iterator<Word> iter2 = Hset.iterator();          while(iter2.hasNext()) {             Object o2 = iter2.next();             System.out.print(o2 + " ");         }           System.out.println(Hset.size() + " Hash set:: "+Hset );     } }


Prove that $x_n$ converge if subsequences $(x_{2n})$, $(x_{2n+1})$ and $(x_{3n})$ converge

Let $x_n$ be a sequence of real numbers such that the subsequences subsequences $(x_{2n})$, $(x_{2n+1})$ and $(x_{3n})$ converge. Prove that $x_n$ converge. I want to prove that all the subsequences that converge, converge to the same point. In other words, I want to prove that their limit is the same. (If not, $x_n$ doesn't converge) Though, I don't know how to go about to proving $\lim(x_{2n})=\lim(x_{2n+1})$.


Given two equivalent norms, convergence in one implies convergences in other.

Suppose we have two equivalent norms, $\|\cdot \| \sim \left\vert\!\left\vert\!\left\vert \cdot\right\vert\!\right\vert\!\right\vert$. We assume that $x_n \rightarrow x $ in $(X,\|\cdot \|)$. Show that $x_n \rightarrow x $ in $(X,\left\vert\!\left\vert\!\left\vert \cdot\right\vert\!\right\vert\!\right\vert)$  We observe since the norms are equivalent, there exits constants $\alpha, \beta$, such that $\alpha \|\cdot \| \leq \left\vert\!\left\vert\!\left\vert \cdot\right\vert\!\right\vert\!\right\vert \leq \beta \|\cdot \|$, with $0 \lt \alpha \leq \beta$  Since, $x_n \rightarrow x$ in $(X,\|\cdot \|$) we know that for all $\epsilon>0, \exists K(\epsilon)$ such that for n>$K(\epsilon),$ we have $\|x_n -x\| \leq \epsilon$  Since, we know $\beta \gt 0$ , then $ \beta \|x_n -x\| \leq \beta \epsilon$, Thus we see that $\left\vert\!\left\vert\!\left\vert x_n-x\right\vert\!\right\vert\!\right\vert\leq \beta \epsilon$.  This is how far I've gotten, our goal to is to find a a $J(\epsilon)$ such that for all $\epsilon>0, \exists J(\epsilon)$ such that for n>$J(\epsilon),$ we have $\left\vert\!\left\vert\!\left\vert x_n-x \right\vert\!\right\vert\!\right\vert \leq \epsilon$  My candidate for $J(\epsilon$) is $J(\epsilon) = \frac{K(\epsilon)}{\beta}$ from my above argument, but I'm not exactly sure how to validate this. If someone could help me on the proof, it would be very appreciated. I believe I'm pretty close, just missing something small.


"Null Object Reference" Error While Passing a Serializable Object To Fragment

I've been researching this and attempting for hours. I've taken after this post for an example of how to pass arguments to a fragment:    I'm trying to pass a custom object from an activity, to a fragment. I chose to implement serializable and pass the object using:  bundle.putSerializable("key", Serializable).   I'm getting the error     java.lang.NullPointerException: Attempt to invoke virtual method java.io.Serializable android.os.Bundle.getSerializable(java.lang.String) on a null object reference   when I'm trying to set my object equal to the arguments passed in from the activity.  here is my object  public class Player implements Serializable {     int attack;    private int tempAttack;    int defense;    private int tempDefense;    int pop;    int level;    String t1Evo;    String t2Evo;    String t3Evo;     public Player() {       attack = 0;       tempAttack = 0;       defense = 0;       tempDefense = 0;       pop = 20;       level = 1;       t1Evo = null;       t2Evo = null;       t3Evo = null;    } }   Then here is my activity from which I am passing, I eventually want to pass all four of my objects, but I right now I'm trying to get at least one to successfully pass.  public class GameScreen extends FragmentActivity {  // Anytime you need to grab data from the players, // this screen will hold them.     private Player player1;    private Player player2;    private Player player3;    private Player player4;      @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.activity_game_screen);         // Instantiate the player objects        player1 = new Player();        player2 = new Player();        player3 = new Player();        player4 = new Player();         // put the objects to send to our fragment in a bundle        PlayerInformation newFragment = new PlayerInformation();        Bundle args = new Bundle();        args.putSerializable("Player1", player1);        newFragment.setArguments(args);         // start transaction        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();         // Replace whatever is in the fragment_player_information view with this fragment,        transaction.add(R.id.playerInformation, newFragment);        transaction.commit();    } }   And then the fragment which throws the Null Pointer Exception, I've indicated the line with "-->"     package com.cs246.spencer.naturalselection;  import android.app.Activity;  import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView;  import java.io.Serializable;   /**  * Fragment that displays the Player information on GameScreen  */ public class PlayerInformation extends Fragment {    Context context;    Player player1;    Player player2;    Player player3;    Player player4;     public PlayerInformation(){        this.context=context;    }    @Override    public View onCreateView(LayoutInflater inflater, ViewGroup container,                          Bundle savedInstanceState) {        // grab the objects passed from GameScreen        Bundle args = getArguments();    --> player1 = (Player) args.getSerializable("Player1");        player1 = (Player) getArguments().getSerializable("Player1");         // Inflate the layout for this fragment        return inflater.inflate(R.layout.fragment_player_information, container, false);    }     public void Update() {        TextView player1Pop = (TextView) ((Activity)context).findViewById(R.id.player1Pop);        player1Pop.setText(player1.pop);    } }


Audio stops working when I unplug my headphones on Ubuntu 20.04

EDIT: This is not a duplicate of the issue linked. When I boot my computer with my headphones plugged in, they are working. When I unplug them and plug back in they usually do not work. To get it working again, I have installed pavucontrol "PulseAudio Volume Control". I go into "Configuration" and I under my audio controller, I change the Profile to "Analog Stereo Output" from "Off". It's almost as if it doesn't automatically detect the headphone being plugged in. there shouldn't be an issue with the hardware because it works fine on Windows with my dual boot. How do I make it so that automatically it picks up that I have plugged in the headphones and switches the profile for me? Edit: Following this does not fix the issue: , it is also a different scenario. Edit: Looks like this is also a similar issue:


Has the policy changed on link-only answers?

I had a flag on a link-only answer declined several minutes ago:     not an answer – dasblinkenlight 6 mins ago   declined - A link only answer is an answer - just a bad answer and should be down-voted rather than flagged. (emphasis added)   According to , flagging was the right thing to do. Has this policy been changed?


Convert group_concat of MYSQL to SQL query

I have a query in MySQL which is using group_concat. I want to convert it into a SQL Server query.  select      apj.package_id,      group_concat(DISTINCT concat(asset.asset_id, '-', asset.name) SEPARATOR '||')'asset_names' from      stg.asset_package_join apj (NOLOCK), stg.asset asset (NOLOCK)  where      asset.id = apj.asset_id  group by      apj.package_id   Could you please help me?


Apologies if this is a simple question, this is my first time here, and I am a noob at statistics. I have a series of numbers and I want to find cutoff points that clearly separate, or group, the data.  Say I have this data:    You can see it is clearly grouped into two groups, the large values, and the small values.  (Maybe 3 groups, with that first positive value being a group of its own.)  Is there any algorithm to determine these groups automatically/programmatically?


Connection between Gauge Fixing Term and Gauge Condition

In Peskin on page 514, when deriving the Faddeev-Poppov ghosts, they arrive at the full Lagrangian for Yang-Mills: $$ \mathcal{L} = -\frac{1}{4}F^2 + \frac{1}{2\xi} (\partial \cdot A^a)^2+\textrm{Fermion Term + Ghosts Term} $$ I'm wondering, what's the correspondence (i.e., what's the way to derive) between the value of $\xi$ and the gauge condition on $A$? For example, Landau gauge is $\xi\to 0$. What kind of gauge-condition equation does that produce on $A$ and how can we derive it?  Compare with this page on Wikipedia:  which says that Landau gauge is when $A$ is only along the $y$-axis and has component there equal to $B\,x$ where $B$ is a constant and $x$ is the coordinate.


Attach a method to every GameObject or use a manager script

I'm new to Unity but not new to development so I'm wondering what the standard way of doing this in with Unity.  In the scene from the start is an empty GameObject that has a script that contains all of the items in the game. Once the game starts, chest prefabs are going to be spawned in the game and upon interaction they will reveal some random loot from the items script.  Is it better practice to have a script on all of the chests that accesses the items script or should I create another empty GameObject as a sort of a chest manager that accesses the item script and keeps track of all of the chests in the game and what all of their loot is.


Why won't vertical-align: middle work?  And yet, vertical-align: top does work.   span{   vertical-align: middle; }
      Doesn't work.


Can a clone of a double-sided planeswalker transform?

Suppose my opponent has  on the battlefield, and has not yet transformed it into a Planewalker.  I cast , making my own copy of Nicol Bolas.  What happens if I activate my cloned Nicol Bolas' ability? What would happen if the ability were phrased differently, such that it doesn't require the creature to leave the battlefield and re-enter?


How to prove that the expected value minimizes mean square error

we read that if $(\Omega, \mathcal{F}, \mathcal{P})$ is a probability space and $X:\Omega\to\mathbb{R}$ is a random variable with mean and variance, then $$\min\limits_{c\in\mathbb{R}}\mathbb{E}((X - c)^{2}) = \mathbb{E}((X-\mathbb{E}(X))^2).$$ I.e., the expected value $c=\mathbb{E}(X)$ minimizes $\mathbb{E}((X - c)^{2}).$ My question is how to prove it?


Show that $y = \frac{2x}{x^2 +1}$ lies between $-1$ and $1$ inclusive.

Prove, using an algebraic method,that $y=\frac{2x}{x^2 +1}$ lies between $-1$ and $1$ inclusive. Hence, determine the minimum and maximum points $y=\frac{2x}{x^2 +1}$ .   What I tried:  Firstly, I thought of using partial fractions but since $x^2 +1 =(x-i)(x+i)$, I don't think it is possible to show using partial fractions.  Secondly, decided to use differentiation  $y=\frac{2x}{x^2 +1}$  $\frac {dy}{dx} = \frac {-2(x+1)(x-1)}{(x^2 +1)^2 }$  For stationary points:  $\frac {dy}{dx} = 0$  $\frac {-2(x+1)(x-1)}{(x^2 +1)^2 } = 0$  $x=-1$ or $x=1$  When $x=-1,y=-1$  When $x=1,y=1$  Therefore, this implies that $y=\frac{2x}{x^2 +1}$ lies between $-1$ and $1$ inclusive.  ^I wonder if this is the correct method or did I leave out something?  The third way was using discriminant  Assume that $y=\frac{2x}{x^2 +1}$ intersects with $y=-1$ and $y=1$  For $\frac{2x}{x^2 +1} = 1$,  $x^2 -2x+1 = 0$  Discriminant = $ (-2)^2  -4(1)(1) = 0 $  For $\frac{2x}{x^2 +1} = -1$,  $x^2 +2x+1 = 0$  Discriminant = $ (2)^2  -4(1)(1) = 0 $  So, since $y=\frac{2x}{x^2 +1}$ touches $y=-1$ and $y=1$, $y=\frac{2x}{x^2 +1}$ lies between $-1$ and $1$ inclusive.  Is the methods listed correct?Is there any other ways to do it?


I have seen a [picture like this] several times:    featuring a "troll proof" that $\pi=4$. Obviously the construction does not yield a circle, starting from a square, but how to rigorously and demonstratively prove it?  For reference, we start with a circle inscribed in a square with side length 1. A step consists of reflecting each corner of figure $F_i$ so that it lies precisely on the circle and yielding figure $F_{i+1}$. $F_0$ is the square with side length 1. After infinitely many steps we have a figure $F_\infty$. Prove that it isn't a circle.  Possible ways of thinking:   Since the perimeter of figure $F_i$ indeed does not change during a step, it is invariant. Since it does not equal the perimeter of the circle, $\pi\neq4$, it cannot be a circle.   While it seems to work, I do not find this proof demonstrative enough - it does not show why $F_\infty$ which looks very much like a circle to us, is not one.   Consider one corner of the square $F_0$. Let $t$ be a coordinate along the edge of this corner, $0 \leq t \leq 1$ and $t=0, t=1$ being the points of tangency for this corner of $F_0$ and the circle. By construction, all points $t \in A=\{ \frac{n}{2^m} | (n,m\in \mathbb{N}) \& (n<2^m)\}$ of $F_\infty$ lie on the circle. I think it can be shown that the rest of the points, $\bar{A}=[0;1] \backslash A$, lie in an $\varepsilon$-neighbourhood $U$ of the circle. I also think that in the limit $\varepsilon \to 0$, points $ t\in\bar{A}$ also lie on the circle. Am I wrong in thinking this? Can we get a contradiction from this line of thought?   Any other elucidating proofs and thoughts are also welcomed, of course.


Is it possible to replace internal memory of a android phone ?  How difficult it is?  Is internal memory part of System On Chip itself, so that it is next to impossible to remove them ?  Have anybody tried this out ?  My device is "Redmi Note" - but you can consider this as a generic question. If these is any device where replacing internal memory is  possible, I will switch to that device :)  Thanks


How to fix NullPointerException in a ListView?

I'm getting a NullPointerException while making a ListView using a custom adapter and don't know the part of code causing the error. Following is the code snippet:  ChatMessageAdapter.java  package com.myappcompany.rajan.thefictionalchat;  import android.content.Context; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView;  import java.util.ArrayList;  public class ChatMessageAdapter extends ArrayAdapter<ChatText> {      ChatMessageAdapter(Context context, ArrayList<ChatText> list) {         super(context, 0, list);     }      @NonNull     @Override     public View getView(int position, View convertView, ViewGroup parent) {          View currentView = convertView;         if(currentView==null) {             LayoutInflater.from(getContext()).inflate(R.layout.list_items, parent, false);         }         ChatText chatText = getItem(position);          TextView textView;         textView = (TextView)currentView.findViewById(R.id.chat_text);         textView.setText(chatText.getMessage());          if(chatText.getMessageType().equals("PERSON_1")) {             textView.setGravity(Gravity.LEFT);         }         else if(chatText.getMessageType().equals("PERSON_2")) {             textView.setGravity(Gravity.RIGHT);         }         else {             textView.setGravity(Gravity.CENTER_HORIZONTAL);         }          return currentView;     } }    list_items.xml  <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:orientation="vertical"     android:layout_width="match_parent"     android:layout_height="wrap_content"     >      <TextView         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:id="@+id/chat_text"         tools:text="Hello" />  </LinearLayout>   I'm getting the following run-time error from the log as the app crashes:  java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference         at com.myappcompany.rajan.thefictionalchat.ChatMessageAdapter.getView(ChatMessageAdapter.java:32)


Best symbol to use for ... in the case of 1,...,n

What symbol do people find gives best results for ... where this is in the case 1,...,n?


Prevent specific sites from being overrepresented in the hot questions list

Some sites appear far more often in the hot questions list than other sites. I don't have any hard data on that, as that kind of data is just not publicly available, but I'm pretty sure my subjective impression on that is reasonably accurate.  Those sites don't appear more often because they are inherently more interesting, but because they have certain voting and answering patterns that favor them in the hot questions algorithm. I would argue that the goal of the hot questions list is to present questions from a large variety of SE sites to the whole network, and to show possibly interesting questions to users that would not have found them otherwise.   To achieve this goal, the spots in the hot questions list should be distributed among all SE sites. The algorithm should try to get a good sampling of all sites, and it should try to normalize the results for varying voting behaviour. At the moment, sites that intrinsically get more votes and more answers per question seem favored in the algorithm.  So I think one part of the algorithm should try to identify questions that get an unusally high amount of votes and views for that site, and give the smaller sites a chance this way.  I'm not sure on how exactly this weighting should be done, as a complete normalization would likely not work across the huge difference in scale for all the SE sites.  As a specific example that the current algorithm is broken I'll present . I don't think any site should occupy a third of the whole list.   Here's another instance where one site is overrepresented at the top of the list:


I read somewhere that a line is made up of infinite points.  Between any two points on that line, there are another infinite points.  and between any two points BETWEEN those 2 points there are another infinite points.   Is this true? If so , HOW?  Also, i have read in physics that the smallest possible length is the “Planck’s Length” . Nothing can be smaller than it. So is the point even smaller than the Planck’s length?   Is a point spherical in shape? Rectangular? Square? Or it does not has any shape? If so, it must not have any length, that means a point does not exist.  Is this correct?


English is my second language and I largely depend on Grammarly for checking grammatical mistakes.     To create a new app, first, make sure your current working directory   is  same as where manage.py file is located. After that execute the    following command.   I don't see any problem with this sentence, but Grammarly alerts me about "Passive Voice Misuse".   Please tell me is there any problem with this sentence.


How to deal with a finicky player who regularly replaces their character?

In my D&D group, we have 4 great players, but one of them is constantly getting bored of their characters.  The other players are all invested in the story more than anything else and as such it really grates to have a character just drop out mid plot-arc and be replaced by some brand new guy who instantly needs to become best buds with the existing party.  However, on the occasions that I have refused him, or at least told him to wait a while before switching, he plays really half-heartedly, doesn't seem to enjoy himself and puts a damper on the whole table.  What can I do to fix this situation?


Given $\lim\limits_{x\to 0} \frac {x(1+a\cos x)-b\sin x}{x^3}=1$, what is the value of $a+b$?

Given that   $$\lim\limits_{x\to 0} \frac {x(1+a\cos x)-b\sin x}{x^3}=1$$   What is the value of $a+b$   My try   $\lim\limits_{x\to 0} (\frac {x(1+a\cos x)}{x^3}-\frac {b\sin x}{x^3})=1$  $\lim\limits_{x\to 0} (\frac {(1+a×cos(x)}{x^2}-\frac {b}{x^2})=1$  $\lim\limits_{x\to 0} \frac {1+a\cos x-bx}{x^2}=1$  Apply L'Hôpital's rule:  $\lim\limits_{x\to 0} \frac {-a\cos x-b}{2x}=1$  Apply L'Hôpital's rule again:  $\lim\limits_{x\to 0} \frac {-a\sin x}{2}=1$ $\to$  $a=-2$  Is my approach right?


Inserting text into an existing file via Java

I would like to create a simple program (in Java) which edits text files - particularly one which performs inserting arbitrary pieces of text at random positions in a text file. This feature is part of a larger program I am currently writing.  Reading the description about java.util.RandomAccessFile, it appears that any write operations performed in the middle of a file would actually overwrite the exiting content.   This is a side-effect which I would like to avoid (if possible).  Is there a simple way to achieve this?  Thanks in advance.


Let $A,B$ be two homeomorph topological space under homeomorphism $\varphi$  and let $\sim$ be an equivalence relation on $A$. Then     Does $A\simeq_\varphi B$ imply $A/{\sim}\,\, \simeq B/\varphi(\sim)$?   Where $\varphi(\sim)$ is defined as follow $$x,y\in A,\quad x\sim y \iff \varphi(x)\,\varphi(\sim)\,\varphi(y).$$


Is there some introspection method allowing to reliably obtain the underlying data structure of an object instance, that is unaffected by any customizations? In Python 3 an object's low-level implementation can be deeply obscured: Attribute lookup can be customized, and even the __dict__ and __slots__ attributes may not give a full picture, as they are writeable. dir() is explicitly meant to show "interesting" attributes rather than actual attributes, and even the inspect module doesn't seem to provide such functionality. Not a duplicate. This question has been flagged as duplicate of . However, that other question only talks about the standard ways of introspecting classes, which here are explicitly listed as not reliable on a lower level. As an example consider the following script with an intentionally obscured class. import inspect  actual_members = None  # <- For showing the actual contents later.  class ObscuredClass:     def __init__(self):         global actual_members         actual_members = dict()         self.__dict__ = actual_members         self.actual_field = "actual_value"     def __getattribute__(self, name):         if name == "__dict__":             return { "fake_field": "fake value - shown in __dict__" }         else:             return "fake_value - shown in inspect.getmembers()"  obj = ObscuredClass() print(f"{actual_members          = }") print(f"{dir(obj)                = }") print(f"{obj.__dict__            = }") print(f"{inspect.getmembers(obj) = }")  which produces the output actual_members          = {'actual_field': 'actual_value'} dir(obj)                = ['fake_field'] obj.__dict__            = {'fake_field': 'fake value - shown in __dict__'} inspect.getmembers(obj) = [('fake_field', 'fake_value - shown in inspect.getmembers()')]


Back button takes the view to initial page from tags search

Here is what I do:   Search for a tag Open a discussion from list of discussions returned by search result Tap back button   This should take the view to search result but instead it returns back to tags search.  I believe this behaviour to be a bug and it is unpleasant to search for your tag every time.   App Version: 1.0.85 Device Manufacturer: asus Device Model: ASUS_Z00AD OS Version: 5.0 (WW_Z00A-WW_2.20.40.139_20151104_2652_user_rel-user-20151104)


Include Chapter number in reference if target is in different chapter

I'm using a setup where the chapter numbers are in Roman and the normal referencing commands do not include a chapter reference:  \renewcommand{\thechapter}{\Roman{chapter}} \renewcommand{\thesection}{\arabic{section}} \renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}} \renewcommand{\thesubsubsection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}    As long as I'm referencing content in the same chapter everything is fine, however, sometimes (not very often) I reference content from a different chapter. In these rare cases I manually add in \Cref{chap:Chapter-Ref} to the reference. Obviously this is both cumbersome and prone to error!  As you can already see, I'm using cleveref, however, it appears it is not clever enough to automagically detect that it should insert a chapter reference when I'm referencing cross-chapter. I would assume that it has all the required information buried somewhere deep in its internals. After reading its documentation I am no wiser nonetheless: If there is some solution apparent in there, I missed it.     How can I [read: you ;-) ] change the reference command such that it inserts a chapter reference whenever the target of a reference command is in a different chapter?   I have tried to obtain a first solution using the mechanisms provided by the zref package, however, I failed miserably.  Below you'll find a tiny MWE for convenience :-)  \documentclass{scrbook}  \usepackage{hyperref} \usepackage{cleveref}  \renewcommand{\thechapter}{\Roman{chapter}} \renewcommand{\thesection}{\arabic{section}} \renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}} \renewcommand{\thesubsubsection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}  \begin{document} \chapter{First Chap} \label{chap:foo} \Cref{chap:foo} should print \textit{Chapter I}. \Cref{chap:foo} should print \textit{Chapter II}. \Cref{sec:foo} should print \textit{Section 1}. \section{A Section} \label{sec:foo}  \chapter{Scnd Chap} \label{chap:bar}  \Cref{chap:foo} should print \textit{Chapter I}. \Cref{chap:foo} should print \textit{Chapter II}. \Cref{sec:foo} should print \textit{Section 1 in Chapter I}.  \end{document}


How does the "1 month ago" option in date command work?

I'm not sure if this gets the past date within the current day or if it only takes 30 or 31 days to it.  e.g.  If the current date is March 28th, 1 month ago must be February 28th, but what happen when it's March 30th?  Scenario  I want to backup some files each day, the script will save this files within the current date with $(date +%Y%m%d) format, like 20150603_bckp.tar.gz, then when the next month arrives, remove all those files within 1 month ago except the 1st's and the 15th's files, so this is my condition:  past_month = $(date -d "-1 month" +%Y%m%d) day = $(date +%d) if [ "$day" != 01 ] && [ "$day" != 15 ] then     rm /path/of/files/${past_month}_bckp.tar.gz     echo "Depuration done" else     echo "Keep file" fi   But I want to know, what will happen when the date is 30th, 31th or even the past February example? It will keep those files? or remove day 1st files?  When it's 31th the depuration will execute, so if the past month only had 30 days, this will remove the day 1st file?   I hope I hinted.


My laptop wifi is broken, so I bought a usb wifi card TL-WN823N(rtl8192cu module). (I know linux but I'm really new to linux drivers things.)  Since I'm using "14.04.2 LTS, Trusty Tahr", I need to install the driver myself. I downloaded the driver from , compiled and installed it. During that I met some compilation error and solved according to . And reboot.  Now the wlan1 seems DISABLED .  cipher@Joy:~$ sudo lshw -c network   ...   *-network DISABLED       description: Wireless interface       product: Wireless 7260       vendor: Intel Corporation       physical id: 0       bus info: pci@0000:03:00.0       logical name: wlan0       version: 6b       serial: 28:b2:bd:a3:76:7c       width: 64 bits       clock: 33MHz       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless       configuration: broadcast=yes driver=iwlwifi driverversion=3.16.0-30-generic firmware=25.228.9.0 latency=0 link=no multicast=yes wireless=IEEE 802.11bgn       resources: irq:65 memory:f1400000-f1401fff   *-network DISABLED                  # This is the usb wifi card.    description: Wireless interface    physical id: 3    bus info: usb@2:1    logical name: wlan1    serial: 24:24:20:4e:49:43    capabilities: ethernet physical wireless    configuration: broadcast=yes driver=rtl8192cu multicast=yes wireless=unassociated   When I tried to get it up manually:  cipher@Joy:~$ sudo ifconfig wlan1 up SIOCSIFFLAGS: Operation not permitted   What are the proper reasons to get this? How can I get it up?  Here are some info about the current state:  Output of lsmod:  cipher@Joy:~$ lsmod | grep 8192 8192cu                527333  0   module depends:  cipher@Joy:~$ grep "8192cu" /lib/modules/3.16.0-30-generic/modules.dep kernel/drivers/net/wireless/rtlwifi/rtl8192cu/rtl8192cu.ko: kernel/drivers/net/wireless/rtlwifi/rtl_usb.ko kernel/drivers/net/wireless/rtlwifi/rtlwifi.ko kernel/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko kernel/net/mac80211/mac80211.ko kernel/net/wireless/cfg80211.ko updates/dkms/8192cu.ko:   Some output of lspci:  cipher@Joy:~$ lspci 02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader (rev 01)   Output of rfkill:  cipher@Joy:~$ sudo rfkill list all 0: phy0: Wireless LAN      Soft blocked: yes      Hard blocked: no   I think it's the device of the system wifi card. The usb card seems missing from rfkill.  Some output of iwconfig:  cipher@Joy:~$ iwconfig wlan1     unassociated  Nickname:"<WIFI@REALTEK>"           Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated              Sensitivity:0/0             Retry:off   RTS thr:off   Fragment thr:off           Power Management:off           Link Quality:0  Signal level:0  Noise level:0           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0           Tx excessive retries:0  Invalid misc:0   Missed beacon:0   system modules:  cipher@Joy:~$ cat /etc/modules lp rtc # rtl8192cu 8192cu   blacklist about rtl8192cu:  cipher@Joy:/etc/modprobe.d$ grep 8192 *  blacklist-8192cu.conf:blacklist rtl8192cu blacklist-8192cu.conf:blacklist rtl8192c_common blacklist-native-rtl8192.conf:## This file ships with the rtl8192-fixes DKMS module. blacklist-native-rtl8192.conf:blacklist rtl8192cu blacklist-native-rtl8192.conf:blacklist rtl8192c_common   I've tried most posts about installing wireless drivers from google, and they brought me to the current situation.  I think I'm almost get the usb wifi card work, but how to get this continue: get the wlan1 up ?  Any experts can give any hints? Thanks in advance.


How to write cursive i (or iota) in latex?

How can I write the following symbol? I tried but I couldn't find any source...I am looking for cursive i


How do I prepare best for my first wedding photography event?

I am going to shoot a wedding this weekend, and I want to do my best for my friend's big day.    What can I do to prepare for the day in order to minimize failures and mistakes? How do I avoid missing important shots? What backup plan should I have?   I have been shooting for 6 years or so, and I know wedding is one of the hardest thing to do. I have told my friend what I end up producing will be of no match with the work of dedicated wedding photographers, not even the ones that are about to fall out of business.  They are on a tight budget, they said some photos are still better than none, they really must minimize the cost as much as they can. I exaggerated again that my photos will be worse off than the cheapest wedding photographer you can find.  She has been a close friends for years, I want to do everything I can to help her.  Their wedding is at 12:30pm coming Sunday, I have visited the venue last Sunday at 12:30pm to check traffic condition and also the lighting.  The setup is mainly outdoor (no church), the indoor area will not have a good ceiling for bounce. Being at the middle of the day, this can mean some tricky fill flash. I have jot down a list of must-have shots. I am also asking for the seating plan and the event run-down.  Gear:   Canon EOS 60D , EF-S 15-85mm f/3.5-5.6 IS USM Canon EOS 450D (or I can borrow a 550D), EF 50mm f/1.4 Speedlite 580 EXII Speedlite 270 EXII Yongnuo 460 (a cheap but powerful manual flash as backup) Samsung EX-1 f/1.8 point and shoot (backup of a backup...?)   Other lenses that I have but I don't think will be useful:   50mm f/1.8 EF-S 50-250mm f/4.0-5.6 IS II EF-S 18-135mm f/3.5-5.6 IS (I have the better 15-85 on 60D, should I put this on the 450D as a backup allrounder?) EF-S 60mm f/2.8 Macro (should I replace 50mm f/1.4 with this for added macro? You can hardly use f/1.4 under direct sunlight if you want to have fill-flash)   I have two batteries for all cameras (60D 450D and EX1). I have like in total 64GB SD card (I am really inclined to get more, or bring a laptop for on-the-fly backup, or do both). I recently repaired my 580EXII, it has a brand new flash head so the recycle time is as good as it can be, I just need a tonne of batteries. No I don't have external power pack or battery grip for my cameras.  I have a great monopod, but a cheap tripod.  I am happy to bring everything, just putting them in the boot of my car. The carpark is on-site, walking from venue to my car is under 1 minute.  I will have my girlfriend carry the 450D and shoot details / non-portraits.  One concern that I have is fill flash, I really do not have a large surface to bounce off  from. I have shot events before but they are not as dynamic/critical as a wedding.  How do I prepare for differing weather conditions?  If its sunny, fill flash is probably going to be in every single shot. If its cloudy, I probably will turn off the flash. If it rains, my 60D should be fine I have used it in slight rain before, but I really don't know their plan and if they have extendable shelters etc.  What else should I prepare for? Having no experience I want to be as prepared as I can be. Maybe I have overlooked something, maybe there is something else I can do to ensure the shooting will go smoothly. Your help is greatly appreciated!


At what port did Lorance Effler born about 1787 in Germany come to the US?

My 4th great-grandfather came into the USA from Germany (Prussia) between 1805-1810.  He arrived into the Port of Charleston, South Carolina, supposedly as a  (taken from an orphanage to become an indentured servant).   I've heard that his brother came with him.  They may have been stowaways. He was working off his passage (in Charleston), had a mean master and was able to escape with a trader from the North Carolina mountains (who was in Charleston buying supplies).  My 4th great-grandfather's name was Lorance Effler born about 1787 (died 1886 in Tennessee).    Is there any way to find him when he arrived in the Port of Charleston or in any port of South Carolina?


Is it possible to (and if so, how do I) make a single program work both as a console application and a GUI version using Delphi 2007?  What I am after is that if the program is run with the appropriate command-line options, it should function as a console program, printing output to the console using WRITELN, but if no command line arguments are given it should run as a normal Delphi GUI application?  The catch is that when running as a console application, the command line interpreter waits for the application to terminate before allowing you to enter a new command, whereas a GUI application started from the command line immediately returns you to the command line and the GUI application is started in a detached process. I want this behaviour retained.  I don't mind something like this:     IF GUI THEN StartApplicationAsGUI(ParamStr(0))   ie. I don't mind that I'll have to restart the application using some form of EXECUTE call to start it in GUI mode if needed, as long as the command line interface returns to the command line input when the GUI version is started.  I'd prefer a solution/suggestion that is along the lines of:     <Parse Comnand Line>   IF ConsoleMode THEN      RunConsole(Parameters)   ELSE BEGIN      Application.Initialize;      Application.CreateForm(...)      Application.Run;   END   (or vice-versa, ie. doing things a special way if GUI mode)  so that I can still use Delphi's IDE and VCL when making the GUI interface...


Duplicates in linked and related questions

I often browse the right side the of the page, looking for similar questions. ("I am interested in this question...what other questions should I read?")  Sometimes, I find the same question as both linked and related. ("Huh...I read a question just like this one...no it was this one...that's weird.")  Example from :    Notice that  shows up twice.  I am not sure if this is intentional behavior. If it is:   I have mistagged this question. I do understand the "technical" correctness. I disagree with intended behavior, as I see at best only marginal benefit.


Implementation of PCA using SVD without creating covariance matrix

So I'm currently taking a Machine Learning course and have correctly submitted my implementation of PCA. I used SVD. Here it is Octave.  function [U, S] = pca(X) %PCA Run principal component analysis on the dataset X %   [U, S, X] = pca(X) computes eigenvectors of the covariance matrix of X %   Returns the eigenvectors U, the eigenvalues (on diagonal) in S %  % Useful values [m, n] = size(X);  % You need to return the following variables correctly. U = zeros(n); S = zeros(n);  % ====================== YOUR CODE HERE ====================== % Instructions: You should first compute the covariance matrix. Then, you %               should use the "svd" function to compute the eigenvectors %               and eigenvalues of the covariance matrix.  % % Note: When computing the covariance matrix, remember to divide by m (the %       number of examples). %  covarianceMatrix = (X' * X) ./ m; [U, S, V] = svd(covarianceMatrix);   % =========================================================================  end   I thought the point of using SVD in PCA implementations was to improve the computational efficiency and therefore not compute the covariance matrix (which can cause loss of precision).   How come I was expected to create the covariance matrix? How can I implement PCA without creating a covariance matrix?


Let m and n be any two positive integers. Then prove that :  Φ(mn) = Φ{ (m, n)Φ[m, n] } where (m,n)=the g.c.d.of m and n and [m, n]= the l.c.m of m and n