Why does an image of the panel appear to left side of the actual object when the picture is taken if the lamp in a switched on state?

An acquaintance recently posted an image to FB from his recent trip to the JFK Historic Site asking for an explanation of a visible artifact he states was not visible to the naked eye but was visible through the EVF of his camera and in the final image.    The artifact is a series of bright, nearly-vertical bars and a longer, almost horizontal bar superimposed over the lower part of the door frame and the radiator.  I found a very similar artifact in another image of the same room from a blogger which isn't as compressed:    In both cases the artifact seems to be a vertically inverted image of the post and rail outside the saturated window.  From looking at other images of the room available online I know there is spherical glass ornament topping the table lamp whose shape is visible at the left of the photo.  One response to the OP's question is as follows:     RK: It is lens flare. So, even on an iPhone, the camera lens is made   up of multiple lenses. Each designed to focus the image and make sure   it isn't distorted. Remember a lens bends light.  Sometimes, based on   angle and intensity of the incoming light, some stray light bounces   back and forth while traveling through the various elements that make   up what we think of as a camera lens (some of mine have 16 elements   inside a single lens.) Even the best glass is capable of reflecting   some light instead of passing it through the lens elements to the   sensor.  This is what you are seeing. The railing is overexposed, and   some stray light is bouncing around a bit inside the lens.   My response:     DJ: I don't think it's lens flare or ghosting. Those usually form an   image of starbursts, rings, or circles in a row across the image or in   the shape of the aperture; or a veiling glare or haze. This is forming   an image of the light outside minus objects in its path. It is more   likely a direct reflection/projection off a mirror or the glass in a   picture frame elsewhere in the room onto the opposite wall and the   radiator. There are two other clues which seem to confirm this. First,   the image has a gradiated appearance, it is less distinct in the   relatively bright area on the door frame and brighter in the   relatively darker areas behind and on the radiator. You would expect   lens flare to be more evenly specular. Second, the image representing   the light from below the horizontal rail changes angle on the   different faces of the door frame. Unlike a projection, lens flare is   an image created within the lens, the physical shape of the objects it   superimposes do not change its shape.      OP: If that were the case, would I have been able to see said   reflection in the room without the camera? There was no image I could   see with the naked eye. I notice the image in my phone before I took   the pic and did a double, triple and quadruple take before I took it   so I'm sure.      DJ: It would have been visible at the moment the image was taken, but   it may not have appeared nearly as bright and distinct because your   eyes were accommodating for the bright light coming in the window. The   projection could have easily been obscured by you or anyone around you   changing position or moving through the path of the projected   reflection. Also, it's been caught by other people... (see Image 2)   Notice that, in the linked example, the projection is again distorted   by the surface it falls on.   Anyone else want to chime in with an explanation?


I'm studying algorithms and I've met a problem, that I can't solve.  for(int i = 0; i < n; i++)     for( int j = 0; j < i; j++)         sum++;   So, time complexity of this code is n^2. But. First loop is iterating n times and I understand that. But second one is iterating n(n+1)/2. So.. It becomes n*(n(n+1))/2. Where I went wrong?

I need to calculate the time complexity of the following code:  for (i = 1; i <= n; i++) {   for(j = 1; j <= i; j++)   {    // Some code   } }   Is it O(n^2)?


Any ideas where the driver can be found or how to activate the scanner driver if it is hidden in the printer driver?

I've got the new Canon Pixma MG 3150 and so far, I can't seem to find a driver anywhere. I do have the CD for both Windows and Mac, but this doesn't help me, as I have Ubuntu 11.10. I'd prefer to have it running on the wifi.  I'm really new to this, so I need for you to explain this to me as basically as possible.


I have this problem,  Let $$p_n(x)=nx^{n+1}-(n+1)x^n+1 \in \mathbb Q[x]$$ for any positive integer $n$. Show that there exist a polynomial $q_n(x) \in \mathbb Q[x] $ satisfying $p_n(x)=(x-1)^2q_n(x)$.  initially I thought that I could use the division algorithm, such that $p_n(x)=(x-1)^2q_n(x)+v(x)$ but is there a reason that we could say that $v(x)=0$?

Prove that the polynomial $f_n(x)=nx^{n+1}-(n+1)x^n+1$ is divisible by $(x-1)^2$  where $n\in\Bbb{N_1}$.  My Attempt   I've tried proving it by induction but can't find a way to prove it for $n+1$ after assuming it holds for $n$; I've also checked it graphically, it seems that for all $n$ $f_n$ intersects the axes at $(0,1)$ and $(1,0)$; I've also tried finding a factor $k$ such that $(x-1)^2k=f_n(x)$ for $n=3, n=4$ on WA but with no luck.


I'm trying to use Guice 4.0 for web applications with Tomcat 8. I tried to do example from wiki but the I get this error in Tomcat Localhost log:      28-Nov-2015 16:36:26.136 SEVERE [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class com.nirus.guice_confige.MyGuiceServletConfig  java.lang.NoClassDefFoundError: com/google/inject/servlet/GuiceServletContextListener     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:760)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2496)     ...   This is my web.xml file:  <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"          version="3.1">     <filter>         <filter-name>guiceFilter</filter-name>         <filter-class>com.google.inject.servlet.GuiceFilter</filter-class>     </filter>      <filter-mapping>         <filter-name>guiceFilter</filter-name>         <url-pattern>/*</url-pattern>     </filter-mapping>       <listener>         <listener-class>com.nirus.guice_confige.MyGuiceServletConfig</listener-class>     </listener>  </web-app>   And my config file for Guice:  public class MyGuiceServletConfig extends GuiceServletContextListener {     @Override     protected Injector getInjector() {         return Guice.createInjector(new ServletModule(){             @Override             protected void configureServlets() {                 serve("/JoinLobby").with(JoinLobby.class);                 serve("/UpdateLobby").with(UpdateLobby.class);                 bind(ILobby.class).to(Lobby.class);             }         });     } }   UPD1: This is my Maven pom.xml file      <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">     <modelVersion>4.0.0</modelVersion>      <groupId>NiRus</groupId>     <artifactId>ImagServerApp</artifactId>     <version>0.0.1-FirstStep</version>      <dependencies>         <dependency>             <groupId>com.google.code.gson</groupId>             <artifactId>gson</artifactId>             <version>2.5</version>         </dependency>         <dependency>             <groupId>com.google.inject</groupId>             <artifactId>guice</artifactId>             <version>4.0</version>         </dependency>         <dependency>             <groupId>com.google.inject.extensions</groupId>             <artifactId>guice-servlet</artifactId>             <version>4.0</version>         </dependency>     </dependencies> </project>

I am getting a NoClassDefFoundError when I run my Java application.  What is typically the cause of this?


Here is my Map   Map<id,List<Custom_Report_2__c>> mapreports= new Map<id,List<Custom_Report_2__c> >(); for( Custom_Report_2__c  cr:cr1){      mapreports.put(cr.Associated_Loan__c,new List<Custom_Report_2__c>());      mapreports.get(cr.Associated_Loan__c).add(cr); }   Even mapreports stores only one record where as there has to be 200 records :( This list of Custom report has 200 records per id.  when i try to get all the records thru for loop i get only i record per id with its list.  for(list<Custom_Report_2__c> ad : mapreports.values()){      system.debug('a'+ad); }   This for loops accepts only list <Custom_Report_2__c>  how do i store all the values for the map returned.   Correct me if my declarations are wrong.

I have a custom object called entity_c, this has a field called product which is a lookup to product. There could be many records in entity_c for a particular product.  I need to store it in a map with productId as the key and all the records for that product in a list.  Here is what i have till now    Map<id,List<Entity__c>> mapProductEntity = new    Map<id,List<Entity__c>>();   for(Entity__c et : [SELECT name,Field1__c, Product__c, Field2__c FROM Entity__c WHERE Product__c IN : Items ORDER BY Product__c ]{         if (mapProductEntity.containsKey(et.Product__c)){             mapProductEntity.get(et.Product__c).add(new Entity__c(    field__c = et.field1__c,product__c = et.product__c, field2__c = et.value__c ));         }         else{       // Not sure how to add it for first time                    //mapProductEntity.put(et.Product__c, lsEntit.add(new Entitlement__c(   field1__c = et.field1__c,product__c = et.product__c, field2__c = et.value__c )));         }   Is this a right approach? Is there a simpler way to do it?


I have a model with an animated shader on it, and I would like to export it to fbx, but without losing this animation is it possible?

I used node textures in a mesh I exported to .FBX.  I then imported it into Unreal Engine 4 and it didn't import any textures; I clicked the Upload Textures option in Unreal Engine.  Is there something I'm doing wrong or is it Blender?


I currently: Pay with a credit card, get my 3% cashback, and then pay off the credit card with my debit card.  What I would like to do is: Use a credit card (to get my 3% Cash back) to withdraw cash, then spend the cash, then pay off the credit card with my debit card.   Is there any way to do this without paying a cash advance fee (or any fees in general)?

I've been curious about something for a few days now, but I couldn't find out the reason elsewhere.   Reading through, for example, the Square terms and conditions (), they state      ... you will not (a) ... (b) provide yourself a cash advance from your   credit card ...   But what is the reason they don't allow this to happen via their services? Note, I am definitely not asking if using Square, or other services, to do this sort of thing should be something I should be doing, but what's in it for Square to refuse this type of transaction? Wouldn't they get a piece of the transaction like any other and profit from this? Or is there pressure or deals with the credit card companies they accept, stating that they will do their best to refuse this behavior?


Story: protagonist receives a device, which looks like a portable computer, and has to use his “quantum reality version selection” abilities to pick the one reality’s version where the computer has finished calculations.   After that is done, it is revealed that the object of calculations was some bio/nano-technological weapon that is released to the world shortly after, but is stopped without any harmful consequences.  2000–2008, full-length color movie, happy end included.

Basically our thoughts are ruining everything. Like when humans are taught stars are giant balls of gas. To the rest of the universe they aren't but humans think it and destroy alien planets. I think they come to seal us off from the rest of the universe.


Please explain what is this? or Please explain what this is?   Which one is grammatically correct?

We always change subject and verb positions in whenever we want to ask a question such as "What is your name?". But when it comes to statements like the following, which form is correct?        I don't understand what are you talking about.   I don't understand what you are talking about.      Another example        Do you know what time is it?   Do you know what time it is?      Another example        Do you care how do I feel about this?   Do you care how I feel about this?


Currently trying to dynamically toggle content within an HTML document using JQuery based upon a user click.  I have an HTML document and I have the following JQuery code, which dynamically toggles the contents of the div based upon a users click.:    $(function() {   $(".uen").on("click", uenSearch); });  function backButton () {   $(".search-form, .content-wrapper.back").toggle();   $(".uen > h3, .uen > p").toggle();   $(".uen").on("click", uenSearch); }  function uenSearch () {   $(".uen > h3, .uen > p").toggle();   $(".search-form, .content-wrapper.back").toggle();   $(".uen").off();   $("#back").on("click", backButton); }

Search by

UEN
   <form action="#" method="post" class="search-form">     <input type="text" placeholder="Enter UEN Number" name="uen_number"      required>     <button type="submit">SEARCH</button>   </form>

Back

     However, once the user has clicked on the div the first time and the content is changed, if the user tries to click on the "#back" paragraph the event listener is not triggered to toggle the div's content back to it's original.  Any help in solving this would be much appreciated.

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


As I understand it pdflatex has been discontinued, and the replacement is LuaLaTeX.  But pdflatex is still included in most (all?) distributions, along with LuaLaTeX.  LuaLaTeX supports lots of new features like otf fonts.  Will I ever need to use pdflatex? Is it faster?

Currently I use pdflatex to process my documents, but I want to be with the cool kids and switch to XeTeX or LuaTeX. My documents are moderately multilingual (main text in portuguese or english, quotations and references in english, german, french, russian and greek), but nothing that pdflatex can't handle with some effort. I just want to get rid of the cruft and be able to use OpenType fonts.  So, is there any drawback of XeTeX/LuaTeX that should stop me from switching right now?  My main concern is math typesetting, as there's usually more math than text in my documents =)  The only issue I am aware is that their support for microtype is incomplete.


When travelling by a train, it seems that the nearby objects move in the opposite direction(which I can explain) but the distant objects appear stationary. I can't explain this. By the concept of relative velocity shouldn't all objects appear to move in opposite direction?

When you run or ride bike at night if you observe the moon you feel like he moves along with you as the same speed you are going. Why?


I have 500gb hdd and 32gb SSD on my ASUS laptop UX32V  On HDD there was WIN7  On SSD I just have installed Ubuntu (/,/home,/swap and boot partition)  After all I realized that I have made a bad choice to make a boot partition on SSD because now i can boot only Ubuntu.  I have installed win7 recovery tool on my USB. When I run it i have to select os which I want to repair but in selection window win7 doesn't show up.  Can I reinstal boot loader to my HDD? what should i do?  > > karolis@karolis-UX32VD:~$ sudo lshw -C disk [sudo] password for karolis:    *-disk                   >        description: ATA Disk >        product: Hitachi HTS54505 >        vendor: Hitachi >        physical id: 0.0.0 >        bus info: scsi@0:0.0.0 >        logical name: /dev/sda >        version: GG2O >        serial: TE95113QKWMLSP >        size: 465GiB (500GB) >        capabilities: partitioned partitioned:dos >        configuration: ansiversion=5 sectorsize=4096 signature=957a0691      *-disk      description: ATA Disk    product: SanDisk SSD i100    physical id: 0.0.0    bus info: scsi@1:0.0.0    logical name: /dev/sdb    version: 11.5    serial: 121600103561    size: 29GiB (32GB)    capabilities: gpt-1.00 partitioned partitioned:gpt    configuration: ansiversion=5 guid=a8636661-170c-476f-81b8-e2d39c529c61 sectorsize=512       *-disk      description: SCSI Disk    product: xD/SD/M.S.    vendor: Generic-    physical id: 0.0.0    bus info: scsi@6:0.0.0    logical name: /dev/sdc    version: 1.00    serial: 3    capabilities: removable    configuration: sectorsize=512  *-medium       physical id: 0       logical name: /dev/sdc

I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu.   How can I get Ubuntu back?


The following code is a small prototype of a big code.I have class Student and list of class   and two list of class like lst and lstcarrier     >in one method i am adding firstname only in another method iam adding age and lastname.I want to join two list and need to get 3 results contain full details like firstname ,lasnmae ,age but when i used Union it is giving 6 results rather 3 results.How to get 3 results??  public class Student         {             public string firstname { get; set; }             public string lasnmae { get; set; }             public string age { get; set; }         }   List<Student> lst = new List<Student>();             List<Student> lstcarrier = new List<Student>();             Student st = new Student();             st.firstname = "sasi";             lst.Add(st);              Student st1 = new Student();             st1.firstname = "rahul";             lst.Add(st1);              Student st2 = new Student();             st2.firstname = "kiran";             lst.Add(st2);              Student sc = new Student();             sc.age = "32";             sc.lasnmae = "ravi";             lstcarrier.Add(sc);              Student sc1 = new Student();             sc1.age = "33";             sc1.lasnmae = "mir";             lstcarrier.Add(sc1);              Student sc2 = new Student();             sc2.age = "34";             sc2.lasnmae = "rar";             lstcarrier.Add(sc2);              List<Student> lstfinal = null;             lstfinal = lst.Union(lstcarrier).ToList() ;

I have an IEnumerable<T> and an IEnumerable<U> that I want merged into an IEnumerable<KeyValuePair<T,U>> where the indexes of the elements joined together in the KeyValuePair are the same. Note I'm not using IList, so I don't have a count or an index for the items I'm merging. How best can I accomplish this? I would prefer a LINQ answer, but anything that gets the job done in an elegant fashion would work as well.


Inappropriate ad spotted on Travel.SE. Looks like the usual health scam. Unfortunately this one seems not to open the link preview when I long-click it, so it's only the image, but .

This post is in reference to the following blog post:   To start off, a quick introduction of myself; my name is Jascha Drel, Product Manager for Advertising at Stack Overflow. In this role, I am part of ’s organization.   Our team is continuously making improvements to the ads experience on our sites. One of the changes we’re excited about sharing is the new Report this Ad feature now available on some of our sites. We want to continue to give our communities more native control over their ad experience. We needed a quantifiable way to receive feedback and this feature will allow that.  We enforce strict  on the types of advertisers we work with but cannot fully control what is shown due to how advertising delivery works. However, being able to hear from our users about problematic ads will be a huge benefit as we can address those problems faster and with more accuracy. The Report this Ad feature will allow us to quickly see and investigate ads reported by you which matters to us because we want to hear your thoughts.  Furthermore, this new feature ensures that the members of our communities have a built-in way to report ads they consider problematic when we test any new ad formats/solutions.  We are launching this feature on 5 sites initially (, , , , and ) to get a good understanding of what we can expect in terms of numbers of reports whenever launching this to the entire network. Prior to launching it network-wide, we’ll share general results we’ve seen here.  What happens once an ad is reported?  All reports will be consolidated into a dashboard that the team will look at several times per week to spot irregularities in terms of the total number of reports, report categories, and on an advertising campaign basis. We will not be replying to individual reports, but we will reach out to our advertisers, to share feedback or notify them if the ad being reported does not fit our guidelines. We may also evaluate our policies in response to large numbers of reports not covered by them. Since we don’t have a baseline for the number of ads that are going to be reported using this new feature, we will consider reevaluating the process if the current process doesn’t scale.    We’d like to share an update on the progress of this feature:   We've launched this feature on 5 SE sites (Server Fault, Database Administrators, Arqade, Game Development, and Unix & Linux) initially for logged in users only, and for anonymous users afterward. The report this ad button was shown several million times (of which roughly 65% paid ads and 35% house ads). We showed several dozens of different ad campaigns. So far we have received 0 reports. We've tested the feature several ways, found some minor bugs (which have been/are being fixed), however, in the vast majority of the scenarios the feature works well (we’re happy to be ).   We’re currently graduating this feature and are releasing it network-wide this week. Feel free to comment below if you have any questions/comments.


This is a very weird issue, and I've consulted the usual resources but found nothing.  When I press the shutdown button, I expect to see an interactive prompt -- e.g., "Shutdown / Reboot / Suspend / Cancel" or something of the sort (which I've had no problems with on other machines with older Ubuntus). I do see this prompt, but the system shuts down immediately regardless of whether I select an option or I select nothing at all.  I've done acpi_listen, and the event comes through normally. Nothing weird in syslog, but I'm sure that isn't the right place to look.  I suspect the problem is in Gnome/Unity, because setting the "Power Button Action" to "Nothing" in gnome-tweak-tool yields the expected result (the event is ignored). If it is set to any of the other options (suspend, logout, reboot, etc.), those work. Only the Interactive option misbehaves. I've also tried editing the corresponding field directly in dconf, with the same effects.  How can I diagnose this issue? And hopefully, fix it?

I have recently installed Xubuntu 13.10 on my Vaio vpcea making me a Linux beginner. The problem is that  laptop's power button is right on the edge of the bezel making it far too easy to press accidentally, in my opinion a design fault by Sony.  At present, when I press the power button it shuts down strait away and as you can imagine, when I'm accidentally pressing it all the time it gets very annoying! So I planned to change it to ask what I would like to do when I press it or at least ask if I'm sure.  So I went through the xfce GUI options "Settings Manager" - "Power Manager" to the field "When power button is pressed", but it was already set to "Ask". So I did some digging and found a thread telling me to navigate to /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml where it said to find power-button-action and check that  value="3". It already did.  So I looked some more and found  which focuses on acpi scripts. I tried solution 1 & 2 using sudoedit to change the files accordingly (I have made executable bash shell scripts already so I think I followed them correctly), but still no difference.   I also found  which instructed me to edit /etc/systemd/logind.conf so that HandlePowerKey=ignore. Still no luck.  I even tried my own approach to completely disable /etc/acpi/powerbtn.sh by renaming it powerbtn.sh.bak hoping for at least no response from the power button... and I have done many reboots in between... but still it shuts down!  I have also read that some people have the file /etc/acpi/events/power_button, but I do not.  So does anyone have any other ideas? What else could be executing the shutdown sequence Is there something I'm missing?  I haven't undone any of these actions so every one of the above files is currently edited on my computer, with the exception that "Solution 2" automatically undone "Solution 1" above.   Thanks guys.


Just installed Ubuntu 20.04 on my laptop, replacing windows 10. My laptop's WiFi adapter (RTL8821CE) drivers weren't installed automatically, and I have no ethernet port so I have to manually do it. I found a guide online on how to download it but it assumes I have internet to download dkms. So I wanted to ask how do I manually download that as well?

I have a friend who has got a computer that is not connected to the Internet. Is there any way to install software offline easily?


In R, I like to create a set of variables that are correlated with a given variable.I scanned related questions but failed to find the same issue i have.  Here is instance.  x<-rnorm(100, mean=3,sd=1.2)   Assuming $x$ is an exiting variable, I like to generate $z, y, t$ correlated variables with $4$ by $4$ correlation matrix.   So, variables $y, t, z$ would correlate $x$ according to predefined correlation matrix I will use as an input. It would be grateful if you leave a comment on me with a specific code.

For a simulation study I have to generate random variables that show a predefined (population) correlation to an existing variable $Y$.  I looked into the R packages copula and CDVine which can produce random multivariate distributions with a given dependency structure. It is, however, not possible to fix one of the resulting variables to an existing variable.  Any ideas and links to existing functions are appreciated!     Conclusion: Two valid answers came up, with different solutions:   An R  by caracal, which calculates a random variable with an exact (sample) correlation to a predefined variable An R  I found myself, which calculates a random variable with a defined population correlation to a predefined variable     [@ttnphns' addition: I took the liberty to expand the question title from single fixed variable case to arbitrary number of fixed variables; i.e. how to generate a variable having predefined corretation(s) with some fixed, existing variable(s)]


Got a pack of models online which gives an obj and mtl file for each. When I import an obj file onto blender, the model looks fine but when rendered it's fully pink. Been looking around the web but haven't found a solution yet. Also tried going file-external data- find missing files but when I go to the respective file, it says there aren't any png files found for the textures. Thanks!

I used node textures in a mesh I exported to .FBX.  I then imported it into Unreal Engine 4 and it didn't import any textures; I clicked the Upload Textures option in Unreal Engine.  Is there something I'm doing wrong or is it Blender?


Both the ratio test and the root test define a number (via a limit).  If both limits exist (and shows that the series is convergent), what (if any) is the relation between the 2 numbers ? are they equal ?  What is the relation (if any) between them and the original series (other than the fact that they say the series is convergent) ?

This may have been asked before, however I was unable to find any duplicate. This comes from  of "Mathematical Analysis: An Introduction" by Browder. Problem 14:     If $(a_n)$ is a sequence in $\mathbb R$ and $a_n > 0$ for every $n$. Then show:   $$ \liminf(a_{n+1}/a_n) \le \liminf((a_n)^{(1/n)}) \le \limsup((a_n)^{(1/n)}) \le \limsup(a_{n+1}/a_n)$$   The middle inequality is clear. However I am having a hard time showing the ones on the left and right. (It seems like the approach should be similar for each). This is homework, so it'd be great if someone could give me a hint to get started on at least one of the inequalities.  Thanks.


The question is pretty straight forward. I can't imagine everybody goes back to their quarters to take a leak every time.

I know that it's a weird question, but I haven't seen a single bathroom on the Enterprise, not even on blueprints.  Do they exist?


I am trying to make a game where you unscramble words. But I cannot seem to get it to properly check if the user's guess is equal to the actual answer. It seems to no matter what have the actual word not equal to the users guess, also while your here. Is there any other way to pause my code and wait for a users input other than having a while loop?  import javax.swing.JOptionPane;  public class Loop extends CreateWindow{     private static final long serialVersionUID = 1L;     public static boolean running = true;      public static void GameStart(){         if(running){             int wordNum = 0;             for (int i=0;i<=9;i++){                 field.setText("");                 setScrambledWord(i);                 while(enter == false){                     System.out.println(userAnswer);                     System.out.println(enter);                     System.out.println(score);                 }                 userAnswer = area.getText();                 if(userAnswer == normalWords[wordNum]){                     JOptionPane.showMessageDialog(null, "legos", userAnswer, JOptionPane.OK_OPTION);                 }else if(userAnswer != normalWords[wordNum]){                     JOptionPane.showMessageDialog(null, "sogel", userAnswer, JOptionPane.OK_OPTION);                 }                 area.setText("");                 enter = false;                 wordNum++;             }         }     }      public static void main(String[] args){         new CreateWindow();         running = true;         GameStart();     }                }    import java.awt.BorderLayout; import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.JTextField;  public class CreateWindow extends JFrame {     private static final long serialVersionUID = 1L;     JPanel panel = new JPanel();     public static int score = 0;     static JTextArea area = new JTextArea(10,40);     static JTextField field = new JTextField(40);     JButton button = new JButton("Press to Enter Answer");     public static boolean enter;     public static String userAnswer;     public static String[] normalWords = {         "yellow",         "alphabet",         "tangent",         "elephant",         "amusement",         "cat",         "eerie",         "wonder",         "shadows"     };     public static String[] scrambledWords = {         "lloeyw",         "lphaabte",         "natgnte",         "leehpnta",         "mauseenmt",         "tca",         "reeei",         "dowenr",         "shawdos"     };     CreateWindow(){         setSize(500,300);         setResizable(false);         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);         setLocationRelativeTo(null);          field.setEditable(false);          button.addActionListener(new ActionListener() {              public void actionPerformed(ActionEvent e)             {                 enter = true;                 System.out.println("You clicked the button");                 System.out.println(enter);             }         });             add(panel);         panel.add(field, BorderLayout.PAGE_START);         panel.add(area, BorderLayout.CENTER);         panel.add(button, BorderLayout.PAGE_END);         setVisible(true);     }      public static void setScrambledWord(int i){         field.setText(scrambledWords[i]);     }      public void clearArea(){         area.setText("");      } }

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?


Good morning forum. I have this basic query in oracle SELECT P.IDPROYECT, P.NOPROGRAM, P.IDETAP, P.STATUS_ETAP, P.VERSION FROM poa.PROYECT P LEFT JOIN DGI.DEPENDENCIA UA ON (P.RAM = UA.RAM AND P.DEPT = UA.DEPT AND UA.YEAR = 2021);  I am attracted to a series of records so the noprogram is repeated 3 times but the only thing different is that the version of those 3 is newer, I would like it to show me only 1 of the 3 records that has a higher version

Table:   UserId, Value, Date.   I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle)  Update: Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date.


The function below gets two values from sharedpreferences, weight and height, and I use these to calculate the BMI,  When I print the content of the values I get the values i have entered in the sharedprefs ( which is good) but then when i run a division operation on them, I always get 0 as a result.. Where is the error?  public int computeBMI(){     SharedPreferences customSharedPreference = getSharedPreferences(             "myCustomSharedPrefs", Activity.MODE_PRIVATE);      String Height = customSharedPreference.getString("heightpref", "");     String Weight = customSharedPreference.getString("weightpref", "");      int weight = Integer.parseInt(Weight);     int height = Integer.parseInt(Height);     Toast.makeText(CalculationsActivity.this, Height+" "+ Weight , Toast.LENGTH_LONG).show();      int bmi = weight/(height*height);     return bmi;  }

Here's an example:  Double d = (1/3); System.out.println(d);   This returns 0, not 0.33333... as it should.  Does anyone know?


i found this relation whilst trying to evaluate the norm (over $\mathbb{Q}$) of $1-\zeta$ for $\zeta$ a primitive $p$-th root of unity ($p$ supposed prime) $$ \prod_{k=1}^{p-1} \sin(\frac{\pi k}{p}) = \frac{p}{2^{p-1}} $$ as yet i have no means of proving it. any suggestions?

Using $\text{n}^{\text{th}}$ root of unity  $$\large\left(e^{\frac{2ki\pi}{n}}\right)^{n} = 1$$  Prove that   $$\prod_{k=1}^{n-1}\sin\frac{k \pi}{n} = \frac{n}{2^{n-1}}$$


Let $R=\mathbb Z[e^{i\pi/3}]=\{a+be^{i\pi/3}\mid a,b\in \mathbb Z\}\subseteq \mathbb C$ (a) Show that $R$ is a Euclidean domain using the Euclidean norm $N(u)=|u|^2$. (b) Show that if $p$ is a prime number in $\mathbb Z^+$ and $x,y\in \mathbb Z$ with $x^2+xy+y^2=p$, then $x+ye^{i\pi/3}$ is prime in $R$. (c) Show that if $p$ is a prime number in $\mathbb Z^+$ and $p\neq x^2+xy+y^2$ for any $x,y\in\mathbb Z$, then $p$ is prime in $R$.  I don't know how to show that the division algorithm holds in $R$. For b, I can show that $N(u) = p  = x + xy + y^2$ by simply expanding out the norm of an arbitrary element of $R$. I also remember my professor mentioning that in a Euclidean domain, if the norm of an element is prime in the integers, then the element itself is prime in the ring. But how would I prove this? Also, am I correct in saying that if the norm is a prime number, then the element itself cannot be a unit, as being a unit would imply that there exists $v$ in $R$ such that  $uv = 1$. But $uv = 1$ implies $N(uv) = 1$, which is impossible since $N(uv) = N(u) N(v)$ for all $u,v$ in $R$, and $N(u) = p$, which implies $N(v) = 1/p $, and as $p >=2$, $N(v) < 1$, impossible. Lastly, I would appreciate a hint for part c. Edit : The ring in my question is different from the ring in the other one. Also, the questions themselves are different too. Please unmark it as a duplicate.

I have to study the prime elements of the ring $ \mathbb{Z} \! \left[ \dfrac{i \sqrt{3} - 1}{2} \right] $. For the moment, I cannot find the general form of such elements. Can you help me?  Thanks! :)


I am trying to write a C program which trims any occurrence of white spaces in a string and prints the resultant string.But ain't getting the desired result and I am getting some random symbols as the output. Please help me.  #include<stdio.h> #include<string.h> int main() {     char s[100];char a[100];int i;     printf("enter the string:\n");     gets(s);     int len=strlen(s);     for(i=0;i<len;i++)     {          if(s[i]!=' ')          {              a[i]=s[i];          }     }      for(i=0;i<len;i++)     {          printf("%c",a[i]);     }    }      Input:  Hello Hello      Expected Output:  HelloHello.      Current Output:Hello◄Hello

Is there a clean, preferably standard method of trimming leading and trailing whitespace from a string in C? I'd roll my own, but I would think this is a common problem with an equally common solution.


I discovered that ArcGIS Diagrammer no longer supports ArcGIS Desktop beyond 10.3. This was the go-to tool for reordering fields for a feature class within a file geodatabase. I have subtypes applied, so I have to operate within the geodatabase environment.  Are there any suitable alternatives that would operate with ArcGIS Desktop (specifically ArcCatalog) 10.5 or higher?  While my question is similar to  and others, most of those fixes are several years out-of-date, and apply to older versions of ArcGIS.

Using ArcGIS 10.0, is it possible to reorder the fields in a file geodatabase, and have the order persisted to the database?  We considered exporting to XML, and writing a parser to change the field order, then re-creating a new database from the XML. This seems like a laborious process.  Another idea is to import the existing field definitionss into Excel, re-order them, export to CSV, then write a Python script to create these fields in a new Geodatabase. Does a script like this exist, before we write it from scratch?  Unfortunately the ArcGIS Diagrammer doesn't seem to support field re-ordering.  Are there any scripts or hacks we could use to simplify this process?


Is it possible to do this? Given a multi-class classifier and the number of classes, is it possible to calculate what the loss should be, on average, for random predictions?  Concretely, I'd like to know if this is possible in order to evaluate the implementation of a neural network. I think that it'd be useful to know what the loss for an untrained model should be.

Suppose weights of NN are Gaussian spread initialization then forward pass for all the inputs will evaluate to zero which computes to 0.69 ($-\log_{e}0.5 \approx 0.69 $, since sigmoid (0) = 0.5) average loss at least in the first pass. For three classes it would be $1.0986$ ($-\log_{e}\frac{1}{3}$) and so on.   I understand when weights are zero-initialized, but why does this happen when weights are Normally distributed to start with?


I'm a beginner, I have a Nikon D5100 with the DX 35mm f/1.8 lens. I made a close-up photo, deliberately way too underexposed, in RAW+JPEG fine format. Here are the files:   and   I opened the files in RawTherapee, and I noticed two things.  First, the perspective in the two files is not the same. Lens correction is turned on in the camera (with the most up-to-date data from Nikon), and I'm guessing the JPG was lens corrected and the NEF wasn't (I really couldn't tell which one is corrected just by looking at the photos though). It seems to me that RawTherapee doesn't come with any lens correction profiles by default, I tried searching for no more than 5 minutes and couldn't find any. So from my point of view, raw seems to be the worse option, because I need to get lens correction profiles somehow (or maybe use Lightroom or something that has it by default), while the camera does it magically when shooting in JPG.  Second, if you adjust the exposure, then as I suspected, NEF has a little more bit depth than the 8 bits of JPG, which can be seen on the camera battery charger on the left for example. But with the exposure adjustment, the raw picture seems to have way more noise than the JPG. So at least in this example, I can't use the extra bit depth because it also brings out a lot of noise, but this may just be a problem with my example.  Based on this example, or if this photo wasn't deliberately underexposed, or any other example really, how do you think raw shooting can help a non-professional person? How much improvement does it give above the camera defaults, how much effort does it take to learn and do the manual RAW->JPG editing, etc? Also, how much better does it get if I buy a professional software like Lightroom?

I'm curious to see some real examples of where simply capturing the same photo in RAW (and being processed by someone who can do it justice) has significantly improved the photo at the end of the process.  I understand what RAW is and why you might want to use it over JPEG, however, I'd like to actually see some examples where it has allowed for a better result. More control over tone, conversion from the more detailed data to 8-bit RGB etc.  Does anyone have or know of some processed RAW+JPEG shots for exact comparison?


I'm stuck on proving the following identity: $$u \ \cdot (v \times w) = w \ \cdot (u \times v) = -v \ \cdot (u \times w)$$ Geometrically I see how this works but computationally I have only been able to get this far: $u \ \cdot (v \times w) = \left [\left \| u - proj_{v \times w} u \right \|  \right ]\left [\left \| v \times w \right \|  \right ] $ $= \left[ u-\frac{u \cdot (v \times w) }{\left \| v \times w \right \|} (v \times w)\right]\left[ \left\| v \times w \right\| \right]$ Where do I go from here? Or am I on the wrong track?

How do you prove the identity: a$\cdot($b$\times$c$) =$ c$\cdot($a$\times$b$) = -$b$\cdot$(a$\times$c) I'm thinking that this is because of row swaps in the determinant of a matrix with a,b,c as its row vectors. But I'm not sure how to write out the proof, and why its related to the determinant of that matrix


I saw this puzzle in a local newspaper:     Consider a normal bicycle set to stand in its upright position, and   its pedal is set to the position as shown in this figure. One man   slightly hold the seat to keep the bicycle from falling. (Actually   this is not important, there can be many ways to keep the bicycle from   falling without affecting the experiment result). A non-elastic string   is tied to the end of the pedal crank arm as in here. Another man then pulls the   string backward.      The question is: In which direction will the bicycle move? Forward,   backward, or standstill? Discuss possible cases.             Hint: The answer is   non trivial. The readers are encouraged to try this experiment before coming to a   hasty conclusion, since it's quite simple to carry out.   Despite the "Hint" part, and the "counter-intuitive" in the title, which is a quite clear suggestion that the bicycle will move in a counter-intuitive direction (backward instead of forward), many people still submitted answer such as "Forward, why not!!", or "Standstill" or "Forward, then as the crank move to 9 o'clock position, it will move backward". Of course they are not the correct answer.  Some people answered that it will move backward, but couldn't give a decent explanation.  My best guess is that this must have something to do with the size (radius) of the wheel, the radius of the crank arm, and the ratio of the crank gear and the wheel gear as well. If the bicycle moves forward, the crank bolt/shoulder will move as well, then the displacement of the crank does not simply equal to the displacement cause by the wheel rotating...  So what can be a simple, short explanation? And what can be a detail explanation with math and equations involved?

This question has been around the net for a while, and I haven't seen a good explanation for it:    A yo-yo is initially at rest on a horizontal surface. A string is pulled in the direction shown in the figure. In what direction will the yo-yo rotate and move?


I am wiring a receptacle for a 4800 watt (220) construction heater ( the standard type found in home stores). Do I need a neutral wire or not?  Do I use 10 awg wire 10/3 or 10/2.

i want to install a 4800 watt construction heater in my garage that is already wired with a 60 amp subpanel.  It has lots of room for extra breakers in the sub panel so i plan to install a 30 amp breaker (the heater specs say it is 21 amps, so the 30 amp breaker appears correct)..  The heater will be plugged in 42 feet from the subpanel so i estimate it will take about 50 feet of wire.  WHAT TYPE OF ELECTRICAL WIRE DO I NEED FOR THIS?


I have been looking around bikes for a while tried about 10 bikes already and rode about 10 miles on each of them and I think I have come to a conclusion about which one to buy (or did I?) But the question is when is the best time to buy a new bike. I assumed that Winter is the best time because most of the people are not riding and companies are trying to sell the old stock off to restock.   So I had made up my mind to buy a certain bike but then heard from the LSB fall is the best time because this is the last price they would reduce on their bikes. So are they right?  Should I get my bike now or should I wait till winter to see the prices going down further? I live in Chicago  Any comments and suggestions are appreciated   Thanks in advance

Is there a month when new models come out and dealers discount stock like with cars?  Do they raise prices in the spring and lower them in the winter?


Why is it that to divide by a fraction you need to multiply by the reciprocal of that fraction?  For instance:  $\eqalign{   & 1 \div \frac{1}{3}  \cr    &  = 1 \times 3  \cr    &  = 3 \cr} $  Thank you.

For example, dividing by 2, means we cut something in two.  But dividing by 0.5, can only be explained with multiplying something by 2.  So, is there a "physical" explanation of dividing by 0.5? Is it "I divide by an entity that internally multiplies' or something as so bizarre?


I would like to get subsets of elements of a Java List by specifying some of their parameters. Each element has different characteristics, e.g. x-position, y-position, width, height and type. Now I want to get all elements, which position is in a specific interval, or which width or height is not greater than a given value, or which type equals some String.  My actual solution is, that I wrote a bunch of subset()-functions to apply in each different case.   public List<Element> subsetByPositionX(     List<Element> elements, int minX, int maxX) { /*...*/ }  public List<Element> subsetByPositionY(     List<Element> elements, int minY, int maxY) { /*...*/ }  public List<Element> subsetByMaxWidth(     List<Element> elements, int maxWidth) { /*...*/ }  // some more subset methods for height and width  public List<Element> subsetByType(     List<Element> elements, String... types) { /*...*/ }   I'm a bit unlucky about this, because it is not very generic. Is there a more elegant way to subset elements by different kinds of characteristics?

I want to filter a java.util.Collection based on a predicate.


Question:Prove that $x^{p^n} -x +1$ is irreducible over $\mathbb{F_p}$ only when n=1 or n=p=2  I know it is a duplicate question. However, someone gave some nice hints on this problem and I want to follow the hints he gave.  Hint (1): Note that if $\alpha$ is a root, then so is $\alpha+a$ for any $a \in \mathbb{F_{p^n}}$  Hint (2): Show that this implies that $F_p(\alpha)$ contains $\mathbb{F_{p^n}}$  Hint (3): Show that $[\mathbb{F_{p}(\alpha)}:\mathbb{F_{p^n}}]=p$  Hint(1) and Hint(2) are done:   Hint(1) is easy to prove, just use two properties: $(\alpha+\beta)^p=\alpha^p+\beta^p$ and $\forall a \in \mathbb{F_{p^n}}$, $a$ is a root of $x^{p^n}-x+1$.  Hint(2): Since $F_p(\alpha)$ is a Galois Extension, we have $F_p(\alpha)$ contain all the roots of $x^{p^n} -x +1$, thus contain $\mathbb{F_{p^n}}$.  However, I stuck on Hint(3), and actually Hint(3) is very important, once we get $[\mathbb{F_{p}(\alpha)}:\mathbb{F_{p^n}}]=p$, we will get $[\mathbb{F_{p}(\alpha)}:\mathbb{F_{p}}]=n \cdot p$ ,and we know $[\mathbb{F_{p}(\alpha)}:\mathbb{F_{p}}]=p^n$, thus we can finish the proof.  Can anyone give me any idea about how to prove hint(3)?

I have a question, I think it concerns with field theory.     Why the polynomial $$x^{p^n}-x+1$$ is irreducible in ${\mathbb{F}_p}$ only when $n=1$ or $n=p=2$?   Thanks in advance. It bothers me for several days.


I have a new HP-15bs015dx laptop which has Realtek RTL8723DE Wireless network card. I dual booted with Windows 10 and Ubuntu 16.04.1 with 4.4.0-31-generic kernel. Now, I am unable to connect to internet in Ubuntu.  I wonder if there is any driver firmware for DE series after looking at this page which mentions firmware upto 8723BE only.    If it is not the case, how can I setup my WLAN card working?Any help would be greatly appreciated

How do I install Wi-Fi drivers for Realtek RTL8723DE device in Ubuntu 16.04?  lspci -v | grep -i network 02:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device d723


I am interested between the correlation between a continuous variable and a binary variable (female=1/male=2). I think it doesn't really make sense to calculate it like this: cor.test(data$continuousvariable,data$binaryvariable)  Is correlation only used for two continous variables? What should I do?

What's a meaningful "correlation" measure to study the relation between the such two types of variables?  In R, how to do it?


Code following a list, though not to be included in the list itself, is not correctly rendered, as shown below. I have tried inserting linebreaks, to no avail.  Inserting "dummy" text will help the renderer.  Have I misunderstood the formatting?  The downvote as a duplicate is fair, as the original question is definitely the same.  I should have searched meta for this problem. However-- many (appreciated) answers have explained various workarounds or manual spacing adjustments.  These suggestions overlook a problem I mentioned (in the comment in the sample code snippet): the {} (code) widget does not format the code (either as a list item or following the list) in this context.  This is, IMO, a UI/UX bug (confusion which lead to this post, obviously).  By comparison, if the B (bold) toolbar widget failed to bold the text in certain contexts, I think it would be recognized as a bug without much contention. Here is a list.  One  Two  Three module Foo Not formatted as code, despite four space indentation and trying the {} widget. end   Here is another list.  One Two  Inserting this text fixes the renderer. module Foo   # Now formatted as code. end

Consider the following piece of Markdown code:  This is some regular text.      >>> def factorial(n):     ...     return 1 if n < 2 else n * factorial(n - 1)     ...   * This is a list item.      >>> def factorial(n):     ...     return 1 if n < 2 else n * factorial(n - 1)     ...    Notice that the second code block is preceded by a list item.   Why is the factorial code not properly formatted under these circumstances? To demonstrate the problem, I'll insert the Markdown code show above:    This is some regular text.  >>> def factorial(n): ...     return 1 if n < 2 else n * factorial(n - 1) ...     This is a list item                 def factorial(n):       ...     return 1 if n < 2 else n * factorial(n - 1)       ...               This applies to numbered as well as unnumbered lists.


On my profile page, the "track the next badge let us pick" thing overlaps with the buttons. Is this a bug, and has it been seen before?  Edit: I clicked "let us pick" and earned another badge, but it happened again

When I visit  I see this:     The "Congratulations! You've earned (badge)" section has dropped down completely beneath the tabs under it. The "You've earned a new privilege!" section has a gap at the bottom:     Shog9 says in comments how to reproduce this:     Gotta have earned a badge, not dismissed the notification, and be looking at your own profile.


Spivak's Calculus on Manifolds asks the reader to prove this (problem 1-8, pp.4-5):     If there is a basis $x_1, x_2, ..., x_n$ of $\mathbb{R}^n$ and numbers $\lambda_1, \lambda_2, ..., \lambda_n$ such that $T(x_i) = \lambda_i x_i$, $1 \leq i \leq n$, prove that $T$ is angle-preserving iff $\left| \lambda_i \right| = c, 1 \leq i \leq n$.   Here "angle-preserving" means that the linear map $T$ satisfies $$\frac{ \langle x, y \rangle}{\|x\| \|y\|} = \frac{ \langle T(x), T(y) \rangle}{\|T(x)\| \|T(y)\|},$$ and that $T$ is injective.  My first problem with this question is that the claim is false. Taking $n = 2$, $x_1 = (1, 0)$, $x_2 = (1,1)$, $T(x_1) = -x_1$, $T(x_2) = x_2$, and setting $x = x_1$, $y = x_1 + x_2$, the expression in the RHS above evaluates to $0$, while the expression in the LHS evaluates to $\frac{1}{\sqrt{2}}$.  My second, bigger problem is that I'm not really understanding what's going on. An earlier part of the problem had me show that norm-preserving matrices are angle-preserving; this I'm not sure I get. Thus, I'm not sure what true "version" of this statement the author had in mind (was he trying to get a converse?) and I don't know what to do.    Here's my guess:  Looking at some transformations in $\mathbb{R}^2$ (just drawing them), it looks like some of them could be "flip the sign of a basis vector" IF it's an orthogonal basis. However, I can't seem to recover the usual "rotation through an angle $\theta$" transformation this way, so I'm not sure that requiring the basis be orthogonal makes the statement true.   Also, I'm not sure how to take the inner product of vectors which aren't in standard coordinates. Or am I missing something here?

This an exercise out of Spivak's "Calculus on Manifolds".  Edit:  There was a typo in the exercise as is noted below in the answers.  The statement has been edited to reflect this.  Given $x,y\in\mathbb{R}^{n}$, the angle between $x$ and $y$ is defined by  $$\angle(x,y) = \arccos\left(\frac{\langle x,y \rangle}{|x|\cdot |y|}\right),$$ where $\langle x,y \rangle$ denotes the standard Euclidean inner product.  A linear operator $T:\mathbb{R}^{n}\to\mathbb{R}^{n}$ is said to be angle-preserving if $\angle(T(x),T(y)) = \angle(x,y)$ for every $x,y\in\mathbb{R}^{n}$.  The exercise as stated:  Let $\{x_{1},\dots, x_{n}\}$ be a basis for $\mathbb{R}^{n}$.  Then suppose that $\lambda_{1}, \dots, \lambda_{n}\in \mathbb{R}$ are such that $Tx_{j} = \lambda_{j}x_{j}$ for each $j = 1,\dots, n$.  Then $T$ is angle-preserving only if (not if and only if!)$|\lambda_{i}| = |\lambda_{j}|$ for every $1\leq i\leq j\leq n$.  I'm having problems with the $(\Rightarrow)$ direction.  My best attempt (which seems to lead nowhere) is to suppose that $|\lambda_{j}|\neq |\lambda_{k}|$.  Then by assumption, \begin{align*} \angle(Tx_{j},Tx_{k}) & = \arccos\left(\frac{\langle Tx_{j},Tx_{k} \rangle}{|Tx_{j}|\cdot |Tx_{k}|}\right)\\ & = \arccos\left(\frac{\langle \lambda_{j}{x_{j}},\lambda_{k}{x_{k}} \rangle}{|\lambda_{j}{x_{j}}|\cdot |\lambda_{k}{x_{k}}|}\right)\\ & = \arccos\left(\frac{\lambda_{j}\lambda_{k}\langle {x_{j}},{x_{k}} \rangle}{|\lambda_{j}|\cdot|\lambda_{k}|\cdot|{x_{j}}|\cdot |{x_{k}}|}\right)\\ & = \arccos\left(\text{sign}(\lambda_{j})\text{sign}(\lambda_{k})\frac{\langle {x_{j}},{x_{k}} \rangle }{|{x_{j}}|\cdot |{x_{k}}|}\right)\\ \end{align*} may also be calculated as \begin{align*} \angle(Tx_{j},Tx_{k}) & =  \angle(x_{j},x_{k})\\ & = \arccos\left(\frac{\langle x_{j},x_{k} \rangle}{|x_{j}|\cdot |x_{k}|}\right). \end{align*}  Then since $\arccos$ is injective, I believe I can make the jump that $\text{sign}(\lambda_{j})\text{sign}(\lambda_{k}) = 1$, which does not resemble the conclusion that I should arrive at.  Note:  I wasn't sure what tag to put this under, so anyone who knows better please feel free to adjust.  Thanks for any help you can give.


I have copied groovy and pdf files from CENTOS linux to my pendrive. When I use the drive under windows the drive is showing the copied from linux and it does not allow to add, modify or delete any files in the drive.Tried formatting but of no use. Tried to format using linux but no improvement. Under Windows DISKPART> detail disk Sony Storage Media USB Device Disk ID: 00000001 Type   : USB Status : Online Path   : 0 Target : 0 LUN ID : 0 Location Path : UNAVAILABLE Current Read-only State : No Read-only  : No Boot Disk  : No Pagefile Disk  : No Hibernation File Disk  : No Crashdump Disk  : No Clustered Disk  : No Volume ###  Ltr  Label        Fs     Type        Size     Status     Info ----------  ---  -----------  -----  ----------  -------  ---------  -------- Volume 4     F   MIT          FAT32  Removable     14 GB  Healthy C:\WINDOWS\system32>format /q /x F: Insert new disk for drive F: and press ENTER when ready... The type of the file system is FAT32. QuickFormatting 14.5 GB Write failure with status 0xc0000185 at offset 0x0 for 0x200 bytes. Invalid media or Track 0 bad - disk unusable. Format failed. Under Linux Disk /dev/sdd: 14.5 GiB, 15518924800 bytes, 30310400 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x500a0dff Device     Boot      Start        End    Sectors   Size Id Type /dev/sdd1       1948285285 3650263507 1701978223 811.6G 6e unknown /dev/sdd2                0          0          0     0B 74 unknown /dev/sdd4         28049408   28049848        441 220.5K  0 Empty

When I plug in my USB flash drive, it shows up on my computer as write-protected or read-only. I am unable to transfer data to it, nor can I modify or delete any files already stored on it. I also cannot repartition or reformat the drive using Windows Disk Management, DiskPart, GParted, or other tools. The drive does not have a write-protect switch.  Why did this happen and what can I do about it? Is there a way to remove the write protection?  (Note that this can happen with some memory cards, too, as they often use controllers similar to those used in flash drives. In some cases, the system may report that the drive or card was formatted successfully even though it was never actually formatted; the original data reappears when the device is reinserted.)     This question comes up often and the answers are usually the same. This post is meant to provide a definitive, canonical answer for this problem. Feel free to edit the answer to add additional details.


I have about 5500 combined hero levels and absolutely nowhere can I find an "ascension" button. It just says I have two hero souls waiting upon ascending.  This is on Xbox One.

The next upgrade I am likely to get is "ASCENSION" for Amenhotep.  The mouseover text on the ability says it restarts the game and gives a single hero soul.  Does anything else cross over (heroes, gold, achievements, etc.)?  When would be the best time to Ascend?  Should I wait until I unlock all the heroes or buy all their abilities?  I'm on level 85 now (not yet beat the boss), should I wait until a specific level?


mentions:     00:04:22: Heathrow also doesn’t display the gate for flights until around 45-90 minutes before departure. This is common in European airports, but uncommon elsewhere.   Why is it common in European airports not to display the gate for flights until around 45-90 minutes before departure, unlike other places?    Note regarding the duplicate flag: my question is about why it is common in European airports not to display the gate for flights until around 45-90 minutes before departure, unlike other places (or perhaps this statement is incorrect). I'm not asking for the reasons why airport authorities would do it (the YouTube video I mentioned in the question explained these reasons pretty well; tl;dw=increase shop sales+take a cut from them).

I am not a frequent traveler but it's been like this with all the flights I have been on. Here is the most recent example:  Below is my boarding pass    As you can see Gate Closes at 20:20  Here is the departures board at 18:32, clearly it says that they will announce the boarding gate at 20:10  ?!    I was hoping they will do that earlier but at 19:41 it's still the same    In fact they announced it at 20:11 but since I was freaking out and had to leg it to the gate I didn't have the time to take a photo.  You might think 9 minutes is enough, well below are the times required to reach the gates from the closest place to them     And that's for a healthy young person, no way my grandmother could be able to be at the gates within 9 minutes.  Is there a specific reason? it's not like they allocate the gate dynamically! The staff must have known about the gate hours ago as I don't expect the pilot to drive the airplane from the garage to the gate within 9 minutes?


I want to download all my photographs from Google Photos. I found out that I can download 500 files in one zip file. I mark the first photo, scroll down 500 photos, press Shift and mark the last photo. This way I can download 500 photos.  I found out that I can select all photos of a day by pressing on the checkmark next to the day.    Is there a way to download all photos?

I have around 950 albums at Google Photos.      I want to back them up now, but organised by albums, not by date.   Whenever I create a backup from within Google Photos, the backup splits my photos by date and adds metadata here and there.  What I am doing now is to click on every album, and choose "Download all". But this will take me ages.  Is there a way through Google Drive or another app to have a easier job?


Is it not time to implement a mobile version of the site?  pros:   browsing experience greater availability more traffic   cons:   txtspeak answers fewer ad impressions

I found this one on UserVoice, and I thought it was fitting to bring it up here for further discussion.  "Stack Overflow already works with Mobile Safari, but the experience is far from optimum. I believe an iPhone-optimized version (or maybe even a native client) would be perfect. I can help with either."  I personally think a some kind of mobile version of Stack Overflow would be great for using as a reference, but using it to ask questions would probably get cumbersome if you had to type up a long question with full description. However, using it to look up an answer when you're away from your desk would be awesome.  But, why not just use the regular Stack Overflow? Well, we all know that the small, touch screens get cumbersome to use when navigating websites built for desktops.


I am trying to export all active layers in a QGIS project to a specified folder, below is what I get atm  Outputdir='C:/Users/DN/Downloads/Test/'   layer = iface.activeLayer()  QgsVectorFileWriter.writeAsVectorFormat( layer, Outputdir + layer.name() + ".shp", "utf-8", layer.crs(), "ESRI Shapefile", 1)   It only works when I click on the layer that I want to export, I am wondering if it's possible to write a loop to loop through all active layers in the project and export them.

I'm having trouble figuring out how to iterate over map layers. I can access the currently highlighted layer in the table of contents via iface.activeLayer() but I want my code to operate on all layers.  I don't see anything in the API that provides easy access to this functionality and couldn't find a good online example but maybe I missed something?


I am trying to use biber for a simple report but I am getting     This is BibTeX, Version 0.99d (TeX Live 2015/Debian) The top-level auxiliary file: document.aux I found no \citation commands---while reading file document.aux I found no \bibdata command---while reading file document.aux I found no \bibstyle command---while reading file document.aux (There were 3 error messages)   in Texmaker.  These are the last few lines of the log:  Package biblatex Info: Reference section=0 on input line 13. Package biblatex Info: Reference segment=0 on input line 13. LaTeX Warning: Citation 'a' on page 1 undefined on input line 16. LaTeX Warning: Empty bibliography on input line 18. [1 {/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./document.aux) LaTeX Warning: There were undefined references. Package biblatex Warning: Please (re)run Biber on the file: (biblatex) document (biblatex) and rerun LaTeX afterwards. Package logreq Info: Writing requests to 'document.run.xml'. \openout1 = `document.run.xml'. )   I don't quite understand what's wrong here.  document.tex  \documentclass[]{article}  \usepackage[autostyle]{csquotes}  \usepackage[     backend=biber,     style=authoryear ]{biblatex}  \addbibresource{references.bib}  \begin{document}   This is \cite{DBLP:journals/corr/abs-1301-3781}  \printbibliography   \end{document}   references.bib  @article{DBLP:journals/corr/abs-1301-3781,   author    = {Tomas Mikolov and                Kai Chen and                Greg Corrado and                Jeffrey Dean},   title     = {Efficient Estimation of Word Representations in Vector Space},   journal   = {CoRR},   volume    = {abs/1301.3781},   year      = {2013},   url       = {http://arxiv.org/abs/1301.3781},   timestamp = {Thu, 07 May 2015 20:02:01 +0200},   biburl    = {http://dblp.uni-trier.de/rec/bib/journals/corr/abs-1301-3781},   bibsource = {dblp computer science bibliography, http://dblp.org} }

Running the minimal example  \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{\jobname.bib} @ARTICLE{example,   author  = {Other, Anthony Norman},   title   = {Some things I did},   year    = {2014},   journal = {J.~Irrep. Res.},   volume  = {1},   number  = {1},   pages   = {1-10} } \end{filecontents*} \usepackage[backend=biber]{biblatex} \addbibresource{\jobname.bib} \begin{document} Hello\cite{example}. \printbibliography \end{document}   I get the warning There were undefined references.  I have read  and know that I need to run:   LaTeX Biber LaTeX   However, my editor is only set up to run BibTeX. How do I go about setting up my editor/IDE to be able to run Biber, and how do I run the LaTeX/Biber/LaTeX cycle?  Answers (sorted alphabetically by editor name)                    Answer guidelines   Each answer should be for one editor. If the editor is cross-platform, if possible give a single answer with notes covering the minor platform variations. Please edit the question to include new answers in the 'link list' Each answer should be 'stand alone', i.e. don't say 'It's almost the same as editor Y but ...' for the editor part Instructions for 'build tools' such as arara or latexmk are welcome but should explain how to set up the editor in question as not all editors allow simple addition of arbitrary tools


How do I set global environment variables in Ubuntu, in such a way, that they would apply also to root user?  Setting PATH or JAVA_HOME in /etc/environment or in /etc/profile.d/my_settings.sh both works for usual user, but not for root.  I'm logging in as root using sudo bash or sudo zsh.  NOTE: using Ubuntu 10.04.

To create persistent environment variables, I add the script file to /etc/profile.d directory, for example:   # my script export MY_VAR=var_value   This works properly for current user:   alex@alex-64:~$ echo $MY_VAR var_value   Now I need the same environment variables for the root user, but /etc/profile.d script doesn't work for root:   alex@alex-64:~$ echo $MY_VAR var_value alex@alex-64:~$ sudo su root@alex-64:/home/alex# echo $MY_VAR  root@alex-64:/home/alex#    How can I set the same variables for the root?


Light cannot escape the gravitational pull of the black hole and hence the 'black hole' is black. Any object that is black in color, absorbs all wavelengths of light and reflects none. So it appears black.   Could someone explain the key difference between these two phenomena ?

Is there a substance that doesn't reflect or absorb visible light but may reflect light from another spectrum? Is there a theoretical substance that would have these properties?  EDIT: Sorry I wasn't quite clear with my original question. I've updated it to express more what I was thinking. Would a substance be "invisible" if it didn't reflect or absorb light? Does a real or theoretical substance like that exist? I assume we can see glass and so on because it refracts light and to a certain extent reflects it.


In the book Grammar Girl's Quick and Dirty Tips for Better Writing is says the word "mom" is a proper noun in the following context and should be capitalized: "How's Mom these days". My question is: should the word "mom" be capitalized in the following sentence: "She became a mom".

I am trying to understand capitalization rules with Mom and Dad. I believe I have it correct below, but please let me know if I do not.     The one thing I learned from my dad was that it was good to earn the trust of one's children. Dad has shown me how good that a dad can be. One day when I went to his house, and Dad wasn't there, I ran outside....   The above passage is just made-up just so that you would see what I mean about capitalization. Let's put numbers by each one, like so:     The one thing I learned from my dad(1) was that it was good to earn the trust of one's children. Dad(2) has shown me how good that a dad(3) can be. One day when I went to his house, and Dad(4) wasn't there, I ran outside....    This is one where I'm not certain. I believe in this sense I'm showing possession here with "my", and it just didn't seem right saying "my Dad". I don't know what the grammar rule is here, or if I even have it right. This one is obvious—it starts the sentence. In this case, I'm using Dad like a name instead of saying "Larry". Therefore, it should be capitalized. Again, just like 3.


i want to get the result of a php file with Process.Start, my code:  public string RunPHP(string filename)     {         var p = new Process         {             StartInfo = new ProcessStartInfo("php", "-f \"" + filename + "\"")             {                 RedirectStandardOutput = true,                 RedirectStandardError = true,                 UseShellExecute = false,                 CreateNoWindow = true             }         };         Console.WriteLine("'" + p.StartInfo.Arguments + "'");         var output = new StringWriter();         var error = new StringWriter();          p.OutputDataReceived += (sender, args) => { output.WriteLine(args.Data); Console.WriteLine(args.Data);  };         p.ErrorDataReceived += (sender, args) => error.WriteLine(args.Data);         p.Start();          p.BeginOutputReadLine();         p.BeginErrorReadLine();          p.WaitForExit();          if (p.ExitCode != 0)         {             throw new Exception(string.Format(                 "PHP failed with the following output:{0}{1}",                 /* {0} */ Environment.NewLine,                 /* {1} */ error.GetStringBuilder().ToString()));         }         var res = output.GetStringBuilder().ToString();         return res;     }   but i get the result only, if i'm press enter in the console application window. (php 7)  how can i avoid this?

I have the following code: info = new System.Diagnostics.ProcessStartInfo("TheProgram.exe", String.Join(" ", args)); info.CreateNoWindow = true; info.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; info.RedirectStandardOutput = true; info.UseShellExecute = false; System.Diagnostics.Process p = System.Diagnostics.Process.Start(info); p.WaitForExit(); Console.WriteLine(p.StandardOutput.ReadToEnd()); //need the StandardOutput contents  I know that the output from the process I am starting is around 7MB long. Running it in the Windows console works fine. Unfortunately programmatically this hangs indefinitely at WaitForExit. Note also this code does NOT hang for smaller outputs (like 3KB). Is it possible that the internal StandardOutput in ProcessStartInfo can't buffer 7MB? If so, what should I do instead? If not, what am I doing wrong?


I use Ubuntu 14.04 at work. It's the first major use of Linux that I've had. I have gotten used to it so much that I prefer using it instead of Windows for all work, particularly in a command line; I am a software developer so perhaps this might not surprise you.  I am considering installing Ubuntu in a new personal laptop.  However, I would want to completely remove Dash. I am absolutely not interested in searching my computer through a GUI (I use find). I've had Ubuntu 14.04 for two years and haven't used Dash a single time. It's intrusive to my workflow. I do not want to pay the cost of a background application indexing my machine. I do not want to pay the cost of the indexed database storage on my machine.  I want, instead, a more Windows XP style prompt. It should have a hierarchy of directories which I manually created. I have that already on the filesystem, but a GUI navigation tree would be acceptable. However, having this menu is not as important to me as removing Dash.

This question exists as it fills a specific criterion.  While you are encouraged to help maintain its answers, please understand that "big list" questions are not generally allowed on Ask Ubuntu and will likely be closed per the . More information on the .   What kind of desktop environments or shells are there for Ubuntu users to install?  Please list a desktop environment or shell for each:   a description on why you like or suggest it (features, performance, etc.). a good screenshot, preferably of it running on Ubuntu and showing off some of its features. the minimal requirement for it to be usable, If there's any setting to lower it's requirement (Like kde's low-fat profile); how to enable the said setting some instructions on how to set it up if in the repositories, please provide a software centre link


So I'm doing a search method and my HashSet<GameBoard> explored has all the explored states. I need to add more states to "explored" so I don't check the same state over and over again. I need to compare states with a copy of itself and if the VALUE of them are the same, I don't check it again.  I know I have to override the .equals()method in Obj class for it to do a deep search and I did just that. Below is my equals method.   public boolean equals  (GameBoard a){     for(int j = 0;j < a.len;j++){         if(a.boardArr[j] != this.boardArr[j]){             return false;         }     }     return true; }   I add GameBoard to explored using explored.add(state);. But this doesn't seem to do anything. I even commented out the equals method completely and the result is the same. It keeps adding the same state to the explored state and hence I have an infinite loop. Really need some help here does anyone know how to solve this?

I ran into an interesting (and very frustrating) issue with the equals() method today which caused what I thought to be a well tested class to crash and cause a bug that took me a very long time to track down.   Just for completeness, I wasn't using an IDE or debugger - just good old fashioned text editor and System.out's. Time was very limited and it was a school project.  Anyhow -   I was developing a basic shopping cart which could contain an ArrayList of Book objects. In order to implement the addBook(), removeBook(), and hasBook() methods of the Cart, I wanted to check if the Book already existed in the Cart. So off I go -  public boolean equals(Book b) {     ... // More code here - null checks     if (b.getID() == this.getID()) return true;     else return false; }   All works fine in testing. I create 6 objects and fill them with data. Do many adds, removes, has() operations on the Cart and everything works fine. I read that you can either have equals(TYPE var) or equals(Object o) { (CAST) var } but assumed that since it was working, it didn't matter too much.  Then I ran into a problem - I needed to create a Book object with only the ID in it from within the Book class. No other data would be entered into it. Basically the following:  public boolean hasBook(int i) {     Book b = new Book(i);     return hasBook(b); }  public boolean hasBook(Book b) {     // .. more code here     return this.books.contains(b); }   All of a sudden, the equals(Book b) method no longer works. This took a VERY long time to track down without a good debugger and assuming the Cart class was properly tested and correct. After swaapping the equals() method to the following:  public boolean equals(Object o) {     Book b = (Book) o;     ... // The rest goes here    }   Everything began to work again. Is there a reason the method decided not to take the Book parameter even though it clearly  was  a Book object? The only difference seemed to be it was instantiated from within the same class, and only filled with one data member. I'm very very confused. Please, shed some light?


I'm a new reviewer. Is it possible for me to filter reviews that don't exist in my tags. If not, can I customize it in any way?

I've had the ability to review suggested edits for a while now, however I don't often do so because the list is usually full of questions about languages and technologies I'm not familiar with or not interested in, and can sometimes be hundreds of questions long.  I would like to help out more, but most of my rep has been gained by questions within a specific technology, so I only feel comfortable reviewing edits within that tag.   Can you allow us to filter suggested edits by tag?  Edit:   Actually, can you let us filter the entire Review section by tag, and not just Suggested Edits?  I would find it much more interesting to review questions in tags I'm familiar with and can  understand the question content of, and it would give me a bit of pride to help maintain "my" section of SO.


After installing KDE on Ubuntu 16.04 I can't use unity anymore and when trying to download new software with apt-get I get error messages.  The following packages have unmet dependencies: kde-telepathy-minimal : Depends: kde-config-telepathy-accounts (>=15.04.0) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).   When I try sudo apt-get -f install i get another error message.  0 upgraded, 1 newly installed, 0 to remove and 46 not upgraded. 2 not fully installed or removed. Need to get 0 B/137 kB of archives. After this operation, 825 kB of additional disk space will be used. Do you want to continue? [J/n] j (Reading database ... 445397 files and directories currently installed.) Preparing to unpack .../kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_amd64.deb ... Unpacking kde-config-telepathy-accounts (4:15.12.3-0ubuntu1) ... dpkg: error processing archive /var/cache/apt/archives/kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_amd64.deb (--unpack): trying to overwrite '/usr/share/accounts/services/google-im.service', which is also in package account-plugin-google 0.12+16.04.20160126-0ubuntu1 Processing triggers for libc-bin (2.23-0ubuntu7) ... Errors were encountered while processing: /var/cache/apt/archives/kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_amd64.deb                                                                  E: Sub-process /usr/bin/dpkg returned an error code (1)    I'm pretty sure i fucked something up along the way and I read online that I will have to delete the damaged package but I don't really know how to do that without bricking my system.

For example:  $ sudo apt-get install curl Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: bsh : Depends: libjline-java but it is not going to be installed groovy : Depends: libjline-java but it is not going to be installed rhino : Depends: libjline-java but it is not going to be installed E: Unmet dependencies.   Try 'apt-get -f install' with no packages (or specify a solution).   I get the same or similar errors when I attempt to install clojure1.3, leiningen, and several other packages.   When I try the suggestion made in the error message, this is what happens:  $ sudo apt-get -f install  Reading package lists... Done Building dependency tree        Reading state information... Done Correcting dependencies... Done The following packages were automatically installed and are no longer required:   diffstat linux-headers-3.2.0-26-generic linux-headers-3.2.0-26 dh-apparmor dkms html2text libmail-sendmail-perl libsys-hostname-long-perl Use 'apt-get autoremove' to remove them. The following extra packages will be installed:   libjline-java Suggested packages:   libjline-java-doc The following NEW packages will be installed:   libjline-java 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 23 not fully installed or removed. Need to get 0 B/72.0 kB of archives. After this operation, 129 kB of additional disk space will be used. Do you want to continue [Y/n]? Y (Reading database ... 226243 files and directories currently installed.) Unpacking libjline-java (from .../libjline-java_1.0-1_all.deb) ... dpkg: error processing /var/cache/apt/archives/libjline-java_1.0-1_all.deb (--unpack):  trying to overwrite '/usr/share/java/jline.jar', which is also in package scala 2.9.2-400 Errors were encountered while processing:  /var/cache/apt/archives/libjline-java_1.0-1_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1)  $ sudo apt-get upgrade Reading package lists... Done Building dependency tree        Reading state information... Done You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies:  bsh : Depends: libjline-java but it is not installed  groovy : Depends: libjline-java but it is not installed  rhino : Depends: libjline-java but it is not installed E: Unmet dependencies. Try using -f.


Suppose you want to activate an alarm triggered once a certain location is reached. There exist something capable of this already on Samsung S9 for example

I want to know what apps can sound an alarm depending on my location.   Obviously it would be better if the battery consumption is low.  I'd be happy if the application is free but wouldn't mind paying if it's working properly with not much battery consumption. Also please post (if you can) only applications that you've used.   UPDATE: Sorry guys, I should have been more clear. The alarm I am looking for is something where I can set an alarm when I am in the bus/train and make it sound the alarm and wake me up before my stop.


I would like to show category.php a post I set as sticky post for that category.    Do you know code to do this?

I have a question today. I am looking for a solution to make sticky post available on my website. But, i just got it work on homepage with the code below.  function wpb_latest_sticky() {   /* Get all sticky posts */ $sticky = get_option( 'sticky_posts' );  /* Sort the stickies with the newest ones at the top */ rsort( $sticky );  /* Get the 5 newest stickies (change 5 for a different number) */ $sticky = array_slice( $sticky, 0, 5 );  /* Query sticky posts */ $the_query = new WP_Query( array( 'post__in' => $sticky, 'ignore_sticky_posts' => 1 ) ); // The Loop if ( $the_query->have_posts() ) {     $return .= '
';     while ( $the_query->have_posts() ) {         $the_query->the_post();         $return .= '
' . get_the_title() . '
' . get_the_excerpt(). '
';      }     $return .= '
';  } else {     // no posts found } /* Restore original Post Data */ wp_reset_postdata();  return $return;   }  add_shortcode('latest_stickies', 'wpb_latest_sticky');   I was thinking to make the sticky post to be displayed on search, tag, and category as well.   Any solution? Thanks!


below is an app im working on:   MainClass Employee Manager QATester Devloper   This is the  Example Scenario:  1) For the given hierarchy:     Manager A  $300         Manager B  $300             Developer $1000             QA Tester $500  2) Manager A’s allocation should be: $2100   The issue I am currently having is when I run the code I get the following Error:  Exception in thread "main" java.lang.NullPointerException at expenseApp.Manager.add(Manager.java:28) at main.MainClass.main(MainClass.java:15)   I am a little confused as to what is going on and how it can be fixed.  Could you please help?  I'm relatively new to programming so examples of suggests do a lot for me. In Manager I left in some commented out code which represents a few of my attempts to fix.   Thank you.  package main;  import expenseApp.Developer; import expenseApp.Manager; import expenseApp.QATester;  public class MainClass {      public static void main(String[] args)      {         QATester tester1 = new QATester();         Developer dev1 = new Developer();          Manager managerB = new Manager();         **managerB.add(tester1);**         managerB.add(dev1);          Manager managerA = new Manager();         managerA.add(managerB);      }  }     package expenseApp;  public abstract class Employee  {     public abstract int getExpenses(); }     package expenseApp;  import java.util.ArrayList;  public class Manager extends Employee {          private ArrayList<Manager> managerList; //= new ArrayList<>();         private ArrayList<Employee> employeeList; //= new ArrayList<>();          // public Manager(ArrayList<Manager> managers, ArrayList<Employee> employees)          // {         //    this.managerList = new ArrayList<>(managers);         //    this.employeeList = new ArrayList<>(employees);         // }      public void add(Employee employee)      {         if(employee instanceof Manager)          {             //managerList = new ArrayList<>();             managerList.add((Manager) employee);          }         else          {             //employeeList = new ArrayList<>();             **employeeList.add(employee);**          }     }      @Override     public int getExpenses()      {          return 300;     }      public int getTotalExpenses()      {         int totalExpenses = 0;          for(Manager manager : managerList)         {             totalExpenses += manager.getTotalExpenses();         }          for(Employee employee : employeeList)         {             totalExpenses += employee.getExpenses();         }          return totalExpenses;     } }     package expenseApp;  public class QATester extends Employee {      @Override     public int getExpenses()      {         return 500;     }  }   package expenseApp;  public class Developer extends Employee {     @Override     public int getExpenses()      {         return 1000;     } }

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 am using 16.04 lts, and after it wasn't working I deleted it on accident and now I do not have the Software Center nor any of my apps, (Inkscape, Blender, misc games.) My steam is running and programs that I downloaded before work.

I have a friend who has got a computer that is not connected to the Internet. Is there any way to install software offline easily?


So, I have an old Sandisk Cruzer Edge 4GB USB drive, And I know how to format the usb, so I did what works for all USB drives, first, I used fdisk -l to find my USB's file-system. Heres what came up:  Disk /dev/sdb: 4004 MB, 4004511744 bytes 124 heads, 62 sectors/track, 1017 cylinders, total 7821312 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0000000  Disk /dev/sdb doesn't contain a valid partition table   So, I'm going on, I successfully unmounted the USB, then ran the command sudo mkfs.ext4 /dev/sdb I get the error:   user@user:~$ sudo mkfs.ext4 /dev/sdb mke2fs 1.42.9 (4-Feb-2014) /dev/sdb is entire device, not just one partition! Proceed anyway? (y,n) y  /dev/sdb: Read-only file system while setting up superblock   Please help? Thanks for any help!  PS: My USB doesn't show up in GParted, so don't tell me to try that please :)

I have a MicroSD card reader in my notebook. When I insert a MicroSD memory card into it, I can't write any data on it - it's read-only. The same thing happens when I try to do it under root. And I can't change the permission policy for it. This problem happens for all microSD cards (I've tested 2 cards). I've encountered it on Ubuntu 12.04 LTS, now I'm on Ubuntu 12.10, the problem is still on it's place. When I try to insert such a "read-only" card in my mobile phone, everything's OK and I can write data on it. So, can anybody tell me, how can I write a data onto the card?  UPD: here's fdisk -l output:  Disk /dev/sdc1: 2013 MB, 2013135360 bytes 62 heads, 62 sectors/track, 1022 cylinders, total 3931905 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000   Device Boot      Start         End      Blocks   Id  System   The file system of the card is msdos. As to me it's weird.   UPD2: I've found a small "lock" switch on my card adapter, and it turns out, that when I insert it in my notebook, it switches on. Perhaps, I have to find some glue or something to get that switch stuck...  UPD3: There was no glue near me, so I've decided to buy another card-reader.


I have twelve global surface temperature rasters and each has a slightly different temperature range depending on the time of year. I would like to create a common scale i.e. -80c to 80c and so all the colours in each raster match each other. I am happy it do this in either QGIS or ArcGIS.

I have a series of continuous rasters representing the same phenomenon over time, so I need to use the same symbology across them all.  So I set the stretched symbology of the first raster, with a color ramp from the min/max values:    Now in the second raster, I import the symbology from the first raster. Unfortunately, although the labels match, the actual min/max values are not the same as the first layer:    So the red in the second raster corresponds to a value of 0.47, rather than 0.66.  How can I ensure that both rasters are using a consistent symbology?


I remember reading (and also seeing a TV movie adaptation?) about a boy/alien who crawled out of a cave, learned the language by reading everybody's thoughts, and then went back for some reason. There was a scene towards the end with a judge asking him to guess a number, and that's how they verified he was actually a telepath. Does anybody remember this book?

As I remember a boy from another planet was dropped on earth. Gravity didn't affect him as much. He was being chased by something and leaped over a barbed wire fence "like a deer". Also the story started out with a young earth girl at "school", she sat in her bedroom and her books and teachers were on a screen ...cutting edge stuff for a 4th grader in 1974.


I am a bit confused. I thought after Monty opens the door with the goat, conditional probabilities kick in and our sample space shrinks down to 2 doors instead of 3, and since they were all equally likely, the two doors now have probabilities of 1/2. But apparently, we are not supposed to use conditional probability here?  Thanks in advance

I was watching the movie 21 yesterday, and in the first 15 minutes or so the main character is in a classroom, being asked a "trick" question (in the sense that the teacher believes that he'll get the wrong answer) which revolves around theoretical probability.  The question goes a little something like this (I'm paraphrasing, but the numbers are all exact):  You're on a game show, and you're given three doors. Behind one of the doors is a brand new car, behind the other two are donkeys. With each door you have a $1/3$ chance of winning. Which door would you pick?  The character picks A, as the odds are all equally in his favor.  The teacher then opens door C, revealing a donkey to be behind there, and asks him if he would like to change his choice. At this point he also explains that most people change their choices out of fear; paranoia; emotion and such.  The character does change his answer to B, but because (according to the movie), the odds are now in favor of door B with a $1/3$ chance of winning if door A is picked and $2/3$ if door B is picked.  What I don't understand is how removing the final door increases the odds of winning if door B is picked only. Surely the split should be 50/50 now, as removal of the final door tells you nothing about the first two?  I assume that I'm wrong; as I'd really like to think that they wouldn't make a movie that's so mathematically incorrect, but I just can't seem to understand why this is the case.  So, if anyone could tell me whether I'm right; or if not explain why, I would be extremely grateful.


I'm restricted to sudo apt-get install and I need to install python-pil so the command should be sudo apt-get install python-pil,but here is the problem:  sudo apt-get install python-pil Reading package lists... Done Building dependency tree        Reading state information... Done Package python-pil is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'python-pil' has no installation candidate   How to resolve this?

How do I install the python imaging library (PIL) on Ubuntu?  I tried doing  sudo apt-get install python-imaging   but now when i run     python selftest.py (a script I got from somewhere on the  website) I get (among other warning messages):  ... *** JPEG support not installed *** ZLIB (PNG/ZIP) support not installed ... *** 1 tests of 57 failed.   Have I somehow messed up the PIL -- how do I fix that?  Is maybe the PIL just fine, but that "selftest.py" is not really the right program for checking to see if PIL is installed properly -- how else can I tell if PIL is installed properly or not?  (I'm using Ubuntu 12.04 LTS "Precise Pangolin").  (What I'm ultimately trying to do is to add a 2D barcode generator to some python code, and all the 2D barcode generators I could find that were written in python all seemed to use the PIL).


I am familiar with the case where the basis is not infinite (it becomes the case that it CANNOT be represented as such). However, many sources suggest that this is not the case for an infinite basis. How could one go about proving this?

I was looking for alternate proofs of the theorem that "a vector space $V$ of dimension greater than $1$ over an infinite field $\mathbf{F}$ is not a union of fewer than $|\mathbf{F}|$ proper subspaces" and possible generalizations.  A simple measure-theoretic proof over $\mathbb{R}$ is as follows: By countable additivity the sum of the measures of any collection of subspaces is zero since the measure of each subspace is zero, which is a contradiction.  I would like to look at proofs over arbitrary infinite fields and would like to know if similar statements hold for say modules (finitely generated or otherwise) over infinite rings.


I wonder if it's worth upgrading 4.13 kernel to 4.15. I cannot complain about any instability of 4.13, but I'm interested how 4.15 going on and if there are benefits upgrading.

Newer "mainline" versions of the kernel are available from the , e.g. 3.4 and 3.5, while Ubuntu 12.04 is on 3.2.   What are the mainline kernels? Are they better than my existing kernel? What are the pros and cons of upgrading to a mainline kernel? Will I easily be able to go back?


I've tried alt+0198but it doesn't work. I guess that only works in Windows. How do I type it in Ubuntu?

The title pretty much says it all: how can I type Unicode characters - specifically the em-dash —?


This has been happening for many days. Some applications are getting installed without my permission, even though I've disabled the 'Unknown Sources' option in Security Settings. Also, I've installed Application Install Blocker and other applications can't be installed, but apps named Timeservice, Data and others get installed.

My Micromax A106 is affected by viruses called  timeService, monkeyTest, androidSystem and some unknown ones.   These viruses started automatically even though I uninstalls, disabled and stopped them. Because of them, performance of mobile is very poor, not responding properly for my action.   I didn't even install any app. My mobile have only 16 apps.   When I switch off and then switch on the mobile, the apps like Privacy guard, 9 apps, cool browser, easy touch (1), easy touch (2), hot video, and some more unwanted apps are installed automatically.   I'm unable to uninstall them. If I uninstall them, they automatically get installed without my knowledge.  SOLUTIONS TRIED:   I tried by installing all the antivirus apps available in Google Play like Norton, Avast, AVG, Kaspersky, Trojan remover and more. Nothing happened. Formatted Internal and External SD cards. Factory reset the device. Enabled the security options to not to install from unknown sources.   I tried most of the solutions available on web. Nothing works for me.   Anyone help me to resolve and relieve me from this issue.