Could we declare a pointer of the class's type in the class declaration?
What are the differences between struct and class in C++?
why is my screen black after rdp connection? After connecting from my home via remote desktop, both my screens are black when I arrive at work. The only thing I can see is a mouse pointer on one of the screens. I then seem to have only two choices: rebooting or working from a remote desktop connection, which works fine.  It did happen every time I tried last week.  However, I did the same from my laptop in a meeting room today, and I didn't have any problem. Dynamically Determine Calling Context? We have various ways of invoking apex. Triggers, Inbound Webservices, @InvocableMethod,@RemoteAction and what not. Often we call some or other utility methods from these execution contexts. I have some generic utility method,that should behave differently from the context it is called?  I know about Trigger.isExecuting but it only tells if its running in trigger context or not.  I have a utility method that creates lead from Webservices, VF button click and via Lightning . Whenever we create a lead I want some special operations to be done via the source it was originated.(Its not just updating a simple field leadSource, I have some methods that creates some childs and update other records of other type) . I can achieve this by passing an extra parameter to utility method to tell about source, but i have then to edit hundred of other class that uses this utility method. If i could dynamically find out via which context this piece of code is running,then i would have to change only one class to satisfy my requirement.    Is there something in APEX that tells in what context the apex method was called? subequations and array in braces I need something like this:  \left\{ first line  (1a) second line (1b) third line  (1c) \right.   all lines should be aligned to left I'm travelling to country X. I want to install an application which isn't available in my country, but is available in country X; but I prefer to download and install it in advance, while the data connection is still cheap.  Unfortunately, the Play Stores does not allow me to install this app. Is there any way to circumvent this limitation? On , I have my favorite tags filter. I setup email notifications for it and now I'm thinking I overdid it on the frequency. Trying to change the settings, I clicked on the edit link in the email notifications box to the right, except nothing happens. There are no JavaScript errors and the HTML for the link is simply &lt;a class=&quot;edit&quot;&gt;edit&lt;/a&gt;. This seems like unfinished planned feature. Update: Using Chrome Version 29.0.1547.66 m Same on Firefox 23.0.1  Both edit links are not working. Further Update Events capture:  Update 2014-02-03: Here's what the subscription tab in the network profile looks like. LaTeX/BibTex not arranging citations by order of appearance I am having an issue with LaTex/Bibtex presenting my citations in order of appearance. I know there a plenty of questions on this and I have read some of them, but the solutions posted don't seem to do me any good. I am using MacTeX and TeXmaker.  I am writing a large document, like a Thesis. Chapters are split between individual Tex files and included using the \include command.  I have a large .bib file that is maintained by Mendeley (program I use for storing my references and producing a BibTex file).  I am using the package, cite (mainly for doing references like [1-3,6,9])  I have a pretty standard looking document.  \documentclass[11pt,a4paper]{report} \setcounter{secnumdepth}{3} \setcounter{tocdepth}{3} \newcommand{\doubleSignature}[3][Alex Mason]{% \parbox{\textwidth}{ \centering #3 \today\\ \vspace{2cm}  \parbox{7cm}{   \centering   \rule{6cm}{1pt}\\    #1  } \hfill \parbox{7cm}{   \centering   \rule{6cm}{1pt}\\   #2 } } } \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} %\usepackage[sorting=none]{biblatex} %\bibliography{Alex} % Where journals.bib and phd-references.bi \usepackage[pdftex]{graphicx} \usepackage{enumerate} \usepackage{nomencl} \usepackage{wasysym} \usepackage{booktabs} \usepackage{cite} \usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry} \graphicspath{{./Diagrams/}} \usepackage[labelfont={sf,bf}, margin=1cm]{caption} \usepackage{subcaption} \renewcommand{\figurename}{Fig.} \renewcommand{\tablename}{Tab.} \renewcommand{\bibname}{References} \author{NAME (MEng)} \title{TITLE} \date{\today} \makenomenclature %------------------------------------------------ \begin{document} \maketitle \pagenumbering{roman} %-----------------------------------------------certificate of originality----------------      -------------------------------------------- \input{CertofOrigin} \begin{abstract} ABSTRACT \end{abstract} %-----------------------------------------------contents------------------------------------------------------------ \tableofcontents \listoffigures \addcontentsline{toc}{chapter}{List of Figures} \listoftables \addcontentsline{toc}{chapter}{List of Tables} \chapter*{Acknowledgements} \addcontentsline{toc}{chapter}{Acknowledgements} ACKNOWLEDGEMENTS \printnomenclature[1.5in] \addcontentsline{toc}{chapter}{Nomenclature} \pagebreak \pagenumbering{arabic} \include{2ndYearReport_CHAP1} \include{2ndYearReport_CHAP2} \include{2ndYearReport_CHAP3} \bibliographystyle{unsrt} \bibliography{Alex} %\printbibliography \end{document}   The goofy looking part at the top (\newcommand{doubleSig.....) is just for when i input a special page I made containing a certificate of originality spiel with two boxes for signatures and my university logo.  As you can see I am using the standard bibtex way of doing bibliographies by stating the style then the stating the bib file to use right at the end of the document. I have tried biblatex but can't get it to work. It says it hasn't produced the bib file but doesn't really state why.  As far as I am aware everything was working A-OK until I started on the second chapter and began adding citations in there. Now my citations are all messed up and won't correct. My first citation starts with [9]!!!  [1] appears in a figure caption later down the page, after 10, 11 and 12 have been called!  I have tried deleting all the working files (bbl, aux, log etc) but nothing happens. I get the same result. IIRC I used to have this problem with MS Word and is part of the reason why I switched to LaTex...yet it seems to have followed me!   bibtex does through a few warnings when it runs stating that some references are missing journal names or volume numbers. Would that be a reason?  What have I done wrong with my code? Now, that Ubuntu 17.10 is out, and Unity 7 is replaced with Gnome 3, is there a way to install and use Unity7?   I know Unity is still in the repositories, so it should be possible, right? If gravity isn't a force, then why do we learn in school that it is? I have studied some of Einstein's Theory of General Relativity, and I understand that it states that gravity isn't a force but rather the effects of objects curving space-time. If this is true, then why are we instructed in middle school that it is a force? Blowing your own sail? How it this possible? Even if the gif is fake, the Mythbusters did it and with a large sail it really moves forward. What is the explanation? A deck of 52 cards is shuffled, and we deal a bridge of 13 cards. Let $X$ be the number of aces and $Y$ be the number of spades. Show that $X$, $Y$ are uncorrelated.  Here is what I did:  $Cov(X,Y) = E[XY]-E[X]E[Y]$   uncorrelated means $Cov(X,Y) = 0$, hence  $E[XY]=E[X]E[Y]$   $E[X] =  \sum_{k=0}^{k=4} k \frac{\dbinom{4}{k} \dbinom{48}{13-k}}{\dbinom{52}{13}} $   $E[Y] =  \sum_{k=0}^{k=13} k \frac{\dbinom{13}{k} \dbinom{39}{13-k}}{\dbinom{52}{13}} $   Are the summations above correct? and how do I calculate $E[XY]$? How to Sort Multi-dimensional Array by Value? Attaching towel rail to drywall GNOME 2 allows one to either save the session automatically or manually (i.e. save the session as it looks right now). This is a nice feature because it restores the various desktop states between logins (and system restarts):   which apps were open where (physically) on the desktop were they open what specific window sizes were these apps set to   Looking around, I can't find the feature in GNOME 3? Did I not look hard enough? How to check if Node connected to another node input in Python I am doing a process to some switch links in materials. I need to know if something is ever linked or not before to process. I can't find out how to :/ The script works well if something is linked only.  import bpy for m in bpy.context.object.material_slots:     mat = m.material     nodes = mat.node_tree.nodes      # get node input (socket)     alphasocket = mat.node_tree.nodes.get("Principled BSDF").inputs[18]     # get node link that connects into the socket     lnk = (link.from_socket for link in mat.node_tree.links if link.to_socket == alphasocket)      #add emission node     emi= nodes.new('ShaderNodeEmission')     emi.name= "emibak"     outepute= mat.node_tree.nodes.get("Material Output").inputs[0]      #make new link destination     #here 's where I cant find out how to check     if lnk != None:         print(mat.name + " alphanod found")        # mat.node_tree.links.new(lnk, emi.inputs[0])     else :         print(mat.name + " alphanod missing")      mat.node_tree.links.new(emi.outputs[0], outepute)     here is another way I am searching...  import bpy  for m in bpy.context.object.material_slots:      mat = m.material     nodes = mat.node_tree.nodes          print("**** Material " + mat.name+ " ****")      for mat_node in mat.node_tree.nodes:         if mat_node.type == 'BSDF_PRINCIPLED':             print("From " + mat_node.name )                         alphasocket = mat_node.inputs[18]             #print(alphasocket)             node_in = mat_node.inputs             #print(node_in)                    for n in alphasocket.links:                                print("Alpha connected to " + n.from_node.name)   This show me what is connected to the alpha channel but if nothing is connected I want to connect a new node. In the story I'm trying to recall, everybody on their thirteenth birthday (?) is assigned by some kind of brain analysis method a profession and given some kind of pill (?) that instantly (?) grants them the required knowledge and skills to start working immediately. Some professions are more sought after than others, especially in view of the olympic (?) games regularly held on a profession-by-profession basis.  The protagonist, however, is turned down from this system and dismissed with some general reason and has to work his way to adulthood the boring old way: studying from books. Eventually he rejects from his status as a "special" student and goes on the run, hiding from the teachers and envying the normal people.      Eventually, it turns out that the protagonist was actually smart enough that being spoonfed premade information was a waste. What he actually was assigned to was advancing the bundles of knowledge themselves, as well as being front line in the technological progress.  "Somebody has to write those textbooks! You can infuse knowledge about how to use today's technology, but you can't do that for tomorrow's - people that get assigned a profession become tied with their assigned technology and are only as relevant as that. If you want more, you must learn how things actually work, and there's no shortcut for that." (not an actual quote, but a specific passage as I remember it.)  The troubles the protagonists underwent were actually planned and necessary for him to acknowledge and accept his role in society.   This story was certainly longer than a couple pages, but it wasn't very long either. If it's a short story, it was probably written by Asimov, but I can't be sure. It rings me of Brave New World given the theme of government-issued population planning, but it certainly doesn't fit with anything else in the actual plot. Any idea? How can I get barcode-scan information into my photo metadata, onsite, untethered? I need a DSLR camera with a barcode scanner for on-site tours photography, which means it needs to be untethered! The image would have to contain the barcode scanned information in the image metadata or in the name itself.  I've seen solutions like, Foolography and a $2600 Canon Studio Edition launched in 2010. But I'm not sure of either those products!  So I'm asking the gurus here how I can get this working, which camera would I need and any accessory necessary?  I'm trying to recreate something like I saw the on-site volume photographers do in Disney's parks. I'm trying to include a tabu inside a new definition of an environment but it fails if the postamble (enddef) of the new environment includes tabu's contents, so cells. With tabular or tabular* works. The error is:   ! Missing number, treated as zero. \tabu@0.H5   The MWE:  \documentclass{article} \usepackage{tabu} \newenvironment{testt} {\begin{tabu} to \textwidth{cccc}  11 &amp; 12 &amp; 13 &amp; 14 \\  21 &amp; 22 &amp; 23 &amp; 24 \\} {  41 &amp; 42 &amp; 43 &amp; 44 \end{tabu} }  \begin{document}  \begin{testt}  31 &amp; 32 &amp; 33 &amp; 34 \\ \end{testt} \end{document}   How to solve this? I recently bought myself a pack of four YN560 IV's and a YN560-TX for my Canon camera, and apparently I got ahead of myself and didn't realise I should make sure the flashes support HSS.  I tried them out yesterday at home, and even on 1/128 and 1/250s on the camera, they were overexposing here and there. Unfortunately, I don't really have the space to move the flashes much further from my subject, so I was wondering if there is any way to trick them into HSS? I should mention that I also own a Canon 580ex II, which does support HSS. I was thinking I could perhaps use that mounted on the camera to trigger the Yongnuo's, but as far as I can tell that would render the 560-TX useless as the flashes can't be controlled wirelessly when in S1 or S2.  I guess I could buy an ND filter, but as I have lenses with differing sizes, this feels like more of a pain in the ass.  Is there any hack I can pull off here that you guys know of?  Thanks! Column and row padding in tables A cannonball is launched from a point 100 m above ground, at a speed of 20 m/s. This is modelled by the equation $h(t)=-4.9t^2 +20t +100$ The speed of sound (of the cannonball is) 380m/s If a person sitting directly underneath the cannonball runs as soon as they hear the sound do they escape the cannon? My main question is &quot;$y=-380x+100$&quot; the correct equation to model the cannon's sound?