C# ClosedXML Table Theme list

Question: Is there any documentation or article listing the Table themes along with displaying the styles for excel workbooks in ClosedXML library. I am unable to find anything on this in their github documentation.
Answer: The implementation of the theme is determined by the application that opens the resulting file, i.e. Excel, LibreOffice Calc, etc. It's not a ClosedXML issue.
Comment: Yes also, the names provided in the styles property of the closedxml correspond to the same names as displayed in Table styles in excel on hovering over their previews
Answer: Open Excel, go to the Home Tab and click in the Styles section "Format as Table".
Now you can hover your mouse over the various table styles and it will show you their names, which you can than use with ClosedXML.
Other office products likely have similar features that will allow you to see a list of themes.

C# ClosedXML Table Theme list


Where can I find a plasma rifle/pistol in the Commonwealth?

Question: I have always loved the Plasma weapons in Fallout, because who doesn't like turning things in to a pile of green goo? In Fallout 4 they are even more versatile because you can mod the same gun between all of the different types (pistol, rifle, heavy, etc). So... I would like to get my hands on them. Problem is they seem to be pretty rare.
Where are some locations where I can find any version of a plasma gun?
Answer: Plasma weapons in Fallout 4 are relatively rare because of how powerful they are. You'll almost certainly not find one before level 20 and if you do you'll most likely be out of ammo for it with no way of getting more as the plasma cartridges are some of the most expensive ammunition in the game. Ultimately random drops are random and so you may find them anywhere, higher level enemies are far more likely to carry one than lower level enemies though.
You're far more likely to find a plasma pistol than any other form factor, but this can be upgraded into a rifle using the weapons bench as required, and to that end, there is normally a plasma pistol being stored inside the Mass Pike Tunnel West (near Diamond City), inside the room containing a steamer trunk with a Plasma Pistol inside.
The "best" plasma weapons in the game are the unique faction variants such as Experiment 18-A, which can be purchased from a synth vendor in the Institute, and the AX90 Fury or Sentinel's Plasmacaster, which can be purchased aboard the Prydwen.
Comment: Have an upvote, I had no idea I could upgrade the pistol into a rifle. I'll do that with Science!
Comment: @DavidYell Sure ignore that I put that into the question ;)  But Kalina.. is there really only that one pistol to be found in the game aside from Vendors? I was hopping that one webiste was wrong or just lacking more information.
Comment: Well random drops are random... I haven't been to that location to pick it up, I've found mine from random drops. You can apparently always get one in that specific location and thus I figured that would be a more useful answer than "random drops are random"
Comment: @james I gave you an upvote too!
Comment: I am just looking for any way to get these types of guns. I would not really want to modify the unique ones and I have not seen anything drop them as of yet (though I will admit I have not hunted down the Brother hood of Steel people as they are on my side so far... though they seem to prefer laser rifles so probably not helpful)
Comment: I have found a few plasma pistols and a rifle while clearing Vault 95 (dropped from enemies, mainly Gunners members). The place was rough though, those damn Assaultrons are no joke.
Comment: I will add, you can find unique pipe pistols+variants that do an additional amount of plasma damage. I found one that does an additional 10 plasma damage and turned it into a sniper rifle. The majority of one-shot kills end with the target turning into a pile of green goop.
Comment: @James Why not modify them? There's no risk of "damaging" them, and you can always put them back to the default configuration if the mood strikes you. In reality, the "unique" trait is a weapon component like any other. There are game mods (for PC, of course) that expose them and let you change them like any other part.
Comment: @T.J.L. Personal preference is all, I like keeping the unique guns unique? Hehe. Id rather have some randoms that I can just screw around with.
Answer: I bought an Incendiary Automatic Plasma Rifle from trader slightly north of a ruined town that always has a Yuo Guai resting in the center. She has a metal trailer just a few steps into the woods. I forgot the name of the town, but it's directly north of Fallon's Department Store and south of from Diamond City. It's an automatic so it pretty weak but I'm planning on modding the hell out of it once I get my hands on another one(and some ammo).
Comment: Trader inventories are random.
Answer: Although I've found most other types of weapon and ammo just by scavenging in the wasteland, plasma weapons do seem rarer and I ended up paying for them.
The weapon vendors Cricket and Arturo often have plasma weapons for sale. Cricket can sometimes be found near Diamond City, and Arturo is always in Diamond City Market during the day.
Answer: I just found a enraging plasma rifle in faneul hall from a legandery mutant dog whilst doing the gilded grasshopper mission
Comment: All legendary loot is random. This answer is not helpful.


Apache redirect web to other host on network

Question: I'm trying to set up one of my hosts as a sort of master web manager. It'll host the majority of my web content, but certain items have already been set up on other hosts and I'm quite content to leave them there.
 I'm trying to set up virtual hosts on the main web server for the specific domains that will need to be routed, but I can't seem to figure it out.
 in the 000-default.conf file, I've tried putting in

Proxy *>
Order deny,allow
Allow from all
/Proxy>
ProxyPass / (broke the link because of reputation. It's http:)//192.168.0.119/
ProxyPassReverse / (broke the link because of reputation. It's http:)//192.168.0.119/
Location />
Order allow,deny
Allow fom all
/Location>

 I also tried using

RewriteEngine on
RewriteRule ^/(.(asterisk)) (broke the link because of reputation. It's http:)//192.168.0.119/$1 [P]

And a few other variations of the above. Some would redirect to the IP rather than proxy the connection, so only local clients would be able to access the web page. Others wouldn't redirect or proxy at all. No errors or warnings in apaches logs. Help would be appreciated!
Answer: Could have sworn I used this before, but
RewriteEngine On
RewriteRule ^/?$ https://192.168.0.119/ [P]
 does the trick just fine.
Also, for anyone wanting to so HTTPS -> HTTPS proxies, you'll need to put the proxies in default-ssl.conf or other appropriately configured host file.


What does "rigorous proof" mean?

Question: I have heard several times that some mathematician has given another and more rigorous for an established theorem, but I don't know what does it really mean and what differences makes it to be more 'rigorous'. My understanding of a proof is that a proof is some explanation to convincing others that a statement is true. If some proof is not rigorous, does it mean that while the proof is acceptable for many but it is not for everybody? If so, the proof is not correct since it going to be rejected by some people and it is not a proof at all. Or, does rigorous mean it uses more advanced tools? If so, why not any alternative (but simpler) proof is also acceptable as rigorous (which is more 'valuable' as well since it's simpler!)?
Saying those limited insight of mine, my questions are:
$1-$ What does rigorous proof mean, in general definition?
$2-$ In order to understand your answers, as an example I am re-writing three of the proofs for the compactness of the torus. Which of the following proofs are most rigorous, 'normal' and least rigorous; and why so?

Theorem: The torus $T^2$ is compact.
First proof: The torus is homeomorphic to the product space $S^1 \times S^1$. The circle $S^1$ is compact. Therefore the torus is the product of two compact spaces, and thus it is compact.
Second proof: The torus $T$ is the subspace of $\mathbb{R}^3$ obtained by rotating a circle about the $z$-axis. The torus is closed since given any point in its complement, there is an open ball of sufficiently small radius centered at that point and disjoint from the torus. Also, the torus is bounded since it is contained in the ball of radius $4$ centered at the origin. Since the torus is closed and bounded in $\mathbb{R}^3$, it is compact.
Third proof: The torus is homeomorphic to a space obtained as a quotient
space of the square by identifying opposite edges. The square is a closed and
bounded subset of $\mathbb{R}^3$ and therefore is compact. Furthermore, a quotient map on the square is a continuous function, and the image of a compact space under a continuous function is compact. Therefore the torus is compact.
Thanks a lot for your guidance.
Comment: All proofs are rigorous, but differ how many details are given, and what is assumed to be known. For example, why is the $1$-torus $S^1$ compact ?
Comment: Someone else posted this same question today and then deleted it. The question had some phrasing that prompted me to write this comment, which is may be relevant here, but when I tried to save the comment, the question had been deleted: It doesn't mean thorough or exhaustive, although those may be consequences.  Rigor is inability to bend.  "Rigor" is etymologically related to "rigid", as squalor to squalid, candor to candid, splendor to splendid (and the etymological fallacy is seen when one considers humor/humid and liquor/liquid.
Comment: "Accepted by peers".
Comment: See [this](http://math.stackexchange.com/questions/1546264/what-is-a-valid-mathematical-proof?rq=1) and [this](http://math.stackexchange.com/questions/473733/what-does-rigor-mean-in-mathematics?rq=1).
Comment: I think a rigorous proof would prove everything, while a not so rigorous one would consider some parts trivial.
Comment: I agree with Dietrich Burde. A proof is rigorous according to its context.
Comment: @YvesDaoust: I would not agree on this one. I would rather say that a rigorous proof uses only well established theorems and each step of the proof is connected by such an established theorem well established theorem. There are many proofs that are only understood by a handful of experts, but still they are accepted as a rigorous proof.
Comment: @MrYouMath: well established theorems were accepted by peers at the time.
Answer: A proof is a succession of "trivial" steps, leading from one statement to another. To be perfectly rigorous, the trivial steps should be either axioms, or theorems proven in equally rigorous manner (and references to said proofs).
However, this is clearly impractical, so in the facts most steps are condensed or simply omitted, and it's up to the reader to fill in the gaps. The more gaps, the less rigor you have. It doesn't necessarily mean the steps are less correct: they can be perfectly true, but the reader has a more difficult task to check and understand them.
In your examples about the torus, you clearly use results about compact sets (among others). I don't have enough background here, so it is not detailed enough to convince me. On the other hand, a reader recognizing theorems he has accepted before would be able to fill the gaps and decide that some of them are sufficiently rigorous for him.
Answer: I don't think, that "rigorous" proof necessarily means that you provide a lot of details. It should be very clear, what you assume to be known, and what your definitions are, and how exactly the result is derived from this.
For example, the first proof seems not to be  very rigorous. First of all, we do not know how the torus is defined. If $T^n=S^1\times \cdots \times S^1$, then we also need to say why $S^1$ is compact, in order to conclude that $T^n$ is compact.
Comment: @DietrichBurde, I interpreted "rigorous proof" of a problem always as given, if the reader with no further/deeper background knowledge can actually understand the proof without having to look up every second notation / word / expressions. I find it hard to draw the line between a rigourous proof with lots and lots of details and one that doesn't include those details.
Comment: If compactness of $S^1$ be proven as a lemma beforehand, would it make the 'first proof' a rigorous proof?
Comment: Yes, indeed, provided you add your definition of a $2$-torus, say, $T^2:=S^1\times S^1$. For the lemma, see [here](http://math.stackexchange.com/questions/337272/show-that-unit-circle-is-compact).
Answer: A rigorous proof is a proof that can be seen to be valid by means of a valid proof-checking algorithm.  Aristotle and many who followed showed us that certain forms of argument cannot lead from true premises to a false conclusion.  One example of that is that a conclusion is validly deduced if it is true in every row in a truth table in which the premises are true.  Other examples involve what can and what cannot be done with the quantifiers $\exists$ and $\forall$.  There are efficient algorithms for checking validity of proofs, even when actually finding the proof may require insight.
It is said in comments above that a proof is rigorous according to its context.  I think it's more accurate to say a proof omits things assumed already known to the reader.  Published rigorous proofs are not usually rigorous proofs, but rather descriptions of rigorous proofs.  "No generality is lost by assuming blah blab blah" is an assertion requiring proof, but the proof is not given and the reader might feel his time is wasted if such a proof were there.  "Having proved $f$ is continuous [over the past ten pages] we can then deduce the conclusion from the intermediate value theorem." This may omit the simple proof that a certain quantity really is intermediate between two others.
A good description of a rigorous proof is not a rigorous proof itself, but it differs from an intuitive argument.

What does "rigorous proof" mean?


Where to place a radiator under a window seat?

Question: I have a bay window in which I want to build a window seat like this:
However, a radiator is currently attached to the wall underneath the windows, with a radiator cover (the typical board with holes) covering the front, and a windowsill covering the top. I'm figuring that I could either leave the radiator on the wall and build the seat around it, with the same type of radio cover as the front of the bench, or I could pull the radiator off the wall and move it forward a bit to get it closer to the cover. This would allow me to use the space between the wall and the radiator for storage, and I presume the radiation of the heater would improve somewhat if it was closer to the cover. I figure I could also use some flexible PEX pipe to go back and forth on the wall a few times before connecting it to the radiator, so that there would be a heat source right under the wall, and the radiator would still be close to the front of the bench.
What are the pros and cons of both configurations? Would both combat the cold air from the windows in roughly the same manner? Would the effect of moving the radiator forward be negligible in terms of improving radiation?
Answer: If the existing radiator is not covered now and you want to cover it with a seat of any construction type, it will drastically reduce it's heat output. Remember cast iron radiators heat by both radiation and convection. If you cover the radiator, you will loose the radiation aspect of that cast iron radiator greatly reducing it's heat output. Radiators, were "made to be seen", and not covered. So if you cover it you may have to add more heat output into the room. This could be somewhat offset if all radiators were zoned. This may not solve the problem but it could help. Also the cover would need to have a long register mounted directly above and be the full length of the radiator to allow for the convected air to escape. I have seen many cases where covers were installed and the areas could not be heated to the desired temperature. If your heating system is hot water, and not steam, the added heat required could come from cast iron baseboard radiation, which is still made, looks decent, and is very expensive. Finned tube radiation,  not usually installed in combination with a cast iron system, could be utilized if, and only if, the whole system is zoned. On a steam system convectors and/or  finned tube baseboard units made for a steam system could be utilized in addition to the now covered radiator, to provide the necessary additional  heating for the room. Zoning would not be required if the extra radiation were sized correctly. I would be very careful in choosing the heating company you choose to do the required work. Most residential heating companies are not schooled in steam. Placement of the radiator under the cover will not greatly affect its heat output, correct installation will.
Comment: As mentioned, the radiator is currently already covered by a windowsill above it and radiator cover in front of it. What I'm planning technically comes down to making the windowsill deeper. Either the radiator stays in place (and is thus further away from the cover in front of it, or is moved forward so that it is still right behind the cover. I'd prefer the latter (because it would create storage space) but wonder if this would adversely affect the combatting of cold air from the windows.
Comment: As an aside, it's a hot water system. What do you mean with "the cover would need to have a long register mounted directly above and be the full length of the radiator". What is a "register" in this context?
Comment: Please show a picture of the existing radiator. If you google ag 20 grill you can get an idea of the type of register  I am talking about.
Comment: Can't take a picture of the actual radiator right now, but it's your standard panel radiator like this one: //d183ptoxzilk60.cloudfront.net/medias/product_images_zoom/1_M_Brugman_22455028_0__22455885_0_jpg_zoom.jpg?context=bWFzdGVyfHByb2R1Y3RfaW1hZ2VzX3pvb218MjE1NjZ8aW1hZ2UvanBlZ3xpbWFnZXMvem9vbS9oMWYvaGQ3Lzg4NTkyNTc4OTY5OTAuanBnfGMwMjAyOTA3NmE2OGM5YjA1MGI5YjBlY2Q5YWY3OTlkN2E4MjZlMzlkMDU2ZTIyZTZkYTNlYjkxZWI0OGVhNGE
Comment: picture did not come through
Comment: http://www.myson.co.uk/static_files/my/images/logos/premier_he.png This, perhaps?
Answer: Make an air inlet at the bottom and outlet above the radiator on the top. Some cool metal or wooden "gills" can be found I am sure at home depot.
Answer: You can do almost anything you want to do with covering the radiator with an enclosure as long as air can get in to the bottom and out  the top of the enclosure so the convection air can flow up and over the radiator. If  you can see the face of the radiator now or as I previously wrote  " made to be seen" and you cover the   front of the radiator you will take away the" radiation affect" and greatly reduce it's ability to heat.( Think sitting in the sun or in the shade ). Your idea of moving the radiator forward makes sense and will give you storage room, and may  add to the heating output of the radiator by a slight amount. Just make sure you have enough air flow in and out. You could use the registers both on the bottom and the top.Hopefully this helps with your plan; GOOD LUCK


Safari style animations

Question: Anybody know if it's possible to get mac book style animations on ubuntu? Specifically the back, forward, and exit tab animations.
Answer: In Chrome their is an extension that adds back and forward animations called SwipeGesture

Safari style animations


Why is my integer always zero?

Question: I am embarrassed to have such a simple question, but I just don't know what I'm doing wrong. I'm trying to have a level unlock after score 20. The first time the level gets unlocked, I want to give the user a message saying "level unlocked". I do this like so:
if(firstTimeOne == 0 && currentHighOne.getInt("levelOneHigh", 0) >= 20){ //First time getting a score over 20
                Toast.makeText(LevelSelect.this, "Unlocked level two!" +firstTimeOne, Toast.LENGTH_SHORT).show();
                firstTimeOne=1;
            }

The problem is, this code executes every time the user gets a score over 20... The firstTimeOne variable should be preventing that, right? It is set to 1 after this method has been called, preventing it to be called again. So, why is this method getting called more than once?
I make the variable firstTimeOne in my class, where I write:
int firstTimeOne = 0;

If you need my full code, here it is. It shows that I initialize the int in the class, rather than in a method:
https://gist.github.com/anonymous/b52a5873b9eb9324e671
EDIT:
Okay, so I am trying SharedPreferences, but get a null pointer exception on `edit.putInt("firstInt", 1); Here is the code: https://gist.github.com/anonymous/c5b71982559c245220df

   //ints will be zero if they do not have a value assigned to them...right?
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_level_select);

        levelTwoButton = (Button) findViewById(R.id.leveltwo);

        SharedPreferences currentHighOne = this.getSharedPreferences("levelOneScore", Context.MODE_PRIVATE);
        if (currentHighOne.getInt("levelOneHigh", 0) < 20) {
            levelTwoButton.setClickable(false);
            levelTwoButton.setText("Level two is locked!");
        }else{

            SharedPreferences firstTimeOne = this.getSharedPreferences("firstTimeOne", Context.MODE_PRIVATE); //Making a shared pref

            if(firstTimeOne.getInt("firstInt" , 5) == 5) { //Check if I've stored values in it yet
                edit = firstTimeOne.edit();
                edit.putInt("firstInt", 0); //Setting the default as 0
                edit.commit();
            }
            if(firstTimeOne.getInt("firstInt", 0) == 0 && currentHighOne.getInt("levelOneHigh", 0) >= 20){ //First time getting a score over 20
                Toast.makeText(LevelSelect.this, "Unlocked level two!" +firstTimeOne, Toast.LENGTH_SHORT).show();

                edit.putInt("firstInt", 1);
            }
        }
    }

Thanks so much for everything,
Comment: *"although I don't think it is necessary"* It's crucial, as your question gives no indication of where or how `firstTimeOne` is declared or initialized, or what happens after the code above runs, or how the code above is run.
Comment: What does this have to do with arrays and strings, as per your tag? Are you sure it's using the same instance of the class each time?
Comment: You probably want to save `firstTimeOne` to your Preferences as well. Otherwise, it will be zero whenever the Activity is started anew.
Comment: @RuchirBaronia: Code related to your question must be **in** your question, not just linked. Links rot, making the question and its answers useless to people in the future, and people shouldn't have to follow some random link to help you.
Comment: @JonSkeet Thanks for our reply. What do you mean _are you sure its using the same instance of the class each time?_ I'm not using an object...Let me know!
Comment: @MikeM. Great idea Mike, I will do that and update my question!
Comment: @T.J.Crowder I didn't realize that T.J, thanks for pointing that out. I will edit my question!
Comment: @MikeM. But, even if I am not changing screen orientation or doing anything that would restart onCreate, why is the int always 0?
Comment: I have a feeling that that's not your entire class, but if you're calling `finish()` or pressing the Back Button, the Activity will be created anew each time you start it.
Comment: I'm, you are using an object. You're assigning to an instance variable... What instance did you think that was, if you thought that you weren't using an object?
Comment: @T.J.Crowder Okay, so I am trying SharedPreferences, but get a null pointer exception on `edit.putInt("firstInt", 1); Here is the code: https://gist.github.com/anonymous/c5b71982559c245220df
Comment: @JonSkeet I understand what you're saying now. It gets reset when I come back to the activity. So I am trying SharedPreferences, but get a null pointer exception on `edit.putInt("firstInt", 1); Here is the code: https://gist.github.com/anonymous/c5b71982559c245220df
Comment: @MikeM. **UM,** I am trying SharedPreferences, but get a null pointer exception on `edit.putInt("firstInt", 1); Here is the code: https://gist.github.com/anonymous/c5b71982559c245220df
Comment: @T.J.Crowder See edit
Answer: Your int variable is a member of your Activity class and you're checking it in the activity's onCreate() callback which is only called when the activity is instantiated. Each instance of your activity is instantiated anew and member variables get their default values. It's not the same int you wrote that you are later reading.
If you want to persist data across activity instances, consider using e.g. SharedPreferences.
Comment: Okay, so I am trying SharedPreferences, but get a null pointer exception on `edit.putInt("firstInt", 1); Here is the code: https://gist.github.com/anonymous/c5b71982559c245220df
Comment: Your `SharedPreferences.Editor edit` is not initialized in the branch where you're calling `putInt()` on it.
Comment: So...what should I do. Should I create a new object in the visible scope? Thanks
Comment: Make sure you're initializing `edit = sharedPreferences.edit()` before calling any methods on the `edit`. For example in your gist move the initialization one level up from the `if` conditional so it's initialized for both. Also note that you're missing a `commit()` or `apply()` in the latter block.
Comment: Okay, thanks it worked. I have marked you best answer and liked your answer.

Why is my integer always zero?


using backtracking with tree

Question: I'm using the backtracking algorithm in tree thanks to a stack (with push and pop).
It works but i've got a problem. The path given by the stack is "wrong".
bool Prefix(Node*root, stack *tas, char *search)
{
    if (!isEmpty(root))
    {
        if (strcmp(search,root->data) != 0)
            push(tas, root->data, search, root);

        if (strcmp(search,root->data) == 0)
        {
            return True ;
        }

        Prefix(root->left, tas, search);
        Prefix(root->right, tas, search);
    }
    return False;
}

For example, i've got a tree as :
     Root
    /    \
   A      B
  / \    / \
 C   D  E   F

When I want the path of C for example, this function returns R A B (ok for R and A, not B).
I don't know if it comes from this function or the push() function.
If you don't see any error in the function, I will paste push() but it's quite long.
Edit: I better understand now,
I've added to the function :
  if node is a leaf, pop().
If I search F, it returns me R A B F instead of R B F.  I don't konw how to avoid to keep A in the stack.
edit2 :
Here is the code : (returns R A B F instead of R B F)
bool Prefix(Node*root, stack *tas, char *search)
{
    if (!isEmpty(root))
    {
        if (strcmp(search,root->data) == 0)
            return True ;

        if (LeafOrNot(root) == True ){  //it's a leaf, pop()
            pop(tas);

        if (Prefix(root->left, tas, search))
            return True;
        if (Prefix(root->right, tas, search))
            return True;
    }
    return False;
}

I don't understand how I can pop traversing child node to obtain the good result, maybe adding
a else to if (Prefix(root->left, tas, search))  ? Anyone have an idea ?
thanks !
Comment: You're almost there.  If you pop from the stack not just at the leaf node but after traversing any child nodes, this will give you the result you want.  Just be sure that you don't pop off the stack when the node is found.

If you're searching for D, it will be push Root, push A, push C, pop C, push D, found... unwind all the way back up the call chain.

If you're searching for F: push Root, push A, push C, pop C, push D, pop D, pop A, push B, push E, pop E, push F, found, unwind...

Hope this helps.
Comment: I've tried to had another pop(tas) but it doesn't work. I need to change the code's structure ? thanks
Answer: At least one problem is that you're not checking the return values of your calls to Prefix, so you don't know if the recursive calls "finish" (and that you should stop exploring).
A simple way to see this is just walk through the function calls (given your sample tree):

Prefix("Root")
  found "C"?
    no: Prefix("A")
      found "C"?
        no: Prefix("C")
           found "C"?
              yes: return true
        (without check of Prefix("C")): Prefix("D")
           found "C"?
              no: return false
      Prefix("B")
        found "C"?
          no: Prefix("E")
             found "C"?
               no: return false
          Prefix("F")
             found "C"?
               no: return false
       return false
  return false

This shows the order of the calls and indents correspond roughly to frames on the call stack.
You can see where checking if a call to Prefix returns true will allow you to exit at the appropriate time.
Comment: @Mitch: Suppose you want to find the path to `D`, and you only explore the left branch, you cannot find the path, despite one existing. The OP's function only records nodes the algorithm has visited (not all candidate visits), thus to enumerate paths it must explore all available branches.
Comment: @Mitch: Sure, Binary Search Trees have that property, straight Binary Trees have no ordering requirements. Given the OP's original function and description, I see no reason to think it's a BST. (also, OP openly states using a backtracking algorithm, which requires...backtracking)
Comment: also, does the poster need to add both branches?
Comment: and you can at least see what you are getting at each step. Simple printf can help :)
Comment: @Mitch: How else would the algorithm explore both child nodes?
Comment: he doesn't need both branches if he's finding the path to a single node. Surely?
Comment: @Sophy: failing to check the return values drops them on the floor, see my edit for what happens when you *don't* check the return values (or just walk through the calls on your own, and it will become clear)
Comment: @Mark: OK. I just can't see the point of not imposing an ordering. Its a pointless data structure without the ordering
Comment: @Mark, I misunderstood but I totally agree with you.
Comment: @Mitch, there are plenty of uses for a tree that is unordered.  Take for example and ancestry tree.  If you wanted to find the path to a certain descendant, what sort of ordering would you impose?  Decision trees are another example; if you wanted to traverse the tree to find the path it took to make a certain decision, you can't assume a particular order.  Also, think about m-ary trees where m is greater than 2, how would order that.  You can't always assume the left is less than the right.
Comment: @Mitch Your claim that BT's without ordering are pointless is severely underinformed; I suggest that you review a basic data structures text. As Mark Elliot already pointed out to you, BST's are only one example of BT's, and searching for a node is not the only operation done on BT's. In the OP's case, it is not a BST and a node is not being sought, rather a *path* is being sought. Consider a BT where a value can occur at more than one node in the tree and the task is to find every path through the tree to a node holding a particular value.
Answer: I have to agree with @Mark Elliot but at first glance, his answer may seem confusing.  You do need a stop condition so you don't keep exploring other nodes and adding them to the stack.  You are returning a bool so you can use that to test if the call finds the node your looking for.
If it was your intention to include the last node in the path to C in the stack, then you should remove the string compare when adding to the stack.
For example, you could do this.
bool Prefix(Node*root, stack *tas, char *search)
{
    if (!isEmpty(root))
    {
        push(tas, root->data, search, root);

        if (strcmp(search,root->data) == 0)
        {
            return True;
        }

        if (Prefix(root->left, tas, search))
            return True;
        if (Prefix(root->right, tas, search))
            return True;
    }
    return False;
}

Comment: Yes, and I upvoted it, but this is an education site. I wasn't criticizing your code, rather the OP's push call, and pointing out additional optimization. Note: the reason that I included these comments here is because yours is the best answer and where the OP is most likely to look and thus is the best place to point out these improvements.
Comment: The push here is excessive; the only thing that needs to be stored on the stack is the Node*. An efficient way to do this is to allocate Node stack elements from the program stack, and then process the Node stack when the matching Node is found. e.g., `typedef struct NodeStack NodeStack; struct NodeStack { Node* node; NodeStack* link; };` ... `bool Prefix(Node* node, NodeStack* link, char* search){ if(!isEmpty(node){ NodeStack elem = { node, link }; if(strcmp(search, node->data) == 0){ processStack(&elem); return true;} if(Prefix(node->left, &elem, search)) return true;` etc.
Comment: Also, the tail recursion could be turned into iteration simply by changing the `if(!isEmpty...` to a `while` and replacing the second `if(Prefix...` with `node = node->right;` (I replaced `root` with `node`, because it's an arbitrary node, not the root; bad names make for bad code).
Comment: All good points but as you can see, my code sample is merely a slight modification of the original to point out Mark's answer.

using backtracking with tree


ApexChart fixed labels x asis for rangeBar chart

Question: This is my chart option code:
const options = {
  chart: {
    type: "rangeBar",
  },
  series: [
    {
      data: [
        {
          x: "Code",
          y: [Date.UTC(2019, 3, 2, 12, 30), Date.UTC(2019, 3, 2, 13, 0)],
        },
        {
          x: "Code",
          y: [Date.UTC(2019, 3, 2, 15, 30), Date.UTC(2019, 3, 2, 16, 0)],
        },
        {
          x: "Code",
          y: [Date.UTC(2019, 3, 2, 18, 0), Date.UTC(2019, 3, 2, 19, 0)],
        },
        {
          x: "Code",
          y: [Date.UTC(2019, 3, 2, 22, 0), Date.UTC(2019, 3, 2, 24, 0)],
        },
      ],
    },
  ],
  plotOptions: {
    bar: {
      horizontal: true,
    },
  },
  xaxis: {
    type: "datetime",
  },
};

And this is the result:

I don't know how to add fixed labels from 00:00 to 24:00 hour format. That's my problem.
I also did this but doesn't work:
xaxis: {
    type: "category",
    categories: ["00:00", ..., "24:00"]
  },

Thanks
Answer: Finally i fixed this in this repo:
https://github.com/mortezasabihi/apexchart-timeline


Azure Service Fabric Actors Reentrancy with Services

Question: When using stateful services and actors in service fabric, the documentation states that actors have an reentrancy policy allowing actors to go from ActorA to AcotrB and back to ActorA in one call context chain. As described here here
But how does this interact with services? Eg. can i do something like: Service1 > Actor1 > Service2 > Actor2 > Service1 > Actor1 ...? Or will the call context be lost when contacting a service?
Answer: Re-entrancy only applies between actors. In your example, the second invocation from Service1 to Actor1 will block and eventually time out.


Year column and Month column into Date colum R

Question: I have dataframe with 2 date columns (year and month) and I would like to merge them into 1 (I will use that column in plotting x-axis).
How can I merge them so values in it will look like "1990-03"
structure(list(Year = c(1983, 1983, 1983, 1983, 1983, 1983),
    Month = c(5, 6, 7, 8, 9, 10), MEI = c(2.556, 2.167, 1.741,
    1.13, 0.428, 0.002), CO2 = c(345.96, 345.52, 344.15, 342.25,
    340.17, 340.3), CH4 = c(1638.59, 1633.71, 1633.22, 1631.35,
    1648.4, 1663.79), N2O = c(303.677, 303.746, 303.795, 303.839,
    303.901, 303.97), CFC.11 = c(191.324, 192.057, 192.818, 193.602,
    194.392, 195.171), CFC.12 = c(350.113, 351.848, 353.725,
    355.633, 357.465, 359.174), TSI = c(1366.1024, 1366.1208,
    1366.285, 1366.4202, 1366.2335, 1366.0589), Aerosols = c(0.0863,
    0.0794, 0.0731, 0.0673, 0.0619, 0.0569), Temp = c(0.109,
    0.118, 0.137, 0.176, 0.149, 0.093)), row.names = c(NA, 6L
), class = "data.frame")

I was trying some methods but keep getting NA
Comment: Try: df %>% mutate(YM = str_c(Year, Month, sep = '-'))
Answer: You could use sprintf to format the month into two digits and paste with the year:
sprintf("%04d-%02d",df$Year,df$Month)
[1] "1983-05" "1983-06" "1983-07" "1983-08" "1983-09" "1983-10"
df$Date <- sprintf("%04d-%02d",df$Year,df$Month)
## dplyr alternative
df %>% mutate(Date=sprintf("%04d-%02d",df$Year,df$Month))

  Year Month   MEI    CO2     CH4     N2O  CFC.11  CFC.12      TSI Aerosols  Temp    Date
1 1983     5 2.556 345.96 1638.59 303.677 191.324 350.113 1366.102   0.0863 0.109 1983-05
2 1983     6 2.167 345.52 1633.71 303.746 192.057 351.848 1366.121   0.0794 0.118 1983-06
3 1983     7 1.741 344.15 1633.22 303.795 192.818 353.725 1366.285   0.0731 0.137 1983-07
4 1983     8 1.130 342.25 1631.35 303.839 193.602 355.633 1366.420   0.0673 0.176 1983-08
5 1983     9 0.428 340.17 1648.40 303.901 194.392 357.465 1366.234   0.0619 0.149 1983-09
6 1983    10 0.002 340.30 1663.79 303.970 195.171 359.174 1366.059   0.0569 0.093 1983-10

For completeness (improving on @KarthikS's comment) U could use stringr::str_c and stringr::str_pad the latter to pad the month with 0s and the former to concatenate the Year and Month
str_c(df$Year, str_pad(df$Month, 2, pad=0), sep='-')
[1] "1983-05" "1983-06" "1983-07" "1983-08" "1983-09" "1983-10"

Comment: great, to make it work with ggplot i also used as.yearmon from zoo library
`as.Date(as.yearmon(sprintf("%04d-%02d",df$Year,df$Month)))`
Comment: You can also use ```df$YM <- format(as.Date(paste(df$Year, df$Month, "1", sep = "-"), format = "%Y-%m-%d"), "%Y-%m")``` in case you want to stay with base R. Also, this question is possibly connected to [Converting year and month ("yyyy-mm" format) to a date?](https://stackoverflow.com/questions/6242955/converting-year-and-month-yyyy-mm-format-to-a-date) and [Extract Month and Year From Date in R](https://stackoverflow.com/questions/37704212/extract-month-and-year-from-date-in-r/37704385).


Submitting Dictionary to Controller

Question: My View is Strongly-typed Dictionary. I use Html.EditorFor() in a foreach loop that itarates over the elements in the Dictionary and creates a text fields for the values. When I try to submit the form  it gives me
[InvalidCastException: Specified cast is not valid.]
   System.Web.Mvc.CollectionHelpers.ReplaceDictionaryImpl(IDictionary`2 dictionary, IEnumerable`1 newContents) +95

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0

In my Controller I have:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult SendDictionary()
{
   if (ModelState.IsValid )
    {
        Dictionary<int, int> dictionary = new Dictionary<int, int>();
        dictionary.Add(1, 1);
dictionary.Add(2, 1);
dictionary.Add(3, 1);
dictionary.Add(4, 1);
dictionary.Add(5, 1);
        return View(dictionary);
     }
     else
     {
       return View();
     }
}

[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult CallMe(Dictionary<int, int> Dict)
{
        if (ModelState.IsValid)
        {
            return View("YEs");
        }
        else
        {
            return View();
        }
}

Model:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MasterPage.Master" Inherits="System.Web.Mvc.ViewPage<Dictionary<int, int>>" %>

In my View:
 <% using (Html.BeginForm("CallMe", "Call", FormMethod.Post))
           {%>
        <%: Html.AntiForgeryToken()%>
        <%foreach (var key in Model.Keys)
          {%>

                <%: Html.EditorFor(m => Model[key])%>

        <% } %>

                <input type="submit" value="submit" />

 <% } %>

Can somebody help me with that error?? Thanks
Comment: In your view, can you show the `@model` bit please?
Comment: I edit it, so that you can see now :)
Comment: Do you need to say Model[key].ToString() ? I am just guessing ..
Comment: Just tried. It gives me:  Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions
Answer: In view, make your html like this type:

@using (Html.BeginForm("CallMe", "Call", FormMethod.Post))
{

  var list = Model as IDictionary<int, int>;

  for (var index = 0; index < Model.Count; index++)
  {
    <input type="text" name="dictionary[@index].Key" value="@list.Keys.ElementAtindex)" />
    <input type="text" name="dictionary[@index].Value" value="@list.Values.ElementAt(index)" />
  }
}

So that in controller you can get
        [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult CallMe(IDictionary<int, int> dictionary)
    {
        // Use your dictionary

        var dictionary1 = new Dictionary<int, int>();
        dictionary1 = (Dictionary<int, int>)dictionary;
        if (ModelState.IsValid)
        {
        }
        return View(dictionary1);
    }

Answer: Try this
 Dictionary<object, object> dictionary = new Dictionary<object, object>();

Comment: It doesn't give me an exception, but in the Dictionary in CallMe(), there is only two records. First is key=controller and value=controller name. The Second is the action and action name. "controller", "ControllerName" and "action", "CallMe"

Submitting Dictionary to Controller


How to kill the Mega Interplanetary Ninja Assassin Claptrap?

Question: So it appears that doing the Claptrap DLC in playthrough 2 wasn't such a smart idea after all. While it's boosted me from level 44 to level 47 fairly painlessly, pretty much everything has a couple hundred times more health than it should've... and kamikaze claptraps oneshot you and are useless for second winds.
Excessive amounts of health notwithstanding I've made my way to the MINAC... where I died thrice in quick succession. Everything — from the ten turrets to MINAC itself — seems to have pretty much infinite health. It probably doesn't help that my best weapons are fire and not corrosive.
At any rate that puts me kind of in an ugly spot. How do I tackle this monstrosity, grinding of gears and wobbly heads and pink panties notwithstanding?
Comment: IDDQD maybe? :)
Comment: What class are you?
Comment: @BenBrocka Commando
Answer: Kill all the turrets first; they don't respawn. They're not too hard to take out (relatively), but they're occasionally covered by invincible covers. Kill the turrets one by one if you're having trouble taking them down before dying; their health does reset but only if they're alive. Make sure all turret slots are dead before preceding. IIRC, corrosive damage helps as well, corrosive sniper would be best, failing that a magnum or SMG.
Stay the heck away from it; if it runs you over it's an instant kill. Just run around at a long distance and shoot it's eye (that is the weakpoint isn't it? Been a while), there's several places you can hide while you're doing this as well, use cover well.
Don't kill the claptraps except the Kamikazes or the ones getting too close/hurting you too much. They're there for second winds.
Answer: Just tackled this one myself.
First, make sure to equip a shield that's fire resistant. The asbestos one, with very high resistence, is aces. Fun fact: with that shield, the eye laser does not hurt you at all. It doesn't even bring your shields down. You can shoot the eye at will.
Second, run to the left from the area where you're respawning. At the very far end you'll find some ruins, there's a wall there with a partial window and you can comfortably crouch behind it. The kamikaze clappys won't reach you back there, they will madly run towards the wall, hug it, and explode, with no harm to you. This is useful as they drop stuff, bullets and health.
From behind the wall you can sniper out the turrets and finally shoot the eye at will. At some points the giant claptrap will become very close to you, this is the ideal opportunity to shoot the laser eye without taking damage from the frontal turret.
I hope it helps someone out there.
Comment: As a note, there are actually two such windowed ruins, one by the gate, and one across.  They both are immune to ClapTrap Kamikaze attacks as far as I can tell.

There are a few other places the Kamikazes won't get you, but most of them do not have nearly as good cover from MINAC's attacks.
Answer: Actually, this "Fyrestone" map gives you at least one safe spot (I don't need more than that, obviously) where taking down the big toaster gets rather simple. I don't feel like making a video now (tried a screenshot, but I can't find a shot that clearly shows the position), so I'll try to describe it. You can use the original Fyrestone map to follow my directions; the DLC4 version looks pretty much the same.
If you stand where you start the game (after getting dropped of the bus) turn left and go to the southern fence (presumeably the bus CAME through there, although I have no idea why they nailed it shut afterwards). Follow the wall at the east. On your left, you will pass a large stone, then a small stone, then another large one. Then you'll get to the largest stone yet, with a path between that large one and a smaller one. Crouching in that "passage" behind the large rock will prevent the Kamikaze claptraps from reaching you, and the big bad can't do much either unless you stand up to take some shots at him.
Sorry, that's just the easy way of doing it. You can always do it the hard way, running around, taking care of the Kamikaze guys, trying dodge the big guns and nibbling them down. Presumeably that didn't work out for you, though -- playing a Siren, my own boss-combat techniques are of no help to you since you aren't phasewalking no matter how hard you try, so I'm not trying to give you soldier advice :-) My own soldier isn't that far yet, and he won't go open combat since he has a big sister that tells him where it's safe :-)
Answer: I have tried tackling him myself and i find its a lot easier to do with a friend as they can distract MINAC long enough to get a couple of shots on the eye. Any corrosive gun is reccomended cause even though i'm only level 22 he was quite easy to take down with a 30 damage corrosive smg


Take arabian text between arabian numbers

Question: I'm noob in a regular expressions and need help. Here part of source text (given me as string):

١ - عَنْ عُمَرَ بْنِ الْخَطَّابِ رَضِيَ اللهُ عَنْهُ قَالَ: سَمِعْتُ
  رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم يَقُولُ: «إِنَّمَا
  الْأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى،
  فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى دُنْيَا يُصِيبُهَا أَوْ إِلَى
  امْرَأَةٍ يَنْكِحُهَا، فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ».
  (البخاري: ١) ٢ - عَنْ عَائشَةَ رَضِيَ اللهُ عَنْهَا: أَنَّ الْحَارِثَ
  بْنَ هِشَامٍ رَضِيَ اللهُ عَنْهُ سَأَلَ رَسُولَ اللهِ صَلَّى اللهُ
  عَلَيْهِ وَسَلَّم فَقَالَ: يَا رَسُولَ اللهِ، كَيْفَ يَأْتِيكَ
  الْوَحْيُ؟ فَقَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم:
  «أَحْيَانًا يَأْتِينِي مِثلَ صَلْصَلَة الْجَرَسِ - وَهُوَ أَشَدُّهُ
  عَلَيَّ - فَيَفْصِمُ عَنِّي وَقَدْ وَعَيْتُ عَنْهُ مَا قَالَ،
  وَأَحْيَانًا يَتَمثَّلُ لِيَ الْمَلَكُ رَجُلًا فَيُكَلِّمُنِي فَأَعِي
  مَا يَقُولُ». قَالَتْ عَائشَةُ رَضِيَ اللهُ عَنْها: وَلَقَدْ
  رَأَيْتُهُ يَنْزِلُ عَلَيْهِ الْوَحْيُ فِي الْيَوْمِ الشَّدِيدِ
  الْبَرْدِ، فَيَفْصِمُ عَنْهُ وَإِنَّ جَبِينَهُ لَيَتَفَصَّدُ عَرَقًا.
  (البخاري: ٢)

What pattern should I write for taking only text between numbers (include start number)? Expected result:

١ - عَنْ عُمَرَ بْنِ الْخَطَّابِ رَضِيَ اللهُ عَنْهُ قَالَ: سَمِعْتُ
  رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم يَقُولُ: «إِنَّمَا
  الْأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى،
  فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى دُنْيَا يُصِيبُهَا أَوْ إِلَى
  امْرَأَةٍ يَنْكِحُهَا، فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ».
  (البخاري: ١)

and

٢ - عَنْ عَائشَةَ رَضِيَ اللهُ عَنْهَا: أَنَّ الْحَارِثَ بْنَ هِشَامٍ
  رَضِيَ اللهُ عَنْهُ سَأَلَ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ
  وَسَلَّم فَقَالَ: يَا رَسُولَ اللهِ، كَيْفَ يَأْتِيكَ الْوَحْيُ؟
  فَقَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم: «أَحْيَانًا
  يَأْتِينِي مِثلَ صَلْصَلَة الْجَرَسِ - وَهُوَ أَشَدُّهُ عَلَيَّ -
  فَيَفْصِمُ عَنِّي وَقَدْ وَعَيْتُ عَنْهُ مَا قَالَ، وَأَحْيَانًا
  يَتَمثَّلُ لِيَ الْمَلَكُ رَجُلًا فَيُكَلِّمُنِي فَأَعِي مَا يَقُولُ».
  قَالَتْ عَائشَةُ رَضِيَ اللهُ عَنْها: وَلَقَدْ رَأَيْتُهُ يَنْزِلُ
  عَلَيْهِ الْوَحْيُ فِي الْيَوْمِ الشَّدِيدِ الْبَرْدِ، فَيَفْصِمُ
  عَنْهُ وَإِنَّ جَبِينَهُ لَيَتَفَصَّدُ عَرَقًا. (البخاري: ٢)

May be there alternatives such as Split?
Comment: Do you just need `Regex.Matches(s, @"\d.*?\d+").Cast().Select(m=>m.Value).ToList()`? Or if you just need Arabic digits, `@"[۱-۹].*?[۱-۹]+"`?
Comment: @WiktorStribiżew I need arabian digits and other stuff such ` - ۱` at the start of each block
Comment: `@"\d.*?(?=\d|$)"`?
Comment: @WiktorStribiżew will try later
Comment: Ok, I am just not accustomed to Arabic script. If you could provide a simplified ASCII-based sample with expected result, I could help with more certainty.
Answer: I've given an initial shot at the question. Definitely a challenging one, Here's a javascript based regex for fetching the words in between the Arabic numbers.
/[(\[\u0660-\u0669](.*?)[\u0660-\u0669]/g
There might be a few bugs here and there but I guess this brings you a little closer to the answer. I've added another test case with

١  هذه هي اللغة العربية  ١

and tested with the paragraph you've provided.
Here's a complete example:
const regex = /[(\[\u0660-\u0669](.*?)[\u0660-\u0669]/g;
const str = `١ - عَنْ عُمَرَ بْنِ الْخَطَّابِ رَضِيَ اللهُ عَنْهُ قَالَ: سَمِعْتُ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم يَقُولُ: «إِنَّمَا الْأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى، فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى دُنْيَا يُصِيبُهَا أَوْ إِلَى امْرَأَةٍ يَنْكِحُهَا، فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ». (البخاري: ١)

٢ - عَنْ عَائشَةَ رَضِيَ اللهُ عَنْهَا: أَنَّ الْحَارِثَ بْنَ هِشَامٍ رَضِيَ اللهُ عَنْهُ سَأَلَ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم فَقَالَ: يَا رَسُولَ اللهِ، كَيْفَ يَأْتِيكَ الْوَحْيُ؟ فَقَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم: «أَحْيَانًا يَأْتِينِي مِثلَ صَلْصَلَة الْجَرَسِ - وَهُوَ أَشَدُّهُ عَلَيَّ - فَيَفْصِمُ عَنِّي وَقَدْ وَعَيْتُ عَنْهُ مَا قَالَ، وَأَحْيَانًا يَتَمثَّلُ لِيَ الْمَلَكُ رَجُلًا فَيُكَلِّمُنِي فَأَعِي مَا يَقُولُ». قَالَتْ عَائشَةُ رَضِيَ اللهُ عَنْها: وَلَقَدْ رَأَيْتُهُ يَنْزِلُ عَلَيْهِ الْوَحْيُ فِي الْيَوْمِ الشَّدِيدِ الْبَرْدِ، فَيَفْصِمُ عَنْهُ وَإِنَّ جَبِينَهُ لَيَتَفَصَّدُ عَرَقًا. (البخاري: ٢)

١هذه هي اللغة العربية١

١ - عَنْ عُمَرَ بْنِ الْخَطَّابِ رَضِيَ اللهُ عَنْهُ قَالَ: سَمِعْتُ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم يَقُولُ: «إِنَّمَا الْأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى، فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى دُنْيَا يُصِيبُهَا أَوْ إِلَى امْرَأَةٍ يَنْكِحُهَا، فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ». (البخاري: ١) ٢ - عَنْ عَائشَةَ رَضِيَ اللهُ عَنْهَا: أَنَّ الْحَارِثَ بْنَ هِشَامٍ رَضِيَ اللهُ عَنْهُ سَأَلَ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم فَقَالَ: يَا رَسُولَ اللهِ، كَيْفَ يَأْتِيكَ الْوَحْيُ؟ فَقَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم: «أَحْيَانًا يَأْتِينِي مِثلَ صَلْصَلَة الْجَرَسِ - وَهُوَ أَشَدُّهُ عَلَيَّ - فَيَفْصِمُ عَنِّي وَقَدْ وَعَيْتُ عَنْهُ مَا قَالَ، وَأَحْيَانًا يَتَمثَّلُ لِيَ الْمَلَكُ رَجُلًا فَيُكَلِّمُنِي فَأَعِي مَا يَقُولُ». قَالَتْ عَائشَةُ رَضِيَ اللهُ عَنْها: وَلَقَدْ رَأَيْتُهُ يَنْزِلُ عَلَيْهِ الْوَحْيُ فِي الْيَوْمِ الشَّدِيدِ الْبَرْدِ، فَيَفْصِمُ عَنْهُ وَإِنَّ جَبِينَهُ لَيَتَفَصَّدُ عَرَقًا. (البخاري: ٢)`;
let m;

while ((m = regex.exec(str)) !== null) {
    // This is necessary to avoid infinite loops with zero-width matches
    if (m.index === regex.lastIndex) {
        regex.lastIndex++;
    }

    // The result can be accessed through the `m`-variable.
    m.forEach((match, groupIndex) => {
        console.log(`Found match, group ${groupIndex}: ${match}`);
    });
}

The result of the group matches are as follows:
Found match, group 0: ١ - عَنْ عُمَرَ بْنِ الْخَطَّابِ رَضِيَ اللهُ عَنْهُ قَالَ: سَمِعْتُ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم يَقُولُ: «إِنَّمَا الْأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى، فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى دُنْيَا يُصِيبُهَا أَوْ إِلَى امْرَأَةٍ يَنْكِحُهَا، فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ». (البخاري: ١
Found match, group 1:  - عَنْ عُمَرَ بْنِ الْخَطَّابِ رَضِيَ اللهُ عَنْهُ قَالَ: سَمِعْتُ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم يَقُولُ: «إِنَّمَا الْأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى، فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى دُنْيَا يُصِيبُهَا أَوْ إِلَى امْرَأَةٍ يَنْكِحُهَا، فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ». (البخاري:
Found match, group 0: ٢ - عَنْ عَائشَةَ رَضِيَ اللهُ عَنْهَا: أَنَّ الْحَارِثَ بْنَ هِشَامٍ رَضِيَ اللهُ عَنْهُ سَأَلَ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم فَقَالَ: يَا رَسُولَ اللهِ، كَيْفَ يَأْتِيكَ الْوَحْيُ؟ فَقَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم: «أَحْيَانًا يَأْتِينِي مِثلَ صَلْصَلَة الْجَرَسِ - وَهُوَ أَشَدُّهُ عَلَيَّ - فَيَفْصِمُ عَنِّي وَقَدْ وَعَيْتُ عَنْهُ مَا قَالَ، وَأَحْيَانًا يَتَمثَّلُ لِيَ الْمَلَكُ رَجُلًا فَيُكَلِّمُنِي فَأَعِي مَا يَقُولُ». قَالَتْ عَائشَةُ رَضِيَ اللهُ عَنْها: وَلَقَدْ رَأَيْتُهُ يَنْزِلُ عَلَيْهِ الْوَحْيُ فِي الْيَوْمِ الشَّدِيدِ الْبَرْدِ، فَيَفْصِمُ عَنْهُ وَإِنَّ جَبِينَهُ لَيَتَفَصَّدُ عَرَقًا. (البخاري: ٢
Found match, group 1:  - عَنْ عَائشَةَ رَضِيَ اللهُ عَنْهَا: أَنَّ الْحَارِثَ بْنَ هِشَامٍ رَضِيَ اللهُ عَنْهُ سَأَلَ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم فَقَالَ: يَا رَسُولَ اللهِ، كَيْفَ يَأْتِيكَ الْوَحْيُ؟ فَقَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم: «أَحْيَانًا يَأْتِينِي مِثلَ صَلْصَلَة الْجَرَسِ - وَهُوَ أَشَدُّهُ عَلَيَّ - فَيَفْصِمُ عَنِّي وَقَدْ وَعَيْتُ عَنْهُ مَا قَالَ، وَأَحْيَانًا يَتَمثَّلُ لِيَ الْمَلَكُ رَجُلًا فَيُكَلِّمُنِي فَأَعِي مَا يَقُولُ». قَالَتْ عَائشَةُ رَضِيَ اللهُ عَنْها: وَلَقَدْ رَأَيْتُهُ يَنْزِلُ عَلَيْهِ الْوَحْيُ فِي الْيَوْمِ الشَّدِيدِ الْبَرْدِ، فَيَفْصِمُ عَنْهُ وَإِنَّ جَبِينَهُ لَيَتَفَصَّدُ عَرَقًا. (البخاري:
Found match, group 0: ١هذه هي اللغة العربية١
Found match, group 1: هذه هي اللغة العربية
Found match, group 0: ١ - عَنْ عُمَرَ بْنِ الْخَطَّابِ رَضِيَ اللهُ عَنْهُ قَالَ: سَمِعْتُ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم يَقُولُ: «إِنَّمَا الْأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى، فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى دُنْيَا يُصِيبُهَا أَوْ إِلَى امْرَأَةٍ يَنْكِحُهَا، فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ». (البخاري: ١
Found match, group 1:  - عَنْ عُمَرَ بْنِ الْخَطَّابِ رَضِيَ اللهُ عَنْهُ قَالَ: سَمِعْتُ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم يَقُولُ: «إِنَّمَا الْأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى، فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى دُنْيَا يُصِيبُهَا أَوْ إِلَى امْرَأَةٍ يَنْكِحُهَا، فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ». (البخاري:
Found match, group 0: ٢ - عَنْ عَائشَةَ رَضِيَ اللهُ عَنْهَا: أَنَّ الْحَارِثَ بْنَ هِشَامٍ رَضِيَ اللهُ عَنْهُ سَأَلَ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم فَقَالَ: يَا رَسُولَ اللهِ، كَيْفَ يَأْتِيكَ الْوَحْيُ؟ فَقَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم: «أَحْيَانًا يَأْتِينِي مِثلَ صَلْصَلَة الْجَرَسِ - وَهُوَ أَشَدُّهُ عَلَيَّ - فَيَفْصِمُ عَنِّي وَقَدْ وَعَيْتُ عَنْهُ مَا قَالَ، وَأَحْيَانًا يَتَمثَّلُ لِيَ الْمَلَكُ رَجُلًا فَيُكَلِّمُنِي فَأَعِي مَا يَقُولُ». قَالَتْ عَائشَةُ رَضِيَ اللهُ عَنْها: وَلَقَدْ رَأَيْتُهُ يَنْزِلُ عَلَيْهِ الْوَحْيُ فِي الْيَوْمِ الشَّدِيدِ الْبَرْدِ، فَيَفْصِمُ عَنْهُ وَإِنَّ جَبِينَهُ لَيَتَفَصَّدُ عَرَقًا. (البخاري: ٢
Found match, group 1:  - عَنْ عَائشَةَ رَضِيَ اللهُ عَنْهَا: أَنَّ الْحَارِثَ بْنَ هِشَامٍ رَضِيَ اللهُ عَنْهُ سَأَلَ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم فَقَالَ: يَا رَسُولَ اللهِ، كَيْفَ يَأْتِيكَ الْوَحْيُ؟ فَقَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم: «أَحْيَانًا يَأْتِينِي مِثلَ صَلْصَلَة الْجَرَسِ - وَهُوَ أَشَدُّهُ عَلَيَّ - فَيَفْصِمُ عَنِّي وَقَدْ وَعَيْتُ عَنْهُ مَا قَالَ، وَأَحْيَانًا يَتَمثَّلُ لِيَ الْمَلَكُ رَجُلًا فَيُكَلِّمُنِي فَأَعِي مَا يَقُولُ». قَالَتْ عَائشَةُ رَضِيَ اللهُ عَنْها: وَلَقَدْ رَأَيْتُهُ يَنْزِلُ عَلَيْهِ الْوَحْيُ فِي الْيَوْمِ الشَّدِيدِ الْبَرْدِ، فَيَفْصِمُ عَنْهُ وَإِنَّ جَبِينَهُ لَيَتَفَصَّدُ عَرَقًا. (البخاري:

You're probably interested in the results of group 1 of the regex matches which are
Found match, group 1:  - عَنْ عُمَرَ بْنِ الْخَطَّابِ رَضِيَ اللهُ عَنْهُ قَالَ: سَمِعْتُ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم يَقُولُ: «إِنَّمَا الْأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى، فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى دُنْيَا يُصِيبُهَا أَوْ إِلَى امْرَأَةٍ يَنْكِحُهَا، فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ». (البخاري:

Found match, group 1:  - عَنْ عَائشَةَ رَضِيَ اللهُ عَنْهَا: أَنَّ الْحَارِثَ بْنَ هِشَامٍ رَضِيَ اللهُ عَنْهُ سَأَلَ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم فَقَالَ: يَا رَسُولَ اللهِ، كَيْفَ يَأْتِيكَ الْوَحْيُ؟ فَقَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم: «أَحْيَانًا يَأْتِينِي مِثلَ صَلْصَلَة الْجَرَسِ - وَهُوَ أَشَدُّهُ عَلَيَّ - فَيَفْصِمُ عَنِّي وَقَدْ وَعَيْتُ عَنْهُ مَا قَالَ، وَأَحْيَانًا يَتَمثَّلُ لِيَ الْمَلَكُ رَجُلًا فَيُكَلِّمُنِي فَأَعِي مَا يَقُولُ». قَالَتْ عَائشَةُ رَضِيَ اللهُ عَنْها: وَلَقَدْ رَأَيْتُهُ يَنْزِلُ عَلَيْهِ الْوَحْيُ فِي الْيَوْمِ الشَّدِيدِ الْبَرْدِ، فَيَفْصِمُ عَنْهُ وَإِنَّ جَبِينَهُ لَيَتَفَصَّدُ عَرَقًا. (البخاري:

Found match, group 1: هذه هي اللغة العربية

Found match, group 1:  - عَنْ عُمَرَ بْنِ الْخَطَّابِ رَضِيَ اللهُ عَنْهُ قَالَ: سَمِعْتُ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم يَقُولُ: «إِنَّمَا الْأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى، فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى دُنْيَا يُصِيبُهَا أَوْ إِلَى امْرَأَةٍ يَنْكِحُهَا، فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ». (البخاري:

Found match, group 1:  - عَنْ عَائشَةَ رَضِيَ اللهُ عَنْهَا: أَنَّ الْحَارِثَ بْنَ هِشَامٍ رَضِيَ اللهُ عَنْهُ سَأَلَ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم فَقَالَ: يَا رَسُولَ اللهِ، كَيْفَ يَأْتِيكَ الْوَحْيُ؟ فَقَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّم: «أَحْيَانًا يَأْتِينِي مِثلَ صَلْصَلَة الْجَرَسِ - وَهُوَ أَشَدُّهُ عَلَيَّ - فَيَفْصِمُ عَنِّي وَقَدْ وَعَيْتُ عَنْهُ مَا قَالَ، وَأَحْيَانًا يَتَمثَّلُ لِيَ الْمَلَكُ رَجُلًا فَيُكَلِّمُنِي فَأَعِي مَا يَقُولُ». قَالَتْ عَائشَةُ رَضِيَ اللهُ عَنْها: وَلَقَدْ رَأَيْتُهُ يَنْزِلُ عَلَيْهِ الْوَحْيُ فِي الْيَوْمِ الشَّدِيدِ الْبَرْدِ، فَيَفْصِمُ عَنْهُ وَإِنَّ جَبِينَهُ لَيَتَفَصَّدُ عَرَقًا. (البخاري:

It's been more than 5 years since I last studied Arabic and this is the closest I could get to. I hope it answers your question. Here's a Regex 101 link to the regex matches.
Edit: By the way, I think there's a bug in the way Regex101 highlights the matched content. I've filed an issue here on Github
Comment: @anatol If you feel that my answer helped you, you could [accept my answer](http://meta.stackexchange.com/a/5235).


Diablo 3 Weapon Damage Range

Question: I am building a Diablo III calculator that will have API importing & also user data entry with validation. My issue lies with the latter part since I'm having a lot of trouble reassembling items with physical damage affixes.
Here's data for a problematic item:
http://us.battle.net/api/d3/data/item/skorn
The goal I've set is to recalculate the maximum possible damage value using the attributes. The value we want to see is 1762.5 as it is given in the API, and I've verified through looking in-game that items can roll a damage value that high (see: https://i.stack.imgur.com/Lmrry.jpg).
What I know:
The damage range is only affected by these attribute types:

Damage_Weapon_Bonus_Delta#Element
Damage_Weapon_Delta#Physical
Damage_Weapon_Bonus_Min#Element
Damage_Weapon_Min#Physical
Damage_Weapon_Percent_Bonus#Physical

Where #Element is the type of bonus damage (Physical, Fire, Cold, Lightning, Arcane, Holy)
The Formula:
My calculations work perfectly if the bonus damage type is anything other than physical. The 2 types (physical and elemental) also display differently like so:
+200-450 Fire Damage
and
+200 Minimum Damage
+250 Maximum Damage
If we were to calculate the Skorn example as elemental, we'd do it like so:
((507 + 106) * 1.5) + 381 + 286 = 1586.5
Which looks like this with attributes instead:
<code>((Damage_Weapon_Min#Physical + Damage_Weapon_Delta#Physical) * (1 + Damage_Weapon_Percent_Bonus#Physical) + Damage_Weapon_Bonus_Delta#Physical + Damage_Weapon_Bonus_Min#Physical</code>
The Problem:
Unfortunately, this just doesn't work since it's way off of what the actual maximum value should be. I just don't know where to go from here, so any assistance would be greatly appreciated.
Comment: That Skorn you're linking to has a max damage of 1744; how does that verify that the maximum is 1762?
Comment: Sorry, what I meant with the example is that it can roll a maximum damage of much higher than what my standard formula produces, giving credence to the 1762.5 cap.
Comment: One thing to make note of is that Minimum Damage is added first; if that pushes it above the base rolled Maximum Damage, Maximum automatically becomes Minimum + 1, and *then* the Maximum bonus is added to it.  It doesn't look like that's happening here, though.
Comment: Where'd the 507 in your example come from?  Looks like it should be 515 with a delta of 114.  http://us.battle.net/d3/en/item/decapitator
Comment: Data is from the API link I gave. The base item range is really not a factor at this point since adding that in doesn't fix it (8 min 16 max difference).
Answer: I think you have your order of operations wrong.  The 50% bonus should be applied last.  Take a look at the image you linked.  The base damage possible for the axe is 507.  If you multiply that by 1.5 and then add 282, you're still well short of the minimum damage displayed on the weapon.  But if you instead take 507 and add 282, then multiply by 1.5, you end up at 1183.5, rounded up to the 1184 displayed on the weapon.  1185 + (373 * 1.5) gives you the 1744 top end.
So (507 + 286) * 1.5 = 1189.5 as the min damage.  That gets rounded up to 1190, and the max damage has to be higher, so it starts at 1191.  1191 + (381 * 1.5) = 1762.5.  Note that the delta is meaningless here, because it is lower than the min damage boost anyway.
Comment: Thanks for this, I'll plug it into my app and see if it solves the issue on all the affected items (which I'm sure it will). I'll be doing this in a few hours and when I come back I'll make sure to mark the answer.

Diablo 3 Weapon Damage Range


Execute code when leaving a tabsheet

Question: I'm currently working on a project in Delphi that has two parts: one in which you can register some information and another one in which you can view the information.
There are two TabSheets in a PageControl, both execute different codes. When I leave a tab to go to the other one, I need to execute the closefile() command,  however I do not know which event registers leaving a tabsheet to the other one. I've tried onExit and onHide, but neither worked.
procedure TfrmRegister.tbsListExit(Sender: TObject)
begin
if Painting <> nil then
    Painting.CloseFile;
end;

The onShow code for the other TabSheet will execute, but this won't. Thanks for any help
Answer: Use the TPageControl.OnChanging event.

Occurs immediately before a new tab is selected.
Write an OnChanging event handler to take specific action immediately before the selected tab changes. Set the AllowChange parameter to False to prevent the change.
Use an OnChanging event handler to prevent the user from leaving a tab setting until certain conditions have been met. An OnChanging event handler can also be used to save information about the current state of the tab control before it is changed by a new tab selection.
Note: The event is not called if you change the active page in code, for example, by setting the value of TPageControl.ActivePage.

Execute code when leaving a tabsheet


How do I install Google Integrated System Conky on Ubuntu 18.04?

Question: I am trying to install Google Integrated System Conky
on my machine.  Here is the link which I am following.
I have followed the guide step by step. All the file were downloaded and present in my home directory as GoogleintegratedSystemConky. I have also run the script present in gisc.sh but nothing is happening. I have no idea what to do next. Please help me configure this in my machine.
Thanks in advance.
errors:
conky: Syntax error (conkyrc:2: '=' expected near 'yes') while reading config file.
conky: Assuming it's in old syntax and attempting conversion.
conky: desktop window (200014) is subwindow of root window (2ac)
conky: drawing to desktop window
conky: drawing to double buffer
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  145 (DOUBLE-BUFFER)
  Minor opcode of failed request:  1 (DBEAllocateBackBufferName)
  Serial number of failed request:  75
  Current serial number in output stream:  76

conky: Syntax error (conkyKeepRc:2: unexpected symbol near '#') while reading config file.
conky: Assuming it's in old syntax and attempting conversion.
conky: desktop window (200014) is subwindow of root window (2ac)
conky: window type - override
conky: drawing to created window (0x2600001)
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  1 (X_CreateWindow)
  Serial number of failed request:  73
  Current serial number in output stream:  77

Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/79581/discussion-on-question-by-c-j-how-do-i-install-google-integrated-system-conky-on).
Answer: Sorry for those disappointing long comment discussion. This is the best I could do. But the configuration poor. It have braking and will take lot of your time.
This is what I did.
1) I have teejeetech conky manager. You have to install the same.
http://www.teejeetech.in/p/conky-manager.html
2) I have downloaded the zip file, of mustafaozhan/GoogleIntegratedSystemConky and extracted in folder the folder ~/.config
3) Created a new folder in ~/.conky folder and copied the files conkyrc and conkyKeepRc
4) Opened the conky manager and run the code.
5) Set the background image give in background folder

Warning: You have to try this on your own risk. For me the conky flicker and hangs the computer.
I am not good at python. Further you are on your own. Just share the details if you have managed to fix it. I will too use this conky.


How to remove/change the label in a plotly geom_vline in R?

Question: Using this example from plotly I am attempting to plot two vertical lines to represent the mean and median.
Reproducible Code
library(plotly)

# data
df1 <- data.frame(cond = factor( rep(c("A","B"), each=200) ),
                  rating = c(rnorm(200),rnorm(200, mean=.8)))

df2 <- data.frame(x=c(.5,1),cond=factor(c("A","B")))

# graph
ggplot(data=df1, aes(x=rating, fill=cond)) +
  geom_vline(aes(xintercept=mean(rating, na.rm=T))
             , color="red", linetype="dashed", size=1, name="average") +
  geom_vline(aes(xintercept=median(rating, na.rm=T))
             , color="blue", linetype="dashed", size=1, name="median") +
  geom_histogram(binwidth=.5, position="dodge")

ggplotly()

Problem
I want to suppress the y-value -2.2 that is displayed next to the red text 'average'. However, I want the text 'average' to display as it does in the screenshot below. I.e. I only want to suppress the label that I have put a black cross through.
The same problem applies to the median line.

My non-working attempt
#plot
gg <- ggplot(data=df1, aes(x=rating, fill=cond)) +
    geom_vline(aes(xintercept=mean(rating, na.rm=T))
               , color="red", linetype="dashed", size=1, name="average")+
    geom_vline(aes(xintercept=median(rating, na.rm=T))
               , color="blue", linetype="dashed", size=1, name="median") +
    geom_histogram(binwidth=.5, position="dodge")

p <- plotly_build(gg)
# p$data[[1]]$y[1:2] <- " " # another attempt, but the line doesn't display at all
p$data[[1]]$y <- NULL # delete the y-values assigned to the average line
plotly_build(p)

This attempt still displays a 0 (screenshot below):
Answer: Solution
#plot
gg <- ggplot(data=df1, aes(x=rating, fill=cond)) +
    geom_vline(aes(xintercept=mean(rating, na.rm=T))
               , color="red", linetype="dashed", size=1, name="average")+
    geom_vline(aes(xintercept=median(rating, na.rm=T))
               , color="blue", linetype="dashed", size=1, name="median", yaxt="n") +
    geom_histogram(binwidth=.5, position="dodge")

#create plotly object
p <- plotly_build(gg)

#append additional options to plot object
p$data[[1]]$hoverinfo <- "name+x" #hover options for 'average'
p$data[[2]]$hoverinfo <- "name+x" #hover options for 'median'

#display plot
plotly_build(p)

Result (screenshot)

Explainer
The object p is a list of plotly options, but does not include all options. It appears the R API to plotly implicitly uses all the defaults. Therefore, if you want something different you need to append the option name (e.g. hoverinfo) with the custom settings (e.g. "name+x").
Plotly reference material


What exactly viewport meta tag does in html?

Question: I have recently started learning about html and css. In particular, I am learning the responsive web design. I studied that meta viewport tag is one of the first steps in creating a responsive web design. In particular, I am studying from this link:
https://www.w3schools.com/css/css_rwd_viewport.asp
Here, they have given two images of a website on mobile screens of with and without viewport tag. In the first without screen, the image doesn't adjust itself with the screen with. But in the latter image, the image adjusts itself. Now, I get this point. I thought of replicating this using the following:
<!DOCTYPE html>

    <title>Title</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing sof

It doesn't make the image change as i change the width. So, what's going on here?
I know, I can solve this issue by putting a css block of width:100% but I want to understand why viewport is not working that way it was mentioned on the website. Or am I missing any important piece?
Comment: I remember once my website on mobile viewing was still looking like a desktop view. I was missing the viewport stuff. When I added it, finally the site was looking like it should do on mobile. I may not know exactly, but it is useful.
Comment: From what i read, I know it is supposed to do something right but I am probably missing some key point here.
Comment: In the example from w3schools, `` has `width` and `height` attributes, they are not in your code, it may explain the difference.
Comment: So, if i have to add height and width css property then what is point of meta tag?Sorry if this question is silly, but I am really confused with meta tags? I purposefully omitted that height and width property.
Comment: The `
Comment: This was my first question. I got a down vote. Please anyone mention the probable reasons why this might have happened. So, I can avoid making same in future. Thank you.
Comment: Take a closer look at the [source code](https://www.w3schools.com/css/example_withviewport.htm) of the example with viewport: It also has a `` which is missing from your example and wouldn't work without it
Comment: Also, it says in the tutorial, under **Size Content to The Viewport**: _3. Use CSS media queries to apply different styling for small and large screens..._ - Responsive design doesn't happen automatically - You need to define the style using CSS
Answer: A  viewport element gives the browser instructions on how to control the page's dimensions and scaling.
The width=device-width part sets the width of the page to follow the screen-width of the device (which will vary depending on the device).
The initial-scale=1.0 part sets the initial zoom level when the page is first loaded by the browser.
Comment: Thanks for answering but this doesn't help. Sorry.
Answer: The browser's viewport is the area of the window in which web content can be seen.
The width property controls the size of the viewport. It can be set to a specific number of pixels like width=600 or to the special value device-width, which is the width of the screen in CSS pixels at a scale of 100%.
The initial-scale property controls the zoom level when the page is first loaded.
Now, for images to be responsive in nature, we should always use viewport-relative units i.e %
so, you should add
img {
  width: 100%;
  height: auto;
}

for the image to resize along with screen size. Hope it clarifies your doubt!
Comment: Thanks Ganesh for the answer.


Python: Two lists to be compared for format match and made into a dictionary

Question: I'm using python 3: I have two lists and I want to have them combined in a dictionary using similar information:
first_list = [('1234', 'abcd', 'John Doe', 'good_status'),
              ('1234', 'efgh', 'John Doe', 'good_status'),
              ('1234', 'hijk', 'John Doe', 'bad_status'),
              ('5566', 'abjk', 'George Washington', 'good_status'),
              ('7889', 'zyxw', 'Jane Austin', bad_status')]

The second list might be:
second_list = [('1234', 'John Doe', 'abcd efgh hijk'),
               ('5566', 'George Washington', 'abjk'),
               ('7889', 'Jane Austin', 'zyxw')]

Desired Dictionary output:
dictionary = {'1234' : ('John Doe', 'abcd_good efgh_good hijk_baad')
              '5566': ('George Washington', 'abjk_good')
              '7889': ('Jane Austin', 'zyxw_bad')
              }

In first_list that entry [0] and [2] match the entry [0] and entry [1] of second_list.
first_list has entry [1] and [3] which should come together and match with second_list[2]
Oh... and the two lists are not really lined up like, index 0 of might not be the same name as index 0 of second_list.
I'm new and kinda in over my head, could use any advice.
Comment: one thing to keep in mind when trying to line up the elements from the two lists is the 'key'.  What is the unique identifier? In this case I'm assuming it's the 4 digit numbers.  This means you'll end up looping through both lists.
Answer: My solution is only to use first_list without the reference of second_list.
The following code can be runnable under the environment of >=python 3.6, since I used f-string.
The full code listed below:
first_list = [
    ('1234', 'abcd', 'John Doe', 'good_status'),
    ('1234', 'efgh', 'John Doe', 'good_status'),
    ('1234', 'hijk', 'John Doe', 'bad_status'),
    ('5566', 'abjk', 'George Washington', 'good_status'),
    ('7889', 'zyxw', 'Jane Austin', 'bad_status')]

dictionary = dict()

# Loop over the given list
for i in first_list:

    # Extract the index
    new_key = i[0]

    # If the new key is not existed,
    # make a new item and initialize it with empty string
    # The reason for using `list` instead of `tuple`
    # is that `list` object is mutable
    if new_key not in dictionary.keys():
        new_name = i[2]
        dictionary.update({new_key: [new_name,""]})

    # Parse the new status string
    # and append it into the existing string
    # If you are using python version under 3.6,
    # try to use `format()` function
    new_str = f"{i[1]}_{i[3].split('_')[0]}"
    dictionary[new_key][1] += f" {new_str}"

# Transfer the lists to tuples using "dict comprehension"
dictionary = {k:tuple(v) for (k, v) in dictionary.items()}

print(dictionary)

Answer: I made a solution with two functions, make_dict_from_list and match_two_dicts.  There are ways to make these more succinct with list comprehensions, but I wrote them the long way so it's more clear what they're doing.
def make_dict_from_list(list):
    temp_dict={}
    for record in list:
        for word in record:
            if word == record[0]:
                temp_dict[record[0]] = []
            else:
                temp_dict[record[0]].append(word)
    return temp_dict

This method makes a temporary dictionary, and iterates through the list, record by record.  It makes the word at the first position (if word = record[0]) the key of the dictionary, and sets an empty array as the value of that key.  If it's not the first word (i.e. else), it appends any other words in the line to that array.  Next you can call these methods to make your dictionaries.  Expected result:
>>>>make_dict_from_list(first_list)
{'1234': ['hijk', 'John Doe', 'bad_status'], '5566': ['abjk', 'George Washington', 'good_status'], '7889': ['zyxw', 'Jane Austin', 'bad_status']}

>>>>make_dict_from_list(second_list)
{'1234': ['John Doe', 'abcd efgh hijk'], '5566': ['George Washington', 'abjk'], '7889': ['Jane Austin', 'zyxw']}

Now we can make our second method:
def match_two_dicts(dict1, dict2):
    for index1, key1 in enumerate(dict1):
        for index2, key2 in enumerate(dict2):
            if key1 == key2:
                print(f"ID {key1}: match at dict1[{index1}], dict2[{index2}]")

This splits the entries in dict1 & dict2 into a list of key-value pairs.  We use enumerate so we have an index of our position in each dictionary.  Then, if the IDs (i.e., the keys of each record) match, we can print out the positions of the match.
Expected result:
>>> match_two_dicts(dict1, dict2)
ID 1234: match at dict1[0], dict2[0]
ID 5566: match at dict1[1], dict2[1]
ID 7889: match at dict1[2], dict2[2]

edit: I just noticed that you have duplicate IDs in your first list, which my solution does not account for.  If this is necessary for your application, you will need to modify the code to use a list of dicts with one key, instead of a single dict with multiple keys.  If this is a problem for you let me know.
Comment: Thanks, I ended up griding it out on my own, but your comment would have helppppped so much. Thanks!  But yeah the duplicate keys was important... although the 4 digit number was what I wanted to be the keys of the dictionary, I needed the dictionary entry for a key to be expanded with aditional information when a list tuple had the same key as was already present in the dictionary.  Took a while to work it out, but I used a similar approach as you with if statements for if 4 digit pin is already in dict.keys ()
Answer: You need a double for loop to check for the status of each item and combine them into a dictionary based on the matches.
first_list = [
    ('1234', 'abcd', 'John Doe', 'good_status'),
    ('1234', 'efgh', 'John Doe', 'good_status'),
    ('1234', 'hijk', 'John Doe', 'bad_status'),
    ('5566', 'abjk', 'George Washington', 'good_status'),
    ('7889', 'zyxw', 'Jane Austin', 'bad_status')
]

second_list = [
    ('1234', 'John Doe', 'abcd efgh hijk'),
    ('5566', 'George Washington', 'abjk'),
    ('7889', 'Jane Austin', 'zyxw')
    ]

def CreateDict(list1, list2):

    #Dictionary to be created.
    dictionary = {}

    #Go through each given data.
    for search_key in list2:
        dict_data  = [search_key[1]]
        status     = ""

        #Go through the data we must check for the status.
        for element in list1:

            #If the number and the names match.
            if search_key[0] == element[0] and search_key[1] == element[2]:

                #Check the status of each data.
                data = search_key[2].split(" ")
                for d in data:
                    if d in element:

                        #         Data| status without the _status  |      add a space at the end.
                        status += d+"_"+element[3].replace("_status", "") +" "

        #Remove the last space added on the status string.
        status = status[:len(status)-1]

        #Append the status data on the list.
        dict_data.append(status)

        #Append the dict_data using the number as a key.
        dictionary[str(search_key[0])] = dict_data

    #Return the dictionary.
    return dictionary

print(CreateDict(first_list, second_list))

Comment: Thanks everyone! I ended up sticking to it and getting an OK enough result on my own. However, you all gave me some really great ideas for version 2 and I learned a lot by doing it then reading your ideas later. Thank you all so very much for your time!


Gas Water Heater leaking water out of the temperature and pressure valve. Could the water pressure regulator contribute to the issue?

Question: Edit...I do not have an expansion tank or pressure gauges.
The "leak" was water pouring from the valve due to pressure or temperature.  Lots of calcium build up on the "down" tube attached to the valve.
My water heater was draining water from the relief valve.  I turned off the pilot and the cold water.  It stopped.  there is calcium build up from a leakage.  I figure I need to replace the valve which easy enough.
I have also noticed loud noises when toilets are flushed and water is turned on. So now I figure that should be the water pressure regulator.
Would too high of water pressure cause the leaking in the water heater?
Comment: Do you have an expansion tank in your water system?
Comment: Do you have an expansion tank? Do you have a pressure gauge? [Or two - one before and one after the pressure regulator, but for the purposes of this question, one after will do.] If not, consider adding both an expansion tank and a pressure gauge. When cold water is heated it expands, and if it is constrained by a check valve or something that acts like a check valve (which a pressure regulator does) then pressure rises drastically. An expansion tank gives it someplace to expand into with much less pressure increase. tl:dr the relief valve is probably working exactly as it should.
Comment: If you do have an expansion tank, it may have failed and need to be replaced.
Comment: Was the T&PRV "leaking" as in the seals failed, or was water coming out of it because the temp or pressure in the tank is getting too high? i.e. is it properly doing its job or is it failing?
Comment: It appears you've created 2 different accounts (your edit shouldn't have gone to the review queue if you'd logged back in as yourself). [Click here](https://diy.stackexchange.com/help/merging-accounts) for instructions on how to get them merged. (I've voted to approve your edit, but it'll take one more vote before it shows up.)
Comment: If you are talking about me having 2 accounts, I only ever opened 1 and have no idea how to delete the other. I followed your instructions but I got lost in the ether and have no idea how to perform the required tasks. I only have 1 log in password.
Answer: The T&P valve on your water heater should be "exercised", that is, lifted and allow water to flow from it at least once a year and should be replaced when bad. I, replace mine every 5-6 years just to be safe. They do not cost a lot of money and keep you safe. A stuck or frozen T&P valve can do a lot of damage. As others have said, if you do not have an expansion tank installed near your water heater, it would be a good investment to install one. If you want or need to check the water pressure in your home you can buy a pressure gauge in any hardware store or the orange or blue store that will screw onto a hose thread. My 2 cents.


Convert a number given as a string input to a 32 bit little endian value

Question: Input -> string: "208705"
Output-> BYTE array: {0x41, 0x2F, 0x03}
I have converted the string to hex format using stringstream:
string decStrToHex(string decimalString) {
    std::stringstream ss;
    ss<< std::hex << stoi(decimalString);
    std::string result ( ss.str() );
    return "0" + result;
}

How to proceed?
Comment: How should `{0x41, 0x2F, 0x03}` relate to `"208705"` actually? 32 bit integer number representation? Little or big endian architecture?
Comment: My hand calculator, converts 208705 to 0x032f41.  So the first byte of your array is lsByte of decimal integer which is 3 bytes long?  last byte is msByte of number?  What if input string is longer than max digits of uint64_t (multi-precision)?  Your question is incomplete.
Answer:
How to convert from a (decimal format) string to a (constant sized hex format) BYTE array: ...

There's no direct conversion from the string to that byte array you want to have.
It looks like you want to convert a number given as a string input to a 32 bit little endian value.
If I put it in my calculator

and convert it to hex, it looks like

So the 0x41 is the LSB and shows up last.
How that byte array you are claiming should actually look like and how the bytes are ordered depends on the machine architecture (see Endianess).
First, you just convert the number (there are other ways but I'll take that as example):
 uint32_t number;
 std::istringstream iss("208705");
 iss >> number;

Next step is to ensure you have a little endian representation of that number:
 union LittleEndian32Bit {
     uint32_t uint;
     uint8_t[4] bytes;
 };

Such you can have
 LittleEndian32Bit le;

 le.bytes[0] = number & 0xFF;
 le.bytes[1] = (number >> 8) & 0xFF;
 le.bytes[2] = (number >> 16) & 0xFF;
 le.bytes[3] = (number >> 24) & 0xFF;

Output BYTE array: {0x41, 0x2F, 0x03}

 std::cout << '{';
 for(size_t i = 0; i < sizeof(le.bytes); ++i) {
     if(i != 0) {
         std::cout << ", ";
     }
     std::cout << "0x" << std::hex << std::setw(2) << std::setfill('0')
               << (unsigned int)le.bytes[i];
 }
 std::cout << '}' << std::endl;

Well, one more for the fourth byte:
{0x41, 0x2f, 0x03, 0x00}

See Live Demo
Comment: @SiimVeskilt You're confusing representation and contents. Sure you need to instruct the text representing stream how to fill up for the required width claimed with `setw()`. The default fill character is `' '`, hence you need to put the `std::setfill('0')` statement.
Comment: When using setfill and setw numbers like 3 get padded, how to actually get it as a BYTE (unsigned char)?
Comment: @SiimVeskilt _"When using setfill and setw numbers like 3 get padded"_ What do you mean actually, I don't get it? Output is exactly as I've been showing, there's nothing _"padded"_. If you want the MSB omitted, just loop `for(size_t i = 0; i < sizeof(le.bytes) - 1; ++i) {`
Comment: I wish the output to be something like BYTE bytes[4] = {0x41, 0x2f, 0x03, 0x00}; which I could feed into a sendPacket function, the 0x03 does not come as 0x03 without the filling.
Answer: For a fixed array of 3 bytes you can do something like this:
unsigned char GetByte(int i, int n)
{
    int Mask = 0xFF;
    Mask <<= n * 8;
    return (i & Mask) >> (n * 8);
}

std::array<unsigned char, 3> decStrToHex(std::string decimalString)
{
    int Val;
    std::stringstream ss(decimalString);
    ss >> Val;

    std::array<unsigned char, 3> Arr;
    for (int i = 0; i < 3; i++)
        Arr[i] = GetByte(Val, i);

    return Arr;

}


Why won't my goods sell?

Question: So I used to be able to sell my goods in the market almost as fast as I could post them. But as of recently, they've stopped selling. I'm selling the same products as before and the products that seem to be selling (based on "sold out" signs in the marketplace) and at the same prices as everyone else if not lower! What gives!?
Answer: Unfortunately, the market is a bit luck-of-the-draw.  There's a lot of things that could be a factor, but there's really nothing you can do to change any of them.
It could be that the people who are matched up with you don't want what you're selling.  There are a lot of goods that I just don't buy unless Eddie wants me to sell him an obscene quantity of.  (Baked Potatoes and Goat Milk, for instance)
It could be that there are a lot of other people selling the same good.  While you might think price matters in this case, often times I find myself just buying goods from whoever is first on the list, since time is something of a factor in market buying transactions.
I myself tend to sell the same items over and over again, at the same default price.  I also tend to see wide swings in terms of how long it takes for the items to sell.  I might put up 2 sets of 2 peaches, and one sells immediately while the other lingers for hours.  They're the same item, sold at the same price, by the same seller, and the market sale time varies significantly.
There's only a couple of things that have much of an effect:

Bad network connection.  If you can't connect to the Country Escape servers, sometimes your goods don't make it to the big market in the sky.  If you can view other people's stuff, though, chances are this isn't an issue.
Being in an active co-op.  You can always see your co-op's stuff for sale, so things tend to sell a bit quicker owing to this larger group of people with constant access to your market.

Beyond that, you're just kind of stuck with whatever the market does for you...

Why won't my goods sell?


React Select - how to type check its onChange handler

Question: I'm currently building a design system in React TypeScript and for the Dropdown component have decided to use React Select to provide most of the functionality.
I've created a wraparound component called <Dropdown /> and have created some custom components for React Select's internal sub-components, such as the Option and Menu. I'm positioning a Checkbox before each Option in the Menu and at the top of the Menu is a Select All button.
Here's my custom component for React Select's Menu subcomponent where I'm trying to call the Select's onChange method and pass it all options in order to select them all:
const DropdownMultiOptionMenu = (menuProps: MenuProps<OptionType>) => {
  const { children, options, selectProps } = menuProps;
  return (
    <components.Menu {...menuProps}>
      <button
        onClick={() => selectProps.onChange(options as MultiValue<OptionType>, 'select-value')}
      >
        Select all
      </button>
      {children}
    </components.Menu>
  );
};

I'm currently getting a TypeScript error for the 'select-value' parameter that I'm passing in to the onChange handler:
Argument of type 'string' is not assignable to parameter of type 'ActionMeta'
However, when I read React Select's documentation, they tell me that the second parameter of an onChange handler is an actionMeta type and the options given are all strings:
https://react-select.com/advanced#action-meta
Any ideas?
Here's the full code for the Dropdown:
import clsx from 'clsx';
import {
  default as ReactSelect,
  components,
  MenuProps,
  OptionProps,
  MultiValue
} from 'react-select';
import { Checkbox } from '../checkbox';
import styles from './index.module.css';

type OptionType = {
  value: string;
  label: string;
};

export interface DropdownProps {
  isMulti: boolean;
  options: OptionType[];
}

const DropdownMultiOption = (optionProps: OptionProps<OptionType>) => {
  const { children, isSelected } = optionProps;
  return (
    <components.Option {...optionProps}>
      <Checkbox
        id="multi-option"
        label={children?.toString()}
        value={children?.toString()}
        checked={isSelected}
        readOnly
      />
    </components.Option>
  );
};

const DropdownMultiOptionMenu = (menuProps: MenuProps<OptionType>) => {
  const { children, options, selectProps } = menuProps;
  return (
    <components.Menu {...menuProps}>
      <button
        onClick={() => selectProps.onChange(options as MultiValue<OptionType>, 'select-value')}
      >
        Select all
      </button>
      {children}
    </components.Menu>
  );
};

const Dropdown = ({ options, isMulti, ...rest }: DropdownProps) => (
  <ReactSelect
    classNames={{
      control: () => styles['c-dropdown'],
      menu: () => styles['c-dropdown__menu'],
      multiValue: () => styles['c-dropdown__multi-value'],
      option: () => styles['c-dropdown__option']
    }}
    closeMenuOnSelect={!isMulti}
    components={
      isMulti ? { Option: DropdownMultiOption, Menu: DropdownMultiOptionMenu } : undefined
    }
    isMulti={isMulti}
    hideSelectedOptions={false}
    options={options}
    unstyled
    {...rest}
  />
);

Dropdown.defaultProps = {};

export default Dropdown;

I've tried typecasting the 'select-value' string as type ActionMeta<OptionType>, but this caused a further TypeScript error which suggested this was not the right course of action.
UPDATE:
Have applied suggestions by @Peter Mortensen but still getting an error which I've added as a comment in the code below:
const DropdownMultiOptionMenu = (menuProps: MenuProps<OptionType>) => {
  const { children, selectProps, options } = menuProps;
  const action: ActionMeta<OptionType> = 'select-option'; // Type 'string' is not assignable to type 'ActionMeta<OptionType>'
  return (
    <components.Menu {...menuProps}>
      <button onClick={() => selectProps.onChange(options as MultiValue<OptionType>, action)}>
        Select all
      </button>
      <CheckboxGroup>{children}</CheckboxGroup>
    </components.Menu>
  );
};

Answer: From the documentation you just sent, you can see that:

React Select exposes a variety of eventListeners to you via props. The onchange function prop now has the following signature. (value: ValueType, action: ActionType) => undefined;
The action argument is a string with the following possible values
'select-option': Selecting an option from the list
'deselect-option': (Multiple) Deselecting an option from the list
'remove-value': (Multiple) Removing a selected option with the remove button
'pop-value': Removing options using backspace
'set-value': Calling setValue from a component without an action
'clear': Removing all selected options with the clear button
'create-option': (Creatable) Creating a new option

There isn't any select-value in ActionType.
Additionally, for the future, you can press Command + I if you are using Visual Studio Code in order to see the suggestions that match the Type.
Or:
 Set the action into a variable and assign its type.
Something like this:
const action:ActionType = 'select-option' // Or any of the actions you want

EDIT:
My bad, I had the Type set wrong. Check this documentation for the correct Types.

If you have a single-select you can type onChange like this:
const onChange = (option: Option | null, actionMeta:
ActionMeta) => {    ... } If you have a multi-select you can
type onChange like this:
const onChange = (option: readonly Option[], actionMeta:
ActionMeta) => {    ... } The actionMeta parameter is
optional. ActionMeta is a union that is discriminated on the action
type. Take a look at at types.ts in the source code to see its full
definition.

Something like this should work:
import { ActionMeta, MenuProps, OptionProps } from 'react-select'

const DropdownMultiOptionMenu = (menuProps: MenuProps<OptionProps>) => {
  const { children, selectProps, options } = menuProps;
  const action: ActionMeta<OptionProps> = {
    action:'select-option',
    // Add the rest of the implementation as needed
    // I added the optional chaining just to show which attributes
    // are required and which are optional
    option:...,
    name?:...,
    removedValue?:...,
    removedValues?:...
  }

  return (
    <components.Menu {...menuProps}>
      <button onClick={() => selectProps.onChange(options as MultiValue<OptionType>, action)}>
        Select all
      </button>
      <CheckboxGroup>{children}</CheckboxGroup>
    </components.Menu>
  );
};

Comment: Re *"you can press Command + I"*: Only if you are willing and/or able to contribute to [Apple](https://en.wikipedia.org/wiki/Apple_Inc.)'s 50% profit margin.
Comment: HI @PeterMortensen, thanks for the suggestion. I've tried it out and updated my question to show what i tried but I'm still getting an error which I've left as a comment above.
Comment: @JamesHowell Where are you importing `ActionMeta` from? It is supposed to be `ActionType` as per the documentation.
Comment: Would you mind sending the link over for the relevant page for importing `ActionType`? Currently getting "Module '"react-select"' has no exported member 'ActionType'."
Comment: Is there any chance you could edit the code snippet below "Update:" in my question to show me the error of my ways. I'm calling an onChange handler whereas the docs show a function definition. I can't seem to just declare it as documented and pass the function reference to selectProps.onChange because the function signature is expecting two parameters. So I think I need to structure it as I have above. But potentially I need to change the value of my action variable so that its something other than just a string. And thanks for the help. Much appreciated.


Ubuntu 20.04 Nautilus Quicklist / Jumplist

Question: On Ubuntu 18.04 I created a nautilus.desktop file, so that a right click on the starter opened a jump- or quicklist
the entries looked something like that:
<code>[Desktop Action new-window]
Name=New Window
Exec=nautilus --new-window
[Desktop Action NewShortcut]
Name= --
Exec=-
[Desktop Action NewShortcut1]
Name=Persönlicher Ordner
Exec=nautilus /home/ck
</code>
After a fresh install with Ubuntu 20.04 this does not seem to work any more, using the old starter does not create the jump- or quicklist. Basically nothing happens. Any ideas how to acieve a jump- or quicklist?
Thx, k
Answer: It still works almost the same way.
You just have to set:
<code>DBusActivatable=false
</code>
See How do I add new locations to right-click menu of "Files" launcher in Ubuntu dock?