I have found some implementation of the Enabled property for tabPages, since the implementation for it in the UI is hidden, but I do not know how to use it. It might strike as a stupid question, but I really just started with c# and the .net platform. I want to take a variable from the first form, which is a login form that sends a true value if one checkbox is checked or false if it's not, and if it is true, login as an admin that has the privillege to access all the tabs, but if it is false, a user will be restricted acces from some of the tabs. I do not know how to restrict access to these tabs, or allow it. The code is as follows:  Code for the constructor of the form:  public Form1() { InitializeComponent();  this.tabControl1.DrawMode =  TabDrawMode.OwnerDrawFixed; this.tabControl1.DrawItem +=  new DrawItemEventHandler(DisableTab_DrawItem); this.tabControl1.Selecting +=  new TabControlCancelEventHandler(DisableTab_Selecting); }   The function which draws the tab pages:  /// <summary> /// Draw a tab page based on whether it is disabled or enabled. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PageTab_DrawItem(object sender, DrawItemEventArgs e) { TabControl tabControl = sender as TabControl; TabPage tabPage = tabControl.TabPages[e.Index];  if (tabPage.Enabled == false) { using (SolidBrush brush =  new SolidBrush(SystemColors.GrayText)) { e.Graphics.DrawString(tabPage.Text, tabPage.Font, brush,  e.Bounds.X + 3, e.Bounds.Y + 3); } } else { using (SolidBrush brush = new SolidBrush(tabPage.ForeColor)) { e.Graphics.DrawString(tabPage.Text, tabPage.Font, brush,  e.Bounds.X + 3, e.Bounds.Y + 3); } } }   The event handler that prevents the tab from being selected if it is disabled:  /// <summary> /// Cancel the selecting event if the TabPage is disabled. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PageTab_Selecting(object sender, TabControlCancelEventArgs e) { if (e.TabPage.Enabled == false) { e.Cancel = true; } }   The said variable and the decisional statement:   int cont = Login.accountType; //the variable from the first tab, that decides whether the account is admin type or client type         //the variable is public static int in the first form          if (cont == 1)         {             //display all the tabs, because we logged in as admin         }         else if(cont == 0)         {             //disable the tabs that we do not want the client to access         }


I know what a "light year" means. However, I am very curious to know about the technique through which scientists are able to calculate the distance of various astronomical bodies from earth which are situated so far that it takes even light a huge amount to travel from there. I just want to know how they calculate distance ???

How do scientists measure the distance between objects in space? For example,  is 4.3 light years away.


Which of the following to use, especially in the context of programming:   hashtag well number pound sign

I used to say "sharp sign" to refer to the # sign.   Today a friend told me that the correct term is number sign or hash sign or even just hash.  What is the difference between these options and what's the correct usage of the names for this sign?


If I set my camera (canon 7d) to manual and the speedlight (600ex) to ETTL, shouldn’t the flash put out the necessary power to expose the image?

I got the Metz 44 AF-1 flash recently that is TTL capable for my Canon 550D, and have been reading around to get a better understanding of using flash on-camera (Neil Van Niekerk's  was particularly helpful in this regard). TTL seems to be a useful feature and seems to take care of flash power based on the exposure settings. From what I've read, TTL seems to provide fill flash when in the semi-automatic exposure modes (Av, Tv etc).  I was wondering how TTL works in the manual exposure mode, where we can choose to deviate from the camera meter reading for correct exposure - what exactly would TTL be doing in such a case?  The reason why I'm asking the question is that it seems flash photography involves some amount of trial & error if we want to control the lighting, and understanding the way TTL works in Manual Exposure mode would make the approach more methodical.  Note: It seems that Nikon & Canon differ in the way their flash systems & Manual exposure modes work - Canon allows only flash exposure compensation when in Manual exposure, while Nikon allows both Flash & regular exposure compensation.  Update: Found  that may be useful for metering purposes when going with E-TTL\E-TTL II on Canon -      There's never any "full-frame" flash metering in E-TTL or E-TTL II. In   both cases, with EOS cameras that use a 45-point focusing   system/21-zone metering sensor, all flash metering is carried out by   the 17 metering segments within the Area AF ellipse shown in the   viewfinder. Subject matter outside the ellipse is completely ignored   in terms of flash exposure control.


I recently had to build a model for flight delay predictions. The data has multiple columns of categorical variables and some continuous variables.  For example: Airline, Arriving airport, Temperature, etc.  My natural instinct of encoding the categorical variables was to one-hot encode them, but resulted >2000 distinct features. So I tried to reduce the dimensions by    Including airports, airlines that appear the most often Run random forest on the categorical features to extract important features   and fit a model like xgboost afterwards. The model's performance is ok, but not good enough to be shipped out.   I suspect the way I have reduced the dimensions is destroying the underlying relationship of the features. So I wonder, are there dimension reduction techniques that can handle mixture of continuous and categorical variables? And in general, what are some rule-of-thumb in situations like these?

What techniques are available for collapsing (or pooling) many categories to a few, for the purpose of using them as an input (predictor) in a statistical model?    Consider a variable like  (discipline chosen by an undergraduate student). It is unordered and categorical, but it can potentially have dozens of distinct levels. Let's say I want to use major as a predictor in a regression model.  Using these levels as-is for modeling leads to all sorts of issues because there are just so many. A lot of statistical precision would be thrown away to use them, and the results are hard to interpret. We're rarely interested in specific majors -- we're much more likely to be interested in broad categories (subgroups) of majors. But it isn't always clear how to divide up the levels into such higher-level categories, or even how many higher-level categories to use.  For typical data I would be happy to use factor analysis, matrix factorization, or a discrete latent modeling technique. But majors are mutually exclusive categories, so I'm hesitant to exploit their covariance for anything.  Furthermore I don't care about the major categories on their own. I care about producing higher-level categories that are coherent with respect to my regression outcome. In the binary outcome case, that suggests to me something like linear discriminant analysis (LDA) to generate higher-level categories that maximize discriminative performance. But LDA is a limited technique and that feels like dirty data dredging to me. Moreover any continuous solution will be hard to interpret.  Meanwhile something based on covariances, like multiple correspondence analysis (MCA), seems suspect to me in this case because of the inherent dependence among mutually exclusive dummy variables -- they're better suited for studying multiple categorical variables, rather than multiple categories of the same variable.  edit: to be clear, this is about collapsing categories (not selecting them), and the categories are predictors or independent variables. In hindsight, this problem seems like an appropriate time to "regularize 'em all and let God sort 'em out". Glad to see this question is interesting to so many people!


I am trying to add an additional argument into a constructor:  e.g. adding the argument 'y'  public Object(int x, int y) {   int x1;   int y1;   x1=x;   y1=y; }   the original constructor was  public Object(int x) {   int x1;   int y1;   x1=x;   y1=(default number); }     I know in Java, you could do something like this(x, 1) to set y to 1 if y is not given, but I think I read that constructors calling constructors doesn't work in C++?  Is there a way to initialize y when it's not given, i.e. making sure that (1) and (2) both work?  Object o1 = new Object (5);   // (1) Object o2 = new Object (5,3); // (2)

As a  developer I'm used to running through constructors:    class Test {     public Test() {         DoSomething();     }      public Test(int count) : this() {         DoSomethingWithCount(count);     }      public Test(int count, string name) : this(count) {         DoSomethingWithName(name);     } }   Is there a way to do this in C++?  I tried calling the Class name and using the 'this' keyword, but both fail.


When a charged particle gets accelerated it emits electromagnetic waves. In reality, when a charged particle gets accelerated the electric field around the charge remains unchanged, but the magnetic field changes. Here the energy provided to the particle - by the energy source accelerating it - gets divided into the energy contained in the increased magnetic field and EMWs radiated. But I don't understand the mechanism by which these EMWs are emitted. I have read that when a charged particle gets accelerated the electromagnetic field associated with it gets detached from it and this detached electromagnetic field is that we call electromagnetic waves.  So is it that, when the charged particle gets accelerated, some part of the magnetic field associated with it gets detached from it and simultaneously (but apart from the effect of the event described above) the magnetic field associated with the charged particle gets changed according to the amount of energy being supplied or being taken away by the external source accelerating the charge particle? Thus, in the entire process the electric field around the charge particle remains constant. Is it so?  If this is true, then do we have to assume that the magnetic field being detached itself and instantaneously gets converted into EMW of the corresponding energy? But then I get again the same question: By which mechanism?   Also I thought of an entirely different mechanism: When the charged particle gets accelerated some part of its electric field as well as some part of its magnetic field gets detached from the charged particle and that itself is the EMW. And simultaneously (but apart from the effect of the event described above) both the magnetic field & electric field associated with the charged particle gets changed according to the amount of energy being supplied or being taken away by the external source accelerating the charge particle? But here is one more problem: If we are assuming that the electric field is decaying into the EMWs, we will have to consider the contribution of the externally accelerating source to increase the electric field of the charge particle regardless the charge is being accelerated or decelerated. As far as I think, this cannot be done directly. We should assume the contribution of the external source to increase the magnetic field associated with the charge and its instantaneous conversion into electric field. Now again, same question: By which mechanism? So overall I have complete unclarity about the mechanism of the production of EMWs when a charge particle gets accelerated.

Let's consider it case by case:  Case 1: Charged particle is at rest. It has an electric field around it. No problem. That is its property.  Case 2: Charged particle started moving (it's accelerating). We were told that it starts radiating EM radiation. Why? What happened to it? What made it do this?  Follow up question: Suppose a charged particle is placed in uniform electric field. It accelerates because of electric force it experiences. Then work done by the electric field should not be equal to change in its kinetic energy, right? It should be equal to change in K.E + energy it has radiated in the form of EM Waves. But then, why don't we take energy radiated into consideration when solving problems? (I'm tutoring grade 12 students. I never encountered a problem in which energy radiated is considered.)


It's my first question in the community, i apologize in advance if I write something wrong I developed an application in Python (Django) and in the quality environment I am using gunicorn to provide the deploy: gunicorn --bind 0.0.0.0:8000 application.wsgi --daemon On the same server, I use Apache to listen to port 443 (https://) and redirect requests to Gunicorn via Proxy like this:   <VirtualHost *:443>            ServerName example.com             ProxyRequests Off         ProxyPreserveHost On                  <Proxy *>                 Require all granted                 Allow from all         </Proxy>          ProxyPass / http://example.com:8000/         ProxyPassReverse / http://example.com:8000/          # SSL         SSLEngine On          ErrorLog ${APACHE_LOG_DIR}/error.log         CustomLog ${APACHE_LOG_DIR}/access.log combined          #Include conf-available         SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem         SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem         Include /etc/letsencrypt/options-ssl-apache.conf  </VirtualHost>  Everything works perfectly, I can access it via https, except for the static files. I followed the recommendation of the documentation, executed the command collectstatic and the files were generated in the folder I configured (/static) in settings.py STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static/')   I took advantage of the fact that I already had Apache installed, I tried to add in the same VirtualHost an alias to the /static directory, like this: Alias /static "/home/ubuntu/example/static/" <Directory "/home/ubuntu/example/static">       Order allow,deny         Allow from all       Require all granted </Directory>  The complete configuration of VirtualHost looks like this:  <VirtualHost *:443>            ServerName example.com            Alias /static "/home/ubuntu/example/static/"         <Directory "/home/ubuntu/example/static">               Order allow,deny                 Allow from all               Require all granted         </Directory>          ProxyRequests Off         ProxyPreserveHost On                  <Proxy *>                 Require all granted                 Allow from all         </Proxy>          ProxyPass / http://example.com:8000/         ProxyPassReverse / http://example.com:8000/          # SSL         SSLEngine On          ErrorLog ${APACHE_LOG_DIR}/error.log         CustomLog ${APACHE_LOG_DIR}/access.log combined          #Include conf-available         SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem         SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem         Include /etc/letsencrypt/options-ssl-apache.conf  </VirtualHost>  However when trying to access the files in this directory I always get one:  Not Found - The requested resource was not found on this server.  I analyzed error.log and access.log and didn't even hit the request in the logs. Adding the same alias to another Virtualhost on Port 80, it works normally. I believe the problem lies in adding this alias to a specific VirtualHost for port 443 Can you help me?

I am trying to set a Apache reverse proxy so that requests get proxyed to another application running on 8080. However, I want some directories to be directly served rather than forwarded to proxy. What I want is:   -> http:// localhost:8080/myapp http:// localhost/images -> /var/www/html/images http:// localhost/anything-else -> http:// localhost:8080/myapp/anyhthing-else  My current httpd.conf is   ProxyRequests Off ProxyTimeout 600 ProxyPreserveHost On ProxyPass / http:// localhost:8080/ ProxyPassReverse / http:// localhost:8080/ RewriteEngine On RewriteRule ^/(.*) http:// localhost:8080/VirtualHostBase/http/%{SERVER_NAME}:80/myapp/VirtualHostRoot/$1 [L,P]   What configuration should I do to make the local path exception to work?  Thank you, Tania


16 gb pendrive show few mb only how to fix it The disk is write protected error whileformatting the pendrives, memory sticks,external hard drive or SD Memory Card.

I have a USB flash drive which is no longer recognized by my computer. Windows Disk Management and DiskPart report No Media with no storage space (0 bytes) on the drive and I cannot partition or format the drive:     If the drive appears in Windows Explorer, trying to access it returns an error message indicating that there is no disk inserted, such as the following:     Please insert a disk into drive X:.   Various disk partitioning and data recovery utilities don't recognize the drive or only give a generic name for the drive and cannot access the contents of the drive.  What can I do? How do I recover data from the drive?     This question comes up often and the answers are usually the same. This post is meant to provide a definitive, canonical answer for this problem. Feel free to edit the answer to add additional details.


I have a formula in List settings-> validation settings. The formula validates correctly and is working. The user message I entered does not display, it displays its own message, which is Error: The validation formula has evaluated to an error. How can I show my own User message below? see a screenshot. Thankyou, Tony.

I have a formula in List settings-> validation settings. The formula validates correctly. The user message  I entered does not display, it displays its own message below which is  Error: The validation formula has evaluated to an error.  How can I show my User message? See a screenshot below:


I was trying to copy a bug reference number from an email into a comment on a question, but it would not appear after tapping Paste. I tried copying several times, to no avail.    App Version: 1.6.6.2 Device: iPhone 7 Plus OS Version: Version 11.0 (Build 15A372)

I’m able to copy-paste from any application to any application. I’m able to copy from a comment or from a question or from an answer. I’m able to paste to a question or answer. However, if I attempt to paste into a comment, nothing happens. I am able to subsequently paste into another application, confirming that the text is actually on the clipboard.   However, copying SE links will paste them successfully, but all other text - including other links - still fails. This leads me to believe that it’s a SE issue and not an Apple one.   This has been an issue since 11.0 beta and persists through iOS 13 release.


Problem  I am working on a problem to find all triangles whose sides are $a,b,c\in \mathbb{Q}$,and its area $S=1$  My attempt   By using Heron’s fomula,  $$ S=\sqrt{\frac{(a+b+c)(a+b-c)(a-b+c)(-a+b+c)}{16}}\\=1$$  and  $$x+y> z \mbox{, for} \left\{x,y,z\right\}=\left\{a,b,c\right\}.$$  Then,to deal with the complex latter condition, I made the following transformation$$\begin{align} &x=-a+b+c\\ &y=a-b+c\\ &z=a+b-c \end{align}$$so that $x+y+z=a+b+c.$  Now,$$S=1\\ \Leftrightarrow xyz(x+y+z)=16\\ \mbox{which } x,y,z>0  \mbox{ and } x,y,z\in \mathbb{Q}$$ The equation is simple. However, I don’t know how to cope with the condition that $x\, y\,z$ are all positive rational numbers.It seems hard to deform.  I have known that $(\frac{3}{2},\frac{5}{3},\frac{17}{6})$ is a solution to the problem and there are more. But I don’t know how these numbers are calculated. I am puzzled by these figures.

A side-rational triangle stands for a triangle with each side rational.   We know, by cosine theorem and computing the area of the triangle, we can get that each angle of the triangle is of rational $\sin$ and $\cos$. Then consider ant height of one side, we have  $$S=h(h\cot \alpha+h\cot \beta)/2$$ Then it suffices to show that  $$t-\frac{1}{t}+T-\frac{1}{T}\notin \mathbb{Q}^2\quad t,T\in \mathbb{Q}$$ But i am stuck on it.


I want to extract the IP address from the following String:  106.220.155.36 - - [29/Sep/2015:09:51:52 -0400] "GET /tutorial/grammar/LL/images/llparsetable.png HTTP/1.1" 200 14284  To do this, I decided to read the string one character at a time. I tried the following code:  public static String uniqueIP(String line){         String IP = "";          while(line.next() != " "){             IP = IP + line.next();         }         return IP;     }   However, the next method doesn't work. Is there some other method I can use?

StringTokenizer? Convert the String to a char[] and iterate over that? Something else?


I propose the ability to search across all sites from the Feed page on the app.  Sometimes I have an off the wall question, but I am not sure which site I would find the information on, or even if there is a site. It is sometimes painful to go searching though the sites when I am not sure what I am looking for. For example, "What would happen to time if our Gravity was greater?". (Not a lot of thought put into this example question.) Do I search in Physics? World building? Or perhaps the answer is in the movie site with an Interstellar reference.  Maybe the answer is in a site I haven't heard of.  I am not sure how painful this feature would be to add, and it may not be feasible. But I think it would be awesome and useful.

Is it possible to search for a question across all Stack Exchange sites in the Android app?   Right now I can search in only one specific site at a time.   If not, can you add that feature?


For if I wanted to make a higher order function that filters even numbers out of a list using the predefined filter function I can do it like this:  filtereven list = filter even list   but another thing that still works is:  filtereven = filter even   why does this work and how does it know that it should expect an input list?

I've seen references to curried functions in several articles and blogs but I can't find a good explanation (or at least one that makes sense!)


I have gone through similar topics and I think my case is not a duplicate.  Some 3 years ago, I had purchased a key for Windows 7 Professional from MSDN subscription. It worked fine and I've been getting Windows updates as necessary.  Now my system has become so slow that I'm thinking of re-installing Windows. I have the key with which I had activated Windows at that time. But I've been having a hard time trying to get an ISO.  I came across  but as expected, my product key was found to be invalid there.  Does that mean I can never re-install my Windows and continue with my same product key ever? Is there is no provision for OEM/MSDN licenses?

I just bought a serial for Windows 7 on-line from the Microsoft store (the most painful shopping experience EVER!). I selected that I wanted to download my version of Windows 7 after purchase. After payment, I have listed a Product Key but no download link in sight.   Where do I download my Windows 7 ISO to burn to disk?  Note: I'm not a Technet or MSDN subscriber.


So the full problem is  Prove that between every two rational numbers $a/b$ and $c/d$ that:  There is a rational number There are an infinite number of rational numbers   I am having some trouble on which approach I should use, but I tried to solve part 1. Part 1) So I believe I proved that between every two rational numbers $a/b$ and $c/d$ that there is a rational number I have my base case as $a,b,c,d$ all being integers. My solution: For some number $x$, $$ x = \frac{\dfrac a b + \dfrac c d}{2} = \frac{ \dfrac{ad}{bd} + \dfrac{cb}{bd}} 2 = \frac{ \dfrac{ad + cb}{bd} } 2 = \frac{ad + cb}{2bd} $$ I concluded that ad + cb must be an integers because addition/subtraction of integers leads to an integer. Same case for $2db$. Not sure if this is correct though Part 2) Prove that there are an infinite number of rational numbers I am confused onto how to solve this part, where to start, and how to use the answer from part 1 into this problem. I've been toiling over this, so your input is greatly appreciated. :)

Suppose $i_1$ and $i_2$ are distinct irrational numbers with $i_1 < i_2$.  Is it necessarily the case that there is a rational number $r$ in the interval $[i_1, i_2]$?  How would you construct such a rational number?  [I posted this only so that the useful answers at  could be merged here before that question was deleted.]


I want to prove that $f(x)=e^x$ is not uniformly continuous on $\mathbb R$.  I tried to show that all $\mathcal C^1(\mathbb R)$ function that has no bounded derivative is not uniformly continuous.  Suppose by contradiction it is. There there is $\delta >0$ s.t. $|f(x)-f(y)|<\varepsilon $ when $|x-y|<\delta $. Then, how to continue ?

It seems intuitively very clear that $e^{x}$ is not uniformly continuous on $\mathbb{R}$. I'm looking to 'prove' it using $\epsilon$-$\delta$ analysis though. I reason as follows:  Suppose $\epsilon > 0$; in fact, fix it to be $\epsilon=1$.   For contradiction, suppose that $\exists \delta >0$ s.t. $$ (\star) \ |x-y|<\delta \Rightarrow |e^{x}-e^{y}|<\epsilon=1 \text{  for  } x,y \in \mathbb{R}.$$ Note that $e^{x+\delta}-e^{x}=e^{x}(e^{\delta}-1)$. So, for $x$ large enough (so that RHS $>1$), the relation $(\star)$ does not hold.  This is our contradiction, and so the exponential function is not uniformly continuous on $\mathbb{R}$.  Is this reasoning correct and sufficient?  Thanks.


I started up installing Linux from USB, and try to install Ubuntu 18.04 LTS alongside Windows 10.  My laptop has 2 hard disks(128GB SSD Windows 10 pre-installed and 1TB HDD). First time when I wanted to install Ubuntu,I selected SSD(sda) for bootloader, installer says I can't use it.  When I select sdb(1TB HDD) for bootloader and root and /home(ext4)(and one time I added swap area partition), I put 250 MB for EFI. Ubuntu has been installed and when I restart it after installation, a black page showed to me and after 15 minutes, I restart again and after selecting Ubuntu from grub menu, OS doesn't startup and giving me this picture instead:      (disabled secureboot)

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


I just recently installed Ubuntu Server 16.04 LTS on VMware Workstation for a school project. OS installed beautifully; however, when I try to install SNMP on it, I am getting this message:  Media change: please insert the disc labeled 'Ubuntu-xxx 16.04 LTS _Xenial Xerus_ - Release amd 64 (20160420.3)' in the drive '/media/cdrom/' and press [Enter]"    I have tried running an update, re-installing Ubuntu, but still nothing.   I have a x64-big Intel Celeron processor on my PC but according to documentation, the image should be compatible. I did install from a USB-stick though. Could that be the reason why? Any advice would be greatly appreciated. Thanks in advance.

When I type sudo apt-get install rails I get the message:  media change: please insert the disc labeled 'Ubuntu 12.04.3 LTS _Precise Pangolin_ - Release amd64 (20130820.1) in the drive '/media/cdrom/' and press enter   I am new to Linux and I have the installation CD in the drive, but I have no idea what disc it is asking for and I'm not sure what /media/cdrom/ means. All I have is the installation CD and it is in the only optical drive I have.


Instead of removing the popcorn ceiling I decided to just put a layer of drywall on top of the existing popcorn ceiling. I noticed the worker used the caulking instead of taping where the old and the new drywall meets. Is this okay?

My contractor told me it's much cleaner to use caulking instead of mud/tape on my new ceiling. He's not talking about the corners. He's talking about where the seam of the drywall sheets meet. I've never heard of this method. Is this acceptable?


Winter Bash 2014 was fun, especially the "secret hat" concept.  However, by the time I found out about it, all the secret hats were not 'secret' anymore. I don't mean that revealing secret hats is a bad idea, but it was a bit annoying. I have the following questions (which I hope would relevant in next year's event)   Suppose I get a secret hat and I have a pretty good guess about how I got it. Is there anywhere I can state this to the SE officials to get a "Eureka!" hat, without revealing it publicly, so that others can also try guessing the secret? I have quite a few ideas for the secret hats for next year. I suppose others have, too. Maybe SE could create some place where you can send such suggestions, and they could use the best ones. Shouldn't next year have more hats, secret ones especially, to make it more difficult to get all the hats? Do the hats have anything to do with the badges? "Winter Bash" wouldn't be that appropriate in places like Australia, maybe something like "Christmas Bash" or "New Year Bash" would have been better. I suppose it's too late to change it, though.

we had a question like this, and  SE  members have supported one this year, and nobody seems to have made one yet.  Hence:  What does everybody want for next year's Winter Bash? It's okay to repost old ideas that have already come up if you feel they haven't had enough attention (but please don't go just copy/pasting every  !).  A few ideas I can think of off the top of my head:   Moar hats! There's been plenty of time to get all the hats this year; it would be great if next year there'd be more to do. Keep secret hats secret-er. This could be pretty hard to do, but possibly by deleting/locking "how do I get secret hats" posts?   One idea per answer, please!


What is the condition for ({$n\alpha$},{$n\beta$}) being dense in [0,1]$\times$[0,1]? (Here {a} represents the fraction part of a). If the qustion changes to ({$n\alpha$},{$m\beta$}), then it is fairly easy: $\alpha$ and $\beta$ are irrationals. However, if the question is ({$n\alpha$},{$n\beta$}), it seems quite complex. For instance, if $\alpha$ and $\beta$ are both irrational but they are equal, then ({$n\alpha$},{$n\beta$}) lies on y=x, so it's not dense. I guess the condition is that $\alpha$ and $\beta$ are irrational while their division is also irrational. But I've got no idea about how to prove\disaprove my conjecture.

I know that the set of points of the form $(e^{2\pi i t},e^{2\pi i a t })$ where $t \in \mathbb{R}$ is dense in the torus $S^1 \times S^1$ when $a \in \mathbb{R}$ is irrational. (This problem is asked .)  I also know that the set of points of the form $e^{2\pi i a n}$ where $n \in \mathbb{Z}$ is dense in $S^1$, when $a$ is irrational. (This problem is asked .)  I believe it is true that the set of points of the form $$ (e^{2\pi i an},e^{2\pi i b n }) $$ is also dense in the torus, where $n \in \mathbb{Z}$ and $a,b$ are irrationals such that $a/b$ is also irrational. But I am unable to show this, and would appreciate any hint on how to proceed.    I tried viewing the torus as the unit square $[0,1] \times [0,1]$ with edges identified appropriately. So, I need to show that the set of points $$(an \pmod 1, bn \pmod 1)$$ is dense in the unit square.  In showing that the line $(e^{2\pi i t},e^{2\pi i a t })$ is dense in the torus, it suffices to show that it intersects every ball with centre on the vertical edge $\{ 0 \} \times [0,1]$. However, to apply the same idea here, I need to find an integer $n$ such that $an \pmod 1$ and $bn \pmod 1$ are both arbitrarily close to $0$.  I can find integers $n_1$ and $n_2$ such that $an_1 \pmod 1$ and $bn_2 \pmod 1$ are both arbitrarily close to $0$, by the same argument used to show that $e^{2 \pi i a n}$ is dense in $S^1$. But I'm unable to arrive at a single integer that does the job for $a$ and $b$ simultaneously.  I'm possibly missing only some small idea. Can anyone help me?


I want to make mist easily. Can someone teach me? I use a MAC and I use Blender 2.79b, making a MineCraft scene. Oh, I'm also a noob.

I already tried several ways to create Mist in Blender, but it never worked 100%. I use Blender 2.78 and I want to create Mist like in this scene here.  What are the exact steps?     Here is what I have tried so far:  I already tried this:  but it simply did not work .. I dont know why.  (EDIT: I managed to fix it: Check out this graphic:   Until now I already used objects successfully as Mist-creators (Volume Scatter under Volume Material). The bad thing about using Objects as Mist-creator is that they dont have an endless mist range + the mist can not be bright. Normally it appears grayish result is bad..  Check it out  Please help


How can I display the remaining battery power as a percentage on an iPod Touch 5.

How do I get the battery percentage on the top right of my screen please help I tried many other things but didn't work


Let a, b, c ∈ N such that (a, b) = 1 and a | bc. Prove that a | c.  I'm a little confused about if I'm doing this proof right.  I know that $\exists  p, q \in \mathbb{Z}$. Such that $pa = bc$ and $qa=c$. Re-arranging the first equation.  $$a = \frac{bc}{p} $$  Substituting this into the second equation.  $$ qa = c$$ $$ q(\frac{bc}{p}) = c$$ $$ \frac{qb}{p} c =c $$ $$ \frac{qb}{p} c =c $$  Thus this equation divides c. Therefore a | c. Does this proof make sense.  Thank you for any guidance.

Well I thought this is obvious. since $\gcd(a,b)=1$,  then we have that $a\not\mid b$ AND $a\mid bc$. This implies that $a$ divides $c$. But apparently this is wrong. Help explain why this way is wrong please.   The question tells you give me two relatively prime numbers $a$ and $b$ such that $a$ divides the product $bc$, prove that $a$ divides $c$. how is this not obvious? Explain to me how my "proof" is not correct.


A coherent source is a source which produces waves of constant frequency which does not change with time. In other words, it produces waves with constant phase difference which does not fluctuate. But my textbook says that ordinary sources of light are not coherent sources. But why? Here is the explanation from my textbook : "In an ordinary source, light is emitted by atoms in discrete steps. An atom after emitting a short light pulse becomes inactive for some time. It again gains energy by some interaction, becomes active and emits another pulse of light. Thus, at a particular time a particular group of atoms is active and the rest are inactive. The active time is of the order of $10^{-8}s$ and during this period, a wavetrain of several meters is emitted. We can picture the light coming from an ordinary source as a collection of several wavetrains, each several meters long and having no fixed phase relation with each other. Such a source is incoherent in itself. Different wavetrains are emitted by different groups of atoms and these groups act independently of each other, hence the phase varies randomly from train to train. If two lamps are substituted in place of the slits $S_{1}$ and $S_{2}$ in a Young's interference experiment, no fringe will be seen. This is because each source keeps on changing its phase randomly and hence, the phase difference between the two sources also changes randomly. That is why, a narrow aperture $S_{0}$, is used to select a particular wavetrain which is incident on the two slits together. This ensures that the initial phase difference of the wavelets originating from $S_{1}$ and $S_{2}$ does not change with time. When a new wavetrain is emitted by the lamp, the phase is randomly changed but that change is simultaneously communicated to both $S_{1}$ and $S_{2}$ the phase difference remains unchanged. In order to obtain a fairly distinct interference pattern, the path difference between the two waves originating from coherent sources should be kept small. This is so because the wavetrains are finite in length and hence with large difference in path, the waves do not overlap at the same instant in the same region of space. The second wavetrain arrives well after the first train has already passed and hence, no interference takes place. In practice, the path difference should not exceed a few centimeters to observe a good interference pattern. Because of the incoherent nature of the basic process of light emission in ordinary sources, these sources cannot emit highly monochromatic light. A strictly monochromatic light, having a well-defined single frequency or wavelength, must be a sine wave which has an infinite extension. A wavetrain of finite length may be described by the superposition of a number of sine waves of different wavelengths. Thus, the light emitted by an ordinary source always has a spread in wavelength." I did not understand the analogy of 'wavetrains'. Someone please explain why an ordinary source of light is incoherent in itself. I am so confused. Please help.

I've tried to search for this answer but found no proper explanation.  My previous ideas were...  1) It is not a point source, so the different points on a filament lamp may cancel out the light from other points on a filament lamp  2) It emits light rays at random (even though I've read this, I don't exactly understand what it means. Does it mean a single point on the filament may emit a photon one second and then the next second not emit anything?)  Are these reasons along the right lines? Could someone give a proper explanation as to why a filament lamp is an incoherent light source?


What is the default font in Ubuntu?  Could someone tell me please?

I was wondering what fonts are used in Ubuntu 11.10 and are they open source? The fonts used in Ubuntu have very cute Armenian character support, that's why I would like to know them, so I can install them on my Symbian smartphone whose fonts do not have Armenian character supprt.  EDIT: I would love to get additional information. In Firefox web browser the Armenian characters are displayed properly, and I would to know exactly which one of the fonts is the one used in Firefox as there are a lot of fonts in the downloaded archive. –


I am reading a Java book and bit confused how new behave when used with String.  Let say I have a statement  String example=new String("Hello");   The book(SCJP 6 by Kathy Sierra and Bert Bates page 434) two objects will be created.  My question will "Hello" be placed in string pool and also  what will happen if i have a below statement   String s="Hello"; String example=new String("Hello");   In this case when 1 is executed Hello will be there in string pool ,what will happen when 2 statement is executed.  While searching through the internet i read that when we use intern method then only string literal are placed in string pool when we use new keyword for creating string object.  Thanks in advance.

I'm a C++ guy learning Java. I'm reading Effective Java and something confused me. It says never to write code like this:  String s = new String("silly");   Because it creates unnecessary String objects. But instead it should be written like this:  String s = "No longer silly";   Ok fine so far...However, given this class:  public final class CaseInsensitiveString {     private String s;     public CaseInsensitiveString(String s) {         if (s == null) {             throw new NullPointerException();         }         this.s = s;     }     :     : }  CaseInsensitiveString cis = new CaseInsensitiveString("Polish"); String s = "polish";    Why is the first statement ok? Shouldn't it be   CaseInsensitiveString cis = "Polish"; How do I make CaseInsensitiveString behave like String so the above statement is OK (with and without extending String)? What is it about String that makes it OK to just be able to pass it a literal like that? From my understanding there is no "copy constructor" concept in Java?


I am starting on planning out a computer. I want to be able to expand the RAM and video cards without replacing the PSU, and I'm not sure if it's safe to get a PSU that provides 750W for a system that'll only require maybe 500W at first. Thanks, all!

Will a 500W SMPS consume more electricity than a 250W SMPS if they are powering computer with same specifications ? Or is the SMPS  designed in such a way that it only draws the required power form the grid ?


How can I check is  of given parameter ?  public static void main(String[] args) {     if (isPrimitive("test")) {         System.out.println("True");     }     if (isPrimitive(1)) {         System.out.println("True");     } }  public static boolean isPrimitive(Object o) {     // Here what would I do ? }

I have an Object[] array, and I am trying to find the ones that are primitives. I've tried to use Class.isPrimitive(), but it seems I'm doing something wrong:  int i = 3; Object o = i;  System.out.println(o.getClass().getName() + ", " +                    o.getClass().isPrimitive());   prints java.lang.Integer, false.  Is there a right way or some alternative?


I have converted a .dwg to a .shp using the CAD2SHP app. I made sure that there would not be a .prj file when I did the conversion. Defined projection once I opened up the file in Arc as a .shp. Then I bought in another .shp, with the same GCS and PCS. I don't see any differences between the two, and yet they will not line up.  Arc has not shown me any errors in the process of  converting or projecting any of the data.   The only clue I can provide is that they have different coordinate values, one in the thousands and the other in the millions. In full extent they appear quite far apart.  Any insight - or a link to someone with a similar issue.

I put 4 different layers into my ArcMap document, but only one of them will show up on the map! I should be seeing the other 3 layers as well. When I do a Zoom to layer, I can see one layer, but I cannot figure out how to make the other 3 show up at once on top of each other.  Before I opened ArcMap, I used ArcCatalog where I right-clicked 3/4 of the shapefiles and  clicked Properties → Coordinate system → Import and then clicked on my Trees layer, which has the coordinate system I want the other 3 to have. But when I opened ArcMap the 4 layers did not overlap, nor could I move them above or below each other.


I was searching for transcripts in a chatroom when I noticed this. The notifications in the FH circle have wrong icons. They're actually SO, MSE and Information Security, but the icon looks like Meta Cross Validated, Cross Validated and SF Meta.  Page refreshed, browser cache cleared, still same.  They look rather OK on any Q&A sites.

I see the same problem has occurred in the past, the most-linked one being   Is this happening for anyone else?   I've marked the icons I could recognize as incorrect.  This exists on every page, is on both chrome and firefox (from Ubuntu 16.04), and persists after hard-refreshes in each.  Edit: The icons in Meta's Hot Network Questions tab appear to be consistently accurate. Every other page I checked (including Unix, Workplace, English Language & Usage, Money, and Sci-fi) have a handful of incorrect ones, even for some of the same questions that are displayed correctly in Meta.  Further note: if it matters, the icons are also incorrect in the drop down community-search feature on the right end of the header. Again, they appear correct on this Meta page, and incorrect on all other pages I've checked. Some of the ones that are consistently incorrect:   computational science constructed languages movies and TV raspberri pi rpg russian language science fiction and fantasy sitecore skeptics super user latex workplace   That distribution seems skewed, but I may just be disproportionately familiar with the sites at the end of the alphabet. Many others could be wrong, those are just the ones I could recognize.    Last edit: apparently my Google skills were lacking -  was asked an hour prior.


Let me begin by saying that yes, I am trying to unscrew the pedal in the correct direction. It is the right side pedal, I am attempting to turn it counter-clockwise.   So here are the :    Now, they look like they have a nice textured part that you can grip when installing or removing them. Unfortunately, that is not the case. That knobby part is actually part of the pedal. It rotates with the pedal itself.  The threaded portion of the pedal that screws into the crank is completely smooth. As in baby smooth. There's nothing for a wrench to grip. I have a pair of pliers that are just a tiny bit too wide. I'm going to see if I can find a narrower pair.   The first pedal came off easily. It just unscrewed. This one seems a bit more "stuck". Other than getting a smaller pair of pliers, are there any good tricks to removing pedals like these?

I bought a pair of bicycle pedals that to my surprise had no notches on the pedal spindle to use when tightening them. I managed to screw them in by hand, but they are not quite tight since I can't use a spanner on them. So what would be the correct way to tighten them? Are there any special tools or similar that I'm supposed to use?  The offending pedals can be seen below. The spindle is, as you can see, completely smooth.


data example : variable a{1, 0, 1, 0, 1, 0, 1, 0}                variable b{0, 1, 0, 1, 0, 1, 0, 1}  can I use spearman method for this analysis?

There are two Boolean vectors, which contain 0 and 1 only. If I calculate the Pearson or Spearman correlation, are they meaningful or reasonable?


I have an executable which creates either file1 or file2 along with other files. I am trying to write a shell script which should output the latest created file. If the executable creates file1, the output should be file1. Please note that I already have both file1 and file2 exists in the directory along with other files. The executable overwrites it. If there are no file1/file2 exist, below script works but this doesn't work if both file1 and file2 exists.   if [ -e "file1" ]; then    output="file1" else    output="file2" fi

Whilst monitoring logging I have to go to my log files, order by written date, so I can then see the name of the log file for the most-recent execution of my application.  Is there any way, given a directory and sub-string, to return the name of the file containing that sub-string, which was most-recently written to?  So if I had  AFile1.log (last written 9am) AFile2.log (last written 10am)   and I wanted to return the most recent log containing the file name "AFile", it'd return AFile2.log?


I'm using HTACCESS to force all my pages to redirect to the HTTPS version. However the home page is still able to go to the HTTP version.   I tried 2 examples from this post:   And they work, but not for my home page as I mentioned. HTTPS is redirecting everywhere except the home page.   RewriteCond %{HTTPS} !on RewriteCond %{HTTP_HOST} ^www\.yourdomainhere\.com* RewriteRule ^(.*)$ https://www.yourdomainhere.com/ [L,R=301]   And  RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]   Edit: When I go to the HTTP version of the home page, any time I click a link it redirects to the HTTPS home page instead of the respective link. After that once on the HTTPS home page all links work correctly.

In Drupal 7, I used the Secure login module to run the site on a secure connection, but it seems it doesn't revert back to http on logout. I would like to just run the whole site as https:// as a simplification.  Is there a simple way to do this without the use of module?


I have Ubuntu 12.04 installed onto my dual-boot system; how can I uninstall it?    Which partition(s) should I delete? As you can see, I have two used/Full up 'Other' partitions and one ext4 partition. The two other partitions have the partition id: (0x82) and the ext4 partition has: (0x83).  How can I safely uninstall Ubuntu, without screwing up the bootloader) (I found a program somewhere which can fix the Windows bootloader but forgot the name)

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


My purpose is to define ajax method callback with jquery.  all DOM of parent div are loaded dynamically i have define delete button foreach comments and i want to get confirmation from twitter bootrap modal befor throw the ajax request :        this.deleteComment = function () {          self = this;          $("button[name='deleteComment']").each(function (index, el) {              $(this).unbind().bind('click', function (event) {                  event.preventDefault();                  var ref = $(this).attr('data-ref');                  var callback = function () {                      /*$.ajax({                         url: '/path/to/file',                         type: 'DELETE',                         data: {param1: 'value1'},                       })                       .done(function() {                         console.log("success");                       })                       .fail(function() {                         console.log("error");                        });*/                      alert("multiple");                  }                  self.confirm("Delete Comment ", "Are you sure you want \                    to delete this Comment ?", callback);              });          });      }       this.confirm = function(head, question, callback) {             $(".modal-title").html(head);             var body = $("<p/>").text(question);             $(".modal-body").html(body);             $("#deleteModal").click(function(event) {                 callback();                 $('.customModal').modal('hide');             });             $('.customModal').modal('show');     }

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


Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


Let $k_1, k_2, k_3,\dots ,k_n$ be positive divisors of $m$ and $n$. Can you prove or disprove the following $$\varphi (k_1) + \varphi (k_2)+\varphi (k_3) +\dots+\varphi (k_n)=\gcd(m, n).$$

Show $\sum\limits_{d|n}\phi(d) = n$.   Example : $\sum\limits_{d|4}\phi(d) = \phi(1) + \phi(2) + \phi(4) = 1 + 1 + 2 = 4$  I was told this has a simple proof. Problem is, I can not think of a way to show this in a very simple and straightforward way.


There's this side project I'm working on where I need to structure a solution to the following problem.  I have two groups of people (clients). Group "A" intends to buy and group "B" intends to sell a determined product "X".   The product has a series of attributes x_i and my objective is to facilitate the transaction between "A" e "B" by matching their preferences. The main idea is to point out to each member of "A" a corresponding in "B" who’s product better suits his needs, and vice versa.   Some complicating aspects of the problem:   The list of attributes is not finite. The buyer might be interested in a very particular characteristic or some kind of design which is rare among the population and I can’t predict. Can’t previously list all the attributes; Attributes might be continuous, binary or non-quantifiable (ex: price, functionality, design).   Any suggestion on how to approach this problem and solve it in an automated way? The idea is to really think out of the box here so feel free to "go wild" on your suggestions.   I would also appreciate some references to other similar problems if possible.

There's this side project I'm working on where I need to structure a solution to the following problem.  I have two groups of people (clients). Group A intends to buy and group B intends to sell a determined product X. The product has a series of attributes x_i, and my objective is to facilitate the transaction between A and B by matching their preferences. The main idea is to point out to each member of A a corresponding in B whose product better suits his needs, and vice versa.  Some complicating aspects of the problem:   The list of attributes is not finite. The buyer might be interested in a very particular characteristic or some kind of design, which is rare among the population and I can't predict. Can't previously list all the attributes; Attributes might be continuous, binary, or non-quantifiable (ex: price, functionality, design);   Any suggestion on how to approach this problem and solve it in an automated way?  I would also appreciate some references to other similar problems if possible.    Great suggestions! Many similarities in to the way I'm thinking of approaching the problem.  The main issue on mapping the attributes is that the level of detail to which the product should be described depends on each buyers. Let’s take an example of a car. The product “car” has lots and lots of attributes that range from its performance, mechanical structure, price etc.  Suppose I just want a cheap car, or an electric car. Ok, that's easy to map because they represent main features of this product. But let’s say, for instance, that I want a car with Dual-Clutch transmission or Xenon headlights. Well there might be many cars on the data base with this attributes but I wouldn't ask the seller to fill in this level of detail to their product prior to the information that there is someone looking them. Such a procedure would require every seller fill a complex, very detailed, form just try to sell his car on the platform. Just wouldn't work.  But still, my challenge is to try to be as detailed as necessary in the search to make a good match. So the way I'm thinking is mapping main aspects of the product, those that are probably relevant to everyone, to narrow down de group of potential sellers.  Next step would be a “refined search”. In order to avoid creating a too detailed form I could ask buyers and sellers to write a free text of their specification. And then use some word matching algorithm to find possible matches. Although I understand that this is not a proper solution to the problem because the seller cannot “guess” what the buyer needs. But might get me close.    The weighting criteria suggested is great. It allows me to quantify the level to which the seller matches the buyer’s needs. The scaling part might be a problem though, because the importance of each attribute varies from client to client. I'm thinking of using some kind of pattern recognition or just asking de buyer to input the level of importance of each attribute.


Objects are made up of atoms, and objects have colour, but atoms, as my understanding goes, do not have colour, so how is it possible that colourless atoms form objects which have colour?

My understanding of colour is that atoms in a particular object will absorb certain wavelengths of electromagnetic radiation, and the scattered wavelengths give the object its colour. The absorbed wavelengths contribute to lattice vibrations, increasing the kinetic energy and raising the objects temperature. Is this correct?  What is the sequence of events when a solution of particular atoms is sprayed through a Bunsen burner? I don't understand this. In this case is the colour seen a result of electrons moving up and then back down energy levels?


I'm not understanding what an unpolarized wave is. Does that mean there is no electric/magnetic field, or that the field is constant, i.e. frequency = 0? How can that be possible?

I need help in finding an expression for the instantaneous electric and magnetic field of unpolarized light in order to write down and evaluate the time-averaged norm of the Poynting vector (i.e. the intensity of unpolarized light). I expect this to be a superposition of some basis functions, but how many and how do they look like? Are these linear polarized waves with random orientation and phase shift?  $$\bar{E}(t,\bar{x})=\sum_{i}\bar{E}_{0,i}e^{i(\bar{k}\cdot\bar{x}-\omega t+\delta_{i})}$$ with $\|\bar{E}_{0,i}\|=\|\bar{E}_{0,j}\|$ ?


In World of Warcraft you can change between two specializations, is there something like this in SWTOR? As an example, can I play as bounty hunter mercenary arsenal , then switch to bodyguard?

World of Warcraft has an ability to have two different talent builds and switch between them with a button press.  Does this exist in Star Wars: The Old Republic?  If so, where (and when) do I learn it and how much does it cost to learn?


A film (rented VHS I think) from the late 80' or early 90's, some kind of pods found their way (don't remember how) into an spaceship heading for earth. These pods were egg/walnut shaped and orange/brown and approximately the size of a basketball. In these pods there was a small machine with tools that could use material from surrounding environment to build some kind of robot/cyborg. I remember that it used a human body as a base to build this robot/cyborg. Some people were trying to stop this ship from reaching earth but in the end it crashed and then you saw at least one surviving pod.  I think Martin Landau was in the film but I may be mixing things up.

I saw this on TV in mid 90s I think. One or more people travel to another celestial body (might or might not be the/a moon or mars), they find an American football. The football transforms into a robot that is hostile. They later find LOTS of these footballs/disguised robots.  Since there are lots of robotic projects with "football robots" or " robots", it is very hard to filter search results using Google etc.


I'm very new to C++. From examples, I find this use of sizeof in order to retrieve the length of an array  int main() { int newdens[10]; // the first line returns 10 which is correct std::cout << "\nLength of array = " << (sizeof(v1)/sizeof(*v1)) << std::endl; std::cout << "\nLength of array = " << (sizeof(v1) << std::endl; //returns 40 std::cout << "\nLength of array = " << (sizeof(*v1)) << std::endl; //returns 4     }   But if i wrote a function like this   #include <iostream>  void myCounter(int v1[])     {     int L, L2, L3;     L = (sizeof(v1)/sizeof(*v1));      L2 = (sizeof(v1));      L3 = (sizeof(*v1));      std::cout << "\nLength of array = " << L << std::endl;     std::cout << "\nLength of array = " << L2 << std::endl;     std::cout << "\nLength of array = " << L3 << std::endl;      }  int main() { int v1[10];  std::cout << "\nLength of array = " << (sizeof(v1)/sizeof(*v1)) << std::endl; std::cout << "\nLength of array = " << (sizeof(v1)) << std::endl; std::cout << "\nLength of array = " << (sizeof(*v1)) << std::endl;  myCounter(v1);     }   the outputs are L=2, L2 = 8, L3 = 4. I can't understand where the problem is.  How to retrieve the correct lenght of v1 inside the function?

First off, here is some code:  int main()  {     int days[] = {1,2,3,4,5};     int *ptr = days;     printf("%u\n", sizeof(days));     printf("%u\n", sizeof(ptr));      return 0; }   Is there a way to find out the size of the array that ptr is pointing to (instead of just giving its size, which is four bytes on a 32-bit system)?


Let be $M$ and $N$ smooth manifolds. Take $f\colon M\rightarrow N$ a continuous maps, so exists smooth $g$ from $M$ to $N$ such that $g$ is homotope to $f$, how can it proved?

If $M_1$ and $M_2$ are compact connected manifolds of dimension $n$, and $f$ is a continuous map from $M_1$ to $M_2$, f is homotopic to a smooth map from $M_1$ to $M_2$.   Seems to be fairly basic, but I can't find a proof. It might be necessary to assume that the manifolds are Riemannian.  It should be possible to locally solve the problem in Euclidean space by possibly using polynomial approximations and then patching them up, where compactness would tell us that approximating the function in finitely many open sets is enough. I don't see how to use the compactness of the target space though.


I have problem with white color. If selected white color I got gray color.  What can be problem?

I already searched the internet but could not find a solution to this. Maybe it is the same question as  but there was no answer.  I want to render a video with tracking, but the output "loses" color information and gets kind of greyish. I first thought that it is related to the renderer, but it happens in Cycles and Eevee. Therefore i made a sample image, added it to the image sequence editor and rendered it as 1 frame. Resulting in the same problem.  I placed the original image beside blenders output so that you can see the difference. The only idea I came up with is that something with the lighting is not correct but I can't find a setting for that.  I am using Blender 2.80 with the default settings. Only set the output resolution to match the input resolution.


I want to run 2.79 and 2.8 on the same machine, but 2.8 destroyed my 2.79. I need a link to the UNINSTALLABLE v 2.79b.

I currently have version 2.74. How do I update to version 2.76? I do not see any links in the UI to update my version of Blender


Some suggestion is that if we plan to have lower tax bracket when we retire, we can contribute into 401(k) pre-tax instead of after-tax.  However, if some people may contribute $60,000 into either pre-tax or after-tax, then when they retire, if it has $1.5 million, then they may end up with $1.2 million after paying tax, versus if people contributed for after-tax, they have $1.5 million, and it is always $1.5 million.  They don't have to worry about tax for it at all.  So is it true that we may consider after-tax even if we think our tax bracket is low after retirement?  But one exception may be: I can't recall if it is after-tax, is it true that some company may not match your contribution, say, at 100%.  If it is 100%, then you may considered it "paying for your tax" already, because if you have $100 and the company contribute $100, then you have $200. Even after paying tax, you may still have $120, so it is better than paying tax for you.

I just graduated, and I'm starting a new job soon. My employer has pretty good policy for matching 401(k) contributions, so I want to invest as much as possible, especially during this first year.  My question is: should I invest in a traditional 401(k), a Roth 401(k), or some combination of the two? On the one hand, tax rates may be much higher when I retire, and I might be in a higher tax bracket, so a Roth 401(k) would be good. On the other hand, I might be in a lower tax bracket when I retire, so a traditional 401(k) might be better. It's hard to know where I will stand in 30 years.  Is this the same trade-off as with a traditional / Roth IRA, or is there any other tax difference I should know about?


Assume that $\lvert f(x)-f(y) \rvert \le \lvert x-y \rvert ^2$ for all $x,y\in \mathbb{R}$. Prove that $f$ is the constant function.      My first thought was to use continuity of $f$, so that we get that $\forall x\in\mathbb{R},\forall \epsilon>0, \exists \delta>0, \forall y \in \mathbb{R}, \lvert x-y \rvert<\delta \implies \lvert f(x)-f(y) \rvert < \epsilon$.   So choosing $y$ so that the above property holds, we get that $\lvert f(x)-f(y) \rvert \le \lvert x-y \rvert ^2 <\delta^2$  Using the inequality I found (supposing it is correct), how would I continue to prove that $f(x)=f(y)$, and so their difference must be zero.

Let $f$ be defined on $\mathbb{R}$ and suppose that |$f(x)$ - $f(y)$| $\leq$ $(x-y)^2$ $x,y \in\mathbb{R}$. Here I have to show that $f$ is a constant function.  I think I have to show that $f'(x)$ = 0 for all $x$. But I don't know from where to start this. I tried taking it as (|$f(x)$ - $f(y)$|/|$x$-$y$|) $\leq$ |$x$ - $y$|. Am I right in doing so? Any hint or suggestion will be helpful. Thanks


I am trying to search all ".txt" file for a drive (C:). For that I am searching "AllDirectories" of drive C:, but I am getting exception while some directory access is denied and my program terminates.   try             {                 var filename = Directory.GetFiles("C:\\", "*.txt", SearchOption.AllDirectories);                 Console.WriteLine(filename.ToString());                 foreach (string a in filename)                 {                      Console.WriteLine(a);                 }             }             catch (Exception ex) { Console.WriteLine(ex); }   System.UnauthorizedAccessException: Access to the path 'C:\Documents and Settings' is denied.  How to skip unauthorized access directory and moving to next directory to search all the".txt"?  Exception:  System.UnauthorizedAccessException: Access to the path 'C:\Documents and Settings' is denied.    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)    at System.IO.FileSystemEnumerableIterator1.HandleError(Int32 hr, String path)    at System.IO.FileSystemEnumerableIterator1.AddSearchableDirsToStack(SearchData localSearchData)    at System.IO.FileSystemEnumerableIterator1.MoveNext()    at System.Collections.Generic.List1..ctor(IEnumerable`1 collection)    at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption, Boolean checkHost)    at System.IO.Directory.InternalGetFiles(String path, String searchPattern, SearchOption searchOption)    at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)    at ConsoleApp1.Program.Main(String[] args) in c:\users\h190733\source\repos\ConsoleApp1\ConsoleApp1\Program.cs:line 16

I am trying to display a list of all files found in the selected directory (and optionally any subdirectories). The problem I am having is that when the GetFiles() method comes across a folder that it cannot access, it throws an exception and the process stops.  How do I ignore this exception (and ignore the protected folder/file) and continue adding accessible files to the list?  try {     if (cbSubFolders.Checked == false)     {         string[] files = Directory.GetFiles(folderBrowserDialog1.SelectedPath);         foreach (string fileName in files)             ProcessFile(fileName);     }     else     {         string[] files = Directory.GetFiles(folderBrowserDialog1.SelectedPath, "*.*", SearchOption.AllDirectories);         foreach (string fileName in files)             ProcessFile(fileName);     }     lblNumberOfFilesDisplay.Enabled = true; } catch (UnauthorizedAccessException) { } finally {}


Upon reading of  "paradox", I began to wonder a couple of things.  First of all, to me the inductive step seems flawed. Just because I have $n$ white horses, does not mean that the $n+1$ will be white, too.   The only explanation to make the inductive step work seems to me that the actual statement we are assuming as base case it's not "there are at least $n$ horses of the same color", but rather "$P(n)$ = any grouping of $n$ horses is such all the horses in that grouping have the same color".  Now this makes the inductive step works, but it's completely useless, as $P(2)$ already implies that all the horses have the same color.  And of course the base case $P(2)$ is not true because it's equivalent to our problem. Setting to prove $P(2)$ is the same as proving that all horses have the same color.  So I can't understand why this has been considered a "false" proof by induction; either the inductive step does not work or it's completely useless.  The wikipedia page linked before explains the problem as      The problem in the argument is the assumption that because each of   these two sets contains only one color of horses, the original set   also contained only one color of horses. Because there are no common   elements (horses) in the two sets, it is unknown whether the two   horses share the same color.   Which does not make any sense to me.. It's like looking at the finger instead that at the moon.  Is there something wrong with my understanding of induction?  Edit  Admittedly, the base case is $P(1)$ and not $P(2)$. But the point holds;the only implication we need is $P(1) \implies P(2)$. All the subsequent implications are useless; a proof of this type is seldom called a proof by "induction". Otherwise all proofs are by induction! :)  What is even the point of establishing what $P(n)$ is? Just prove $P(2)$ and use as known fact $P(1)$ as you would do with any other known fact.   Edit 2  Since there has been some confusion about what I asked, I'll explain my thought process:  1) Begin reading the proof. Imagine that the statement is "P(n) = at least n horses have the same color", and if by induction on $n$ this hold for every $n$, then QED.  2) Realize the inductive step does not work  3) Understand that the proposition to be proved has been (silently) changed and now it's "P(n) = any grouping of $n$ horses is such all the horses in that grouping have the same color"."  4) Realize that $P(2)$ is what we want to prove.  5) Wonder why on earth we are trying to show $P(n)$ for $n > 2$. Induction proof usually works because the final statement to be proved come from the fact that it works for all $n$. Here $n=2$ suffice, so it is really odd.  6) Starting to think I've missed something here. But hey, it's a false proof, let's see what was wrong.  7) Turns out that the outline of the proof is fine but here's the catch: of all the implications $P(1) \implies P(2)$ is not valid hence the whole $P(n)$ cannot be valid.  8) Thinking (again) that this seems weird. Wonder if I've missed something .  By extended discussion it turns out that my understanding of induction was right. This lead me to believe that is is a bad example because it "seems" like a proof by induction but really some essential elements are not present. It's not that is wrong (apart from the failed implication), is that it gives a very bad idea of what a proof by induction is

I'm bugged by the following that's summarized on p. 109 of .     False theorem: All horses are the same color.      Proof by induction:      $\fbox{$P(n)$ is the statement: In every set of horses of size $n$, all $n$ horses are the same color.}$   $\fbox{Base Case or $P(1)$:}$ One horse is the same color as itself. This is true by inspection.   $\fbox{Induction Step:}$ Assume $P(k)$ for some $k \geq 1$.   $\fbox{Proof of $P(k + 1) :$}$   Since $\{H_1, H_2, ... , H_n\}$ is a set of $n$ horses, the induction hypothesis applies to this set. Thus, all the horses in this set are the same color.   Since $\{H_2, H_3, ... , H_{n+1}\}$ is also a set of $n$ horses, the induction step likewise holds for this set. Thus, all the horses in this set are the same color too.         Therefore, all $n +1$ horses in $\{H_1, H_2, H_3, ... , H_n , H_{n+1}\}$ are the same color. QED.   The issue the instructor was trying to point out is clearly valid. For the case $n = 1$, there is only ${H_1}$. So this case says nothing about possible overlapping elements of each set of $(n + 1)$, for instance $H_2$ in the above proof.    But it was proposed in the class discussion that this was the only problem. Had you been able to prove $P(2)$ true, then a proof of the above format would have been fine.    My interpretation is that yes, you could prove all horses are the same color, if you can prove that any set of two horses will be the same color. But this format would not work.  Why not? The problem I see is that the above proof is for the existence of at least one particular pair of sets of horses of sizes $n$ and $n + 1$, such that in each set, all horses are the same color.  Particularly when the set of size $n$ is a subset of the set of size $n + 1$.  In order to prove the induction step, don't you need to prove that sets of sizes $n$ and $n + 1$, do not necessarily contain the same, overlapping elements?  You could prove that any horse can be added to a set of 2 horses.  Take the last two, and they must be the same color, and so on.  Wwhatever color the first two happen to be, all other horses must thus be the same color.    Am I misinterpreting the example, or am I making a logical error? Thanks in advance.


I have a simple question about strings in Java. The following segment of simple code just concatenates two strings and then compares them with ==.  String str1="str"; String str2="ing"; String concat=str1+str2;  System.out.println(concat=="string");   The comparison expression concat=="string" returns false as obvious (I understand the difference between equals() and ==).    When these two strings are declared final like so,  final String str1="str"; final String str2="ing"; String concat=str1+str2;  System.out.println(concat=="string");   The comparison expression concat=="string", in this case returns true. Why does final make a difference? Does it have to do something with the intern pool or I'm just being misled?

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


Sorry if it has been asked before I am sure. Anyways, if I hold a ball in the air, I do no work but I do spend energy ("chemical", heat... whatever happens in my muscle) and get tired. Where does the energy or whatever to cause me to get tired come from? For example how is an electrical charge capable to  pull forever and never get "tired"?

I read the definition of  as  $$W ~=~ \vec{F} \cdot \vec{d}$$  $$\text{ Work  =  (Force) $\cdot$ (Distance)}.$$ If a book is there on the table, no work is done as no distance is covered. If I hold up a book in my hand and my arm is stretched, if no work is being done, where is my energy going?


This is continuation to   **Please read previous question in order to understand my findings.*  Okay guys, this is REALLY strange. It seems as Intel Turbo Boost was always working, but i could not see it really working until i installed Intel Processor ID Utility.   - Intel Turbo Boost activated in BIOS  What is strange is that no other programs can see Turbo Boost but Intel Processor ID Utility and Intel Turbo Boost Monitor. Everytime i launch monitor it states that i don't have Turbo Boost enabled, but continues to monitor.   - Intel Turbo Boost deactivated in BIOS  And Turbo Boost still works although it is deactivated in BIOS?! How is this possible?  I don't know what to believe now. What if monitor and processor ID lie to me that Turbo Boost is working and other programs don't? I don't have any Turbo Boost stuff in Device Manager which means it is hidden and no other programs can see Turbo Boost but Intel's?  AIDA64 CPUID does not show any signs of Turbo Boost - clock rate is ~same, multiplier changes but no further than x25, system bus is ~100MHz.  In the end i have mananged to disable Turbo Boost (i think) but only with having 1 active core, so in other words i cannot disable Turbo Boost with 2 active cores.  I have noticed that when Turbo Boost kicks it, the screen's brightness changes. Any idea why?  Update: Turbo Boost

Investigation continued      Dell Latitude E6420 is my laptop with Windows 7 Enterprise. Turbo Boost is enabled in BIOS but is disabled in OS according to AIDA64. I managed to install Intel Turbo Boost Monitor but it says that Turbo Boost is not enabled. Although I still see standard speed but I also see "Energy Saver" appears when CPU runs at less than standard speed.  What is interesting is that Turbo Boost gets enabled in OS only when SpeedStep is enabled as well in BIOS. This slows down CPU to ~700Mhz and stays there no matter what. Enabling\Disabling C-State did not do anything and there is no multiplier.  Intel Chipset Utility is the latest version and I did not find any Turbo Boost driver, nor any service in Administration.  I have found drivers package for my model . The problem is that i do not know what is responsible for Turbo Boost.


By dead spots I mean places where grass won't grow on my plane e.g. for walkways. I've been wondering this for a while but I haven't seen anything in regards to it online. Thanks!

I am trying to make some grass. I want to have grass only near the edges of my plane and not on the center.   Is any way to do that?   Or I have to split the plane and make different objects?


How do I log out from my account?I have a problem logging out of my account because I can't seem to find the log out icon.

Per the title, where is the logout button?  All the existing questions I can find refer to the previous design of the site, where hovering over your name in the top bar brought up a menu.


I just started using Blender. I have a png file used as texture, and I would like to apply a glossy finish only to one colour of the image. Is there any way I can do it? Thank you in advance!

So I came across some difficulties with the "Mix shader" node in cycles. I have 3 textures on a label: gold, paper and rough black letters.  How can I mix these effects? I can make 2 textures work together, but not the 3rd one. Here's the node graph.  Here's the reference.


I want installed a complete Ubuntu 20.04.2.0 on a USB Flash Drive, according to , using 64GB USB Flash Drive I wonder is it enough space or should I use larger USB? And how many space allocate  to each partiton? FAT32 partition, EXT4 partition, Swap partition. Is the allocation order matters?  FAT32 partition  EXT4 partition  Swap partition   (I did not understand the purpose of each of them). In the meantime, ZOOM and VSCode is required, I do not need a lot of memory but I want it to be enough.

I’m trying to install Ubuntu 16.04 alongside with Windows 7. My HDD supports only 4 partitions. Three of the partitions are taken up by windows. The fourth one is labelled as free space.   Now, how do I make root, swap and home partitions? Should I format my free space as primary with EXT4 first (if so, what should be the mount point?) and then create logical partitions for root/Home/swap? How do I go about this?  Edit: I tried to use the automatic installation option for dual boot. However I got the error ubi partman exit code 141. Probably because it tried to create two separate partitions for root and swap.   $ sudo parted -l Model: ATA ST1000DM003-1CH1 (scsi) Disk /dev/sda: 1000GB Sector size (logical/physical): 512B/4096B Partition Table: msdos Disk Flags:   Number  Start   End    Size   Type     File system  Flags  1      1049kB  106MB  105MB  primary  ntfs         boot  2      106MB   277GB  277GB  primary  ntfs  3      277GB   903GB  627GB  primary  ntfs


I'm new to JavaScript/TypeScript and am trying to figure out what's going on here.  class MyClass {      constructor() {         this.doThisEverySecond();         setInterval(this.doThisEverySecond, 1000);  // Tried here     }      doThisEverySecond():void {         console.log("Do some stuff");         this.subroutineForOrganization();         console.log("Do more stuff\n");     }      subroutineForOrganization():void {         console.log("Doing many things");     } }  const foo:MyClass = new MyClass(); setInterval(foo.doThisEverySecond, 1000);  // And tried here   I want to call a function doThisEverySecond() and have it execute every x seconds; and for simple organizational purposes I have some of what it does pulled out into a subroutine, subroutineForOrganization().  Regardless of whether I call setInterval() in its constructor or immediately after its instantiated, I get the following error:  Do some stuff Doing many things Do more stuff  Do some stuff D:\Webstorm Projects\Sonification\es5\src_ts\test.js:8         this.subroutineForOrganization();              ^  TypeError: this.subroutineForOrganization is not a function     at Timeout.MyClass.doThisEverySecond [as _repeat] (D:\Webstorm Projects\Sonification\es5\src_ts\test.js:8:14)     at Timeout.wrapper [as _onTimeout] (timers.js:417:11)     at tryOnTimeout (timers.js:224:11)     at Timer.listOnTimeout (timers.js:198:5)  Process finished with exit code 1   I don't understand why it runs just fine when called from the constructor the first time, but then has an error when its invoked with setInterval.  How is it a function then, but not now?  Is there some sort of JavaScript scope wizardry going on that I don't get?  Thanks!  SOLVED: Calling with an arrow function (as explained below) preserves the reference to this ()

Is there a best-practice or common way in JavaScript to have class members as event handlers?  Consider the following simple example:  <head>     <script language="javascript" type="text/javascript">          ClickCounter = function(buttonId) {             this._clickCount = 0;             document.getElementById(buttonId).onclick = this.buttonClicked;         }          ClickCounter.prototype = {             buttonClicked: function() {                 this._clickCount++;                 alert('the button was clicked ' + this._clickCount + ' times');             }         }      </script> </head> <body>     <input type="button" id="btn1" value="Click me" />     <script language="javascript" type="text/javascript">         var btn1counter = new ClickCounter('btn1');     </script> </body>   The event handler buttonClicked gets called, but the _clickCount member is inaccessible, or this points to some other object.  Any good tips/articles/resources about this kind of problems?


I'm a non EU passport holder and have a valid Schengen visa (5 year multiple entry). When I applied for the visa I applied as a spouse on a UK passport holder. Have traveled to EU several times with my husband and child - no problems. I now wish to travel without my spouse (but with child who has UK passport) on this Schengen. Is this possible?   I realise that conditions for granting the family visa include travelling with partner but it's not clear if these conditions apply for all future travel too. Hoping a Schengen is a Schengen and other conditions can't be applied post issuing. Failing that, hoping my UK born child can be considered my family member.

I have a relative who has an EU passport. They emigrated out of the EU many years ago and have married (in Australia) an Australian citizen. They are planning on travelling around EU/Europe later this year (just a regular holiday, not working or anything)  I know the EU relative will have no problem getting into the EU (since they are an EU citizen), and that it will (probably) be very easy for an Australian citizen to get a tourist visa for many countries.  But I have a vague idea that the spouse of an EU citizen is (legally) allowed live and work in the EU for as long as they want, right? So in theory, the spouse could never be denied a visa, or have to pay for one, right?  How would the non-EU spouse enter the EU as 'spouse-of-EU-citizen' rather than 'general-tourist'? Is this possible? Is this beneficial?


I use free -h see this:                total        used        free      shared  buff/cache   available Mem:           1.9G        1.2G        157M        4.8M        630M        635M Swap:          947M        256M        690M

briefly list the format of the free command, noting that buffers is kernel memory that must be written out to disk and cache is file data that does not need to be written disk.  On my system, unlike most times I have run free, buffers occupies over 10% of RAM.  Usually, buffers are a small, almost token, value.    My question is, what exactly is in the area called buffers?  Can I look for it with lsof?  Does it consist of open file regions that have not been flushed?  Is it memory mapped file regions?  What is it?  The system runs well and little swap is used, so performance is fine.


Is there a means in ogr2ogr to "clip out" one shapefile from another?  I know ogr2ogr -clipsrc B.shp out.shp A.shp will remove any part of A.shp that is NOT in B.shp.  Is there an ogr2ogr command to remove any part of A.shp that intersects with B.shp?  I have seen this called "reverse clip", "clip out", "erase" (ArcMap), or "difference".  Note: this question is about ogr2ogr, the command line tool, NOT the OGR library, which requires programming.

I'm trying to find the erase geoprocessing method as I am familiar with in ARC, but I can't seem to find it in OGR using Python. I have looked through the module OGR documentation but perhaps I missed it.   An example of the function would be even better.


I'm trying to capture everything between two markers (START[number] and END[number]) where number also needs to be extracted. I need to support line breaks.   For instance the following :  START[1]  message to capture ...END[1]    must return :   group 1 : 1 group 2 :    message to capture ... group 3 : 1   Here is my attempt ():    START\[(\d+)\]((.|\n|\r)*?)END\[(\d+)\]   It doesn't work as I obtain a third group made of the last character of the message to capture and I don't know why.  Can someone may help me with this ? Thanks.

For example, this regex  (.*)<FooBar>   will match:  abcde<FooBar>   But how do I get it to match across multiple lines?  abcde fghij<FooBar>


I'm trying to select a certain song to play on a command block, but when I type in something like "/playsound music.game.creative @p", it will play a different song everytime I activate the command. Is there a way where I can select one of the songs without it playing a different one?

I want to play a file from a folder containing more than one track, but Minecraft doesn't seem to allow one to specify a song from the folder, and only picks a random song out of those listed to be played.    I've tried making a new folder that contains only the sound file I want but it doesn't play anything at all when I try that.  Is there any file I can alter, folder I can create, or really anything I can do to play a specific sound file?


Let $n>0$. Let $V\subset \mathbb{F}_2^n$ a vectorial space. Let $U$ a subspace of $V$.  How many subspaces $W_i \subset V$, at most, I can describe (for example using the basis) such that $U \subset W_i$?

In $GF(2)$, How Can I calculate the number of subspaces of dimension $k<w$ that contains a fixed subspace of dimension $k'<w$:


I'd like to create disabled field with ModelForm on django 1.11.  I read django has "disabled field options" since 1.9. However, I can not understand how do I define disabled field with ModelForm.  Could you tell me how to create disabled field with ModelForm please ?  Here is my models.py, forms.py and views.py    class my_model(models.Model)      name = models.CharField(max_length=10,)     title = models.CharField(max_length=10,)     date = models.DateField(default=date.today,)      def __str__(self):         return u'%s' % (self.name)  class my_modelform(ModelForm):      class Meta:         model = my_model         fields = ['name', 'title', 'date']         widgets = {             'date': DateWidget(usel10n=True, bootstrap_version=3,),         }         disabled = [ 'name' ]  class my_UpdateView(UpdateView):     model = my_model     form_class = my_modelform     template_name = "update_form.html"     success_url = "success.html"         Although, I changed the "disabled = {'name' : True} instead of [ 'name' ], it doesn't work.

In a Django form, how do I make a field read-only (or disabled)?  When the form is being used to create a new entry, all fields should be enabled - but when the record is in update mode some fields need to be read-only.  For example, when creating a new Item model, all fields must be editable, but while updating the record, is there a way to disable the sku field so that it is visible, but cannot be edited?  class Item(models.Model):     sku = models.CharField(max_length=50)     description = models.CharField(max_length=200)     added_by = models.ForeignKey(User)   class ItemForm(ModelForm):     class Meta:         model = Item         exclude = ('added_by')  def new_item_view(request):     if request.method == 'POST':         form = ItemForm(request.POST)         # Validate and save     else:             form = ItemForm()     # Render the view   Can class ItemForm be reused? What changes would be required in the ItemForm or Item model class? Would I need to write another class, "ItemUpdateForm", for updating the item?  def update_item_view(request):     if request.method == 'POST':         form = ItemUpdateForm(request.POST)         # Validate and save     else:         form = ItemUpdateForm()


If we expand $$ (x_{1}+x_{2}+...........+x_{k})^{n} $$ How many terms will be there once we collect terms with equal monomials?   What is the sum of all coefficients?  I literally have no clue how to start it.  I am relating it to multinomial coefficient $$\frac{n!}{n_1!n_2!\dots n_k!}$$  but I don't know how to proceed.

If you expand $(x_1+x_2+\cdots+x_k)^n$, how many terms will there be once you collect terms with equal monomials? What is the sum of all the coefficients?  I'm kind of lost here. This came up with other questions on the topic of binomial coefficients, and i have figured those out. I have spent almost an hour trying to figure where to start and haven't made any progress.


$$x_n = 1 + 1/2 +\dots +1/n- \log n$$  Then -  $1.$ Is the sequence increasing?  $2.$ is the sequence convergent?  For $(1)$, $\sum 1/n$ is increasing and $\log n $ is also increasing. First few terms are increasing, but i don't know about later terms.  $(2)$ $n^{th}$ term of the sequence can be written as $a_n = (\sum_{i=1}^{n}) - \log n$  So, $\lim_{n\to \infty} a_n = \lim_{n \to \infty} \sum 1/n -\lim_{n \to \infty} \log n$  Neither first part nor second is convergent here. so i could not conclude anything.  How to solve?

I'm searching for a really simple and beautiful proof that the sequence $(u_n)_{n \in \mathbb{N}} = \sum\nolimits_{k=1}^n \frac{1}{k} - \log(n)$ converges. At first I want to know if my answer is OK.  My try: $\lim\limits_{n\to\infty} \sum\limits_{k=1}^n \frac{1}{k} - \log (n) = \lim\limits_{n\to\infty} \sum\limits_{k=1}^n \frac{1}{k} + \sum\limits_{k=1}^{n-1} \log(k)-\log(k+1) = \lim\limits_{n\to\infty} \frac{1}{n} + \sum\limits_{k=1}^{n-1} \log(\frac{k}{k+1})+\frac{1}{k}$     $ = \sum\limits_{k=1}^{\infty} \frac{1}{k}-\log(\frac{k+1}{k})$ Now we prove that the last sum converges by the comparison test: $\frac{1}{k}-\log(\frac{k+1}{k}) < \frac{1}{k^2} \Leftrightarrow k<k^2\log(\frac{k+1}{k})+1$ which surely holds for $k\geqslant 1$      As $ \sum\limits_{k=1}^{\infty} \frac{1}{k^2}$ converges $ \Rightarrow \sum\limits_{k=1}^{\infty} \frac{1}{k}-\log(\frac{k+1}{k})$ converges and we name this limit $\gamma$ q.e.d


Why do we define continuous probability distribution as those with absolutely continuous CDF, instead of just continuous CDF?

In the book Limit Theorems of Probability Theory by Valentin V. Petrov, I saw a distinction between the definitions of a distribution being "continuous" and "absolutely continuous", which is stated as follows:  "...The distribution of the random variable $X$ is said to be continuous if $P\left(X \in B\right)=0$ for any finite or countable set $B$ of points of the real line. It is said to be absolutely continuous if $P\left(X \in B\right)=0$ for all Borel sets $B$ of Lebesgue measure zero..."  The concept I am familiar with is:  "If a random variable has a continuous Cumulative Distribution Function, then it is absolutely continuous."  My questions are: are the two descriptions about "absolute continuity" in (1) and (2) talking about the same thing? If yes, how can I translate one explanation into the other one?


I had just been trying to understand GR but i just cannot understand where some of the formula of field came from. Apparently all those initial formula are from Newtonian physics so please anyone could recommend me the topics and even better if there are books which consist of the derivation of the formula of the Newtonian gravitational fields which is used in the derivation of GR.

What are some good books for learning general relativity?


Secretary sends out months of meetings, always at a time I already have a re-occurring meeting, so I decline them all. However, what if my meeting changes/ends and now I could attend if I wanted- how can I still see that I was invited to a meeting at that time- without replying "tentative" to them all? Is there a way?

In Outlook, How can I list cancelled/declined meetings?   I happen to use Outlook 2010 at the moment.


How we can lock or protect a shapefile from editing in arcgis?  I want another person to be able to view the data/attributes in the shapefile, but don't want them to be able to change or edit the data.

How do you make the shapefile a Read-only so the client can not make any edits using 10.2.2 ArcGIS.  It is not within a geodatabase, just a stand alone shapefile.  I am using Windows 8


Say we had a sample of 100 people who were asked how many days during the last week they drove their car. Let's say the resulting frequency table is as follows: Days, frequency 0, 1 1, 5 2, 3 3, 15 4, 20 5, 25 6, 31 7, 0 How do I go about using a beta-binomial model for estimating the average number of car-driven days a week for a uniform prior? The data is binomial, with 7 Bernoulli trials each with a success probability of p. I don't know how to proceed from here in terms of figuring out the average? Thank you!

So, I have been presented with this question: A sample of 100 people were asked how many days they drove their car during the last week (inc. the weekend). The resulting frequency of response is shown below: Days, frequency 0, 1 1, 5 2, 3 3, 15 4, 20 5, 25 6, 31 7, 0 I need to use a beta-binomial model in order to estimate the average number of 'car driven' days a week for a uniform prior. There are a total of 7 Bernoulli trials, each with success probability p. I'm incredibly confused at what the outcome will be. I know that for a uniform prior that alpha = 1, and beta = 1, but I don't know how to apply this all to get the average? Thank you.


Listing docker containers: docker ps -a -q  error: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json?all=1: dial unix /var/run/docker.sock: connect: permission denied  temporary fix: grep docker /etc/group newgrp docker  Oddly, if I exit out of bash from the Gnome Terminal I have to re-run the group command(s) above. Why?  And, how to make that configuration persist?

In ubuntu 18.04 with default desktop, behaviour of logout/login has changed:  Previously on an Ubuntu system, when I find that I need to add my user id to some group, it was sufficient to   sudo adduser ludwig docker # adds me to group docker   and then I had to logout and login again to make the group change effective.  I notice that with Ubuntu 18.04, after adding the group and logging out and back in, the list of effective groups is still unchanged.  As a workaround I rebooted the system, which is inconvenient (requires making the right selection in grub and re-entering the disk encryption password).   Why is the behaviour now like this?  Can I do something else short of rebooting?   (I know I can ssh into localhost and get the correct groups in the ssh session only. This is also too inconvenient.)


I've been trying to import the blender python library into python so I can use it in another python IDE. I followed some steps on the blender wiki page and achieved the correct files. My only problem left is to copy and past the correct files in the 'site-packages' folder under python 3.4 but I don't have such directory... I did not install this python version manually, It came with Ubuntu by default.  -Bert  The blender wiki page:

How do I find the location of my site-packages directory?


I got a tarball (let's say t.tar.gz) that contains the following files  ./a/a.txt ./b/b.txt    where ./b/b.txt is a hard link to ./a/a.txt.  I want to unpack the tarball on a network file system (AFS) that only supports hard links in the same directory (see ). Therefore, just unpacking it via tar -xzf t.tar.gz raises an error that the hard link ./b/b.txt cannot be created.  So far, my solution to the problem was to unpack ./t.tar.gz on a file system that supports ordinary hard links. Then pack it again with the option --hard-dereference as  proposes. And lastly, unpack that new tarball into the AFS.  As this is unsatisfactory for me, I'm asking if there is an easier way to get the content of the archive unpacked directly to it's final destination? Such as an equivalent option to --hard-dereference for unpacking instead of archiving?

If I have a tar file, bob.tar, which contains real_file and link_to_real_file, in which the latter is a symlink, is there a way to extract the contents of bob.tar so that link_to_real_file will not be a symlink, but be a copy of real_file.    I know this is indeed possible on the creation side, if I use the -h flag.    The command tar -cvhf bob.tar real_file link_to_real_file will dereference link_to_real_file, but I want to do this on the extraction side regardless of how the tar file was created.


Suppose I have these two lenses: - Tamron SP 24-70mm f/2.8 Di VC USD G2 Lens - Tamron 28-300mm F/3.5-6.3 Di VC PZD  And suppose I have used them both on the same full frame camera, in the same tripod setup to take the exact same photo using these exact settings on both lenses  - focal 50mm - Aperture F5  - shutter 1/400 - ISO 100  should I get the exact same photo quality in both images because all settings are the same? or there will be a difference in photo quality because of the difference in lenses?

When reading lens reviews on the Internet, I often find subjective statements about the image quality that a lens produces, such as "good contrast" or "sharp". The problem is that I don't think I am capable to actually see these qualities on an image. I don't even think I could tell the difference between a cheap kit lens and a top lens, if not by "this just looks better".  So my question is: without looking at sharpness tests and MTF curves, how do you learn to judge the quality of a lens based only on sample images? What are the characteristics you look for and what constitutes good or bad in each of them?