How to have many namespaces while keeping a 'clean' api? namespace composition

EDIT: This does not really seem a duplicate to me since  in broader in scope (how to use it). Anyways, the answer to my question does turn out to be there in paercebal's  and is namespace composition. Another related source in SO is this other .    I've been trying to modularize my code using namespaces. Anon's  to a question on nested namespaces got me wondering whether they should be used for design instead of simply avoiding name clashes.  I feel like namespaces (occasionally nested ones) are useful to organize the code, but sure things like world::europe::spain::madrid become cumbersome to use. Therefore, from an API point of view, having most code in the same namespace (just like the std library) works best.  My question is then two fold:   Should namespaces be used to organize code or simply to avoid name clashes? and if so How to have a "complex" namespace structure while keeping the API clean?   Regarding question 2, I've been using the following strategy:  (1) having some code with its own namespace  //mathlib.h  namespace mathlib {     int sum( int a, int b ) {         return a + b;     } }   (2) and bring it into another namespace  //otherlib.h  #include <iostream> #include "mathlib.h"  namespace otherlib {     using namespace mathlib; // lookup stuff inside mathlib      void print(int n) {         std::cout << "the int is " << n << "!";     } }   (3) So I can actually call sum as it were under the otherlib namespace.  #include "otherlib.h"  int main(){     auto myint = otherlib::sum(1, 2);     otherlib::print(myint);     return 0; }


I just started learning python. I come from C++/Java background. To understand two dimensional arrays. I have written the following snippet  x = [[0]*3]*3 for i in range(0,3):    for j in range(0,3):       x[i][j] = i+j  for i in range(0,3):    for j in range(0,3):       print x[i][j],    print ""   Why is this program printing  2 3 4 2 3 4 2 3 4   instead of my expectation  0 1 2 1 2 3 2 3 4   I thought about the reason for this and I am not able to conclude anything. Is this something to do with reference variables?


Comparing two logit/probit curves with a single parameter

I've conducted a psychological experiment on the same subject, under two different condition. For each condition I've collected the number of correct and wrong answer for each stimulus (number of trials per stimulus = 10; number of stimulus = 15). From the data collected I fitted a psychometric curve (probit or logit curve), and now I want to compare the results.  Consider subject 1: His answers are collected in the following matrices  **COND_1**     correct cnt   Y  N   1   0 10   2   0 10   3   0 10   4   0 10   5   0 10   6   0 10   7   1  9   8   4  6   9   5  5   10  7  3   11  8  2   12  7  3   13 10  0   14 10  0   15 10  0  **COND_2**     correct cnt   Y  N   1   0 10   2   2  8   3   2  8   4   3  7   5   2  8   6   4  6   7   8  2   8  10  0   9   8  2   10 10  0   11  9  1   12 10  0   13 10  0   14 10  0   15 10  0  COND_1.1 <- matrix(c(0, 2, 2, 3, 2, 4, 8, 10, 8, 10, 9, 10, 10, 10, 10, 10, 8, 8, 7, 8, 6, 2, 0, 2, 0, 1, 0, 0, 0, 0), byrow=F, ncol=2)  COND_1.2 <- matrix(c(0, 0, 0, 0, 0, 0, 1, 4, 5, 7, 8, 7, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 6, 5, 3, 2, 3, 0, 0, 0), byrow=F, ncol=2)  cnt <- seq(from=0, to=1.4, by=0.1)  ddprob.1.1 <- glm(COND_1.1 ~ cnt, family = binomial(link = "probit"))  ddprob.2.1 <- glm(COND_2.1 ~ cnt, family = binomial(link = "probit"))     Observing the plot, you can surely say that performance under condition 2 is better then the performance under condition 1. In fact if you compute some parameters like AUC, p25, p50, p75 (the value of the stimulus at which the number of correct answers are 25%, 50% and 75% each) [threshold parameters], you'll see that:  COND_1      COND_2 AUC    <    AUC p25    >    p25 p50    >    p50 p75    >    p75     Now consider subject 2:  COND_1     correct cnt   Y  N   1   0 10   2   0 10   3   0 10   4   0 10   5   3  7   6   3  7   7   4  6   8   5  5   9   9  1   10  9  1   11 10  0   12 10  0   13 10  0   14 10  0   15 10  0  COND_2     correct cnt   Y  N   1   0 10   2   1  9   3   0 10   4   4  6   5   2  8   6   6  4   7   4  6   8   7  3   9   4  6   10  7  3   11  7  3   12 10  0   13  9  1   14 10  0   15 10  0   COND_1.2 <- matrix(c(0, 0, 0, 0, 3, 3, 4, 5, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 7, 7, 6, 5, 1, 1, 0, 0, 0, 0, 0), byrow=F, ncol=2) COND_2.2 <- matrix(c(0, 1, 0, 4, 2, 6, 4, 7, 4, 7, 7, 10, 9, 10, 10, 10, 9, 10, 6, 8, 4, 6, 3, 6, 3, 3, 0, 1, 0, 0), byrow=F, ncol=2) cnt <- seq(from=0, to=1.4, by=0.1)  ddprob.1.1 <- glm(COND_1.2 ~ cnt, family = binomial(link = "probit")) ddprob.2.1 <- glm(COND_2.2 ~ cnt, family = binomial(link = "probit"))   The plotted curves are shown in the image below.    Can you say what performance is better? Under condition 1 or under condition 2? Extrapolating AUC, p25, p50, p75, you have:  COND_1      COND_2 AUC     >   AUC p25     >   p25 p50     =   p50 p75     <   p75   So my question is: Is there a method to say that a generic curve (logit, probit or whatelse) is HIGHER then another? Is there a method to compare (a single number of "performance") that describe the differences of the two curves? My example shows that AUC, p25, p50, p75 are not good parameters. I'd like to compute a single numeric parameter for each curves, to make a simple t-paired test, extrapolated from the distribution seen.


Prove by induction that $3 \mid n^4-n^2 \forall n \in \mathbb{Z^+}, n \ge 2$.

Proposition: $3 \mid n^4-n^2$ for all $n \in \mathbb{Z^+}, n \ge 2$ My attempt Lemma: $3 \mid (m-1)m(m+1)$ Proof. Suppose $m \in \mathbb{Z}$. By the QRT, we have $m=3q+r$ $\,\ni\, r \in \{0,1,2\}$, and $q=\lfloor{\frac{m}{3}}\rfloor$. We want to show that $(m-1)m(m+1)$ is divisible by 3. Clearly, if any one of the three factors in $(m-1)m(m+1)$ is divisible by 3, then the product must also be divisible by 3. $\cdot$ Case 1 ($r=0$): If $r=0$, then $m=3q$ is divisible by 3. $\cdot$ Case 2 ($r=1$): If $r=1$, then $m-1=(3q+1)-1=3q$ is divisible by 3. $\cdot$ Case 3 ($r=2$): If $r=2$, then $m+1=(3q+2)+1=(3q+3)=3(q+1)$ is divisible by 3. In either case, one of the three factors in $(m-1)m(m+1)$ is divisible by 3. Thus $3 \mid (m-1)m(m+1)$. Therefore, the product of any 3 consecutive integers is divisible by 3. Proof. Base case: Let $n=2$. Then $\exists k \in \mathbb{Z}$ such that $12=3k$, namely, $k=4$. Thus $3 \mid 12$ and hence the claim holds for the base case. Assume for positive integer $m \ge 2$ that $m^4-m^2=3k$ for some $k \in \mathbb{Z}$. We need only to show that this implies that $3 \mid (m+1)^4-(m+1)^2$. $(m+1)^4-(m+1)^2= \sum_{i=0}^{4} {4\choose i} m^i \cdot 1^{4-i}-(m+1)^2=(m^4-m^2)+4m^3+6m^2+2m=(m^4-m^2)+3(m^3+2m^2+m)+(m^3-m)$. By the inductive hypothesis, $3 \mid(m^4-m^2)$. And since $(m^3+2m^2+m) \in \mathbb{Z}$, it follows that $3 \mid 3(m^3+2m^2+m)$. Note that $(m^3-m)=m(m^2-1)=(m-1)m(m+1)$. By the Lemma, $3 \mid (m^3-m)$. Thus we have $3 \mid (m^4-m^2)$, $3 \mid 3(m^3+2m^2+m)$, and $3 \mid (m^3-m)$. To show that their sum is divisible by 3, let $k_1,k_2,k_3 \in \mathbb{Z} \,\ni\, m^4-m^2=3k_1, 3(m^3+2m^2+m)=3k_2$, and $(m^3-m)=3k_3$. Thus $3k_1+3k_2+3k_2=3(k_1+k_2+k_3)=m^4-m^2+3(m^3+2m^2+3m)+(m^3-m)$, where $(k_1+k_2+k_3) \in \mathbb{Z}$. Hence $3 \mid (m+1)^4-(m+1)^2$. Therefore, by induction, $3 \mid n^4-n^2, \forall n \in \mathbb{Z^+}, n \ge 2$.


[CLOSED] Thanks  GoodDeeds and Henry [1] I understood the fundamental problem.  As √9 = ± 3    If , √A = √B Thus, ** ±a =  ±b** And so a = b; -a = b; and  a = -b;; Thus, √9 = +3 OR -3    Let, √A = ±a and, √B = ±b Is this reasoning correct?   If not how does this actually work?  [1] \bib{26369}{misc}{     title={Square roots -- positive and negative},     author={Henry ()},     note={URL:  (version: 2011-03-11)},     eprint={},     organization={Mathematics Stack Exchange} }


If $p^q - 1$ is a prime, then $p=2$ and $q$ is a prime

I was working my way through some number theoretic proofs and being a newbie am stuck on this problem :     If $p$ and $q$ are positive integers ($\mathbb{Z}^+$) such that $q \gt 1$ and $(p^q - 1)$ is a prime, then $p$ is $2$ and $q$ is a prime.   My Question :     I am unable to make any concrete progress . Even a decent hint would be acceptable so that I can build on that ...


How do i create a WPF window in a console app?

I have an existing project, now i want to create a menu window (using WPF). I cannot seem to figure out how to add this to my existing project. How can i implement a "WPF-window" to a console app project?


Hi i wanted to know is it possible to call a codebehind function in my Javascript? The javascript is in the head of my asp.net webpage page.   I have tried many methods but none seem to have worked. Its the first time iv had to do this so an example would be a nice learning curve fix.  My codebehind function in C#  protected void GetAverageRent_TextChanged(object sender, EventArgs e) {     string Postcode = _postCodeInput.Value.ToString();     var webGet = new HtmlWeb();     var doc = webGet.Load("http://www.webadress.com/" + Postcode);       HtmlNode AvgPrice = doc.DocumentNode.SelectSingleNode("//div[@class='split2r right']//strong[@class='price big']");      if (AvgPrice != null)     {         AverageRentLbl.Text = AvgPrice.InnerHtml.ToString();     }     else     {         AverageRentLbl.Text = "Invalid Postcode!";         AverageRentLbl.ForeColor = Color.Red;         AverageRentLbl.Font.Bold = true;     } }   My Javascript  <script> function codeAddress() {          document.getElementById('map-canvas').setAttribute("style", "height:200px");          geocoder = new google.maps.Geocoder();         var latlng = new google.maps.LatLng(-34.397, 150.644);         var mapOptions = {             zoom: 16,             center: latlng,             mapTypeId: google.maps.MapTypeId.ROADMAP         }         map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);          //var address = document.getElementById('_mainContentHolder__postCodeValue').value;         var address = document.getElementById('ContentPlaceHolder1__postCodeInput').value;          geocoder.geocode({ 'address': address }, function (results, status) {             if (status == google.maps.GeocoderStatus.OK) {                 map.setCenter(results[0].geometry.location);                 var marker = new google.maps.Marker({                     map: map,                     position: results[0].geometry.location                 });                  document.getElementById('ContentPlaceHolder1__latValue').value = results[0].geometry.location.lat();                 document.getElementById('ContentPlaceHolder1__longValue').value = results[0].geometry.location.lng();             } else {                 alert('Sorry the postcode you entered in invalid. Please try again: ' + status);                 document.getElementById('ContentPlaceHolder1__postCodeInput').value = "";             }         });</Script>


How to get the index of the word being clicked in Javascript

I want the index of the search results when they are being clicked and I have used the following code:-  $('#results').append('

'+dis[searchResult[i]]+'

'); var g = document.getElementById("select"); for (var j = 0; j<g.dis.length; j++) {     g.addEventListener('click',function(index){     console.log(index);     });      }   But that gives the following error:-  search83.js:27 Uncaught TypeError: Cannot read property 'length' of undefined     at HTMLInputElement.<anonymous> (search83.js:27)     at HTMLInputElement.dispatch (jquery.min.js:2)     at HTMLInputElement.v.handle (jquery.min.js:2)


I have a piece of code in Java that I have been struggling to understand what is the time complexity... In the best case scenario I believe it might be O(n) and the worst case probably O(n^2) because it could go in recursion for n times... Is this right??  All the other methods are O(1)  public void associateblocks() {     Block block = head;     while (block != null) {         Block block2 = block.getNextBlock();         if (block2 != null) {             if (block.getSize() == block2.getSize() && block.isFree() && block2.isFree()) {                 block.setSize(block.getSize() * 2);                 block.setIndex((block.getIndex() - 1) / 2);                 block.setNextBlock(block2.getNextBlock());                 associateblocks();                 freeBlocks.remove(block2);             }         }         block = block.getNextBlock();     } }


In Blade Runner 2049, Wallace wants to capture the replicant child so that he can dissect it, study it, and create replicants capable of breeding.  Meanwhile, the replicant rebels want to use the child as proof of replicant reproduction, arguing that replicants should have the same rights as normal humans.  This seems counterproductive.  Wouldn't it serve the replicant rebellion's interests if Wallace were able to create more replicants capable of breeding?


I am working on an javascript app and having some trouble with the object constructor.  I am going to make each card in the deck an object and so just working on building an array of those objects.  Here is what i have :        function card(suit1,number1) // Constructor     {     this.suit1 = suit1;     this.number1 = number1;     }       function makeDeck1() {     var deck1 = new Array()        deck1[0]= new card('S','A');     deck1[1]= new card('S','1');      }       function myFunction() {  makeDeck1();     alert('gman' + deck1);      }
Blackjack
      <button onclick="myFunction()">Click me</button>     basically the console is telling me that "deck1" is not defined...so something is wrong with the process...  was wondering if anyone can shed any light on this.  Thanks!  G


What is the difference between Ubuntu Software Centre and Synaptic Package Manager?

I am transferring from 8.10 to 10.10. I was wondering what is the difference between Ubuntu Software Centre and Synaptic Package Manager in 10.10? For what kinds of things do I need to go which?   Thanks!


It seems generally admitted that there are no negative prime numbers.  What are the rules that can affirm this?  Thanks in advance and happy new year to all.  Best regards,


What does "if and only if" mean in definitions?

Consider the following definition:     A sequence $\{p_n\}$ is Cauchy if we have that for every $n, m \ge N$: $$|p_n - p_m| < \epsilon$$   Although if and only if is not used, we know that if a sequence is Cauchy, the Cauchy criterion holds. Consider now the following definition:     An action of a group $G$ on a set $X$ is transitive if and only if for each $x, y \in X$ there is a $g \in G$ such that $gx = y$.   What motivates the use of "if and only if" here? As far as definitions go, my head has automatically thought "if and only if." The latter example is taken from Ratcliffe's "Foundations of Hyperbolic Manifolds", and he switches a lot between "if" and "if and only if" in his definitions.


Why haven't I received the "Curious" badge?

As you can see in the picture, I have 13 out of 5. But it's been like this for about two months! What's the reason for that?


Can i update ubuntu while i currently have themes

I have some themes installed on ubuntu 16.04 right now and im running plank as well, i wanted to know if i could safely just update to 18 right now or would i have to restore defaults and uninstall any extra features


With a Blinkback Belt, a Quickdraw Shield with the Throwing Shield property can be donned and thrown as a free action. How many throws is reasonable?

A player in my group is interested in making a offensive shield build. They found that if you get a  and modify it with , that you can don it, and throw it all as a free action. Then, if they put it on a , then it returns to their belt immediately after the attack is resolved. Thankfully there is a rule that states you can only perform a reasonable number of free actions per turn... In this case... How many shield tosses would be a "reasonable" [mechanically balanced] amount?


How is focal length facial distortion different on an APS-C sensor compared to a full frame?

From my understanding (and research) focal length affects how a face will end up looking on a photograph.  Here's an example of focal length distortion on a full-frame sensor:    My question is: will a photo taken with a 28mm focal length on an APS-C sensor look identical to a photo taken with a 40mm (28mm equivalent on a full frame sensor) on a full frame sensor? or will the levels of distortion remain the same as with a 28mm - full-frame sensor combo?


I was wondering is there any usability of using final local variables. Variables are not overridden anyway when inheritance comes into picture. For example a simple code as below  public static void main(String args[]) {     final String data = "Hello World!";     System.out.println(data); }   The example is quite simple one and may not be a relevant code but the question is more generic.I have seen a lot of codes(all incorporated in main function which have final local variables) Is there any usability of  declaring local variables as final other than that they cannot be edited in the same function itself?


Bash converting path names for sed so they escape

I'm having a problem with a script. It is meant to change a value in a file called %DIR% so that it becomes a path name. The problem is the slashes in the directory name upset sed, so I get weird errors. I need to convert the slashes in the path name into escaped slashes.  So /var/www would become \/var\/www  But I don't know how to do this.  Currently the script runs sed with this:  sed -i "s/%DIR%/$directory/g" "$config"


Real curve noob here.  I'm building fan blades. I have an extruded cube and a BezierCircle. I just want to place copies of the object around the curve. But when I do wire up the object and curve It completely deforms the shape of the object rather than just position copies around the curve.  I end up with this:    How can I stop the curve altering the shape? Or am I just getting the entire approach wrong. Very confused.


Can a multiclassed Sorcerer prepare spells using slots from Flexible Casting?

Let's take the example of a Sorcerer 2/Cleric 1. The Sorcerer/Cleric can "burn" his or her spell slots in order to obtain a single 5th level spell slot using Flexible Casting. Would RAW only allow them to prepare 1st level Cleric spells, or would it allow them to prepare Cleric spells of up to 5th level because the 5th level slot is not from the Sorcerer's "Spellcasting" feature?


What do  mean such as implements Comparable?

In , class  implements interfaces Comparable, Serializable.  In , class  implements interfaces Serializable, Comparable<BigInteger>.  This is just an example to help me ask about < and >.  What I am really wondering about is the < and > stuff.  My question is threefold:    what does the <BigInteger> part of the implements statement mean? what is that syntax called? and what does it do?   P.S.: It's really hard to google for < and > and impossible to search SO for < and > in the first place.  Thanks!


Which one is correct- 'pleasant experience' or 'a pleasant experience?

I know Grammarly is not a precise source for finding grammar-related mistakes. But its verdict on the following sentence perplexes me:      It's necessary for offering pleasant shopping experience to your customers.    Grammarly says that I should write 'a pleasant shopping experience'. My cognition says that experience is a mass noun and therefore, does not require any article prior to it.   Even Google  did not help me much.  What should I write here-pleasant shopping experience or a pleasant shopping experience?


Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of HTML tags?


How to hide infoWindow while using measure tool and showing it back after using it ArcGis JavaScript API

I have an infoWinfow set on the click event of the map. I want to disable this event when I'm using the measurement tool and then enable it back after the measurement tool is used. So far I've done this code, where the click event for the infoWindow is disable when the measurement tool is used. I want to enable the click event back after the measurement tool is used. Any ideas on how this could be done? Thanks.  function initToolbar(mymap) { var measurement = new esri.dijit.Measurement({     map: mymap }, dojo.byId('measurementDiv')); measurement.startup(); measurement.setTool("area", false);  measurement.areaToggleButton = function () {     this.clearResult();     this.setTool("area");     dojo.disconnect(clickHandler); }; measurement.distanceToggleButton= function () {     this.clearResult();     this.setTool("distance");     dojo.disconnect(clickHandler); }; }


Adding a search box to a Leaflet.js example

Consider the example in the following link for : .   The result looks like what you see below:        I would like to add a search box to it to be able to search by city, and have the visualization zoom in and/or center around it. How can I go about adding such search box to it? Can I add this functionality perhaps in the HTML file?


Boot Ubuntu in Command line without loading graphics drivers?

How do I tell GRUB to boot Ubuntu in command-line and not to load any AMD graphics drivers?  It seems that my laptop's Graphics card is broken - there are . I am able to get to the GRUB menu with these blue stripes. However, once I chose "recovery mode" the screen just freezes and cursor keeps blinking forever. My goal is to somehow boot into system and copy all personal files to a remote host, but I can't do that presumably because Ubuntu tries to load AMD GPU driver and switches graphics mode. The same issue happens also If I try to boot my system with USB flash drive.


How to replace EasyPeasy partition with Lubuntu

I have acer netbook with dual boot, window 7 and Easy Peasy . I want to replace EasyPeasy partition with Lubuntu so that I have dual boot of window 7 and lubuntu.  Please let me know how can do it.


Is there a commercial, "Stack Overflow"-like framework available for companies to use for strictly INTRAnet based Q&A?


regex skip matches if they contain substring

This is the test case: ARMOIRE 6 PORTES &lt;span style=&quot;font-family: arial;&quot;&gt;&lt;u style=&quot;color: rgb(170, 170, 170);&quot;&gt;:	Longueur : 297 cm - Profondeur : 73 cm - Hauteur : 260 cm.&lt;/span&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;&lt;u&gt;ARMOIRE 4 PORTES &lt;span style=&quot;font-family: arial;&quot;&gt;&lt;u style=&quot;color: rgb(170, 170, 170);&quot;&gt;:

Chevet  And here's my solution: (?<=&)(?!.<).?(?=[A-Z]) Basically I want to select everything between a & and the first instance of [A-Z], but not if it contains a html tag bracket. At first I thought it doesn't work, because it didn't - not in Notepad++, not on regex101.com However, if I modify the test string ARMOIRE 6 PORTES &lt;span style=&quot;font-family: arial;&quot;&gt;&lt;u style=&quot;color: rgb(170, 170, 170);&quot;&gt;:	Longueur : 297 cm - Profondeur : 73 cm - Hauteur : 260 cm.&lt;/span&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;&lt;u&gt;ARMOIRE  4 PORTES &lt;span style=&quot;font-family: arial;&quot;&gt;&lt;u style=&quot;color: rgb(170, 170, 170);&quot;&gt;:

Chevet  then it works.  I would like to understand why and how I can modify my regex to cover both cases - if possible.


Review notification appears when the queue is empty

I was on the PPCG meta site, and suddenly the "3 notifications" appeared. I went there, and the queues are all empty. Refreshing and revisiting the page did nothing.  Is this perhaps showing me notifications for items in the queue that I had already reviewed? The notifications appeared after my most recent reviews.


Where can I find advice on building my own Node.js TypeScript framework

I have posted a question about advices on design and architecture and review on a framework I'm creating:   Basically: I'm in the right direction and have I done some mistakes in the architecture. This required a bit of reading of the documentation and code can't be posted as such.  All my questions were closed or voted down, telling me to go somewhere else. Very nice people gave me a : none of them seem to fit the topic (although other similar question get answered on Stack Overflow, software engineering stack... which is very frustrating).  Simple question: Where do I post this kind of question now?


When objects fall along geodesic paths of curved space-time, why is there no force acting on them?

On , it is written that      So, we see things falling with an acceleration which we call the acceleration of gravity,and thinking that we live in a straight line , uniformly moving or stationary inertial frame, we attribute that acceleration to a force, the force of gravity. Whereas in reality,objects falling towards the Earth are moving along geodesic paths with no acceleration and according to modified version of law of inertia, have no force acting on them. They fall simply because the curved space-time near the Earth ...   Now, why do the objects falling towards the Earth move along the geodesic paths with no acceleration? That means the objects don't have any force acting on them, but why? A body in a free-fall moves with acceleration $g$, so, why is it written like that? Why does the author use Law of inertia on freely falling body?? Law of Inertia can only be applied when no external force acts on the body. So, is the freely-falling body accelerates under force of gravity or moves uniformly while moving through geodesic paths as quoted by the author?


Passing an array of ints as an argument in C++?

I made a function in C++ to find the length of an array. I find the sizeof the array passed in the argument and divide it by the sizeof the variable type. This should work but it always returns 1! Am I missing something obvious? Or does this have to do with pointers and memory? This is my code:      #include <iostream>      using namespace std;      int lengthOf(int arr[]);      int main() {         int x[] = {1,2,3,0,9,8};         int lenX = lengthOf(x);         cout << lenX;         return 0;     }      int lengthOf(int arr[]) {         int totalSize = sizeof arr;         cout << totalSize << endl;         int elementSize = sizeof(int);          return totalSize/elementSize;     }   Output (should be 6 instead of 1):      4     1   I am fairly new so excuse me if this is a bad question.


Physical meaning of Maxwell's equations and origin of EM waves

Is it possible to describe the physical meaning of  and show how they lead to electromagnetic wave, with little involvement of mathematics ?


Collector Doping Concentration and Current Gain

I was wondering, in a BJT why does the collector doping concentrarion have no effect in determining the current gain? I am trying to understand this conceptually but I can't seem to wrap my head around it.


MacTeX - TeX Live Utility broken after 2015 update

I have the following strange message.  The repository at ftp://ftp.oleane.net/pub/CTAN/systems/texlive/tlnet  has TeX Live 2015, but you have TeX Live 18446744073709551615  installed. You need to switch repositories in order to continue.   How can I fix this ?


combinatorics circular arrangement problem

If $n$ distinct things are arranged in a circle, then what are the number of ways selecting three of these things so that no two of them are next to each other?


Okay I have been through these forums for days and I'm finally breaking to ask the question. I'm designing for 3D printing (so solid forms are extremely valuable). I have an SVG Logo (both in Curve and Mesh format in my scene) that I need to mesh to a cylinder type shape I created so that it can be embossed onto it and then also etched into it (need to create both versions). The etched version I need to retain the inset shape so that it can be printed separately (in another color) and then glued into the etch if possible. I've tried Shrink Wrap (makes it flush), Simple Deform (does nothing or warps it out of recognition), and Curve (if it even lets me use it) does nothing that I can tell. I have no clue how to get this to just match the curve of the cylinder and it should not be this complicated >.< Any help is greatly appreciated and I apologize for being such a newb. Notes: I'm working on a Mac version of the program so the common hot key commands do not work most of the time so please avoid them in your help if possible. I've posted two pics of my current workspace. Again, Thank you![


I have an issue with evee (both in 2.8 and 2.9) - on my setup background and HDRI illumination isn't blocked off by other surfaces and materials. So, even in a completely closed room, all surfaces seem equally lit. I did some research, but couln't find a solution to that exact issue. Would be glad if anyone had an idea...? Thanks in advance! Ro.


Downloading salinity data from Government of Canada

Since I would like to use the salinity data with lat/lon in the Gulf of St. Lawrence, Canada to compare with the fishing data. I'm trying to download the 2010-2019 average salinity data. As the table in this database showed. ()


What happens when I sacrifice a blocking creature?

In Magic:The Gathering it is possible to trigger abilities of creatures at the same time you can play instants?  I play it that I can block with a creature and sacrifice it at the same time. The attacking creature blocked this ways does not deal damage because the blocking creature is gone - and I get the bonus for the sacrifice (e.g.  gives me an extra B-Mana).  In a recent discussion the topic came up again. It seems like the rulings even allow for the blocking player to wait until the damage is put on the stack. Once the damage is on the stack, I can sacrifice my creature, gain the benefits from the sacrifice ability AND deal damage to the attacking create. In my Blood Pet example I would be able to kill an attacking creature with toughness 1 and get 1 B-Mana.  Is this correct? Where can I find the official ruling that clarifies that?


How do I change my password in ubuntu?  I think I have either 12.4 or 12.10.  I'm a bit computer illiterate, so will need an answer for a computer dummy.


why using typename keyword when declaring vector iterator?

When I want to declare a iterator for vector, why do I need to use typename?  For example:  typename vector<T>::iterator i;   If I remove the keyword of typename then the program simply does not work. What I have written is:  #include <iostream> #include <string> #include <vector>  using namespace std;  template <class T>  class MyClass {   private:     vector<T>  array;    public:     MyClass ( T * begin,int n ) : array(n)     {       copy( begin, begin + n, array.begin());     }      void List()     {       typename vector<T>::iterator i;       for( i = array.begin(); i != array.end(); ++i )         cout << * i << "," ;     }    };   int main() {   string array[4] = { "Tom","Jack","Mary","John"};   MyClass<string>obj(array,4);   obj.List();   return 0; }    Any help would be appreciated.


What are all the Christmas decor items in Merry Clickmas?

Every time I search the internet for what all of the Christmas items on the list in Merry Clickmas, I only find incomplete lists.   Right now I have 360% on my current speed - these are the decorations I have unlocked (each decoration adds +4% speed):     a Christmas tree a partridge in a pear tree tinsel baubles glass ornaments a star an angel a fairy a cherub pine cones Christmas lights candles a lantern bells five gold rings a trumpet a drum ribbons glitter a Merry Christmas banner a Christmas wreath mistletoe holly an advent calendar paper chains Christmas crackers Christmas cards Christmas presents toys wrapping paper a Christmas stocking a Christmas sack candy canes chocolate decorations a Christingle a nativity scene a figure of Mary a figure of Joseph a figure of Jesus wise men figures a toy soldier a donkey decoration a robin decoration a reindeer decoration a penguin decoration a polar bear decoration a santa decoration an elf decoration a sleigh decoration a Christmas pudding decoration a turkey decoration a chimney decoration a snow globe a snowman snow decoration icicles santa hats a lump of coal ivy poinsettia a nutcracker a toy train a Christmas pickle chestnuts roasting on an open fire and a gingerbread house     Are there any more or is that the limit?


How can I prevent certain websites from appearing in my Google search results?

I'm looking for a method to stop a given list of websites from appearing in my Google search results. Any chance I can achieve this?


Automated SQL to identify Contacts to Delete in Marketing Cloud

Our contact count in Marketing Cloud is increasing quickly and we will start to look at an automated way to delete contacts who no longer exist in CRM. The plan is to compare the All Contacts table with the synchronized DE contact_salesforce and lead_salesforce. If the Contact exists in All Contacts but does not exist in the synchronzed DEs then we can assume that the contact has either been deleted or merged in CRM and we can then proceed with the delete contact in Marketing Cloud. In order to accomplish this, we will need to query the All Contacts in Marketing Cloud. I know we have the _subscribers data view but in this case, we want to pick up all contacts not just contacts who have been sent an email. Can you advise on how to accomplish this. Thank you.


User with low reputation shows as having modified thread

How can this user , reputation 3, show in  as having "modified 7 hours ago", but on the modified thread, , not show at all?  This user also has two medals, which is somewhat puzzling.


What happens if a user has multiple accounts and keeps upvoting himself/someone else?  Does that happen? Is there a system to stop it?


Shrink database after removing extra data

We have a need to fit a database in 4GB in order to use SQL Server Express Edition. I started from a 7GB database, and found a lot of unneeded records, and deleted them. After shrinking, the database size is 4.6GB, and 748 MB is free (according to database properties).  However, when I execute exec sp_spaceused, I have interesting results:  DatabaseName    Database_size   unallocation space xxxxxx          4726.50 MB      765.42 MB   Reserved        Data          index_size      unused 3899472 KB      1608776 KB    1448400 KB      842296 KB   Any ideas, how can I release at least some of this unused space? Also I know table, which occupied it.  Update: is it worth to trying to rebuild table indexes?  ALTER INDEX ALL ON Production.Product REBUILD


Installing Microsoft office 2010 across multiple drives

I've bought an ASUS TX300CA Windows 8 transformer tablet which has a detachable keyboard dock.  The tablet has a neat feature that although the detachable tablet part has only a 128Gb SSD, when you attach the keyboard dock, you get additional 500Gb of magnetic hard drive.  I want to install Microsoft Office 2010 so that some Office applications install on the tablet drive and some (such as Access, Visio, Project etc) - that would usually require keyboard work - to install on the dock drive.  There doesn't seem to be a mechanism to change the installation folder for the software.  Can it be done?  TIA, Paolo


Can any one help me with the code for adding some number of days to any date..?  For example  today is 11-04-2014.   I want 15-04-2014 + 3 days  output:18-04-2014.  My question is not adding dates to current date..


Apply filters immediately or after confirming with a button?

What is the proper way to filter data in an application?  The example displays a case where the filter shows the population for the selected city.        Automatically filter data when selection changed:         Or        Filter data after the button "Filter" got selected:


Is there any way to clone a content type

My site has a lot of different content types, they all have the same fields, the only difference is the name of the content type. Is there any way to clone those content types other than create them one by one. Thanks.


I am getting this warning after updating to PHP 7.2 can anyone help me resolve it?     Warning: Declaration of foundation_navigation::start_lvl(&$output,   $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output,   $depth = 0, $args = Array) in   /nas/content/staging/arnoldhill/wp-content/themes/arnoldhill/functions.php   on line 121   The function is currently written like this  // Add class to navigation sub-menu class foundation_navigation extends Walker_Nav_Menu {  function start_lvl(&$output, $depth) {     $indent = str_repeat("\t", $depth);     $output .= "\n$indent<ul class=\"flyout\">\n"; }  function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {     $id_field = $this->db_fields['id'];     if ( !empty( $children_elements[ $element->$id_field ] ) ) {         $element->classes[] = 'has-flyout';     }         Walker_Nav_Menu::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );     } }   Thanks  Henry


Determine the set of continuity point of Riemann function defined on $ [0,1]: $ $$  f(x) = \begin{cases} \frac{1}{q}, & x = \frac{p}{q} \mbox{ is rational in lowest terms} \\ 0, & x = 0 \mbox{ or }  x\mbox{ is irrational} \end{cases}   $$ $( \frac{p}{q}$ is in lowest terms, if $p$ and $q$ are integers with no common factor and $q > 0$) I'd like to determine the set of points of continuity and I really don't know how to approach this.


javascript does not detect the click on the link

I am inserting link elements and would like to share the clicks, but I'm not getting .. The test code:  <html> <title></title> <head>      <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>     <script type="text/javascript">          $(document).ready(function(){             $("#teste").click(function(){                $("body").append($("<a>").text("Element A"));             });              $("a").click(function(){                alert("oi");             });         });      </script>  </head> <body>     <input type="button" value="INSERT A" id="teste" /> </body> </html>


What I had tried till Now  string Value =""; foreach (List<string> val in L1) {    Value = Value + string.Join(",", val) + " // "; }   Where L1 is of datatype List <List<strings>>  This Works, But its take almost n half hour to complete Is there as many fastest and simple way to achieve this.


I'm trying to solve a problem from my Group Theory course. It goes like this:  Being $S_n$ the symmetric group of order $n$. Find the number of index 2 subgroups of $S_n$.  I'm not pretty sure how to start. I guess it would have something to do with the normal subgroups of $S_n$, since any index two subgroup of a group $G$ is normal to $G$. But I don't know how to compute this number of subgroups, I just know that $|S_n|=n!$. Any help will be appreciated.


What are all the versions focal, focal-updates, focal-backports, focal-proposed, focal-security ..in http://ports.ubuntu.com?

asking so many questions these days.. In , I see versions focal, focal-backports, focal-proposed, focal-security and focal-updates. What are these different versions? and how can I get the sources of them? What I want to do is to compile the source after adding some debug information (prints, or debug-info) and use the changed installation .iso in my qemu virtual machine to debug install failure. p.s. : I know how to install the focal-updates version (in it, the one using network to install components).


Second countability by itself doesn't restrict the cardinality of a topological space, since every set with the trivial topology is a second countable space, but it seems natural to ask whether second countability restricts the cardinality of the Borel $\sigma$-algebra of the space.  Can the cardinality of the Borel $\sigma$-algebra of a second countable space be arbitrarily big? If this is the case is there a simple construction for a second countable space with an arbitrarily big Borel $\sigma$-algebra?


Which answer should be the accepted answer for this question

I asked  a few days back. It had one answer that was correct but was not so relevant to what was asked (The person wrote something he used in Ember but not React).   So that answer guided me and I easily found a "correct" solution relevant to React and I posted the answer, so that someone visiting the question in future in reference to React can easily find the answer.  Now I am confused, which answer to mark as "accepted" answer, since I obviously referenced an answer before posting my own.  Moderators? Suggestions?  Note: Let me know if my answer does not add anything useful to page, I will remove it.


How to use a static map of function pointer field in a template with using or typedef

I have   template <class ElemType> class FunctionNode : public ComputationNode<ElemType> {     typedef void(*TensorFunctionFunc)  (TensorView<ElemType>&);      static const map <string, TensorFunctionFunc> fmap;   and in the cpp  template <class ElemType> const map <string, TensorFunctionFunc> FunctionNode::fmap = FunctionNode::create_map();   However i get a variety of errors , tried using as well. Any ideas ? Also i don't think i can use std::function() since i'm using dlopen.    Quite a few similar questions but none covering a static map of function pointer , in a template .  This is not a duplicate of "Why can templates only be implemented in the header file? 12 answers" since even when using the header it does not work due to the static ! . This requires completely different initialization.  ( the answers there do not work) ..


Do we really need that $\mathcal{E}$ is locally free for part (c) of Exercise 5.1 in Chapter II of Hartshorne?

I have a question concerning part (c) of Exercise 5.1 in Chapter II of Hartshorne: He asks to prove that if $\mathcal{E}$ is a locally free $\mathcal{O}_X$-module of finite rank and $\mathcal{F},\mathcal{G}$ are arbitrary $\mathcal{O}_X$-modules, then $$ \operatorname{Hom}_{\mathcal{O}_X}(\mathcal{E}\otimes_{\mathcal{O}_X}\mathcal{F},\mathcal{G})\cong \operatorname{Hom}_{\mathcal{O}_X}(\mathcal{F},\mathcal{Hom}_{\mathcal{O}_X}(\mathcal{E},\mathcal{F})). $$ My question is: is it really necessary to suppose that $\mathcal{E}$ is locally free of finite rank for this to hold? Because I seem to be able to construct canonical maps in both directions which are mutually inverse, without using that $\mathcal{E}$ is locally free. Namely $$ F:\operatorname{Hom}_{\mathcal{O}_X}(\mathcal{E}\otimes_{\mathcal{O}_X}\mathcal{F},\mathcal{G}) \to \operatorname{Hom}_{\mathcal{O}_X}(\mathcal{F},\mathcal{Hom}_{\mathcal{O}_X}(\mathcal{E},\mathcal{F}))\\ \varphi\mapsto \left(\substack{F(\varphi):\mathcal{F}\to\mathcal{Hom}_{\mathcal{O}_X}(\mathcal{E},\mathcal{F})\\ b\in\mathcal{F}(U)\mapsto F(\varphi)(U)(b)\in\mathcal{Hom}_{\mathcal{O}_X|_U}(\mathcal{E}|_U,\mathcal{F}|_U)}\right) $$ where we define for open sets $V\subseteq U\subseteq X$ and sections $a\in\mathcal{E}(V)$ and $b\in\mathcal{F}(U)$ $$ [F(\varphi)(U)(b)](V)(a):=\varphi^{\text{pre}}(V)(a\otimes b|_V). $$ Here $\varphi^{\text{pre}}$ is the precomposition of $\varphi$ with the canonical map from the presheaf tensorproduct to the sheaf tensor product. On the other hand, we also have the map $$ G:\operatorname{Hom}_{\mathcal{O}_X}(\mathcal{F},\mathcal{Hom}_{\mathcal{O}_X}(\mathcal{E},\mathcal{F}))\to\operatorname{Hom}_{\mathcal{O}_X}(\mathcal{E}\otimes_{\mathcal{O}_X}\mathcal{F},\mathcal{G})\\ \psi\mapsto G(\psi) $$ where on simple tensors $a\otimes b$ with $a\in\mathcal{E}(U)$ and $b\in\mathcal{F}(U)$ (and I believe the values on simple tensors suffice to specify all of $G(\psi)$) we define $$ G(\psi)(U)(a\otimes b):=[\psi(U)(b)](U)(a). $$ It seems to me that these two constructions are mutually inverse and don't use any assumption on $\mathcal{E},\mathcal{F},\mathcal{G}$. Am I mistaking somewhere?


Doppler Shift when Light Travels Through Two Different Mediums

When considering the Doppler shift, the 'canonical equation' is  $$f=\frac{c+vr}{c+vs}f_0$$  However, this equation seems to run into trouble in the following situation: A light source inside water is moving at a speed $v$ towards a receiver outside the water. Can we modify the above equation to deal with a transition between two media? Or is there a completely different formula that applies here?


How do I unscrew a hex screw that doesn't have any grip anymore?

I messed up the screw that fits this tip of this particular type of screwdriver bit (circled in red):   That screw now has almost no edges and is basically oval. I tried lubricating the screw so that I can get it by the neck on the opposite side with a set of pliers but I had no luck there as well.


Permission denied: writing a udev rule to to a test file in /etc/udev/rules.d/

An Ubuntu 16.04 udev rule is defined:  target='SUBSYSTEMS=="usb", ATTRS{product}=="Metrologic Scanner", GROUP:="username"'   Command to append a rule to test udev file fails:  sudo echo $target > /etc/udev/rules.d/test.txt   What must be done to overcome the response \ error:     bash: /etc/udev/rules.d/test.txt: Permission denied   Examples and explanations are highly appreciated: thank you


Intersection of the $p$-sylow and $q$-sylow subgroups of group $G$

What can we say about the intersection of the $p$-sylow and $q$-sylow subgroups of group $G\;$?  It's not necessary that $p=q$.  Is there general statements about the intersections of sylows subgroups ?   You can give me restricted conditions, this is also welcome !


Compiling a given Template with given .cls

I am trying to use a particular template (given in the 2nd link below). Before I apply this to my own Tex file for my paper, I'd like to learn how to actually compile the given template. I am having trouble with the following steps:  1) For file prepared in AMS-LATEX format: Download the class file “AIMS.cls” from the following link and place it to the local folder where your tex file resides. .  Question: The link isn't a download but rather leads to a page with some code. What exactly should I be adding to my folder and how do I do this?  2) For file prepared in AMS-LATEX format: Download the AMS-LATEX template by clicking the following link and use it as a template to prepare your tex file.   How do I put these two together to compile the corresponding PDF for the given template? I've never done this before. I've tried (using TeXworks) to (i) compile the Template_1.tex file, (ii) insert the .cls code into a blank template and then compile, and (iii) insert the .cls code into the Template_1.tex code (does it matter where I insert the code?).   In each case, I receive an error.   This is pdfTeX, Version 3.14159265-2.6-1.40.16 (MiKTeX 2.9) entering extended mode (C:/Users/Joseph/Desktop/cls.tex LaTeX2e <2015/10/01> patch level 2 Babel <3.9m> and hyphenation patterns for 69 languages loaded.  LaTeX Warning: You have requested package `',                but the package provides `dcds'.  ! Use of \@ doesn't match its definition. \@tempa#1#2\@nil->\edef \@classname{#1}  l.14 \expandafter\@tempa\@currnamestack{}{}{}\@nil  ? "    I see that part of the problem is that I should not use class AMS article nor \amsart but use class \dcds, so how should I make this change in the template? Is it as simple as replacing every occurrence of "amsart" with "dcds"?


Why does he go "pink with the effort" while watching morris dancing?

This is a follow-up question to my previous one, , as in that one I have established that "pink" in this context mean "embarrassed" other than "angry or healthy."  Then it leads to my second confusion, why is he embarrassed? I have checked the definition of morris dance on wikipedia, so far as I know it's a culture dancing, some cultural heritage. but why embarrassing? is there some culture gap I have missed??  Here is the sentence:     We, in the meantime, had gradually been increasing Will’s outings—and   the distance that he was prepared to travel. We had been to the   theatre, down the road to see the morris dancers (Will kept a straight   face at their bells and hankies, but he had gone slightly pink with   the effort), driven one evening to an open-air concert at a nearby   stately home (more his thing than mine), and once to the multiplex   where, due to inadequate research on my part, we ended up watching a   film about a girl with a terminal illness.      Me Before You by Jojo Moyes   I searched the whole novel, and there are only two times "morris" are mentioned, the other is in a conversation in a horse racing watching:      ‘Don’t be grumpy. They say you should try everything once,’ I said.       ‘I think horse racing falls into the “except incest and morris   dancing” category.’       ‘You’re the one always telling me to widen my horizons. You’re loving   it,’ I said. ‘And don’t pretend otherwise.’       Me Before You by Jojo Moyes   The context is that Will is a quadriplegic in wheelchair and he rarely goes out, and he does not like go watching horse racing. "We" means Louisa, his carer.    Could anyone help with this question?


Yes, it's a small issue. But, it occurs in many areas of the Stack Exchange Sites.  I found this issue in  Question with one view   In the review History Page    Rest of the things are on the hover messages, I've tried them on both Firefox and Chrome.   See the below screenshots,        Do we need to fix this type of issues?  I think, Yes.


iptables port redirect not working for localhost

I want to redirect all traffic from port 443 to the internal port 8080. I'm using this config for iptables:  iptables -t nat -I PREROUTING --source 0/0 --destination 0/0 -p tcp \          --dport 443 -j REDIRECT --to-ports 8080   This works for all external clients. But if I'm trying to access the port 443 from the same maschine I'll get a connection refused error.  wget https://localhost   How can I extend the iptables rule to redirect local traffic too?


Is it possible to have a Group without any elements inside it?

I know that any set with just one single element forms a group. The single element satisfies all the axioms. However, similarly to how we have an empty set, which is nevertheless still a set, is it possible to have a sort of "empty" group that would "vacuously" satisfy the group axioms?  I have looked at the Wikipedia page for Group, however I could not find an explicit statement that said that a "0" group can not exist.  If an "empty" group does not in fact exist, then I am confused as to why an "empty" category can exist. It would seem like sometimes you can in fact have "empty" trival objects, and then in other areas of mathematics you can not. I would really appreciate an intuitive discussion as to why that could be?  Thank you so much!


Why didn't Count Dooku expose Palpatine?

In the Revenge of the Sith, when Count Dooku had Chancellor Palpatine captured, did he actually know that Palpatine was the same person as his master Darth Sidious?   If he did, then why didn't he expose Palpatine when the latter ordered Anakin Skywalker to kill him?


Yesterday, our kitchen faucet suddenly stopped working. Water pressure has always been fine, but now there is only a trickle. It's a single handle faucet and both the hot and cold will not work. I have a reverse osmosis water filter next to it that still works fine, and I know the shutoff valves are open. I cleaned the aerator and even took off the sprayer, and still very little water comes out from the hose, so I don't think it's a clogged sprayer.   Any suggestions?


Printing very large - can I use my photo from my Fuji XT2?

Can I print an image of artwork taken on my Fuji XT2  on fabric 100 x 120 inches, or would I need to have that image scanned at a higher resolution on a flatbed scanner, or photographed by professional services?  Thank you in advance for your advice!  My artwork is a drawing of an elephant that will be created at a size to optimize maximum image size in a photograph.  What would that size be? A size that fills my fixed lens?  The viewing distance would be 10-20 feet in an interior gallery space. The fabric is polyester georgette, a sheer, smooth surface. The printer of this fabric says that they print at 200dpi and that my image should be scaled to 100%.


Find the limit: $\lim_{n\to\infty} \left (1+ \frac {1}{2^2}+ \frac {1}{3^3}+...+\frac {1}{n^n} \right)$

Does the limit:   $$\lim_{n\to\infty}  \left (1+ \frac {1}{2^2}+ \frac {1}{3^3}+...+\frac {1}{n^n} \right)$$   admit a closed form?   I know only Riemann-Zeta function.I've just discovered this sum.


How to convert typename T to string in c++

While playing with templates in c++ I encountered a problem converting typename T to string. For example:  template <typename T> class Matrix {    public:         Matrix() {            //my_type = string type of T. i.e. if T is char. I want my_type to be "char".         }    string my_type; }   How do I convert T to a string that says what T is.  Note: I'm just playing around so please do not worry about when one might need such a thing.


How to build a predictive model when more levels of a categorical predictor are possible than appear in the training data

I have created an Artificial Neural Network with 4 categorical features and a binary outcome either 1 for suspicious or 0 for non-suspicious:          ParentPath                                  ParentExe 0   C:\Program Files (x86)\Wireless AutoSwitch  wrlssw.exe 1   C:\Program Files (x86)\Wireless AutoSwitch  WrlsAutoSW.exs 2   C:\Program Files (x86)\Wireless AutoSwitch  WrlsAutoSW.exs 3   C:\Windows\System32                         svchost.exe 4   C:\Program Files (x86)\Wireless AutoSwitch  WrlsAutoSW.exs  ChildPath                                   ChildExe    Suspicious C:\Windows\System32                         conhost.exe  0 C:\Program Files (x86)\Wireless AutoSwitch  wrlssw.exe   0  C:\Program Files (x86)\Wireless AutoSwitch  wrlssw.exe   0 C:\Program Files\Common Files               OfficeC2RClient.exe  0 C:\Program Files (x86)\Wireless AutoSwitch  wrlssw.exe  1 C:\Program Files (x86)\Wireless AutoSwitch  wrlssw.exe  0   I have used sklearn for label encoding and one hot encoding on the data:  #Import the dataset X = DBF2.iloc[:, 0:4].values #X = DBF2[['ParentProcess', 'ChildProcess']] y = DBF2.iloc[:, 4].values#.ravel()  #Encoding categorical data from sklearn.preprocessing import LabelEncoder, OneHotEncoder #Label Encode Parent Path labelencoder_X_1 = LabelEncoder() X[:, 0] = labelencoder_X_1.fit_transform(X[:, 0]) #Label Encode Parent Exe labelencoder_X_2 = LabelEncoder() X[:, 1] = labelencoder_X_2.fit_transform(X[:, 1]) #Label Encode Child Path labelencoder_X_3 = LabelEncoder() X[:, 2] = labelencoder_X_3.fit_transform(X[:, 2]) #Label Encode Child Exe labelencoder_X_4 = LabelEncoder() X[:, 3] = labelencoder_X_4.fit_transform(X[:, 3])  #Create dummy variables onehotencoder = OneHotEncoder(categorical_features = [0,1,2,3]) X = onehotencoder.fit_transform(X)   I have split the data into a training and test set and run it on my gpu box with a nvidia 1080.  I have tuned the hyperparameters and am now ready to use the model that is trained in a production environment with one test sample being tested at a time.  Lets say I just want to test one sample:     ParentPath            ParentExe     ChildPath           ChildExe 0  C:\Windows\Malicious  badscipt.exe  C:\Windows\System   cmd.exe     The issue that I am running into is the training set has seen the ChildPath "C:\Windows\System" and the ChildExe "cmd.exe"  which are normal, but the training set has not seen the ParentPath "C:\Windows\Malicous" or ParentExe "badscipt.exe" so these have not been label or one hot encoded.  My big question is how to build a predictive model when not all of the categorical variables (in this case, file paths and file names) can be exhaustively enumerated?  I have seen examples using feature hashing but I'm not sure how to apply that or if that would even solve this problem.  Any help or pointers would be greatly appreciated.


Geometrical intuition for sum of first n cubes

The relation  $$ \sum_{k=1}^n k^3 = \left(\sum_{k=1}^n k\right)^2 $$  baffled me when I first found out (i.e. yesterday on a train trip). Writing an inductive proof is easy and I know that there is a recursive way to obtain a general formula for  $$ \sum_{k=1}^n k^j $$  for any $j \in \mathbb{N}$, but I feel like this relationship between the sum of the first n cubes and the sum of the first n integers should have some nice geometrical proof. The closest thing I found was the first answer to , but I still don't find it intuitively clear. Maybe I am asking for too much here.


How do I resize a LVM partition using system-config-lvm?  As per   I clicked on the partition and tried to resize, but got a pop-up error from system-config-lvm.     Logical volume is not mounted but is in use. Please close all applications using this device (eg iscsi).     What's the problem and how can I fix it?    See also .


Which parts of Pathfinder are excluded from the PRD?

I recently started playing/GMing Pathfinder (beginner rules) and currently shopping around for the Core Rulebook (planning ahead). The way the PRD puts it, it sounds like the Core Rulebook is entirely unnecessary:     This compendium is NOT the official Pathfinder Roleplaying Game!   Players interested in a user-friendly introduction to the Pathfinder   system will want to purchase the complete Pathfinder Roleplaying Game   Core Rulebook and the Pathfinder RPG Bestiary, which comes complete   with more than 350 monsters to menace your player characters.      Both books contain hundreds of beautiful full-color illustrations and   lots of descriptive text to explain and introduce key rules concepts   necessary to fully enjoy the Pathfinder Roleplaying Game experience. ()   I do enjoy reading their "user-friendly" material, but if all I'm missing out on is wordiness and pretty pictures I have no problem at all with that and saving $30-$50.


What is the difference between a "link function" and a "canonical link function" for GLM

What's the difference between terms 'link function' and 'canonical link function'? Also, are there any (theoretical) advantages of using one over the other?  For example, a binary response variable can be modeled using many link functions such as logit, probit, etc. But, logit here is considered the "canonical" link function.


How to manually typeset text in parallel on facing pages in (Lua)LaTeX?

I want to typeset a bilingual text in parallel on facing pages using LuaLaTeX. The existing solutions to automate this task have proven unsatisfactory as they don't allow for footnotes (parallel), don't allow for different font sizes of the two parallel texts (), or generally provide a poor result of aligned text chunks (eledpar).  As the text is not too long, I really came to consider breaking the pages myself. For this to do, I have to solve the following problem(s):  Consider two facing pages with ending paragraphs of different length. The following paragraphs should then begin at the same vertical position such that the beginnings of these following paragraphs face each other. For this to accomplish on has   to determine the position of the end of the longer paragraph on its page to have the means to let the next parallel paragraphs both begin at the identified position.   Is this something which is doable? Are there mechanisms provided by (Lua)LaTeX to determine positions on a page and to begin typesetting at a specific position on a page?  EDIT: The following example illustrates the task. Here the latin paragraph starting with "O tempora, o mores" (third chunk of text in the code) should begin at the facing position of the beginning of the paragraph "Shame on the age..." (fifth chunk).  \documentclass[a6paper]{scrbook} \usepackage{fontspec} \usepackage[latin,english]{babel} \begin{document} \mbox{}\pagebreak  \noindent\selectlanguage{latin}{\large quo usque tandem abutere, Catilina, patientia nostra? quam diu etiam furor iste tuus nos eludet? quem ad finem sese effrenata iactabit audacia? nihilne te nocturnum praesidium Palati, nihil urbis vigiliae, nihil timor populi, nihil concursus bonorum omnium, nihil hic munitissimus habendi senatus locus, nihil horum ora voltusque moverunt? patere tua consilia non sentis, constrictam iam horum omnium scientia teneri coniurationem tuam non vides? quid proxima, quid superiore nocte egeris, ubi fueris, quos convocaveris, quid consili ceperis quem nostrum ignorare arbitraris?\par\newpage}  \noindent\selectlanguage{english}When, O Catiline, do you mean to cease abusing our patience? How long is that madness of yours still to mock us? When is there to be an end of that unbridled audacity of yours, swaggering about as it does now?  Do not the nightly guards placed on the Palatine Hill — do not the watches posted throughout the city — does not the alarm of the people, and the union of all good men — does not the precaution taken of assembling the senate in this most defensible place — do not the looks and countenances of this venerable body here present, have any effect upon you? Do you not feel that your plans are detected? Do you not see that your conspiracy is already arrested and rendered powerless by the knowledge which every one here possesses of it? What is there that you did last night, what the night before — where is it that you were — who was there that you summoned to meet you — what design was there which was adopted by you, with{\parfillskip0pt\relax\par}  \noindent\selectlanguage{latin}{\large O tempora, o mores!\par\newpage}  \noindent\selectlanguage{english}which you think that any one of us is unacquainted?  Shame on the age and on its principles! \end{document}


How to get the average of the higher M values in N cells?

I have a spreadsheet with values in a matrix with several rows. For each row I have a N numbers. I want to calculate the average of the M higher values of the row. With M<N. Is there a common function to do it?  If there is no such function, I suppose I can add it using the python plugins for gnumeric or the basic plugin for libreoffice.


Finding an acceptable upper limit on a random generator with an unknown distribution

Suppose we have a random number generator, and we do not know anything about the generator, including the distribution of its outputs. We are allowed to use the generator some number of times to get draws and observe the sample.   Then, from the sample(s), we want to find a number M such that we can say something like  "z% of the (future) draws from this random number generator will be less then M." (future draws meaning not including the draws we used to make sample(s))  How would I go about doing this, and are there any resources to go to?  Thanks!


"these are/it is" "too much/too many" macaroni

You've got macaroni spilt all over your house. Which one would be a correct version?    These are too much macaroni. These are too many macaroni. It's too much macaroni.


How to Search Google Drive for Directories over a Certain Size?

I've just received notice that my storage on Google Drive is about to exceed my storage limit. I often deal with this sort of thing by finding and removing a handful of obsolete giant files, freeing up enough space that there is no longer an issue.  However, it could be more (or also) useful to remove a handful of obsolete directories full of thousands of smaller files... Where the folder size is significant even though the individual files are small.   Is it possible (and how would it be done) to either sort the directories of Google Drive by the sum size of their contents, or to search for directories containing greater than 50MB for example?


Limit of derivative is zero. Does it imply a limit for f(x)?

I have come across the following question:  Say $f(x): [0,\infty) \rightarrow \mathbb{R}$ differentiable. Given $\lim_{x\rightarrow\infty}f'(x) = 0$, does this imply an existence of a limit (finite or not) of $f$ at infinity?  From what I tried to do, looking at the definition of the derivative: $\lim_{\substack{h\rightarrow0 \\ x\rightarrow\infty}}\frac{f(x+h)-f(x)}{h} = 0$ you could say that $\lim_{\substack{h\rightarrow0 \\ x\rightarrow\infty}} f(x+h) = \lim_{x\rightarrow\infty} f(x)$. Is it enough to prove the existence of a limit? if not, is there another way to prove or disprove that?


Even when I unlock the Fast User Switching functionality, using an admin account, the menu remains disabled.  What could be causing this? And, how could I solve it?


I'm getting the following error when I run sudo apt-get update:  W: The repository 'http://download.fpcomplete.com/ubuntu yakkety Release' is not signed.   How can I fix this?  My /etc/apt/sources.list file is as follows:  deb http://archive.ubuntu.com/ubuntu yakkety main universe restricted multiverse deb http://security.ubuntu.com/ubuntu/ yakkety-security main universe multiverse restricted deb http://archive.ubuntu.com/ubuntu yakkety-updates main universe multiverse restricted deb http://archive.ubuntu.com/ubuntu yakkety-backports main universe multiverse restricted   I have changed "Server in South Africa" to "Main Server" in "Software and Updates", but that hasn't helped.


Prove that if $n \in \mathbb{N}$, then $\sum_{d|n}{(d(n))^3}=(\sum_{d|n}{d(n)})^2$ where $d(n)$ is the divisor function.

Prove that if $n \in \mathbb{N}$, then $$\sum_{d|n}{(d(n))^3}=(\sum_{d|n}{d(n)})^2$$ where $d(n)$ is the divisor function. I have know only information is $d(n)=\sum_{d|n}{1}$.


"a patient who is" or "a patient whom is"?

I am still very confused on when to use who and whom, I understand the idea these sentences are correct:        He is the person who won the competition.   That is the person whom I went on holiday with.      But what would be correct in the following sentence:     This image shows a patient who is... or whom is?   Would it be who because the patient is the subject, or is it?


How to prove $a_1^m + a_2^m + \cdots + a_n^m \geq \frac{1}{a_1} + \frac{1}{a_2} + \cdots + \frac{1}{a_n}$

I was asked to prove an inequality: For any $n$ positive numbers $\{a_i\}$ with $a_{1}a_{2}\cdots a_{n} = 1$ and $m \geq n-1$ be a non-negative integer, $a_1^m + a_2^m + \cdots + a_n^m \geq \frac{1}{a_1} + \frac{1}{a_2} + \cdots + \frac{1}{a_n}$  After several attempts, I think I had to use induction on both $m$ and $n$. In particular, I fix an $n$ and claim that the inequality holds for every $m$, and use induction on $n$.  The case where $n = 2$ could be done by rewriting the inequality as $a_1^2 + a_2^2 \geq a_1 + a_2$ and assume  that $a_1 \leq 1 \leq a_2$.   In the inductive step, given $a_1^k + a_2^k \geq a_1 + a_2$ , by writing $a_1^{k+1} + a_2^{k+1} = (a_1^{k} + a_2^{k})(a_1 + a_2) - a_1^{k}a_2^{k} (a_1 + a_2)$, the result follows.  However, this method seems to fail for $n>2$, as the right-hand side of the inequality becomes more complicated. Should I try not to prove it by induction?


Duplicated content - how to tell Google I am original author

Let's say I prepared an article I wish to publish on my not so popular blog. But I am afraid that this article is so good that much more popular site will steal it and publish it on its own. I am guessing that because of low popularity of my blog, the Google would show links to the bad site instead of my own. Is there a way to prevent such outcome? What if I would prepare an article, publish it on my blog and later decide it it so good that I'll put it on Wikipedia, is there a way that Google would consider me above Wikipedia?


Stop Windows 8 from converting wallpapers to low quality JPGs

This has been bugging me on Windows 7 as well, and much to my chagrin Microsoft didn't bother addressing that issue in Windows 8. Take this image for example:   (Click to open original unaltered image.)  It's made for retina Macbooks, so naturally it's being downscaled when setting it as wallpaper on my 1680x1050 screen. Windows 8 manages to make it look terrible, see this screenshot:    Is there any way of making Windows always use the original image, not some JPGized-to-hell version of it?


Can the Past Progressive tense be used for habitual past?

I ran across the following sentence in an ESL textbook (by Jack C. Richards): "I was going to auditions". It was used to say what the subject would do for some time after college.  However, almost every grammar source I've seen claims that only "Simple Past", "used to" and "would" can be used for habitual past.  Can anyone explain the use of Past Progressive in the sentence above?


Getting Ip error while updating packages in terminal

Getting  404  Not Found [IP: 91.189.95.83 80]  How can I solve it?


How can I prevent Ask Toolbar and Ask Toolbar Updater from installing when jucheck installs an update?

I know about , but the accepted answer (use offline installer) keeps the Java auto-update (jucheck.exe) from downloading, and it makes it harder to update about a dozen PC's running various versions and editions of Windows.  So: is there a way to prevent the Ask Toolbar and Ask Toolbar Updater from installing when the Java Autoupdate (jucheck.exe) runs?


Help me understand .profile, .bashrc, etc

My current understanding is that commands added to these two files are run every time a new terminal is open. Is that correct? Because in a lot of places I see suggestions to put there commands I want to be executed at login, but if they get executed every time I open a new terminal, then I do not want that. Can you help me understand how they work? Also what is the difference between them?  If I understand them correctly, then where can I put commands that I want to be executed only on login, but not every time a new terminal is opened? I know that I can do that from the GUI for "startup applications", but I am interested in doing this in a file, if possible.


How to disable all GUI elements and boot to command prompt

Cross post from   I have a laptop I'm running as a file server, which is running Ubuntu 10.04 Desktop. Now that summer heat is here, and because I love the environment, I'm look for all sorts of ways to reduce the laptop's power/memory/heat footprint.  One part I never touch any more is the GUI as the lids always closed.  I thought perhaps simply removing GDM from all run-levels my achieve this, so I did so using sysv-rc-conf. However this didn't make any difference and upon reboot the lovely Ubuntu boot screen and graphical login prompt appeared.  Please help!  Additionally, perhaps this is a silly question, I want to make sure that the monitor is off at all times the lid is closed, which it is already set to do when the GUI is running, can/do I need to configure this separately for non-GUI environments? (Seems to be doing this fine)  Thanks :D  EDIT: Ok maybe I'm using sysv-rc-conf wrong and it needed 2 reboots to apply the settings or something? As rebooting it a second time since removing GDM from all run levels I got a command prompt.  However I didn't watch it reboot and was a little confused by this, so I rebooted what I believe to be a 3rd time, and now it's booted to a black screen with a solitary white underline in the top-left, no other text. No amount of keyboard mashing in order to change run levels is having any effect, however I am able to access it via SSH and the SMB shares, so I suppose it's doing almost what I want. The lack of a CLI on the screen itself is still concerning however.


Emails being replace to Holiday in the United States?

I recently started noticing that my emails were being replace to "Holidays in the United States" on the default Apple mail app. This is annoying because now I have to send emails from the browser. My name is correct in settings, does anyone know how to fix this?  I am on macOS Sierra.


Proving that $a+b+c $ is composite knowing it divides $abc$

Assume $a$, $b$, and $c$ are positive integers such that $(a+b+c)$ divides $abc$.  Show that $a+b+c$ is composite  I have that so far,  If $a+b+c$ is prime, then letting $a = xd$, $b = yd$, and $c = zd$ we have that $d(x+y+z)$ is prime. This means that $d = 1$ and thus $a,b,c$ are relatively prime. Therefore, $\dfrac{xyz}{x+y+z}$ is supposed to be an integer. What next?


How do I take two at a time from a collection

I'm trying to create substrings from each index in a string using this helper method public  List<int> AllIndexesOf(string str, string value) {     if (String.IsNullOrEmpty(value))         throw new ArgumentException("the string to find may not be empty", "value");     List<int> indexes = new List<int>();     for (int index = 0; ; index += value.Length)     {         index = str.IndexOf(value, index);         if (index == -1)             return indexes;         indexes.Add(index);     } }  And the way I am using it is like this string input = "27758585926302004842"; List<int> eh = AllIndexesOf(input, "2");  So I essentially want to grab each string between the indexes in two. So the subscring between index 0 and 9 and 13 and 19. I'm just not sure how to do this without using linq


How to know which driver is right for SM Bus Controller?

I'm having a problem with the SM Bus controller. it appears with an explanation mark in Device manager. I would install the driver manually but i'm not sure which is the right one. I don't know what device is that actually. How can i know? It seems like it's a known problem but i didn't find a good answer for my question.  I'm using Windows 8.1 64-bit:  Gigabyte Z97-d3h MoBo.  Intel CPU 4790k.  Kingston HyperX 16GB RAM.  MSI gtx970 4G GPU.  Kingston 3TB HDD.  Samsung Evo 250GB SSD.  EVGA 650W Gold PSU.


Do the cold welds that cause static friction also affect the lifting force?

In my physics book static friction is explained by cold welds between contact points.  If I now try to lift this object is there an initial max static lifting force which is slightly greater than the weight of the object?


I'm facing a strange result sizeof() during testing. How T1 and T2 are the same size as the types used in T2 is smaller than T1?  #include <iostream>  using namespace std;  struct T1 {     int     id;     int     enable; };  struct T2 {     int     id;     char    enable; };   int main() {     cout << sizeof(T1) << endl; // Print 8     cout << sizeof(T2) << endl; // Print 8     return 0; }


Can I Create a Dictionary of Generic Types?

I'd like to create a Dictionary object, with string Keys, holding values which are of a generic type. I imagine that it would look something like this:  Dictionary<string, List<T>> d = new Dictionary<string, List<T>>();     And enable me to add the following:  d.Add("Numbers", new List<int>()); d.Add("Letters", new List<string>());   I know that I can do it for a list of strings, for example, using this syntax:  Dictionary<string, List<string>> d = new Dictionary<string, List<string>>(); d.Add("Key", new List<string>());   but I'd like to do it for a generic list if possible...  2 questions then:   Is it possible? What's the syntax?   Many thanks, Jon


Why it is "Okun's Law" and "Philips Curve" rather than "Okun Law" and "Philips' Curve"?

How exactly do these kinds of compound words work?     "Okun's Law" and "Philips Curve" rather than "Okun Law" and "Philips' Curve"?   Is there any grammar book I can look for?


What are the platform strings for the iPhone 6S and iPhone 6S Plus?  From the simulators it looks like iPhone 6S is iPhone8,1 and iPhone 6S Plus is iPhone 8,2.   Can anyone with actual hardware confirm? Thanks.


if $a,b$ are elements of a unital algebra $A,$ then $1-ab$  is invertible if and only if $1-ba$ is invertible.  because if $1-ab\ $ has inverse $x$ , then $1-ba\ $ has inverse $1+bxa$. but how ??  $$(1-ab)x=x(1-ab)=1$$  then $$(1-ba)(1+bxa)=1+bxa-ba-babxa$$  but how the expression on right hand side equal to $1$.  any hint ??


Do I need an ESTA if entering the US from Canada by train

As a UK citizen, I will be flying to Vancouver (for which I will need an eTA) and then taking an AMTRAK train to Seattle. I will stay in Seattle for several days before returning to Vancouver and flying back to the UK. Do I need an ESTA for entering the US during this trip?


Reason of existense of the extra space in align environment and removal of it between two align environments

This is a follow-up question regarding the extra vertical space in amsmath's align environment. Why when in use align uses so much vertical space in contrast with other environments like for example tabular or itemize?  \documentclass[12pt]{article} \usepackage[top=0.3in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}   \usepackage[fleqn]{amsmath} \usepackage{unicode-math}  \setlength{\mathindent}{0cm} \newcommand{\3}{\vspace{0.3cm}}  \title{} \author{} \date{}  \begin{document}  70  \begin{align*} &e^{jz}=\cos z+j\sin z\\ &\cos z=(1/2)(2\cos z)=\\ &=(1/2)(2\cos z+j\sin z-j\sin z)=\\ &=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\ &=(1/2)(e^{jz}+e^{-jz}) \end{align*}  80  \begin{itemize} \item Item 1  \item Item 2  \end{itemize}  90  \begin{tabular}{c|c}  Entry 1& Entry 2  \\  Entry 3& Entry 4 \end{tabular}  \end{document}     Also another image of the huge space between two align environments. Even without the blank lines the space is a lot.    \begin{document}  \begin{multicols*}{2}   \begin{align*} &\text{70}\\ &e^{jz}=\cos z+j\sin z\\ &\cos z=(1/2)(2\cos z)=\\ &=(1/2)(2\cos z+j\sin z-j\sin z)=\\ &=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\ &=(1/2)(e^{jz}+e^{-jz}) \end{align*}    \begin{align*} &\text{207}\\ &x(t)=A_{c}\cos \theta(t)\\ &\theta(t)=2\pi f_{c}t+\phi(t)\\ &\phi(t)=K_{p}m(t)\\ &x(t)=A_{c}\cos[2\pi f_{c}t+K_{p}m(t)] \end{align*}   Edit I:  As I mention in a comment I have tried the following code and there is no difference between two align environments, only between text and an align environment. Why doesn't work in the case of the two environments and how can I fix it so to work? Also what is the reason that this space exists?  \setlength{\abovedisplayskip}{0pt} \setlength{\belowdisplayskip}{0pt} \setlength{\abovedisplayshortskip}{0pt} \setlength{\belowdisplayshortskip}{0pt}


Infer the second isomorphism theorem from the first one

I'm trying to infer the second isomorphism theorem on groups from the first one. Could you please verify if my attempt is fine or contains logical mistakes?  Let $G$ be a group, $S \le G$, and $N \trianglelefteq G$. Then $(S N) / N \cong S /(S \cap N)$.   My attempt: Consider the map $\phi: S N \to S /(S \cap N), \quad sn \mapsto s(S \cap N)$. Let $s_1, s_2 \in S$ and $n_1,n_2 \in N$ such that $s_1 n_1  = s_2 n_2$. We have $s_1 n_1 = s_2 n_2 \iff s_1^{-1} s_2 =n_1 n_2^{-1} \implies s_1^{-1} s_2 \in S \cap N$ $\iff s_1(S \cap N) = s_2(S \cap N)$. Hence $\phi$ is well-defined. Clearly, $\phi$ is surjective. It follows from $S \le G$ and $N \trianglelefteq G$ that $(S\cap N) \trianglelefteq S$. Hence $S /(S \cap N)$ is a group. Next, we show that $\phi$ is a homomorphism. Let $s_1, s_2 \in S$ and $n\in N$. It follows from $N \trianglelefteq G$ that $ns_2 = s_2 k$ for some $k \in N$. Hence $\phi ((s_1n)(s_2n)) = \phi (s_1 s_2kn) = (s_1s_2) (S \cap N) =$ $(s_1(S \cap N)) (s_2 (S \cap N))=\phi (s_1n) \phi (s_2n)$. It's not hard to verify that $\operatorname{ker} \phi := \{sn \in SN \mid (s,n) \in S \times N \text{ and } s (S \cap N) = S \cap N\} = N$. By , the result then follows.


So I have taken a first course in Special Relativity and the Relativistic Mass is defined as: $$m = \frac{m_o}{\sqrt{1 - v^2/c^2}}.$$  Now, when this was introduced in the course, it was introduced as something profound and very important. Not only did it show why no particle can be accelerated to a speed equal or larger than c but it also was required for momentum to be conserved in SR.  So why is it then that I keep reading here on SE that this term is deprecated, obsolete, etc. ?  This also eventually led to the famous $E = mc^2$ so I gotta ask, does mass increase in a moving frame or does it not?   This is quite confusing!


python looping through 2 lists skipping similar elements

I have 2 identical lists a = [a1,a2,a3] b = [a1,a2,a3] What is a most effective way to iterate over these 2 list simultaneously while i am interesting only in combination of different elements from both lists despite order, i.e a1a2 and a1a3. Combinations a1a1, a2a2, a3a3, a2a1, a3a1 i am interesting to skip, but interesting keep iterators values avaliable.  Want to re phrase questions: interesting in possible combinations of 2 elements from list a = [a1,a2,a3]


How do I install a .zip file via the command line?


WAMP different sites on different ports accessible on LAN

I have a small windows server set up on a LAN, with static IP address 192.168.1.100. I have a few other client machines, say 192.168.1.101 - 104.  Requirements:   Host an apache server (wampserver) on the main server, accessible only on the LAN. Set up the default wampserver tools (such as phpmyadmin) on port 8080, accessible only from the server machine Use port 8081 for a special internal site, accessible by all machines on the LAN   My current setup as follows:  httpd.conf:  ServerRoot "c:/wamp/bin/apache/apache2.2.22"  Listen 8080 Listen 8081  ServerAdmin admin@localhost ServerName localhost:8080 DocumentRoot "c:/wamp/www/"  <Directory />     Options FollowSymLinks     AllowOverride None     Order deny,allow     Deny from all </Directory>  <Directory "c:/wamp/www">     Options Indexes FollowSymLinks     AllowOverride all      Order deny,allow      Deny from all      Allow from 192.168.1 </Directory>  <Directory "c:/site1">     Options Indexes FollowSymLinks     AllowOverride None      Order deny,allow      Deny from all      Allow from 192.168.1 </Directory>  <Directory "cgi-bin">     AllowOverride None     Options None      Order deny,allow      Deny from all      Allow from 192.168.1 </Directory>   httpd-vhosts.conf:  Listen 8080 Listen 8081  NameVirtualHost *:8080 NameVirtualHost *:8081  <VirtualHost *:8080>     ServerName localhost     DocumentRoot c:/wamp/www </VirtualHost>  <VirtualHost *:8081>     ServerName site1     DocumentRoot c:/site1 </VirtualHost>    I have opened up port 8081 on the windows server I have added "site1" to point to 192.168.1.100 on the hosts files of the client machines I have added an alias on the server  Alias /site1/ "c:/site1/"        Options Indexes FollowSymLinks MultiViews     AllowOverride all         Order allow,deny     Allow from all    The problem now is that the behaviour is not quite what I need.  Current behaviour on the server:   192.168.1.100:8080 serves me c:/wamp/www as expected 192.168.1.100:8081 also serves me c:/wamp/www instead of c:/site1 that I expect  instead, 192.168.1.100:8081/site1 serves me c:/site1   Current behaviour on client machines:   site1:8081 (or 192.168.1.100:8081) serves me the c:/wamp/www on the server, instead of c:/site1 that I expect. I don't want c:/wamp/www accessible from clients. instead, site1:8081/site1 (or 192.168.1.100:8081/site1) serves me the c:/site1 on the server.   What am I doing wrong?


I'm new to postgresql/postgis and trying to measure a distance. So st_distance() may be the most accurate, it's the slowest too (as I've read). I read that one can use geometric (instead of geographic) measuring with less accuracy, but the numbers I get don't make sense. This is what I've got:  (all points are geography(Point,4326))  select   st_astext(point),   st_astext(point2),   round(st_distance(point, point2)),   round(point::geometry <#> point2::geometry) -- cast to geometry and use distance operator from testgeo2 limit 50  "POINT(53.887 54.043)","POINT(70.764 80.922)","3053406","32" -- ok "POINT(93.262 59.546)","POINT(84.331 84.334)","2774883","26" -- ok "POINT(99.624 67.098)","POINT(95.718 85.252)","2027908","19" -- ok "POINT(54.406 84.531)","POINT(80.27  83.385)", "326308","26" -- hm?!   So I don't get how this can be right. Any suggestions?  One more example  -- new york, tokyo insert into testgeo2(point, point2) values (    st_geographyfromtext('point(-74.007873 40.717602)'),     st_geographyfromtext('point(139.754333 35.675853)'))  -- get distance select   st_astext(point),   st_astext(point2),   -- km, most accuracy   round(st_distance(point, point2)) / 1000,   -- km, with less accuracy   round(st_distance(point, point2, false)) / 1000,   -- km, Lambert   round(st_distance(     st_transform(point::geometry, 3587),     st_transform(point2::geometry, 3587))) / 1000,   -- km, from degree   round(point::geometry <#> point2::geometry) * 111 from testgeo2  -- results POINT(-74.007873 40.717602) POINT(139.754333 35.675853),     10871, 10847, 11224, 23754   is geometry just not working on a larger scale?


Proof that the Euler characteristic is additive

I'm reading through a set of notes which assumes that the Euler characteristic is additive, but doesn't give a proof, so I would like to understand why this is.  Let $A_n$ be a finitely generated Abelian group, non-zero for $0<n<k$. Consider the long exact sequence  $ \cdots \rightarrow A_n \rightarrow B_n \rightarrow C_n \rightarrow A_{n-1} \rightarrow B_{n-1} \rightarrow C_{n-1} \rightarrow \cdots $  where $B_n$, $C_n$ defined similarly to $A_n$.   I know that the Euler characteristic of $A$ is given by $\chi(A) = \sum_0^k (-1)^n \text{rank}(A_n)$, with similar definitions for $B$ and $C$. I want to prove that $\chi(B) = \chi(A) + \chi(C)$.  The notes say that for an exact sequence  $0 \rightarrow X \rightarrow Y \rightarrow Z \rightarrow 0$  of finitely generated Abelian groups $X,Y,Z$, we have the result rank($Y$) $=$ rank($X$) +  rank($Z$), and that the additivity of the Euler characteristic follows from this fact, but I can't see how.


As an example in pseudocode:  if ((a mod 2) == 0) {     isEven = true; } else {     isEven = false; }


Why can an  abstract class have a constructor? As we can't create an object of it why would we need a constructor in an abstract class?


When I compile my schematic, I get some errors in the compile window. When I double click them it zooms in on them and highlights them with a mask. How do I get rid of that mask?


Javascript: Second instance of class overwrites the first

I am trying to create two objects from one class. The objects add scroll listeners to the document and change change the divs provided by the instance.   However, creating a second class instance ignores the first and does not do anything to the provided div.  class MyClass{   constructor(parameter){     self = this;     self.parameterA = parameter;     self.myClassMethod = self.myClassMethod.bind(self);     document.addEventListener("scroll", self.myClassMethod)   }    myClassMethod(){     $('.class').each(function(){       console.log(self.parameter); //Returns only the second instance's parameter (parameter B)       $(this).children('.'+self.parameter).fadeIn('slow');//only fades in second instance     })   }  }  var testA = MyClass(parameterA); var testB = MyClass(parameterB);   Edit: In this code I have to use the this of the constructor and the .each() function.


Should we have a way to mark answers as duplicates?

Many times I have seen answers that are exact copies of other answers to the same question, with minor changes like different variable names. This does not add any value to anything; just extra load on the servers. Could we have a way to identify them as such so they can be dealt with?


What heterogeneity test is appropriate for my study? And, what is the use of correlation between median PFS and median OS

I want to perform a meta analysis of a particular subjects of cancer. My effect sizes are Overall Response Rate (ORR), Disease Control Rate (DCR), Duration of Response (DOR), Progression-Free Survival (PFS), and Overall Survival (OS). While ORR and DCR can be performed by meta analysis of proportions, PFS, OS, and DOR is in median months. I've managed to figure out how to do Cochran Q test for ORR and DCR. However, I can't manage to figure out how to perform heterogeneity test for DOR, PFS, and OS since it's in months and not in binary outcomes.  I have considered using PFS6m(%) and OS1y(%), wich units are in percentages. However, out of 7 studies, only 1 provided PFS6m and OS1y, thus I can't make a meta analysis using those  Furthermore, which statistical software package is eligible to perform I2 test?  And, I performed Spearman correlation between median PFS and median OS, and it shows medium correlation with bad significance (p = 0.294). Is it possible performing meta analysis with those data?  Thanks!


I'm at a complete loss right now.  I did plenty of research regarding this issue. Some background: I'm sending a HTML email through PHP using PHPMailer. The problem is, it always ends up in the junk folder.  $message = "Hello there"; date_default_timezone_set('Etc/UTC'); $mail = new PHPMailer();   //even tried setting up SMTP server  $mail->IsSMTP(); $mail->Host = "smtp.gmail.com"; $mail->SMTPAuth = true; $mail->Username = "myGmailEmail@gmail.com"; $mail->Password = "my gmail password"; $mail->SMTPDebug = 2; $mail->Port = 587; $mail->SMTPSecure = 'tls';  $mail->setFrom('noreply@promisingwebsite.com', 'No-reply'); $mail->addReplyTo('noreply@promisingwebsite.com', 'No-reply'); $mail->AddAddress($to); $mail->IsHTML(true);   $mail->Subject  =  $subject; $mail->MsgHTML($message); if($mail->send()) resp(true,$code); else resp(false,"error (".$mail->ErrorInfo.")");   When I do not use SMTP, it sends the email which ends up in junk folder. When I DO use it, I cannot authenticate:      2016-11-26 12:44:16 CLIENT -> SERVER: EHLO 185.80.130.141 2016-11-26 12:44:16 CLIENT -> SERVER: STARTTLS 2016-11-26 12:44:16 CLIENT -> SERVER: EHLO 185.80.130.141 2016-11-26 12:44:16 CLIENT -> SERVER: AUTH LOGIN 2016-11-26 12:44:16 CLIENT -> SERVER: bmVkdWthczE3QGdtYWlsLmNvbQ== 2016-11-26 12:44:17 CLIENT -> SERVER: bmVkdWxpdWthczEyMw== 2016-11-26 12:44:17 SMTP ERROR: Password command failed: 534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbtT                                       534-5.7.14 KhjtVSQhqL8MciQEtofR0fc36pPSF1zUxFnNZCay9DTcpxzjY0-elaKn8oWgt_-7bXpCSU                                       534-5.7.14 L0sarBbOFwjA4l3lN_VmEDi1Pej1C4gHpfDiFnpC87Md82FK_qZe2B6J1olxCWnmQUQlWE                                       534-5.7.14 eIwqtsXjE3xia_Y-lJnGZu7uQeQ7L_4QYj452Xxllf6GjA9Pz-cJsanxzXl7NTqRKEhcGM                                       534-5.7.14 hTxqiKtVHXjFtkWZ_fGs5O960iNwk> Please log in via your web browser and                                       534-5.7.14 then try again.                                       534-5.7.14  Learn more at                                       534 5.7.14  https://support.google.com/mail/answer/78754 e102sm10342631lfi.25 - gsmtp 2016-11-26 12:44:17 SMTP Error: Could not authenticate. 2016-11-26 12:44:17 CLIENT -> SERVER: QUIT 2016-11-26 12:44:17 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting   I have no idea what to do. I ran spamcheck tests but they return somewhat a negative result (email is not classified as spam). Thanks for your help.


How do I increase number of open files with ulimit on Ubuntu 18.04?

When I try to ulimit -n 4097 or greater I get the following error:  bash: ulimit: open files: cannot modify limit: Operation not permitted   None of the solutions at  seem to work or apply.  I can raise the limit to 4096 but not beyond.  Output of ulimit -n -H 4096  Edit:  Problem solved:


explain the cost function of scalar vector machine (SVM)

I am unable to understand the above cost function. The two possible outputs ($y$) are $-1$ and $+1$. As far as i know, $x_i$ values are individual training example values, $y_i$ are actual true values for that example and w is the weights that we are adjusting so as to minimise the cost. if the actual output is $1$ and and my SVM predicts it as $-1$ my classifier is penalised, how will my SVM penalise? how much will be the penalty? I know this function gives cost 0 for that training example when prediction is correct and some penalty if predicted wrong. I am also confused how $\max(0,1-y(wx+b))$ outputs the cost for one training example. please enlighten me how this cost function works.


The existence of Delta baryons was experimentally proven?

If we will look at the  of their properties, we will find the same mass for all. That looks like a result of some calculation, rather then a result of measurement. Was that important particles really found?


I'm doing my CV with the template ModernCV Classic. I want to rotate my picture but the command used is \photo I don't know how to do that.  \documentclass[11pt,a4paper,sans]{moderncv}  \moderncvstyle{classic} \moderncvcolor{blue} \nopagenumbers{}  \usepackage[utf8]{inputenc}  \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[francais]{babel}  \usepackage[scale=0.75]{geometry}  \name{John}{Doe} \title{...} \address{adress}{Town}{Country}  \extrainfo{age, nationality} \phone[mobile]{54466145745} \email{john.doe@mail.com} \photo[80pt][0.4pt]{Photo.jpg} \quote{Objectifs: ...}


The image shown below is the output for plot(lm.fit) on the Boston dataset, where lm.fit=lm(medv~lstat) . Why are some of the points labelled in the plot ?


How to uninstall Windows 7 and install Ubuntu

I want to replace an old Windows 7 operating system on a 64 bit hp desktop with Ubuntu.    I have read the answers on this site. Not helping me.     My Windows 7 machine had a 12.04 Ubuntu OS running as a dual boot.    A few months ago, the boot to Ubuntu failed. I have downloaded an iso of the newest Ubuntu (16.04) and run through the "erase and install" option, the "LVM" option, and the "something else" option to install Ubuntu. Results have all been the same.      When I pull the DVD with the iso out and reboot the machine, the dual boot option is still there, the Ubuntu boot is still dead, and Windows 7 is still alive! With all my data!    I had backed all of the Windows data files to an external hard drive formatted NTFS. That drive has been installed through a USB port. Any ideas on how to get this done?


How can I run regular one-hour sessions of D&D?

I had an idea while talking to some co-workers today. I asked them if they'd be interested in starting a game that we could play during our lunch hours. My idea is that we'd spend at least one hour a week when we're all free and slowly play out our story before going back to work.  The only real question that came up was "How?" Personally, I'm okay with these kinda micro sessions, but the others have their doubts. So I'm wondering if anyone else has run a similar campaign; where you play in smaller bursts.  What's a good way to go about this? Is there a particular version that is more suited for this kind of gameplay?


Delete all files except in a certain subdirectory with find

I want to recursively delete all files not accessed in a while in folder a, except all files in the subfolder b.  find a \( -name b -prune \) -o -type f -delete   However, I get an error message:     find: The -delete action automatically turns on -depth, but -prune does   nothing when -depth is in effect.  If you want to carry on anyway,   just explicitly use the -depth option.   Adding -depth causes all files in b to be included, which must not happen.  Anyone know a safe way to make this work?


Why won't this ocelot do anything but breed?

I have several raw fish and have been trying to tame an ocelot. However, every time I get it to approach and feed it a fish, it simply wants to breed. I am playing on SMP, and have tried logging in/out to see if maybe the texture just didn't change, but it appears the ocelot is simply un-tamed. The  that this should tame the ocelot.  Is this a bug or a change? How can I tame this ocelot?    Here is a screenshot of my second attempt. This time, unlike last, clicking with the fish caused the ocelot to also flee. I am not sure if this is the same ocelot or not.


How to resolve "undefined reference" error while statically linking cppunit?

I am not sure why this question is marked as a duplicate of . That question and this question are two totally different questions.  I have installed libcppunit-dev with apt-get on my Debian system.  $ dpkg -l libcppunit-dev Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name                       Version            Architecture       Description +++-==========================-==================-==================-========================================================== ii  libcppunit-dev             1.13.2-2.1         amd64              Unit Testing Library for C++  $ dpkg -L libcppunit-dev | grep "libcppunit\." /usr/lib/x86_64-linux-gnu/libcppunit.a /usr/lib/x86_64-linux-gnu/libcppunit.so   I have written a simple test. Since my concern right now is only linking cppunit, I don't have a test runner yet. Ignore the lack of test runner for now. Here is my test.cpp:  #include <cppunit/extensions/HelperMacros.h> #include <iostream>  class FooTest : public CppUnit::TestFixture { protected:     void testFoo()     {         CPPUNIT_ASSERT_EQUAL(1 + 1, 2);     }  private:     CPPUNIT_TEST_SUITE(FooTest);     CPPUNIT_TEST(testFoo);     CPPUNIT_TEST_SUITE_END(); };  CPPUNIT_TEST_SUITE_REGISTRATION(FooTest);  int main() {     std::cout << "hello\n";     return 0; }   Dynamic linking works fine:  $ g++ -lcppunit test.cpp && ./a.out hello   Static linking fails:  $ g++ -l:libcppunit.a test.cpp /tmp/ccwMWIsX.o: In function `CppUnit::AdditionalMessage::~AdditionalMessage()': test.cpp:(.text._ZN7CppUnit17AdditionalMessageD2Ev[_ZN7CppUnit17AdditionalMessageD5Ev]+0x14): undefined reference to `CppUnit::Message::~Message()' /tmp/ccwMWIsX.o: In function `FooTest::testFoo()': test.cpp:(.text._ZN7FooTest7testFooEv[_ZN7FooTest7testFooEv]+0x70): undefined reference to `CppUnit::SourceLine::SourceLine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)' test.cpp:(.text._ZN7FooTest7testFooEv[_ZN7FooTest7testFooEv]+0xa5): undefined reference to `CppUnit::SourceLine::~SourceLine()' test.cpp:(.text._ZN7FooTest7testFooEv[_ZN7FooTest7testFooEv]+0xe9): undefined reference to `CppUnit::SourceLine::~SourceLine()' /tmp/ccwMWIsX.o: In function `FooTest::getTestNamer__()': test.cpp:(.text._ZN7FooTest14getTestNamer__Ev[_ZN7FooTest14getTestNamer__Ev]+0x41): undefined reference to `CppUnit::TestNamer::TestNamer(std::type_info const&)'   What can I do to ensure that static linking with cppunit succeeds?


Is $\log(n!) \in\Theta(n \log n)$?  I know it is $O(n \log n)$ because $\log(n!) \leq \log(n^n)$ which is the same as $\log(n!) \leq n \log n$.  But how can I show it is also $\Omega(n \log n)$?


I'm just starting out with LaTeX.  Would I be better off learning ConTeXt instead?  Which of the two is better for a beginner - assuming I do want to tweak the formatting occasionally?