I want to send temperature value from a microcontroller using UART to C# interface and Display temperature on Label.Content. Here is my microcontroller code:  while(1) {    key_scan(); // get value of temp    if (Usart_Data_Ready())    {       while(temperature[i]!=0)       {          if(temperature[i]!=' ')          {             Usart_Write(temperature[i]);             Delay_ms(1000);          }          i = i + 1;       }       i =0;       Delay_ms(2000);    } }   and my C# code is:  private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e) {    txt += serialPort1.ReadExisting().ToString();    textBox1.Text = txt.ToString(); }   but exception arises there "Cross-thread operation not valid: Control 'textBox1' accessed from a thread other than the thread it was created on" Please tell me how to get temperature string from my microcontroller and remove this Error!

I have a scenario. (Windows Forms, C#, .NET)   There is a main form which hosts some user control. The user control does some heavy data operation, such that if I directly call the UserControl_Load method the UI become nonresponsive for the duration for load method execution. To overcome this I load data on different thread (trying to change existing code as little as I can)   I used a background worker thread which will be loading the data and when done will notify the application that it has done its work.   Now came a real problem. All the UI (main form and its child usercontrols) was created on the primary main thread. In the LOAD method of the usercontrol I'm fetching data based on the values of some control (like textbox) on userControl.    The pseudocode would look like this:  CODE 1  UserContrl1_LoadDataMethod() {     if (textbox1.text == "MyName") // This gives exception     {         //Load data corresponding to "MyName".         //Populate a globale variable List<string> which will be binded to grid at some later stage.     } }   The Exception it gave was     Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on.   To know more about this I did some googling and a suggestion came up like using the following code  CODE 2  UserContrl1_LoadDataMethod() {     if (InvokeRequired) // Line #1     {         this.Invoke(new MethodInvoker(UserContrl1_LoadDataMethod));         return;     }      if (textbox1.text == "MyName") // Now it wont give an exception     {     //Load data correspondin to "MyName"         //Populate a globale variable List<string> which will be binded to grid at some later stage     } }   BUT BUT BUT... it seems I'm back to square one. The Application again  become nonresponsive. It seems to be due to the execution of line #1 if condition. The loading task is again done by the parent thread and not the third that I spawned.  I don't know whether I perceived this right or wrong. I'm new to threading.  How do I resolve this and also what is the effect of execution of Line#1 if block?  The situation is this: I want to load data into a global variable based on the value of a control. I don't want to change the value of a control from the child thread. I'm not going to do it ever from a child thread.   So only accessing the value so that the corresponding data can be fetched from the database.


I'm reading basic algebra notes and met this exercise:  Let $\circ$ be an operator defined on $G$, if $\forall a,b,c$, $$ab=ac\Rightarrow b=c$$ and $$ba=ca\Rightarrow b=c$$ then $(G,\circ)$ is a group.  I couldn't figure this out. Could you pls give me some hint?

Let $G$ be a non-empty finite set with an associative binary operation so that cancellation law holds, i.e. $ab=ac$ or $ba=ca$ implies $b=c$, for any choices of $a,b,c$ in $G$. Assume that there is an identity element $e$ in $G$. Show that $G$ is a group.  Proof: To show $G$ is a group, conditions must hold. Suppose that $ab=ac$, then $b=eb=(a^{-1}a)b =a^{-1}(ab)=a^{-1}(ac) =(a^{-1}a)c=ec=c$. So left cancellation holds in $G$.  2) Suppose $ba=ca$, then $b=be=b(aa^{-1}) =(ba)a^{-1}=(ca)a^{-1} =c(aa^{-1})=ce=c$. So right cancellation holds in $G$.  3) If $a$ exists in $G$ then $aa^{-1}=a^{-1}a=e$, where $a$ is an inverse of $a^{-1}$. Since inverses are unique, $(a^{-1})^{-1}=a$.  4) Let $x$ be the inverse of $ab$. Then $(ab)x=e$. By associativity we have $a(bx)=aa^{-1}$. Through left cancellation we have  $bx=a^{-1}bx=ea^{-1}=b(b^{-1}a^{-1})$ and $x=b^{-1}a^{-1}$.  Thus $(ab)^{-1}=b^{-1}a^{-1}$. So all conditions hold, $G$ is a group.  Is this proof correct? I know to show $G$ is a group these conditions have to be met. This is all I have to show right?


Currently I am running my micro-controller boards with power adapter(AC to DC).  Now I am developing a system which senses AC power and sends me some signal when AC power is gone.  The problem is I am running my board with the AC power(through adapter) which I am sensing. So, I need to switch to battery power( as backup ) instantly when AC power is gone making sure my board doesn't turn off while switching.   I am not sure how it should be done.

I have got two power supply options on my board:   USB 5.0V DC Power Jack of 5.0V   My intention is to design a or-ing power supply option, as either of them will be used at a time. Possible solutions are shown below:    Using oring diodes   or using two p-mos    Possible issues observed with the above options:   Using diode is cheap and good option but an ordinary diode gives a drop of 0.7V and a schottky diode will give a drop of 0.16 to 0.20 volts, which is also not acceptable because my processor  recommended operating power supply is 5.0V and minimum supply voltage is 4.75. With a 0.2V with schottky diode the 5.0V comes down to 4.80V and the space between recommended and supply fed is very less. Then I thought to use p-mosfets which serves the purpose of oring along with reverse polarity protection, but assume a case when both the supplies are fed together by mistake and there is minor difference between USB supply and DC jack say 4.9V for USB and 5.10V for DC Jack. Then, the DC jack supply may pump the current in USB Jack, which may damage USB.   Is there any other better and cheap option I should use for or-ing supply, or is there something wrong with my analysis?


When I run my Java program, it gives me an error on this line   compiler.getTask(null, null, new DiagnosticCollector<JavaFileObject>(), null, null, compilationUnits);   Error I am getting is:  Exception in thread "main" java.lang.NullPointerException     at AnotherClassLoader.loadClass(test.java:58)     at test.main(test.java:30)     at Main.main(Main.java:68)   Can you please tell me how can I solve this error?

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I asked client to create a sub-domain and a folder for me.  He created a sub-domain and dir ygjhazaxnv  I only have SSH access as mani user.  I put files in ygjhazaxnv folder via Git pull and the owner of all these files is mani. So far all OK.  Now the project I configured is able to create files dynamically, whatever the files are created by my project(PHP files) has owner ygjhazaxnv  Now how can I delete files created by ygjhazaxnv user when logged in as mani?  I tried to own those files via chown but error chown: changing ownership of ‘ABC’: Operation not permitted  Both ygjhazaxnv and root user lies under group www-data  Server is Amazon EC2

I want to stop having to use sudo everytime I work in /var/www. How can I do that? I simply want to put all of my sites into this directory and work with them without too much pain.


I have multiple accounts on many of the same services. I would like a better way to manage my sessions.   A personal Gmail account, and one for work A personal Amazon account, one for work A personal hosting account, one for work, one I manage for a freelance client Many other scenarios like this   As a developer, I'd like to avoid repetitive logins for   browse as a logged-in admin browse as a logged-in user browse as a guest, or any other role   I'd like to avoid having to logout, login, logout, login, over and over again.  I understand that some services like Gmail offer simultaneous logins, but I want a general purpose solution that works for all services.  Chrome Incognito Mode is not designed for this   Chrome Incognito Mode gives you a new cookie jar, but cookies are shared across other incognito windows. At best, this means you can have two sessions. Other browser extensions you may rely upon are not available in Incognito windows (nor should they be) This isn't Incognito's intended purpose

When opening new Internet Explorer window, a new browser session is issued. Therefore you can login with two different accounts on the same service (let's say ). The same does not apply when opening a new tab in the same window in Internet Explorer.  How can I get a new browser session when opening a new tab or window on Firefox?  How about Google Chrome?


Is the above inequality true? I feel that it is, but I am having a tough time convincing myself (or coming up with an appropriate counter-example).

I've been working on this problem from Lang's 'A First Course in Calculus'.   I'll restate the problem in full.  Prove the following inequalities for all numbers x, y. Then, the problem I'm having trouble with under this header is:  $$ |x+y| \ge |x|-|y| $$  It gives as a hint to write x = x + y -y, and apply Theorem 2.3 (If a, b are two numbers then |a+b|<= |a| + |b|), together with the fact that |-y| = |y| but I haven't been able to successfully apply that information to solve it.   Here is my initial attempt to apply the advice.   $$ x = x + y - y $$  Then, stating Theorem 2.3:  $$ |x+y| \le |x| + |y| $$  Now, substituting x:  $$ |(x+y-y) + y| \le |x+y-y| + |y| $$  I'm not really sure where to go after this point, but I think these are probably the correct steps so far to reach the answer. I know I'll need to get |x| - |y| on the right side and flip the inequality sign (multiplying by negative one) somehow.  I did restate the inequality in a few simplified possibilities, when x, y are both positive numbers and when x, y are both negative numbers. I know there are other cases though, such as when x is negative and y is positive or vice versa. And I'd also need to do varying cases when x+y >= 0, and x+y <= 0, where x,y could be all possible combinations of positive and negative.  It seems like there might be a solution through tedious case analysis along these lines but I believe there is probably a better way to come about the answer. In any case, the ones I did restate are:  Case 1:   $$ x + y \ge x - y $$ when x, y are both positive or zero. This simplifies somewhat.  $$ y \ge -y $$  $$ 2y \ge 0 $$  Case 2:   $$ -x - y \ge -x + y $$ when x, y are both negative or zero.  In the first case, when x and y are positive or equal to zero, it is obvious that it is correct.   Intuitively speaking, the second case and indeed any case should simplify down to the first case, since I know any negatives attached to the numbers will simply make them positive or stay zero since it is applying the rules of the absolute value function. I'm not sure how to state this in a proof though, and I'd like to be able to apply the technique that the book suggests.   I would appreciate any guidance on this problem, thanks in advance.


I have heard that you can do the double slit experiment, but is there any other experiments like particle entanglement or observer-induced state collapse?

Is there a phenomenon visible to the naked eye that requires quantum mechanics to be satisfactorily explained? I am looking for a sort of quantic Newtonian apple.


I'm having the issue with ELB constantly showing unhealthy instance. The access.log and error.log are both empty, which makes it seem the ELB is not able to reach the EC2 instance at all. For the sake of testing, I'm using security groups that allow All Traffic to make sure it's not it's not security groups problem on both the ELB and EC2 instance.  Below is the nginx.conf file I'm using with .ebextensions, it's being created properly as I see it in the /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf. The ELB test is on HTTP Port 80 /elb-health-check  container_commands:   00-copy-my-nginx-config:     command: "sudo cp /tmp/my-custom-nginx.conf  /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf"    01-delete-my-nginx-config:     command: "sudo rm /tmp/my-custom-nginx.conf"  files:   "/tmp/my-custom-nginx.conf":    mode: "000644"    owner: root    group: root    content: |   server   {       listen 80 default_server;       listen [::]:80 default_server ipv6only=on;        # Don't redirect the health check for ELB       location /elb-health-check       {           access_log off;           return 200;       }   }    server   {       listen 80;       server_name example.com;       root /var/app/current/public;        # Redirect to HTTPs       if ($http_x_forwarded_proto = "http")       {           return 301 https://$host$request_uri;       }        # API requests to server       location /       {           proxy_pass http://localhost:3000/;       }   }   I tried connecting to the server directly on port 80, it gives me a Connection Refused error, but when I connect on port 3000, it works fine, so I'm suspecting the issue would be with nginx not allowing any requests to come in.  The listeners on the ELB are HTTP 80 -> HTTP 80, HTTPs 443 -> HTTP 80, the SSL is being handled on the ELB using Amazon certificate.  Any suggestions would be highly appreciated, thanks.

This is a  about Connection Refused    We see a lot of questions to the effect      When I try to connect to a system I get a message      Connection refused      Why is this ?


I have been running Ubuntu 13.04 successfully on a MacBook Pro in a virtual machine in Parallels Desktop 9.  Today (2013-10-17) after applying today's Ubuntu update, which included updates to X Windows, my Ubuntu 13.04 virtual machine launches, the launcher comes up, but the screen background is solid black, rather than the shaded orange colour of the default desktop background (and my desktop icons are "hidden behind this blackness", as well). I can launch applications from the launcher, and there is a very brief white flash on the screen, and then it returns to black. It's as if there is a "black blanket" covering the entire screen, so there is no way to interact with any application windows using the keyboard or mouse. The icons of the launcher are responsive to the mouse, so I can right-click and quit any application I have launched. But the rest of the screen is non-responsive to keyboard or mouse.  This same behaviour happens with two different versions of Parallels Tools, so I am quite sure this is not a Parallels problem per se, although I could believe that it could be a paroblem with the interface between Parallels and this new updated X Windows code.  Could anyone tell me what has happened, and how I might be able to fix this problem, so I can continue to use my Ubuntu 13.04 virtual machine?  (I do have the option of reverting to a previous version of my virtual machine from before this update, but if possible I would prefer to keep my version of Ubuntu 13.04 up to date with the latest updates.)  Thanks, Bob

I can install Ubuntu 13.10 in parallels ok and then log in.  Problem is Ubuntu does an update and I get black screen / desktop such that I can't see any app windows that I open.  I've tried a few of the other suggestions and they don't work for me.


I have cmus music player installed and I really like it.  I need to run a command by pressing a key, for example CTRL+F so it will open browser and search a lyrics for currently playing song.  The command might be something like:  /usr/bin/google-chrome --new-tab http://search.azlyrics.com/search.php?q=[name-of-the-song]  Is it possible and if so where and how can I define such command ?  UPDATE:  Sorry for not being clear enough. This has nothing to do with global system keyboard shortcuts (as I know how to made them). Let me explain:  I am running cmus music player and within it I am selecting a song to play and play it. Then I want to run an "external command" for this song. By running some key shortcut (while this song is played) I want to run a command that will search lyrics for this song.

I want to change the key bindings on some of the keys on my keyboard.  I want some to run commands and others to activate different keys.  What applications can I use to do this?      Index:       (from within System Settings)             I'm still looking for answers using dconf and any other method.


Hi guys I have a path that generates a extrusion from a Bevel Object, but I need certain vertices with different bevel size. I tried to select the vertices, I can tilt them pressing Ctrl+T, but I cannot change the size of the generated bevel in that specific point.

I have made a bezier tube and I want some parts of it to be large and others to be small.  When I try to set the depth for one of its vertices, it just changes the depth for the whole object. Is there a way to change the depth for separate parts of the bezier curve?


I've seen all the mathematical proofs and physics demonstrations in vacuums.  However, for example, if a hammer falls to the Earth it falls very quickly. But, it can be interpreted another way. The hammer doesn't fall to the Earth, the Earth falls to the hammer. Then, on the moon, (since the smaller gravitational acceleration) the moon falls a lot slower to the hammer than the Earth falls to the hammer.

The common understanding is that, setting air resistance aside, all objects dropped to Earth fall at the same rate. This is often demonstrated through the thought experiment of cutting a large object in half. The halves clearly can't then fall more slowly just by being sliced in two.  However, I believe the answer is that when two objects fall together, attached or not, they do "fall" faster than an object of less mass alone does. This is because not only does the Earth accelerate the objects toward itself but the objects also accelerate the Earth toward themselves. Considering the formula: $$ F_{\text{g}} = \frac{G m_1 m_2}{d^2} $$  Given $F = ma$ thus $a = F/m$, we note that the mass of the small object doesn't seem to matter as when calculating acceleration the force is divided by the $m$ term, its mass. However, this overlooks that the force is actually applied to both objects, not just to the smaller one. The acceleration on the second, larger object is found by dividing $F$, in turn, by the larger object's mass. The two objects' acceleration vectors are exactly opposite, so closing acceleration is the sum of the two:  $$ a_{\text{closing}} = \frac{F}{m_1} + \frac{F}{m_2} $$  Since the Earth is extremely massive compared to everyday objects, the acceleration imparted on the object by the Earth will radically dominate the equation. As the Earth is $\sim 5.972 \times {10}^{24} \, \mathrm{kg} ,$ a falling object of $5.972 \, \mathrm{kg}$ (just over 13 pounds) would accelerate the Earth about $\frac{1}{{10}^{24}}$ as much, which is one part in a trillion trillion.  Of course in everyday situations, we can for all practical purposes treat objects as falling at the same rate because of this negligible difference—which our instruments probably couldn't even detect. But I'm hoping not for a discussion of practicality or what's measurable or observable, but what we think is actually happening.  Am I right or wrong?  What really clinched this for me was considering dropping a small Moon-massed object close to the Earth and a small Earth-massed object close to the Moon. This made me realize that falling isn't one object moving toward some fixed frame of reference, but that the Earth is just another object, and thus "falling" consists of multiple objects mutually attracting in space.


How is $\pi$ actually defined? If it is defined as the ratio of the circumference of a circle to its diameter then from this definition itself either of the circumference and diameter has to be irrational. The circumference and diameter both are finite but $\pi$ is irrational. An irrational number is a number with never ending numbers after decimal, till now no recurrence has been discovered.   Yet there are methods to represent them in a number line which means they have finite length.  So, if we take a finite length and make a circle around it as diameter, does it mean circumference is irrational but finite? In our everyday life, do we always take rounded off values of circumference or diameter?

$\pi$ can be represented as $C/D$, and $C/D$ is a fraction, and the definition of an irrational number is that it cannot be represented as a fraction.   Then why is $\pi$ an irrational number?


i have very basic doubt - from performance point of view "is" cast or "as" cast is better to use. Though "as" does not throw exception but it does boxing and hence performance gets affected but still not sure.  if possible please give example for this

When programming interfaces, I've found I'm doing a lot of casting or object type conversion.  Is there a difference between these two methods of conversion?  If so, is there a cost difference or how does this affect my program?  public interface IMyInterface {     void AMethod(); }  public class MyClass : IMyInterface {     public void AMethod()     {        //Do work     }      // Other helper methods.... }  public class Implementation {     IMyInterface _MyObj;     MyClass _myCls1;     MyClass _myCls2;      public Implementation()     {         _MyObj = new MyClass();          // What is the difference here:         _myCls1 = (MyClass)_MyObj;         _myCls2 = (_MyObj as MyClass);     } }   Also, what is "in general" the preferred method?


i am new in ubuntu. i just install ubuntu server 9.04(old because my server only support this version).setup is complete .ip set perfectly i can ssh from other computer so ip setup is good. but i cant assess internet. when i put  =====apt-get update======  W: Failed to fetch http//us.archive.ubuntu.com/ubuntu/dists/jaunty-updates/multiverse/source/Sources 404 Not Found  E: Some index files failed to download, they have been ignored, or old ones used instead. .i guess in proxy there some problem happen. i donot have any user or password for proxy my proxy adress is 172.22.0.2:8080  i did this  export http_proxy=http://username:password@172.22.0.2:8080   but no luck. i did changes in vi /etc/bash.bashrc adding  export http_proxy=http://username:password@172.22.0.2:8080/   but no luck can you help me.how can i set my internet works .

Based on some excellent feedback by Mark here (), today I was able to use the vmware converter to clone my production server for a staging server.  However the nic won't come up no matter what I do. I attempted to inistall vmware tools, as I suspect that the fact that it is not installed might prevent the nic from working. (I have the nic set as a vmxnet3 card in the vm settings). The install failed because there were several dependencies missing as well as the Linux headers. Given that Ubuntu 9.04 has been EOL'd, the packages I need to install to get the vmware tools to install are no longer available. I doubt the ubuntu 9.04 install CD has the packages on it.   What are my options? I'd rather not upgrade the version of Ubuntu yet, as the point of the vm right now is to maintain parity with the production server. Might I have better luck resetting the driver to use vmxnet2 instead of the vmxnet3?  Thanks in advance!  Chris


I am looking at the . Is the second formula correct? $$ B_\lambda (\lambda, T) = \frac{2hc^2}{\lambda^5}\frac{1}{e^\frac{hc}{\lambda k_B T} -1} $$  If $f = \frac{c}{\lambda}$, should it not look like this? $$ B_\lambda (\lambda, T) = \frac{2hc}{\lambda^3}\frac{1}{e^\frac{hc}{\lambda k_B T} -1} $$

I am drawing a blank when it comes to equation transformation. Wikipedia  for the spectral radiance of black body:   First as a function of frequency $\nu$: $$I(\nu, T) = \frac{2 h \nu^3}{c^2}\cdot\frac{1}{e^\frac{h \nu}{k T} - 1}$$ Then as a function of wavelength $\lambda$ : $$I'(\lambda, T) = \frac{2hc^2}{\lambda^5}\cdot\frac{1}{e^\frac{h c}{\lambda k T}-1}$$   And I don't see how they get $\lambda^5$ term. I'm assuming that the transformation is just $\nu \rightarrow c/\lambda$, but that gives $$ \frac{2 h \nu^3}{c^2} \Rightarrow \frac{2 hc}{\lambda^3} \neq \frac{2hc^2}{\lambda^5} $$  Similar transformation happens at other parts in the article also. I'm obviously missing something, likely completely trivial.


Yesterday afternoon I arrived Delhi. So if I want to Inform my friends which word should I use  I am At Delhi or I am in delhi

I have found the following usage of "on", "at" and "in" on the internet. Is there any other exception and/or rule for that?  Preposition of Place Use in for  Enclosed place: in a room / in a building / in the garden / in a box / in a car / in a taxi / in a helicopter / in a boat / in a lift (elevator) Water: in the water / in the sea / in a river Line & Queue: in a row / in a line / in a queue Countries: in France / in the US / in Iran Cities: In Paris / in New York / in Tehran  Exceptions: in the newspaper / in the sky / in the bed / in the street (= in the middle of the street, standing on it. e.g. Watch out! There is a tire in the road) Use at for  general Places: at the bus-stop / at the door / at the cinema / at the end of the street (for address. e.g. I live at 21st street) Point: at the top (bottom) of the page / at the back (front) of the class / at the corner / at the door / at the entrance / at the front desk  Exceptions: at home / at work / at school / at university / at college / at the top / at the bottom / at the side / at reception Use on for  Surfaces: on the ceiling / on the wall / on the 2nd floor / on the table / on the menu / on a bicycle / on a motorbike / on a horse / on an elephant Small Islands: on Maui Directions: on the left / on the right / straight on the main street  Exceptions: on a bus / on a train / on a plane / on a ship / on the radio / on television / on the way / on the internet / on Facebook / on my weblog / on the street (e.g. Ikea have a big new store on Oxford Street) No Preposition  home / downstairs / downtown / inside / outside / upstairs / uptown  She went upstairs / He comes home / They both are outside


How can I save the gif "Graph of Tangent from Unit circle" on:    ?  Thank you.

I need a way to record my Windows desktop and save it as an animated GIF file. Here's an example:    I need GIF animations so that they can run from a web page without requiring any plugins.  I want to record and save directly as a GIF.  How can I create a GIF screencast?


This is a part of a question to show absolute convergence/divergence of improper integrals. So my professor simplified the question to this $\frac{2}{\pi} \sum\limits_{n=1}^{\infty} \frac{1}{n+1} $ and then proceeded to say that "it is a well known fact that $\sum\limits_{n=1}^{\infty} \frac{1}{n+1} $ diverges". My question is that shouldn't it converge ? As I can say that the values of the individual terms in the series $\sum\limits_{n=1}^{\infty} \frac{1}{n+1} $ will finally tend to $0$ as $n$ approaches $\infty$. I cannot ask this in class as the lectures are pre recorded and the doubt session is quite far away.

Can someone give a simple explanation as to why the       $$\sum_{n=1}^\infty\frac1n=\frac 1 1 + \frac 12 + \frac 13 + \cdots $$   doesn't converge, on the other hand it grows very slowly?   I'd prefer an easily comprehensible explanation rather than a rigorous proof regularly found in undergraduate textbooks.


What is the longest lexicographic English word?  In other words, what's the longest English word who's letters are in alphabetical order?

It's Friday again, how about some fun to get us into the weekend?  What is the longest word you can come up with for which all the letters in that word are in alphabetical order?   Rules:   English words only    Can't be a name of a place, person or other proper noun.   if it contains the same letter twice in a row, that does not disqualify it.   No fair looking it up on Google!   Update: One more rule to help you guys out.   The word can be in either ascending or descending alphabetical order.


I have following SQL-query and I have to build it up with LINQ, but it's too complex to find an easy way. :-/  Here is the query first:  SELECT * FROM tbl_a LEFT JOIN (     SELECT tbl_a.id AS id     SUM(tbl_b.amount) AS amount     FROM (tbl_a LEFT JOIN tbl_c ON tbl_a.id = tbl_c.from_this_id)         LEFT JOIN tbl_b ON tbl_c.id = tbl_b.tbl_c_id         WHERE (tbl_c.deleted = FALSE)                AND tbl_b.deleted = FALSE                AND tbl_b.status = 2         GROUP BY tbl_a.id ) tbl_tmp ON tbl_a.id = tbl_tmp.id WHERE (tbl_tmp.amount Is NULL OR tbl_a.amount > tbl_tmp.amount)       AND tbl_a.amount > 0       AND tbl_a.item_ID = item.Id       AND tbl_a.type_ID = type.Id       AND tbl_a.deleted = FALSE   I must tell you that "item.Id" and "type.Id" are parameters of type long, so you can replace them with a number.  Can someone help me to make an alternative query with same result, so I can use it with LINQ? Or can someone convert this directly to LINQ?!

Is there a tool out there which can convert SQL syntax to LINQ syntax?   I just want to rewrite basic queries with join, etc., to . It would save me a lot of time.


I am using Ubuntu 16.04. my Ubuntu software is not opening.I tried opening it through the terminal.When I type 'open Ubuntu software center', it shows 'Couldn't get a file descriptor referring to the console'. Please give me a solution.

I am a newbie in linux and I don't know how to open the Ubuntu Software Center via Terminal!! Please help


Let $R$ be an integral domain, $M$ an $R$-module and $\{m_1,\dots,m_n\}$ a set of generators for $M$. I want to show that any set of elements of $M$ with cardinality $n+1$ is linearly dependent.  My approach was as follows: After reordering we can always choose a non empty maximal linearly independent set $\{m_1,\dots,m_s\}$ for $1\leq s \leq n$ since otherwise $M$ would be torsion and the result holds trivially. Then we can consider the free module $F$ generated by this set and is easy to show that $M/F$ is torsion. Hence given any  $a_1,\dots,a_{n+1}$ in $M$ we can find non zero $x_1,\dots,x_{n+1}$ such that $x_1a_1,\dots,x_{n+1}a_{n+1}$ are in $F$. Then given that we know the result holds for free modules and given that $R$ is a domain we are done. Now to show this holds for free modules suppose for contradiction that there exists a linearly independent set of $n+1$ elements in $M=R^n$ then we get an injective map $R^{n+1}\rightarrow R^n$ which is impossible by the famous exercise 2.11 in AM. But exercise 2.11 does not assume the fact that $R$ is a domain so I was wondering whether there is a way around this that takes advantage of this further assumption.

Let $R$ be a commutative ring and $M$ a finitely generated $R$-module. Let $s$ be the maximum number of linearly independent elements of $M$, while $t$ is the minimum number of a system of generators of $M$. Show that $s\leq t$.  It is immediate in the case of vector spaces, but my first attempt (explicit computation) didn't work here due to the fact that there are coefficients (elements of $R$) without an inverse. I tried in so much other ways spending a lot of time, and I should be very glad if you cold give me a precise, complete and rigorous proof. Thank you in advance.


I have a square matrix $A$ which is $m\times m$ large, for example: $$ A=\begin{pmatrix} a & b & c\\ d & e & f\\ g & h & i \end{pmatrix} $$ and a shuffled version of it, for example: $$ B=\begin{pmatrix} a & e & b\\ d & c & i\\ h & g & f \end{pmatrix} $$ Is it possible to prove that $B$ is a product of $A$ undergoing an unknown number of row and column exchanges? (for example, swap row 1 with row 2, then, swap column 2 with column 3, ...)  As far as I know, I can disprove it if they have different values for the absolute value of their determinant, but say they have the same determinant or one has the negative determinant of the other?  How about if the matrix is not square?

Suppose I have a $n\times n$ matrix $A$. Can I, by using only pre- and post-multiplication by permutation matrices, permute all the elements of $A$? That is, there should be no binding conditions, like $a_{11}$ will always be to the left of $a_{n1}$, etc.  This seems to be intuitively obvious. What I think is that I can write the matrix as an $n^2$-dimensional vector, then I can permute all entries by multiplying by a suitable permutation matrix, and then re-form a matrix with the permuted vector.


I have a data-set which has n number of features containing both categorical and continuous values. its a binary classification problem. The data set has many missing values. I am interested in imputing the values. For features such as amount/price I could use regression, Query : I could predict the values using other features(which have missing values), is this the right way?is the predicted value good/correct enough? Can I calculate the correlation between the variables for the whole data-set with missing values?

Virtually any database we want to make predictions using machine learning algorithms will find missing values for some of the characteristics.  There are several approaches to address this problem, to exclude lines that have missing values until they fill with the mean values of the characteristics.  I would like to use for a somewhat more robust approach, which would basically run a regression (or another method) where the dependent variable (Y) would be each of the columns that have missing values but only with the rows of the table that contain all the data , and predict the missing values with this method, complete the table by the table and move to the next 'column' with missing values and repeat the method until everything is filled.  But that gives me some doubts.  Why any column start? I believe that the one with the smallest missing values until the one with the most  Is there any threshold of missing values that is not worth trying to complete it? (for example, if this characteristic only has 10% of the values filled would not it be more interesting to exclude it)  Is there any kind of implementation in traditional packages or other methods that are robust to missings?


Trying to reuse this old dell laptop,,,I can't find a ubuntu or mint distro that the cpu will accept?   Is it just too old to function?  Came with xp pro 32 bit?  Thanks for help/suggestions  John in Dallas

For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and  such as:    with a lighter desktop than the usual Gnome and Unity  with the even lighter LXDE desktop   Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements?


I am facing problem in getting value from hashmap  Map<String, Object> mapObj = new HashMap<String, Object>(); String[] strArray = {"String1", "String2"}; mapObj.put("string_array",strArray);  //trying to print: for (String entry : mapObj.keySet()) {     Log.v("", "map entry "+ entry);     Log.v("", "map value "+ mapObj.get(entry)); }   actual output: [Ljava.lang.String;@410ee550  expected : String1 String2

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]


I was trying to discover what >> meant in java, I think it's some sort of operation but not sure, so I typed it into Google: Java ">>" and got the same results as for just Java.  Is there any way to search for special characters, like same way to 'break' like how \" is used to store " in a String instead of ending the String.

As I learnt from this , Google has no ability to search for special characters. Let's say I want to search for ss!. Are there any other search engines that can achieve this? Please do not propose any programming code search engines since this is a general search.


Basically, I've created lightning select inside aura iteration , but how do i uniquely identify which specific value of each lightning select and button (upload) was clicked , as the buttons have the same label name and same aura Id (since it's inside a loop) Currently the value for all the lightning select becomes same, I want to select different values for every lightning select inside aura iteration

I've been working on a pretty complicated component, and I've had all kinds of trouble simply trying to identify which element is currently being used. After all sorts of experiments, I found a really nifty property on event, the "path" attribute. It seems to be a list of all elements that the event has gone through, and actually includes the data I'm looking for. However, I don't see this in the documentation anywhere, so I want to know if this attribute is reliable.  Here's some demo code:  <aura:application extends="force:slds">     <aura:attribute name="items" type="Integer[]" default="[1,2,3]" />     <aura:attribute name="currentIndex" type="Integer" />     <aura:iteration items="{!v.items}" var="item" indexVar="index">         <div data-value="{!index}" >             <lightning:input onfocus="{!c.focused}" name="demo" label="Text" />         </div>     </aura:iteration>     <lightning:input disabled="true" readOnly="true" type="number"                      value="{!v.currentIndex}" label="Last Focused Item" /> </aura:application>     ({     focused: function(component, event, helper) {         var index = event.path.reduce(             (a,c) => c && c.dataset && c.dataset.value !== undefined?              c.dataset.value: a, null);         component.set("v.currentIndex", parseInt(index));     } })     Does anyone know where I can find the documentation for this, or otherwise figure out if this supported behavior? I'd rather not use a feature that will be patched out of existence later, and it would finally solve  about how to actually use a supported method that doesn't involve using a class, style, or name attribute, which should ideally be used for their intended purpose.


I just read about people trying to capture neutrinos and study them. America has a lab in Antarctica and France deep under the ocean. Is it dangerous to conduct such an experiment where people live or near a river that people use for living? How dangerous could it be?

In , the Indian government is going to start a neutrino project.  Questions:   Is it harmful for people who stay there?   Will this project affect any living beings? Does it cause any pollution?


This is my query to find out primary key, foreign key in SQL Server 2008 R2:  select  *  from information_schema.table_constraints where constraint_type = 'PRIMARY KEY'   Know I need to select without primary key table in my database.  Thanks

A Google search spewed forth millions of hits on how to find tables without clustered indexed, the PK normally being the clustered index of a table. However, a table could easily have a natural key as a clustered index, and a non-clustered surrogate index, like an identity column.  How do I find all tables in a DB without a primary key defined? I have 245 tables in this DB: manual inspection is grossly inefficient.


is the sequence $a_{n+1}=\sqrt{(2+a_n)}$ convergent with $a_n=1$? using induction i was able to prove $a_n<5$ (I choose $5$ randomly) for all n and also a increasing sequence Which also I proved using induction. So can I say since a monotonic bounded sequence are convergent can we say above sequence is convergent? My induction for boundedness $a_1=1<5$ $a_2=\sqrt(3)<5$ let the statement be true for $1,...n$, $a_n<5$ $ \implies a_n+2<5+2 \implies \sqrt{a_n+2}<\sqrt{7}\implies a_{n+1}<5$ is this correct?

My solution:  Proof of (1)  $$< \sqrt{2 + 2} \text{ by I. H.}$$  $$= 2$$ As required. Therefore by PMI $\{a_n\}$ is bounded above by 2  Proof of (2)  $$(a_n - 2)(a_n + 1) < 0$$  Therefore $\{a_n \}$ is strictly increasing.   By BMCT it states that if a sequence is bounded above and strictly increasing, then it converges. Therefore this sequence by BMCT converges.   Is this correct? Is there anything else I should say or add?


Can anyone list out great sources of GDAL training? Books, videos, companies and/or people offering tutoring?

I quite often get stuck trying to solve particular problems, or getting syntaxes right.   Apart from the details provided in the links on , does anyone know of any 3rd party resources/manuals explaining it in a bit more user friendly way?


I have created the following function which is supposed to check whether the "role" column in my Database contains admin or is Null (which means it's a regular user). I try to test it in my Servlet class as shown in the code below but it redirects me to the USER JSP page every time. Is there any error in my checkRole() method? Thank you in advance.  checkRole() method  public static boolean checkRole() {      boolean find = false;     PreparedStatement pst = null;       ResultSet rs = null;       try(Connection conn= ConnectionConfiguration.getConnection()){         pst = conn.prepareStatement("SELECT * FROM users WHERE role=?;");           pst.setString(1, role);           rs = pst.executeQuery();         while (rs.next()) {        if (rs.getString("role").equals("admin") {            find = true;             } else {find = false;}         }     } catch (SQLException e) {         e.printStackTrace();     }     return find;   }   SERVLET code          {                  String pass1 = request.getParameter("password");                 String email = request.getParameter("email");              //checks whether user credentials are right and if it is admin                 if(User.validate(email,pass1) && User.checkRole()){                      request.setAttribute("email",request.getParameter("email"));                     request.setAttribute("pass", request.getParameter("password"));                     s.invalidate();                     forwardTo(ctx, request, response, "/Admin.jsp");                 }       //checks whether user credentials are right and if it is a regular user                 else if (User.validate(email, pass1) && !User.checkRole()) {                          request.setAttribute("email",request.getParameter("email"));                         request.setAttribute("pass", request.getParameter("password"));                         s.invalidate();                         forwardTo(ctx, request, response, "/RegularUser.jsp");                     }                  else {                      //show some error message                  }             }

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?


Can you please suggest a regex code that will select all words. Basically everything between whitespaces   Example-string('This is a man's world') I need to match-'This' 'is' 'a' 'man\s' 'world'

I don't really understand regular expressions.  Can you explain them to me in an easy-to-follow manner?  If there are any online tools or books, could you also link to them?


Using Python, If I have this list:  cars = {'Honda': 'Civic', 'Audi': 'A4', 'Chevrolet': 'Camaro', 'Volkswagen': 'Passat', 'Jeep': 'Wrangler', 'Pontiac': 'G6'}   Python 2.6 prints it like this:  print(cars) {'Pontiac': 'G6', 'Jeep': 'Wrangler', 'Chevrolet': 'Camaro', 'Honda': 'Civic', 'Volkswagen': 'Passat', 'Audi': 'A4'}   Python 3.3 prints it like this:  print(cars) {'Jeep': 'Wrangler', 'Honda': 'Civic', 'Pontiac': 'G6', 'Chevrolet': 'Camaro', 'Volkswagen': 'Passat', 'Audi': 'A4'}   How does Python determine the order of the printed items?   This is by default, without sorting the list first.  Why doesn't either version print the list as is?  How is this accomplished?

Here is the dictionary I have  propertyList = {     "id":           "int",     "name":         "char(40)",      "team":         "int",     "realOwner":    "int",      "x":            "int",     "y":            "int",      "description":  "char(255)",      "port":         "bool",     "secret":       "bool",     "dead":         "bool",     "nomadic":      "bool",      "population":   "int",     "slaves":       "int", }   But when I print it out with "\n".join(myDict) I get this  name nomadic dead port realOwner secret slaves team y x population id description   I know that a dictionary is unordered but it comes out the same every time and I've no idea why.


I go into edit mode for an object, select vertex mode, select one of the squares, then pull the arrow it moves just the square like it is suppose to. If I resize it then go into edit mode it no longer does this.  When I select vertex select a square, then go to move that square everything moves now, not just the vertex. Why?   I have already reset everything back to default settings and it is still doing this. It wasn't doing this yesterday, but today it is.

My problem is that I sometimes lose the ability to independently translate or otherwise transform any parts of a single mesh. If I try, for example, to just translate several faces, edges, or vertices, then the entire mesh will stretch and displace itself in order to follow the translation. Or, alternatively, if I try to translate just one face then the whole mesh will move as if I'm translating in Object Mode.  I'm not really sure I know how to describe this problem properly. I don't even know how to reliably reproduce it. It seems to happen to any given mesh at random, and it doesn't stop happening to that mesh unless I delete and remake it.  I assume that I must be doing something wrong to cause this to happen. Does anyone have any ideas? Thanks.


So I download a web page video game player. And I think it infected my system with a fake explorer.exe that uses from 100,000k RAM to 5,000,000k RAM. I have done everything in my power to get remove the virus. I have run anti virus programs and even run them in safe mode. Nothing has helped. If anyone have any ideas, please help me. Thank you.  Edit 1-1-2015  After removing Adobe Flash 15. The usage of RAM was down sized.

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


(a) Consider a sequence defined by $a_0=1$ and $a_{n+1}=(\sqrt2)^{a_n}$ . Prove that limit exists and find it.   (b) Show that the limit doesn't exist finitely if we replace $\sqrt2$ by $1.5$. What are the maximum and minimum numbers such that limit exists?  I could do the first question and the first part of the second question. For (a), by induction, each term of the sequence lies in $(1,2)$ and is therefore monotonically increasing by the recursion function. Hence the limit exists, let it be $l$, it comes $2$. For (b), the sequence is monotone unbounded above, and the limit is $\infty$ similarly. How do I do the second part of (b)?

I got this problem from my teacher as a optional challenge. I am open about this being a given problem, however it is not homework. The problem is stated as follows. Assume we have an infinite tetration as follows $$x^{x^{x^{.^{.^.}}}} \, = \, a$$ With a given $a$ find $x$. The next part of the problem was to discuss the convergence radius of a. If a is too big or too small the tetration does not converge. Below is my humble stab at the problem.  My friend said you would have to treat the tetration as a infinite series, and therefore could not perform algebraic manipulations on it before it is know whether it converges or diverges. However my attempt is to first do some algebraic steps, then discuss the convergence radius. I) Initial discussion At the start it is obvious that the tetration converges when $a=1$ (just set $x=1$) Now after some computer hardwork it seems that the tetration fails to converge when a is roughly larger than 3. II) Algebraic manipulation $$ x^{x^{x^{.^{.^.}}}} \, = \, a$$ This is the same as $$ x^a \, = \, a$$ $$ \log_a(x^a) \, = \, \log_a(a)$$ $$ \log_a(x) \, = \, \frac{1}{a}$$ $$ x \, = \, a^{\frac{1}{a}}$$ Now, if we let $a=2$ then $x = \sqrt{2}$. After some more computational work, this seems to be correct, which makes me believe this formula is correct. III) Discsussion about convergence By looking at the derivative of $ \displaystyle \large a^{\frac{1}{a}} $ we see that the maxima occurs when $a=e$, which also seems to correspond to the inital computational work. Now I think, that the minima of $\displaystyle \large a^{1/a}$ is zero by looking at its graph, studying its derivative and the endpoints. So that my "guess" or work shows that it converges when $$ a \in [0 \, , \,  1/e] $$ VI) My questions Can my algebraic manipulations be justified? They seem rather sketchy taking the a`th logarithm and so on . (Although they seem to "magically" give out the right answer) By looking at Wikipedia it seems that the tetration converge when $$ a \in \left[ 1/e \, , \, e \right] $$ This is almost what I have, why is my lower bound wrong? How can  I find the correct lower bound?


On my laptop, I have Windows 10 on first disk drive and Debian 10 on second disk drive with dual-boot functionality. However, is it possible to boot Debian 10 installation from Windows 10 through some kind of virtualization software, while Windows 10 is running?

Background: I am using VirtualBox installed on Windows 7. From within VirtualBox I am using Xubuntu as a virtual OS. The reason I chose this approach is so that I don't have to keep turning off Windows and rebooting from Xubuntu every time I needed to switch OSes. And VirtualBox's seamless mode is pretty amazing to allow me see Xubuntu and Windows 7 all in one screen.   Issue: Now I am thinking of a way to have Xubuntu more integrated into my system. By this I mean I want to have a physical partition for Xubuntu. But I want to still have the feeling of the seamless mode.  Question: So finally, my question is: is it possible to load a partition in VirtualBox as a virtual OS?   Case examples: Ideal scenario would be: I physically boot up and login to Windows 7. Now I want to access Xubuntu, so I load VirtualBox and access my Xubuntu partition without rebooting. And the other way around too, i.e. I boot up the system, login to Xubuntu, and can access the actual Windows 7 partition through VirtualBox.   Other info: Please note that I am not talking about getting access to files, as I have a completely separate partition for my files, and am very familiar with VirtualBox's Shared Folders option.


I scanned my system with CLamAV by the terminal and I wanna know what files are infected. How can I get a report for that?  I want a report on my last scan, not on the next one

I scanned pen drive using clamscan and I closed the terminal after scanning without reading the result.   Now one of my folders on the pen drive is missing. I wanted to know if clamav deleted it.   So I want to view the last scan result.


I heard both phrases in some YouTube videos and I am not sure which one's correct.  Apart from the answer, could you tell me what I should be googling for in order to understand the grammar related to this question?  I don't think it's a duplicate and I don't understand why it's marked as one. Please note that this is not the "check" vs "check out" question. I use "check out" in my example. The question here is the order of words; where comes the object,  between "check" and "out" or after "check out". As far as I know, it's a phrasal verb and I wanted to know where the object should come: before or after the particle? At the moment of asking this question, I didn't know it's called "phrasal verb" so it was difficult to find related articles on Google.

I have to make an invitation to some people. Is it correct to say "come check out our products" or "come check our products"?


So today I wanted to separate the workspace between two monitors and I shift-clicked the view I wanted to put in a new window and it worked.  The problem is that when I wanted to close it (since in any editing program I know closing the main window closes all the others and then at the startup restores them) I accidentally closed the main one and the secondary window stayed open (I was surprised a lot :D) and I don't know how to restore the main one with the top bar (you know, the one which has File, Edit...) and the original layout because in the secondary window there is only the view.  So how do I restore it?

Using blender 2.80 stable on Linux with openbox / nvidia. Once in a sudden the top menu with all my workspace was gone. Restarting blender does not help. Blender without the related file shows the menu. As soon the file is loaded it is gone. How can I get it back?


Let $0< \beta < \gamma <1$. Show that the interpolation inequality holds.  $$||U||_{C^{0,\gamma}(U)} \le ||U||^{\frac{1-\gamma}{1-\beta}}_{C^{0,\beta}(U)} ||U||^{\frac{\gamma-\beta}{1-\beta}}_{C^{0,1}(U)}.$$

Assume $0 < \beta < \gamma \le 1$. Prove the interpolation inequality $$\|u\|_{C^{0,\gamma}(U)} \le \|u\|_{C^{0,\beta}(U)}^{\frac{1-\gamma}{1-\beta}} \|u\|_{C^{0,1}(U)}^\frac{\gamma-\beta}{1-\beta}.$$   From PDE Evans, 2nd edition: Chapter 5, Exercise 2  I would love to employ Hölder's inequality which can easily justify this inequality. But Hölder's inequality requires $u \in L^p(U), v \in L^q (U)$. Instead, this problem has $u \in C^{0,\beta}(U) \cap C^{0,1}(U)$.  The textbook gives the definition of  \begin{align} \|u\|_{C^{0,\gamma}(\bar{U})} &:= \|u\|_{C(\bar{U})}+[u]_{C^{0,\gamma}(\bar{U})} \\ &= \sup_{x \in U} |u(x)|+\sup_{\substack{x,y \in U \\ x \not= y}} \left\{\frac{|u(x)-u(y)|}{|x-y|^\gamma} \right\} \end{align}  All I know so far is that, given $0 < \beta < \gamma \le 1$ ...   If $|x-y|<1$, then $\frac 1{|x-y|^\gamma}<\frac 1{|x-y|^\beta}$, which means $\|u\|_{C^{0,\gamma}(U)} < \|u\|_{C^{0,\beta}(U)}$. If $|x-y|\ge 1$, then $\frac 1{|x-y|^\gamma}\le \frac 1{|x-y|}$, which means $\|u\|_{C^{0,\gamma}(U)} \le \|u\|_{C^{0,1}(U)}$.


My networking was working fine yesterday. I shut down, went to bed, and when I booted up this morning it won't even talk to the router; network-manager crashes.   I was wondering how to upgrade packages when it can't connect to the internet. My Ubuntu 15.10 laptop (this machine) connects to the internet through the same router just fine. Some of the error report:  Title  NetworkManager crashed with SIGSEGV in nm_netlink_monitor_attach()  Unreportable reason    You have some obsolete package versions installed.   Please upgrade the following packages and check if the problem still occurs:    network-manager, libnm-glib-vpn1, libnm-glib4, libnm-util2, network-manager

When I started my laptop, there was no network service, and also no network icon in the top bar. It gives an error when I start OS like "Sorry, Ubuntu 14.04 experienced an internal error". When I click details, it says the error is occurred in the executable path usr/sbin/NetworkManager. Also, when I try to enter Network in the System Settings, it says "the system network services are not compatible with this version"  How can I solve this shocking issue?  p.s. I didn't install any third party packages/apps related with networking. Only system updates are installed.


Let $m,n\geq 0$ be integers and $k$ be an algebraically closed field. $\mathbb P^n \times \mathbb P^m$ is isomorphic to $\mathbb P^{m+n}$ if and only if $m=0$ or $n=0$.   any comments and hints would be highly appreciated.

I know that $\mathbb P^{1}\times \mathbb P^1$, as a projective variety, is not isomorphic to $\mathbb P^2$.  Now, I think that also $\mathbb P^n\times \mathbb P^m$ is not isomorphic to $\mathbb P^{m+n}$ for any $m,n$, but why? For the above statement I use the fact that any two lines in $\mathbb P^2$ intersect, but in general?  Thank you in advance.


Good day all  So I have been a member of the stackexchange site for sometime, about 2-3 years, having made a few contributions, asked a few questions and so forth, however I have noticed over the course of questions (and answers) is that each person, mostly moderators, are more focused on downvoting a question they do not deem fit for the site.   Now naturally, I can't ask a question about Newtons' laws of physics on serverfault, the same way I can't ask a C# question on Mathematica.  Here's the rub, take myself as an example, I am a university student 2nd/3rd year Bachelors in Computer Science, now I am still learning, about Mathematics, about coding methods, algorithms, etc. and say on the side I am trying to get to know Linux beter to migrate to.   Based on this, I might ask, how do I add a desktop icon in Linux Ubuntu Gnome or a similar question, but while asking the question, I find myself at a lack of the correct words, thus I am not able to make myself as clear  as I would like.  Another example would be a problem who's answer is obvious to a mod/user but not to my will be downvoted.  I and many others (this is logical) would not ask a question if I do not know the answer to it, if I ask a stupid question, why downvote, I do not know the answer, so answer me. Else I will ask the question 3 times more, till I get an answer. That is what the site is for, right? Not downvotes, if I wanted negative feedback, I will post something depressing of facebook.  This here is a case, where I am not sure if I am making myself clear, but focus more on actual helping, instead of downvoting, since a 20k rating won't in any way help me with my question being answered!  UPDATE I like to compare life situation's to my time a primary school, since all of us have been there and all of us were equals there  All of you, even you new commers to this quesiton have asked a stupid question or something you didn't get but everyone else did.   Did you teacher/educator say, "Derp, go read you text book again",etc. or did he/she come and actually help you to find the answer to 5*7?   The purpose, for anyone and everyone is to help each other, hence the master-student parable, who are you going to be, a teacher that decides because this kid didn't get it the first time now he will be left behind or will you go and help this kid, and maybe, just maybe you could be of help to someone.  In the mean time, I'll go to yahoo answers from now on,  Thanks Stackoverflow, may you repository of real-world solutions lead man into a new age of thinking, hopefully where someone might show some kind of humanity to another!

Why do I get downvoted when I try to learn something about programming on Stack Overflow? Out of all the Stack Exchange sites, this one is the most unwelcoming to people trying to learn.  There was a post where a guy asked an innocent question and one of the comments was let the voting war start.  He just wanted to learn and people were downvoting his questions but others would upvote for being genuine. The downvotes make it feel like the community may not welcome beginner and novice programmers(?). Here are a few examples from me:   I did my research, provided the code, and made the plot.  I simply want to know why it isn't turning out correct.  Downvote. Edit: tom 10 responded and said it will be helpful to show the actual equation than just the code.  If that was the reason for the downvote, why not just say "Hey, from the code we aren't sure what the true equation is"?  Again I provided code and explained that the issue was due to  (e) not having enough in the array, but I wanted to figure out how to plot still.  Downvote.  I wanted to learn what the best method and format to save images is for publication quality. Downvote.  The environment feels so unwelcoming. I am sorry to state that again.


The photograph below is available as a wallpaper in Windows 10. Where was it taken?

Windows 10 has an extensive collection of lock screen photos, many of which have  here on Travel.SE.  Is there a website which lists the location of all of these photos? I imagine Microsoft has purchased an official license, so they should have a record about the photographer and the place where the photo was taken.


Thanks for reading.  I started sculpting a mesh and noticed I wasn't in Cycles. After switching, the object no longer appears in the final render or in Render View. The object shows up just fine in the other 3D view options.  Things I have checked:  - The object is selected for viewing in the Outliner.   - The shaders are linked to the Material Output and Alpha is set to 1.  - Viewed by camera in cycles is checked in the Object tab.  If anyone knows a solution to this issue or the reason behind it, the info would be greatly appreciated.  Update: Image as requested. Camera is checked and in position. Shader and Texture Nodes Connected to Object's Material Output. 3 Point lighting using soft hemi's. All objects (even lamps currently, sigh) are on same layer.

This is meant to solve this problem once and for all. What is every reason an object isn't showing up in a render or viewport in when using the cycles render engine?


After starting up my laptop - which runs Ubuntu 14.04, I got   error: attempt to read or write outside of disk hd0   when I manage to boot using command line I got   grub>    when I write   grub> ls    I get  error: attempt to read or write outside of disk hd0   does this mean that my hdd has gone bad?  Updates: when I log in using bios, it seems that hdd is recognizable and does not seem to have an issue. My question is different than other posted question such as , in such way that grub ls does not output anything!

I tried to install Xubuntu 13.10 on an older computer. I noticed some difficulties during installation that may be relevant to my problems. Notably:   The screen resolution was extremely low. The windows were much larger than the screen and I had to move them around to get to the "Next" button. The mouse cursor was a blur of colours that was flashing all the time.   The installation finished and I tried to reboot the computer. Immediately I got:  error: attempt to read or write outside of disk 'hd0'.  Entering rescue mode...  grub rescue>   I made a  USB disk, booted it and chose the default repair. The application told me that the problem is repaired and that If this does not solve my problem I should show  to someone who can help me.  What should I do next? I already tried to install Ubuntu and Xubuntu, both with no success.  EDIT:  I found a workaround.   Insert the Xubuntu live USB Select "try Xubuntu" In the settings menu select "install Xubuntu"   This fixed the problem for me. Since it is solved I cannot test the answer.


I have the below regex to match email address with atleast one @ and one .  [-0-9a-zA-Z.+_]+@[-0-9a-zA-Z.+_]+\.[a-zA-Z]{2,4}   Am wondering can it be simplified further to match email address with atleast one @ and one .?

Over the years I have slowly developed a  that validates MOST email addresses correctly, assuming they don't use an IP address as the server part.  I use it in several PHP programs, and it works most of the time.  However, from time to time I get contacted by someone that is having trouble with a site that uses it, and I end up having to make some adjustment (most recently I realized that I wasn't allowing 4-character TLDs).  What is the best regular expression you have or have seen for validating emails?  I've seen several solutions that use functions that use several shorter expressions, but I'd rather have one long complex expression in a simple function instead of several short expression in a more complex function.


I know that a solution for this question exists on SE, I have seen it, but it doesn’t satisfy my query. I couldn’t understand the solution.  Here is an excerpt from one of the answers   $$z = e^{e^{i \theta} }$$  $$\implies z=e^{\cos \theta +i\sin \theta }$$  $$\implies z=e^{\cos \theta} e^{i\sin \theta }$$  $$\implies z=e^{\cos \theta}(\cos (\sin\theta) +i\sin(\sin \theta))$$  I didn’t understand the last line of the answer. Up to the third line, everything is clear.

How to find the real part of the complex number (in Euler's form) $ z = e^{e^{i \theta } } $ ?  I got confused on how to proceed.  I am a beginner to complex numbers.


Sorry to repeat this question, but I got no definite answer , so I am trying to state the question more clearly.   Power = force x distance / time = force x velocity.  So if we apply a small constant force, as velocity increases, we get power which keeps increasing with the velocity. How is it possible to obtain increasing power from a small constant force?   Specifically, consider a rocket in space, which has a large supply of fuel, burns fuel at a small constant rate, meaning the input power is constant and the generated force (thrust) is also constant. As it accelerates from zero to millions of m/s, we are getting increasing power from the small constant force.  How is this possible? Where does the increasing power come from, when the power from the fuel was constant?  Our assumptions   We do not approach the speed of light, so I am not seeking a relativistic solution.  I am not considering the reduction of mass of the rocket as it burns fuel. If we considered the reduced mass, then it would increase the obtained acceleration, velocity and power still further, from the small constant input power, so would not solve the problem.   Rocket theory states that thrust does not depend on the velocity of the rocket with respect to the observer, it only depends on the exhaust velocity relative to the rocket, so as the rocket accelerates (to beyond the exhaust velocity), the thrust really will be constant, by burning a small constant amount of fuel.    Previous attempts at solution  The answer which came closest to solving the problem was that when the rocket is at rest, we are accelerating both the rocket and exhaust in opposite directions, so we are spending the energy of the fuel on both, and only a small portion of the input power is used for accelerating the rocket, most of it is used for accelerating the exhaust. As the rocket speeds up, the velocity of the exhaust relative to the observer reduces, so we spend more of the input power in accelerating the rocket and less on accelerating the exhaust. However, this answer fails as the rocket exceeds the exhaust velocity, and both the rocket as well as the exhaust are moving forward relative to the observer. Now, as the rocket accelerates forward, the exhaust accelerates forward too, so the power for accelerating both keeps increasing again, so we get an increasing power from a small constant input power. How is this possible?  Also someone commented that we are not getting increasing power, but we have to provide increasing power to keep accelerating under a small constant force. How does this help to solve the problem in our scenario? We are still burning fuel at a small constant rate and the rocket keeps accelerating. Where does the extra power that we need to “provide” come from? Why does the rocket keep accelerating although the equation clearly states that it cannot do so unless we provide increasing input power (increasing fuel)?

From this  by orlp:     If I strap a rocket booster to a rocket in space and fire it for one second, then the work provided is much higher when the rocket is flying fast compared to when the rocket was stationary. In both cases the rocket fires for the same duration but in the former case the rocket travels a much greater distance during this period. What gives?


When I try to update my JavaFX app when the server adds a client, I receive a nullpointer for my FXML listview when I use my update function. Any clue why it will work in my intitialise and my events but not in my update method  FXMLController  public class FXMLController implements Initializable, Remote, ClientObserver {       @FXML private ListView listview;          List<RMIClient> clients;     RMIServer server;      public FXMLController(RMIServer server) throws RemoteException     {         this.server = server;     }      @Override     public void initialize(URL url, ResourceBundle rb) {         if(server != null) {             try {             ObservableList<RMIClient> clients = FXCollections.observableArrayList();             clients.addAll(server.getClients());             if(listview.getItems() == null)                 this.listview.setItems(clients);             else                 this.listview.getItems().setAll(clients);             } catch (RemoteException ex) { }         }     }          @Override     public void update() {        System.out.println(listview);     }  }   My Mainapp  public class MainApp extends Application {      public static RMIServer server;     private FXMLController controller;     @Override     public void start(Stage stage) throws Exception {         FXMLLoader loader = new FXMLLoader();         loader.setLocation(getClass().getResource("/fxml/Scene.fxml"));         controller = new FXMLController(server);         loader.setController(controller);         server.setObserver(controller);         Parent root = loader.load();          Scene scene = new Scene(root);         scene.getStylesheets().add("/styles/Styles.css");          stage.setTitle("RMINetwork Centre");         stage.setScene(scene);         stage.show();     }      /**      * The main() method is ignored in correctly deployed JavaFX application.      * main() serves only as fallback in case the application can not be      * launched through deployment artifacts, e.g., in IDEs with limited FX      * support. NetBeans ignores main().      *      * @param args the command line arguments      */     public static void main(String[] args) {           try           {             server = (RMIServer) Naming.lookup("rmi://localhost:1099/" + RMIServer.class.getTypeName());           }           catch(Exception e) { }           launch(args);     }  }   Scene.fxml  <BorderPane prefHeight="350" prefWidth="500" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" >    <left>     <ListView fx:id="listview" prefHeight="398.0" prefWidth="152.0" onMouseClicked="#ChangeContext" /> </left> </BorderPane>   Server class :  public class Server extends UnicastRemoteObject implements RMIServer {      private List<RMIClient> clients;     private ClientObserver observer;       public Server() throws RemoteException      {         this.clients = new ArrayList<>();     }      @Override     public void registerClient(RMIClient client) throws RemoteException      {         this.clients.add(client);         if(observer != null)          {               this.observer.update();          }     }      @Override     public void removeClient(RMIClient client) throws RemoteException      {         this.clients.remove(client);         if(observer != null)          {              this.observer.update();          }     }          @Override public String notifyClient(int index, RMICommand cmd) throws RemoteException  {     return this.clients.get(index).executeCommand(cmd); }  @Override public List<RMIClient> getClients() throws RemoteException {     return this.clients; }  @Override public void setObserver(ClientObserver observer) throws RemoteException {     this.observer = observer; }   So has anyone a clue to solve my problem?  Kind Regards

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


This is recent behavior, but I couldn't figure out since exactly when this is happening:  % !TEX encoding = UTF-8 Unicode % !TEX TS-program = pdflatexmk \documentclass{beamer}  \usepackage{filecontents}  \begin{filecontents}{foo.bib} @misc{Fallick2004a, author = {Fallick, Bruce and Fleischman, Charles A.}, title = {{Employer-to-Employer Flows in the U.S. Labor Market: The Complete Picture of Gross Worker Flows}}, url = {http://www.federalreserve.gov/econresdata/researchdata/feds200434.html}, year = {2004} } \end{filecontents}  \usepackage[     backend=biber,     style=authoryear-comp,     natbib=true ]{biblatex} \bibliography{foo} \begin{document}  \begin{frame} \citet{Fallick2004a} \end{frame} \end{document}   Output:  Fallick and Fleischman, (2004)   This happens for all sorts of references, but only textcite and citet, not citep. I tried re-installing   sudo apt-get install texlive-full   to no avail.

I've been using the biblatex package for a while, and since updating my TeX installation (post-el capitan upgrade) I have been experiencing the following.   If the following is typed:  Such and such has been said \citep[111]{citekey}.   The following text is displayed:  Such and such has been said (Author, 2016, p. 111).   And if the following is typed:  \citet[111]{citekey} has said such and such.   The following text is displayed:  Author, (2016, p. 111) has said such and such.   The citep command is working as I want it to, but I do not want a comma placed after the author's name when using the citet command. I would like it to display as follows:  Author (2016, p. 111) has said such and such.    If I use the \citeyearpar command, it is fine, but I would rather not have to type the author's name in manually.   Here is the command placed in the preamble:  \usepackage[backend=bibtex, style=authoryear-icomp, url=true, isbn=false, natbib=true, sortcites=true, block=space, pagetracker=false, loccittracker=constrict]{biblatex}   Here is an example of an entry in my bib file (made using BibDesk):  @article{poldrack2006, Author = {Poldrack, Russell}, Journal = {Trends in Cognitive Sciences}, Number = {2}, Pages = {59--63}, Title = {{Can cognitive processes be inferred from neuroimaging data?}}, Volume = {10}, Year = {2006}}   I have also tried changing the entry to the following:  @article{poldrack2006, Author = {Russell Poldrack}, Journal = {Trends in Cognitive Sciences}, Number = {2}, Pages = {59--63}, Title = {{Can cognitive processes be inferred from neuroimaging data?}}, Volume = {10}, Year = {2006}}   The bibliography entry appears as follows, and is fine:  Poldrack, Russell (2006). “Can cognitive processes be inferred from neuroimaging data?” In: Trends in Cognitive Sciences 10.2, pp. 59–63.  Thank you for any help that can be offered.


I am looking for references to the following problem, which I saw a long time ago and I think is a well-known problem (maybe from IMO or American Mathematical Monthly), I hope to remember it correctly.  Problem. Let $a$ and $b$ be two positive integers. If $a^n - 1$ divides $b^n - 1$ for all the positive integers $n$, then $b = a^k$ for some positive integer $k$.  Thank you in advance for any answer.  EDIT: As noted by cr001, a solution to the problem was given on Math.StackExchange (see ). However, what I am asking for is a reference to a journal or book.

We can prove that there is no integer $n>1$ such that $2^n-1\mid 3^n-1$. This leads to the following question:     Is it true that for every pair of primes $p<q$ there are only finitely many integers $n$ such that $p^n-1\mid q^n-1$? Are there two primes $p<q$ and an integer $n>p+q$ such that $p^n-1\mid q^n-1$?Is it true that if $n>6$ then $2^n-1\nmid 5^n-1$?   Edit: Here are some examples: \begin{array}{ll} 2^{36}-1\mid 41^{36}-1, &3^{12}-1\mid 97^{12}-1,\\ 5^{6}-1\mid 37^{6}-1, &7^{4}-1\mid 151^{4}-1. \end{array}  Now I prove there is no integer $n>1$ such that $2^n-1\mid 3^n-1.$  Proof: Denote $A=2^n-1$ and $B=3^n-1$. If $n$ is even then $3$ divides $A$ but not $B$, a contradiction.  If $n$ is odd then $A\equiv -5\pmod {12}$. Since every prime greater than $3$ is $\equiv \pm1,\pm5 \pmod {12}$, some prime factor $p$ of $A$ must be congruent to $\pm5 \pmod {12}$. As $p \mid B$, we have $3^{n+1}\equiv 3 \pmod p$. Since $n+1$ is even, we get $(\frac{3}{p})=1$, a contradiction again.


Edit:  Of course my real code doesn't look exactly like this. I tried to write semi-pseudo code to make it more clear of whay I wanted to do.  Looks like it just messed things up instead.  So, what I actually would like to do is this:  Method<Interface1>(); Method<Interface2>(); Method<Interface3>(); ...   Well ... I thought that maybe I could turn it into a loop using reflection. So the question is: How how do I do it. I have very shallow knowledge of reflection. So code examples would be great.  The scenario looks like this:  public void Method<T>() where T : class {} public void AnotherMethod() {     Assembly assembly = Assembly.GetExecutingAssembly();      var interfaces = from i in assembly.GetTypes()     where i.Namespace == "MyNamespace.Interface" // only interfaces stored here     select i;      foreach(var i in interfaces)     {         Method<i>(); // Get compile error here!     }       Original post:  Hi!  I'm trying to loop through all interfaces in a namespace and send them as arguments to a generic method like this:  public void Method<T>() where T : class {} public void AnotherMethod() {     Assembly assembly = Assembly.GetExecutingAssembly();      var interfaces = from i in assembly.GetTypes()     where i.Namespace == "MyNamespace.Interface" // only interfaces stored here     select i;      foreach(var interface in interfaces)     {         Method<interface>(); // Get compile error here!     } }   The error I get is "Type name expected, but local variable name found". If I try  ...     foreach(var interface in interfaces)     {         Method<interface.MakeGenericType()>(); // Still get compile error here!     } }   I get "Cannot apply operator '<' to operands of type 'method group' and 'System.Type'" Any idea on how to get around this problem?

What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?  Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod<T>() using the Type stored in the myType variable?  public class Sample {     public void Example(string typeName)     {         Type myType = FindType(typeName);          // What goes here to call GenericMethod<T>()?         GenericMethod<myType>(); // This doesn't work          // What changes to call StaticMethod<T>()?         Sample.StaticMethod<myType>(); // This also doesn't work     }      public void GenericMethod<T>()     {         // ...     }      public static void StaticMethod<T>()     {         //...     } }


I am specifically interested in my syntax highlighting changes I made. Is there some kind of configuration file I can import to transfer my settings?

Does someone know, how to save all the settings of Texstudio and restore them in a simple way?  Thank you in advance!


For an (N+1)x(M+1) matrix A, what does the notation  A[i,1:M] mean?

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


I have to fill out a form and I want to fill it in Latex. How can I insert the pdf/word file with the form and write on it in latex?  Thank you!

I'd like to create a LaTeX document that when rendered into PDF, has forms that can be filled out using Adobe Reader or other such programs. Then I'd like to be able to extract the data. I deliberately would like to avoid using Acrobat for all the usual reasons (non-free, need different versions for different platforms etc).   Can this be done ?


This may be an unenlightening question, but I'm just not sure about the result and hoping someone can help me varify it.  $\\$  This question is related to   .  $\\$  I want to construct the isomorphism relationship between the  $SL(2,\mathbb{C})$ and $SU(2)$. I have the feeling that there should be some such isomorphism of groups.  $\\$  To begin, we know that as   $$ \mathfrak{sl}(2,\mathbb{C}) \simeq \mathfrak{so}(1,3) $$  and  $$ \mathfrak{su}(2) \oplus \mathfrak{su}(2) \simeq \mathfrak{o}(4) $$  But we also know that  $$ \mathfrak{so}(n) \simeq \mathfrak{o}(n) $$  so I believe that this allows us to write  $$ \mathfrak{su}(2) \oplus \mathfrak{su}(2) \simeq \mathfrak{sl}(2,\mathbb{C})  $$  This makes sense anyway, since we know that the real algebra of the complexification of $\mathfrak{su}(2)$ is $\mathfrak{sl}(2,\mathbb{C})$, and in taking the real algebra of the complexified Lie algebra we get two commuting copies.  So, the part that I am not yet convinced about is how to get from this relationship between algebras to a relationship between groups.  I was told by someone in the department that     Theorem The Fundamental Theorem of lie Groups: Let $G_1$, $G_2$ be Lie groups. Then $G_1$ and $G_2$  have isomorphic Lie algebras if and only if they are locally isomorphic.   So this is a local statement only.  Moreover, he said that there is an extension of this theorem to a global statement which says that the Lie groups are globally isomorphic if they are simply connected.  Now, for our two groups, $SL(2,\mathbb{C})$ and $SU(2)$, we know that they are indeed simply connected. We could prove this, or instead, recall that they are the  of $SO(1,3)\uparrow$ and $SO(3)$ respectively, and so by the definition they must be simply connected.  This would solve our problem, and we could write down   $$ SU(2) \times SU(2) \simeq SL(2,\mathbb{C})$$  and be done.  $\\$  However I want to try to verify that statement, as opposed to taking it in blind faith (not that I have any reason to doubt it, but rather that I'd like to 'learn it' as opposed 'to be aware of it', if that makes sense).  $\\$  I tried looking it up, and the  source didn't have anything on a Fundamental Theorem of Lie Groups, only a short bit on .  Some searching brought up  lecture notes (in .pdf format) from UCLA. It appears to be getting at what I want, but unfortunately is written in category theoretic language, which I know nothing about.  $\\$  Could anyone verify for me if this is correct, and perhaps point me to a book/ website/ lecture notes etc. where I could reference. (Our library is huge, so a book being online need not be a constraint).  $\\$

I'm a beginner of QFT. Ref. 1 states that      [...] The Lorentz group $SO(1,3)$ is then essentially $SU(2)\times SU(2)$.    But how is it possible, because $SU(2)\times SU(2)$ is a compact Lie group while $SO(1,3)$ is non-compact?   And after some operation, he says that the Lorentz transformation on spinor is complex $2\times2$ matrices with unit determinant, so Lorentz group becomes  $SL(2,\mathbb{C})$. I'm confused about these, and I think there must be something missing.   References:   L.H. Ryder, QFT, chapter 2, p. 38.


I am trying to read a raster tiff [RGBA] file with GDAL in [C++], I can load the file, get  the number of channels, the size of the bands and the metadata, but when I try to extract the Band [R, G or B] I get the images in gray scale but all of them has the same values; so when I try to merge them with opencv I get a Gray image and not the RGB, The code that I use to do this process is below... Could you give me an idea of what I am doing wrong?   I read the following answers and the GDAL doc but dont get a good result...  Link 1:    Link 2:   [I use this code and also try the GDALRASTERIO method]   Code:      // Register all Drivers     GDALAllRegister();      // Load the raster     GDALDataset *dataset = (GDALDataset *) GDALOpen(path, GA_ReadOnly);     // Get some features of the raster     int raster_cols = dataset->GetRasterXSize(),             raster_rows = dataset->GetRasterYSize(),             raster_channels = dataset->GetRasterCount();     // keep data - Channels and Type of the image    std::vector<std::string> raster_bandName(raster_channels),                             raster_BandType(raster_channels);     std::vector<cv::Mat> Mybands(raster_channels, cv::Mat( raster_rows, raster_cols, CV_8UC1 )); // Byte[Raster] -- 8U [OpenCV]    cv::Mat img;     // Walk over the bands ---     for(int i = 1; i < raster_channels; i++)     {         // Get the data of the available bands          GDALRasterBand *poBand = dataset->GetRasterBand(i);         raster_BandType[i-1] = GDALGetDataTypeName(poBand->GetRasterDataType());         // Get some descriptor of the band that was loaded          raster_bandName[i-1] = GDALGetColorInterpretationName(poBand->GetColorInterpretation());          std::string ban = raster_bandName[i-1];          poBand->RasterIO(   GF_Read, 0, 0, raster_cols, raster_rows,                              Mybands[i-1].data, raster_cols, raster_rows,                              GDT_Byte, 0, 0 ); // Write the Image data in the OpenCV var           std::cout<<raster_BandType[i-1]<<" "<<raster_bandName[i-1]<<std::endl;      }      cv::merge(Mybands,  img );   Update: The following code works for me, I don't see a real difference but It returns the desired image.....   GDALAllRegister(); GDALDataset *dataset = (GDALDataset *) GDALOpen(path, GA_ReadOnly); int raster_cols = dataset->GetRasterXSize(),                   raster_rows = dataset->GetRasterYSize(),                   raster_channels = dataset->GetRasterCount();      for(int i = 1; i < raster_channels; i++)     {         // Save the channel in var not in the vector of Mat         cv::Mat bckVar(raster_rows, raster_cols, CV_8UC1  );          GDALRasterBand *poBand = dataset->GetRasterBand(i);          poBand->RasterIO(   GF_Read, 0, 0, raster_cols, raster_rows,                              bckBar.data, raster_cols, raster_rows,                              poBand->GetRasterDataType(), 0, 0 );         // Image is a std::vector<cv::Mat> image;         image.push_back( bckBar.clone() );         // Clean mm         bckBar.release();     }      cv::merge( image, usrImage2w );// RGB ok

I am trying to open a spectral file and move bands of data from GDAL to OpenCV's Mat data structures. As of now I am just trying to make sure that I can correctly access each band using GDAL and pull the pixel data.   So I want to explain what I think the following code is doing and if I am wrong(must be) then please correct me. It opens the file and loads the dataset. Then I get raster band 1 assigned to currentBand. The float pointer is then made to point at enough memory for one line of pixel data. RasterIO gets this data and places it in the newly allocated space. I then traverse the array printing the value that has been placed in each element.  (Code in c++)  GDALDataset  *dataset; GDALRasterBand *currentBand; int blockXSize, blockYSize; GDALAllRegister(); dataset = (GDALDataset *) GDALOpen( specImag->filename.c_str(), GA_ReadOnly );  currentBand = dataset->GetRasterBand(1); currentBand->GetBlockSize(&blockXSize, &blockYSize);  float *fScanline; fScanline = (float *) CPLMalloc(sizeof(float)*specImag->widthx);  currentBand->RasterIO( GF_Read, 0, 0, specImag->widthx, 1,                           fScanline, specImag->widthx, 1, GDT_Float32, 0, 0 );   for(int i=0; i<specImag->widthx; i++){         std::cout << "Data Point ";         printf("%d", i);         std::cout << " is: ";         printf("%d", fScanline[i]);         std::cout << std::endl;     }   (the code is not complete and will not run as is)  When I run the code I get the same number (ex. 421076 or 4210432) for every element in the array. If I wait a little bit and run the program again I get a different number than the prevous run but still the same in each element.   What am i missing when it comes to accessing the pixel/data in each band?


I am a Russian citizen with a visa to enter the UK. Can I return to Russia in transit via Brussels without any other visa?

I found many related questions on this site but I am still not sure about the rules. How can I decide if I need a visa to transit? Schengen members as of May 2021 are as follows:  Austria Belgium Czech Republic Denmark (excluding Greenland and the Faroe Islands - but an open border with the Schengen Area is maintained) Estonia Finland France (excluding overseas departments and collectivities) Germany Greece Hungary Iceland Italy Latvia Liechtenstein Lithuania Luxembourg Malta Netherlands (excluding Aruba, Curaçao, Sint Maarten and the Caribbean Netherlands) Norway (excluding Svalbard) Poland Portugal Slovakia Slovenia Spain (except Ceuta and Melilla) Sweden Switzerland


Find the roots of the equation $$2000x^6+100x^5+10x^3+x-2=0.$$ I am struggling finding a root using rational root theorem. Even if I get a root, I have to find all the roots. Please don't use WolframAlpha, I am looking for an approach, etc. Thanks.

One of the roots of the equation $2000x^6+100x^5+10x^3+x-2=0$ is of the form $\frac{m+\sqrt{n}}r$, where $m$ is a non-zero integer and $n$ and $r$ are relatively prime integers.Then the value of $m+n+r$ is?     Tried to use the fact that another root will be $\frac{m-\sqrt{n}}r$ as coefficients are rational but there are six roots and using sum and product formulas would allow many variables in the equations.


I have taken a course in general topology this semester.while solving problems,i find it difficult to go by the definition which says that a space is compact if every open cover of it has a finite subcover. To prove a set is compact in any arbitrary topological space, I know they must show that for every open cover there's a finite subcover, the problem is that I can't see intuitively how one could show this for every cover. Also when trying to disprove compactness the books I've read start presenting strange covers that I would have never thought about. I think my real problem is that I didn't get yet the intuition on compactness.  If the space is subset of $R^n$, then I can easily verify the compactness by using Heine Borel  theorem,which is rather more geometrically motivated.  but can i give some geometrical arguments to answer compactness of set in arbitrary topological space.if such method exists, please give some references to show how to understand the process of proving (and disproving) compactness?

I have a question that may be regarded by many as duplicate since there's a  one at MathOverflow. The point is that I think I'm not really getting the idea on compactness. I mean, in $\mathbb{R}^n$ the compact sets are those that are closed and bounded, however the guy who answered this question and had his answer accepted says that compactness is some analogue of finiteness. That's the first problem: In my intuitive view of finiteness, only boundedness would suffice to say that a certain subset of $\mathbb{R}^n$ is in some sense "finite". On the other hand there's the other definition of compactness (in terms of covers) which is the one I really need to work with and I cannot see how that definition implies this intuition on finiteness. Also, I feel it's pretty strange the covers people use when they want to deal with compact sets. To prove a set is compact I know they must show that for every open cover there's a finite subcover; the problem is that I can't see intuitively how one could show this for every cover. Also when trying to disprove compactness the books I've read start presenting strange covers that I would have never thought about. I think my real problem is that I didn't yet get the intuition on compactness. So, what intuition should we have about compact sets in general and how should we really put this definition to use? Can someone provide some reference that shows how to understand the process of proving (and disproving) compactness?


Is it possible by some means to define a notion of sum over the elements of an uncountable set $S$ of real numbers.I thought of something like $\sum_{\alpha \in \tau }  a_\alpha:=\sup_{T\subset S ,|T|=\aleph_0}\sum_{a_{\alpha}\in T}a_\alpha$ where $\tau$ is the index set.Does this makes much sense?

I was wondering whether it makes sense to use the $\sum $ notation for uncountable indexing sets. For example it seems to me it would not make sense to say  $$ \sum_{a \in A} a \quad \text{where A is some uncountable indexing set e.g. some $A \subset \mathbb{R}$ } $$  Would it be better to avoid the above notation in general for uncountable indexing sets ? Any help in making better sense of this would be very appreciated.


I installed google earth, using the 32bit google-earth-pro.deb for linux from google's website. Since then, however, I've had a repeating error: Whenever I open google earth, the it copies my background screen and shows that, instead of the normal google earth map:    As you can see, the normal map is just in one tiny corner. What could be causing this?

I have the same problem as is described  but that question does not have an answer and its OP does not seem like they will ever answer the arisen questions. I installed google-earth-pro-stable_current_amd64.deb via sudo apt install on Ubuntu 16.04 64 bit. Deleting ~/.xinputrc did not change anything. When I log into a different account (account on my machine, that is – I do not think the commenter meant a different Google account (I did not log into any Google account)), I experience the exact same problem. It is not like a glitch which occurs for a few seconds and then vanishes. Google Earth just is not usable because the map never shows up. It always shows the controls, part of the splash screen, and whatever was in the background when the application was launched.


I have a .NET 3.5 Winforms project. This project has a main form with a toolbar on it with a toolbar button in it. And a simple normal button dropped directly on to the form.  When the main form starts up a smaller sub form is loaded up too in the load event of the main form with the .Show method (so it is not modal which is important).  The focus is on this subform.  When I hover with the mouse over the toolbar button in the main form it responds to the mousehover event but when i click the toolbar button the main form first receives focus, so I have to click again. Only then the click event is fired. When I however do this to the normal button it immediatly responds to the click wether the sub form has focus or not.  So my question is why does this happen? And how can I prevent it so my endusers do not need to click the toolbar button twice?

I have a .NET 2.0 WinForms application with a ToolStrip on my main form. Sometimes, the ToolStrip icons don't respond to the first mouse click, so I have to click the icon twice. It's just a standard ToolStrip with several icons and tooltip texts, I don't do anything special. Is this common?