Java Inheritance: Question regarding the parent reference variable.  I am learning Java and going through the inheritance problems in Java, have one question here.  public class Shape {     private String shapeName;     private String area;     //normal getters and setters }  public class Triangle extends Shape {     private String typeOfTriangle;     //normal getter and setter. }  public class ShaperRunner {     public static void main(String[] args) {         Shape shape = new Triangle();         // Here the shape reference variable referencing to Triangle object is allowed, however using this shape object. I cannot call         shape.setTypeOfTriangle("Scalence")         System.out.println("The shape of the triangle is " + shape.getTypeOfTriangle());     } }   My Question is if shape reference variable can be used to call only the getters and setters confined to what is defined in it, then why do we even consider using shape object to reference Triangle object. I have seen such code in few places but could not understand what is the advantange of doing it.

I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible?


Is it possible to determine if some application is currently using microphone (i.e. is actively listening)?  Do operating systems (Windows in my case, but I'm curious about other OS-es as well) provide APIs for such feature?  I'm trying to test if apps are spying on users and data from such feature could serve as circumstantial evidence.

After reading  and reading the comments on the page, one person was wondering if it would be possible to use the Physical Device Object Names of other hardware such as the microphone to find out the names of processes using that device.  I tried the same approach, but so far it only seems to work for the webcam. Is there any other way I could get this to work in ?      UPDATE:  The Lifehacker post was about finding out which Windows process is currently using your webcam.  is how they went about doing it:        Start Device Manager (WIN+R → "devmgmt.msc" → OK)   Find your webcam among the list of devices (check under Imaging Devices)   Open the properties window of the device and switch to the Details tab  (Right click → Properties → Details)   In the dropdown menu, select Physical Device Object Name and copy the string(Right click → Copy)   Download    Make sure you have opened Process Explorer in Administrator Mode(File → Show Details for All Processes)   Hit CTRL+F and enter the string you copied earlier(it should be something like \Device\000000XX)   Hit the Search button and you should see a list of processes using the webcam(if there are any)


Suppose elements $a$ and $b$ in a domain satisfy $a \mid b$ and $b \mid a$. How do I see that $a = bu$ for some unit $u$?

Let $x$ and $y$ be nonzero elements of an integral domain $D$. Then $x$ and $y$ are associates if and only if $x = yd$ for some unit $d \in D$.    I am done proving the $\Leftarrow$ part. For $\Rightarrow$ what I did was: If $x$ and $y$ are associates then $x \mid y$ and $y \mid x$, so $x \mid y$ implies that $xs = y$ for some $s \in D$ and $y \mid x$ implies that $yt = x$ for some $t \in D$. That is, $yts=y$ which implies $ts=1$. Therefore $s$ is a unit and $t$ is a unit.    Am I on the right track? Can I say that the proof is complete?


I will be landing at Geneva airport (Switzerland) in the coming mid June. As I would like to go to Metabief, France, I am thinking to take train from Train station Geneva Cornavin (near Geneva airport) to Vallorbe followed by a bus to Metabief.      sells train tickets. However, I am not sure whether my flight would be delayed and so I am not planning to purchase online.   As this is my first time travelling to Geneva airport, I am not sure whether I can purchase train ticket on the spot.

On September 4, I will be arriving in Geneva by airplane at approximately 11 AM. After that, I need to go to Lausanne. I have two questions:   Do I need to buy a train ticket online, or can I buy it directly at the station without any problems? (Problems such as: the trains are always full, it's not permitted to buy a ticket etc.) Moreover, are the tickets only for a specific train or it is like "you can board any train from Geneve to Lausanne with this ticket"? How do I get from the airport to the Geneva train station (as low a budget as possible, I guess walking is not an option though), and how much does it cost?   I'd appreciate answers from people who have been there, but if you're able to find an exhaustive link from any website that's okay too.


This is the proof from class:  $Q_8 = \langle a,b \mid a^4, a^2=b^2, a^b=a^{-1} \rangle$ has a unique element of order 2, so every subgroup of $Q_8$ of order 4 must be cyclic and has $a^2$ as its element of order 2. So $N\cap H \neq 1$.  My question is, why can we conclude that every subgroup of $Q_8$ of order 4 must be cyclic and has $a^2$ as its element of order 2?

Hi I'm having trouble understanding why the quaternionic group cannot be written as a semi-direct product in a non-trivial way. Is there a proof of why this is the case?


I have wrote this below code to create order when opportunity stage is closed/Won 100%.  Problem is I am getting following error in below form in line number 8,     Too many SOQL queries: 101   I think i wrote this trigger with bulky but not sure what i missed up or what i did wrong for this code, can any one please look into this code ?  trigger OrderOfOpportunity on Opportunity (after update) { if(trigger.isUpdate && Trigger.isAfter){     Map<Id,Opportunity> mapOldOrderToOpp = Trigger.oldMap;     Map<Id,Opportunity> mapNewOrderToOpp = Trigger.newMap;     List<Order> orderList = new List<Order>();              if(mapNewOrderToOpp.size() > 0){         /* This is line number 8 */         List<opportunity> oList = [SELECT Id, CurrencyIsoCode, Type, AccountId, ContractId, stageName, RecordTypeId , sub_tipo__c, (select id from Orders),(Select Id, SBQQ__Product__c, SBQQ__Quantity__c, SBQQ__ListPrice__c from Quote_Lines__r), Quote_line_Product_Name__c FROM opportunity WHERE id IN : mapNewOrderToOpp.keyset()];         List<orderitem> oitemList = new List<orderitem>();         Id prbkId = [Select Id from Pricebook2 where Name = 'Lista de Precios CPQ' Limit 1].Id;         Order order;         if(!oList.isEmpty()){             for(opportunity op : olist){                 if(op.Orders.isempty() && op.stageName != null && mapOldOrderToOpp.get(op.Id).stageName != op.stageName && op.stageName == 'Ganada/Firma de contrato' && op.RecordTypeId == '012700000001ix9'){                     order = new Order();                     order.EffectiveDate = Date.TODAY();                     order.AccountId = op.AccountId;                     order.OpportunityId = op.Id;                     order.Status = 'Stand by';                     order.Type = op.sub_tipo__c;                     order.CurrencyIsoCode = op.CurrencyIsoCode;                     order.PriceBook2Id = prbkId;                     orderList.add(order);                 }             }         }         if(orderList.size() > 0)             insert orderList;     } } }

This question has been asked before, but none of the answers on those threads have helped so far.  Getting the following error when trying to deploy a test class from the sandbox to production in the Force.com IDE:  System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, LeadPerson: execution of AfterInsert caused by: System.Exception: Too many SOQL queries: 101  LeadPerson trigger looks OK, e.g., no SOQL calls inside a loop.  trigger LeadPerson on Lead (after insert) {     Map<Id, Lead> leadMap = new Map<Id, Lead>();     Map<String, Lead> leadEmailMap = new Map<String, Lead>();      for(Lead lead : Trigger.new) {         if (lead.Email != null) {             leadMap.put(lead.Id, lead);             leadEmailMap.put(lead.Email, lead);         }     }      Map<String, Person__c> personMap = new Map<String, Person__c>();     for (Person__c p : [SELECT Id, Email__c FROM Person__c WHERE Email__c IN :leadEmailMap.keySet()]) {         personMap.put(p.Email__c, p);     }      List<Person__c> addPersons = new List<Person__c>();     List<PersonHistory__c> addPersonHistorys = new List<PersonHistory__c>();     List<Lead> addPersonLead = new List<Lead>();     Map<String, String> addPersonEmails = new Map<String, String>();      for(Lead lead : Trigger.new) {         if (lead.Email != null) {             if (personMap.containsKey(lead.Email)) {                 // Create PersonHistory__c record for existing Person__c records                 Person__c getPerson = personMap.get(lead.Email);                 PersonHistory__c newPersonHistory = new PersonHistory__c();                 newPersonHistory.Person__c = getPerson.Id;                 newPersonHistory.RecType__c = 'LEAD';                 newPersonHistory.RecSubType__c = lead.inq_type__c;                 newPersonHistory.SFID__c = lead.Id;                 newPersonHistory.RecTypeStatus__c = 'NEW';                 addPersonHistorys.add(newPersonHistory);             } else {                 // Create Person__c and PersonHistory__c record for NEW Person__c records                 String firstInitial = '';                 if (lead.FirstName != null) {                     firstInitial = lead.FirstName.substring(0, 1);                 }                  if (!addPersonEmails.containsKey(lead.Email)) {                     addPersonEmails.put(lead.Email, 'EMAIL');                     Person__c newPerson = new Person__c();                     newPerson.Email__c = lead.Email;                     newPerson.AltKey__c = firstInitial + lead.LastName + lead.PostalCode;                     newPerson.Current_Status__c = 'NEW';                     addPersons.add(newPerson);                     addPersonLead.add(lead);                 }             }         }     }      // INSERT NEW Person__c records     List<Database.SaveResult> newPersonResult = Database.Insert(addPersons);     for (integer i = 0; i < newPersonResult.size(); i++) {         // Create PersonHistory__c records for new Person__c records         PersonHistory__c newPersonHistory = new PersonHistory__c();         newPersonHistory.Person__c = newPersonResult.get(i).getId();         newPersonHistory.RecType__c = 'LEAD';         newPersonHistory.RecSubType__c = addPersonLead.get(i).inq_type__c;         newPersonHistory.SFID__c = addPersonLead.get(i).Id;         newPersonHistory.RecTypeStatus__c = 'NEW';         addPersonHistorys.add(newPersonHistory);     }     insert addPersonHistorys; }   The debug log doesn't show a transaction having more than 5 out of 100 SOQL queries in the CUMULATIVE_LIMIT_USAGE sections. Not sure where to look next. Any help is appreciated.


Is $1= -1$ ?    because,  $1=\sqrt{1}  =\sqrt{-1×-1}  =\sqrt{-1}×\sqrt{-1 }  = i×i   = i^2 = -1 $ this can be done with all natural numbers. how this can be? please help me


Four different integers form an increasing A.P. One of these numbers is equal to the sum of the squares of the other three numbers. Find the numbers  My Attempt:  I assumed the four numbers as: $(a-3d), (a-d), (a+d), (a+3d)$ but now i can't understand which number to square.

Please help-  Four different integers form an increasing AP.One of these numbers is equal to the sum of the squares of the other three numbers.Then- find all the four numbers.  I assumed the numbers to be $a,a+d,a+2d,a+3d$ and wlog let $a+3d$ this number and according to question-  $a^2+(a+d)^2+(a+2d)^2=a+3d$  but I could not solve the above equation.


I want to know how to prove this:  $$ \sum_{k=1}^\infty \arctan\left( \frac{x}{k^2+a} \right)  = \pi \left\lfloor \frac{b}{\sqrt{2}} \right\rfloor     + \arctan\left( \frac{x}{b^2} \right)     - \arctan\left[ \tanh\left( \frac{\pi}{\sqrt{2}} \frac{x}{b} \right)                     \cot\left( \frac{\pi}{\sqrt{2}} b \right) \right] $$  for $0 \le a, b = \sqrt{\sqrt{x^2 + a^2} - a}$.  At least in the special case $x=1$,$a=0$  Thank you ..

show that:   $$\sum_{n=1}^{\infty}\arctan{\left(\dfrac{1}{n^2+1}\right)}=\arctan{\left(\tan\left(\pi\sqrt{\dfrac{\sqrt{2}-1}{2}}\right)\cdot\dfrac{e^{\pi\sqrt{\dfrac{\sqrt{2}+1}{2}}}+e^{-\pi\sqrt{\dfrac{\sqrt{2}+1}{2}}}}{e^{\pi\sqrt{\dfrac{\sqrt{2}+1}{2}}}-e^{-\pi\sqrt{\dfrac{\sqrt{2}+1}{2}}}}\right)}-\dfrac{\pi}{8}$$   This relust is nice.(maybe have some wrong)  becasue I know this famous problem $$\sum_{n=1}^{\infty}\arctan{\dfrac{2}{n^2}}=\dfrac{3\pi}{4}$$ and follow AMM( E3375) problem $$\sum_{n=1}^{\infty}\arctan{\dfrac{1}{n^2}}=\arctan{\left(\dfrac{\tan{\frac{\pi}{\sqrt{2}}}-th{\dfrac{\pi}{\sqrt{2}}}}{\tan{\dfrac{\pi}{\sqrt{2}}}+th{\dfrac{\pi}{\sqrt{2}}}}\right)}$$  Follow is AMM solution:  My try:  my problem I want use this methods,But at last failure it.  Thank you  for you help.  This problem is similar this:we konw this     $$\sum_{n=1}^{\infty}\dfrac{1}{n^2}=\dfrac{\pi^2}{6}$$   and then little hard problem:   $$\sum_{n=1}^{\infty}\dfrac{1}{n^2+1}=\dfrac{1}{2}(\pi\coth{\pi}-1)$$


The distance between two opposite vertices of the dodecagon is 2. Find the area of the dodecagon.  Is there any way to do this without trigonometry?  And could you include a proof also? :O


I sometimes need to mount USB drives that are NTFS formatted and write to them. On Mavericks I achieved this using the Homebrew formula ntfs-3g which depends on osxfuse.  After upgrading to Yosemite, osxfuse is broken.  Homebrew message:  ==> Upgrading osxfuse osxfuse: OS X Mavericks or older is required for this package. OS X Yosemite introduced a strict unsigned kext ban which breaks this package. You should remove this package from your system and attempt to find upstream binaries to use instead. Error: An unsatisfied requirement failed this build.   I take this to mean that the kernel extension used by osxfuse is completely disallowed in Yosemite because it is not digitally signed by Apple, whereas in Mavericks it was allowed.  So, is there any way now to mount and write to an NTFS-formatted USB drive in Yosemite using either open-source software or free, unencumbered (not spyware/malware or bundled with useless toolbars etc.) software from the App Store?

What is the best, easiest, preferably cheapest way to make OS X write to NTFS-formatted drives in Mac OS X?


In the circuit below the switch is open and the capacitor starts with an initial energy of 0J and an initial potential of 0V in it.  The switch is closed and both the battery and the inductor's magnetic field charges the capacitor up. Everything then settles down and comes to a full rest.    The Question is: Once the process is complete after the closing of the switch and everything is settled down and has come to rest, How much energy in the form of joules should the capacitor have in it as well as how much voltage should the capacitor be charged up to?  This is a real world circuit with losses in the battery source, the connecting wires, the switch, the capacitor, the diode and the inductor. So not a perfect circuit by any means.  There is no inductance value, and in fact several different types of coil sizes and resistances were tried with the same result, so that's the reason for leaving off the inductance value. The inductance value is not 0 nor is the resistance value 0.  The answer doesn't have to be exact and just a general answer is expected. If the inductance somehow changes the answer to different answers then just include an inductance of some value, just as long as it's not 0H.         – Schematic created using

This is a followup to my previous question:   This is a real world circuit with losses. The losses are in the resistance of the battery, the switch, the capacitor, and the inductor.  The inductance value of the L1 inductor has been left out because it was not known or measured. It's not a value of 0 however as it has some inductance.  The capacitor starts out with an initial energy of 0 Joules as well as an initial voltage of 0 Volts.  The switch is closed only one time and left closed. The capacitor charges to the same voltage level as the battery of 12.33 V therefore it now has 76.014uJ of energy in it.   The question is:   Does the 50% loss of energy that normally occurs when charging a capacitor from a battery (without the inductor) still apply to this circuit, even with the L1 inductor in place?  In other words, the capacitor will charge up to the same voltage level as the battery of 12.33 V as confirmed with an actual physical circuit. Has only 50% of the energy been transferred into the capacitor than what came from the battery?  The actual physical circuit has actual inductance in the inductor, but it is unknown, but it's not 0.   Summarized and to the point:  In this circuit, how much energy is transferred from the battery and into the capacitor when everything comes to rest and all processes are completely done? 50%?, 99.8%?, how much energy was transferred from the battery to the capacitor?           – Schematic created using


I tried to compute the integral by using the substitution $x=e^y$ but I couldn't find an answer (I checked it converges by checking limits at both ends by using the comparison test).

We had our final exam yesterday and one of the questions was to find out the value of: $$\int_{0}^{\infty} \frac {\ln x}{1+x^2} \mathrm{d}x $$ Interestingly enough, using the substitution $x=\frac{1}{t}$ we get - $$-\int_{0}^{1} \frac {\ln x}{1+x^2} \mathrm{d}x = \int_{1}^{\infty} \frac {\ln x}{1+x^2} \mathrm{d}x $$and therefore $\int_{0}^{\infty} \frac {\ln x}{1+x^2} \mathrm{d}x = 0 $  I was curious to know about the theory behind this interesting (surprising even!) example.  Thank you.


How do I actually run a file on localhost? I know it is working, but how do I run a file on it, and how do I verify that the file is in fact running on localhost?  Server newbie here, additional questions (I have xampp running Apache 2.2): From your responses it sounds like I have to type in the path in the browser in order to open the file on the localhost. So, if I want to have the file in a subdirectory, I would have to type the full path including the directory?   Is there a way to have the browser point to the localhost while I am working on my html, instead of having to type in the path all the time?  I am working in Dreamweaver CS3, and want to use include commands (either SSI or PHP), but not have to keep putting my files up on HostGator in order to see if they are working.  What is the best way to do this (please be specific, I know nothing). If there is a detailed tutorial anywhere, really appreciate a link.  Thank you

I have a site directory for html (dreamweaver CSS3) with lots of subdirectories that contain HTML files for a number of drop down menus. They work fine where they are, but they all have menus that are JavaScript and could be kept in a separate file. So, I want to use Include. I don't want to have to FTP my files to HostGator every time I want to test the includes. I want to have this on my local machine. So, I am attempting for the first time to setup XAMMP and then run my html files (site) on localhost, so I can see what they look like before ftping everything to HostGator and putting it live.  I tried copying the main site folder to htdocs, and then copying the path to the file I want to run in front of the localhost in Firefox, but it gave me file not found:   Do I have too many subdirectories? Why isn't the file being found? It is there.  Tried this too:   No go.


I am using an HP laptop with Windows 10, this is showing maximum screen resolution of 1366x768. I see that this is maximum available display:     However, I require a minimum of 1920×1080 screen resolution to capture web page screenshots.  If I have to install additional software or hardware, so that I can increase resolution?

I need to take a screenshot of a website as it would appear on a very high resolution monitor... say 4000x3000 pixels. My laptop's screen has a native resolution of 1400x768. Basically, I need to simulate having a monitor resolution much higher than my monitor and video card actually supports.  I want the screenshot of the site to look pretty much how it does when you hit CTRL MINUS (zoom out) in Firefox repeatedly, but without any loss of pixels due to scaling. How can I do this? Is there some way to use virtual machine software to simulate a super-high-res display? If not, is there some way to open a browser window bigger than the screen, and then capture its contents as a PNG somehow? Anything else that might work?


The first time I had the occasion to need a hexagonal grid mesh, and hexagonal cylindrical grid, I created them, and saved the objects  [  to a library file. But I'm finding them useful enough that I'd like to be able to add them to the "Add mesh" menu so that I could skip the "append" process. Is there a convenient way to add custom primitives?

It may be useful in sculpting and character design for example for the body parts (head, eyes ...)


What is the meaning of "beat somebody to the punch" . Could you please explain to me in a simple way. English is not my mother tongue. Thanks :)

I just read about a guy that was beaten to the punch several times. I couldn't find a meaning of that using my dictionary or Google, so what does that mean?


I don't know whether there's a duplicated question or not but I've been search this  for a long time.  The problem is that all the icons of the same application is stacked into one icon, so I need several steps to select to minimize or maximize the window I want, is there any way to unstack the icons like Windows 7/10 ?  Or can anyone confirm that there's no way to do this?

I want to make Ubuntu dock like Windows taskbar  Ubuntu:    Windows:    (as you see Windows has three Explorer icons and Ubuntu has only one Files icon  Is it possible to uncombine/ungroup apps in Ubuntu?


I was recently deported from South Africa and i was given a 12 months ban. I am flying elsewhere using SA airways can i pass through South Africa or i will be deported again on touch down again?

I received an undesirable status for overstaying a SA visa while hospitalized for injuries sustained in Lesotho. I had to cross into SA from Lesotho. Now I am banned entry into SA until Feb 2016 and though I have submitted a waiver request to remove the undesirable status, I hear from some the waiver request may take 4-5 months or even take longer than the time of banishment.  I have a pre-paid safari planned in October in which I need to fly through Johannesburg to get to Botswana. The Jburg border control requires tourists to pass through SA immigration even when simply changing planes.  1) Will SA grant me "transit" access if I don't leave the airport?  2) Will SA allow me to spend a night in the airport as the layover is 12 hours>  Thanks for passing on any info.


Taking the half-orc alternate racial feature Toothy grants me 1d3 primary natural bite attack.   At level 2 a bear shaman can take a totem transformation granting the character a 1d6 bite attack and two 1d4 claw attacks.   Would I replace the bite from toothy half-orc with the totem transformation, or would I get to use both bite attacks? (For four total natural attacks)

My character has a bite attack from his race.  What happens if he gains another bite attack from class abilities or spells?  Does the damage increase?  Can he make more than one attack?  Or is it simply that only the better version applies?  I would prefer answers from a Pathfinder context but 3.5e is also acceptable.


I want to extract the (paragraph) within the html tags in Python       &lt;p style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small; font-family: lato, arial, helvetica, sans-serif;&quot;&gt;   Irrespective of the kind of small business you own, using traditional sales and marketing tactics can prove to be expensive.   &lt;/span&gt;&lt;/p&gt;   My code is   from HTMLParser import HTMLParser  from bs4 import BeautifulSoup  x = """&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;span style=&  quot;font-size: small; font-family: lato, arial, helvetica, sans-serif;&quot;&gt; Irrespective of the kind of small business you own, using traditional sales and marketing tactics can prove to be expensive. &lt;/span&gt;&lt;/p&gt;"""  p1 = HTMLParser() p1.unescape(x) bdy_soup = BeautifulSoup(p1.unescape(x)).get_text(separator=";") print(bdy_soup)   this code is not returning anything please help me to do so ,, any help would be appreciated

I'd like to extract the text from an HTML file using Python.  I want essentially the same output I would get if I copied the text from a browser and pasted it into notepad.    I'd like something more robust than using regular expressions that may fail on poorly formed HTML.  I've seen many people recommend Beautiful Soup, but I've had a few problems using it.  For one, it picked up unwanted text, such as JavaScript source.  Also, it did not interpret HTML entities.  For example, I would expect &#39; in HTML source to be converted to an apostrophe in text, just as if I'd pasted the browser content into notepad.  Update html2text looks promising. It handles HTML entities correctly and ignores JavaScript.  However, it does not exactly produce plain text; it produces markdown that would then have to be turned into plain text. It comes with no examples or documentation, but the code looks clean.    Related questions:


I am looking at enrolling in a university paper on modelling but am faced with an option of either a paper based on linear regression or logistic regression.  To be honest I don't quite know the difference. My limited understanding is that logistic regression relates more to probability more than the other. Again, I have a limited understanding so I may have misunderstood this.  Is any one able to shed some light on how they may differ and what real world applications may suit one over the other.  thanks

What is the difference between linear regression and logistic regression?  When would you use each?


Using the sine rule: $$ \frac{a}{\sin(A)} = \frac{b}{\sin(B)} = \frac{c}{\sin(C)}$$  prove, for triangle ABC:  $$\sin\left(\frac{B-C}{2}\right) = \frac{b-c}{a} \cos\left(\frac A2\right)$$  Using the sine rule it's easy to translate the RHS into:  $$\sin\left(\frac{B-C}{2}\right) = \frac{\sin(B)-\sin(C)}{\sin(A)} \cos\left(\frac A2\right)$$  Yes, I can expand out the LHS, and use the difference of 2 sines in the RHS, but neither makes an obvious equality, especially with terms in a and A in the RHS.  A nudge in the right direction would really be appreciated. Thanks.

Trigs is not my strongest apparently...  I need to prove  $c\sin \frac{A-B}{2} = (a-b) \cos \frac{C}{2}$ for a general triangle $ABC$.  Here is what I do, or rather, here is how I fail at proving it:  $\cos \frac{C}{2} \equiv \sin \frac{A+B}{2}$, so $\displaystyle{\frac{\sin \frac{A-B}{2}}{\sin \frac{A+B}{2}} \equiv \displaystyle{\frac{a-b}{c}}}$.   This implies: $\displaystyle{\frac{\tan \frac{A}{2}-\tan \frac{B}{2}}{\tan \frac{A}{2}+\tan \frac{B}{2}} \equiv \frac{a-b}{c}}$.   Now, imagine graphing an angle bisector from angle $A$ and then from angle $B$, the point where they intersect, let's call it $K$. From that point drop a perpendicular on $AB$, let's call that point $L$. Hence, $\tan \frac{A}{2} = \frac{KL}{AL}$ and $\tan \frac{B}{2} = \frac{KL}{LB}$. Plugging those in, gives us: $$\frac{LB-AL}{c} \equiv \frac{a-b}{c}$$ And now I have no clue how to show that $LB-AL = a-b$.  If you could let me know how to show that and/or you know a better way of proving the identity, please share.


I have downloaded Android-Studio and extracted it into documents. When I try to locate the studio.sh file located in Documents/android-studio/bin, I get an error.  How will I go ahead and install this Android Studio.

Please tell me the full process of installing Android Studio and its necessary dependencies.


I would like to move all my user files, programs, everything that is not the OS.  I'd like to keep Ubuntu on an SSD and put everything I've done on a separate 1TB drive. This includes everything in $HOME, but I'd like to also move /usr to move all my user-installed software.  My thinking is to keep the 180GB SSD as pristine as possible with only the OS in case I need to re-install Ubuntu at any time.  First question: Is this a bad idea?  Second question: Can I follow the same instructions which I used to move my /home to a different disk? As in this post: , or

This is not a question about how to create a home partition, just as a caveat. :)  What are the pros and cons to having a separate home partition? How do I know if having one is right for me? Will it increase or decrease speed of file retrieval? Are there any risks?


We have a need to set an element such as
 to have an image as a background. I am trying to figure out the way to get the image to display as a background but also with the image style that was used.  The image field (field_image) in question is used in multiple view modes with different image styles.   Example:   Basic page view mode: default, field_image with format = image and image style = large Basic page view mode: promoted, field_image with format = image and image style = small Basic page view mode: small tile, field_image with format=image and image style = medium   How can I accomplish the code below? Would the proposed solution work as I am not sure it is safe to use ['#markup']?

   Currently on View mode:   Field_image with Format = Image, Image Style = large   Current problem:   node.field_image.entity.uri.value returns the original images, not the one where the image style is applied.    Proposed solution:   set format = URL to image image style = large update the twig template to use node.field_image.0['#markup]

I'm implementing a node template that uses an image twice; once in a 'normal' way (i.e. using the image style defined in the field's display configuration for that view mode), and the other is as a css background-image property.  I need one of two things:   (ideally) a way to get the URL for a different image style of the same image. a way to get the URL for the image field.   I'm struggling to use dump() and kint() to help myself to an answer. They both output far far too much (thanks to embedded links to "parent" etc.) and seem to not have the info I need. e.g. looking at dump(content.field_image) output the actual URL of the image is not there (so where does it come from such that it can be rendered with {{ content.field_image }}?!). kint() on the other hand dies completely if I pass an argument to it and the top-level version is again far too big to navigate. Debugging was soo much easier with phptemplate + xdebug. (Yes I know it's good that themers can't drop the database.)  There's an answer to (1) that implies , but I don't understand why I can't get the existing URL in (2)?


I have three given names, say Adam John Isaac. Furthermore I have one family name, say Harris. (The names are not my own, but the initials are.) On this website, I read that I can freely choose which names to put on a paper.  My first given name is not the name that I'm actually known as. Therefore, it feels a bit strange to put Adam J.I. Harris on a paper.  In other papers, I often see people placing initials between their (first) given name and family name. So far I have never seen initials before the first given name, like A. John I. Harris. This looks strange, in my opinion, both because an initial before the given name is uncommon, and it might be read as the word 'a' instead of the initial 'A.'.  Now I've been thinking of using John A.I. Harris on the paper. This way all my names/initials are there, and it looks less strange. Furthermore it's kind of funny, as I'm an AI student.  Another option would be to just stick with my calling name and family name: John Harris.  Do you have any thoughts on this? Can the initials A.I. be seen as some (stupid) joke, so could I better leave them out? Or doesn't it really matter at all, and should I just pick an option?

I have one official first name which appears on my ID card. I have another first name which friends call me by. Is it possible to use my unofficial first name and official family name to publish scientific papers? How can I prove to someone that I am one of the authors?


Calculate $$\lim\limits_{x\to 0}{e^x-e^{\sin x} \over x-\sin x}$$   Personal work:  $$\lim\limits_{x\to 0}{e^x-e^{\sin x} \over x-\sin x}=^{0 \over 0}\lim\limits_{x\to 0}{e^x-e^{\sin x}\cdot\cos x \over 1-\cos x}=^{0 \over 0}\lim\limits_{x\to 0}{{e^x-(e^{\sin x}\cdot\cos x-\sin x}\cdot e^{\sin x}\over \sin x})=\cdots$$  This gets to nowhere. Also, I substituted $t=e^{\sin x}$ but I could not replace the $e^x$.

Obviously, when substituted, expression gives $\frac{0}{0}$, which leads me to conclusion to use L'Hopital's rule.   However, it is again $\frac{0}{0}$. How can I find this limit?


I have a list of objects of type A, that may contain instances of any number of classes derived from A. I am calling a function on each member of the list, and wish to have the function from the most derived class be called. However, the function of the base class is called. How can I get it to be the case that the most derived class is used?  The following code illustrates my problem. The code outputs "In a" but I want it to output "In b".  #include <iostream>  class A { public:     virtual void func()     {         std::cout << "In A" << std::endl;     } };  class B : public A { public:     virtual void func()     {         std::cout << "In B" << std::endl;     } };  int main() {     A a = B();     a.func();     return 0; }

Someone mentioned it in the IRC as the slicing problem.


When signing into the new winterbash site, Google notified me that the site was using Open ID 2.0 and that .  Is this something I need to worry about? Should I start logging on with alternate accounts?

Apparently, for some reason, . I got this notice while logging in with Disqus, but not with Stack Exchange.  So... is Stack Exchange going to be affected by this? Do I need, or want, to add extra login methods to my Stack Exchange account to ensure I can still log in come April?


How do you then manage the database? An alternative, of course, is to just keep the themes in version control, and then upload them manually to the site when deploying.  edit: Close this, it's duplicate. I couldn't "flag" it.

I've been using git to track changes in the plugins and themes I've developed for different sites. Each plugin or theme has their own repository in whichever local install of WordPress I happen to be using for that project. This works fine when I'm just working on one solitary plugin or theme.  But when I have a local version of an entire site which is a collection of different plugins, themes, WordPress core, etc. Should I be keeping that entire directory under version control?  Is there a best practice to always have a collection of repositories for each theme/plugin, or for each client site to have one monolithic repository that includes all the code used in the project (including the latest copy of WordPress via svn.)


I am getting these errors  W: Failed to fetch http://download.virtualbox.org/virtualbox/debian/dists/utopic/contrib/binary-amd64/Packages  404  Not found  W: Failed to fetch http://download.virtualbox.org/virtualbox/debian/dists/utopic/non-free/binary-amd64/Packages  404  Not found   How do I stop these messages from appearing?

PPA seems to be constantly offline. Whenever I use sudo apt-get update, this error is shown:  W: Failed to fetch http://ppa.launchpad.net/ 404  Not Found   How do I fix these errors?


in python you can define a class A  class A(object):     .....      def __call__(self, bar):         #do stuff with bar         ....   which allows me to use it like this:  bar = "something" foo = A() foo(bar)   I would like to do the same thing in c++, but I did not find anything, Is this possible or did I overlook something?

I keep hearing a lot about functors in C++. Can someone give me an overview as to what they are and in what cases they would be useful?


I am not able to find a way to determine how much disk space is free. The methods I am seeing are not clear and provide information that appear to need to be put together for a big picture. Is there a third party utility program that can provide a clean estimate of remaining disk space?

What is the command to find out how much disk space is being used/remaining?


I installed Ubuntu 14.04 on my laptop with win 8.1,but now when I start the power only Ubuntu is come in DOS and the win 8.1 does not load. how I fix it?

I installed Windows on my computer, followed by an installation of Ubuntu. However, now I'm unable to boot into my Windows install.  What can I do to fix this?


I have a Windows 7 machine, where I have enabled the local "Administrator" account. When I log in as this local Administrator I still cannot do everything I want to do. There are still settings that are disabled.  What do I possible need to look at in order to make my Administrator account in to a real super user account? Is there some hidden setting in Windows 7 that prohibits the Administrator from really being an administrator?  It has been suggested that I need to "run as administrator" those programs where I need administrator privileges. But how do I do I do this with the control panel?

My account, david, is in the Administrators group on a Windows 7 machine.  I am still having problems with programs that I should be able to use, such as SQL Server. Specifically, my account seems to not have correct permissions when I am working.  I know with an Administrator account I should have full access. How can I force my account (david) to act like an admin account and have full access to everything?


I often find myself alt-tabbing to google "How to do X in Linux".   Is there a way to search (say, man pages) in Linux to find tools that might be of use in a particular situation?   For example, earlier I needed the command to see how much space a folder was taking up. (Excuse my Windows terminology – I'm new to this!) Is there any way I could have found the du -h command without leaving the terminal?

Does anyone have any tricks and tips for finding information in man pages?


If I were to keep a ledger of the number of activities I have completed, would that be an "activities count" or an "activity count"?

I read this recently in :     At the end of the summit, the French and European officials had   claimed a points victory over the Germans by getting them to agree   more firmly to a target date of January 1st next year to entrust the   European Central Bank (ECB) with the ultimate authority to supervise   the euro zone’s 6,000-odd banks.   "Points" is a plural, and I suppose it doesn't function as a noun in this sentence since it's following the article "a", so is it an adjective adorning "victory"?


I followed several tutorial to create a nurbs curve, and duplicate it in edit mode. Of course I pressed A key to select all points and F key to create surface. But there was no surface be created, a start point of one curve and an end point of another point were connected instead.     Is there anybody get any idea about this case?

I followed the tutorial on the , and then I created a simple test. I created a Surface NURBS curve, made 3 copies with space between them, selected all, and hit F, but nothing happened. No error or any indication that F is supposed to do anything was displayed. I am new to Blender and am using version 2.70, so not sure what I am doing wrong. Any ideas?


EDIT: I am posting a screenshot to show the issue I am describing. I have tried about more than half of those techniques shown on the post that this question was closed for but it just sits at this one spot near the bottom of the page when the screen is resized; it shows fine whenever it's not resized. The absolute-bottom method makes the only "change" to it, but instead of fixing it, it makes it sit near the very top of the page, right under the nav header. Otherwise, any other method I try does nothing and just makes it sit about near the bottom of the page. From the picture, the blue drawn square is the fixed nav header, green  one is main content, and the red one is the footer clearly sitting (why it's highlighted) as the background on one of the previous elements on the page. I want it to sit at the bottom like when it's regular screen sized.     First thing, I get this is a VERY frequently asked question, and for that reason avoided asking it, but I have spent a whole day of searching, trying so many different techniques, even changing code that feel might be affecting it in some way and I'm still stuck at start. Just want a sticky footer (not fixed) that stays at the bottom even when screen is resized (responsive.)    Right now it looks fine, I'm guessing because there's enough content, but when the screen is resized for small screens, it appears a good bit above from where it should be and so it ends up as the background of one of the previous elements on the page. The last approach I used was this flex method, . What am I doing wrong here?        body, div, h1, h2, h3, h4, h5, h6, p, ul, ol, li, dl, dt, dd, img, form, fieldset, input, textarea, blockquote {   margin: 0;   padding: 0;   border: 0; }  * {   -moz-box-sizing: border-box;   -webkit-box-sizing: border-box;   box-sizing: border-box; }  body, html {   font: 16px/30px "Helvetica", sans-serif;   margin: 0; }  html {   height: 100%; }  body {   display: flex;   flex-direction: column;   height: 100vh; }  #header {   height: 110px;   position: fixed;   width: 100%;   background: white;   background: -moz-linear-gradient(top, white 0%, #ffffff 100%);   background: -webkit-linear-gradient(top, white 0%, #ffffff 100%);   box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);   z-index: 10;   flex: 1;   top: 0;   border-radius: 2.7px; }  #content {   width: 100%;   flex: 1 0 auto;   background-color: white; }  footer {   width: 100%;   height: 180px;   background-color: #001e33;   flex-shrink: 0; }   /*media queries for footer*/  @media only screen and (max-width: 575px) {   footer,   .flex-footer {     height: auto;   }   .footer-left img {     height: auto;   }   #bottom-footer .footer-center,   #bottom-footer .footer-right {     display: none;   } }

                                               NOTE: This is just the main tags and css classes for those tags. Thank you!

I have a simple 2-column layout with a footer that clears both the right and left div in my markup.  My problem is that I can't get the footer to stay at the bottom of the page in all browsers.  It works if the content pushes the footer down, but that's not always the case.


I think it is annoying that I have to enter my password every time I close the lid of my computer. There was a setting when the lid is closed: do nothing. in earlier versions, but this feature seems to have been removed.    How do I do configure the computer to not require a password as soon as the laptop is reopened?

Since my upgrade to Ubuntu 17.10 there's no option in the settings about what to do when the notebook-lid is closed any more.     Before this function had the options "do nothing" and "suspend" and maybe "shutdown".  The "do nothing" function did something: when the lid was closed, the display went dark and the screen was locked with the password.  My question is how to change the setting so that it's like I'm used to, so that the screen just locks but doesn't suspend when closing the lid.


In the biography of Dumbledore (by Rita Skeeter) it is said that Dumbledore finally decided to confront his one time friend Gellert Grindelwald, who at the time was powerful and was in possession of the Elder Wand.   After Dumbledore defeated him in their famous duel, Dumbledore claimed his wand, the mythical Elder Wand and stopped using his old wand.  So what did he do with his old wand?

Before acquiring the Elder Wand, what kind of wand did Dumbledore have, and what kind of wood and core components went into it?   We know that he was buried with the Elder Wand.  Are there any references to what became of his original wand?


I have a 3 class program, and I need to know the first vowel in a String.   This String has his getter and setter methods. I tried to use by example:  obj.getnameString().charAt(i);   where (i) is a value previously obtained. But this throws a null value. why?

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?


As far as I remember from the books, there's no description of what a person using a Pensieve looks like. When Harry is using the Pensieve, he describes it as if he were falling into it, but it's never stated whether his body really enters the Pensieve, because the experience is just told from his point of view.   Now let's say Dumbledore enters his office while Harry was using the Pensieve -- what would Dumbledore see? Is there an answer in the books/canon?

You remove your memory from your brain to store in a Pensieve (as Snape or Dumbledore did). Then, you re-watch the memory (e.g. as Dumbledore re-watched his memories of Voldemort's investigations with Harry) in the Pensieve.   Does that mean that you now re-created the memory in your brain (because you remember watching it) and thus you'll need to extract/erase it from your brain again if you don't wish to keep it there for security/capacity reasons (which was why you stored it in the Pensieve in the first place?  Canon answers only please.


I have a system that generates multiple address fields according the an amount selected by the user.  Initially I used $("input[name=inputname]") which works fine for the initially loaded fiedls but doesn't work when adding more. Searching google and here led me to believe I could use JQuery's .on function, although I can't seem to get it working, is there anything wrong with this code or do I need to approach this a different way?  $("div.data").on( "change", "input[name^=delivery-address-1]", function() {   alert( $( this ).val() ); });   Thanks in advance  EDIT: Hi, regarding the 'marked as duplicate', as I said I have read the similar answers and am aware of them, but the code learned from these answers doesn't seem to work in my situation and so was looking for further help, thanks.

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.


I'm a very emotionally flat person in real life, and the way I act in reality is relatively unique. The result of this is that every character I've ever made has been painfully recognizable as me. Even if I try to put a spin on it during character creation, in practice it doesn't play out in a meaningful way. I really don't want to be "that guy" for the sake of others and myself. How do I give my characters a personality of their own without becoming a bad caricature?

I am a newbie in playing role-playing games, and after several games, I've come to the conclusion that character personality creation poses a bit of a problem for me.  I mostly tend to create and describe somebody with whom I feel rather comfortable. This makes for the personality, the alignment, the world view, the race, and so on. As a result I always end up with almost the same character, which very much resembles me myself IRL, or at least me the way I'd like to see myself. The point is - it's not some other character, some "mine" character, - it is precisely me put in the game world like in a dream.  I feel that despite some variations that I can bring in, with this approach my characters are pretty repetitive and actually reflect me very well. I don't find it interesting to invent some "artificial" character, with no real connection with me, just for the sake of it. I can understand other possible configurations - why they are who they are, and what are their world views, their biases - but I am not interested in being them. Trying to do so quickly becomes boring as doing something I am not really interested to be doing.  Hence my question - is that normal among roleplayers? Do you create your characters to be like you (with some possible modifications, like, maybe, gender, race, some minor biases), or do you usually create a completely different person and inhabit it? If the latter is the case, then how do I do that, and how do I get into playing that role?


Let $\sum a_n $ be a convergent series. Is  $\sum n^{1/n} a_n$ convergent? $\sum a_n/({1+ |a_n|})$ convergent?  If not, provide examples in the contrary.  I feel like 1 is maybe convergent, however I cannot seem to prove it or come up with an example to contradict. Please help.

Could anyone please give me some hints ?   Let $\sum a_n$ be a convergent serie of real number. Prove or disprove that $\sum a_n \sin n$ and $\sum n^{\frac{1}{n}} a_n$ are also convergent.


I'm parsing user HTML to LaTeX templates. The HTML comes from a rich text editor, so of course the incoming HTML syntax can be almost anything. There's one case that breaks LaTeX that I have to handle.  text   This HTML, which I do not control, is parsed by a neutral parser into LaTeX templates. It might become something like:  \ul{\url{http://www.google.com}}   Due to the nature of the input, and the nature of the parser, I must assume I have some sort of underline tag wrapping some sort of link tag. This is a required constraint for answering this question. I do not have direct control over the input, and the parser is neutral. I can control what the parser outputs per per tag, such as  input can be compiled into \uline, but I cannot change the structure of the AST.  See what happens when I include the ulem package and wrap the link with \uline:  \usepackage{ulem}  Text: \uline{\url{http://test.com/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/}}   Now the link is underlined, but does not wrap:    This is despite the  saying "Unlike regular underlining, ulem allows line breaks".  I have also tried using the soul package and the \ul command:  \usepackage{soul}  Text: \ul{\url{http://test.com/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/uline-text/}}   Which chokes with the error:  ! Argument of \hyper@n@rmalise has an extra }. l.9 ...ne-text/uline-text/uline-text/uline-text/}}   I do not directly control the creation of the LaTeX source code, so I cannot directly modify the order of the tags. Please read this question carefully before voting. I am not asking how to underline a link tag.

I would like the internal hyperlinks generated by  to be colored and underlined.    Reading some of the package documentation, I know that these \hypersetup keys exist:   colorlinks: when true, color the link; when false, draw a border around the link and color that. linkcolor: the color of the link (requires colorlinks=true to have any effect) linkbordercolor: the color of the link border color (requires colorlinks=false to have any effect) pdfborderstyle: keys for the pdf borderstyle dictionary.  I don't know what keys and values exist for this dictionary, but I do know that pdfborderstyle={/S/U} or pdfborderstyle={/S/U/W 1} can change the link border from a box to an underline.   But it seems impossible with this key structure to have colored links (requiring colorlinks=true and colored borders (requiring colorlinks=false.)  Here is a minimal (non)-working example ():  \documentclass{article} \usepackage{xcolor} \usepackage{hyperref}  \hypersetup{colorlinks=false,linkbordercolor=red,linkcolor=green,pdfborderstyle={/S/U/W 1}}  \begin{document} \section{To See}\label{tosee} \vskip2cm \hyperref[tosee]{just to see} \end{document}   With colorlinks=false (the default), the text is black and the border is red.  With colorlinks=true the text is green and there is no border.


Imagine yourself and anything you're able to perceive to be drawn onto a rubber band. Any means of determining distances would be affected by the stretching/contracting of the rubber band. The relation between any two lengths would remain exactly the same because every length is increased/decreased by the same factor as the band stretches/contracts. According to my understanding, that is what the dilation/compression of space is like for us and why it should not lead to any change in distance.  This also applies to relational measurements of length as they are performed, for example, by devices like LIGO. Although the deformation (e.g. gravitational waves) propagates only in one of two directions of measurement, the relation between both lengths should not be affected because none of the individual lengths should be affected.  Accordingly, anything that travels the four kilometers in LIGO should take the exact same amount of time, no matter whether space is currently stretched or compressed. The speed of light being constant should be irrelevant in this this case.  If gravitational waves stretch space itself, how can they have an effect on the interference of two laser beams? According to my understanding, compression or dilation of space itself (as opposed to something in space) should not affect the distance between two points.  Disclaimer: Obviously, the above is not true. It's just how I thought is was. Hopefully, it helps to see where my understanding went awry.  ————  In this question (  ), the problem I had has actually been solved. It comes down to the fact that atoms (because of the non-gravitational forces holding them together) are in fact not affected by spacetime deformations. This makes these deformations detectable.

, Laser Interferometer Gravitational-Wave Observatory, is a large-scale physics experiment aiming to directly detect gravitational waves. The device measures the phase shift laser beams.  If I understand this well, the measurement assumes that a suitable gravitational wave reduces and prolongs one of the tubes and the extension will take effect in the phase-shifting laser beams.  But I think if there's a gravitational wave that passes through it, it will affect everything, even the laser beam. This means that when the wave lengthens or shortens the tube, it also lengthens or shortens the wavelength of the laser beam.  In my opinion, therefore, this device does not work. Or am I wrong?


Ok so I've seen the other questions about installing games onto another drive(SSD) and I've already done that properly for any new game that I have been getting.  However I want to know if there is a proper way to transfer games from my old drive over to the new drive without having to uninstall and then re-download them.  I already tried copying the folders over but all that does is make steam not know where the games are anymore and I'm not sure how to change the location that it looks for a particular game once it is already installed on my C drive.  Thank you!

I use (and have it much bigger) drive D: to store all my user data and games, but I have installed the Steam client on drive C:. When I was installing a first game (Warhammer 40000), I've chosen to place my library folder on drive D: and the game went there.  But now as I've got installed the second game (Portal), I can see that it was put on drive C: despite to the choice I've done previously. When I open Steam - Settings - Downloads + Cloud - Steam library folders, I can see both installation places in the list. Can I merge them into one?  I would even agree to use the default drive C: library (as I've replaced it with a symlink already). When I press to remove one library it says it can only remove empty ones.


I have the following tuple:  tuple = (65,67,5,67,34,76,67,231,98,67)   When I did the following:  print tuple3[2:8]   I got:  (5, 67, 34, 76, 67, 231)   I thought that 98 should be also included. Isn't 98 on the index number 8? Why isn't 98 included?  Thanks.

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


Use of  ' the' before television???????~ above 1st photo from use of 'the' is different from 2nd photo please solve my question

"He was watching the television when I called on him."  When I said this sentence to one of my friends  (an English teacher)  he corrected me saying that the definite article (the) should be omitted. Still, I can't understand why. ? Actually similar  question has been asked earlier but the answers were so ambiguous. So I put complete sentence.


Dust or pollen inside this lens is common problem so I finally removed the front element and cleaned it, but even after this procedure I have the very same specks in a video as before. So I guess it's the heavily polluted second element - but I'm not sure if I can clean it.  Someone mentioned that these elements are coated, but I can't find any documentation/evidence. Blower was not enough.  Can I clean it as normal front element lens?        EDIT: So it's the dirty sensor. I set F22 and made video with 18-200mm and 55-300mm and the spots are same.

In my question's preview, the attached image looks rotated. So, assuming you are able to see it in the real orientation, can anyone determine what is that dust flake type thing on the top, slightly towards the left?   One looks like a dust flake and there's another dot to the left of it?  Note: I wont have physical access to the camera until the weekend.  Is it just a dust flake on the lens or can it be some problem with the sensor? Its a 3 month old Canon 1500D.


#include <cs50.h>  #include <stdio.h>  int main(void);   int alpha = 0; while (alpha < 10) {     printf("Hello, World\n");     alpha++; }  error: expected identifier or '(' while (alpha < 10) ^ i am trying to make a finite loop to print hello world 10 times but the error keeps coming up. I googled it but all answers were for do-while loop. What is my mistake ?

This question attempts to collect the few pearls among the dozens of bad C++ books that are published every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a well-written C++ book. It is way too big and complex for doing this. In fact, it is so big and complex, that there are very many very bad C++ books out there. And we are not talking about bad style, but things like sporting glaringly obvious factual errors and promoting abysmally bad programming styles. Please edit the accepted answer to provide quality books and an approximate skill level — preferably after discussing your addition in . (The regulars might mercilessly undo your work if they disagree with a recommendation.) Add a short blurb/description about each book that you have personally read/benefited from. Feel free to debate quality, headings, etc. Books that meet the criteria will be added to the list.  Books that have reviews by the Association of C and C++ Users (ACCU) have links to the review. *Note: FAQs and other resources can be found in the  and under .


$f:D \rightarrow \mathbb{C}$ holomorphic and $d:=\sup_{z,w\in D} |f(z)-f(w)|$. Prove that $d\geq 2|f'(0)|$ and is equal if and only if $f(z)=a_0+a_1z$

Let $D = B(0,1) \subset \mathbb{C} $ a disc, $f$ holomorphic on $D$. I want to demonstrate that if $$ 2|f^{'}(0)| = \sup_{z, w \in D} |f(z)-f(w)|$$  then $f$ is linear.   I know this is a well-known result. Where can I find the proof ?


So I have installed Ubuntu to a 1 TB hard drive.(I have a laptop) I want to install Windows 7 to another 500 Gb hard drive and be able to switch out between the two hard drives. Is this possible? Will this cause a fuss with GRUB / Windows bootloader? Does having only one HDD slot in my laptop affect this? Help appreciated.

I have Ubuntu on my laptop. Now I want install Windows 7 in a dual-boot. How can I do this? I can't lose my Ubuntu files, and I'm afraid that I might break . Go  for UEFI only!


In our glorious chat system (may it live forever!), I have noticed a grain of sand in the pearly gear system.  This grain of sand is that when a message with a ping is sent, it pings (fine and well).  Then, when the sender edits the message, it pings again.  Then, when they edit it again, it pings again (unsurprising, at this point).  99.99% of the time, these edits are adjusting typos, obscuring profanity, or doing some other minor edit.  I am wondering if this only bothers me, or if other people have noticed it too?  It is definitely not a make-or-break problem, but it would be nice if it was changed so we only get pinged the first time, and if there are substantial changes, the user can just delete the message and send a new one.

If you use an @notification in chat messages it will notify the corresponding user with a small circle (or snowman) on their gravatar and (if enabled) a sound effect.   Now, when you have notified a user that way they will be notified again if you edit the message containing the @notification. I don't think this behaviour is optimal. In most cases I don't really want to ping the user again; I just want to correct some small typo.  I suggest to change the behaviour to not repeat the ping when posts are edited.


Using jquery and/or spservices, how can I know whether the current user is a member of an AD group?  , but I think it only checks for membership in a Sharepoint group.

I want to check the current user exisit in a AD group inside the SharePoint Group using SPServices JQuery. I used the below code snippet but not successed. Any suggestions?   $().SPServices({         operation: "GetGroupCollectionFromUser",         userLoginName: $().SPServices.SPGetCurrentUser(),         async: false,         completefunc: function (xData, Status) {              if ($(xData.responseXML).find("Group[Name='SP Group Name']").length == 1)              {               }             else              {              }         }      });


I have this regex in JavaScript:   new RegExp('^[0-9a-z._-]+@{1}[0-9a-z.-]{2,}[.]{1}[a-z]{2,}$','i');   and I want to modify it.  The last part of the mail must have a minimum value: 2 chars and no maximum length so I can put mails such as .localhost .paris .thisismyexample ...  How may I do that?

Is there a regular expression to validate an email address in JavaScript?


I have been working with an Atmega 328 PU for a while and I understand how the .hex file is transferred into the chips code segment in memory . I have looked at the architecture of the Atmega 328 and it raises questions in my mind as to how are instructions processed in the processor , or in other words , how does the binary instruction ex : 1000001 get processed by the micro-controller. I searched the web but found nothing helpful. Can anybody give a good answer on how a instruction is processed by the micro-controller's processor ?

I have learnt in school about opcodes and how it works with the ALU to add numbers and such, now is my question how the computer is able to understand this, because it is codes and the computer needs something to translate that to actually doing that, in't it? (correct me if I'm wrong plz) I also want to, when I understand that, make my own processor so I can learn the computer bottom-up and become a good computer engineer.


I need help recovering my old accounts and I have a bunch to find and I've tried looking up by phone number and it didn't work

I have forgotten the password or username for my Google account, or I'm unable to access my account for other reasons.  How can I recover my account?  (This Q&A is meant as a general description for all Google and Gmail username/password questions. See: )


I know what is Probability Density Function and its application in Machine Learning and Statistics. The problem I faced is that how does it being calculated? For a specific example like the probability of amount of rain in a rainy day, the researchers measure the rain amount for specific period of time and they make a function for that (frequentist approach)? More specifically, The question is about how the following diagram is obtained?  PS It's not related to , because I asked how to create a diagram like the following diagram!

On the , there is this line:      $p(\mathrm{height}|\mathrm{male}) = 1.5789$ (A probability distribution over 1 is OK. It is the area under the bell curve that is equal to 1.)    How can a value $>1$ be OK? I thought all probability values were expressed in the range $0 \leq p \leq 1$. Furthermore, given that it is possible to have such a value, how is that value obtained in the example shown on the page?


Find all functions $f:(0,\infty)\rightarrow(0,\infty)$ subject to the conditions:  $f(f(f(x)))+2x=f(3x)$ for all $x>0$ and $\displaystyle\lim_{x\to\infty}(f(x)-x)=0$  I tried as follows: Suppose $x_0=x,x_1=f(x_0)=f(x),...,x_n=f(x_{n-1})$. But I am facing problem due to $f(3x)$ term.

Be $f:\mathbb R^ +\mapsto\mathbb R$ a function that satisfies the following conditions:  a)$ f(f(f(x)))+2x=f(3x)$ for every $x\gt 0$;  b)  $\lim_{x \to \infty} (f(x)-x)=0$.  This was proposed by Gabriel Dospinescu  at a romanian competitions about a decade ago. No idea how to approach it. Thank you!


Okay, it used to go fast, just like it should, but yesterday, everything started to slow drastically. It's gotten to the point I can't even watch an entire episode of something on Hulu without the page crashing. Has this happened to anyone before? No, I haven't installed anything new recently, and after it slowed down, I even uninstalled unnecessary items such as Wine and Perl. It's gotten even slower since then, but when I'm off for a while and then get back on, it goes at least a little faster for awhile, but not long enough to do much.  Should I just wait longer between uses, or is this an actual problem I should fix?  Note: Disregard the tag, I couldn't find one that really fit.  It's in Ubuntu 14.04  Probably is, but I'm not 100% sure on the hardware, was bought for my birthday and I wasn't really told the Hardware Specs. (I can try to find the name of the model and look it up, but as of now that's all the information I have). And I haven't tried booting an old kernel, though that might be one of my next courses that I take. The RAM and the rest of it, not that I know of.

What are your tips for improving overall system performance on ubuntu? Inspired by this  I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster.  This is not meant to be application specific (e.g. make firefox load pages faster), but system wide.  Preferably 1 tip per answer, with enough detail for people to implement it.  A couple of mine would be:   Install  (via Software Center or sudo apt-get install preload); Change  value - "which controls the degree to which the kernel prefers to swap when it tries to free memory";   What are yours?  PS: Since this is not intended to have a unique answer but rather, several useful tips, I'm making this community wiki out-of-the-box.


Let $f$ be a function having continuous derivative on $[0,1]$ such that $0 < f' \le 1$ and $f(0)=0$. Defined $$I := \frac{\left(\int_0^1 f(x)dx\right)^2}{\int_0^1 f^3(x)dx}$$ we must have that: $$(A) \quad I \ge \frac{2}{3}\qquad (B) \quad I \ge \frac{1}{2}\qquad (C) \quad I \ge \frac{1}{3}\qquad (D) \quad I \ge 1$$  I have been stuck on this for quite some time, here is what I have tried. Since $0\lt f'(x)\le 1$, then taking the definite integral on both sides of the inequality we get that $0\lt f(1)\le 1$. Let $f(1)=k\in (0,1]$. then the curve $y=f(x)$ passes through the points $(0,0)$ and $(1,k)$ the join of which lies on the line $y=kx$. I am unable to proceed from this step. Another alternate approach I have tried to use was the Cauchy-Schwarz inequality for integrals but to no avail. Perhaps the AM-GM inequality might be useful, since the function is non-negative in $[0,1]$ but I am not exactly sure how. Any hints or ideas are appreciated. Thanks.

Define $f : [0,1] \to \mathbb{R} $ differentiable satisfying $f(0)=0$ and $0<f'(x)<1$. Prove:  $\displaystyle\int_{0}^{1} f^3(x) \, dx < \left(\displaystyle\int_{0}^{1} f(x) \, dx\right)^2$ I found the following answer,  Define $F(x)=\displaystyle\int_{0}^{x} f^3(t) \, dt - \left(\displaystyle\int_{0}^{x} f(t) \, dt\right)^2$ We have $$F'(x)=f^3(x)-2 \left(\displaystyle\int_{0}^{x} f(t) \, dt\right)f(x)=f(x)\left[f^2(x)-2 \left(\displaystyle\int_{0}^{x} f(t) \, dt\right)\right]$$ and $$\left[f^2(x)-2 \left(\displaystyle\int_{0}^{x} f(t) \, dt\right)\right]'=2f(x)\left[f'(x)-1\right]$$ from which we can arrive at the conclusion.  But I felt a little confused. In the past I usually proved the inequality by classical inequalities and something like Taylor expansion to use the condition about derivative. But this answer is little out of my expectation. Do we have other proofs or ideas to arrive at $\displaystyle\int_{0}^{1} f^3(x) \, dx < \left(\displaystyle\int_{0}^{1} f(x) \, dx\right)^2$? And other thoughts about solving these types of issues? I think when we talk about $\left(\displaystyle\int_{0}^{1} f(x) \, dx\right)^2 >\ldots \,$ it's a little difficult to deal with. I don't quite know what tools to use.


every month in my bank statement I transferred money to my cousin to save and he transferred it back before my visa....

Many of the UK visa refusals we see here share a common pattern and the prevailing reasons refer to V 4.2 (a) and (c).    I do understand that, while the applicants may describe very different individual circumstances, there's a consistent pattern and, broadly, fall into specific categories:    Credibility (lifestyle, lack of ties, visit history, lies & omissions) Funding (insufficient funds, provenance of funds, funds parking) Sponsorship (family, friends, employer)   Question: What most commonly triggers a UK visa refusal where V 4.2 (a) and (c) are given as the grounds?  Secondarily: Given that there is a clear pattern, to what extent are these refusals predictable? Does sponsorship make a difference? Is there a set of personal circumstances, however abstract, where a refusal is all but guaranteed? For example, why do those we see here on TSE who sought entry for the PLAB or British Army appear to be refused with a common theme? Is there a uniform shortcoming or is it just discrimination?   PLAB: What is about applications for a visa, for the purpose of sitting the Professional and Linguistic Assessments Board (PLAB) exam, that seem to invite refusals. After all, the test is given so that international medical graduates can show that they qualify to practise medicine in the UK. The first part, PLAB 1, can be taken in centres outside of the UK. However, PLAB 2 can be taken only in the UK. Why can't you can't get a visa just to sit the exam, promising that you'll leave immediately after?    British Army: Since Commonwealth citizens are eligible to apply online to join, even those who don't reside in the UK, why is it so difficult to get a visa just to attend an interview to see whether you are suitable? Even with an invitation from the Army, such visa applications seem to be unsuccessful. Isn't a career in the British Army a valid reason?     Lastly:  After such a refusal, what approaches would increase the chance of a successful application?


Why do we see patterns on a rotating wheel with spokes which seem to rotate counterclockwise or clockwise as and when the wheel accelerates or deaccelarates. What I mean is the patterns like

When viewing cars that are driving along side of us, sometimes their wheels appear to be turning backwards even though they are traveling in the same direction as our car. Why do they look that way?


I have an array list containing the following data;  [pagoda, hour, hour experience, pagoda, car, eatables, eatables water, walk, small, small garden, little, little hot, jungle, jungle beach, restaurant, ocean, local, room, morning, guy, pagoda small, small garden, hour experience, peaceful environment, view]   I want to check if an element in the arraylist contains value of another element, and if so remove the element which has the shorter length.  Eg:- look at hour, and hour experience in the arraylist above. I would need the method to remove hour element and keep only hour experience element.  This is what I wrote. But it doesn't work that well.  public void removeDuplicateKeywords(ArrayList<String> list){         System.out.println(list);          for(int i=0; i<list.size(); i++){             String keyword = list.get(i);             for(int j=i+1; j<list.size(); j++){                 if(keyword.equals(list.get(j))){                     list.remove(j);                 }                 if(list.get(j).trim().contains(keyword.trim()) && list.get(j).length() > keyword.length()){                      list.remove(i);                 }              }          }         System.out.println(list);     }   This will print  [pagoda, hour, hour experience, pagoda, car, eatables, eatables water, walk, small, small garden, little, little hot, jungle, jungle beach, restaurant, ocean, local, room, morning, guy, pagoda small, small garden, hour experience, peaceful environment, view]  [hour, hour experience, car, eatables water, walk, little, little hot, jungle beach, restaurant, ocean, local, room, morning, guy, pagoda small, small garden, peaceful environment, view]   Please help. Thanks in advance.

I have an ArrayList<String>, and I want to remove repeated strings from it. How can I do this?


I'm trying to create a dynamic number of HTML input text fields, where the number comes posted from another form. But Flask interprets the form number 10 as 1 0, i.e. 2 (string length).  The first form:  <form action="/new_vocals" method="post">   <input type="text" name="count">   <input type="submit">   The Flask app route:  @app.route("/new_vocals", methods=['POST', 'GET']) def new_vocals(): voc_count = request.form['count'] return render_template("new_vocals.html", count=voc_count)   Trying to use voc_count in a for loop, I get 2 input types with the value 10, 3 with 100 and so on.  There has to be a way to get Flask to interpret 10 as a string?

In Python, how can I parse a numeric string like "545.2222" to its corresponding float value, 545.2222? Or parse the string "31" to an integer, 31?  I just want to know how to parse a float str to a float, and (separately) an int str to an int.


I found the identity for $n\ge 1$: $$ (n-1)n^{n-1} = \sum_{j=1}^{n-1} \binom{n}{j} j^j (n-j)^{n-j-1} $$ or equivalently, if we say $0^0 = 1$, we have $$ n^n = \sum_{j=0}^{n-1} \binom{n}{j} j^j (n-j)^{n-j-1} $$ This identity is easy to show using generating functions (as I couldn't find this identity anywhere online, I include this proof below). However, it looks suspiciously like something that would have a combinatorial interpretation, since $n^n$ is the number of functions from a set of $n$ elements to itself, and the binomial coefficients could be taken to represent numbers of subsets of the same set. My question is, does this identity have a combinatorial proof or some meaningful combinatorial interpretation at least?  Proof using generating functions: The power series for the principal branch $W(x)$, the Lambert W function, is $$ W(x) = \sum_{n=1}^\infty \frac1{n!} (-n)^{n-1} x^n $$ and $W'(x) = \frac{W(x)}{x(1+W(x))}$. Thus we have: \begin{eqnarray} \sum_{n=1}^\infty \frac1{n!} n^{n-1} x^n &=& -W(-x) \\ \sum_{n=1}^\infty \frac1{n!} n^n x^n &=& x{\frac{d}{dx}}(-W(-x)) = \frac{-W(-x)}{1+W(-x)}\\ \sum_{n=0}^\infty \frac1{n!} n^n x^n &=& 1 + \frac{-W(-x)}{1+W(-x)} = \frac{1}{1+W(-x)} \end{eqnarray} We therefore have the product  $$ -W(-x) \cdot \left(\frac{1}{1+W(-x)}\right) = \frac{-W(-x)}{1+W(-x)} $$ which in series form looks like $$ \left(\sum_{n=1}^\infty \frac1{n!} n^{n-1} x^n\right)\left(\sum_{n=0}^\infty \frac1{n!} n^n x^n\right) = \sum_{n=1}^\infty \frac{1}{n!}\left(\sum_{j=0}^{n-1} \binom{n}{j} j^j (n-j)^{n-j-1}\right) x^n = \sum_{n=1}^{\infty} \frac1{n!} n^n x^n $$

Is there an intuitive way, though I am not sure how to find a conceptual proof either, to establish the following identity: $$\sum_{k=1}^{n} \binom{n}{k} k^{k-1} (n-k)^{n-k} = n^n$$ for all natural numbers.  I am thinking about binomial formula $$\sum_{k=0}^n\binom nk x^{n-k}y^k=(x+y)^n$$ but I'm not sure how to use it.  I find this problem tantalizing because it looks as if there should be some sort of intuitive way so that is why I share it here. I am looking for an answer like  if possible. Can you find one?


I was going through the differences between Conduction and Displacement current.  Conduction current is just the flow of electric charges but when we come to Displacement current, we see that there is no actual flow of "electric charges" rather is just the flow of electric field lines which varies with time.   I have a doubt regarding the correct definition of current. Is current the flow of electric charges or the flow of electric field lines that vary with time? Is it something else?

I'm confused with this definition of displacement currents within capacitors via Wikipedia:     However it is not an electric current of moving charges, but a   time-varying electric field.   It's a time-varying electric field, but there isn't any actual flow of current, while at the same time... it produces a magnetic field. It's counter-intuitive.  If air was in the center between the plates, it's possible to have some "current flow" due to atoms within the gas molecules, likewise, for a dielectric.  Yet, displacement currents aren't considered "real/free" current. Could someone clarify this confusion for me.  How significantly different are displacement currents from normal/free currents?


When running my program, the last line displaying yearly gas expense is not showing... what have I done wrong? Also would like some help rounding figures to 2 decimal points...  I tried implementing a few strategies but none of them worked. Any help is appreciated!  public class GasExpenses { public static void main(String[] args) {  //Use scanner in order to retrieve user input. Scanner keyboard= new Scanner(System.in);  //Declare variables. int milesPerWeek; double milesPerGallon,costOfGas;   System.out.println("GAS EXPENSES");  //Get user input. System.out.println("How many miles do you drive a week?"); milesPerWeek = keyboard.nextInt();  //Get user input. System.out.println("How many miles per gallon does your auto get?"); milesPerGallon=keyboard.nextDouble();  //Get user input. System.out.println("What is the current cost of gas?"); costOfGas=keyboard.nextDouble();  //Calculate miles per year. int milesPerYear=(milesPerWeek*52); //Display calculated yearly mileage. System.out.println("At " + milesPerWeek + "miles per week, you travel "+ milesPerYear + " miles per year.");  //Calculate and display calculated weekly & yearly gallons of gas used. double gallonsPerWeek=(milesPerWeek/milesPerGallon);  System.out.println("Gallons per week:" + gallonsPerWeek); double gallonsPerYear=(gallonsPerWeek*52); System.out.println("Gallons per year:" + gallonsPerYear);  //Calculate and display calculated weekly & yearly gas expense. System.out.println("With gas at $" +costOfGas + " per gallon, you will spend: "); double weeklyGasExpense=(costOfGas*milesPerWeek); System.out.println("Gas expense per week: $" +weeklyGasExpense); double yearlyGasExpense=(costOfGas*milesPerYear); System.out.println("Gas expense per year: $" +yearlyGasExpense);  //Calculate and display calculated weekly & yearly gas expense based on increased gas price. double costIncrease= (costOfGas+1); System.out.println("If gas goes up by one dollar per gallon to $" + costIncrease +(" per gallon, you will spend:")); double weeklyIncreasedGas=(costIncrease*milesPerWeek); double yearlyIncreasedGas=(costIncrease*milesPerYear); System.out.println("Gas expense per week : $" +weeklyIncreasedGas); System.out.print("Gas expense per year : $" +yearlyIncreasedGas); }}

What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next number. This is the standard method of rounding most people expect in most situations.  I also would like only significant digits to be displayed - i.e. there should not be any trailing zeroes.  I know one method of doing this is to use the String.format method:  String.format("%.5g%n", 0.912385);   returns:  0.91239   which is great, however it always displays numbers with 5 decimal places even if they are not significant:   String.format("%.5g%n", 0.912300);   returns:  0.91230   Another method is to use the DecimalFormatter:  DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385);   returns:  0.91238   However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this:  0.912385 -> 0.91239 0.912300 -> 0.9123   What is the best way to achieve this in Java?


I've been wondering and wanting to recreate the style below for quite a while. I know the typical overlay options, but overlays that are white would usually simply result in creating a greyscale image. I'm certain I am missing something here, but I just cannot wrap my mind around on how to create something like this - especially with such a light tone. Anyone got any ideas?  Here's a similar photo from the same scene but with the actors in colour:  Sorry for the crappy quality of the second one. Seems to have been a badly recorded video.

I'm wondering how they actually achieved this kind of effect?    image from   Could you give me some suggestions: are there any techniques to get the same effect? I tried many ways in Photoshop. I have more than 5 years of experience in Photoshop, but my results are not the same?  What should I do?


What is the running temperature of a 100w bulb if it's resistance while on is 50 ohms and the mains voltage is 240 V RMS.

Suppose we have a light bulb, for which we know its power rating, like voltage of $12\mathrm V$, and power consumption of $10\mathrm W$. We also know it's a halogen bulb with a tungsten filament inside. Suppose we also know temperature of the surrounding air.  Is this data enough to compute temperature of the filament? If not, what should also be included? And anyway, how do we find the temperature?


I have a file with those data :   PAS_BEGIN_0009999     T71_MANUFACTURER_4=98     T71_COLOR_ID_7=000     T71_OS_7=08 PAS_END_0009999  PAS_BEGIN_0009996     T72_VAS_SERVICE_IDENTIFIER_6=     T72_ORDER_NB_7=0003     T72_TECHNOLOGY_7=01 PAS_END_0009996  TPV_BEGIN     PAS_20819001=3600000  TPV_END   How can I simply isolate content betweenPAS_BEGIN_0009996 and PAS_BEGIN_0009996  Here is a link for the example :   It finds something, but my python code doesn't find anything..  if re.match("PAS_BEGIN_0009999([\S\s]*)PAS_END_0009999", line):     data.append(line)     print(line)   Can anyone help me on this ? Thanks

What is the difference between the search() and match() functions in the ?  I've read the  (), but I never seem to remember it.  I keep having to look it up and re-learn it.  I'm hoping that someone will answer it clearly with examples so that (perhaps) it will stick in my head.  Or at least I'll have a better place to return with my question and it will take less time to re-learn it.


I want to get the value of the following nodes:  ResponseMessage, Response Result and VelocitiHotLeadID  from this SOAP XML response:  <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <SubmitHotLeadDetailsResponse xmlns="http://tempuri.org/"> <SubmitHotLeadDetailsResult xmlns:a="http://schemas.datacontract.org/2004/07/Velociti.Webservice.VelocitiHotLead" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">     <a:ResponseMessage>1:VendorID Does Not Exist 2:IDNumber is invalid.</a:ResponseMessage>     <a:ResponseResult>false</a:ResponseResult>     <a:VelocitiHotLeadID>0</a:VelocitiHotLeadID> </SubmitHotLeadDetailsResult> </SubmitHotLeadDetailsResponse> </s:Body> </s:Envelope>   I've tried to use this code but it did not work:  $xml = simplexml_load_string($result, NULL, NULL, "http://schemas.xmlsoap.org/soap/envelope/"); $xml->registerXPathNamespace('s', 'http://schemas.xmlsoap.org/soap/envelope/'); $xml->registerXPathNamespace('a', 'http://schemas.datacontract.org/2004/07/Velociti.Webservice.VelocitiHotLead'); $xml->registerXPathNamespace('i', 'http://www.w3.org/2001/XMLSchema-instance'); foreach($xml->xpath('//a:ResponseMessage') as $response) {    echo $response; }

Let's say I have some XML like this  <channel>   <item>     <title>This is title 1</title>   </item> </channel>   The code below does what I want in that it outputs the title as a string  $xml = simplexml_load_string($xmlstring); echo $xml->channel->item->title;   Here's my problem.  The code below doesn't treat the title as a string in that context so I end up with a SimpleXML object in the array instead of a string.  $foo = array( $xml->channel->item->title );   I've been working around it like this  $foo = array( sprintf("%s",$xml->channel->item->title) );   but that seems ugly.  What's the best way to force a SimpleXML object to a string, regardless of context?


I am on Ubuntu 18.04 in my PC. I installed PyCharm. But when I tried to run a simple print 'hello world', it showed a pop-up to install Python Packaging Tools.  When clicked on install, it showed the following error:  Executed command:      /tmp/tmp9bdigh8apycharm-management/setuptools-39.1.0/setup.py install   Error occured:     ModuleNotFoundError: No module named 'distutils.core'   Command Output:     Traceback (most recent call last):   File   "/tmp/tmp9bdigh8apycharm-management/setuptools-39.1.0/setup.py", line   11, in        import setuptools   File "/tmp/tmp9bdigh8apycharm-management/setuptools-39.1.0/setuptools/init.py",   line 5, in        import distutils.core ModuleNotFoundError: No module named 'distutils.core'   Please help me fix this and install the interpreter.

When I try to add virtualenv as an interpreter in PyCharm Community 2018.1.2 in Kubuntu 18.04 I get the following error:  ModuleNotFoundError: No module named 'distutils.core'    How can I solve this?


Is there a way to know if the connection to a host is made via an alias or using the direct host name itself? This is in Linux.  Basically I want to find out what are the connections made to my DB server host using the direct host name itself (and not an alias)  Thanks SK

This is a  about hostname-awareness and proxying.   I know that some protocols are hostname-aware; that is, when I connect to the HTTP server at www.example.com it knows I want www.example.com's HTTP service, not www.example.net's, even though they are on the same IP address.  How can I do this for protocol foo?  (Temporary note: this question appears pursuant to .)


I'm trying to figure how to approach with generating unique integer with 8 digits in java. The biggest problem is that it gives you a limited permutation, and also the clustered env. Any suggestion is welcome.  Regards

How do I generate a random int value in a specific range? I have tried the following, but those do not work: Attempt 1: randomNum = minimum + (int)(Math.random() * maximum);  Bug: randomNum can be bigger than maximum. Attempt 2: Random rn = new Random(); int n = maximum - minimum + 1; int i = rn.nextInt() % n; randomNum =  minimum + i;  Bug: randomNum can be smaller than minimum.


Question:  A and B are matrices size $n\times n$  given $AB=BA$ and A has n eigenvalues, prove $B$ is diagonalizable.  I would have written what I tried to do, but It's really nothing worth reading..  Any help would appreciated,  Thanks.

We were asked to prove the following:  Let $ A $ be an $n \times n$ matrix with $n$ distinct real eigenvalues. If $AB=BA$, show that $B$ is diagonalizable.   It was suggested I show that an eigenvector of $A$ is also an eigenvector of $B$. I am both having trouble doing this and failing to see how I would complete the proof after. Any help would be appreciated.  Thanks


I'm trying to calculate the number 4.2 + 0.2 - 0.1 However Despite having the value of 4.3 the output was 4.300000000000001. This is the animal.dart class class Animal {   String name = '';   int age;   double weight = 0;    Animal(this.name, this.age, this.weight);    void eat() {     print('$name is eating.');     weight = weight + 0.2;   }    void sleep() {     print('$name is sleeping.');   }    void poop() {     print('$name is pooping.');     weight = weight - 0.1;   } }  and this is the main() function import "dart:io"; import "lorem.dart";   void main(){ var pet = Animal('Flowie', 2, 4.2);    pet.eat();   pet.poop();   print(pet.weight); }  and the output is the following: Flowie is eating. Flowie is pooping. 4.300000000000001  what's the correct way to output the weight to 4.3 instead of 4.300000000000001 ?

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


I have a situation I'm trying to handle. I am using webdriver, C#. when I tried using the CSSSelector it is just reading the parameter as a string. Kindly look into it.This is the HTML.
     ***&nbsp;***       <input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-7" id="s2id_autogen7">

                <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" aria-owns="select2-results-7" id="s2id_autogen7_search" placeholder="">

   The element I'm trying to get the ID is a dropdown with this kind of ID: id="select2-chosen-7". The "select-chosen-" is static and numeric part is dynamic. After reading forums, all suggestion does not seem to have the answer. At the end this is the code I'm using which is still not working -  IWebElement DropDownPath = driver.FindElement(By.CssSelector("*[id^='select2-chosen-'][id*='select2-chosen-']")); SelectElement DropDown = new SelectElement(DropDownPath); DropDown.SelectByText(UserConstants.UserRoleText);

I'm trying to test a page that has an input but really its a drop down list. The user enters text and then a dropdown appears based on what the user inputted. They are groups that are in the database. If I look for these elements before typing anything they dont exist but once I start typing they do exist.  The problem is I cant just type the whole name and then press enter or return because an option has to be selected from the list.  I can press arrow down to get the focus on the item from the list but then if I say enter it doesnt select, it sends that enter to the original element and nothing gets selected.  I can find the select element:  var ddList = driver.FindElement(By.CssSelector(".ui-autocomplete-input")); ddList.SendKeys("Admins");   This is the first time the list appears in the html.  It looks like this:  <li class="ui-menu-item" role="presentation">


When writing a thank you note from a husband and wife, is it correct to write the note as...     "Thank you for inviting Steve and me to your home for the birthday celebration."    Or is it,     "Thank you for inviting Steve and I"?    This seems so simple but yet I get stumped every time :/

From some comments in the answers for  (now deleted, 10k only), there's confusion around the usage of I vs. me:  While the sentence, "the other attendees are myself and Steve," is agreed to be incorrect, there's confusion about whether the correct form is "the other attendees are me and Steve" or "the other attendees are Steve and I."  (I've always used the heuristic of removing the other people from the sentence, so I always thought "the other attendee is me" would be correct, instead of "the other attendee is I." Is this true, or am I using a flawed heuristic?)


Water can't be compressed. Even with 150 times the normal atmospheric pressure (such as at the bottom of oceans), it gets compressed by less than 1%.  This would affect the mechanism of trash compactor, for sure. Totally submerged trash wouldn't get compacted at all.  Why was there water in the trash compactor of the Death Star? And, why did they turn on the compactor without filtering out water from the trash (they could certainly drain water using a small hose)?

When Chewbacca, Luke, Han, and Leia escape the detention block aboard the Death Star, they find themselves in a trash compactor filled with enough murky liquid to hide a dianoga.                                What is the liquid?  Is it sewage?


For instance, let's say I have a random array [5,2,1,3,6,4] and I want to access it at least 6 times (i.e. 6 == len(array)) (the acess order doesn't matter, nor does it matter that I've accessed them all). How can I randomly access the whole array without popping any of the values ? In other words, I am trying to write a function find_new_index which takes an index i such that: arr = [5,2,1,3,6,4] i=0 x = 0 while i < 6:     access = arr[i]     x+=1     i = i + find_new_index(i) assert(x >= 6)  The idea is that this function works for any random array of size N which has random values from 1 to N. PS : The easy way to write find_indexis to generate a random number within it. However, I want to know if it's possible to write this function without loops or any function calls. This differs from other questions, since I don't want to use the Random Module.

What's the easiest way to shuffle an array with python?


I want to remove the commas in the x-axis values for a pgfplots graph. Here is an example with commas:    Is there a way of removing these commas only in the x-values (not in the y-values)?

How can I change the type of the decimal/thousand separator from the american one to the european one? More precisely, I want:   "1000" to be written as is, instead of "1,000" "0,1" instead of "0.1"


I usually use Debian, and use root commands after su. I am new to Ubuntu, not familiar with sudo syntax.  sudo cat fstab_new_text >> /etc/fstab   This results in   bash /etc/fstab: permission denied   I can edit the file in a terminal with vi  sudo vi /etc/fstab   The man pages did not help me.  Thanks in advance for any clue.

When using sudo to allow edits to files, I regularly get 'permission denied'.  For example, my mouse is jittery and sluggish, so I want to disable polling:  sudo echo "options drm_kms_helper poll=N">/etc/modprobe.d/local.conf   I'm prompted for a password, and then get:  bash: /etc/modprobe.d/local.conf: Permission denied   So I tried to do a temporary change to disable polling by using:  sudo echo N> /sys/module/drm_kms_helper/parameters/poll   Yet again the system responded with:  bash: /sys/module/drm_kms_helper/parameters/poll: Permission denied   Any ideas?


Near the end of The Last Jedi,      Luke uses some sort of astral projection to appear to the Resistance and face off with Kylo Ren.   During the scene, Luke is equipped with Anakin's old lightsaber. Given that      Kylo would remember Luke with his green saber from ROTJ and Kylo had JUST witnessed Anakin's saber exploding,   why did Luke equip himself with that lightsaber instead of the one he'd been using for decades?

During Luke's confrontation of Kylo Ren toward the end of The Last Jedi we see that       the lightsaber Luke uses a blue lightsaber (which I thought was his original one but that really doesn't matter), not the green one of his own construction.   Given that Kylo Ren  and Rey has just     fought over and broken the blue lightsaber   Why did Kylo Ren not notice this "inconsistency" and realize that      Luke's physical body was not there?


My code is-  x1 = 1000 x2 = 1000  x1 is x2 -> False  Y1 = 1 Y2 = 1  Y1 is Y2 - > True   Why results are different?

Why does the following behave unexpectedly in Python?  >>> a = 256 >>> b = 256 >>> a is b True           # This is an expected result >>> a = 257 >>> b = 257 >>> a is b False          # What happened here? Why is this False? >>> 257 is 257 True           # Yet the literal numbers compare properly   I am using Python 2.5.2. Trying some different versions of Python, it appears that Python 2.3.3 shows the above behaviour between 99 and 100.  Based on the above, I can hypothesize that Python is internally implemented such that "small" integers are stored in a different way than larger integers and the is operator can tell the difference. Why the leaky abstraction? What is a better way of comparing two arbitrary objects to see whether they are the same when I don't know in advance whether they are numbers or not?


I left several vacuum packed packages of salmon and ahi tuna filets in a cooler with ice bags in my car  are they still good after 24 hours.?please answer

If I left food out of the refrigerator for some period of time, is it still safe? If I left it out too long, can I salvage it by cooking it more?


I'm trying to solve this question but I'm stucked:  If a ring $R$ satisfies the following two conditions: i) For every maximal ideal $M$ of $R$, if $S = R\setminus M$ then $S^{-1}R$ is Noetherian, ii) For every $x \in R$, $x\neq 0$, the set of maximal ideals that contains $x$ is finite, then $R$ is Noetherian.  I tried to show that every ideal of $R$ is finitely generated but I don't get anything with this. Thank you for any help.

Let $R$ be a ring with finitely many maximal ideals such that $R_{\mathfrak m}$ ($\mathfrak m$ maximal ideal) is noetherian ring for all $\mathfrak m$. Is $R$ noetherian?   I think $R$ has to be noetherian. Let $p_1 \subset p_2 \subset \cdots \subset p_n \subset \cdots$ be an infinite ascending chain of prime ideals in $R$, then I claim that there exist a maximal ideal $m$ which will contain all the prime ideals in this chain (from finiteness of the maximal ideals), this will give a chain of prime ideals in $R$ localised at $m$, but since that has to be finite (the local ring $R_m$ is noetherian) so the chain pulled back will terminate in $R$.