I am tried to add a custom main menu in QGIS Desktop Application. Here I am already added custom sub menu in QGIS but I want to add a custom main menu in QGIS using Python.  See the blow image.

I need to add new menu item to the top level menu of QGIS Desktop (2.7.0); I.e. it shall be on same level as "Project", "Edit", "View", "Layer" etc.  As far as I know there is pretty nice way how hide menu items (Settings->Customization) Plus using QgisInterface () I can add new items to Menus already defined in QGIS (addLayerMenu, addPluginToDatabaseMenu etc) from my plugin code.  But I need new Menu item on top layer (this is req from customer).


Is there a method to wrap a contact form with another block and make them together a new block or something?  I want to put some information next to the contact form and put them together in a container. Furthermore I want to place other blocks above and under it, so I prefer not to edit in the region twig file.  Note: I want to have some text next to my contact form. So it doesn't neccesary have to be a block, but that was the first that came up to me.

I have to embed a contact form inside of a block, and I'm trying to use the entity.form_builder service, But I'm not sure which entity I should give it, I found Message and ContactForm entity, so what I'm thinking is to create a contact form entity and give it to the entityFormBuilder->getForm($contactFormEntity)  My current code is:  <?php   /**  * @file  * Contains Drupal\pid_contactform_block\Plugin\Block\TellUsYourStoryBlock  */  namespace Drupal\pid_contactform_block\Plugin\Block;  use Drupal\Core\Block\BlockBase; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Symfony\Component\DependencyInjection\ContainerInterface;  /**  * Class TellUsYourStoryBlock  * @package Drupal\pid_contactform_block\Plugin\Block  * @Block(  *     id = "tell_us_your_story_block_id",  *     admin_label = "Tell us your story block",  *     module = "pid_contactform_block"  * )  */ class TellUsYourStoryBlock extends BlockBase implements ContainerFactoryPluginInterface {     protected $entityFormBuilder;  public function __construct(array $configuration, $plugin_id, $plugin_definition, $entityFormBuilder) {     parent::__construct($configuration, $plugin_id, $plugin_definition);     $this->entityFormBuilder = $entityFormBuilder; } /**  * Builds and returns the renderable array for this block plugin.  *  * If a block should not be rendered because it has no content, then this  * method must also ensure to return no content: it must then only return an  * empty array, or an empty array with #cache set (with cacheability metadata  * indicating the circumstances for it being empty).  *  * @return array  *   A renderable array representing the content of the block.  *  * @see \Drupal\block\BlockViewBuilder  */ public function build() {     return $this->entityFormBuilder->getForm();  }  /**  * Creates an instance of the plugin.  *  * @param \Symfony\Component\DependencyInjection\ContainerInterface $container  *   The container to pull out services used in the plugin.  * @param array $configuration  *   A configuration array containing information about the plugin instance.  * @param string $plugin_id  *   The plugin ID for the plugin instance.  * @param mixed $plugin_definition  *   The plugin implementation definition.  *  * @return static  *   Returns an instance of this plugin.  */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {     return new static(         $configuration,         $plugin_id,         $plugin_definition,         $container->get('entity.form_builder')     ); }   }  My question is basically:   Am i doing it the right way? How do I initialize the ContactForm entity correctly, if I am right, should I just import it or should I require it through a service or something? If I'm not right, do you have any idea how I should do it then?


*Edited  I am using the subcaption as mentioned in this link    I am expecting the caption to start from 'a', but the caption starts from 'c'. Any help would be appreciable.  \makeatletter \newcounter{parentsubcaption} \newenvironment{subsubcaption}  {\refstepcounter{sub\@captype}%   \protected@edef\theparentsubcaption{\@nameuse{thesub\@captype}}%   \setcounter{parentsubcaption}{\value{sub\@captype}}%   \setcounter{sub\@captype}{0}%   \@namedef{thesub\@captype}{\theparentsubcaption--\arabic{sub\@captype}}%  % \ignorespaces }{%   \setcounter{sub\@captype}{\value{parentsubcaption}}%   %\ignorespacesafterend } \makeatother  \begin{figure*}[!htb]  ------------------------------------ \begin{subsubcaption} \begin{subfigure}[t]{0.5\textwidth} \centering \includegraphics[height=2.3in]{fig1.eps} \caption{} %\label{4.1 a} \end{subfigure}%    ~ \begin{subfigure}[t]{0.5\textwidth} \centering \includegraphics[height=2.15in]{fig2.eps} %  \caption{} %\label{4.1 b} \end{subfigure} \end{subsubcaption}  %-------------------------------- \begin{subsubcaption} \begin{subfigure}[t]{0.5\textwidth} \centering \includegraphics[height=2.3in]{fig3.eps} \caption{} %\label{4.1 a} \end{subfigure}   ~ \begin{subfigure}[t]{0.5\textwidth} \centering \includegraphics[height=2.15in]{fig4.eps} %  \caption{} %\label{4.1 b} \end{subfigure} \end{subsubcaption} \caption{}  \end{figure*}  \begin{figure*}[!t] %------------------------------------------------------- \begin{subsubcaption} \begin{subfigure}[t]{0.5\textwidth} \centering \includegraphics[height=2.3in]{fig5.eps} \caption{Est. $F_c$ of Original Speech Signal} %\label{4.1 a} \end{subfigure}% ~ \begin{subfigure}[t]{0.5\textwidth} \centering \includegraphics[height=2.15in]{fig6.eps} %  \caption{}  \end{subfigure} \end{subsubcaption}  \nopagebreak %------------------  \begin{subsubcaption} \begin{subfigure}[t]{0.5\textwidth} \centering \includegraphics[height=2.3in]{fig7.eps} \caption{} %\label{4.1 a} \end{subfigure}% ~ \begin{subfigure}[t]{0.5\textwidth} \centering \includegraphics[height=2.15in]{fig8.eps} %  \caption{} %\label{4.1 b} \end{subfigure} \end{subsubcaption} \caption{}  \end{figure*}   This code is working fine. i.e. Caption starting from 'a'. But if i copy the same code and make an another set of figure. I was expecting it to start from 'a', but it continues from 'c'

I am new to LaTeX. I am not sure how to frame my question. But I will frame it so that it is understandable.  I would like to make a subfigure, but the caption must be   caption of subfigure a-1                caption of subfigure a-2      caption of subfigure b-1      caption of subfigure b-2                    `caption  of entire figure`   I  tried using subfigure, but I am getting continuously a,b,c,d, but i need to name them as as mentioned above (a-1, a-2, b-1, b-2).  In my situation, there are chances that the sub figures might be in different pages.


I have read that it can be proven experimentally and it occurs to all fermions.

I can't seem to connect these two stories. Can you please help?  I have heard that you have to turn electron by 720 degrees in order to get the same spin state. Has this been seen experimentally? How do you turn an electron?  I know that Bloch sphere is used to explain spin states. I sort of understand how it works and how matrices can be constructed. However there you turn the vector by 360 degrees in order to get the same state. Why so? (Is that in reality you have to turn twice as much?)


I received a call which was for my colleague. he was not at his seat at that time hence I told caller I will inform him about his call once he returned to his seat.   How should I inform to my colleague?  Xyz had called you, Please call him  Or  Xyz called you, Please call him  I know there is one more way to say this  Xyz's call for you Please call him  According to me simple past is enough here because I want to refer only one past event.   Please help

I have never had this problem before. But after seeing some questions posted on ELU, I started to doubt. I have been through links1, pages of grammar books2, a lot of questions3 posted here and ELU. I now still can't seem to understand how the past perfect is exactly used. The references sometimes even contradict each other.  What I had understood so far was      The past perfect is not necessary if we are not 'going back' to the earlier past, and simply moving from one event to another.   but I then saw a lot of other 'rules' including      If the sequence is clear, the past perfect is not needed.   which is slightly different, less 'narrow' and can be applied in more situations than the first ruleA, and      The past perfect is optional only when talking about an action at a specific time.   This is confusing. Can anyone here clarify things out please?    A For example, for  Doing the survey [completed] -> Showing the result      We showed the result of the survey we did.      If the second rule is applied, the sentence above is fine (the sequence is clear), but not if the first rule since we are not moving from any event to the next and possibly even going back.    1  and   2 Practical English Usage (2005) by Michael Swan, Collins Cobuild Student's Grammar (1991). Upper-Intermediate Cutting Edge.  3 including , , ,  etc.


In short, I have a plane, with an image texture on it, which will act as a flower.   My question is, since I need 21 different flowers, can I duplicate that first plane (flower), on which I already have set up a node tree, so that the duplicated one shares the same node tree but has different image (texture)? That would mean also for the next 20 planes (textures)?   Or do I need to keep adding plane by plane, applying textures on each one of them, and for each have 21 node trees (that are basically the same).  Just for the records, if it means anything for this process, I intend to group those flowers in one group, which would act as particle emitter, so that I end up with an animation of falling flowers (i would set one big plane as emmiter of particles, which i would ofcourse link them to the group, which would made the particles to be the actual flowers, that would fall randomly...)  Please, anyone knows if I can duplicate that way, and how? It would simply save me a lot of time.  Thanks a lot!

Is it possible to share a single material across several objects but have control over some aspect of the material (e.g. factor on a fade node) on individual objects. Each object can be associated with an individual FCurve. I am currently building N identical materials for N objects, but its getting old. Thanks.


An ideal $P$ is called a prime ideal if whenever $ab\in P$ we have either $a \in P$ or $b \in P$.  I am confused about how to connect the definition with with $\langle p\rangle$.

In the ring $\mathbb{Z}$ the following conditions on a nonzero ideal $I$ are equivalent: (i) $I$ is prime; (ii) $I$ is maximal; (iii) $I=(p)$ with $p$ prime.


I'm new to Bash. From the :     You want to find every file in ~/mydir and all its subdirectories, recursively, with a file extension of .htm (or .HTM or .Htm...) and delete it. I've seen a lot of attempts like rm -rf ~/mydir/*.htm which really don't come close. The correct solution is  find ~/mydir -iname '*.htm' -exec rm {} \;       -iname says that you want to do a case-insensitive search on the filename. '*.htm' is in single quotes to prevent bash from expanding the *, which will produce unexpected results.      Question: What does asterisk produce with and without the quotes? Why would you decide to use quotes versus not?

I read many questions and answers like  and   I know wildcards are expanded by the shell before running a command and they are a feature of the shell.  Also wildcards work with those commands that can accept many arguments.  In find . -name *.rb  if we have more than one file in the current directory find will give us an error because find cannot accept multiple arguments and the ways to solve this are:  find . -name "*.rb" find . -name '*.rb' find . -name \*.rb   We escape the asterisk and prevent expansion by the shell but wildcards are a feature of the shell; when we escape the asterisk shell does not know about its meaning, and it should find a file named *.rb, so how is the asterisk being expanded in this case?


I have an if statement the check if all item is selected or not  (Android )  if(region_id == null && City == SelectAll && Distric == SelectAll && itemid== SelectAll){            // DO something  }else{ if(City == SelectAll && Distric == SelectAll && itemid== SelectAll){            // DO something           }else{       if(Distric == SelectAll && itemid == SelectAll)){        // DO something           }     }//end else }//end else   My issue that if dos not working

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I have two div tags as below

hi

i m on top

   I want to display the upper div first, followed by the lower div but I can not change the declaration order in HTML.  I am using the following css  #outer{     position:relative; } #upper{     position:absolute;     top:0; }   But the upper is overlapping with lower.  UPDATE  I tackled the situation in following way as it does not disturb the design

displayed in second line

       displayed in first line
       By using the above code i perfectly tackled my use case. Thanks for everyone for giving answers

Given a template where the HTML cannot be modified because of other requirements, how is it possible to display (rearrange) a div above another div when they are not in that order in the HTML? Both divs contain data that varies in height and width.

         Content to be below in this situation

         Content to be above in this situation

 Other elements   Hopefully it is obvious that the desired result is:  Content to be above in this situation Content to be below in this situation Other elements   When the dimensions are fixed it easy to position them where needed, but I need some ideas for when the content is variable. For the sake of this scenario, please just consider the width to be 100% on both.  I am specifically looking for a CSS-only solution (and it will probably have to be met with other solutions if that doesn't pan out).   There are other elements following this. A good suggestion was mentioned given the limited scenario I demonstrated—given that it might be the best answer, but I am looking to also make sure elements following this aren't impacted.


I know that order type $\omega + 1$ can be well-ordered, but I am not sure if real numbers on $[0,1]$ can be well-ordered.

So, from what I understand, the axiom of choice is equivalent to the claim that every set can be . A set is well ordered by a relation, $R$ , if every subset has a least element. My question is: Has anyone constructed a well ordering on the reals?  First, I was going to ask this question about the rationals, but then I realised that if you pick your favourite bijection between rationals and the integers, this determines a well ordering on the rationals through the natural well order on $\mathbb{Z}$ . So it's not the denseness of the reals that makes it hard to well order them. So is it just the size of $\mathbb{R}$ that makes it difficult to find a well order for it? Why should that be?  To reiterate:   Is there a known well order on the Reals? If there is, does a similar construction work for larger cardinalities? Is there a largest cardinality for which the construction works?


How does one write text such that whatever comes next is placed as if the text had not been written?  Edit: More specifically, I would like to place text in the top-left corner of a tikzpicture by writing the text right before the figure and anchoring the figure as if the text had not been written. Here is an attempt I made that does not work:  \documentclass{article} \usepackage{tikz} \begin{document}  \newcommand{\imagetop}[1]{\vtop{\null\hbox{#1}}}  \makebox(0,0){a} \imagetop{%     \begin{tikzpicture}         \draw (0, 0) rectangle (1, 1);      \end{tikzpicture} } \makebox(0,0){b} \imagetop{%     \begin{tikzpicture}         \draw (0, 0) rectangle (1, 1);      \end{tikzpicture} }  \end{document}

I've seen hbox, vbox, mbox, parbox and others used in various code samples. What are the different kinds of box in (La)Tex? Which are suitable for use in LaTeX, as opposed to plain TeX?


As you know, when you edit a post in SE communities (like SO), sometimes your edition will be a new version, and sometimes else the current post will be just updated.  According to some tests, I figured it out:   when there is a comment under the post after the last version, it will create a new version if you edit the post. When 10 minutes passed since the last edition, then it will create a new version if you edit the post.   Anything else?

When answers are posted within a question's initial grace period, it is possible that further edits could completely change the question (see ""), and render those first few answers incorrect.   Worse yet, nobody is notified that there was a change to the question, except those that are sitting on the page and notice the edit bar pop in. And of those, only those bothered enough to open it in a new window to compare the differences, will see how much was changed.   After the grace period is up, nobody will be able to consolidate why the first few answers actually answered a different question. And the answerers won't know unless someone comments or down-votes (and in the latter case, without context, they still might have trouble understanding, unless they memorized the question's initial state).  Jon Skeet stated it pretty well in  on :     I'd like this to apply to the question, as well as answers. Sometimes I (or others) have added perfectly good answers, but then the question has been changed within the grace period, making answers look foolish without any indication of what's happened.   So this time, my proposal is quite simple:     Once an answer is posted to a question within the initial grace period, a new grace period should start, and the current state of the question should be saved as the first revision. Further edits within the next 5 minutes will be aggregated into a new, second revision.   This will only noticeably affect questions where answers are posted within the grace period and the author of the question makes edits within 5 minutes of the first answer. (Effectively, it would treat it as if a different user made an edit within the author's grace period.) All other scenarios will continue to behave as they do today.  This feature request comes close:    However, the answer suggests a simple change to the wording or a pencil icon (like we see with edited comments), without adding a revision that can be viewed and compared. I don't think this is enough - in some cases it's going to be important to know what changed, not just when.


I have been playing Minecraft 1.12.2 Java Edition on PC. One of my friends started to make me say stuff I wasn't saying in the chat. I don't know what command he was using but he basically made the chat say, "I am an idiot" from my perspective (which I never did) and I really want to know how to do it so I can make a comeback and troll him and other people the same way. Does anyone know how to do this?

I'm trying to make a mini game but I want it so that when you press a button over a command block it will say "BOB welcome", so 'bob' instead of the @a or @p sign and then followed by the message. All I know is that I need to use /tellraw.


When I read other answers to my question it says to feed the Ocelot raw fish till it emits hearts and it will be tamed. Why isn't it working for me?

I'm trying to make a cat house for my zoo on Minecraft. I have some untamed ocelots and I also want a few tamed ocelots. Fish only puts them in breeding mode.


I have a Nikon Coolpix L810 (which I know is a very basic camera, but hey, I was just starting out and didn't want anything too complicated.) Now I feel like this camera just isn't doing it for me. I bought some ND lenses, a wide angle lens, and a telephoto lens, but those don't improve the camera. I'm reading more and more about different aspects of photography and what makes a good photo (like changing aperture, ISO, and shutter speed, which I can't do on this camera) and I feel like I won't be able to improve my photography if I don't get a new camera. Therefore, I am looking into buying a better one. So could somebody please give me suggestions? I am going on a trip to Europe around August or September 2016 and I hope to have a new one by then (and it doesn't necessarily have to be nikon). Thanks!

I am thinking of buying a digital SLR camera. What things should I be looking for?


I would like to make these "Red drives" look same as those blue ones. Nothing serious, just annoying when watching it.

my disk has over 100GB of free space, but the usage bar in Computer is displayed in red, as if it reached a low space limit. It looks like Windows applies the same 10% or 15% hard disk space value for low space warnings, regardless of if the disk is 50GB in size or 1.5TB, which is not very smart and obsolete for most recent computers.  Is there a Registry key or some place I can change this percentage so the usage bar displays in green, not red?  The hibernation and page files are already reserved (5GB together), so surely the low space warning for a 1.5TB disk should be 5-10GB, not 150GB or more. The way Windows 7 computes the low space limit seems pretty dumb, not much Intellisense there.  This is not a high priority issue, but it makes the Computer applet look pretty stupid and it's irritating every day to see that 100GB of free space is putting my computer in the red. It would also be nice to be able to edit this low limit percentage in Computer/Manage/Storage/Disk Management or directly in the disk properties ("Tools" tab).


I have just started "Game of Thrones" from season 1.  Most of the characters in "Game of Thrones" are saying Winter is Coming, Winter is Coming.  But I don't know the real meaning of that phrase.  Anyone can tell me about it?

It's my understanding that the phrase "Winter is Coming" is the motto of the Stark house, when the story first reaches the wall it's implied that the winter is not a periodic season like it is in our world.  Does the winter refer to a particularly severe season or does a winter only occur every few years?


Like a virtual host declaration at a web server, I'd like to control sshd when a connection with a certain domain name gets established. That is, multiple domain names point to the sshd machine, which has only a single IP address. Is it possible at all? Following doesn't seem to work: Match Host some-domain.com   ChrootDirectory /some/dir  If I connect from my local machine with ssh some-domain.com I'm not rooted to /some/dir. Can it be done anyhow? According to this (old)  and its answers it is not possible...

So here's the problem:   I have a single server with multiple hostnames, meaning I have A records example.com and *.example.com pointing to the server's ip-address I want to limit incoming ssh connections to a specific hostname, that is I want to allow only logins to user@secret.example.com, and disallow login attempts using user@ip-address or user@example.com   The man page from sshd_config has the following for ListenAddress:  Specifies the local addresses sshd(8) should listen on.   The following forms may be used:  ListenAddress host|IPv4_addr|IPv6_addr ListenAddress host|IPv4_addr:port ListenAddress [host|IPv6_addr]:port   which seems to indicate that sshd has the ability to restrict itself to a a specific hostname. However I've tried ListenAddress secret.example.com:22, but after restarting sshd that doesn't seem to add any restrictions based on hostname used.  man sshd_config doesn't seem to show any other options in that vein.  Is there something I'm missing, or does sshd simply not have that ability?


I was on Ubuntu 12.10 and ran the system updates and after the re-install, the system became unstable and kept prompting me with the message "System Issue" and this as the error per Ubuntu "/usr/share/apport/apport-gpu-error-intel.py". After I tried re-starting, the issue is still appearing and the system ultimately freezes (requiring a hard reset).  I tried a clean install of 12.10 and the system works fine until the newest updates are applied...it then returns to the same messages.  I then tried a clean install of 12.04 LTS and just like 12.10 it works until the latest updates are applied.  On 12.04, I tried to use the previous kernel - going from 3.5.0-26 to 3.5.0-23 and the issue is still there.  Currently, I'm sitting on 12.04 LTS clean install without doing the updates and the system is working.  Does anyone have an idea how to fix this? Thanks.

Feeling disempowered by Ubuntu's new bug reporting policy/system. My Intel i5 machines have all experienced daily (if not more frequent) freezes, but it's very difficult to report bugs now and policy instead is just for ubuntu to collect counts; no way for me to see that anything is (or is not) being worked on.  I've just experienced a freeze and now on reboot I'm stuck in a cycle of "Ubuntu has an internal error" (presumably Ubuntu never experiences an external error...) do you want to report it? Yes. Oh another internal error...    It looks like this report could contain useful information. Is there anyway to make sure it gets provided to the people who can fix it?


I want to enumerate Dave-Letterman Style with the last listed first as in enumerating top ten items and having them  listed in  10 9 8 7 6 5 4 3 2 1. Is the etaremune package the only way to go?  Edit: I realized my question is vague and incomplete.  Does any package have the ability to change the order of appearance of a collection of entries. Consider a long already-typed list. I may want one of two things,    Changing the order of appearance of items. Say it is typed as 1) Apples, 2)Oranges 3)Pears and I want it to appear as 1)Pears, 2)Apples, 3)oranges.  Of course I could cut/paste the original text, but what if the table is long/etc ... Changing the way enumeration shows up as in  1,2,3 vs 3,2,1.   Also, what if a table of items breaks across a page. If all items are on one page then switching the enumeration from 1,2,3 to 3,2,1 would be easy. But if the list breaks across a page then many times it is better to count in reverse. And the question is how do you do this automatically.

To build a list of publications, I wish to show the most recent on top of the list, while keeping the numbering similar. This can be achieved manually by doing something like:  \begin{enumerate} \item[42] pub num 42 \item[41] pub num 41 \item[...] \item[1] pub num 1 \end{enumerate}   but is there a more principled approach?


I have a contact info form in Visual Studio (using C#) that can be used to turn the contact into a customer, to do so I want to send the id from the contact that was just created to the other form and to do this I created a stored procedure that returns the id using SCOPE_IDENTITY(). It works in SQL Server and returns the identity correctly but when I try to aquire it, convert the int into string and set it in a label for testing it reads as 0.  My stored procedure is as follows.  SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO  CREATE PROCEDURE IdentityTest       @FirstName varchar(50),       @LastName varchar(50),       @id int output AS BEGIN       SET NOCOUNT ON;        INSERT INTO Employees (FirstName, LastName)       VALUES (@FirstName, @LastName)        SET @id = SCOPE_IDENTITY()       RETURN  @id END   In my form.aspx.cs I have the following code to acess the DB.  protected void Button1_Click(object sender, EventArgs e) {      SqlCommand cons = new SqlCommand("IdentityTest", cncon);      cons.CommandType = CommandType.StoredProcedure;       cons.Parameters.Add("@FirstName", SqlDbType.NVarChar);      cons.Parameters.Add("@LastName", SqlDbType.NVarChar);      cons.Parameters.Add("@id", SqlDbType.Int);       cons.Parameters["@FirstName"].Value = nom.Value;      cons.Parameters["@LastName"].Value = dirclie.Value;      cons.Parameters["@id"].Value = IdCliente;       string IdClientesString = IdCliente.ToString();       cncon.Open();      cons.ExecuteNonQuery();       Label1.Text = IdClientesString;      cncon.Close(); }

My stored procedure has an output parameter:  @ID INT OUT   How can I retrieve this using ado.net?  using (SqlConnection conn = new SqlConnection(...)) {     SqlCommand cmd = new SqlCommand("sproc", conn);     cmd.CommandType = CommandType.StoredProcedure;      // add parameters      conn.Open();      // *** read output parameter here, how?     conn.Close(); }


I'm currently in possession of 2 different versions of Stephen King's The Gunslinger.  One of those is found  and here is a paragraph (found on page 6).     Perhaps the campfires were a message, spelled out one Great Letter at a time. Keep your distance, partner, it might say. Or, The end draweth nigh. Or maybe even, Come and get me. It didn’t matter what they said or didn’t say. He had no interest in messages, if messages they were. What mattered was that these remains were as cold as all the others. Yet he had gained. He knew he was closer, but did not know how he knew. A kind of smell, perhaps. That didn’t matter, either. He would keep going until something changed, and if nothing changed, he would keep going, anyway. There would be water if God willed it, the old-timers said. Water if God willed it, even in the desert. The gunslinger stood up, brushing his hands.   The other version, I don't know where it comes from. Here is the same paragraph.     Perhaps the campfires are a message, spelled out letter by letter. Take a powder. Or, the end draweth nigh. Or maybe even, Eat at Joe’s. It didn’t matter. He had no understanding of the ideograms, if they were ideograms. And the remains were as cold as all the others. He knew he was closer, but did not know how he knew. That didn’t matter either. He stood up, brushing his hands.   These differences seem too big to be a simple different edition of the book. What is the 2nd version, and how does it relate to the current official The Gunslinger, linked above?    Edit: by googling this exact paragraph, I have found the same version in some piracy ebook websites. Is it perhaps a commonly pirated version of Gunslinger?

Wad Cheber had said (in ) that there are differences between each version of the first book (I understand there is a large gap between books 1 & 2 being written):     Like, there are two (or three) editions of Book I (The Gunslinger): The original serialized version in which it appeared in SF&F magazine, which I've never read; the original limited edition print novel version (and reprints of it) which was slightly altered from the serialized version; and the significantly different "Revised and Expanded Edition" which was released in the early 00's, when Book V came out.   What are all the differences?


I have updated Ubuntu to the last version (15.04), but now I am not able to open Spotify. When I ran spotify in a terminal, I found that a library (libgcrypt.so.11) was missed.

Yesterday I updated my Ubuntu from 14.10 to 15.04 but sadly i had to conclude that Spotify doesn't work anymore. Today I installed 15.04 and Spotify again but nothing has changed - Spotify isn't working.  For installing Spotify I have used the instructions on this Page:    How can I fix this?  (Sorry for my bad English, but I hope, this is understandable...)


I have some variables that I want to check if any of them are exist in the database or not. Also I want to prevent injection. This is my code:  if(!empty($_POST['submit'])) {     $username = $_POST['username'];     $password = $_POST['password'];     $result = $db->query('SELECT * FROM users WHERE username=:username AND password=:password');     if($result->rowCount($result)=='1') {         echo 'Ok';     } else echo 'Not Ok'; }   But I get this error:  Fatal error: Call to a member function rowCount() on a non-object in D:\xampp\htdocs\index.php on line 7   Please help me solve this problem.  Thanks.  By the way, I have the class $db and It is working well.

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


Thymine does not present in RNA but DNA containing thymine why

This question was posed on SE Biology some time ago, but all the answers, including the accepted one, answered a different question instead: . I therefore changed the title to match the answers, giving notice that, if the change were approved, I’d post the original separately question myself (and answer it, if necessary). Here it is:     It is believed that thymine replaced uracil (the RNA base) in DNA because of the deleterious effects of slow spontaneous deamination of cytosine to uracil: by employing thymine instead of uracil, any uracil in DNA would clearly be aberrant, allowing a specific mechanism of repair (involving uracil DNA glycosylase) to evolve with impunity. As this was clearly advantageous, why didn’t RNA also evolve to use thymine instead of uracil?   N.B. By “why?” I mean “how can one rationalize the fact that?”. Obviously, the answer to this type of question is not, and probably cannot be, known with certainty.


Sample table:  date    |  name  | record   7/27/16 | john   | H   7/27/16 | john   | P   7/28/16 | john   | P   7/28/16 | john   | L     Results:  date    |  name  | record   7/27/16 | john   | H,P   7/27/16 | john   | H,L     Query:  SELECT      date, name, record  FROM     TABLE  GROUP BY      date, name, record(not sure how to do this part)

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)


At the moment I'm frying chips and protein 3 times a day daily using a fry machine. I'm using sunflower oil though could use others if needed but right now that's easiest to use.  The oil stays in the fry machine, not sure if it's air tight but i dont think it is and it also sits near the window.  I notice food particles in the fryer and fry basket but i guess i could clean that\pull it out with a sieve every 2-3 days.  Considering my heavy usage, how often should i change the oil and how often should I be cleaning the food out, will simply removing with a sieve be enough i still imagine there would be small particles remaining.  Also,  think I read that if it smells of other food you should change it.  However if you cook chicken in it it ay quicly smell of chicken, does it have to be changed in this case or can one just livewith the smell?

What are some guidelines or rules with regard to filtering and reusing (vegetable/canola/sunflower) oil that has been used for deep frying?  Is it safe and acceptable under some circumstances to filter and keep oil? If so, does it depend on which foods were fried? How long can the filtered oil for be kept for?  Or, is it never appropriate? If not, are the reasons health or flavour related? or both?


I read this in the mid-1980's and so my memory is a bit sketchy.  In the first book, there is some environmental disaster that's coming up, but the government doesn't want anyone know, so they put the scientists that are aware of the problem on a generation ship and send them to colonize a new world.  But really the government is just trying to get rid of them.  In the second book, they get to their world, but it turns out to not be that great.  Something about the atmosphere being too thick.  They decide to head out to a new planet.  In the third book, for some reason, only the kids remain on the ship and they've formed a quasi-religion based on the instruction video that was left for them.  The main antagonist was a sneaky kid that was confined to a wheelchair.  There was also an issue of the main character wanted to fix the broken things on the ship, but it was against their religion.   Any ideas?

I thought this was a trilogy from Michael Moorcock - but maybe not. I can't remember the name of the trilogy or any of the books (the one I read was a three-in-one volume, like The Stainless Steel Rat was).  In book 1, the wisest political and scientific minds on Earth forsee a complete annihilation of the human race on Earth, and build a super spaceship to carry a remnant to a far distant planet - and no hyperspace here... The people were to be kept in cryogenic stasis for a time.  I think the second involves some of the people waking up for some reason.  The third involves several generations later when the people on the spaceship have begun to worship the ship itself (and its computer) as supreme beings, and have no knowledge of the actual facts (that they are on a computer-controlled spaceship vessel). One of the people on the ship dares to "go behind the curtain" (and violates all kinds of religious rules) and finds that they are actually on a computer-controlled ship, and that something has gone wrong and they are about to crash. He saves the day somehow.  UPDATE: Could be by Ben Bova too. I can't remember for sure.


I am writing a code to copy a particular portion from a text file into another text file. I want to know what regular expression I should form so that in every RelationRecord the content inside the first curly braces gets copied to a text file. Can somebody please help me.  This is the content of my input file:  [RelationRecord(items=frozenset({'   android.software.live_wallpaper\n', '   location.gps\n'}), support=0.010217983651226158, ordered_statistics=[OrderedStatistic(items_base=frozenset({'   android.software.live_wallpaper\n'}), items_add=frozenset({'   location.gps\n'}), confidence=0.6818181818181819, lift=2.194976076555024), OrderedStatistic(items_base=frozenset({'   location.gps\n'}), items_add=frozenset({'   android.software.live_wallpaper\n'}), confidence=0.03289473684210527, lift=2.1949760765550246)]), RelationRecord(items=frozenset({'   location\n', '   location.gps\n'}), support=0.3106267029972752, ordered_statistics=[OrderedStatistic(items_base=frozenset({'   location\n'}), items_add=frozenset({'   location.gps\n'}), confidence=0.7808219178082192, lift=2.5136986301369864), OrderedStatistic(items_base=frozenset({'   location.gps\n'}), items_add=frozenset({'   location\n'}), confidence=1.0, lift=2.5136986301369864)]),   Code:  import re import sys regex = r"\RelationRecord(items=frozenset({(.*?)\}" myfile = open("CEHRelationRecord.txt", "rt")  test_str = myfile.read()                   myfile.close()   matches = re.finditer(regex, test_str, re.MULTILINE | re.DOTALL)   I expect the following as the output for the given input:  line1:  android.software.live_wallpaper, location.gps line2:  location, location.gps

I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?


How can I make a function that splits a multiline string every nth character. I have the below function, but it doesn't work correctly with multiline strings. splitIntoChunks("abab", 2) works correctly and gives ["ab", "ab"] But, this doesn't work correctly: var str = `aaa bbb ccc ddd`  splitIntoChunks(str, 2)  This returns ["aa", "a", "bb", "b", "cc", "c", "dd", "d"] And what I need is: ["aa" ["a\n", "bb", "b\n", "cc", "c\n", "dd", "d\n"]] It needs to keep the \n function splitIntoChunks(str, size) {   return str.match(new RegExp('.{1,' + size + '}', 'g')); }

For example, this regex  (.*)<FooBar>   will match:  abcde<FooBar>   But how do I get it to match across multiple lines?  abcde fghij<FooBar>


I was wandering if there is a command that will let you define the size of graphics globally throughout then entire document. Most of my images are photos and should all be the same size and it would be good if I could change one thing that will affect the size of them all, rather than having to do it manually. For the odd picture here and there that has different dimensions I can adjust their size manually.  Question content copied with permission from .

I am using Sphinx and the plantuml package to include UML diagrams.  The plantuml package for Sphinx generates the following LaTeX code:  \includegraphics{%s}   Anyways - the diagrams are to big, so what I want is   \includegraphics[scale=0.75]{%s}   Can I - without patching the plantum package - set a default scale for \includegraphics in my LaTeX preamble?


I am writing a java code to add a student, remove a student and print the whole database of a class' grades. After running some times I have encountered 2 issues which I would like to find out where I am going wrong and what I can do to change my code.  1) Not sure why I am getting a null pointer exception error in my code, this is a code to help remove a student from a database and shift the students after into the position before. The issue is on this one line: if (student[l].equals(studenttoremove))    2) If I add a student in method newstudent, then remove a student in the method removestudent it will show up with nulls after printing the names to show which possible students to remove. How can I remove the nulls after it?   //studentgradedatabase import java.util.Scanner; public class studentgradedatabase  {     String newstudent;     int newgrade;     Scanner in = new Scanner(System.in);     String[]student = new String[10];     int[]grade = new int[10];     int numberofstudents = 0;     int matchstudent = 0;     int nullcounter = 0;      void newstudent(String a, int b)     {         newstudent = a.toUpperCase();         newgrade = b;         if (numberofstudents == 10 || numberofstudents > 10)         {             System.out.print("Maximum Number of Students exceeded, Please Delete a Student First");         }         else         {             student[numberofstudents] = newstudent;             grade[numberofstudents] = newgrade;             numberofstudents = numberofstudents+1;         }     }     void removestudent()     {         String studenttoremove;         for (int i=0;i<student.length-nullcounter;i++)         {             System.out.print(student[i] + " ");         }         System.out.println(" ");         System.out.println("Input the name of the student you want to remove: ");         studenttoremove = in.next().toUpperCase();         for (int l=0;l<student.length;l++)         {             if (student[l].equals(studenttoremove))             {                 matchstudent = l;             }             else             {                 System.out.print("Student name not found");             }         }         for (int y=matchstudent; y<student.length-1; y++)         {             student[y] = student[y+1];             grade[y] = grade[y+1];         }         for (int x=student.length-1; x<student.length;x++)         {             student[x] = null;             grade[x] = 0;         }         System.out.print("Removed Student");     }     void printdatabase()     {         for (int i=0;i<student.length;i++)         {             if (student[i] == null)             {                 nullcounter = nullcounter+1;             }         }         for (int j=0;j<student.length-nullcounter;j++)         {             System.out.print(student[j] + " ");         }         System.out.println("");         for (int j=0;j<grade.length-nullcounter;j++)         {             System.out.print(grade[j] + " ");         }     } }

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


Let $f:\mathbb{R}^n\times\dots \times\mathbb{R}^n\rightarrow\mathbb{R}$ defined by $$ \ f(X^1,...,X^n)=\det[X^1...X^n] \\ $$ is a differentiable function and $Df_H(A)=\sum_{i=1}^n\det[A^1\dots A^{i-1}H^iA^{i+1}\dots A^n]$.  I wanted to start with showing $DF(A)$ is linear, but I couldn't show it because if I define $T(A)=\sum\det[A^1\dots H^i\dots A^n]$, I get $$  \ T(\alpha A)=\sum \det[\alpha A^1\dots\alpha H^i\dots\alpha A^n]=\alpha^n\sum[A^1\dots H^i\dots A^n]\ne \alpha T(A) \\ $$ After I show this, I couldn't either to prove that the limit $$ \ \lim_{H\rightarrow 0}\frac{f(A+H)-f(A)-T_H(A)}{\left \| H \right \|} \\ \ =\lim_{H\rightarrow 0}\frac{\det[A^1+H^1...A^n+H^n]-\det[A^1...A^n]-\sum\left \| H \right \|\cdot\det [A^1...H^i...A^n]}{\left \| H \right \|} \\ $$ equals to $0$.

I was wondering, given an $n \times n$ square matrix, let function $\det : \left(a_1,a_2,\ldots,a_{n^2}\right) \to \textbf{R}$ give the determinant, where $a_{k}$'s are the entries of the $n \times n$ matrix.  Is this function (determinant) a differentiable kind?  If so, is the derivative continuous? That is, is $d\left(\det\right)$ a continuous function?  Furthermore, if so, to what differentiability class does this $\det$ function belong?   Thanks in advance.


I have 2 questions.  1- How to use a diagonal seperator for the table hearders n and k in a good way.  2- How to align the back of the arrow to the rightand the head to the left of the numbers?    \documentclass{article}  \usepackage{tikz} \usetikzlibrary{matrix,chains,scopes,arrows}  \begin{document} \begin{center}     \begin{tikzpicture}       \matrix[matrix of math nodes,column sep=1em,row sep=0ex] (ex5mx) {         n\backslash{}k & 0 & 1 & 2 \\         0 & -0.3887696362 & ~ & ~ \\         1 & -0.3892561049 & -0.3894182612 & ~ \\         2 & -0.3893777792 & -0.3894183372 & -0.3894183423 \\       };        %\draw[thin,black] ([xshift=0em,yshift=0em]ex5mx-1-1.north west) -- ([xshift=0em,yshift=0em]ex5mx-1-1.south east); %\drule       \draw[thin,black] ([xshift=0.5em,yshift=0em]ex5mx-1-1.north east) |- ([xshift=1.058em,yshift=0em]ex5mx-4-1.south east); %\vrule       \draw[thin,black] ([xshift=-0.5em,yshift=0.25em]ex5mx-1-1.south west) |- ([xshift=3em,yshift=0em]ex5mx-1-4.south east); %\hrule        %1st rows       {[start chain,every on chain/.style={join={by <-*, blue!30}}]         \chainin (ex5mx-3-3);         {[start branch] \chainin (ex5mx-2-2); }         {[start branch] \chainin (ex5mx-3-2); }       }        {[start chain,every on chain/.style={join={by <-*, blue!30}}]         \chainin (ex5mx-4-3);         {[start branch] \chainin (ex5mx-3-2); }         {[start branch] \chainin (ex5mx-4-2); }       }        %2nd rows       {[start chain,every on chain/.style={join={by <-*, blue!40}}]         \chainin (ex5mx-4-4);         {[start branch] \chainin (ex5mx-3-3); }         {[start branch] \chainin (ex5mx-4-3); }       }      \end{tikzpicture}     \end{center} \end{document}

I need this table:    (each row and column should have the same height and length, last cell should be divided by diagonal line). I tried the following code:  \documentclass[11pt]{article} \usepackage[T1]{fontenc} \usepackage{array} \usepackage{makecell} \newcolumntype{x}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}} \begin{document} \setlength{\extrarowheight}{0.1cm} \begin{tabular}{|x{0.5cm}|x{0.5cm}|x{0.5cm}|x{0.5cm}|x{0.5cm}|}\hline &&&&20\\ \hline &&&&30\\ \hline &&&&45\\ \hline 15&12&18&50&\diaghead(-3,2){\hskip \hsize}{$a_i$}{$b_j$}\\ \hline \end{tabular} \end{document}   but text in the last cell is displayed incorrectly and cells are not the same.     How can I change that?


Round timespan seconds I also need do same with .Hours and .Minutes  This:  1.53994 second   to:  1 second

Can you round a .NET TimeSpan object?  I have a Timespan value of:  00:00:00.6193789  Is there a simple way to keep it a TimeSpan object but round it to something like 00:00:00.62?


I was reading the question and answers found  and I realized something. Distinction between half-bloods and pure-bloods were done using Third Reich rules for Jews. Well in order for magic to exist a "first" Wizard (or witch) should exist. The specific first was muggle born. Given that the first was alone his/her children would be half bloods. If he/she was not alone (let's say another one was created from another family) their children were both descendants of muggle borns.   So in theory all magicians in the magic world are descendants of muggle borns. Unless In the whole harry potter universe exists a "creation/evolution" theory in which the first wizard/witch descended from a different kind of species (or created by god alongside adam and eve even though I do not accept the creationists theory IRL, I would accept it in mythology).  Is there a canon answer to this? Are all Wizards descendants of Muggle borns?

What is a wizard that makes them non-Muggle? Or, more directly, what ancestry does the witch/wizard gene follow? Is there a patriarchal wizard (or matriarchal witch) that Muggles have no part in? Elves perhaps? Stop reading here.  Purpose of the Question/History/Don't Read There seem to be solid consequences associated with being Muggle, or Muggle-related. A dominant theme in the novels is discrimination against the non-gifted race, but, when read into, the wizard bloodline doesn't appear all that well defined. JKR indicates that wizard-ness is genetic, or inherited:  "Muggle-borns will have a witch or wizard somewhere on their family tree, in some cases many, many generations back. The gene resurfaces in some unexpected places."  By the above, it stands that a family that produces a squib (non-magical born of magical parents) must be a half-blooded family in some way, since half-blooded only requires one non-magical ancestor. Of course, we are dealing in magic genetics. Any other form of genetics would make this inherited, seemingly recessive trait (or squibs couldn't exist), never appear at all. Unless they were XMen. If it is so important, what does the wizard-bloodline follow? Other Mythos In other literature a wizard can be nearly anything, but magical powers are typically inherited as well as learned. Merlin of the Arthurian Legend (also mentioned in HP) is Cambian, meaning he is born of demonic intervention; this explains his source of enchantment. Gandalf of Middle Earth is a Maiar, as are all Wizards of Middle Earth. Wizards in Harry Potter seem to follow a bloodline, and it has been mentioned (in the question Gabe linked) that genetics have a heavy play in it, meaning that squibs and parents of Muggle-born wizards should have identical genetics. This bloodline must come from somewhere. Magical Creatures In Harry Potter it is common for magical creatures to "mingle" with humans, these beings are typically somewhat magical. Elves have been described to have very strong magic, but are for some unreasonable reason subservient to humans. I may be mistaken, but believe it was hinted that elves and the wizarding lineage had intersected at one time. Maybe I'm imagining this. Genocidal Allusions Voldemort hates muggles, and half-bloods, and whatever else is non-wizard. The presence of this theme, suggests that this wizardly bloodline must be at least defined if the main antagonist is so obsessed with keeping that mysterious bloodline pure. Since Slytherin himself was said to be a supremacist (circa a really long time ago) it suggests that this bloodline should have existed long before he was around, especially if he founded a school with people he was not related to, but were also magical.


Why when flagging a post I see "rude or abusive":         But for comment similar option looks as "rude or offensive":        Should the text be different?  P.S. English is not my native language :)

The problem Comments are terrible; no one agrees on what they're for, or how long they should be kept. Comment flags are equally terrible, because if no one's on the same page as far as what should be posted in the first place then no one can agree on what should be removed either. On top of that, we have this confusing set of flags where two mean "noise", one means "vile", one means "moderator, help!" and one means nothing at all - the end result is that it's all but impossible to even analyze comment flagging. The solution (or, part of it) Two years ago, in a fit of rage, I . Nothing got done. As always, everyone has a different idea of how things are supposed to work, and I'd bitten off more than I could chew. So, here we are, two years later, and comment flags still suck. So let's start by just cutting the fat: if we can trim down the list of flags to a set of clearly distinct problems, we might have something we can build on. Here's what I'm proposing, based on the past two years of discussion:   Re-word the "rude or offensive" flag to read,  rude or abusive: this comment violates .   Remove the "not constructive", "obsolete" and "too chatty" flags.  Add a new comment flag:  no longer needed: this comment is obsolete, chatty or otherwise unnecessary   Re-word the "other..." flag:  in need of moderator attention: these comments require action by a moderator. Be specific and detailed!    That's it; that's all I'm proposing to start out - simplify things so that we have something to build on. See also:


How can I find (if possible) the location of the script that is being executed?  So I have a script that I'll use to do some magic, and I'll need to call it from random locations on a system (this system can be mine, my servers, my friend's PC, my mom's PC, etc).  Now, I need to execute some binaries present along with the script, How can I do that?  Say my script folder has 3 files:    binary1 myScript.sh binary2   Now, this whole folder can be located in "/tmp/scripts", on one system, and in "/home/user/Downloads" on other system(random locations). And I'll need to run this script from, lets say "/home/user/Desktop". So my question is, how can I execute the binary1 and binary2 from my script without knowing their actual path before hand?

How do I get the path of the directory in which a  script is located, inside that script? I want to use a Bash script as a launcher for another application. I want to change the working directory to the one where the Bash script is located, so I can operate on the files in that directory, like so: $ ./application


I would like to know if centrifugal force is only apparent why all the objects in a washing macchine are pressed against the "wall"? I can experience the effects of the centrifugal force even if I am a still observator?

Currently in my last year of high school, and I have always been told that  does not exist by my physics teachers. Today my girlfriend in the year below asked me what centrifugal force was, I told her it didn't exist, and then she told me her textbook said it did, and defined it as "The apparent force experienced towards the outside of a circle is the centrifugal force and is due to the mass of the object resisting the inward centripetal acceleration that the object is experiencing". I was pretty shocked to hear this after a few years of being told that it does not exist.  I did some reading and found out all sorts of things about pseudo forces and reference frames. I was wondering if someone could please explain to me what is going on? Is it wrong to say that centrifugal force does not exist?   This has always nagged me a bit as I often wonder that if every force has a reaction force then a centripetal force must have a reaction centrifugal force, but when I asked my teachers about this they told me that centrifugal force does not exist.


Each of my USB-C enabled devices charge via the plug. Each came with a USB-C chargerbut my phone does not need much power so the power adapter is small.   My laptop needs a lot of power and its charger is more powerful.  What happens if I mess up and I plug my phone in the PC charger?  Does the phone blow up?  And what happens if I try to charge my PC with my phone charger will it catch fire?

I have an HP Chromebook and a Nexus 6P smartphone, and both of them use USB-C connections for charging.  When I plug the Chromebook into the Nexus's charging cable, it works fine and I just get a message that says I am connected to a "low-power charger".  However, is it safe to plug the cell phone into the laptop's power supply?  I'm afraid that doing so might fry the phone.


imtrying to follow a tutorial on youtube but I have a laptop, and it doesent have a numpad, please help whats a good alternative

I've just got into Blender, and I like it a lot. But as I just switched from a stationary computer to a MacBook, I've got some new problems regarding the numpad. I can use 1-9 perfectly, But I have no idea how to emulate buttons like / (used to enter local view). I've searched the web for an answer, but I can't find any.


, thanks for the time invested at resolving my issue :)

How do you convert between hexadecimal numbers and decimal numbers in C#?


This question has been rounding my head for a while, id say help me cook but then  i think about omitting "to" which i think isn't correct. Can you give me more examples about this situation.   Thanks in advance

What is the correct way to use infinitive after the verb "help": with or without "to"?  For example:     Please, help me to understand this.   or:     Please, help me understand this.


I have a Apex Trigger which makes the callout to the External system when a field in a record is updated. The Apex Trigger and the Callout method are like below trigger updateLocation Account (after update) {    List<String> jSONBody = new List<String>();          if(trigger.isupdate)     {         set<Id> AccountIds = new Set<Id>();         list<Account> acclist = new list<Account>();                  for( Id accountId : Trigger.newMap.keySet() ){             if( (Trigger.oldMap.get(accountId).Location__c != Trigger.newMap.get(accountId).Location__c))             {                 AccountIds.add(accountId);              }         }                  if(AccountIds.size()>0)         {             acclist = [Select id,Location__c from Account WHERE Id IN: AccountIds ];                          for(Account acc : acclist)             {                         handleD365Request.updSubSegJSON js = new handleD365Request.updSubSegJSON();                         js.Location= acc.Location__c;                         jSONBody.add(json.serialize(js));                         handleReq.handleAccountReqs(jSONBody,endPoint);             }}  Apex Class with future method   @future (callout=true)     public static void handleAccountReqs(List<String> jsonBody,String endPoint) {       ...............         for (String str : jsonBody)         {         Http http1 = new Http();         HttpRequest req1 = new HttpRequest();         String d365EndPoint = resource + endPoint;                    req1.setMethod('POST');         req1.setTimeout(20000);         req1.setHeader('Authorization','Bearer '+bearerToken);         req1.setEndpoint(d365EndPoint);         req1.setBody(str);         req1.setHeader('Content-Type', 'application/json;charset=UTF-8');         HttpResponse res1 = http1.send(req1);        }     }    The issue is we have workflow rules on the Accounts so when the update on the field happens the  Trigger is executed twice one from the record through through UI and other time when the workflow rules update the field. I am not here trying to restrict the trigger execute only once instead trying make call the external system when all the transaction is complete on the record.How can I make the callout  only when all the transaction is complete on the record. In the other question it was recommended to use the async callout , I read future callouts are async. I am not sure how I can handle the async callout out of the trigger or using the Continuation object as works with VF page I dont have a VF page here. Any help is greatly appreciated to handle this usecase.

The trigger creates a related record when a checkbox is updated. The problem is it is creating a new related record everytime the record is edited. I want to edit the trigger to only create the related record once. (When the criteria is first met). The code is below  Trigger copyEquipmentonsite on Unit_Placements_Sales__c(after insert, after update) {      List<Services__c> sub=new List<Services__c>();      for(Unit_Placements_Sales__c u : Trigger.new) {           if(u.Service_Month_is_Next_Month__c == TRUE) {                 Services__c s = new Services__c();                 s.Equipment_Onsite__c=u.ID;                 s.Equipment_Type__c=u.Equipment__c;                 s.Machine_Specific_Notes__c=u.Machine_Specific_Notes__c;                    s.Product__c=u.The_Product__c;                   s.Dell_Tag_Number__c=u.Dell_Tag_Number__c;                 s.Serial_Number__c=u.Serial_Number__c;                  s.XD_Number__c=u.XD_Number__c;                 sub.add(s);           }           if(sub.size()>0)           insert sub;      } }


I'm a programmer coming from Python background which typically uses lexical scoping and I want to understand dynamic scope. I've researched it on-line, still unclear to me. For example, I've read  which made things a lot easier to me, especially the code snippets:   #In Dynamic scoping:              const int b = 5;             int foo()                    {                               int a = b + 5;        return a;     }      int bar()     {        int b = 2;        return foo();     }      int main()     {        foo(); // returns 10        bar(); // returns 7        return 0;     }   #In lexical scoping:              const int b = 5;             int foo()                    {                               int a = b + 5;        return a;     }      int bar()     {        int b = 2;        return foo();     }      int main()     {        foo(); // returns 10        bar(); // returns 10        return 0;     }   As I understand and as you can see, in the dynamic scoping, bar function returns 7 not 10, which means foo called the b variable which is defined within bar, in other words, foo did not looked for the b variable that's defined in top of the code (the first b variable) but rather it used the b variables that's defined in bar.   Q1: Hence, In dynamic scoping, the function that's being called within another function in this case foo called in bar first looks for variables in the caller function in this case bar  and then it looks for top level variables ?   Q2: Could you explain dynamic scoping in Python code ?

What exactly are the Python scoping rules?  If I have some code:  code1 class Foo:    code2    def spam.....       code3       for code4..:        code5        x()   Where is x found?  Some possible choices include the list below:   In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop   Also there is the context during execution, when the function spam is passed somewhere else. And maybe  pass a bit differently?  There must be a simple reference or algorithm somewhere.  It's a confusing world for intermediate Python programmers.


odata.stackexchange.com is damn funny. But when do cached(?) query results, like , get updated?

promised that data.SE would "soon" get live data:     I realize it's a long weekend, but given that data.SE is now over 2 months out of date, it would be nice if this was finally rolled out.


I want to run a VPS for torrenting Ubuntu's upcoming release. Is it legal?  Some VPS providers are unsure about it.  I am not talking about modifying Ubuntu here. Just distributing the ones that Ubuntu already provides.

What license does Ubuntu fall into (GPL, MIT, a mix)? Would it be legal to modify it and redistribute my modified version?


I am a novice when it comes to photography. But I have a picture that I would love to submit to a photo comp. Their specifications are: have suitable resolution to be printed between 596mm x 422mm (A2) and 841mm (w) x 1189mm (h) (A0) I tried to increase the resolution on photoshop and ended up with these numbers: Image size 1.84 M - With 644 pixels - height 1000 pixels - resolution 300 pixel an inch   Could any let me know if these dimensions are acceptable?

What size images do I need for common print sizes, such as wallet size, 8x10, and 16x20?  Is there a general formula?  How could that size change if, for example, a 16x20 was printed on canvas rather than photopaper?


Show that f is not differentiable at the origin of the following function:  $f(x,y) = \left\{\begin{matrix}\frac{2xy}{x^2+y^2}, (x,y) \neq (0,0)\\ 0, (x,y) = (0,0) \end{matrix}\right.$  I was thinking that I would have to approach the origin from the left and right of the x and y-axis.  But given that it is a conditional function I have myself confused.  Could someone show me how to approach this question. Thanks !

$$f(x,y) = \left\{\begin{array}{cc} \frac{xy}{x^2+y^2} & (x,y)\neq(0,0) \\ f(x,y) = 0 & (x,y)=(0,0) \end{array}\right.$$  In order to verify if this function is differentiable, I tried to prove it by the theorem that says that if $\frac{∂f}{∂x}$ and $\frac{∂f}{∂y}$ exist and are continuous at the point $(x_0,y_0)$, then the function is differentiable at this point. So I did:  $$\frac{\partial f}{\partial x}(0,0) = \lim_{h\to 0}\frac{f(0+h,0)-f(0,0)}{h} = 0$$ $$\frac{\partial f}{\partial y}(0,0) = \lim_{h\to 0}\frac{f(0,0+h)-f(0,0)}{h} = 0$$  so we have that the partial derivatives at point $(0,0)$ is $0$. Now, if we take the derivative at $(x,y)\neq (0,0)$ and then take the limit of it as $(x,y)\to(0,0)$, we can see if the derivatives are continuous or not. So here it is:  $$\frac{\partial f}{\partial x}(x,y) = \frac{y(y^2-x^2)}{(x^2+y^2)}$$  but   $$\lim_{(x,y)\to(0,0)} \frac{y(y^2-x^2)}{(x^2+y^2)} $$ does not exist (by wolfram alpha... but can anybody tell me an easy way to prove this limit does not exist? easier than taking the limit in different directions?), therefore the derivative is not continuous at $(0,0)$, so we can't say $f$ is differentiable at $(0,0)$, but for $(x,y)\neq (0,0)$ the function is continuous, as it is a quotient of continuous functions. So $f$ is at least differentiable at $(x,y)\neq (0,0)$.   Now, to verify differentiability at $(0,0)$ I think we must use the limit definition of differentiablity: A function is differentiable at $(0,0)$ iff: $$\lim_{(h,k)\to (0,0)} \frac{f(0+h,0+k)-f(0,0)-\frac{\partial f}{\partial x}(0,0)-\frac{\partial f}{\partial y}(0,0)}{\|(h,k)\|} = 0$$  Let's calculate this limit:  $$\lim_{(h,k)\to (0,0)} \frac{f(0+h,0+k)-f(0,0)-\frac{\partial f}{\partial x}(0,0)-\frac{\partial f}{\partial y}(0,0)}{\|(h,k)\|} = \\ \lim_{(h,k)\to (0,0)} \frac{\frac{hk}{h^2+k^2}}{\sqrt{h^2+k^2}} = \\ \lim_{(h,k)\to (0,0)} \frac{hk}{(h^2+k^2)\sqrt{h^2+k^2}}$$  which I think, it's a limit that does not exist, therefore the function isn't differentiable at $(0,0)$


It is a theorem on the stacks project that if a category $\mathcal{C}$ has finite products and equalizers then it has a terminal object, this theorem is at .   But the category $\mathbb{Z}$ considered as a totally ordered set has all finite products which are given by taking the minimal element, and it vacuously have all equalizers, but has no final object. What is going wrong here?

I read something weird in my category theory book (Awodey p 47).  " Observe also that a terminal object is a nullary product, that is, a product of no objects:  Given no objects, there is an object $1$ with no maps, and given any other object $X$ and no maps, there is a unique arrow:  $$!:X\to 1$$  making nothing further commute."  Could anyone give a hint about what this means? I mean "given no objects, there is an object..?"  Thank you


If one has multiple sentences all of the form "Let x be y" written successively. Is it grammatically correct to write "and god said "let apples be red, oranges be orange, etc""?. Is it possible to not repeat the verb "to be" and to simply write "let apples be red, oranges orange, etc".

This following sentence is puzzling me. Neither can I understand the meaning, nor can I reason the grammatical soundness of the sentence.     Some symbols acquire a multitude of meanings, some widely shared, others personal, some contradictory, conflicted, or ambivalent.   Please help understand the meaning and grammatical explanation.


I have an I2C slave device in which the maximum input voltage to SCL & SDA is 3.6V.  And the I2C Master device is PIC16F877A operating at 20MHz which provides a 5V output on SCL & SDA.  Pls help me to interface these two devices.

Is there any IC that interfaces any 3.3V Input/Output to 5V Output/Input? I need it primarily for an Arduino Due but if there any bidirectional IC that works like that it would be great.  Some people advised me to use the SN74AHC125 and CD4050 ICs, but I don't understand how they work or how to interface with them.


I have a 401k retirement savings account from a previous employer. I am considering transferring it to a rollover IRA, where it seems I would have access to a larger range of investment options. However, I understand doing that would not be reversible, so I want to be 100% sure I am doing the right thing. Are there any downsides I should be aware of to transferring a 401k from a previous employer to a rollover IRA?

Currently in the US there are circumstances which allow you to rollover your existing 401K into an IRA, such as when you change employers. You may also keep it in the existing employer's plan or roll it into your new employer's plan.  Assuming there is no issue of minimum balances for the funds of interest, why would I not choose to rollover my 401K into my IRA whenever I'm allowed to do so?  It seems to me that an IRA is a superior account type.


I'm trying to calculate the gradient with respect to x of the following function $$g(x) = x^TP^TPx + q^Tx + r$$ with $x,q \in R^n, P \in R^{nxn}$ and P full rank  I've been using this answer as its kind of similar .  Please forgive me as I am not very experienced with vector calculus.  I create intermediate variables $P^TPx = u$ and $x^TP^TP = v$, both vectors.  Next I try to use the chain rule in a similar way as the answer linked above with $x^Tu$ and $vx$. $$\frac{dg}{dx} =  \begin{bmatrix} \frac{\partial g}{\partial x^T} & \frac{\partial g}{\partial x} \end{bmatrix} \begin{bmatrix} \frac{\partial x^T}{\partial x^T} \\ \frac{\partial x}{\partial x} \end{bmatrix} = \frac{\partial g}{\partial x^T} + \frac{\partial g}{\partial x} $$ Now $\frac{\partial g}{\partial x^T} = \frac{\partial}{\partial x^T}[x^Tu] = u$   and $\frac{\partial g}{\partial x} = \frac{\partial}{\partial x}[vx] = v$   and $\frac{\partial}{\partial x}[q^Tx] = q^T$  So I have $\frac{dg}{dx} = u + v + q^T = P^TPx + x^TP^TP + q^T$  Is this correct?

It's stated that the gradient of:  $$\frac{1}{2}x^TAx - b^Tx +c$$  is   $$\frac{1}{2}A^Tx + \frac{1}{2}Ax - b$$  How do you grind out this equation? Or specifically, how do you get from $x^TAx$ to $A^Tx + Ax$?


A lot of applications (including ubuntu default apps such as system monitor, calculator, logs, etc. as well as other third party applications) do not apply the dark theme.   How to force all applications to use the defined dark theme? Or, is it possible to delete all other themes in the computer, so that all apps are forced to use the only one that exists?

I'm using X-Arc-White GTK theme in my freshly installed Ubuntu 18.04 desktop. I looks really amazing, but there's a problem with GNOME own applications, like system monitor or calculator. They are shown only with default Adwaita theme.      The only themes which work for all programs are Ambiance and Radiance. Is there a reason for that behaviour?


ID|  tag  |  version -----+-----+----- 1|  A  |  10 2|  A  |  20 3|  B  |  99 3|  C  |  30 3|  F  |  40   desired output:  1 A 10 2 A 20 3 B 99   How can I get the max version of every ID and the corresponding tag for that version? Speed is important (I have around 28m rows) so a nested Select won't do it. Also a simple Group by ID with a max(version) doesn't work because I also need the corresponding Tag where the version is max.

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


I know boring is one option, but it does not always apply to the case that something maybe desirable at start,  but once it happens too often, it becomes bad.  For example, in movies and literature, heroes always win over the evil at last which has become too often to be good, so under that context which word could be used to describe that phenomenon?  I also want to ask can I use cliche? but the dictionary says it applies to phrase or opinion?

What are the differences between trite, cliché, and passé? They seem to all have a similar denotation, but what are the subtleties of their connotations?  The only difference I really see is that cliché is an expression that has become trite or passé, whereas trite and passé can be related to anything, e.g. ideas, words, fashion, etc.  I’d love to hear your thoughts.


I was asked to build a java system that will have the ability to load new code (expansions) while running.  How do I re-load a jar file while my code is running? or how do I load a new jar?  Obviously, since constant up-time is important, I'd like to add the ability to re-load existing classes while at it (if it does not complicate things too much).  What are the things I should look out for? (think of it as two different questions - one regarding reloading classes at runtime, the other regarding adding new classes).

Why is it so hard to do this in Java? If you want to have any kind of module system you need to be able to load JAR files dynamically. I'm told there's a way of doing it by writing your own ClassLoader, but that's a lot of work for something that should (in my mind at least) be as easy as calling a method with a JAR file as its argument.  Any suggestions for simple code that does this?


Here is my command:  echo "This is the body of the email" | mail -s "This is the subject line" myemail@address.com   When I ran this command with root user, that email goes into inbox and all file. But sadly  when I switch to another user (su info) and then send that email with another user, it goes into spam.     Noted that info has sudo priviliges. In reality I need to send that email using a PHP script like this:  // send_email.php <?php     $msg = "First line of text\nSecond line of text";     $msg = wordwrap($msg,70);     mail("myemail@address.com","My subject",$msg); ?>   When I execute that php script, that email sends as well, but the sad part is, the sender name will be shown as www-date@lamtakam.com. As you know www-date is apache's user which executes that script.  So all I'm trying to do is putting user info as the owner of that script. My goal is making sender like info@lamtakam.com.  Any idea how can do that?

I send email from my server like this:  echo "This is the body of the email" | mail -s "This is the subject line" user@example.com   Noted that I replace user@example.com with a real email address. And it works. Just I need to know, where this nickname comes from?    I use ubuntu 14.04 on the server and I want to know how can I change that name?


We did a scan on our web page for vulnerabilities. We received a critical Blind SQL injection in the following query. I am using the prepared statements. What else I can do to prevent SQL Injection attack? Please let me know. Here is my example code. I appreciate any suggestions.  $first_name = $_POST["first-name"]; $middle_name = $_POST["middle-name"]; $last_name = $_POST["last-name"];  $qry = $pdo_conn->prepare('INSERT INTO table1(first_name, last_name, middle_initial) VALUES (?, ?, ?)'); $qry->execute(array($first_name, $last_name, $middle_name));

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


I have these data members static because Array will be an abstract class that will have have multiple classes that will inherit it. I want to be able to load data from a text file into my primaryCollections array. Keep getting an error when I try to compile my code:  /usr/bin/ld: Array.o: warning: relocation against `_ZN5Array17primaryCollectionE' in read-only section `.text' /usr/bin/ld: Array.o: in function `Array::loadData(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': Array.cc:(.text+0x240): undefined reference to `Array::primaryCollection' /usr/bin/ld: warning: creating DT_TEXTREL in a PIE collect2: error: ld returned 1 exit status make: *** [Makefile:6: p1] Error 1   Array.cc: //loads data from text file into a list of record objects void Array::loadData(string f){    int year, employed, graduates;   string province, degree, gender;    ifstream file(f, ios::in);    if (!file) {     cout << "Error: could not open file" << endl;     exit(1);   }    while ( file >> year >> province >> degree >> gender>> employed>> graduates ) {      Record *record = new Record(year,province,degree,gender,employed,graduates);     primaryCollection.push_back(record);    }     }  Array.h: class Array {       public:      static void loadData(string);         private:     string name;     static vector<Record*> primaryCollection;      };

Can anyone explain why following code won't compile? At least on g++ 4.2.4.  And more interesting, why it will compile when I cast MEMBER to int?  #include <vector>  class Foo {   public:       static const int MEMBER = 1;   };  int main(){       vector<int> v;       v.push_back( Foo::MEMBER );       // undefined reference to `Foo::MEMBER'     v.push_back( (int) Foo::MEMBER ); // OK       return 0; }


What's the rule for using a/an before an adjective?  I am asking this question because my high school professor is teaching us that  we shouldn't use a/an before an adjective. With some 'exceptions' like "Picasso was a famous painter."   Now that sounds very strange to me because I am used to saying "It's a beautiful day.", not "It's beautiful day.", or "It's a small dog.", not "It's small dog". My professor also pointed out that "Picasso was a famous painter." was some kind of exception because "a" is used before an adjective. My professor also told me that this sentence is correct : "A mouse is an animal. It's small animal."  Like I said, for me, It's a very strange claim that we shouldn't use "a" or "an" before an adjective. What should I say to my professor? I would like your professional opinion about this.  Thanks.  Notice: This question isn't about 'a' vs 'an'. Read the question before marking it as a duplicate.

In the following example, is it appropriate to use a or an as the indefinite article, and why?     He ate __ green apple.   I know that in the case of just "apple", it would be "an apple," but I've heard conflicting answers for "green apple," where the noun is separated from the article by an adjective.  Also, which is more appropriate in this case:     He ate  __ enormous Pop-Tart.


hy all, I have streaming site, and want to make a toggle button to switch to Dark/light mode using jQuery. please look to my code, what is wrong with my code, bcz this is not work for me.  in footer.php (above )

    in player.php  ...
 <button id="gelap-terang">Change Mode</button>
 ...   CSS code  .gelap-terang { height:100%; width:100%; background-color:black; opacity:.8; position:fixed; top:0;left:0; z-index:1;display:none;}  #player2, .player_nav  { z-index:99; position:relative;}   the button is perfect look in the below of player video, but the
 is not appear when I click the button. I tried to delete the "display:none;" in the .gelap-terang CSS code, the
 is appear and look good, but not switch (hide) when I click the button.

I'm doing it right now with the following code:   function uw_load_scripts() {     // De-register the built in jQuery     wp_deregister_script('jquery');     // Register the CDN version     wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', array(), null, false);      // Load it in your theme     wp_enqueue_script( 'jquery' ); } add_action( 'wp_enqueue_scripts', 'uw_load_scripts' );   This works, but should I do this for everyone, like this, or for everyone but admin (so that backend uses the WordPress version?):  if (function_exists('load_my_scripts')) {   function load_my_scripts() {       if (!is_admin()) {       wp_deregister_script( 'jquery' );       wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', array(), null, false);      wp_enqueue_script('jquery');        }   }   }   add_action('init', 'load_my_scripts');   This version doesn't work at all actually, I get the WordPress jQuery-version and not the Google one.  Therefore, should I deregister the jQuery that is included in WordPress at all?    Also, how do I add my own scripts (slider scripts, modernizr and my own custom.js) the correct way? I guess I should do this via functions.php as well and not in the header like I'm doing it now, but I'm unsure of how I would do that.


const onChange = (type) => (e) => {      const [value, setValue] = useState({         StartDate : new Date("2021-03-24T23:59:59"),         EndDate : new Date("2021-03-24T23:59:59"),         Seperate : false         });       if (type == "StartDate" || type == "EndDate") {       console.clear();       setValue({         ...value,         [type]: new Date(e),       });     } else {       setValue({         ...value,         [type]: e.target.value == "on" ? !value[type] : e.target.value,       });     }   };       <Form.Control as="select" onChange={onChange("Consolidation")}>     <DateTimePicker onChange={onChange("StartDate")}     onChange={onChange("StartDate")}  Attempting to understand %100 the above.  And I am confused by one item in the above.  What is the purpose of the second (e) in the above function?  I know this is the event handler, yet how is this passed to the onChange function from the form controls, being it is only defined with the type parameter. I guess the additional => (e) is confusing me.  Thanks for your time.

I've seen references to curried functions in several articles and blogs but I can't find a good explanation (or at least one that makes sense!)


I would love to make apps and publish them on the Ubuntu Software Centre. After following the instructions on the developer centre, I built an app and published it. Now I have realised I have built an app for Ubuntu touch. There doesn't seem to be an SDK for making Ubuntu desktop apps. Is there one? Where can I find simple instructions to make and upload an ubuntu desktop app? Thanks.

On  most resources seems to be targeted to Ubuntu touch. If I wanted to write an Ubuntu desktop application, where can I start?   Is the Ubuntu SDK for the desktop too? I read that actually is more targeted to mobile apps.  Given that the Ubuntu SDK is not yet ready for desktop, I'm searching for the avalaible options for developing desktop apps on Ubuntu highlighting the strength and the weakness of each solution.


Given an enum with 4 elements  enum fontType {bold,italic,underlined,struck}   and two variables of this enumeration type called enum1 and enum2 that are assigned as follows  fontType enum1=fontType.bold | fontType.italic; fontType enum2=fontType.underlined & fontType.struck;   Why is enum1 = 'italic' and enum2 = 'underlined' on output?

From time to time I see an enum like the following:  [Flags] public enum Options  {     None    = 0,     Option1 = 1,     Option2 = 2,     Option3 = 4,     Option4 = 8 }   I don't understand what exactly the [Flags] attribute does.  Anyone have a good explanation or example they could post?


This is a two part question, with the two parts being mirror images to each other.  Is the ability to use the Force a requirement, for some reason, to using a lightsaber?  And if so, why?  And on the other side, on Hoth, when Luke is hanging in ice in the wampa's cave, he uses the Force to bring his lightsaber into his hand.  But, as best I can remember and find, the Jedi always use a lightsaber like a "real" sword and keep it in their hands (although I think there's one case in a movie where a lightsaber is thrown to cut down support for a walkway).  Can a lightsaber be wielded with the Force only?  For instance, when Anakin's hand was cut off, could he have controlled the movement of his lightsaber the way Vader did with the objects he Force-tossed objects at Luke in the Cloud City?  While that's two questions (that I think are closely related), another way to put it might be to ask, "How closely is the use of the Force related to wielding a lightsaber?"  Addendum: No, this is NOT a duplicate of .  Note I am the one who asked both questions.  I asked both because they cover different groups.  See the Venn diagram.  I allow room for possible members of Sith and Jedi who do not use the Force.  (Hey, in the Star Wars universe, almost anything can happen.)  If that is not possible, then just imagine the black box not intercepting either or both of the Jedi and Sith boxes.  One can be non-aligned (with Jedi or Sith) and still use the Force and it's possible, at some point, we may find some odd story about a Jedi or Sith who cannot use the Force.  (There may be some story about how such a person is not felt by Force users, so is valuable to one side or the other.)  This question overs the black box.  The other question covers the green box.  Yes, there is overlap, but there are also distinct separate groups covered by each question that are not covered in the other question.

I understand that the mechanics and design of a lightsaber aren't that complicated.  Do others besides the Jedi and Sith (or their minions) make or use lightsabers?  And if they don't, why not?


I get this error message when I try to deoploy via change set:       "Code Coverage Failure The following triggers have 0% code coverage. Each trigger must have at least 1% code coverage. PullProjectNoOpportunity –"   I thought writing the trigger was the hard part... hah! This trigger populates a lookup field on a child object based on user input into another field on the child object.   Trigger:  trigger PullProjectNoOpportunity on SAP_Sales_Order__c (before update) {     Set<String> codes = new Set<String>();     for (SAP_Sales_Order__c o : trigger.new) codes.add(o.SAP_Project_NO__c);      Map<String, Opportunity> pronumOpportunities = new Map<String, Opportunity>();     for (Opportunity a : [SELECT Cilioproject__c FROM Opportunity WHERE Cilioproject__c IN :codes]) {         pronumOpportunities.put(a.Cilioproject__c, a);     }      for (SAP_Sales_Order__c o : Trigger.new) {         Opportunity pronumOpportunity = pronumOpportunities.get(o.SAP_Project_NO__c);         Id parentId = (pronumOpportunity == null) ? null : pronumOpportunity.Id;         o.project__c = parentId;     } }   I'm following some tutorials on apex, and I thought i just have to create a record that will cause the trigger to fire, so I wrote this for the test class:  @isTest private class testPullProjectNoOpportunity {     static testMethod void validateLookupPopulation() {         SAP_Sales_Order__c SO = new SAP_Sales_Order__c(name='9999999');         SO.SAP_Project_No__c = '30157';         insert SO;       } }   But, the test class doesn't test my trigger. I'm thinking that I need to have some code in the test class that evaluates whether the trigger works, but I'm in over my head. Any comments or pointers would be greatly appreciated  EDIT 1: I made the change suggested below so the test class now reads:  @isTest private class testPullProjectNoOpportunity {     static testMethod void validateLookupPopulation() {         SAP_Sales_Order__c SO = new SAP_Sales_Order__c(name='9999999');         insert SO;          SO.SAP_Project_No__c = '30157';         update SO;     } }   But it's still not testing when i try to deploy.

How do I write a unit-test / test class for a trigger?  What are my options?   Inline with the trigger?  New Class?


Please explain me why am i getting an output  1234567 7654321  I want to know what exactly is happening here.  public static void main(String[] args) {   Date date = new Date(1234567);   m1(date);   System.out.print(date.getTime() + " ");    m2(date);   System.out.println(date.getTime()); }  public static void m1(Date date) {   date = new Date(7654321); }  public static void m2(Date date) {   date.setTime(7654321); }

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


In WHO official website ", it doesn't mention that wearing mask an effective measure to protect people.   I don't understand why wearing mask is not good way to prevent infection of COVID-19.  Is it just because masks are out of stock?

Information about (simple) mask wearing (concerning covid19) is a complete mystery to me. On several official places it is not recommended for a person without symptoms to wear a mask. For example:    (time 0:20)  or here:    However no explanation is given - which makes me wonder (and even angry). I think everybody should wear a mask because:   Many persons feel ashamed wearing it, even those with symptoms. If everybody wears it, they do not feel ashamed and wear it. As far as I know, one is (wrt covid19) contagious before developing symptoms. So if everybody wears the mask also these people do.   The two above points act as a collective protection.   Simple mask certainly will lower "getting / spreading illness" probability. Of course the "holes" (in a simple mask) are too big to prevent completely virus to enter (or get out when coughing), but it lowers probability! Even if it lowers the transmission probability by e.g. 5%, it might be a lot. As a hypothetical example: it might reduce R0 from 1.02 to 0.97 and so stop the virus spread so fast.   The videos are full of self-contradiction. In the same video    time 0:50 the lady says I should wear a mask if I am in contact with an infected person... why if it is inefficient?  Question: What are reasons for not recommending wearing a mask?


Let $X \sim U(-1, 1)$ and $X \sim U(-1,1)$. We want to find density function of $W = \sqrt{X^2 + Y^2}$. I got stuck and I have no idea, where I am making a mistake. This is my approach. Let $F$ be a cumulative distribution function of $W = \sqrt{X^2 + Y^2}$ \begin{align*} F(w) = P(W \le w ) &= P(\sqrt{X^2 + Y^2} \le w) \\ &= P(X^2 + Y^2 \le w^2) \\ &= \iint \limits_{x^2 + y^2 \le w^2} \frac{1}{4} dxdy \\ &= \int \limits_{0}^{w^2} \int \limits_{0}^{2 \pi} \frac{1}{4} d\theta dr \\ &= \pi \frac{w^4}{4} \end{align*} So, the density: $$ f(w) = F'(w) = \pi w^3 $$ But if I run a simulation: X <- runif(100000, -1, 1) Y <- runif(100000, -1, 1) R2 <- X^2 + Y^2 R <- sqrt(R2)  hist(R,  prob=TRUE)   Where am I making a mistake?

I'm looking at how the expected minimum Euclidean distance between randomly uniform points and the origin changes as we increase the density of random points (points per unit square) around the origin. I have managed to come up with a relationship between the two described as such:  $$\text{Expected Min Distance} =\frac{1}{2\sqrt{\text{Density}}}$$  I came up with this by running some Monte Carlo simulations in R and fitting a curve manually (code below).   My question is: could I have derived this result theoretically rather than through experimentation?  #Stack Overflow example library(magrittr) library(ggplot2)   #--------- #FUNCTIONS #--------- #gen random points within a given radius and given density gen_circle_points <- function(radius, density) {   #round radius up then generate points in square with side length = 2*radius   c_radius <- ceiling(radius)   coords <- data.frame(     x = runif((2 * c_radius) ^ 2 * density, -c_radius, c_radius),     y = runif((2 * c_radius) ^ 2 * density, -c_radius, c_radius)   )   return(coords[sqrt(coords$x ^ 2 + coords$y ^ 2) <= radius, ])#filter in circle }  #Example plot plot(gen_circle_points(radius = 1,density = 200)) #200 points around origin points(0,0, col="red",pch=19) #colour origin     #return euclidean distances of points generated by gen_circle_points() calculate_distances <- function(circle_points) {   return(sqrt(circle_points$x ^ 2 + circle_points$y ^ 2)) }  #find the smallest distance from output of calculate_distances() calculate_min_value <- function(distances) {   return(min(distances)) }   #Try a range of values density_values <- c(1:100)  expected_min_from_density <- sapply(density_values, function(density) {   #simulate each density value 1000 times and take an average as estimate for   #expected minimum distance   sapply(1:1000, function(i) {     gen_circle_points(radius=1, density=density) %>%       calculate_distances() %>%       calculate_min_value()   }) %>% mean() })  results <- data.frame(density_values, expected_min_from_density)  #fit based off exploration theoretical_fit <- data.frame(density = density_values,                                fit = 1 / (sqrt(density_values) * 2))  #plot monte carlo (black) and fit (red dashed) ggplot(results, aes(x = density_values, y = expected_min_from_density)) +   geom_line() +    geom_line(     data = theoretical_fit,     aes(x = density, y = fit),     color = "red",     linetype = 2   )


Consider my code below:      System.out.println("Insert your inventory");     for (int i = 0; i<20;i++) {        System.out.print(i+1+".");        if (inventory[i] == "N" || inventory[i]=="n") {           break;        }        inventory[i] = s.nextLine();          }   How can I exit from this loop if the user enters 'N' or 'n'?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


Dior was the second King of Doriath and the son of Beren and Lúthien, so that made him half man, half elf and Maia. However, since Dior died before Manwë decreed any half-blood person could choose which kindred they wanted to be with, what was his fate?  Did he dwell in the Halls of Mandos with the Elves or did he go beyond the circles of Arda like Men do?

Earendil and Elwing were given the choice of kindreds after their journey to Valinor, This choice was extended to their sons (specifically sons, not daughters or grandchildren)  Elrond chose the race of the Eldar and his brother Elros chose to be counted amongst the Edain. Thus far Manwë's proclamation has been fulfilled.  There are some inconsistencies here:   Arwen was given the choice, but Elladan and Elrohir remained as Eldar in Imladris Tar-Vardamir was not given the choice The offspring of Imrazor and Mithrelas in Dol Amroth dont seem to have been given a choice   I can think of only one explanation, that the Mannish blood is dominant over the blood of the Eldar, thus, As Vardamir was the offspring of two mortals he did not fall under Manwë's proclamation despite being the son of a half elven.  However this does not seem to explain the other inconsistencies, Is it possible that Elladan and Elrohir and also the princes of Dol Amroth weren't considered important enough by Manwë or Eru to give them the choice.  Also as a side note Tolkien states there were only three unions between man and elf, but this seems to ignore Turin/Finduilas and Imrazor/Mithrelas  My question is, Why was Arwen given the choice and not the sons of Elros?