Need Help With My Trigger to Update OpportunityLineItem

I have a problem with my update trigger. I created Order and Order Line Item custom objects, same and related with Opportunity and Opportunity Line Item. When I create an Order, a related Opportunity also created automatically. Their relations are:   Lookup on Order to Opportunity (Opportunities__c) Lookup on Opportunity to Order (Orders__c) Lookup on Order Line Item to Order (Order__c) Lookup on Order Line Item to Product2 (Product2__c) Lookup on Product2 to Order Line Item (Order_Line_Items__c)   When I update a product on Order Line Item, that product doesn't get updated on related Opportunity Line Item. This trigger doesn't update anything but I'm not getting any error. Do you have any idea what am I missing?  trigger OrderLineTrigger on Order_Line_Item__c (after update) {   if(trigger.isUpdate){      List<ID> orderlistid= new List<ID>();     List<ID> pricebooklistid= new List <ID>();     List<Order_Line_Item__c> updatelist=trigger.new;      for(Order_Line_Item__c updatelists:updatelist){       orderlistid.add(updatelists.Order__c);       pricebooklistid.add(updatelists.Product2__c);     }        List<Opportunity> opportunitylist=new list<Opportunity>([Select Id,Orders__c From Opportunity Where Orders__c IN:orderlistid]);       List<PricebookEntry> pricebookentrylist=new List<PricebookEntry>([Select Id,Product2Id From PricebookEntry Where Product2Id IN:pricebooklistid]);     List<ID> opportunityid=new List<ID>();     List<ID> pbeid=new List<ID>();      for(Integer k=0;k<opportunitylist.size();k++){       opportunityid.add(opportunitylist[k].Id);     }      for(Integer l=0;l<pricebookentrylist.size();l++){       pbeid.add(pricebookentrylist[l].Product2Id);     }      List<OpportunityLineItem> oppLists=new List<OpportunityLineItem>([Select UnitPrice, Quantity, PricebookEntryId, OpportunityId, Id From OpportunityLineItem Where PricebookEntryId IN:pbeid AND OpportunityId In:opportunityid]);       for(Integer i=0;i<oppLists.size();i++){        for(Integer j=0;j<opportunitylist.size();j++){          if(oppLists[i].OpportunityId==opportunitylist[j].Id){            for(Integer n=0;n<pricebookentrylist.size();n++){              if(oppLists[i].PriceBookEntryId==pricebookentrylist[n].Id){                for(Integer l=0;l<updatelist.size();l++){                  if(updatelist[l].Order__c==opportunitylist[j].Orders__c && updatelist[l].Product2__c==pricebookentrylist[n].Product2Id ){                    oppLists[i].UnitPrice=updatelist[l].UnitPrice__c;                   oppLists[i].Quantity=updatelist[l].Quantity__c;                 }               }             }           }         }       }     }         update oppLists;   } }


jQuery stop working after 2nd reply in a post

I have php comment system like Facebook where user can post comment and reply. when I make 2 reply in a comment one after one then I cannot make 3rd reply in same comment. Also here cannot work emoticons slide and upload toggle. But can reply others comments. I cannot understand this type of jQuery behaviour!!! I also can't understand, can php create this type of problem?   For emoticons display yet I create review window behind textarea And make my textarea transparent. So here I used jQuery bind(). All comment and reply submit by AJAX.  When i going to reply 3rd time Its not work in same comment. But after refresh its work for more 2 reply only.    Here is some related jQuery:  $('.maintbox').on('keyup',function() {     $(this).css('height','auto');     $(this).css('height',Math.max(this.scrollHeight)+'px'); }); $('.replycom').livequery("click",function() {     var VID = $(this).attr('id').replace('replycom','');     $("#parent_id").attr("value", VID);     $("#replycom"+VID).bind("keyup", function() {        $("#replycom"+VID).html($(this).val());        $(".review"+VID).html(smilyMe($("#replycom"+VID).val()));     });     return false; });  $('.showhide_emobox').livequery("click",function(){     var EID = $(this).attr("id");     $("#emobox"+EID).slideToggle(); }); $(".embtno").livequery("click",function(event){     var emotiText = $(event.target).attr("alt");     var EID = $(this).attr('id').replace('','');     var prevMsg = $("#replycom"+EID).val();     $("#replycom"+EID).val(prevMsg + emotiText);     $(".review"+EID).html(smilyMe($("#replycom"+EID).val()));     $('#emobox'+EID).fadeToggle(); });   my form:  echo'

 <form action="" method="post" class="repfrm'.$rows['id'].'" id="prepfrm"> <fieldset id="cmntfs">     <input type="hidden" name="username" id="author" value="'.$_SESSION['username'].'"/>     <input type="hidden" name="url" id="url" value="" />

        <textarea name="replycom" id="replycom'.$rows['id'].'" class="replycom" placeholder="Type your comment ..."></textarea>

     <input type="hidden" name="parent_id" id="parent_id" value="'.$rows['id'].'" />     <input type="hidden" name="tutid" id="tutid" value="'.$tutid.'" />     </form>     // Image upload system here
     <button type="submit" name="submit" value="" id="repl'.$rows['id'].'" class="replyfrm">Post Reply</button>     </fieldset>

';


PCB trace routing trick: how safe is it?

In a 2 layer PCB I routed some tracks under unused pins of a MCU to avoid GND polygon crossing, and also saved few vias. For example, using this trick 2 SDIO traces on the left were routed nicely together with other SDIO lines (and have a nice continuous GND on a bottom layer).  Assuming "standard" PCB/soldermask quality, how safe is to use this trick on volume production device (few thousand)?  I'm asking because I didn't see such routing in real-life products (did I invented new hack? :) and nothing on the Internet.  Unused GPIOs could be set to inputs and polled up/down internally, to be on a safe side if somehow soldermask is broken under them.


How to copy a link in Firefox with a plain text decoded format to past it in Notepad

Every time I try to copy a link location in Firefox and then past it in Notepad I get the encoded web adresses with numbers instead of characters, I searched a little for this problem, people seems have found a way to force Firefox to bypass the encoding by doing this:  network.standard-url.escape-utf8: true   But the problem I don't find this setting in about:config, the only result I get when i write network.standard-url in about:config page is this:     So how can I copy/past decoded data in Firefox newest versions?  Edit: I have found the solution in another post, the setting in about:config changed and was replaced by another one:   browser.urlbar.decodeURLsOnCopy;false   Change false to true and you will be able to copy/paste encoded links in Firefox without being forced to use a decoder.


Is $[\mathbb{Q}(x, y):\mathbb{Q}] = 2^r$ a sufficient condition for a point $(x, y) \in \mathbb{R}^2$ to be constructible by ruler and compass?

For $(x, y) \in \mathbb{R}^2$ to be a constructible point, we must necessarily have $[\mathbb{Q}(x, y):\mathbb{Q}] = 2^r.$ According to a book I'm reading on Galois theory, questions about sufficiency are much more difficult.  There is a nice exercise in the book to show that $\mathbb{Q} = F_0 \subseteq F_1 \subseteq \cdots \subseteq F_r = \mathbb{Q}(x, y)$ with $[F_{j + 1} : F_j] = 2$ is a sufficient condition for $(x, y) \in \mathbb{R}^2$ to be a constructible point. But is just $[\mathbb{Q}(x, y):\mathbb{Q}] = 2^r$ a sufficient condition for $(x, y) \in \mathbb{R}^2$ to be a constructible point?


Limit of reciprocal function is the reciprocal of its limit

Let $g$ be continuous on the interval $[a, b]$, and a $< c < b$ with $g_{(c)}<0$  Prove, using the epsilon and delta characterisation of a limit, that $\lim\limits_{x \to {c}}\frac{1}{g{(x)}} = \frac{1}{g{(c)}}$ Hence deduce that $\frac{1}{g}$ is continuous at $c$  I know that there exists $g {(x}$) smaller than $\frac{g {(c)}}{2} < 0$ and I can use this information somehow but other than that I am not sure how to approach this question. Is there any special laws I need to follow?


How Can I take Screenshot using selenium Webdriver

Hello , please tell me how can i  take the screenshot of webpage by using selenium Webdriver in java ??


Galois group of $\mathbb Q(\sqrt{4+\sqrt 7})/\mathbb Q$

Let $\alpha =\sqrt{4+\sqrt 7}$ and $\beta =\sqrt{4-\sqrt 7 }$. I have to compute $Gal(\mathbb Q(\alpha )/\mathbb Q)$. So, I found that $Gal(\mathbb Q(\alpha )/\mathbb Q)=\mathbb Z/2\mathbb Z\times \mathbb Z/2\mathbb Z$, that $\mathbb Q(\beta^2)= \mathbb Q(\alpha^2)$. I show that the roots of the minimal polynomial of $\alpha $ are $\{\alpha ,-\alpha ,\beta ,-\beta \}$. But now that ask me to enumerate the element of the galois group. I did it's $\{id, \sigma ,\tau,\sigma \tau\}$ where   \begin{align*} \sigma : \alpha &\longmapsto -\alpha \\ \beta &\longmapsto -\beta  \end{align*} and  \begin{align*} \tau : \alpha &\longmapsto \beta  \\ \beta &\longmapsto \alpha  \end{align*}  But in my correction they wrote   \begin{align*} \sigma : \alpha &\longmapsto -\alpha \\ \beta &\longmapsto \beta  \end{align*}  Question : Who is right ? me or the correction ?  The problem it's that this group is abelian, so if they are right, $$\sigma \tau(\alpha )=\beta \neq -\beta =\tau\sigma (\alpha )$$ so I think I'm right, but in the doubt I prefer to ask you.


Should I have more than one brokerage account?

I have my brokerage business with one particular well-known US brokerage house. I find being able to access my retirement accounts and personal investment accounts through the one interface useful.  However, I was talking with a friend of mine and she said she never puts more than about $50k into any particular brokerage account.  Managing three or four such accounts seems like too much overhead for me. I'd prefer to spend my "investment time" reading up on my investments and researching new ones.  One reason to have more than one brokerage account with different houses is the issue of  insurance:     Within limits, SIPC expedites the return of missing customer property by protecting each customer up to $500,000 for securities and cash (including a $250,000 limit for cash only).   What other reasons could I have to use more than one brokerage account?


Trouble Installing Ubuntu from DVD and USB

I have no interest in saving anything that is still on this device.  When I choose "Erase disk and install ubuntu" I receive the error "?????? "??????" Could anyone help me with this problem?   This PC has a 1Tb HD and 4 Gb of RAM There was previously Windows 7 on the PC, but that is now gone.  I can let you know anything else about the specs if needed. Thank you.


although it is possible to do it with a form and submit, I am trying to make the upload of files from javascript to php.  I have slightly modified a code I found on an example for the upload of files from a client (a php file using a javascript) to the server where a PHP file receives the file. This code works for the files that are present on the same folder of the client php file. I am testing this code with xampp so on the localhost folder.  Is there any possible way to allow also files from different folders (so that any client would upload files) to be uploaded? Here is the code I am using  client file php  // Getting a file through XMLHttpRequest as an arraybuffer and creating a Blob  var document = document.querySelector("#fileToUpload"); var file = document.getElementById("File1").files[0];  if (document) {       var xhr = new XMLHttpRequest(),         blob;     var file1=document.getElementById("fileToUpload").files[0].name;       xhr.open("POST", ""+file1, true);        xhr.responseType = "blob";      xhr.onreadystatechange = function () {         window.location.href = "testupload.php?w1=";         if (xhr.readyState === 4 && xhr.status === 200) {              /*                  Create a blob from the response                 Only needed if the responseType isn't already blob                 If it's "arraybuffer", do this:                  blob = new Blob([new Uint8Array(xhr.response)], {type: "image/png"});             */             blob = xhr.response;             var form = new FormData();             formData.append("file", file);             form.append("blobbie", blob);              var xhrForm = new XMLHttpRequest();             xhrForm.open("POST", "handle_file_upload.php");             xhrForm.send(form);              xhrForm.onreadystatechange = function () {                 if (xhrForm.readyState === 4) {                     console.log(xhrForm.response);                     rhino.src = xhrForm.response;                 }             };         }     };     // Send XHR     xhr.send(); }   };      thanks a lot for any possible advise or sample code you might have. Michele


What's the difference between $scope.myScope = function () and function () in AngularJS

I've recently gone into developing with AngularJS. It's confusing to me the different between these two:   $scope.myScope = function () {   var x = 'do something with variable here';  $scope.anotherScope = x; };   and   function myFunction () {  var x = 'do something with variable here';  $scope.anotherScope = x; }   They both seem to be able to do the same thing (I use them a lot inside controllers). Is there a best practice for when and where to use these two?


what are the relativistic/cosmological implications on a long rigid body?

This is my first question. Hope it's in respect of quality standards.  Let's suppose to have a "long" rigid almost unbreakable bar of fixed negligible diameter . (we can imagine it as a rigid wire) Lets suppose that the "bar" goes from Earth to Sun (8 light minute distance) but not consider the masses/gravity of Sun and Earth.  1. If I pull the bar 1 meter , what's the relativistic analisys ? Since the info that "I pull the bar" travels at light speed ,  in the 8 minutes the info reach the Sun is the Bar one meter longer ?  2.The cosmological question:  If the bar goes from one galaxy to another , how the universe expansion reflects on it?


I'm curious how USB device recognition works in Windows. I imagine it's something like this:   When you plug in a device, it tells Windows "here's my device ID to tell you what I am" Windows looks to see if any drivers have been installed that match that device ID. The driver probably tells Windows what the device should be called - like "BlackBerry Curve" or "Canon Printer" If so, it somehow associates that device with that driver Otherwise, it looks for a matching driver online (if you let it)   Am I right? If so, that still leaves some questions.   When you install drivers, where do they go? Are they files in a folder, or do they get added to the registry? What is Windows doing when it first recognizes the device, thinks, and finally says "your new device is installed and ready to use?" Where does Windows look for missing drivers? Is it in their own database? Do device manufacturers submit drivers to Microsoft for inclusion there?   Can anybody explain how this process really works? Also, do other OSes do this differently?


Why is Brace expansion with variables not working as expected?

I would like to set a variable (x=100) in the brackets such as   x=100     for i in {0.."$x"..50} ;do echo $i  done   the desire output for i should be   0 50 100   although I get as an output  {0..100..50}


How could I have dropped out of sudoers?

I started to receive a message   dims is not in the sudoers file.  This incident will be reported.   about myself.  How could this happen?  The suspicious command I made was creating group "advanced" and adding myself to it.  addgroup advanced usermod -G advanced dims   Could this break my sudo rights?


I received a payment error during my ESTA application; what can I do?

I received a payment error during my ESTA application and still need to pay. The current application status for the last few hours shows:     THE PAYMENT STATUS COULD NOT BE DETERMINED AT THIS TIME.    PLEASE CHECK BACK LATER FOR THE PAYMENT STATUS.   Your application is not complete and will not be processed by CBP until the processing fee has been paid.   You must complete payment within 7 days.


In .net we are having strong name for assembly. what is the actual use of this? how this internally used? if possible please explain the scenario


Forcing an 'added' alias to every command

Is it possible to forcibly add a timing alias (for lack of a better way to phrase it) to every command in bash? For example, I would like to have a specific user who, whenever a command is run, it is always wrapped either with date before and after, or time. Is this possible, and, if so, how?


I am sriram, we have a problem our company today, that is virus is attacked our LAN, so please give suggestion to rectify the virus.  It will effects   Taskbar is disabled Network connection is not worked cut,copy,post options are not worked when our rigt click the pop menu does not opened   etc...  We checked different antiviruses but, we don't find out to rectify the problem.  Please help me......


is in the list of SE sites of the new top-bar included. But since  it should be in my top 5 sites to be consistent.  BTW I don't get notified about new rep on Area51 as well.


"They went for one- fifty if they went for a quarter"

They in this sentence refers to:     "worked leather cowboy boots studded with silver conches".   What does the phrase in the topic mean? The boots could sell for 6 times as much now because of the silver?  EDIT: I don't seem to have enough to comment on the commentators below, so I will ask my follow-up here.  Does this mean the last part of the sentence     "...if they went for a quarter"   only serves to clarify the unit mentioned in the beginning (in this case, money) and not about any cost (a quarter)?


show that $ \lim(\sin(\frac{1}{x}))$ as $x$ approaches zero does not exist.

I am stuck trying to understand how to prove that the limit of $\sin(\frac{1}{x})$ as $x$ approaches $0$ does not exist. a hint was given: a limit does not exist if there exists an $\varepsilon > 0$ such that for every $\eta>0$ there exists an $x$ with $0<|x-a|<\eta$ whenever $|f(x)-L|\geq \varepsilon$.   so I approached this by stating that $|x|<\eta$ then $\sin(\frac{1}{x})-L\geq \varepsilon$. then I set $\varepsilon \leq|f(x)-L|<\sin(\frac{\eta}{2x})-L$ then used inverse sine to try and get delta alone... but now I'm looking at it trying to figure out what i did and why i did it.   can someone please walk me through a proof that this limit does not exist and maybe try and explain it to me. I am lost.


Apache cannot start or restart after uninstalling Softaculous

I wanted to restart my server so I did :  sudo service apache2 restart   It instead showed me the message below :  Job for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for details.   I then did systemctl -l status apache2.service and it came out with these results:      apache2.service - LSB: Apache2 web server    Loaded: loaded (/etc/init.d/apache2)   Drop-In: /lib/systemd/system/apache2.service.d            └─forking.conf    Active: failed (Result: exit-code) since Thu 2016-12-15 07:44:48 CST; 43min ago   Process: 31239 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)  Dec 15 07:44:48 s87890 apache2[31239]: Starting web server: apache2 failed! Dec 15 07:44:48 s87890 apache2[31239]: The apache2 configtest failed. ... (warning). Dec 15 07:44:48 s87890 apache2[31239]: Output of config test was: Dec 15 07:44:48 s87890 apache2[31239]: apache2: Syntax error on line 216 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf-enabled/softaculous.conf: No such file or directory Dec 15 07:44:48 s87890 apache2[31239]: Action 'configtest' failed. Dec 15 07:44:48 s87890 apache2[31239]: The Apache error log may have more information. Dec 15 07:44:48 s87890 systemd[1]: apache2.service: control process exited, code=exited status=1 Dec 15 07:44:48 s87890 systemd[1]: Failed to start LSB: Apache2 web server. Dec 15 07:44:48 s87890 systemd[1]: Unit apache2.service entered failed state.   I looked at line 216 of /etc/apache2/apache2.conf and this is what I saw:  IncludeOptional conf-enabled/*.conf   I did journalctl -xn and it showed me :      - Logs begin at Tue 2016-12-13 16:17:11 CST, end at Thu 2016-12-15 08:11:24 CST. -- Dec 15 08:11:05 s87890 sshd[32074]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=116.31.116.48  user=root Dec 15 08:11:07 s87890 sshd[32074]: Failed password for root from 116.31.116.48 port 61622 ssh2 Dec 15 08:11:10 s87890 sshd[32074]: Failed password for root from 116.31.116.48 port 61622 ssh2 Dec 15 08:11:12 s87890 sshd[32074]: Failed password for root from 116.31.116.48 port 61622 ssh2 Dec 15 08:11:12 s87890 sshd[32074]: Received disconnect from 116.31.116.48: 11:  [preauth] Dec 15 08:11:12 s87890 sshd[32074]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=116.31.116.48  user=root Dec 15 08:11:22 s87890 postfix/smtpd[32032]: warning: hostname dedic858.hidehost.net does not resolve to address 91.200.13.20: Name or service not kn Dec 15 08:11:22 s87890 postfix/smtpd[32032]: connect from unknown[91.200.13.20] Dec 15 08:11:24 s87890 sudo[32065]: ejandra : TTY=pts/0 ; PWD=/home/ejandra ; USER=root ; COMMAND=/bin/journalctl -xn Dec 15 08:11:24 s87890 sudo[32065]: pam_unix(sudo:session): session opened for user root by ejandra(uid=0)   I already did an apache uninstall and then installed it again but still the same error persists. What could be wrong here?


Condition Random Variable on Range of Another Random Variable

Assume that $v_s \sim N(\mu_s,\sigma_s^2)$ and $v_b \sim N(\mu_b,\sigma_b^2)$, denote their correlation by $\rho$, and assume they are jointly normally distributed. How would I assess $E[v_b|v_s\leq c]$ where $c$ is some constant? I figured it would be of the form $$E[v_b|v_s\leq c]=\frac{1}{P(v_s\leq c)}\int_{-\infty}^cE[v_b|v_s]f_{v_s}dv_s$$ however I'm not sure this is right. Not sure how to conceptualize the approach here. Thanks!


What happens at hardware level when we feed a code?

I wanted to know what hardware is installed in 8051 such that whenever i write a program it accepts it and execute it. My query is what happens at the hardware level whenever i feed a program to 8051.


How to use this keyword in static method? C#

I have a static method in a non static class. I would like to use this keyword in this static method.  Or is there another implementation that is similar to this.


I'm having some issues with my Ubuntu 20.04 server, when I type sudo apt update I get the following error: E: Malformed entry 2 in list file /etc/apt/sources.list.d/pgdg.list (Suite) E: The list of sources could not be read. I've ran sudo more /etc/apt/sources.list to see what the issue is but I can't work out which one is giving me problems... The full log here: admin@localhost:~$ sudo more /etc/apt/sources.list  ## Note, this file is written by cloud-init on first boot of an instance ## modifications made here will not survive a re-bundle. ## if you wish to make changes you can: ## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg ##     or do the same in user-data ## b.) add sources in /etc/apt/sources.list.d ## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl  # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://archive.ubuntu.com/ubuntu/ focal main restricted # deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted  ## Major bug fix updates produced after the final release of the ## distribution. deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted # deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted  ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://archive.ubuntu.com/ubuntu/ focal universe # deb-src http://archive.ubuntu.com/ubuntu/ focal universe deb http://archive.ubuntu.com/ubuntu/ focal-updates universe # deb-src http://archive.ubuntu.com/ubuntu/ focal-updates universe  ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://archive.ubuntu.com/ubuntu/ focal multiverse # deb-src http://archive.ubuntu.com/ubuntu/ focal multiverse deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse # deb-src http://archive.ubuntu.com/ubuntu/ focal-updates multiverse  ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe m ultiverse # deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted univ erse multiverse  ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. # deb http://archive.canonical.com/ubuntu focal partner # deb-src http://archive.canonical.com/ubuntu focal partner  deb http://security.ubuntu.com/ubuntu/ focal-security main restricted # deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted deb http://security.ubuntu.com/ubuntu/ focal-security universe # deb-src http://security.ubuntu.com/ubuntu/ focal-security universe deb http://security.ubuntu.com/ubuntu/ focal-security multiverse # deb-src http://security.ubuntu.com/ubuntu/ focal-security multiverse  I'm hoping someone can guide me on which one to remove so I can use apt again. UPDATE: deb http://apt.postgresql.org/pub/repos/apt focal-pgdg main deb http://apt.postgresql.org/pub/repos/apt/  focal-pgdg main


Delphi sql: dealing with space character in field name

Ho do I deal in the sql text with fields that have a space character. For example in db biolife I have the field: Species Name both my attempts did not work:  query1.SQL.Text := 'SELECT Species Name FROM biolife'; query1.SQL.Text := 'SELECT ''Species Name'' FROM biolife';    The first one gives error, the second gives wrong result.


Viewing C# tag then changing sorting drops the # symbol

Steps to reproduce:            Change sorting to "date posted" You will now see that your search criteria is for C, not C#.


QUESTION: Suppose $P(x)$ is a polynomial of degree $n$ such that $P(k)=\frac{k}{k+1}$ for $k=0,1,2,.....,n$. Find the value of $P(n+1)$.   MY APPROACH: At first, this question seemed simple to me.. By putting values of $k$ we can easily get values of $P(0),P(1),....$ and so on. Since, $P(0)=0$ therefore we can say that the constant part of the polynomial is zero. Now,I have assumed the polynomial to be $P(x)=x^n+a_{n-1}x^{n-1}+.....+a_1x+a_0$ But from here things start to mess up.. I am sure this method won't work.. how do I think about it?  Please help me out. Thank you.


i have:  for i in range(2,n):     if(something):        do something     else:        do something else        i = 2 **restart the loop   But that doesn't seem to work. Is there a way to restart that loop?   Thanks


How to generate multiple, numeric-style citation call-outs?

In my kile documents, I want to add multiple citations. For this I use the command   \cite{cristo,taylor,polgar,phillips,speirs,simoes,roberto}   The names in this command give numeric references, which is what I wanted, but not in the way I want it. It gives [1,2,3,4,5,6,7] instead of [1,2,4-8]. Is there any other way to manage this? My bibliography style is elsarticle-num, and I use bibtex for the bibliography.   I use this preamble in my document:  \documentclass[review,preprint,twocolumn,3p]{elsarticle} \usepackage{graphicx} \usepackage{color} \usepackage{url} \usepackage{ctable} \usepackage{booktabs} \usepackage{cite} \usepackage{tabularx} \usepackage{array} \usepackage{soul} \usepackage{multirow} \usepackage{lineno} \usepackage{subfigure} \usepackage{amssymb,amsmath} \newcommand{\tab}{\hspace{5mm}}


Choose 100 numbers from 1~200 (one less than 16) - prove one is divisible by another!

Prove that if 100 numbers are chosen from the first 200 natural   numbers and include a number less than 16, then one of them is   divisible by another.   How to prove this? many thanks....


Suppose I have a file:  File1:   PAPER  TEAM  MANISH NISHA GARIMA JYOUTI ........etc    File2 I want:  PAPER     TEAM MANISH NISHA GARIMA     JYOUTI   Rows to column conversion of File1.


How to switch language keyboard combination?

I would like to type Hebrew in Ubuntu. I tried downloading the Hebrew language pack and then setting alt-shift as my layout-change shortcut in the Options section of "Keyboard Layout".  However, when I actually press alt-shift, nothing happens. How can I switch my keyboard layout to Hebrew?


"book available at" or "book available on?"

What's the correct way of saying it?   "X book is available at Amazon" or "X book is available on Amazon?"


Can't review closed votes, but still 20 votes left

I was helping to burn the close vote queue and I was surprised to see the "you reached 40 closed votes today, come back in xx hours" message so soon. Now, I discover I still had 20 close votes left! What's going wrong?     Please note that I've already done 2 close votes after the review was blocked.


Why this object reference variable is null after creating an object and assigning it to the variable?

I've just started learning Java. I'm reading this book: Intro to Java Programming, Comprehensive Version (10th_Edition). In chapter 9, there's a simple program:  import java.util.Date; public class Test {  public static void main(String[] args) {  Date date = null;  m1(date);  System.out.println(date);  }  public static void m1(Date date) {  date = new Date();  }  }   As I understand the method creates a new object and assigns It to the reference variable that was passed to It. Why does It still print null after calling the method? Thanks for your answers.


What I do: I want to write a kernel module that does stuff to the KVM data structures. But I don't want to run it on the real machine, so I run one guest, inside it I run another two guests, and want to test my module.  The problem: VirtualBox (which now runs the outer guest), doesn't support nested virtualization, and when I cat /proc/cpuinfo | grep vmx I get no output.  What can I use that has nested virtualization?  You may look at my  to get an idea of what I want to do.


Should I attend a likely lesser university, PSU in Pittsburg, Kansas, for a graduate degree in history, or should I attend the University of Minnesota for a second bachelors degree in psychology? All of this is aimed at eventual graduate work in philosophical counseling and the history of philosophy. I want to take the time to read and study ancient philosophy in depth so that I can teach it, but I'm also pretty sure that I have the ability to become a decent philosophical counselor and have spent a good deal of my time thinking and reading about it. The U is a stretch financially at the moment, but I might be able to make it work. Financial aid is sparse for a second bachelors degree. This is why there is even a question. I can definitely afford to live in Pittsburg, KS and I do like it there and I can go to PSU and sort of revive my rusty study habits (3.5 yrs since graduation) in a slightly less rigorous setting, most likely, that I should be able to receive adequate loans for. If I can manage to pay for 13 credits at the U, the rest are free. That is one semester, with tuition around 18k. Living in Minneapolis is very expensive too, all the amenities are higher and rent averages 600 just for a room. I have a lot of history there and friends, but haven't lived there in some time. I also have friends and history in Pittsburg whom I've seen more recently. I have no idea what to do at this point. Looking at both acceptance letters, reading them back to back, over and over, and feeling paralyzed. School starts in January.


More fine grained syntax highlighting in Emacs/AUCTeX

I'm using Emacs with AUCTeX to do all my LaTeX. When it comes to syntax highlighting it seems that all mathematics is by default just orange. Do you know of a mode or package that adds some more fine grained syntax highlighting? For example all commands (\foo), matching braces, sub- and superscripts, etc. should get a different color.


Can I apply for Schengen without hotel reservation and a local address, as I will be visiting Munich during layover?

I am an Indian citizen, holding a valid visa for USA. I will be traveling to the United States via Munich, Germany. I have 10 hours of layover at Munich. I would like to visit Munich during the layover. I have two questions.   Do I need to apply for a Schengen Visa before my travel? I understood that, Schengen Visa needs proof for hotel reservation and a local address. I do not need a hotel accomodation and a local address, as I will be traveling to the USA. Can I get a Schengen without hotel reservation and a local address?   Appreciate if anyone can guide.  ~SAM


I am an investor from Brazil and I would like to know how fractional shares works in the US Market.  Is this operation specific to some brokerage firms? When I place a trade order, is it executed immediately? Or I have to wait until the end of the day in fractional shares only.  I tried to open some accounts, but I don't have US address.


Looking for closed-forms of $\int_0^{\pi/4}\ln^2(\sin x)\,dx$ and $\int_0^{\pi/4}\ln^2(\cos x)\,dx$

A few days ago, I posted   Prove that \begin{equation} \int_0^{\pi/2}\ln^2(\cos x)\,dx=\frac{\pi}{2}\ln^2 2+\frac{\pi^3}{24}\\[20pt] -\int_0^{\pi/2}\ln^3(\cos x)\,dx=\frac{\pi}{2}\ln^3 2+\frac{\pi^3}{8}\ln 2 +\frac{3\pi}{4}\zeta(3) \end{equation}  and the OP receives some good answers even I then could answer it.    My next question is finding the closed-forms for     \begin{align} \int_0^{\pi/4}\ln^2(\sin x)\,dx\tag1\\[20pt] \int_0^{\pi/4}\ln^2(\cos x)\,dx\tag2\\[20pt] \int_0^1\frac{\ln t~\ln\big(1+t^2\big)}{1+t^2}dt\tag3 \end{align}   I have a strong feeling that the closed-forms exist because we have nice closed-forms for \begin{equation} \int_0^{\pi/4}\ln(\sin x)\ dx=-\frac12\left(C+\frac\pi2\ln2\right)\\ \text{and}\\ \int_0^{\pi/4}\ln(\cos x)\ dx=\frac12\left(C-\frac\pi2\ln2\right). \end{equation} The complete proofs can be found .  As shown by Mr. Lucian in his answer below, the three integrals are closely related, so finding the closed-form one of them will also find the other closed-forms. How to find the closed-forms of the integrals? Could anyone here please help me to find the closed-form, only one of them, preferably with elementary ways (high school methods)? If possible, please avoiding contour integration and double summation. Any help would be greatly appreciated. Thank you.


Why does the definition of addition require proofs?

The book is Foundations of Analysis by E. Landau.  I delve into analysis for the first time. Before I would encounter merely a definition of something in a textbook, but now there is something more. In Theorem 4 the author gives a definition of addition. Then he first proves that A) for any fixed $x$ there is at most one possibility to define $x + y$. Then he proves that B) for each $x$ it is possible to define $x + y$.  My question is why does he prove B) that it is possible to define $x + y$? He has already made a definition, so he brought it into existence.  Why does he need proofs here at all? It is a definition, you can define it however you want.


How can I uninstall ubuntu and then install windows 8.1

I want verification that my windows 8.1 instalation disk will run if i uninstall ubuntu


I am looking for a command options for grep to  find files with the occurences of foo and bar.  Grepping with  grep -r -e foo -e bar .   shows files which have only foo or only bar and files which have foo and bar.  Is it possible with grep to find only files which have both foo and bar (and display the lines that match either foo or bar or both in those files only)?  Example:  echo foo > file1 echo bar > file2 (echo foo;echo;echo bar) >file3 echo barfoo > file4   the grep cmd:  grepcmd -r -e foo -e bar . ./file3:foo ./file3:bar ./file4:barfoo


Properly discontinuous action: equivalent definitions

Let us define a properly discontinuous action of a group $G$ on a topological space $X$ as an action such that every $x \in X$ has a neighborhood $U$ such that $gU \cap U \neq \emptyset$ implies $g = e$. I would like to prove that this property is equivalent to, having given $G$ the discrete topology and in the $X$ locally compact Hausdorff case, the map $G \times X \rightarrow X \times X$ given by $(g, x) \mapsto (x, gx)$ being proper (i.e. closed and preimage of compact sets is compact) plus the action being free.  I have managed to prove one direction, that is, if the action is proper and free with $G$ having the discrete topology then it is properly discontinuous. I'm having trouble though with the other direction. Here is an attempt: let's denote by $\rho : G \times X \rightarrow X \times X$ the map $\rho(g, x) = (x, gx)$. Suppose $K \subset X \times X$ is compact. We wish to show $\rho^{-1}(K)$ is compact. Let $(g_i, x_i)$ be a net in $\rho^{-1}(K)$. Then $\rho(g_i, x_i) = (x_i, g_i x_i)$ admits a convergent subnet, so passing to it we may assume $x_i \rightarrow x$ and $g_i x_i \rightarrow y$. Essentially we must now find a way to prove $g_i$ converges, but I can't seem to do this. Any hints?


How to add navigation circles to Copenhagen theme in beamer?

I would like to ask if there is a way to add navigation circles to the Copenhagen theme. Let me expalin it better:   1. on the left hand side of the header there is a list of the sections.  2. on the right hand side of the header there is a list of the subsections (if there are any). I don't have subsections.  I would like to have on the right hand side as many navigation circles as frames, situated at the same height as the corresponding section. I saw this configuration in some presentation, but I am unable to replicate it.  As I am unable to show you an example with a real slide, next I show a scketch of how I want the header (each x is for a navigation circle and treat · as white spaces):  |··························|····················|  |···········Section 1 | xxx·············|   |···········Section 2 | xxxxx·········|  |···········Section 3 | xx ··············|  |··························|····················|  Where section 1 has 3 frames, section 2 has 5 frames and section 3 has 2 frames.  Thanks for your help.  Mihaela


Gambian national traveling to Gambia having four hours transit in morroco Casablanca do I need a transit visa

k am a Gambian national traveling to Gambia do I need a  four hour transit visa to morroco Cassablanca


Replace Builtin commands with Custom Commands for CMD.exe

If I do a command like (on windows cmd.exe):  where dir   or  where cd   I get the following message:  INFO: Could not find files for the given pattern(s).   This tends to mean to me that cd and dir are not actual programs, but are built in to cmd.exe.  Now the real question is:   Is there ant way to replace cd and dir with other programs?  If you wanted to replace say more, you could just put another program by that name in the system PATH in front of where more is.  But you cannot do that with cd and dir.  Am I just stuck with them?


Checking if checkboxs is ticked after adding it with jquery

When the page starts the users is asked to selected a category. Once a category is selected with Ajax some checkboxes are loaded.  I need to do something when these checkboxes are ticked however the problem is i cannot detect change on them since i just added them.  *** options variable contains the input checkbox  $("#subcat").append(options)   I then try to check weither the it is checked or not with the code  below  <script>     $(":checkbox").change(function(){         if($(this).attr("checked")) {             alert("abc");         } else {             alert("CBA");         }     }); </script>   If i add a input check box directly onto the html file then it detects change however when i load checkboxes with ajax it does not.


How can I align a 2D object properly using tilemap collision

I'm making a mario clone, and I have been working on the collision but I can never seem to get it right. I started out with "true/false" collision, aligning the player at it's last position, and as can guess, the results were barely ok. The problem was in the alignment and in the direction of movement. I then converted my collision function to return the rectangle area of intersection as shown in the top left corner: (Yellow rectangle)  I now have a bunch of other problems which I think are more acceptable to solve. I'm unsure of what to do with the data I get from the function now. My current logic is this: // Update Gravity // Update Movement // Check for collision // Intersect2 applies offset to a existing rectangle, and returns true or false. if(Intersect2(*level, *camera)) // Check collision against level, but only against tiles in camera view. {     // Correct Y Movement     if (offset.height >= 16) sprite.move(0, offset.height); // 16 is half a tile size     else      {         sprite.move(0, -offset.height);         inAir = false;     }     velocity.y = 0;          // We corrected Y, are we still intersecting? then correct X as well     if(Intersect2(*level, *camera))      {         if (offset.width >= 16) sprite.move(offset.width, 0); // 16 is half a tile size         else sprite.move(0, -offset.height);         velocity.x = 0;     }     // Reset the offset rectangle     offset.height = 0;     offset.top = 0;     offset.left = 0;     offset.width = 0;  }  How can I apply the offset in a correct way? Side note: I have stuttering problems while on ground, as my gravity is always "on" so that I can fall down when walking off an elevated block.


Possibly i know the following uses of **  Power  x ** y # x power y equivalent to pow(x,y)   Passing indefinite number of args  def sample(x, **other):     print(x, other.keys) sample(x=2,y=3,z=4)    But i don't understand when its used as follow( in )  def create(self, validated_data):     return Comment(**validated_data)   Can someone give me a hint of what is happening there


How do I know if a font has a glyph for a given Unicode character?

I've seen similar questions answered for C#, PHP, etc. but I was not able to use those solutions in my Pascal work (Lazarus and Delphi).  The question is simple: I'd like to know programmatically if a font has a glyph for a given unicode character - using Lazarus (preferably) or at least Delphi.  In my specific case I'd like to use a unicode arrow char in some TLabel but I'd like to be able to check if that unicode arrow character is present in that font.  As an aside: my current roundabout solution is get TextWidth and TextHeight of the unicode character, and compare it with the TextWidth and TextHeight of a character that I'm sure does NOT have a glyph (say U0001). If they are different, it means the glyph exists. If they are the same, either the character doesn't have a glyph, or the glyph happens to have the same size as the  ("glyph missing) replacement char. Clearly not a very satisfying solution. If you can think of a better roundabout solution, please let me know as well.  Thanks!


Is there a length-preserving encryption scheme?

Is there a length-preserving encryption scheme, that preserves the lengths of input sizes such that the length of the input plain text is same as length of the output cipher text ?


What is the complete and correct syntax for the SQL Case expression?


I've got Linux Mint 17.1 on my laptop installed by someone else and I want to replace Mint with Ubuntu. I don't have a Windows system on it - just Mint.  Can anyone tell me - in newbie friendly terms - how to do that?  When I type df -h in terminal, the result is as below:  Filesystem Size Used Avail Use% Mounted on /dev/sda1  684G 189G 460G 30% /  none       4.0K 0    4.0K 0% /sys/fs/cgroup udev       1.9G 4.0K 1.9G 1% /dev tmpfs      386M 1.4M 385M 1% /run none       5.0M 0    5.0M 0% /run/lock none       1.9G 32M  1.9G 2% /run/shm none       100M 28K  100M 1% /run/user


Getting shapefile in right projection using ArcGIS Desktop?

I have an older map that I didn't create. I'm just trying to get everything to line up on it, and having a hard time.  The data frame is in NAD_1927_UTM_Zone_12N, as are the point shapefiles (derived from a .dbf table that I had to repair the data source to) and one line shapefile.  All the other data is in StatePlane (either 1927 or 1983) and that's what shows up in the layout view (aerial, roads, buildings, polygons, etc.)  I've changed the points (via right click, data, repair data source, browsing for the data and then editing "Coordinate System of Input Coordinates" to StatePlane, but that doesn't work. The point shapefiles aren't visible anywhere, even if I zoom to the layer or go to Full Extent.  When the points are in the UTM projection, they're at a ridiculous scale (1:1,000,000) and they're all in a straight line instead of spread out like the old PDF version of the map I have.   I'm trying to make some simple edits, but I can't fix the bigger issue of shapefiles not lining up.  Although I don't know if this is the problem, when I open the map I get a notice that says, "This document may contain VBA code but you don't have a VBA license." I would just assume that scripts don't run, not that that would affect projections...  Any insight would be greatly appreciated. Thanks.   edit: No, the pdf is uneditable. I did realize the XY were being mapped to the same field, which was wrong (the XY data is in northings and eastings), but correcting that didn't fix the problem. Unfortunately, whenever I try to add data, browse for projections and the like, ArcMap crashes which is an unrelated server problem. I could copy the data to my own folder but there are a lot of files and some of them are linked and from other folders and ...still of course in different projections. Although I fixed the VBA license problem, so that has nothing to do with it.  I tried doing Data Management > Projections & Transformations > Features > Project and each time (regardless of which projection I choose) the new points project exactly where they currently are. I'm currently trying suggestion #1 at the moment.


Can a snake feel if a Parselmouth is around?

When Harry and the Durselys visited the zoo in the first book, the snake was sleeping all the time and didn't even move when the glass was knocked at. But when Harry moved closer to the cell, it opened its eyes and winked at Harry even though Harry hadn't said a word.  Harry moved in front of the tank and looked intently at the snake. He wouldn't have been surprised if it had died of boredom itself -- no company except stupid people drumming their fingers on the glass trying to disturb it all day long. It was worse than having a cupboard as a bedroom, where the only visitor was Aunt Petunia hammering on the door to wake you up; at least he got to visit the rest of the house. The snake suddenly opened its beady eyes. Slowly, very slowly, it raised its head until its eyes were on a level with Harry's. It winked.  Did the snake feel that a Parselmouth was around? Because how else would it have recognized Harry as a Parselmouth as it winked at Harry before he uttered a word.


I installed zram with sudo apt-get install zram-config. After that it started automatically and when I verified with cat /proc/swaps it's running properly  But when I used sudo echo 128M > /sys/block/zram0/disksize to change the zram size like in the  I always get bash: /sys/block/zram0/disksize: permission denied  Even when I turned it off with sudo swapoff /dev/zram0 then changed I still got permission denied  So how can I change the zram size? And is disksize the space it consumes on RAM or just the maximum zram disk size?


Fillfactor is ignored when non-clustered index added

I have a test scenario where I have added fill-factor = 90 to a clustered index over a random generated GUID primary key.   If I create the table without fill-factor = 90 then the number of page splits is initially 31 for 3974 rows and splits occur with every subsequent insert. When I include the fill-factor = 90 the number of splits on population rises to 35 but splits stop happening with every subsequent insert. All good so far!   The problem is that when I add a non-clustered index although the clustered index still indicates a fill-factor of 90% the initial insert is back to 31 splits and splits are happening again on every subsequent insert indicating that the fill-factor is being ignored.   Does anyone have an idea as to why this might be happening?      /*     scenarios:     1. Create table #Test02 without fillfactor, populate and observe 37 page splits occured, insert two rows at a time and observe page splits occurring     2. Drop and create table #Test02 with filfactor = 90, populate and observe 40 page splits occurred, insert two rows at a time and observe that page splits do not occurr     3. Drop and create table #Test02 with filfactor = 90, insert two rows then populate, observer 38 page splits occurred, insert two rows at a time and observe page splits occurring     4. Drop and create table #Test02 with filfactor = 90, create index IX_#Test02_ProductName, populate and observe 37 & 35 page splits occurred, insert two rows at a time and observe that page splits occur on PK     5. Rebuild index PK_Test02, insert two rows at a time and observe that page splits do not occurr      Conclusion: On an empty table with a PK FF = 90 SQL preserves the fill factor     */      --non-sequential index table     IF OBJECT_ID('tempdb.dbo.#Test02') IS NOT NULL DROP TABLE #Test02     --CREATE TABLE #Test02(ID uniqueidentifier default newid(), ProductName nvarchar(150), CONSTRAINT PK_Test02 PRIMARY KEY CLUSTERED (ID))      CREATE TABLE #Test02(ID uniqueidentifier default newid(), ProductName nvarchar(150), CONSTRAINT PK_Test02 PRIMARY KEY CLUSTERED (ID) WITH (FILLFACTOR = 90))      --ALTER INDEX PK_Test02 ON #Test02 REBUILD WITH (FILLFACTOR = 90);        IF EXISTS (SELECT * FROM tempdb.sys.indexes WHERE name = N'IX_#Test02_ProductName') DROP INDEX IX_#Test02_ProductName ON #Test02     CREATE INDEX IX_#Test02_ProductName ON #Test02(ProductName)      --populate script     INSERT #Test02(ProductName)     SELECT TOP 4000 COALESCE(O1.name,O2.name)       FROM master.sys.objects O1 CROSS JOIN master.sys.objects O2      --two row insert     INSERT #Test02(ProductName) VALUES(N'Straight Banana'),(N'Bent Banana')      --observe page splits     SELECT ios.index_id          , o.name as object_name          , i.name as index_name          , ios.leaf_allocation_count as page_split_for_index          , ios.nonleaf_allocation_count page_allocation_caused_by_pagesplit          , ios.leaf_insert_count          , i.fill_factor       FROM tempdb.sys.dm_db_index_operational_stats(db_id(N'db_name'), null, null, null) ios       JOIN tempdb.sys.indexes i on ios.index_id = i.index_id AND ios.object_id = i.object_id       JOIN tempdb.sys.objects o on ios.object_id = o.object_id      WHERE o.type_desc = N'user_table'         AND o.name like N'#test02%'


Should it be 'is' or 'are' after a number with a unit?

What would be the right form of to be in the examples below?     Five miles [is/are] a long way to walk.        Preliminary results [is/are] better than no results at all.


I've been trying to prove that the set of all invertible $n \times n$ matrices is a differentiable manifold. My attempt is as follows:  Define a map $\alpha : X \to XX^{-1} - I$ I take the inverse: $\alpha^{-1}(0)$ which would map to the set of invertible $n \times n$ matrices. I believe this suffices to show it is a manifold, but I am stumped in finding it's dimension. How can I approach this?


Understanding slice indexing without exception

I do not quite understand why a slice of a list does not throw an exception, when the low index is larger than the length of the list. Instead an empty list is returned.  >> [1, 2, 3][1000:] []   Why is this?


A Variation of the even-town odd-town problem

Let assume facebook has $n$ users. Mark Zuckerberg decided that people are allowed to open groups under the following restrictions:      1) No two different groups can exactly the same participants.      2) The number of users in each group is even.      3) Every two group has an odd number of common users.      Denote by $m$ the maximal number of groups that can be formed in facebook under the restrictions mentioned above. Prove $m \leq n$.   I tried solving this by defined a matrix, multiplying it by its transpose and using some rank considerations I thought I could derive the bound, but I didn't succeed. Could you please give me a hint?  The question had anther subsection : prove that in the case that $n$ is even than we have stron inequality


Overall reputation scores are headed nowhere but up.  Pretty soon there will be thousands of mods.  What to do?  Thoughts on possibilities:   Thousands of mods is fine.  Carry on. Adjust the threshold values for high-level SO privileges. Do a straight-up inflation adjustment.  You had x rep, then at the turn of the year we applied the Consumer Rep Index to all scores, now you have (x / inflation) rep. Implement a rep decay mechanism, so that inactivity sheds some of the overall rep that's built up.


Identifying the group $G = \langle x,y \space | \space xy=yx, x^4=y^2 \rangle$ from the given presentation

I'm trying to solve a problem in my textbook which asks me to identify the groups $G_1 = \langle x,y \space | \space x^3y=y^2x^2=x^2y\rangle$ and $G_2 = \langle x,y \space | \space xy=yx, x^4=y^2 \rangle$ from the given presentations.  For $G_1$, I'm pretty sure I can say that $x^3y=x^2y \implies x^3y(x^2y)^{-1} = e \implies x = e$ (where $e$ is the identity), and then $x^3y=y^2x^2 \implies y = y^2$ as $x=e$ to get $G_1 = \langle x,y \space | \space x=y=e \rangle \cong \{e\}$ (though I'd appreciate it if you could tell me if I have this wrong).  What I'm struggling with is trying to do the same sort of thing for $G_2$ - I can't see any way of getting this into a form where I can see the represented group.  I'd appreciate any help you could offer.


Earth-Centered Inertial (ECI) reference frame as approximate inertial frame of reference

In many practical applications, one can consider the Earth-Centered Inertial () reference frame approximately as an inertial reference system, though strictly speaking, it is non-inertial.   Is there any quotable reference, where this claim is supported by a detailed estimation how small the effects are that one neglects if one considers the Earth's frame as inertial?


Tikz how to extract spherical coordinates

I have X coordinate defined in Spherical coordinate system (the point is to be situated on the circle so it's easier):  \def\Sx{0} \def\Sy{0} \def\Sz{2} \pgfmathsetmacro\Sρ{"sqrt((\Sx)^(2)+(\Sy)^(2)+(\Sz)^(2))"} \pgfmathsetmacro\Sθ{ifthenelse(\Sx==0&&\Sy==0&&\Sz==0,0,"acos(\Sz/(sqrt((\Sx)^(2)+(\Sy)^(2)+(\Sz)^(2))))")} \pgfmathsetmacro\SΦ{ifthenelse(\Sx==0&&\Sy==0,0,ifthenelse(\Sy<0,"-acos(\Sx/(sqrt((\Sx)^(2)+(\Sy)^(2))))","acos(\Sx/(sqrt((\Sx)^(2)+(\Sy)^(2))))"))} \tdplotsetcoord{S}{\Sρ}{\Sθ}{\SΦ} \coordinate (X) at ($(S)+(xyz spherical cs:radius=2,longitude=-40,latitude=0)$);   However X coordinate defined this way cannot be extracted into x,y,z components:  % calc library     \newdimen\Xx \pgfextractx{\Xx}{\pgfpointanchor{X}{center}} % this doesn't work for me   How can be coordinate defined in Spherical coord. system and then extracted into x,y,z or ρ,θ,Φ? Thanks.


404 when trying to login on per-site metas

How to reproduce:  Wander aimlessly into some meta site (either, logged on some other site or not logged at all) Try to upvote/downvote/do something that requires you to be logged in (this will trigger the login or create an account) Click any login option ... ....  What happens? You get a . What this silly user thinks should happen? Either, allow me to login or do not show me the box to login in the first place. Impact? All per-site metas.


Can someone explain this method declaration syntax for me?  In this function, the number of rows of a UIPickerView (slot machine UI on the iPhone) is being returned.  From my understanding, the Method is called 'pickerView', and returns an NSInteger.    It passes in a pointer to the UIPickerview called 'pickerView' ... first, why is the method called the same name as the parameter?    Next there is NSInteger parameter called component that tells us which component we are counting the rows for.  The logic to decide which is in the body of the method.    What is 'numberOfRowsInComponent? It seems to describe the value we are returning, but it is in the middle of the parameters.    - (NSInteger) pickerView:(UIPickerView *)pickerView   numberOfRowsInComponent:(NSInteger)component {     if (component == kStateComponent)         return [self.states count];      return[self.zips count]; }


Rings with decomposition are sums of ideals generated by idempotents

I'm working on a question out of T.Y. Lam's book that has me thrown. Let $B_1 \dots, B_n$ be left ideals (resp. ideals) in a ring $R$. Show that $R=B_1 \oplus \dots \oplus B_n$ iff there exists idempotents (resp. central idempotent) $e_1, \dots ,e_n$ with sum 1 such that $e_ie_j=0$ whenever $i \neq j$, and $B_i=R e_i$ for all $i$. In the case where the $B_i$'s are ideals, if $R=B_1 \oplus \dots \oplus B_n$, then each $B_i$ is a ring with identity $e_i$, and we have an isomorphism between $R$ and the direct product of rings $B_1 \times \dots \times B_n$. Show that any isomorphism of $R$ with a finite direct product of rings arises in this was. Attempt Supposing we have such idempotents there is an obvious map $R \to \oplus Re_i$ since $r=r \cdot 1=r \sum e_i$. Hence, $r \mapsto r \sum e_i$. This map is easily shown to be bijective, however, demonstrating that this is a homomorphism seems to be problematic. Consider $$r_1r_2 \mapsto r_1r_2(\sum e_i) \text{ but } r_1(\sum e_i)r_2(\sum e_i) \neq r_1r_2 \sum e_i???$$ so perhaps this isn't the correct map? Conversely, supposing we have such a decomposition then clearly $1=\sum b_i$ so let $e_i = b_i$. I'm guessing the fact that 1 is trivially an idempotent will show that the $e_i$ are but I'm stuck there. We have $$1=1^2=(\sum e_i)^2$$ and similar to the above the map $r=r*1=r\sum e_i$ jumps out at me.


I am new to Android Programming and i am following some tutorial and the tutorial is 1 year ago. i am stuck with this error i think the problem is related to the database but i dont know anything yet about android. PID: 23165     java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.database.DatabaseReference com.google.firebase.database.DatabaseReference.child(java.lang.String)' on a null object reference         at com.example.fooddeliver.MainActivity.checkUserFromFirebase(MainActivity.java:101)         at com.example.fooddeliver.MainActivity.lambda$init$0$MainActivity(MainActivity.java:83)         at com.example.fooddeliver.-$$Lambda$MainActivity$9ehXip3aW7uFlecdkbtLT68AicY.onAuthStateChanged(Unknown Source:2)         at com.google.firebase.auth.zzj.run(com.google.firebase:firebase-auth@@19.3.1:2)         at android.os.Handler.handleCallback(Handler.java:938)         at android.os.Handler.dispatchMessage(Handler.java:99)         at com.google.android.gms.internal.firebase_auth.zzj.dispatchMessage(com.google.firebase:firebase-auth@@19.3.1:6)         at android.os.Looper.loop(Looper.java:223)         at android.app.ActivityThread.main(ActivityThread.java:7656)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) I/Process: Sending signal. PID: 23165 SIG: 9  my code is this. Update i put my init because i dont know how to initialize userRef sorry for the newbie post     private void init() {         providers = Arrays.asList(new AuthUI.IdpConfig.PhoneBuilder().build());          firebaseAuth = FirebaseAuth.getInstance();          dialog = new SpotsDialog.Builder().setCancelable(false).setContext(this).build();         cloudFunctions = RetrofitCloudClient.getInstance().create(ICloudFunctions.class);         listener = firebaseAuth -> {             FirebaseUser user = firebaseAuth.getCurrentUser();             if(user != null)             {                 checkUserFromFirebase(user);             }             else             {                 phoneLogin();             }         };     }  private void checkUserFromFirebase(FirebaseUser user) {         dialog.show();         userRef.child(user.getUid())                 .addListenerForSingleValueEvent(new ValueEventListener() {                     @Override                     public void onDataChange(@NonNull DataSnapshot snapshot) {                         if(snapshot.exists())                         {                             Toast.makeText(MainActivity.this, "You are Already Registered", Toast.LENGTH_SHORT).show();                              UserModel userModel = snapshot.getValue(UserModel.class);                              goToHomeActivity(userModel);                         }                         else                         {                             showRegisterDialog(user);                         }                          dialog.dismiss();                     }                      @Override                     public void onCancelled(@NonNull DatabaseError error) {                         dialog.dismiss();                         Toast.makeText(MainActivity.this, ""+error.getMessage(), Toast.LENGTH_SHORT).show();                     }                 });     }


Example of a set which is not well ordered

Give an example for a linear ordered set $\langle A, ≺_A\rangle$, such that $\langle {^2}A,≺\rangle$ is not well ordered where $$f ≺ g ↔ (∃a ∈ A)[(∀b ∈ A)(b <_A a ⇒ f(b) = g(b)) \text{ and } f(a) < g(a)].$$ My attempt: We know that $\langle A, ≤_A\rangle$ is well ordered if for every nonempty $b$ in $A$, $b$ has a minimal element with regard to $≤_A$. Hence we have to show the contrary for $\langle A2,≤\rangle$. This $A2$ (if I am not mistaking the notation) is actually $P(A)$. However I am not sure whether I should check for another element in $P(A)$, so I am stuck on this problem. Any Help is welcome.


How to redirect links in email template to salesforce1 app

With the new salesforce1 app which looks cool, i am currently not able to click a record link and open the record in salesforce1. I am using Ipad and set all the salesforce1 setting from the salesforce1 documentation:  "For the mobile browser app, from Setup, click Mobile Administration > Salesforce1. Select Enable the Salesforce mobile browser app to turn on automatic redirection to the mobile browser app whenever a user logs into Salesforce using a supported mobile browser."  But when i click a link its still going into the safari browser and not the Salesforce1 app. Is there something missing? thanks a lot.


Why isn't my code working beyond printing the math.random?

I'm a new programmer and trying to teach myself Java by doing random projects. Below is a "Rock, Paper, Scissors" game and the issue that I'm facing is after printing "a", the program ends and does not continue onto the if else statements below. Any help that can be given would be greatly appreciated.  package com.company;  import java.util.Scanner;  public class Main {      public static void main(String[] args) {          System.out.println("Hello & Welcome to Rock, Paper, Scissors. What's your name?");         Scanner scan = new Scanner(System.in);         String userChoice = scan.nextLine();         System.out.println("Hello, " + userChoice + ". Let's start a game!");         Scanner scan = new Scanner(System.in);         System.out.println("Choose one: Rock, Paper, Scissors");         String userFirstChoice = scan.nextLine();         System.out.println("You chose " + userFirstChoice);          double a = Math.random();         System.out.println(a);            if (a >= 0.00 && a<= 0.3){             if ( userFirstChoice== "Rock"){                 System.out.println("Rock vs Rock: TIE");             }             else if (userFirstChoice == "Paper"){                 System.out.println("Rock vs Paper: YOU LOSE!");             }             else if (userFirstChoice == "Scissors"){                 System.out.println("Rock vs Scissors: YOU WIN!");             }          }         else if (a>=0.3 && a<=0.6){             if(userFirstChoice == "Paper"){                 System.out.println("Paper vs Paper: TIE!");             }             else if (userFirstChoice == "Rock"){                 System.out.println("Rock vs Paper: YOU LOSE!");             }             else if(userFirstChoice == "Scissors"){                 System.out.println("Scissors vs Paper: YOU WIN!");             }          }         else if (userFirstChoice == "Scissors"){             System.out.println("Scissors vs Scissors: TIE!");         }         else if (userFirstChoice == "Paper"){             System.out.println("Paper vs Scissors: YOU LOSE!");         }         else if (userFirstChoice == "Rock") {              System.out.println("Rock vs Scissors: YOU WIN!");         }      }   }


Which of these files are safe to delete to free space in /boot? For future needs, how can I know which files are in use and which ones are obsolete?  root@ubu:/boot# ls -l total 153003 -rw-r--r-- 1 root root  1162712 ago 13 18:45 abi-3.13.0-34-generic -rw-r--r-- 1 root root  1163858 ago 15 04:56 abi-3.13.0-35-generic -rw-r--r-- 1 root root  1164509 nov 13 19:30 abi-3.13.0-40-generic -rw-r--r-- 1 root root  1164720 dic  8 21:28 abi-3.13.0-43-generic -rw-r--r-- 1 root root   165611 ago 13 18:45 config-3.13.0-34-generic -rw-r--r-- 1 root root   165652 ago 15 04:56 config-3.13.0-35-generic -rw-r--r-- 1 root root   165745 nov 13 19:30 config-3.13.0-40-generic -rw-r--r-- 1 root root   165745 dic  8 21:28 config-3.13.0-43-generic drwxr-xr-x 5 root root     1024 dic 12 11:53 grub -rw-r--r-- 1 root root 28321722 ago 20 08:49 initrd.img-3.13.0-34-generic -rw-r--r-- 1 root root 28332451 nov 16 22:45 initrd.img-3.13.0-35-generic -rw-r--r-- 1 root root 28350706 dic  2 10:47 initrd.img-3.13.0-40-generic -rw-r--r-- 1 root root 28386822 dic 12 11:53 initrd.img-3.13.0-43-generic drwx------ 2 root root    12288 jul 21 12:21 lost+found -rw-r--r-- 1 root root   176500 mar 12  2014 memtest86+.bin -rw-r--r-- 1 root root   178176 mar 12  2014 memtest86+.elf -rw-r--r-- 1 root root   178680 mar 12  2014 memtest86+_multiboot.bin -rw------- 1 root root  3381262 ago 13 18:45 System.map-3.13.0-34-generic -rw------- 1 root root  3386444 ago 15 04:56 System.map-3.13.0-35-generic -rw------- 1 root root  3387231 nov 13 19:30 System.map-3.13.0-40-generic -rw------- 1 root root  3388760 dic  8 21:28 System.map-3.13.0-43-generic -rw------- 1 root root  5797728 ago 13 18:45 vmlinuz-3.13.0-34-generic -rw------- 1 root root  5806368 ago 15 04:56 vmlinuz-3.13.0-35-generic -rw------- 1 root root  5808960 nov 13 19:30 vmlinuz-3.13.0-40-generic -rw------- 1 root root  5814080 dic  8 21:28 vmlinuz-3.13.0-43-generic


Ambiguous definition of the set of Natural Number

According to the book "An introduction to the analysis of algorithms (written by Michael Soltys)", the author says in chapter 1 as follows.     Let $\mathbb N = \{0, 1, 2,...\}$ be the set of natural numbers. Suppose that $S$ is a subset of $N $ with the following the two properties: first $0 \in S$, and second, whenever $n\in S$, then $n+1\in S$ as well. Then, invoking the Induction Principle(IP) we can conclude that $S=\mathbb N$.   I am wondering if it is fine to define the set of natural numbers like the author. Why the author put the number $0$ into the set of natural number $\mathbb N$?


If $a$ and $b$ on a UFD don't have any associated irreducible factors, then $1\in GCD(a,b)$

Let $a = p_1\cdots p_n$ and $b = q_1\cdots q_m$ be two non-zero elements of a unique factorization domain $R$ and their respective factorization in irreducible factors, such that no $p_i$ is associated with a $q_j$ (i.e., $\nexists k\in R^*:p_i=kq_j$). Let $GCD(a,b)$ be the set of all greatest common divisors of $a$ and $b$ in $R$. Then I want to conclude that $1_R\in GCD(a,b)$ Once $1_R$ divides all elements of $R$, it's equivalent to show that if $d$ is a common divisor of $a$ and $b$, then $d$ divides $1_R$, which is equivalent to $d$ be an unity element, or that $d$ is associated with $1_R$. In any if these ways I don't see how to use the hypothesis that $a$ and $b$ don't have associated irreducible factors. Can someone give me a hint on this?


Automatically add ProductB once ProductA is manually added to the opportunity

I have been trying to get this trigger to work and it has been impossible... ugh... maybe you guys can help me.  I have created the following trigge with the help of some freinds under "Opporunity Products" triggers. The issue is that the second product is not being added automatically to the opportunity once the first product is added manually. I don't understand why it is not working. Can you guys help me please?  trigger Attempt1 on OpportunityLineItem (after insert) {     List<OpportunityLineItem> OpportunityLineItems = new List<OpportunityLineItem>();  for(OpportunityLineItem item: [    SELECT OpportunityId, Name     FROM OpportunityLineItem    WHERE Id = :Trigger.new AND Name = 'Car_Filter_Plus']) {         OpportunityLineItems.add(new OpportunityLineItem(             OpportunityId = item.OpportunityId,              PricebookEntryId ='01eE000000QopleIAD',             Quantity = 1,             UnitPrice = 25)         ); } }


Trying to run Jekyll on a Google Compute Engine VM instance. It runs a server on port 4000. I have created a firewall rule to allow incoming traffic from this port, but all my connections get refused for some reason. What else should I be looking at?


I have a confusing issue, I delivered the logo to the client with the standard sizes for social media applications (link to the page I took sizes from  ), but he came back and told me that FB size which is 200px*200px looks blurry. I tried it myself and it looked blurry too. Now my question is: are those sizes in this link(In other links too all over the internet) wrong, or there is something that I don't understand?. And if they are correct then why the logo looks blurry? (it looks blurry on all social media sizes). should I only deliver 5000px*5000px version instead of these sizes? (because I tried it and it's very good on all social media apps).


python: Piping a value through an if/elif statement

I have a function that can return one of three values: a, b, or c.   def f():     return x # a, b, or c   I need to execute different statements based on the return value of f(): A, B, or C. The best way to do this, that I know of, is:  v = f() if v == a:     # Do A elif v == b:     # Do B else:     # Do C   Without introducing this new variable v, is there a different way to evaluate the return value of f()? Something like this, maybe?  if f() == a:     # Do A elif _value_from_above == b:     # Do B else:     # Do C


Let $N$ be a subgroup of a group $G$. Suppose that, for each $a$ in $G$, there exists $a, b$ in $G$ such that $Na=bN$. Prove that $N$ is a normal subgroup.   Attack: I found $b^{-1}N$ = $Na^{-1}$ but I am stuck!  Any help will be appreciated


How can I view hidden files in the Finder?

I noticed that whenever I add files and delete them, their physical space remains on the disk drive. I uninstalled NTFS Tuxera and I still have the same problem.  So I had to insert the disk under my other Windows laptop to locate the ./#### files and delete them. I was surprised that I couldn't locate those files in Finder, but windows allowed me to view them.  Is there a way to have more control over what files are viewed in Finder?  Platform: retina MacBook Pro, Mountain Lion (OS X 10.8)


I am looking for the definition of when I am allowed to do forward declaration of a class in another class's header file:  Am I allowed to do it for a base class, for a class held as a member, for a class passed to member function by reference, etc. ?


I will be travelling to Sydney and just wanted to know about the tipping etiquette in Sydney.   I have read somewhere that the Service tax is already included in the price and there is no need to tip. Also, in countries like US (NYC specifically), bartenders/waiters are paid minimum wage and therefore there is a culture of paying tips. Is it similar in Sydney?  Is it required to tip the taxi drivers?


Not using the definite article for "baby"

In the British show Call The Midwife, which is a show about midwifery, a lot of the dialogue is about babies. Whenever someone refers to a specific baby, they never use the definite article. So "That's not good for baby" rather than "That's not good for the baby". "I'll ask the doctor to listen to baby's heartbeat" rather than "I'll ask the doctor to listen to the baby's heartbeat". I notice they use the definitive article for everything else ("the doctor", "the children", "the hospital", "the midwife") but never for "baby".   What is the reasoning for this? Is this an archaic thing (the show is set in the 50's-60's), a British thing, a medical thing?


Can a frame of reference travel with the speed of light?

I read that nothing with mass can travel at the speed of light. Therefor one can not ask what happens when an observer in a car moves with the speed of light. But, is it possible for a frame of reference to move with the speed of light? Is there something preventing that?


I have a problem on my code on java, I want to pass the array pin on my thread class and give it's elements at my second array pinakas, which pinakas is private array of the class kk. I want my threads to use pinakas.I have to write pinakas length at first, but i don't know how big it is, because it is as big as pin (user gives pin's length). What should i do??   Hi, this is my code:   `import java.util.Random;   import java.util.Scanner;     class kk extends Thread{     int[] pinakas;     int opt,T1,T2,T3;     int T4[] = new int[3];     Random ar = new Random();`      public kk(int[] pin,int option) {         for(int i=0; i<pin.length;i++) pinakas[i] = pin[i];         opt = option;     }      public void run () {         try {         if (opt==1) {             T1=0;             for(int i=0;i<pinakas.length;i++) T1 += pinakas[i];             System.out.println("thread 1 runned");         }         else if(opt==2) {             T2=0;             for(int i=0;i<pinakas.length;i++) T2 *= pinakas[i];             System.out.println("thread2 runned");         }         else if(opt==3){             System.out.println("thread3 runned");             T3 = ar.nextInt(1000 + 1 -(-1000)) -1000;         }         else {             System.out.println("thread4 runned");             int max=T1;             if(max<T2) max=T2;             if(max<T3) max=T3;             T4[0] = max;             int min=T1;             if(min>T2) min= T2;             if(min>T3) min= T3;             T4[2]= min;             if(max==T1 && min==T2) T4[1]=T3;             if(max==T1 && min==T3) T4[1]=T2;             if(max==T2 && min==T1) T4[1]=T3;             if(max==T2 && min==T3) T4[1]=T1;             if(max==T3 && min==T1) T4[1]=T2;             if(max==T3 && min==T2) T4[1]=T1;         }         }         catch(Exception e) {             System.out.println(e);         }      }    }  public class klasi {      public static void main(String[] args) {         System.out.println("Give me the length of array: ");         Scanner In = new Scanner(System.in);         int p = In.nextInt();         In.close();         int pin[] = new int[p];         Random ar = new Random();         for(int i=0;i<p;i++) pin[i] = ar.nextInt(1000 + 1 - (-1000)) -1000;         Thread t1 = new Thread(new kk(pin,1));          Thread t2 = new Thread(new kk(pin,2));         Thread t3 = new Thread(new kk(pin,3));         Thread t4 = new Thread(new kk(pin,4));          t1.start();         t2.start();         t3.start();         t4.start();     }   }  When i am running it i have two errors, both of them are: java.lang.NullPointerException, when threads 1 and 2 are running.   The only possibility to work is:  int[] pinakas = new int[5];   and user must give the number 5 as the length of array pin.


Replace SSD without unplugging laptop battery

Is it normally safe to replace a laptop SSD without unplugging the battery?  I wish to replace the SSD on my Samsung NP900XCE, which required me to remove the entire back panel. So far so good, but unfortunately I failed to remove three of the screws holding the battery in place. The heads (Philips) got a bit damaged by my attempt.  I did manage to remove the screws holding the mSata SSD in place, so physically I can replace it, but I'm afraid of damaging the motherboard or SSD if I replace the SSD with the battery still attached. I suspect that the laptop is never completely turned off while the battery is still attached. One indication of this is that the charge level of the battery drops with about 5 % per week even when I'm not using the laptop at all. I'm not using sleep mode or anything, but the laptop is really fast at booting.  There is a small button on the battry for "Emergency cutoff" of the battery power, in case water is spilled on the laptop. But the manual says:  "Do not cut the battery power under normal conditions. This may result in data loss or a product malfunction."  Supposedly, "if you connect the AC adapter, the battery power will be supplied again", but I'm not to keen on testing if it works...


Calculate the limit : $\lim_{x \to 0}\frac{x-\sin{x}}{x^3}$ WITHOUT using L'Hopital's rule

I was given a task to find  $$\lim_{x\to0}\frac{x-\sin{x}}{x^3}$$ at my school today. I thought it was an easy problem and started differentiating denominator and numerator to calculate the limit but the teacher then said we aren't allowed to use  L'Hopital's rule, but to "play around" with known limits and limit definition. I got stuck here since I can't really think of a way to do this, and according to my teacher, there are at least 4 ways. A subtle hint would be enough. Thanks.


Where to put my professional (academic) personal page after my PhD

I am a PhD student, and the defense of my thesis is at the end of this year. During my PhD, I had an institution server account to put my page. However, it is closed (I finished my PhD longer than the expected time).  Although it looks like difficult, I still want to try to obtain post-doc position. During several months (or even one year) after I graduate, I don't know where to put my personal/professional page, which should be good for applying the job.  I found there are some personal website provider (e.g. wix.com), however after a quick look on the templates, the styles not seem very academic professional.  Do you have any idea what should I do to create my page during this time?


How to fix NullPointerException in For Loop

So I am sort of new to Java and have only been doing it for a couple of months. I'm trying to implement different types of sorting algorithms and I think everything is okay except when I run it I get a NullPointerException on the for loop. I have already read this post . But I still can not figure out how to fix the problem even though I think it is quite simple. Any help?  import java.lang.*; import java.util.*;  public class SortApp {      public int[] generateRandomArray(int size) {          int[] output = new int[size];         for (int i = 0; i < size; i++) {             output[i] = (int) (Math.random() * Integer.MAX_VALUE);         }         return output;     }      public void printArray(int[] inarray) {          for (int i = 0; i < inarray.length; i++) {             System.out.println(inarray[i]);         }     }      public boolean isSorted(int[] inarray) {         for (int i = 0; i < inarray.length; i++) {       //Error here             if (inarray[i] > inarray[i + 1]) {                 return false;             }         }         return true;     }      public int[] insertionSort(int[] inarray) {          int[] data = Arrays.copyOf(inarray, inarray.length);         int temp;         int j;         for (int i = 0; i < inarray.length; i++) {             temp = inarray[i];             for (j = 0; (j > 1) && (temp < inarray[j - 1]); j--)                 inarray[j] = inarray[j - 1];             inarray[j] = temp;         }         return data;     }      public int[] selectionSort(int[] inarray) {          int[] data = Arrays.copyOf(inarray, inarray.length);         int temp;         int n = inarray.length;         for (int i = 0; i < inarray.length; i++) {             int k = i;             for (int j = i + 1; j < n; j++)                 if (inarray[j] < inarray[k])                     k = j;             temp = inarray[i];             inarray[i] = inarray[k];             inarray[k] = temp;         }         return data;     }      public int[] mergeSort(int[] inarray, int temp[], int l, int r) {          int[] data = Arrays.copyOf(inarray, inarray.length);          if (l == r) return null;         int mid = (l + r) / 2;         mergeSort(inarray, temp, l, mid);         mergeSort(inarray, temp, mid + 1, r);          int i, j, k;         for (i = l; i <= r; i++)             temp[i] = inarray[i];         for (i = l, j = mid + 1, k = l; i <= mid && j <= r && k <= r; k++)             if (temp[i] < temp[j]) inarray[k] = temp[i];         i++;         inarray[k] = temp[j];         j++;         for (; i <= mid; i++, k++)             inarray[k] = temp[i];         for (; j <= r; j++, k++)             inarray[k] = temp[j];          return data;     }      public static void main(String[] args) {         SortApp myApp = new SortApp();         int[] data = myApp.generateRandomArray(10);          boolean isSortedA = myApp.isSorted(myApp.insertionSort(data));         boolean isSortedB = myApp.isSorted(myApp.selectionSort(data));         boolean isSortedC = myApp.isSorted(myApp.mergeSort(data, data, 0, 0)); //Error here         myApp.printArray(data);     } }   Error I am getting is this:  Exception in thread "main" java.lang.NullPointerException at SortApp.isSorted(SortApp.java:23) at SortApp.main(SortApp.java:91)


Error 8024402C immediately after installing Windows from scratch and updating

I just installed Windows 7.1 (SW_DVD5_Win_Pro_N_7w_SP1_32BIT_English_-2_MLF_X17-59635.ISO) in a VirtualBox (Linux host) with a stable Internet connection.  Then I opened Windows Update, and let it install all of the updates it wanted, starting with a Windows Update update. It asked me to reboot, so I rebooted, and then opened Windows Update again, and it had a few more updates, then reboot again, etc, about 5~10 times.  Problem: Now it is showing me this:    I really only performed the steps above, I did not run any program except Windows Update, and in particular I installed no firewall or antivirus or anything.  What is the problem, and how to solve it?


JS replacing all occurrences of string using variable

I know that str.replace(/x/g, "y")replaces all x's in the string but I want to do this  function name(str,replaceWhat,replaceTo){     str.replace(/replaceWhat/g,replaceTo); }   How can i use a variable in the first argument?


How to show $ \left(\frac{1-x}{2}\right)^p+\left(\frac{1+x}{2}\right)^p \leq \frac{1+x^p}{2}$

When $p\geq 2$ and $0\leq x\leq1$, how does one show the inequalities $$ \left(\frac{1-x}{2}\right)^p+\left(\frac{1+x}{2}\right)^p \leq \frac{1+x^p}{2}$$ and $$ 2(1+x^p)\leq (1+x)^p + (1-x)^p \ ?$$   The first one looks like a correction of the parallelogram law for powers greater than $p=2$, I've tried using that and rearranging but it hasn't worked. I've also tried differentiating but then I don't know how to handle the new expressions.  This is from a qualification exam on analysis. Basically the problem becomes trivial if one shows the inequalities.  Thank you!


I run 14.04 on my main PC and 12.04 on my old PC ( built 2003 ). My old PC runs OK on 12.04. If I load 14.04 it runs so slow it cannot be used. The main PC is OK using 14.04.  Specs are:  Main PC:   3.9gb ram Pentium(R) dual core CPU E5300 @ 2.60 GHz x 2 graphics Gallium 0.4 on NV98 32 bit Disk 74.4 GB   Old PC:   1.5gb ram AMD Athlon(tm) XP 1600+ Graphics unknown 32 bit Disk 18.0 GB   Any ideas what the problem is and what I should do?


I have JSON which looks like this:  {   "item1": {     "category": "fruit",    },  "item2": {     "category": "fruit",    } }   How can I count the no. of items inside this?


Trouble Understanding this Combinatorics Problem

Problem:  There are 2 girls and 7 boys in a chess club. A team of four persons must be chosen for a tournament, and there must be at least 1 girl on the team. In how many ways can this be done?  Now,the solution suggested by the book is C(7,2)+2xC(7,3)=91 ,Which I understand,But I don't understand why my answer which is C(2,1)xC(8,3) is wrong. Because after choosing 1 girl,There are no more rules,So we should just choose 3 more people.


I have heard that using the newer <strong> tag as opposed to <b> creates an ability for some devices to make text "strong" that was already bolded-as in the case of a palm pilot, where it would be underlined if you used <strong>.   I have also heard that older browsers cannot recognize <strong> and <em> and just ignore them, but newer browsers recognize both the old and new tags, making it an advantage to use the older tags if your users/viewers might have old browsers-however some newer devices benefit from the newer tag (like the <strong> vs <b>).   So I was wondering-how does the <em> tag show up on, say, a palm pilot, or similar devices?  What is the advantage and disadvantage of using <em> vs <i>? Or vice-versa?   ~Added after comments and marked as "duplicate"~  Since this seems to some to be a duplicate question, but I can't find my answer, I will rephrase:   What would happen to text in a browser that did not recognize the < i > tag if you used that instead of the < em > tag? How would it appear?  Is there any advantage to using the < i > tag that now appears to be less "correct" to use then the < em > tag? For instance-some devices might recognize it but not the other? Or would it be pretty much obsolete and useless?


Might be a waste of time, but  how do I debug excess space that appears in resulting pdf?  ,  the file might be able to be shortened but I found the spacing is really pronounced if I leave it long To be clear I would like the algorithm to appear where it does (relative to everything else) but would like spacing to  follow the standard put everything right afterwards unless it's a float that doesn't fit in which case move it to the next page.


What level is the value `ulimit -n`mean? user level or process level?

I want to increase the ulimit -n value,so I add   *       soft  nofile  20000 *       hard  nofile  20000   in the /etc/security/limits.conf file, but there is a question confuse me all the time. what level is the value ulimit -n mean? user level or process level? Specifically speaking, if the value of ulimit -n is 512, and user testUser hava 3 process, does it means testUser can have the total file descriptors for 512 sum up for all his 3 process, or does it means each of testUser's process can have 512 file descriptors and thus testUser can hava a total file descriptors amount of 512*3?


How to get minutes interval of two dates PHP 5.2?

$curr_date = date('2015-01-28 14:23:02'); $deadtime= date('2015-01-26 15:11:00');   I am in trouble buddies? I have a difficulty in getting the minutes difference of current date to deadtime date. Can you help me with the formula? Thanks in Advance


Linear Algebra: If $A^3 = I$, does $A$ have to be $I$?

So it's been a while since I've taken Linear Algebra, but my friend asked me a question, that I couldn't answer.  If a matrix $A$ exists such that $A^3 = I$, does $A$ have to equal the identity matrix $I$?  My first instinct was to say no, but... (edited out my incorrect math)  EDIT: thanks guys for the awesome examples  EDIT2: Followup question: Is there a way to solve for all possibilities of A if given A^3 = I?


Facing difficulties in Cauchy PDF problem from harvard stats 110 book

I have two doubts:  If X and Y are independent then PDF of X/Y is simply PDF of X(by independence) I don't know where am I interpreting wrong, Please correct me. How X/Y and X/|Y| are identically distributed by the symmetry of the standard Normal distribution Even if so How could we say that P(X/Y <= t) = P(X/|Y| <= t). Thank you for your valuable time... :)


how to know when a security update is finished, so that i can run other installing or updating commands?

for example, i ran sudo apt upgrade and i got these errors E: could not get lock /var/lib/dpkg/lock-fronted - open (11: resource temporarily  unavailable) E: unable to acquire the dpkg frontend lock (/var/lib/dpkg/lovk-frontend), is an other process using it?  what should i do?


I have a two-step optimization problem now, which is \begin{equation} \max_{\boldsymbol{x}\in\mathcal{X}}\min_{\boldsymbol{y}\in\mathcal{Y}}f(\boldsymbol{x},\boldsymbol{y}) \;. \end{equation} I am curious under which conditions I can switch the order of $\min$ and $\max$ to \begin{equation} \min_{\boldsymbol{y}\in\mathcal{Y}}\max_{\boldsymbol{x}\in\mathcal{X}}f(\boldsymbol{x},\boldsymbol{y}) \;. \end{equation} Could anybody please refer me to some literature about this topic?  Thanks!


If I leave my chargers plugged into the wall socket at all times, do they consume energy or present a safety risk?

This is something I always wondered about: when I leave my charger plugged on the wall socket but not charging anything, is it still consuming energy?   Some notebook chargers have a led that is always on, so I guess it's consuming at least a bit. But what about Apple chargers? I want to leave my iPhone and iPad chargers always plugged under my desk (so I can just connect my device when I want to charge) but I'm worried they shouldn't be plugged all the time due to safety risks or phantom power consumption.  Is there any way to measure this to be sure?


SQL Server: Creating a user database with permissions

At work, I am tasked with creating a user database.  It needs to account for (end)user permissions for 8 different installed programs.  The database will be hosted by each client containing their specific information behind a firewall.  I have the majority of it built out (tables below), but I don't know how to incorporate permissions.  I could put all available permissions in a table, and then link them to users/groups and applications in another table.  Or I could put all available permissions in a table, then link them to users/groups in another table, and then applications in yet another table.  Problem is that both of these options don't play well with the applications because I cannot think of a way to actually search for a specific permission (ex: call to database to find if user can do 'x') without the programmer hard-coding the permission Ids into the program.  I could have a table per application with each of that application's permissions as a column, but there are 70+ permissions for each application and the tables would get huge (also not very expandable if we need to add more permissions later).  So the end questions is; How do I set up permissions for end-user accounts in a way that the programmer does not have to know and hard-code the Ids into the applications?  Table - Description   Applications - Basically a list of our applications so we have an Id to link the permissions to GlobalSettings - Settings used for all users, mostly password requirments Groups - Lists all end-user administrator defined groups of users (this way a permission can be tied to a group of users at one time) PreviousPasswords - Lists the last x hashed passwords for each user (the ones they can't use again) UnusablePasswords - Lists passwords we won't let our end-users use (such as password1) User_Group_Link - Links a User to a Group Users - Lists all end-users and their needed data (birthday, name, etc)


Are there any benefits to using identical memory modules?

Are there any benefits from running eg. two identical 1G rams over two different, but same-clocked? The motherboard doesn’t support dual-channel operation.


Let R be a commutative ring, and let P be a prime ideal of R. Suppose that P has no nontrivial zero divisors in it. Show that R is an integral domain.   My proof:  Take $r,s,a \in R$ with $ar = as$, and $p \in P$. Then  \begin{align*} par &= pas\\ a p r &= a p s && \text{R is commutative} \end{align*} and since $P$ is an ideal of $R$, then $pr, ps \in P$. Since $P$ is an integral domain, then $a p r = a p s \implies p r = p s$, so $r = s$.  I'm not using the fact that $P$ is a prime ideal which leads me to believe that I messed up a step.


I have a question on determining eigenvalues for a given matrix A:  $$ A=  \begin{bmatrix}  2 & 1 & 2 \\  0 & 2 & -1 \\  0 & 1 & 0 \\  \end{bmatrix} $$  Here's what I have so far:  \begin{align} & det(A-\lambda I_3) = 0\\ & =det \begin{bmatrix}  2-\lambda & 1 & 2 \\  0 & 2-\lambda & -1 \\  0 & 1 & 0-\lambda \\  \end{bmatrix} = 0 \\ & = (2-\lambda) \begin{vmatrix}  2-\lambda & -1 \\  1 & 0-\lambda \\  \end{vmatrix} \\ & = (2-\lambda)(-2\lambda+\lambda^2+1) \\ & = (2-\lambda)(\lambda-1)^2 = 0\end{align}  So my eigenvalues are $2$ and $1$. I am almost postitive this is correct. Here's my confusion/question. I know that the determinant of an upper triangular matrix is the product of the terms along the diagonal.  Some of my classmates used a different approach where from the beginning they row reduced $A$ into an upper triangular matrix by eliminating the $1$ from the $3$rd row, then subtracted $\lambda I$ and then instead of solving the determinant like I did they just multiplied the diagonal terms together.  The problem I see with this is that you can obtain different matrices depending on how you choose to row reduce, which means you can get different eigenvalues. Is it possible to solve for the eigenvalues by using the approach of making $A$ into an upper triangular matrix first? (So that you can solve the determinant by multiplying the diagonal entries) I hope that makes sense. Thanks!


I am trying to find how can I detect with JavaScript if I am in a HTTP or HTTPS environment.  I am calling an Ajax request so if I am in HTTPS and call HTTP Ajax then I get a 302 Moved Temporarily.  I was thinking of getting the current window.location.href and do a string manipulation.  What is the best way of detecting HTTPS using JavaScript?


why should we use final to mark the constructor parameter in enum?

I've seen the question in , and I found that they used final in the constructor parameter, I think it's unnecessary, anyone can tell me why? thanks..


I cut and paste an 80GB worth of files and folders. At about 80% I cancelled it. Are some of the files deleted and gone forever? Does the files that were successfully transferred gets deleted? If yes, can I still recover them?


Is there an official list of Disney Princesses?

Some characters in Disney movies are labelled as Princesses. Is there an official list of these Princesses? Rules to qualify, requirements that must be met?


Where does Eleven's mind go when she is in the sensory-deprivation tank?

Where does Eleven's mind go when she is in the sensory-deprivation tank in Stranger Things? Is it an alternate reality? Or is it a parallel universe? Did she travel time or space?


Widget - unable to load a hot question, check your internet connection

App Version: 1.0.89 Device Manufacturer: LGE Device Model: Nexus 5X OS Version: 7.1.2 (3769476)   I have reinstalled the app, logged in again but the problem remains.


What are the risks / advantages of working with a mainline kernel?

I'm currently on ubuntu 13.04. It's using 3.8 kernel. Is it possible to install 3.11.5 kernel downloaded from the website www.kernel.org  what is the improvement in such new kernel? Is there a easy guide if i need to update?  I'm a newbie. So, please bare if i asked a silly question.


I'm sorry for asking such a simple question but I'm having a hard time thinking about all possible ideals of $M_2(Z)$. So let's consider an arbitrary matrix $\begin{pmatrix} a & b \\ c & d\end{pmatrix}$ where $a,b,c,d \in Z$. How can I start constructing ideals?


Why can't I log-in to meta.*.stackexchange.com without (broken) SSL?

Here are the steps to reproduce this problem:   Be on a device where I am not logged-in to a meta site. Go to the main *.stackexchange.com site - Everything seems to work fine. Go to the meta.*.stackexchange.com site and click log in in the title bar - Page just refreshes without logging in. WTF?   Here is the workaround I have found to work:   Go to main *.stackexchange.com site and click on help=>meta Click through  about the . Log-in works.   I'm not fussy about whether my connection to SE is encrypted.  However, I do care that this problem created a barrier to my participation in meta.*.stackexchange.com.  I cared and knew enough to poke at this thing for five minutes and find a workaround so I could vote on a .  I doubt, however, that this is the case for most users.  It concerns me that participation in meta is being filtered by a technical problem.    I use chrome as my browser, and my google account to authenticate.  The problem exists on both Travel and English se.com on both a Windows 7 and 8.1 machine.     seems similar.  However, the symptoms are different in two ways: In my case no login page is ever presented, and I'm not using OpenID.


How do I know that journal is good apart from the impact factor?

My boss asked me to submit my research to a journal I've never heard of.  How do I know that journal is good for my career apart from the impact factor?  I would like to have my own criteria without just doing whatever my boss says. For example, how the journal is peer-reviewed, time of publication, specific topics, other authors, and how to measure these things just looking at a journal site.