PDO Parameter Binding Not Working on Order By

Just getting started with parameter binding and I've read all through the docs and quite a few questions/answers here, but I can't seem to get this to work.  Simply sorting via get request.  public function getAttributeGroups($data = array()) {     $params = array();     $sql = "         SELECT *          FROM {$this->db->prefix}attribute_group ag          LEFT JOIN {$this->db->prefix}attribute_group_description agd          ON (ag.attribute_group_id = agd.attribute_group_id)          WHERE agd.language_id = '" . (int)$this->config->get('config_language_id') . "'";      $sort_data = array(         'agd.name',         'ag.sort_order'     );        if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {         //$sql .= " ORDER BY " . $data['sort'];         $sql .= " ORDER BY :sort";         $params[':sort'] = $data['sort'];     } else {         $sql .= " ORDER BY agd.name";        }         if (isset($data['order']) && ($data['order'] == 'DESC')) {         $sql .= " DESC";     } else {         $sql .= " ASC";     }      if (isset($data['start']) || isset($data['limit'])) {         if ($data['start'] < 0) {             $data['start'] = 0;         }                         if ($data['limit'] < 1) {             $data['limit'] = 20;         }             $sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit'];     }      $query = $this->db->query($sql, $params);      return $query->rows; }   The quoted line is the original that sorts just fine, but in analyzing the code is open to injections.  The above does execute a query and returns data, but it doesn't sort by the passed in binding.  What am I missing?


How to delete a file that starts with a -?

I accidentally created a file when I meant to pass an option.  Now I have a file named: -myfile that I can not delete with rm -myfile  $ touch hi > -myfile $ rm -myfile  rm: invalid option -- 'm' Try 'rm ./-myfile' to remove the file ‘-myfile’. Try 'rm --help' for more information.


I am currently practicing presenting mathematics to various audiences and am considering the example of the mean value theorem. I was wondering how would I be able to motivate this theorem to a mathematician, to a physicist and to someone who does not have any experience with theoretical mathematics.


Custom Labels in Lightning Component markup, combined in an expression

see the next code example:      <lightning:card iconName="custom:custom33" title="{!notequals(v.aType, 'typeA')? 'This is type B' : 'This is type A'}">       ...       ...     </lightning:card>   Now I want to use Custom Labels for the string literals 'This is type A' and 'This is the A' but when I want to place them in this expression I got an error:   Cannot mix expression and literal string in attribute value, try rewriting like {!'foo' + v.bar}  How do you do this with custom labels?


double click to open file for the second time opens application again

I have a problem when opening files with an application I created.   I implemented a mechanism and changed the registry file like described here:   to open the file with my application. This is working well, however if i have my application running and double click a another file, another instance of my app is getting started. I want the running app to open the double clicked file instead, how can I achieve that?  thanks for you help in advance!


Why python calculate wrong, base arithmetic issue


Can 'Enhance Ability' grant targets advantage on attack rolls?

Enhance Ability (PHB 237) is a 2nd level spell granting either temporary hitpoints or advantage on any one of the 5 core skills (Str,Dex,Int,Wis,Cha).  It has already been answered several times that , like Cat's Grace would bestow from Enhance Ability.  I am wondering now about other types of d20 rolls: namely, can a Wizard gain advantage on spell attacks with Fox's Cunning? A rogue or fighter on their weapon attacks with Bull's Strength and Cat's Grace? A cleric or sorcerer on spells with Eagle's Splendor or Owl's Wisdom?  N.B. I am not concerned about the balance of this, only whether it is permissible based on the rules.


Local hyperlinks broken after PDF processing with Ghostscript

I usually compress my tex PDFs with ghostscript:  pdflatex -shell-escape file.tex  gs -sDEVICE=pdfwrite        \    -dCompatibilityLevel=1.4   \    -dPDFSETTINGS=/prepress      \    -dNOPAUSE -dQUIET -dBATCH      \    -sOutputFile=file_compressed.pdf \     file.pdf   Normally that works well, but if I have relative links to local files, the links don't work afterwards.  Minimal example:  \documentclass{beamer} \usepackage{hyperref}  \begin{document}     \begin{frame}         \href{run:./audio.mp3}{test}     \end{frame} \end{document}   The link works in file.pdf but not in file_compressed.pdf. Is there any pdflatex or ghostscript setting that retains the link in the compressed version?  I use Acrobate Reader 10.1.14 for viewing, Ghostscript 9.10 and pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014) on OS X 10.9.5.    Update: The breakage of hyperlinks had nothing to do with compressing the PDFs. The breakage happened for all re-processing of PDFs containing hyperlinks in its input PDF.


Book I read in the 70's or 80's; I think the title was "The * mask"

The book was a fantasy book about a group of people working together and at the end you discover that they are all crew mates on a spaceship and the life they were living out was really a virtual reality the ship put them in while they were traveling (cryosleep) or something like that.  Does anyone remember that book?


Set program as default for all openable files on mac

Is there a way to set a program as default, for all file types it can open? I know there is a setting for this in windows, but how can I do this on Mac? Or at least a menu where I can toggle all files that can be opened, like you can in windows?  1. Set as default 2. List of files


Add "New" label to post not older than 24 hours

I did not found many results when searching in Google and the items that I found did not help me very much.  How can I add a label "New" to posts that are not older than 24 hours?  Is there a function I can add in my functions.php I can use to manage this?


Most modern method of getting mouse position within a canvas in native JavaScript

First, I know this question has been asked many times. However, the answers provided are not consistent and a variety of methods are used to get the mouse position. A few examples:  Method 1:  canvas.onmousemove = function (event) { // this  object refers to canvas object       Mouse = {         x: event.pageX - this.offsetLeft,         y: event.pageY - this.offsetTop     } }   Method 2:  function getMousePos(canvas, evt) {     var rect = canvas.getBoundingClientRect();     return {         x: evt.clientX - rect.left,         y: evt.clientY - rect.top     }; }   Method 3:  var findPos = function(obj) {     var curleft = curtop = 0;     if (obj.offsetParent) {          do {             curleft += obj.offsetLeft;             curtop += obj.offsetTop;          } while (obj = obj.offsetParent);     }     return { x : curleft, y : curtop }; };   Method 4:  var x; var y; if (e.pageX || e.pageY) {     x = e.pageX;     y = e.pageY; } else {     x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;     y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;  }  x -= gCanvasElement.offsetLeft; y -= gCanvasElement.offsetTop;   and so on.  What I am curious is which method is the most modern in terms of browser support and convenience in getting the mouse position in a canvas. Or is it those kind of things that have marginal impact and any of the above is a good choice? (Yes I realize the codes above are not exactly the same)


A continuous bijection from a compact space to a $T_2$ space is always a homeomorphism

This problem is bugging me for some time.     $f:(X,\mathcal{T}) \to (Y,\mathcal{T}')$ is a continuous bijection where $(X,\mathcal{T})$ is compact and $(Y,\mathcal{T}')$ is $T_2$ (i.e. Hausdorff and $T_1$). Then show that $f$ must be a homeomorphism.   So far I have failed to understand any relation between the compactness of domain and $T_2$-ness of the range. I tried in vain to prove that $f(U)$ is open in $(Y,\mathcal{T}')$ whenever $U$ is so in $(X,\mathcal{T})$. I know $f$ makes $X$ and $Y$ respectively $T_2$ and compact and hence makes both of them $T_4$ spaces. But that is not coming to any use. I would be glad if someone helps me with a solution. Thank you.


How does the Hawking Radiation mechanism cause a black hole to lose its mass?

Correct me if I am wrong: in the  mechanism, when a virtual particle-antiparticle pair gets created at the edge of the black hole, a black hole could sometimes eat up one of the particles before it could annihilate with the other particle, and this causes the other particle to radiate away, and this process causes a loss in the mass of the black hole.  What I don't understand is: if a black-hole also absorbs a particle from the pair, shouldn't the black hole actually be gaining mass? Since the black-hole hasn't lost anything but instead gains a particle?


Fraction of even numbers in decimal expansion of $\pi$ and $e$.

This is just a random thought that came to my mind. What is the fraction of even numbers in decimal expansion of $\pi$ and $e$? Is there any research on this and it’s possible generalisations? Edit: I checked the first 100 digits and found number of even digits in $\pi$ and $e$ to be $50$ and $58$ respectively. Is there any reason we should believe that the fraction should converge to exactly $50$%?


Add or remove locked Unity launcher items from terminal?

I've been building a very thorough script to handle the process of fresh-installing Ubuntu and setting it up just the way I like (as well as adapting it for use at where I work). It's a bash script I run right after install.  One of the last remaining things I haven't figured out how to do with something like gsettings is to control what icons get locked to the launcher. I would like to remove almost all the default icons and only lock icons of my choosing instead.   Any ideas?   Running 14.04.2, pure Ubuntu (not a variant).


Is my code safe if I receive input from GET?

I am creating an app that needs to connect to a MySQL database and do various things. I have created PhP scripts to do all the server-side stuff for me, like connecting to the database and doing CRUD operations. The PhP script will then echo out the results, which is stored in a String in my code for further handling.  However, i am concerned with security. My PhP scripts are open for everyone to use. For instance: "" could be such a script, and what it could do was insert the values in the GET part of the URL into my database.  I know for a fact this isn't safe, but i don't know what to do? The thing is, the PhP script are not linked to/from any where, they are just used in my code only. What i mean by that, is that it is PhP code created to work specifically with my application, so i only ever run them by sending an HTTP request from within the app itself, and i never just run into my browser and type in the address (however, someone else could), which is why i don't think it is very safe.  Any ideas / good suggestions in order to make my scripts safe?  EDIT Here is an example of my code, which i would like to make safe:  $orderGrill = $_GET["getOrder"];     $query = "INSERT INTO grillOrders (`order`, `orderNumber`) VALUES ('{$orderGrill}', {$orderNumber})";   There you can see, how i am just directly using the GET values. But how should i make them safe? I can't use forms since i am running this script from an iPhone app "behind the scenes", so the user can't see the forms.  Thank you


Combinatorial proof for $\sum_{k=0}^p (-1)^k {n \choose k} = (-1)^p {n-1 \choose p}$

I am trying to give a combinatorial proof for: $$\sum_{k=0}^p (-1)^k {n \choose k} = (-1)^p {n-1 \choose p}$$ Where $p$ and $n$ are natural numbers.    We could easily see that if $p=n$ this reduces to the fact that a set has as many subsets of even cardinality, as those with odd cardinality. However, this formula suggests a relation between the even and odd cardinalities less that $p$.  Note: I'm not interested in an algebraic proof, as Pascal's identity gives a telescopic sum on the RHS.       Thank you in advance.


Probabalistic way to calculate limit of a sum

I am following a course on stochastic processes. One question is to Calculate  $$lim_{n\to \infty} \sum^n_{i=0} e^{-n} \frac{n^i}{i!}$$ I see that it looks like the expected value of $e^{-n} \frac{n^{i+1}}{i!}$ but i don't know how to proceed.  I tried to use mathematica but i'm not sure this is correct.     Solve[Integrate[E^(-n) n^(i + 1)/Factorial[i], {n, 0, x}] ==      1/2 Integrate[       E^(-n) n^(i + 1)/Factorial[i], {n, 0, Infinity}] , x, Reals]   Thanks in advance


Arithmetic with Arbitrarily Large Integers in PHP

Ok, so PHP isn't the best language to be dealing with arbitrarily large integers in, considering that it only natively supports 32-bit signed integers. What I'm trying to do though is create a class that could represent an arbitrarily large binary number and be able to perform simple arithmetic operations on two of them (add/subtract/multiply/divide).  My target is dealing with 128-bit integers.  There's a couple of approaches I'm looking at, and problems I see with them. Any input or commentary on what you would choose and how you might go about it would be greatly appreciated.  Approach #1: Create a 128-bit integer class that stores its integer internally as four 32-bit integers. The only problem with this approach is that I'm not sure how to go about handling overflow/underflow issues when manipulating individual chunks of the two operands.  Approach #2: Use the bcmath extension, as this looks like something it was designed to tackle. My only worry in taking this approach is the scale setting of the bcmath extension, because there can't be any rounding errors in my 128-bit integers; they must be precise. I'm also worried about being able to eventually convert the result of the bcmath functions into a binary string (which I'll later need to shove into some mcrypt encryption functions).  Approach #3: Store the numbers as binary strings (probably LSB first). Theoretically I should be able to store integers of any arbitrary size this way. All I would have to do is write the four basic arithmetic functions to perform add/sub/mult/div on two binary strings and produce a binary string result. This is exactly the format I need to hand over to mcrypt as well, so that's an added plus. This is the approach I think has the most promise at the moment, but the one sticking point I've got is that PHP doesn't offer me any way to manipulate the individual bits (that I know of). I believe I'd have to break it up into byte-sized chunks (no pun intended), at which point my questions about handling overflow/underflow from Approach #1 apply.


C# process hanging due to StandardOutput.ReadToEnd() and StandardError.ReadToEnd()

For processes with a lot of output or error, trying to redirect standard output and error with a simple  string output = process.StandardOutput.ReadToEnd(); string err = process.StandardError.ReadToEnd(); process.WaitForExit();   will cause the program to hang, and never actually finish.


Why does not 18.04 LTS have any DSL option?

Why has the option of adding a DSL connection on the tab for Wired Connection been removed after 17.04?  I was using 16.04, and then upgraded to 17.04 and later 17.10, I still had the DSL connection, as it was saved from previous versions.  However, on a fresh install of 17.04, 17.10 or 18.04, I cannot create DSL connections anymore. In my opinion this is a important feature, as many Indian ISPs with many customers still use DSL.  For an average user who has a single device it's easier to create a DSL connection, and put the DSL modem in bridge mode, to avoid hassle of port forwarding.


biblatex instead of natbib in elsarticle, how?

I'm using elsarticle and I would like to apply biblatex for my references but apparantly natbib.sty is loaded by default. In this case how can I use biblatex or how can I disable natbib?   %% natbib.sty is loaded by default. However, natbib options can be %% provided with \biboptions{...} command. Following options are %% valid:  %%   round  -  round parentheses are used (default) %%   square -  square brackets are used   [option] %%   curly  -  curly braces are used      {option} %%   angle  -  angle brackets are used    <option> %%   semicolon  -  multiple citations separated by semi-colon %%   colon  - same as semicolon, an earlier confusion %%   comma  -  separated by comma %%   numbers-  selects numerical citations %%   super  -  numerical citations as superscripts %%   sort   -  sorts multiple citations according to order in ref. list %%   sort&compress   -  like sort, but also compresses numerical citations %%   compress - compresses without sorting %% %% \biboptions{comma,round}  % \biboptions{}  \usepackage[ backend=biber, style=alphabetic, citestyle=authoryear  ]{biblatex}  \addbibresource{references.bib} \begin{document}  bla bla bla  \printbibliography \end{document}   Messages/Log file: Command \bibhang already defined,


Where to find an official copy of Microsoft Windows 7 installer?

I could not get a copy from Digital River the official distribution partner of Windows 7, as it seems to have stopped distributing windows 7. Is there an alternative?  - I have a product key but my hard disk with the bootable Partition has been ruined for some reason.  - There are a lot of Malware infested Windows copies out in the bit-torrent community that are capable of sniffing out my license key and share it with the pirate community.  - The Top google search results take me to getintopc.com which by name sounds fishy. I do not want to shell out even more money for buying a new copy of Windows 7.      How do I get a copy of an uncontaminated Windows 7 recovery disc ?


Can't start a numbered list on a number other than 1

Why can't I start a numbered list on an arbitrary number?  Example:   Some Point   sub point sub point    some explaination pertaining to point 1 above   this should be a 2. not a 1. as I wrote 2. but it changes automatically to 1.   Escaping the dot moves the list too far to the left.  Can we get lists that start on any number?


Remove dynamically created elements even when using ON function

THIS IS NOT A DUPLICATE FOR  as i'm already using the ON function, but it doesn't work :  I'm trying to delete dynamically created elements.  Everytime a user make a search, a tag with the keyword is added containing an X button to delete this tag (it's add to the .tags div) :

      <input type="search" class="searchfield" />       <button class="searchbutton">add tag</button>
   The problem is, when i click on the X button, the on("click" function is never executed! (i never get the alert) :  $( document ).ready(function() {      $(".searchbutton").click(function(){         addTag($(".searchfield").val());     });      $(".removeTag").on("click", function(){         alert("yes");     }); });  function addTag(search) {   $(".tags").append("
" + search + "<button class='removeTag'>X</button>
"); }   Check the demo here  you have to make a search to see the added tag  I use jQuery 1.9.1  Thanks


Recently BBC updated their app with the new Material theme, and it completely ruined the app, I reverted back to the previous version using Titanium backup, and I want to ignore BBC app updates indefinitely for now. Much like Windows ignore update etc. Is there a way to do so in the Play Store?


When the trig functions moved from the right triangle to the unit circle?

I have to write a paper about the unit circle and I'm trying to uncover some of its origins.   Also, when the trig functions were expanded to angles greater than $90^{\circ}$ and what was the rationale behind it? Also, why mirror the right triangle along the axis instead of just moving the base of the right triangle to the next axis $(+x\to+y\to-x\to-y\to+x)$?  I had no luck trying to find that online, and all the books that I looked into would jump right into the practical part of it.


What should I respond when someone ends their sentence with ',no?'

How should I respond when someone ends their sentence with ', no?'. I can see this going two ways:  No  yes:  yes to the no. no:   no to the no.    Example: Q:  your day was good, no? A: No, it was good  or  Yes, I didn't have a good day   Sentence  yes:  yes to the sentence no:   no to the sentence    Example: Q:  your day was good, no? A: yes, it was good  or  no, I had a bad day  (if there was a , I would use it)


Google indexed my domain name, but my entity's name with spaces isn't returned

Working for my client, Google has indexed for some time the index page of my website example.com. If a search is done for "example company" however, Google returns no results. If the search is done for "example", or "example company", or example company 314 (part of the business address), Google returns the index page in search results.   I have also noticed examples identical to mine are returned in searches as the first listing.  My code to text ratio is 38%. My maximum number of keyword repetitions in the body text is 5. My description text contains 4 identical keywords, fences. The title text is good. The site is mobile friendly across the website (I used Bootstrap). Page speed is great for desktop about 90+ and mobile about 75+, per google page speed. GTMetrix gives me a 97 and 91 Yslow. The site is optimized as much as it can be and be functional. I can find no place where I am spamming keywords. I Have no doorway redirects or any other prohibited practice. I have a good sitemap.xml file, my robots.txt isn't blocking anything.   Basically, I can't find anything wrong.  Oh, and a P.S., Bing, Yahoo, plus all the other engines bring up the index page with a standard search using the company name.  P.P.S., My domain was purchased from Google domains, I have a Google+ business page, and Google Analytics. Oddly, Google Analytics claims the index page is at position 9.4. Unbelievable.


Summation index x in (set inclusion) big chi

I am trying to write \sum_{x \in \Chi, y \in \Upsilon} to denote a summation whose index is with small x in big Chi, and small y in big Upsilon (summation over all possible values of two discrete random variables X, Y that take values in big chi and big upsilon). However, writing \Chi right after writing \in causes an undefined control sequence. How could I fix this?  Thank you!


It seems that math in captions gets stretched out as illustrated in Figures 2, 3 and 4:  The problem shows up with pdflatex on the second run. The solution given in  of adding an additional curly brace ${y = mx + b}$ works but wondering if there is a better solution for captions. A bit of stretch in order to justify text would be ok, but in this case that does not seem to be the issue and the stretching seems quite large. References:     Code: \documentclass{article} \usepackage{showframe} \usepackage{graphicx}  \usepackage{caption}  \DeclareCaptionStyle{mystyle}   {format=plain,%     font=footnotesize,     textformat=period,     justification=RaggedRight,     singlelinecheck=true,   }% all captions are left aligned  \DeclareCaptionStyle{singlelinecentered}   [justification=Centering]% centered if single line and no `singlelinecheck=false`   {style=mystyle}% other captions are left aligned  \DeclareCaptionStyle{singlelineraggedleft}   [justification=RaggedLeft]% right aligned if single line and no `singlelinecheck=false`   {style=mystyle}% other captions are left aligned  \captionsetup{style=singlelineraggedleft}  \begin{document} \noindent \begin{minipage}{0.5\linewidth}     \centering     \includegraphics[width=0.95\linewidth, height=2cm]{example-image}%     \captionsetup{width=0.95\linewidth}%     \captionsetup{singlelinecheck=false}%     \captionof{figure}{$y=mx+b$ on Left}% \end{minipage}% \begin{minipage}{0.5\linewidth}     \centering     \includegraphics[width=0.95\linewidth, height=2cm]{example-image}%     \captionsetup{width=0.95\linewidth}%     \captionof{figure}{$y=mx+b$ on Right}% \end{minipage}%  \medskip\noindent \begin{minipage}[t]{0.5\linewidth}     \centering     \includegraphics[width=0.95\linewidth, height=2cm]{example-image}%     \captionsetup{width=0.95\linewidth,style=singlelinecentered}%     \captionof{figure}{$y=mx+b$}% \end{minipage}% \begin{minipage}[t]{0.5\linewidth}     \centering     \includegraphics[width=0.95\linewidth, height=2cm]{example-image}%     \captionsetup{width=0.95\linewidth}%     \captionof{figure}{$y=mx+b$}% \end{minipage}% \end{document}


What do the various dpkg flags like 'ii' 'rc' mean?

I frequently need to check which packages are installed, and I use the following command:  dpkg -l | grep foo  which gives the following output  Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name                       Version         Description ii   foo                       <version>         <description>    What does the ii mean?  What other flags are there? How to read the flags? (because the explanation is quite complicated, IMO)   Thanks.


Is it dangerous to take pictures of the sun without any filter?

I captured this photo a few minutes ago :   The circle you see is the Sun :|. When I was taking this picture, I was in Live-View Mode with F/22 and no UV Filter. You think it's dangerous for my camera?  I've used Canon 60D with Canon 50mm 1.4 Lens


How to prove that $\tan \left( \frac{\pi}{2} - \theta \right) = \cot \theta$

I am asked to simplify the following expression:  $$\tan \left( \frac{\pi}{2} - \theta \right)$$  The book gives me the answer $\cot \theta$ but, when I try to derive that formula using   $$\tan \left( A \pm B \right) = \frac{\tan A \pm \tan B}{1 \mp \tan A \cdot \tan B}$$  I get $\tan \frac{\pi}{2}$ as one of the terms (which is undefined).   $$\tan \left( A \pm B \right) = \frac{\tan A \pm \tan B}{1 \mp \tan A \cdot \tan B} = \frac{\tan \frac{\pi}{2} - \tan \theta}{1 + 0 \cdot \tan \theta}$$  How do I proceed?  Thank you.


C# Exception while iterating through collection of Values of Dictionary of (int Key, Value)

I have a Dictionary of type (int, < T >).  I have a helper method GetAll(); that gets me all the values as IEnumerable< T >.  I sometimes get an exception When I try to use a lambda expression to search for a value, Like this:  myDictionary.GetAll().Where(x => x.Id == myID)   The search condition is valid and it exists.  The exception I get is:  System.InvalidOperationException: Collection was modified;  enumeration operation may not execute.    at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)    at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext()   at System.Linq.Enumerable.FirstOrDefault[TSource] (IEnumerable`1 source, Func`2 predicate)   I checked and found that using ToList() might resolve my problem. I tried,  but the issue reoccurred. Can anyone help?          EDIT - Dictionary is being called/shared by multiple threads/functions/classes simultaneously. Putting in a lock would be painful and have performance overheads. The issue is rare and random to reproduce.          EDIT2 : Used ToList(),  doesn't help.     Here's the GetAll method :     It does use the Values internally, just has a lock object wrapped over it.      public IEnumerable<U> GetAll()     {         IEnumerable<U> values;         lock (lockObj)         {             values = myDictionary.Values;         }         return values;     }


How do I install the latest stable version of Thunderbird?

Similar to , what's the best way to stay up to date with the latest stable releases of Thunderbird?


How to make salesforce tabs look normal even on adding external style sheets to visual force pages

Hi i was adding style sheet to my visual force page, it is working fibe but it is affecting  default salesforce tabs look un-user-friendly.  without adding style sheet it is looking like   <apex:page standardController="case" extensions="UnclaimedTicket" sidebar="false" tabStyle="case"  recordSetVar="search" >  </apex:page>     when style sheet was added to the page  <apex:page standardController="case" extensions="UnclaimedTicket" sidebar="false" tabStyle="case"  recordSetVar="search" >  <link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.no-icons.min.css" rel="stylesheet"/>     </apex:page>     by adding the style sheet i am loosing the salesforce and version logos on top right and also the whole page was zoomed in and giving very narrow and closed look.   Is there any way to over come this ...


NullPointerException when using PersistentEntityResourceAssembler.getResource on existing Obj instance

I'm trying to build a restful controller with HAL links and custom methods. When I'm using a getResources from PersistentEntityResourceAssembler (HAL links) and this cause NullPointer.    StackTrace  java.lang.NullPointerException: null     at pl.com.tt.sok.core.component.attendance.entity.PersonAttendanceListBuilder.addAttendance(PersonAttendanceListBuilder.java:37)     at pl.com.tt.sok.core.component.attendance.service.AttendanceStatusService.createAttendanceListForPersonBasedOnRequestedDates(AttendanceStatusService.java:50)     at pl.com.tt.sok.core.controller.attendance.AttendanceStatusController.getPersonAttendanceList(AttendanceStatusController.java:34)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497) ...   PersonAttendanceListBuilder  @Autowired private PersistentEntityResourceAssembler assembler; (...)  private PersistentEntityResourceAssembler assembler;     public PersonAttendanceListBuilder addAttendance(Attendance attendance) {     PersistentEntityResource resource = assembler.toResource(attendance); //(37)     this.attendanceList.add(resource);     return this; }   AttendanceStatusService              attendance = attendanceRepository.findByDateAndPerson(Date.valueOf(day), person);         if(attendance==null){             attendance = new Attendance();        }         listBuilder.addAttendance(attendance); //(50)


isAccessible() vs isQueryable() and which one to use for SOQL query CRUD checks

Whats the difference between isAccessible() vs isQueryable() methods in DescribeSObjectResult Class and which method should one use for CRUD checks in SOQL query ?   ()  From documentation they look synonymous .


Hello people I have a problem using parameters in threads. The problem is that I put an object List<object> as a parameter for a thread array in a foreach loop iterating a list of Lists (List<List<Object>>), and sometimes  it duplicates the parameter (i already check that there is not a duplicate object before i put it in a thread). My code is something like this. Does anyone have an idea what is wrong?. Thanks in advance  foreach (List<object> list2 in list1) {      threads[i] = new Thread(() =>DoWork(list2, nRetorno));     threads[i].Name = "thread " + i;     threads[i].Start();     Thread.Sleep(5);     i++; }


Check Robustness of ISI Q1 enlisted Journal?

Recently, I've received an acceptance for publishing my paper in an ISI enlisted Journal called Indian Journal of Science and Technology. Definitely, it's great.  How can I check the robustness of this journal? How much value will carry on it in academic world?   Can anyone help me, please?


If k and n are relative primes, do I get all the remainders (0, ..., n-1) from these numbers (mod n): 0, k, 2k, 3k, ..., (n-1)*k? If so, what theorem is about this topic? Also, what if they are not relative primes?


Why are all $n$, s.t. the sum of digits of $n$ and $n^2$ coincide, $\equiv 0,1 \bmod 9$

Let $S(n)$ be the sum of digits of $n$.  Numerically, I've found that for all $n$ where $S(n) = S(n^2)$, $n \equiv 0,1 \bmod 9$.  Why is that? Is there a proof to show that this is always the case?


Determine if $f$ is differentiable at $(0,0)$, given that it is continuous at $(0, 0)$.

Define $f(x,y)= \frac{x^2y}{x^2 + y^2}$ if $(x,y)≠(0,0)$ and $f(x,y)=0$ if $(x,y)=(0,0)$. Determine if $f$ is differentiable at $(0,0)$.  Using limits and converting to polar coordinates, I determined that $f$ is continuous at $(0,0)$.  I also got that the partial derivatives exist and are constant functions both equal to $0$. But how do I determine from this if $f$ is differentiable at $(0, 0)$, step by step if possible?


Using "${a:-b}" for variable assignment in scripts

I have been looking at a few scripts other people wrote (specifically Red Hat), and a lot of their variables are assigned using the following notation VARIABLE1="${VARIABLE1:-some_val}" or some expand other variables VARIABLE2="${VARIABLE2:-`echo $VARIABLE1`}"  What is the point of using this notation instead of just declaring the values directly (e.g., VARIABLE1=some_val)?  Are there benefits to this notation or possible errors that would be prevented?  Does the :- have specific meaning in this context?


Hello StackOverflow users. This is related to the Java instead of the robot itself. What i was trying to do is to seperate the sensors from the movement methods to make the code easily readable, but I've ran into one problem.  Sensor.java  package sensors;  import lejos.hardware.sensor.EV3ColorSensor; import lejos.hardware.sensor.EV3GyroSensor; import lejos.hardware.sensor.EV3TouchSensor; import lejos.hardware.sensor.EV3UltrasonicSensor;  public class Sensors {      EV3TouchSensor touchSensor;     EV3ColorSensor colorSensor;     EV3GyroSensor gyroSensor;     EV3UltrasonicSensor ultrasonicSensor;      public Sensors(EV3TouchSensor t, EV3ColorSensor c, EV3GyroSensor g, EV3UltrasonicSensor u) {         touchSensor = t;         colorSensor = c;         gyroSensor = g;         ultrasonicSensor = u;     }      public int getColorSample(){         int sample = colorSensor.getColorID();         return sample;     }  }   Movement.java  public class Movement {      RegulatedMotor left;     RegulatedMotor right;     EV3TouchSensor touchSensor;     EV3ColorSensor colorSensor;     EV3GyroSensor gyroSensor;     EV3UltrasonicSensor ultrasonicSensor;      public Movement(RegulatedMotor l, RegulatedMotor r, EV3TouchSensor t,  EV3ColorSensor c, EV3GyroSensor g,             EV3UltrasonicSensor u) {         left = l;         right = r;         touchSensor = t;         colorSensor = c;         gyroSensor = g;         ultrasonicSensor = u;     }      //initialize sensors      Sensors sensors = new Sensors(touchSensor, colorSensor, gyroSensor, ultrasonicSensor);      public void moveForward() {         // get the color sample of the ground         //int sample = colorSensor.getColorID();         int sample = sensors.getColorSample();          // while machine is on the ground color         while (sample != 7) {              // get new sample             //sample = colorSensor.getColorID();             sample = sensors.getColorSample();              // move forward             syncForward();         }         // if on black, stop motors.         syncStop();     }   Don't look at the other methods, because these work fluently, but the error comes at the line 30, where it tries to get the sample from the sensors class. I have no idea, I've given the commented out lines as well, which work fluently. The error comes from accessing the sensors class and i can' think out a solution.  I'll be in your debt!


In what format drupal stores the data in config tables ? is it a json ?  Can i parse it with a online json parser ? or is there any other method ?  sample configuration data :  a:10:{s:4:"uuid";s:36:"52c29e86-0ed2-4927-b801-1e1741951d4f";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:0:{}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"dJ0L2DNSj5q6XVZAGsuVDpJTh5UeYkIPwKrUOOpr8YI";}s:2:"id";s:13:"authenticated";s:5:"label";s:18:"authenticated user";s:6:"weight";i:1;s:8:"is_admin";b:0;s:11:"permissions";a:91:{i:0;s:10:"clone node";i:1;s:15:"clone own nodes";i:2;s:15:"access comments";i:3;s:13:"post comments";i:4;s:21:"skip comment approval";i:5;s:18:"edit field_fwd_acl";i:6;s:19:"edit field_p_access";i:11;s:26:"edit field_p_businessowner";i:14;s:24:"edit field_p_destination";i:16;s:20:"edit field_p_garefid";i:18;s:15:"edit field_p_lb";i:19;s:22:"edit field_p_lbmembers";i:21;s:19:"edit field_p_lbping";i:22;s:21:"edit field_p_lbprefix";i:25;s:28:"edit field_p_lbstickysession";i:27;s:25:"edit field_p_maintaccess2";i:31;s:20:"edit field_p_project";i:34;s:16:"edit field_p_sla";i:36;s:19:"edit field_p_somail";i:38;s:25:"edit field_p_template_tnv";i:42;s:21:"edit field_p_weblogic";i:43;s:19:"view field_p_access";i:48;s:26:"view field_p_businessowner";i:51;s:24:"view field_p_destination";i:53;s:20:"view field_p_frontip";i:54;s:20:"view field_p_garefid";i:56;s:15:"view field_p_lb";i:57;s:22:"view field_p_lbmembers";i:59;s:19:"view field_p_lbping";i:60;s:21:"view field_p_lbprefix";i:63;s:28:"view field_p_lbstickysession";i:65;s:21:"view field_p_location";i:66;s:25:"view field_p_maintaccess2";i:70;s:20:"view field_p_project";i:73;s:16:"view field_p_sla";i:75;s:19:"view field_p_somail";i:77;s:19:"view field_p_status";i:78;s:25:"view field_p_template_tnv";i:82;s:21:"view field_p_weblogic";i:83;s:13:"view faq page";i:84;s:26:"access GA autocompletion";i:85;s:24:"access check backend tab";i:86;s:14:"access content";i:87;s:36:"create forward_proxy_request content";i:90;s:38:"edit own forward_proxy_request content";i:92;s:30:"edit own proxy_request content";i:93;s:19:"view uploaded files";i:94;s:29:"use text format filtered_html";i:95;s:24:"administer node adoption";i:97;s:19:"access take control";i:98;s:23:"administer take control";i:99;s:19:"access file browser";i:100;s:23:"administer file browser";i:101;s:29:"access Notification admin tab";i:102;s:34:"access Notification autocompletion";i:103;s:38:"bypass Notification field verification";i:104;s:25:"access backup and migrate";i:105;s:19:"access backup files";i:106;s:29:"administer backup and migrate";i:107;s:19:"delete backup files";i:108;s:14:"perform backup";i:109;s:19:"restore from backup";i:110;s:22:"access ga admin menu";i:111;s:16:"access mailusers";i:112;s:31:"access mailusers autocompletion";i:113;s:35:"access mailusers field verification";i:114;s:17:"administer blocks";i:115;s:23:"access GA admin menus";i:116;s:21:"access GA admin tab";i:117;s:30:"bypass GA field verification";i:118;s:13:"access nusoap";i:124;s:20:"edit own faq content";i:125;s:20:"revert faq revisions";i:126;s:18:"view faq revisions";i:127;s:30:"view printer friendly versions";i:128;s:20:"administer printable";i:129;s:26:"restful delete entity:node";i:130;s:23:"restful get entity:node";i:131;s:25:"restful patch entity:node";i:132;s:24:"restful post entity:node";i:133;s:40:"delete own forward_proxy_request content";i:134;s:28:"create proxy_request content";i:135;s:32:"delete own proxy_request content";i:136;s:20:"grant content access";i:137;s:21:"access private fields";i:138;s:28:"administer field permissions";i:139;s:18:"create field_p_mem";i:140;s:20:"edit own field_p_mem";i:141;s:17:"administer search";i:142;s:19:"use advanced search";i:143;s:14:"search content";}}   I was trying to get the authenticated users list . I got the above config data   when i queried      select * from config where name='user.role.authenticated';   When i checked the user__roles table  i have only 2 roles named   administrator and manager


Does anyone have any idea how to create this realistic "skewed"/inclined 3D Style Tile?:    Things to note from this design:   The image "wraps" around the slab. The image has a light source that helps create the realistic look to it. Look at how the lighting in the upper right side is lighter than the lower left side. The location of the shadow is perfectly aligned with the tile. The spread/blur of the shadow "fits" the distance of the slab from the surface.   I found  from 2012, but the steps described by the author are to vague and can't enlarge his screenshots either.  I've been looking all over the web for a more helpful tutorial about how to accomplish this, but haven't been able to find anything.  Any help or pointers accomplishing this is GREATLY appreciated.  Image taken from Jonathan Quintin's:   EDIT-9/25/14  I was able to find the answer to my own question, but was unable to add it here. So I answered these two other very similar questions:


How to loop through a list in Python using range()

I don't know how to convert this loop in C to Python. Thanks in advance  I tried to convert  for(i=start, i<=end, i++)    printf(ids[i])   to:  for x in range(start, end, ids):    print(x)   But range requires integer values and ids is a list of strings.  I tried casting ids as integers but it says      "ValueError: invalid literal for int()"   I need the values in ids to stay as characters because there are some letters in it.


What is the construction be + verb (perfect form)? I have come across it multiple times in legalese. For instance:     to ensure that every person be granted adequate assistance


How do you prove that $e=\sum_{n=0}^{\infty}\frac{1}{n!}$? Here I am assuming $e:=\lim_{n\to\infty}(1+\frac{1}{n})^n$. Do you have any good PDF file or booklet available online on this? I do not like how my analysis text handles this...


Let $A \subset X$ metric space. Then $d(x,A) = 0$ if and only if $x\in \overline{A}?$

I am trying to prove this. I did not find in any book.  I was making some exercises where I had to prove that if $A$ is closed and $x\not\in A$ then $d(x,A) >0.$ Because of the condition "being closed" I asked myself: $d(x,A) = 0 \Leftrightarrow x \in \overline{A}?$   It is true? Any hints to prove? Any references?  Thanks!


Does java support explicit interface implementation like c#?

i tried doing this :  interface pet {     void sleep(); } interface robot {     void sleep(); }  public class roboGarfield implements pet , robot {      /*      * this gives error     void pet.sleep(){      }     */      @Override     public void sleep() { System.out.println("this isn't really specific.."); }      public static void main(String[] args){         roboGarfield t = new roboGarfield();         t.sleep();         ((pet)t).sleep(); // similar to C#          ((robot)t).sleep();     }     }   But even though i can cast the roboGarfeild object to its pet or robot type , i cant do an  like c#.  Anything i'm doing wrong ? or is it just not supported in java ?  Edit: So , java doesn't support explicit interface implementation like C#. But for cases where  they can't be avoided , Holger's delegate method seems like the way out.  Thanks for all the replies.


How to remove Windows 10 digital licence

I want to activate Windows with a product key by doing a clean install.Is it possible to get rid of digital entitlement on a system


What is the meaning of ?? and ! in ConTeXt?

Reading this  about the differences between LaTeX and ConTeXt, I came across the following snippet:  \definesystemvariable {dt} % DocumentTitle  \def\setuptitle   {\dodoubleempty\dosetuptitle}  \def\dosetuptitle[#1][#2]%   {\ifsecondargument      \dodosetuptitle[#1][#2]%    \else      \dodosetuptitle[\v!content][#1]%    \fi}  \def\dodosetuptitle[#1][#2]%   {\def\dododosetuptitle##1%      {\getparameters[\??dt##1][#2]}%    \processcommalist[#1]\dododosetuptitle}   I've worked out most of what this means, but I don't understand what \??dt##1 is? What's the meaning of the double question marks? Similarly, what is the meaning of \v!content ?


If $f$ is continuous in [0,1] then what will be the value of $$\lim_{n\to\infty}\sum_{j=0}^{\left[\frac{n}{2}\right]}\frac{1}{n}f\left(\frac{j}{n}\right)?$$  We know that,$$\lim_{n\to\infty}\sum_{j=0}^{{n}}\frac{1}{n}f\left(\frac{j}{n}\right)=\int_0^1f(x)dx$$But what will be the value if we have $\left[\frac{n}{2}\right]$ instead of $n?$


Submartingale convergence (Durrett 5.3.1)

Exercise 5.3.1 in Durrett's "Probability Theory and Examples" states  Let $X_n$, $n\ge 0$, be a submartingale with $\sup X_n < \infty$. Let $\xi_n=X_n-X_{n-1}$, and suppose $E(\sup \xi_n^+)<\infty$. Show that $X_n$ converges almost surely.  Here are my thoughts: It looks like we need to use theorem 5.2.8 (Martingale convergence theorem), which states that $X_n$ converges almost surely if $\sup EX_n^+<\infty$. I am trying to understand why we can just do the following (or at least I'm guessing we can't):  Suppose $X_n > 0$ (edit: on some set with positive measure), then $0< \sup X_n < \infty$, and therefore $EX_n^+ \le \sup X_n < \infty$. So we're done.  Otherwise, if $X_n \le 0$ a.e., then $\sup X_n^+ = 0$ a.e. Once again, we're done.  Am I missing something? Since I didn't use all the information, I probably am.  Thanks for the help.


Why hasn't Trusty received the updates for OpenSSL's CVE-2016-2108 and CVE-2016-2107?

OpenSSL released , warning users of two recently discovered vulnerabilities:   Memory corruption in the ASN.1 encoder (CVE-2016-2108) Padding oracle in AES-NI CBC MAC check (CVE-2016-2107)   Their recommendation is as follows:     OpenSSL 1.0.2 users should upgrade to 1.0.2h   OpenSSL 1.0.1 users should upgrade to 1.0.1t   However, the latest version available for Trusty (14.04) is 1.0.1f-1ubuntu2.19. How come such an old version is still being provided and how do I mitigate this?


Bluetooth headphone mic and stereo audio not working simultaneously on laptop

I have a Sennheiser HD4.40BT bluetooth headphone. When I connect this to my android phone, I can listen stereo quality music and while call, I can hear other person clearly and use the mic also. Problem appear when I connected headphone with my laptop through laptop's inbuilt bluetooth.  The problem is headphone is connecting in one of 2 ways: Headphone mode and Headset mode(with mic).  - When I select headphone mode, sound is great but I cannot use my mic.  - When I select headset mode(or handsfree mode), I continuously hear static and very poor audio quality but can use mic with this mode.    I already read to disable headset mode to get stereo quality but "this is not my purpose". What I want is to use headphone with stereo audio and mic simultaneously.


Can a 64-bit OS run as a guest on a 64-bit VirtualBox host?

Is it possible to run a 64-bit OS as a guest on a 64-bit machine with VirtualBox? I'm guessing it should be, but I'd like to make sure.  Do some virtualization technologies allow a single guest machine to use multiple cores? I guess it should be possible, but my VirtualBox open-source edition doesn't seem to do it.


Prove that any non-zero-divisor of a finite dimensional algebra has an inverse

Let $A$ be a finite dimensional algebra. Prove that an element of $A$ is invertible iff it is not a zero divisor.  Let $a$ be an invertible element, then there exists an element $b$ such that $ab=1$ and assyme that $a$ is a zero divisor, then there exists an element $c  \neq 0$ such that $ac=0$ and i don't know.


I am not very big in mathematics yet(will be hopefully), naive set theory has a problem with , how do they defeat this sort of problem in mathematics? Is there a greater form of set theory than naive set theory that beats this problem? (Maybe something like superposition if is both or neither)?


Combine fill and pattern in a pgfplot boxplot?

Is it possible to combine a pattern with a background color in Pgfplot boxplot?  \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \usepgfplotslibrary{statistics} \usetikzlibrary{patterns}  \begin{document}  \begin{tikzpicture} \begin{axis} [ ytick={1}, yticklabels={Index 0}, ] \addplot+[ boxplot prepared={ median=1, upper quartile=1.,  lower quartile=0.5, upper whisker=1.5, lower whisker=0. }, fill=green, draw=red, pattern=north east lines, ] coordinates {};  \end{axis} \end{tikzpicture}  \end{document}   It seems that pattern and fill cannot be combined.  Any Idea?  I also tried using postaction as mentioned in   \addplot+[boxplot prepared={  median=1,  upper quartile=1.,  lower quartile=0.5,   upper whisker=1.5,  lower whisker=0.},  fill=green,  draw=red,    postaction={pattern=north east lines}  ] coordinates {};   The boxplot result is the following


Every time I increment the below to update the created by my method, I get a Exception in thread "main" java.lang.NullPointerException error. I have no clue what's causing this, perhaps it's the "do" loop? I've tried everything I can and am not aiming to import any packages  userCardsCount = 2; boolean trueScore = userSum <= 21;  do{         displayCards(true);      // User turn     int i = 2;      System.out.println("\nUSER'S TURN");     System.out.print("Draw new card (Y/N): ");     input = br.readLine();      if(input.equals("y") || input.equals("Y") || input.equals("yes") || input.equals("YES")) {         userCardsCount++;         userCards[i] = deck.drawCard();         userSum += userCards[i].value;           System.out.print("\n--> User drew a " + "[" + userCards[i].value + "]\n");         //i++;     } else if(input.equals("n") || input.equals("N") || input.equals("no") || input.equals("NO")) {          // You stay as you are and go to the computer's turn          System.out.println("--> User stays.");        }      else {         System.out.println("\t--> Umm please retry input");     } } while(trueScore);   METHOD  public static void displayCards(boolean showHidden) {     if(showHidden) {         System.out.print("Computer's cards: [" + computerCards[0].name + "]");     } else {         System.out.print("Computer's cards: [X]");     }     for(int i = 1; i < computerCardsCount; i++) {         System.out.print("[" + computerCards[i].name + "]");     }     if(showHidden) {         System.out.print(" (sum: " + computerSum + ")");     }      System.out.print("\nUser's cards: ");     for(int i = 0; i < userCardsCount; i++) {         System.out.print("[" + userCards[i].name + "]");     }     System.out.print(" (sum: " + userSum + ")");      System.out.print("\n"); }   Any suggestions?


I am dual booting Ubuntu 19.10 and windows 10 and I keep getting notifications that my / directory has low space. The size of / is 8GB. I have run sudo apt clean but it did not free up much space.  I have been trying to understand if I need to extend that partition and some guides I have found have not helped me. Is there no easy way to just add to it from the free disk space I have? Or do I have to create a new root partition and move everything there?  Any help appreciated.


Given a simple graph and its complement, prove that either of them is always connected.

I was tasked to prove that when given 2 graphs $G$ and $\bar{G}$ (complement), at least one of them is a always a connected graph.  Well, I always post my attempt at solution, but here I'm totally stuck. I tried to do raw algebraic manipulations with # of components, circuit ranks, etc, but to no avail. So I really hope someone could give me a hint on how to approach this problem.


Can you place a draw 2 (+2) on top of a draw 4 (+4) in regular Uno?

So, the way I've always played you can't add a draw 2 on a draw 4 but I've seen plenty of other people do it. So I'm wondering if you can or can't?


Real Analysis, Folland problem 2.13. Integration of Nonnegative functions

Suppose $\{f_n \}\subset L^{+}$, $f_n\rightarrow f$ pointwise, and $\int f = \lim\int f_n < \infty$. Then $\int_{E}f = \lim\int_{E}f_n$ for all $E\in M$. However, this need not be true if $\int f = \lim\int f_n = \infty$  Proof: Let $E\in M$, by Fatou's Lemma $$\int_{E}f = \int f 1_{E} = \int\lim_{n\rightarrow \infty}\inf f_n 1_{E} \leq \lim_{n\rightarrow \infty}\inf\int f_n 1_{E} = \lim_{n\rightarrow \infty} \inf\int_{E}f_n$$ Similarly, $$\int_{E^{c}}f\leq \lim_{n\rightarrow \infty}\inf\int_{E^{c}}f_n$$ Note, $f = \int f 1_{E} + f 1_{E^{c}}$ and $f_n = f_n 1_{E} + f_n 1_{E^c}$ for all $n\in\mathbb{N}$. This implies, $\int f_{E^c} = \int f - \int_{E} f$ and (for $n$ large) $\int_{E^c}f_n = \int f_n - \int_{E} f_n$. Therefore, $$\int f - \int_{E}f = \int_{E^c}f\leq \lim_{n\rightarrow \infty}\int_{E^c}f_n = \lim_{n\rightarrow\infty}\left(\int f_n - \int_{E} f_n\right) = \int f - \lim_{n\rightarrow \infty}\int_{E}f_n$$ Cancelling $\int f$ from both sides (which is allowed since $\int f = \lim\int f_n < \infty$)   we get $$\int_{E} f = \lim_{n\rightarrow \infty}\int_{E}f_n$$  I have not completed the second part yet, I just wanted to make sure this is correct, any suggestions is greatly appreciated especially for the second part.


UK Standard Visitor visa refusal for Assessment and Interview in the UK Army- refused V4.2(a) (c)

I have received a refusal for a UK visit visa. Below is the relevant text of the refusal. What does this mean and what steps can I take to significantly increase my chances of success in a potential new attempt to apply?      The Decision      I have refused your application for a visit visa because I am not   satisfied that you met the requirements of paragraph(s) V4.2.of the   Appendix V: Immigration Rules for Visitors because:         In order to be able to make a decision on whether or not to grant you entry clearance in this category i have taken into account your   stated circumstances in Nigeria, the reason for your visit and your   proposed travel arrangements.   You state that you wish to travel to the UK for 4weeks to attend the interview and assessment stage in you application to join the British   Army. You have provided a letter from the British Army which states   that this event will be held 12th - 14th December, a period of 3 days.   Given this, your plans for the remainder of your time in the UK lack   clarity.   I note that you have stated that your cousin in the UK will provide the funds for your trip but in order to make a decision on your   application it is reasonable to assess your personal circumstances in   Ghana as part of my overall assessment of your application.   You have declared on your application form that you are employed by ABC Company and that you derive a net monthly income of 1,000ghs   (£198.76 OANDA rate of exchange on 17/11/2016) from this employment.   You have provided a bank statement in your name from Fidelity Bank   which shows a closing balance of 1,742.97ghs (£346.43) on 08 November 2016.   > Whilst this statement show payment with the reference of 'SafeDrive' these are deposited into the account in cash therefore the   fact that these transactions appear on your statement hold little   corroborative value in determining that your employment is as stated by   you.   You have provided a further account in your name from Barclays which shows a closing balance of 2,236.35ghs (£444.50) on 11 November 2016.   Again the funds  in this account are an accumulation of cash deposits   that are inconsistent with your stated income.   Given the statement you have made and the documentary evidence you have presented to support your application I am not satisfied that   your circumstances in Ghana, coupled with your reasons for wishing to   travel to the UK at the end of your proposed visit.   In light of all the above, I am not satisfied that you have demonstrated that you are a genuine visitor and will leave the United   Kingdom at the end of your visit. Your application has therefore been   refused under paragraph V4.2(a) and (c) of the immigration rules.         Further Applications      Any future UK visa application you make will be considered on their   individual merits; however you are likely to be refused unless the   circumstances of you application change.      In relation to this decision there is no right of appeal or right to   administrative review.   Please any advice on what to do because my application was assessed based on my circumstances in Nigeria but I am a Ghanaian and also the Army has given me another date for assessment in 2017.


What is the difference between a deleted user and a "destroyed" user?

Prompted by , it appears there are two methods of disabling user accounts permanently:  deleting and "destroying"   What are the differences between deleting and destroying a user? What determines which method is used?


I've got this problem:   Here, if $Z,W$ are independent random variables, and $Z$ has normal standart distribution and $W$ has $\chi^2$ with $n$ degrees of freedom, $T=\frac{Z}{\sqrt{\frac{W}{n}}}$. I don't expect to find any problems in $b$ and $c$ parts, but in $a$, I don't know how to find the conditional density. How could I?


Can anyone explain to a non-logician how Tractatus 3.333 refutes (or fails to refute) Russell's Paradox? Please explain his use of symbols!


This is what i am trying to acchomplish, i have created an iframe, within my iframe i have input a src to a PHP file.  when the php file opens up within the iframe it has a choose file input dialog. I have created a button seperate from the iframe in which i would like to use to open up input dialog.  here is example below:     here is the php file(Form portion) that i open  <form action="NewResizeUpload.php" method="post" enctype="multipart/form-data">  <input type="file" input id="input" name="image" onchange="handleFiles()" /> <button>Upload</button>     The question is how do i call for the open choose file dialog this is what i am currently using but does not work when i load php file into iframe  function ChooseFile(){ document.getElementById('input').click();


Possible to perform cross-database queries with PostgreSQL?

I'm going to guess that the answer is "no" based on the below error message (and ), but is there anyway to perform a cross-database query using PostgreSQL?  databaseA=# select * from databaseB.public.someTableName; ERROR:  cross-database references are not implemented:  "databaseB.public.someTableName"   I'm working with some data that is partitioned across two databases although data is really shared between the two (userid columns in one database come from the users table in the other database). I have no idea why these are two separate databases instead of schema, but c'est la vie...


I'm trying to create a program which takes user input of two words and determines whether or not these words are the same.   import java.util.Scanner; public class L7E3 {     public static void main(String[] args) {         Scanner keyboard = new Scanner(System. in );         String word1, word2;          System.out.println("Please enter a word: ");         word1 = keyboard.nextLine();         System.out.println("Please enter a word: ");         word2 = keyboard.nextLine();          if (word1 == word2) {             System.out.println("The words are " + word1 + " and " + word2 + ". These words are the same.");         } else {             System.out.println("The words are " + word1 + " and " + word2 + ". These words are not the same.");         }     } }   I figured that word1==word2 would have worked to determine whether the two strings were equal, I'm using JGrasp and it goes directly to my else option regardless of input. Am I doing something wrong with strings?


How to resize the correlation plot for better visualization?

I have dataset which contains 72 features. Now I want to find the most significant features which will affect my model. So I am trying to plot a correlation matrix plot using seaborn and matplotlib but when I try to plot it as it contains 72 features it is not possible to visualize it properly. How can I enlarge the plot to understand it better.  Code:  %matplotlib inline corr = data.corr() sns.heatmap(corr,              xticklabels=corr.columns.values,             yticklabels=corr.columns.values)   Screenshot:


My motherboard currently supports both SATA II and III (3 Gb/s and 6Gb/s respectively), but after reading some online, it seems as though connecting a HDD to the 6 Gb/s is pretty much pointless. If this is the case I'm going to leave my two SATA III ports open for something that can actually use it (which at this point I'm not really sure what can).  This is part of an article I read:     In terms of everything else, we saw basically no difference from the same single drive being plugged into a SATA 6Gb/s or SATA 3Gb/s port. All of this is obviously due to the hard drive not being able to actually take advantage of the 6Gb/s bus.   from .


Program windows turn gray and then go back to normal again

I installed Ubuntu 14.04 on a Toshiba C50D-A-133 laptop. After installation I opened a terminal, and ran sudo apt-get install with some packages. I remember PlayOnLinux , GIMP, etc.  While the packages were being installed I started Empathy to enter the access data from my jabber account. In the shell window I saw that the Windows fonts were unpacking. Empathy fades to gray, and after 1 or 2 seconds it goes back to normal, and I could enter the jabber account information. At the shell windows apt-get was unpacking the next packages. Then after this a window with an update notification appears. I chose there preferences, and I unmarked the checkboxes there. After closing, the windows turned gray too for about 1 or 2 seconds, then the notification "no updates needed" appears.  I think that the windows became unresponsive because the system was busy. Is this correct or could something be damaged or wrong with my system? No program crashed or was aborted, only turned gray for a second, and then ran normally.


How to check a variable is class object or not

Assume a simple class:  class MyClass(object):     pass  . . . m = MyClass print type(m) # gets: <type 'classobj'> # if m is classobj, how can i check a variable is class object?   My question is: how can i check a variable is a class object?  a simple solution:  if str(type(m)) == "<type 'classobj'>":     # do something   But i think there is at least one classic way to check that.


I'm using three questions in a list inside quotation marks, would I separate with a comma, semicolon, or nothing? Are the question marks even needed?

A sentence with a list of questions inside quotation marks, how do I separate them? I can't find a solid answer anywhere.   Option 1: In simple terms, Naikan is based on three questions: “What have I received?” “What have I given?” and “What troubles and difficulties have I caused?”   Option 2: In simple terms, Naikan is based on three questions: “What have I received?”; “What have I given?”; and “What troubles and difficulties have I caused?”.  Option 3: In simple terms, Naikan is based on three questions: “What have I received?”, “What have I given?”, and “What troubles and difficulties have I caused?”.  Or would it be no question mark at all? In simple terms, Naikan is based on three questions: “What have I received”, “What have I given”, and “What troubles and difficulties have I caused."  The quotation marks have to be in it.


We all know that milk overflows from the container when boiled. The reason is air trapped under the skin of the milk, can't escape and hence, pushes the skin upwards until it overflows.  My mother uses a trick to stop the overflow of milk. She puts a ladle on a diameter of the container. Here are two pictures :       What is the reason that the milk doesn't flow over anymore? Is there a gap created on the places where the milk comes in contact with the ladle from which the air escapes?


Can an answered question be anonymized because it can't be deleted?

You cannot delete this question as others have invested time and effort into answering it. For more information, visit the help center.  The situation is as follows:  A question has a positive record and an answer only upvoted by the question author. The question author doesn't want anyone else to know that they asked this question, but they can't delete it.  Is there any solution for this? For example, can I flag the question and let an administrator or moderator change the author to Community?


I'm asked to indicate which natural numbers $n$ each of the below inequality is true, and then I am required to prove this via induction, but I'm wondering what that means... Strong induction?  $n^2\leq n!$  $n^2\leq 2^n$  $2^n\leq n!$


I am trying to make a JButton that displays an image in the JPanel when pressed - allowing the user to choose the location in the panel. I am using the following methods to paint:  public void paint(Graphics g, URL path) {     Image img = getImage(path);     Graphics2D g2 = (Graphics2D)g;     g2.drawImage(img, getX(),getY(),50,50, null); }  public Image getImage(URL path) {     Image temp = null;     try     {         temp = Toolkit.getDefaultToolkit().getImage(path);     } catch (Exception e) {         e.printStackTrace();     }     return temp; }   When I call paint(), I get a null pointer exception in my last line of my ActionListener:  dogButton.addActionListener(new ActionListener() {         public void actionPerformed(ActionEvent ae) {             Graphics g = null;             Animal animal = new Animal();             animal.paint(g, main.class.getResource("/Animals/dog.jpg"));         }   I'm a little confused overall about how to use ActionListeners.  This is my first project so I apologize for my lack of knowledge.


Codeigniter Mail function sends mail to spam folder

I am using codeigniter mail function. Its sends mail perfectly. But all the time mail going to the spam folder. How can I overcome this.  Function  function msg_now(){         $this->load->library('email');         $this->load->library('parser');          $config['protocol'] = 'sendmail';         $config['wordwrap'] = TRUE;         $config['mailtype'] = 'html';         $this->email->initialize($config);         $email_id='test@test.com';         $name=$this->'test';         $this->email->from('test@gmail.com');         $this->email->to($email_id);          $this->email->subject('Test subject');          $this->email->message("
Lorem ipsum dummy content
");         $this->email->send(); }


I know I can set the render border with Ctrl+B and dragging a box.  But is there  a way I can exactly specify the border dimensions?


Why is text darker than a filled shape of the same RGB colour in powerpoint?

When filling text and a solid shape fill or slide background with the same RGB colour values, the text appears darker than the shape or background. This makes the colour inconsistent when using the same swatch from a colour theme for text and fills. Frustrating for clients who want the simplicity of a consistent colour template.


and condition unpredictable in lightning

The following does not evaluate correctly and shows a field even when the cond4 is not met  <aura:if isTrue="{!and(cond1, cond2,cond3, cond4)}"> SHOW A FIELD  </aura:if>   However, when I put cond4 in the front of the and, then it works as expected and does not show the field when cond4 is not met.  <aura:if isTrue="{!and(cond4, cond2,cond3, cond1)}"> SHOW A FIELD  </aura:if>   any clues


How can a monoid be a category with just one object?

My book says that:     A monoid is a set M equipped with a binary operation $.:M\times M\to  M$ and a distinguished unit element $u\in M$ such that for all    $x,y,z\in M$:      $$x\cdot(y\cdot z) = (x\cdot y)\cdot z$$ and      $$u\cdot x = x = x\cdot u$$      Equivalently, a monoid is a category with just one object. The arrows   of the category are the elements of the monoid. In particular, the   identity arrows is the unit element $u$   So, a monoid is a category with just one object. What it means exactly? $M$ has more than one object. Later the book cites $\mathbb{N}$ as being a monoid. Why?


Search for diamond (♦) symbol doesn't work

Just tried to search for the diamond symbol (♦) and got . It seems that searching for any single symbol is not implemented. For instance:   Even more, searching for the  doesn't work too. However since diamond symbol (♦) for whole Stack Exchange has special meaning it would be desired to allow searching for that symbol.


Can you make TableViewCells not be able to be Selected?

I am currently working with TableViewCells in xCode and I am wondering if there is a way to make the cell not be highlighted/selected whenever it is tapped on. The answer can be either in code or by using the Interface Builder.  If I am not being specific enough or if you are confused as of what I am asking, please let me know and I will clarify. Thank you.


What experiment confirms $\mathbf{J}^2 = \hbar^2 j(j+1)$?

I learned that if we measure the spin angular momentum of an electron in one direction $J_z$, we get $\pm \frac{1}{2} \hbar$.  But if we measure the magnitude of the angular momentum $\mathbf{J}^2$, we should get $\frac{3}{4} \hbar^2$.  What experiment gives the latter result? As @user1585635 notes, measuring $J_x$, $J_y$, and $J_z$ separately and summing their squares gives $\frac{3}{4} \hbar^2$.  This is not what I'm looking for.  First, if I measure $J_z$, measure angular momenta in three directions separately, and measure $J_z$ again, the two measurements of $J_z$ aren't guaranteed to be the same, since $J_z$, $J_x$, and $J_y$ don't commute.  But $\mathbf{J}^2$ commutes with $J_z$. Second, when the spin is not $\frac{1}{2}$, say it's $j$, summing the squares of components of $\mathbf{J}$ gives 3ℏ²𝑗², where 𝐉² should be ℏ²𝑗(𝑗+1) doesn't always give $\hbar^2 j(j+1)$.  (Thanks to @MichaelSeifert for pointing that out) This question is not a duplicate of . That question is about how $\mathbf{J}^2$ is derived mathematically. Mine is about how it is confirmed experimentally.


I have the following code snippet  function receiver(callback) {     console.log( callback ); }  function callback(){}  receiver( new callback() );  OUTPUT: callback {}   is there a method or way to get 'callback' out of callback parameter? I like to get an object's name.


Apple Music offline files still there if subscription stops after free trial?

I am now using the 3-month free trial of Apple Music. Yesterday, I downloaded a few albums into my iPhone. If I do not join the subscription after the free trial period, will the songs still be in my iPhone?


What does "to the back of the bus" mean in      All of these options push the important element of demand to the back of the bus. And, those in the demand part of the equation—aka consumers—are faced with a dizzying array of options come meal time.   Note this is from The Spoon's "" (link to article, which dishes up the context).


Kernel requires an x86-64 CPU, but only detected an i686 CPU. How can I install Lubuntu/Ubuntu?

I'm trying to install Lubuntu on my laptop (sorta old 2005). [Laptop stats: Intel® Celeron® CPU 410 @ 1.46 GHz 1.47GHz, 448 MB of RAM]  I press Install and this message appears:   This kernel requires an x86-64 CPU, but only detected an i686 CPU.  Unable to boot - please use a kernel appropriate for your CPU.   What can I do to install Lubuntu on my computer?


how to get javascript variable value into php variable without ajax?

<script type="text/javascript">     var a=10; </script>  <?php echo $value; ?>   I want to get the value of variable "a" to PHP variable "$value" without ajax request.


Custom definition of \ref causes problem inside argument of \caption

I am trying to implement a custom version of the \ref command. I found out that in order for me being able to redefine this command I need to do so via \AtBeginDocument as otherwise my change seemed to get overwritten by something else.    It works now as expected except when using \ref inside a \caption which will produce the following error:  Argument of \@caption has an extra }. \caption{Test here \ref{sec:Section}} Paragraph ended before \@caption was complete. \caption{Test here \ref{sec:Section}}   Here is a MWE reproducing the problem:  \documentclass{article}  \usepackage{xstring}  \AtBeginDocument{%     \let\refCopy\ref     \renewcommand{\ref}[1]{%         \IfBeginWith{#1}{eq:}{             (\refCopy{#1})         }{         \refCopy{#1}     } } }  \setcounter{errorcontextlines}{999}  \begin{document}     \section{Section}     \label{sec:Section}      \begin{figure}         \caption{Test here \ref{sec:Section}}     \end{figure} \end{document}   If I remove my custom implementation of \ref the document compiles just fine.    What is causing this problem and how can I avoid it?


As I'm relatively new to the electronics world, I was wondering if you can connect multiple  ground terminals (corresponding to several different voltage outputs) to the same ground. Or do they each need their own?  In my case I have 5 lines, one 12V, one 3.3V, two 5V and one variable from a 12V in using a  voltage regulator that already has its own ground. So I'm guessing that each would need its own ground, but it is never bad to ask.


I have a table that shows up after the example and exercises subsection. Is there a way to not anchor it to anything and have it appear in its original position in the code?  \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage[margin=1.1in]{geometry} \usepackage{enumitem} \usepackage{multirow} \newtheorem{example}{Example}[section] \newtheorem{exercise}{Exercise}[section] \begin{document} \begin{table}[ht] \centering \caption{Set Identities} \begin{tabular}{ll} $\overline{(\overline{A})} = A$   & Double Negative \\ $A \cap U = A$  & \multirow{2}{*}{Identity Laws} \\ $A \cup \emptyset = A$  & \\ $A \cup U = U$  & \multirow{2}{*}{Domination Laws} \\ $A \cap \emptyset = \emptyset$  & \\ $A \cup A = A$  & \multirow{2}{*}{Idempotent Laws} \\ $A \cap A = A$  &  \\ $A \cup B = B \cup A$  & \multirow{2}{*}{Commutative Laws} \\ $A \cap B = B \cap A$  & \\ $A \cup (B \cup C) = (A \cup B) \cup C$  & \multirow{2}{*}{Associative Laws} \\ $A \cap (B \cap C) = (A \cap B) \cap C$  & \\ $A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$ & \multirow{2}{*}   {Distributive Laws} \\ $A \cap (B \cup C) = (A \cap B) \cup (A \cap C)$  & \\ $\overline{A \cap B} = \overline{A} \cup \overline{B}$  & \multirow{2}{*}  {De Morgan's Laws} \\ $\overline{A \cup B} = \overline{A} \cap \overline{B}$  & \\ $A \cup (A \cap B) = A$  & \multirow{2}{*}{Absorption Laws} \\ $A \cap (A \cup B) = A$  & \\ $\overline{A} \cup A = U$ & \multirow{2}{*}{Negation Laws} \\ $\overline{A} \cap A = \emptyset$ & \end{tabular} \end{table}  \begin{example} Find the intersection of $A = \{2k|k \in \mathbb{N}\} \text{ and } B = \{3k|k \in \mathbb{N}\}$.  \smallskip \noindent \textbf{Solution:} The set $A$ represents all natural numbers divisible by $2$ and the set $B$ is the set of all natural numbers divisible by $3$. $A \cap B$ is the set of all natural numbers divisible by $2$ and $3$, therefore $A \cap B = \{6k | k \in N\}$. \end{example}  \subsection*{Exercises} \end{document}


I have a batch script variable like this:  Set myvar=hello\nworld   And when I echo myvar, i get the whole hello\nworld literally. How can I ask it to parse my \n and intrepret it as a new line character, so that I can echo that in two lines?


How can I install commonly used developer tools?

Is there a meta-package for installing commonly used developer tools such as cmake, autoconf, g++, etc.? The intent is to have roughly the same range of command-line tools as one has after installing XCode and the Mac SDK on Apple.


I read that as long as I hold a stock for two business days, I will get a dividend? What if I make multiple trades for one stock. For example, if I buy 20 shares and sell 20 two days later, then I buy 30 shares and sell 30. How much in dividends will I get if it is $1/share?


How to turn off Unity 3D so I can use Unity 2D on Ubuntu 13.04

I just want to turn Unity 3D off and use Unity 2D. I crunch alot of words and numbers, and when i try multitasking, Unity 3D is taking system resources that i need.


What is wrong with particle acceleration based fusion?

Recently, I was thinking about fusion and this thought struck my mind.    In tokamaks, the plasma is heated to extremely high temperatures in order to supply enough energy to the ions for them to fuse. But since, the plasma follows a boltzmann maxwell distribution curve,only a few ions have have enough energy to fuse. But, while this is happening, there also is a lot of energy loss due to Bremsstrahlung radiation.    Now, what I was thinking about is: If we somehow (rather mysteriously) confined a low temp plasma comprised of deuterium ions and an equal amount of electrons (quasi-neutral and approx 60000K) magnetically, and accelerate tritium ions (like a dense particle beam) and make them bombard the plasma. Could we gain net energy?  The reasons I think this would produce a Net gain of energy:   Well apparently, since the accelerator beam isn't in thermal equilibrium (wasn't given enough time), almost all collisions would result in fusion. Previously, many people told me that the reason this can't produce net energy is because the coulomb interaction cross-section is much higher than the nuclear cross section, But I suppose that given enough density of the confined plasma, even when the nuclear cross section is smaller than the coulomb cross section to produce more energy than is lost. This is also the case in tokamaks. The low plasma temperature can be helpful in producing high number densities in favor of the above point. Yes, the energy of the alpha particles resulting from fusion heats the gas, but we can find ways to cool the plasma to maintain confinement. I don't think that the cross section of coulomb interactions or Bremsstrahlung radiation would be considerably different from tokamaks, since we are dealing with the same energy levels (This statement is  probably wrong, so it would be great if some one can help me on this) Now, compared to tokamks, in which electrons have substantial amounts of energy and extremely small mass and emit a lot more Bremsstrahlung radiation than the particle beam I was talking about or ions in the plasma, radiation losses in our model might actually be smaller.    And for the to compensate for the losses, thee particle beams energy per particle must be slightly higher, for example 30 Kev instead of 25 Kev  With all this in mind, I think that the model we were talking about can produce net energy. So, where am I going wrong in my thinking? Where am I making wrong assumptions?  Any help would be appreciated  EDIT: Forgot to mention that we would actually add an equal amount electrons to the plasma as the number of ions penetrating the plasma to maintain quasi neutrality.  EDIT: This  is also completely different from other questions on stack exchange. First off, I try to use confined quasi neutral plasma as a target instead of just 2 beams to increase number densities. This has NOT been asked or reviewed in the posted questions.   EDIT: I just realized that we could use a helical magnetic field to make the particles spiral. So, the particles would spiral around the field lines and along the field lines. The lower the pitch of the helix, the more the particles interact with the plasma. So this would increase collision cross sections drastically wouldn't it? Are there any disadvantages in doing this?


Partial sum of divergent series $f(k) = \sum_{n=1}^{m}{(-1)^{n+1}n^k}$

I would like to calculate partial sum of divergent series: $$f(k) = \sum_{n=1}^{m}{(-1)^{n+1}n^k}$$ From wolframalpha.com I know that: $$f(0) = \frac{1}{2}((-1)^{m+1} + 1)$$ $$f(1) = \frac{1}{4}(-2(-1)^{m} m + (-1)^{m+1} + 1)$$ $$f(2) = - \frac{1}{2} (-1)^m m (m+1)$$ $$(...)$$ How can I calculate partial sum of this divergent series without any software?


As per , there is a toggle that can be used to enable/disable Autoplay feature on YouTube. However, I cannot fine this toggle in :  Could someone give a hint?


Hi I'm trying to build a palindrome but it seem to be not working, please could you help. I'm expected to catch true on dad and false on other things  public static void main(String[] args) {      Scanner input = new Scanner(System.in);     System.out.println("Enter Your User Name");     String userInput =input.nextLine();     System.out.println(abcDEF(userInput)); } static boolean abcDEF(String userInput) {     StringBuilder s1 = filter(userInput);     StringBuilder s2 = reverse(userInput);     return s1.toString() == s2.toString(); } static StringBuilder filter(String userInput) {     StringBuilder sb = new StringBuilder();     char[] inputData = userInput.toCharArray();      for (int i = 0; i < userInput.length(); i++) {         if (userInput.matches("[a-zA-Z0-9]+")) {             sb.append(inputData[i]);         }     }     return sb; }  static StringBuilder reverse(String userInput) {     StringBuilder sb = filter(userInput);     sb.reverse();     return sb; }


In a formal / professional email (i.e. emails directed at potential employers, co-workers and administrators), is it okay to exclude the greeting after the first email?  For example, I will send an email in the form:     [Formal greeting]   [Message body]   [Formal salutation]   I will typically then receive an email of the same form. After this point, is it necessary to keep including a formal greeting, or even a formal salutation?  I generally do not keep saying "Hello" (or include any other greeting) in the same email thread after having said it once in the initial email. I may include another greeting if I am emailing the same person after at least a day in between emails, or if starting a new email thread.  I will also generally omit the salutation and just place my name or signature at the end of the email after the initial greetings / emails as well.  What are everyone's thoughts on this? I am referring specifically to formal and professional situations and not casual emails with friends or co-workers who you may have already been working with for a while.


I am trying to calculate $R^2$ (variance explained) for a set of data using GLMM's, and . Here's some dummy data.   set.seed(7127) # Number sampled n = 10000 # Average height m = 180   leg     = rnorm(n, 75, 5) torso   = rnorm(n, 75, 5) head    = rnorm(n, 30, 1)  df = data.frame(1:n, sample(leg, n, replace = T), sample(torso, n, replace = T), sample(head, n, replace = T)) df$height = rowSums(df[,2:4]) colnames(df) = c("person", "leg", "torso", "head", "height")   This is height data for 1000 people, measured as three components of height (leg, torso, and head) which sum to give total height. I want to have an $R^2$ value for each of the three components, where $R^2$ is how much of the variance in height is explained by leg length, torso length, and head length individually.  To do this I have made 3 models where each component is modelled as a fixed effect, with a random effect (randomly assigned the group 1 or 2, these could be analogous to sex [male or female]), as well as a random effects only model (order in code is null, leg, torso, head).  mod0 = lmer(df$height ~ 1  + (1|df$random)) mod0  modL = lmer(df$height ~ df$leg   + (1|df$random)) modL   modT = lmer(df$height ~ df$torso     + (1|df$random)) modT  modH = lmer(df$height ~ df$head  + (1|df$random)) modH   Following the protocol of  I have tried to calculate Marginal and Conditional $R^2$ values for each component of height (order in code is leg, torso, head).  # Marginal R squares VarFixedL = var(fixef(modL)[2]*getME(modL,"X")[,2]) R2M_L = VarFixedL / (VarFixedL + VarCorr(modL)$df[1] + attr(VarCorr(modL),"sc")^2) R2M_L  VarFixedT = var(fixef(modT)[2]*getME(modT,"X")[,2]) R2M_T = VarFixedT / (VarFixedT + VarCorr(modT)$df[1] + attr(VarCorr(modT),"sc")^2) R2M_T  VarFixedH = var(fixef(modH)[2]*getME(modH,"X")[,2]) R2M_H = VarFixedH / (VarFixedH + VarCorr(modH)$df[1] + attr(VarCorr(modH),"sc")^2) R2M_H  # Conditional R squares R2C_L = (VarFixedL + VarCorr(modL)$df[1]) / (VarFixedL + VarCorr(modL)$df[1] + attr(VarCorr(modL),"sc")^2) R2C_L  R2C_T = (VarFixedT + VarCorr(modT)$df[1]) / (VarFixedT + VarCorr(modT)$df[1] + attr(VarCorr(modT),"sc")^2) R2C_T  R2C_H = (VarFixedH + VarCorr(modH)$df[1]) / (VarFixedH + VarCorr(modH)$df[1] + attr(VarCorr(modH),"sc")^2) R2C_H   The results suggest that the variance in height is largely explained by leg and torso length (~49% each). (Edit: I have tested this on the sample data provided by the Nakagawa & Schielzeth paper and reproduced their results, but would appreciate feedback on whether this is correct).  > R2M_L [1] 0.4869814 > R2M_T [1] 0.4909379 > R2M_H [1] 0.02097508  > R2C_L [1] 0.4871594 > R2C_T [1] 0.4909379 > R2C_H [1] 0.02097508   Here the two types of $R^2$ are (virtually) identical. If I introduce variance as a result of the random group (e.g. df$height = ifelse(df$random == "2", df$height, df$height+rnorm(n, 10, 1))) I get differences between the two types, could someone explain the difference between the Marginal and Conditional $R^2$. Why would one be better or, when would one be more appropriate, than the other? Why do they react differently to the addition of random or unmeasured variance components?


Which virtual function in C++ will be called

class A {     int a; public:     A()     {     }     virtual void f1()     {         cout<<"A "<<endl;     }     virtual void f2()     {         f1();     } };  class B: public A {     int b; public:     B()     {     }     void f1()     {         cout<<"B "<<endl;     } };  int main(void) {     B obj;     obj.f2(); }   o/p - B  I am running this code on visual stdio 2010. Please explain Why class B's function f1() is called? and why not class A's function f1().


How do I get notified about a new question in my favorite tag?

Is there a way to get notified if a new question is posted in one of my Favorite tag other than me clicking on the tag or browsing through new questions all the times?  I have a favorite tag (Bloomberg) with low monthly number of questions in it (around 30-40).  And since I can be of great help in that area to other people, I would like to see if there a notification system in place (such as email).


SQLite Result are the Same but Python says False

Trying to prevent a user from paying credits to themself in a discord bot. Heres the code: @client.command() async def pay(ctx, receiver: str, amount: str):     c.execute("SELECT * FROM users WHERE UserID=?", [str(ctx.author.id)])     user = c.fetchone()      c.execute("SELECT * FROM users WHERE Username=?", [receiver])     receiver = c.fetchone()      print(user)     print(receiver)      if amount.isdigit():         amount = int(amount)          if receiver is not None and receiver[4] is not client.user.name and receiver is not user:             if amount > user[3]:                 await ctx.send(client.get_user(ctx.author.id).mention + " You do not have enough credits.")             else:                 userNewCredit = user[3] - amount                 receiverNewCredit = receiver[3] + amount                 c.execute("UPDATE users SET Currency=? WHERE UserID=?", (userNewCredit, str(ctx.author.id)))                 conn.commit()                 c.execute("UPDATE users SET Currency=? WHERE UserID=?", (receiverNewCredit, receiver[0]))                 conn.commit()                 await ctx.send(client.get_user(ctx.author.id).mention + " You have successfully paid " + client.get_user(int(receiver[0])).mention + " " + str(amount) + " credits.")          else:             await ctx.send(client.get_user(ctx.author.id).mention + " You must enter a valid username. Make sure to include the # and numbers. You may not pay yourself.")      else:         await ctx.send(client.get_user(ctx.author.id).mention + " You must enter a postive integer.")  When the user tries to pay themself, it takes the money and doesnt add it back. However, the main issue is that the if statement should not execute at all. Printed the user and receiver variable. ('204808276397785088', 2, 131, 20, 'Maksimum#6716') and ('204808276397785088', 2, 131, 20, 'Maksimum#6716')


Please check both sentences and let me know, which one is correct and why?   She compares me with her boyfriend.  She compares me to her boyfriend.


How do I see what is being tested in Chrome Canary, on an ongoing basis?

What advances are being tested in Canary?  How is feedback from users/testers received and responded to?


Tendency of using pronouns 'she/her' when talking about a random person

Reading different specifications and manuals I've noticed that more often and often pronouns she or her are being used when some unknown person's behavior is described.  For example: "when user opens the first screen, let she be notified about something" or "let user input her address". Actually, I've seen more versatile examples but cannot remember anything nice now.   Is it a last-years tendency? Or is it something only UK-specific? Are there any rules about it? Or, maybe, is it applicable only for written document/spoken language?  I'm not an informant (as you've already guessed) and it's very important to me how should I write in official correspondence with British/US customers and not to hurt their feelings?


Find all positive integers n, such that $n2^n+1$ is divisible by $3$

Find all positive integers $n$, such that $n2^n+1$ is divisible by $3$ I was trying to solve with normal Diophantine equation but couldn't get and don't know much about modular arithmetic . Please help me out in this


So, I'm learning about Latex, I've read the entire TeX and LaTeX wikipedia pages, trying to understand what is this all about. Already installed TexWorks and MikTex in my windows. I know how to create PDF articles with nice math notation, and beamer presentations, but in essence I don't really know what I'm doing. I know that TexWorks isn't really necessary, I could use only the MikTex.   What I want to know is: what's the difference of TeX and LaTex, and what's the really minimum setup that I could use to just display a simple math equation. I don't really need complicated editors, it could be just via command line. I'm asking this because I want to understand the inner working of TeX or LaTex so I can develop something that I'm thinking would be nice. So, I'm here to learn.  I don't know where or what type of program I'm running on my computer, who or what compiles the .tex file, and how my article is transformed to PDF. I'm really lost. I appreciate any kind of help. I'm tired of installing programs and lots of packages without knowing what they do, so I would really love to learn about the LaTeX inner workings.


How do I change a username? (shortname and home folder)

Under Linux, this would be a no brainer. Just go into /etc/password and edit that, and rename the directory in /home.  I want the new shortname and the new home folder to match after the change.


Registered Apple Developer Agreement when under 18

When I registered to be an Apple Developer, I inadvertently did so without realizing the requirement to be 18 years of age (I was 17 and 6 months away from being 18 at the time). I did not take out any sort of paid membership at the time, however.  I am now 20, will this cause me any problems now or is it nothing I need to worry about?


How can I add the bibliography in a report with its own section, including number?

I'm writing my thesis as a report document using TeXShop (pdflatex and bibtex) and want the bibliography to get its own section number and appear in the table of contents. Here's what I've tried so far and the problems arising:  \addcontentsline{toc}{section}{References}   Does not add the section number, not in the toc and naturally not in the section title.  \cleardoublepage \renewcommand*{\bibname}{\section{References}} \bibliographystyle{plain} \bibliography{bibliography}   Error: ! Incomplete \iffalse; all text was ignored after line 1.  \cleardoublepage \section{References} \renewcommand*{\bibname}{} \bibliographystyle{plain} \bibliography{bibliography}   The only problem this leaves is that this starts the actual bibliography on the next page after it inserts 2.5 References. Otherwise I would be happy with this solution. How can I solve this issue?


bash history: can't retrieve commands/commands not saved

I suddenly got a problem with my bash history. When I type history, it only shows:  1  history  I tried following commands: set -o | grep history  echo $HISTFILE echo $HISTSIZE echo $HISTFILESIZE  and I got, respectively, the following results: history         on /home/mary/.bash_history 1000 2000  I added also to my bashrc, the following lines: # Avoid duplicates HISTCONTROL=ignoredups:erasedups # When the shell exits, append to the history file instead of overwriting it shopt -s histappend  # After each command, append to the history file and reread it PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"  Everything seems OK but I can't scroll back to retrieve commands and the reason seems the fact that nothing has saved in history and that is why the command history does not contain anything. Could you please help me to solve this issue ?


I am wanting to replace my Operating sytem hard drive with 2 SSD drives. Well possibly just 1 but I am curious about doing 2 in a RAID-0 setup for even more improved speed.  What exactly would I need to run 2 SSD drives in a raid0 setup?


Ubuntu 12.04 installation input/output error

I have been trying to install Ubuntu 12.04 on my system since tomorrow, I know there newer versions of Ubuntu available, but still I want to install this version only.  I'm repeatedly getting the same error when I try to install Ubuntu on my system. I checked the md5 hash of the ISO file i downloaded but it is correct. I'm installing Ubuntu from my USB drive.  Please help me out, I need an OS to be installed on my PC. Because I don't have one.


Easy summation question: $S= 1-\frac{1}{2}+\frac{1}{4}-\frac{1}{8}+\frac{1}{16}\cdots$

While during physics I encountered a sum I couldn't evaluate: $$S= 1-\frac{1}{2}+\frac{1}{4}-\frac{1}{8}+\frac{1}{16}\cdots$$ Is there a particular formula for this sum and does it converges?


Question Find the value of p for which the function f(x)=$\left(\frac{\sqrt{p+4}}{1-p}-1\right)x^{5}-3x+ln5$ decreases   $\forall$x $\in\mathbb{R}$   MY Approach$\Longrightarrow$f'$\left(x\right)$= $\left(\frac{\sqrt{p+4}}{1-p}-1\right)5x^{4}-3$$\leq$0$\Longrightarrow$$\left(\frac{\sqrt{p+4}}{1-p}-1\right)\leq$$\frac{3}{5x^{4}}$$\Longrightarrow$$\left(\frac{\sqrt{p+4}}{1-p}-1\right)<0$$\Longrightarrow$x $\in$$\left(-\infty,\frac{3-\sqrt{21}}{2}\right)$$\bigcup$ $\left(\frac{3+\sqrt{21}}{2},\infty\right)$  But Book Says Answer is $\left[-4,\frac{3-\sqrt{21}}{2}\right]$$\bigcup$$\left(1,\infty\right)$


How do I use the ga() function in Google Analytics when the tag is in Google Tag Manager: Uncaught ReferenceError: ga is not defined

I'm following :   But in my real code, I've used google tag manager to manage google analytics. So I have just one script in the head of my website which belongs to gtm:  (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-P8F58CT');  ga('create', 'UA-124402662-1', 'auto'); // Uncaught ReferenceError: ga is not defined   As you can see, I've added ga('create', 'UA-124402662-1', 'auto') right after that google tag manager (the same as the tutorial I've linked in the first line of my question). And I have a ga('send', 'pageview', newURL); code which will be executed when the page changes using ajax.  The problem is it throws: (as I've commented in code above)     Uncaught ReferenceError: ga is not defined   How can I fix it? Someone told me no need to add ga('create', 'UA-124402662-1', 'auto'); at all, and gtm will handle it all. But in my tests:   When I open my website (homepage), and run ga('send', 'pageview', "/adv"); in the console, nothing changes in google analytics and it still points to the homepage. When I open my website (homepage), and run ga('create', 'UA-124402662-1', 'auto'); and then run ga('send', 'pageview', "/adv");, then the google analytics will be changed to the /adv (not homepage anymore). So I believe ga('create', 'UA-124402662-1', 'auto'); is needed. But why it is undefined?


Is the university really important for picking a PhD?

I want to study for a PhD in robotics. The research laboratory is a renowned one but the associated university is not. In fact, the laboratory is part of a research institute. Do you think that would be a desadvantage knowing that I intend to work in the industry after the Phd and not in academics?


Is it wrong to tell children that $1/0 =$ NaN is incorrect, and should be $∞$?

I was on the tube and overheard a dad questioning his kids about maths.  The children were probably about 11 or 12 years old.   After several more mundane questions he asked his daughter what $1/0$ evaluated to. She stated that it had no answer. He asked who told her that and she said her teacher. He then stated that her teacher had "taught it wrong" and it was actually $∞$.  I thought the Dad's statement was a little irresponsible.  Does that seem like reasonable attitude? I suppose this question is partly about morality.


I would like to use special characters as the german umlaute ä, ö, ü, etc. (also ß) in the source file in plain TeX as I may use them in LaTeX using \usepackage[utf8]{inputenc}. The use of  \input utf8-pl and typesetting with plain TeX leads to the error message "The encTeX extension of TeX is not found“. Is there a way to circumvent this problem? I am using TeXShop Version 3.75 on a MacBook Air with macOS Sierra (Version 10.12.1) and encTeX is apparently part of TeXShop.


Warning: Load biblatex with (biblatex) the "backend=bibtex" option

i am trying to compile a work in Texmaker, but when doing so, the console returns:  Package biblatex Warning: No "backend" specified, using Biber backend. (biblatex) To use BibTeX, load biblatex with (biblatex) the "backend=bibtex" option.   I really do not know what does it means.  My preamble is the next:  \documentclass[12pt,twoside]{report} \usepackage[utf8]{inputenc}  \usepackage{fancyhdr} \pagestyle{fancy} \usepackage{csquotes} \usepackage{biblatex} \addbibresource{bibtex.bib}


Who buys these significantly out-of-money options?

The following is the screenshot of the NIFTY 50 option chain.  It is taken from the  link.    Why are these people buying these significantly out-of-the-money options? In this case, it's the put option of 7300 strike price. It's highly unlikely that the Index will fall more than 500-600 points in this series unless very serious news comes out affecting the entire economy.  Even if the index falls by, let's say, 500 points, the value for that option won't change more than 0.50 or such price.  Specifically, what strategy are these people following where they could possibly benefit from buying such an option?