Setting DataRow as ComboBox's value member

Question: I am filling items to my ComboBox from a XML file using a DataTable. Currently I have it set so that one column is ComboBox's displaymember and another is it's value member. However this may not always work for me, since I have to set the selectedItem parameter, and value member may not be unique.
I don't know if there is a duplicate of the value member in the table or not, so my idea was that I would put entire DataRow as the value member of the ComboBox and then use ComboBox.SelectedITem = (DataRow)some_data_row; for selecting, and it would always select the right ComboBox object.
How would I accomplish this? IS there a better way of doing this? I'm open to suggestions, however it is very important that I can get to both, display member and value member.
Thank you for your help!
EDIT: Maybe I wasn't clear enough before, however while I am asking if this is the best approach here, I am also asking how to do this. If I don't set the valuemember parameter, the SelectedItem is of DataRowView type... Please note, that I want to use the selectedValue parameter to select items from ComboBox, and if I try to do that without explicitly setting the value member an exception is thrown.
Answer: If you bind a ListBox to a DataTable, you're actually binding it to a DataView that represents that DataTable (DataTable implements IListSource, and that returns a DataView). You can't directly set SelectedItem to a DataRow instance, you have to set it to a DataRowView instance. Unfortunately there's no easy way to obtain a DataRowView from a DataRow.
You would do better to just do all of your interactions through a DataRowView. This will allow you to set SelectedItem explicitly.
You cannot use the SelectedValue property, you must use SelectedItem for this.
Answer: First of all thank you Adam Robinson, I'm sure your answer was correct, but it just wasn't what I wanted to hear. I solved my problem in a different way and I think it may be useful to someone else, so I am posting it here.
What I did was I created a new class, in my case I named it ListObject, which had a property DataRow (as you will see later it works for other types too, I just used this since this is what I actually wanted as my Item value property). It also overrides methods:

String ToString()
bool Equals(object obj)
int GetHashCode() --is not needed in my case, however Visual Studio
warns you it should be overridden.

The idea was that I could fill ComboBox.Items collections with objects of my own class, display a custom string (if I had not worked it out like this, my next question on Stack overflow would probably be about customizing DisplayMembers when reading items from a DataRow) and compare only one class's item (in my case DataRow).
So here is the code and it works great (at least for what I wanted to do with it).
public class ListObject
{
    public DataRow element;

    public String DisplayObject = null;

    public ListObject(DataRow dr)
    {
        element = dr;
    }

    public ListObject(DataRow dr, String dspObject)
    {
        element = dr;
        DisplayObject = dspObject;
    }

    public override String ToString()
    {
        if (DisplayObject == null) throw new Exception("DisplayObject property was not set.");

        return element[DisplayObject].ToString();
    }

    public override bool Equals(object obj)
    {
        if (obj.GetType() == typeof(ListObject))
            return Equals(((ListObject)obj).element, this.element);
        else return base.Equals(obj);
    }

    public override int GetHashCode()
    {
        return base.GetHashCode();
    }
}

In my case it works great since I can just fill the ComboBox's with a foreach statement:
dtUsers.ReadXml(Program.Settings.xmlInputUsers);

foreach(DataRow dr in dtUsers.Rows)
{
    cmbUser.Items.Add(new ListObject(dr, "Name"));
}

And when I get the DataRow I want selected I just do this:
cmbUser.SelectedItem = new ListObject(dlg.SelectedDataRow);

Where I don't have to worry about the DisplayMember etc, because only DataRow's will be compared, and your display parameters will still be set from when you filled ComboBox.Items collection. Also since toString method is overridden you can really customize your output.
Creating this class was only possible because of msdn article on ComboBox.SelectedItem Property in which it was noted, that SelectedItem property works using the IndexOf method. This method uses the Equals method to determine equality.
Answer: This is the most simple way to get DataTable to a combobox
private void load() {
DataTable dt = // get data from DB
comboBox1.ValueMember = null; // allows you to get all fields in the obj to combobox
comboBox1.DisplayMember = "ccType";//label displayed from dt
comboBox1.DataSource = dt;
}
//to test
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
    {

        DataRowView current = (DataRowView)comboBox1.SelectedValue;
        string drs = current.Row["ID"].ToString();

    }


Can anyone tell me what kind of tree this is?

Question: My family and I ate lunch at the park today (North Carolina) and found this fruit tree. The tree is on the smaller side and has large oval leaves. The fruit is roughly two thumbs thick, is pale orange when ripe, has a pit and grows in bunches. My first instinct is that this is an older breed of Peach tree (I learned within the last year they used to be much smaller than the store variety) but my family disagrees since they lack the typical fuzz. Does anyone have a better idea of what this could be?
Answer: It looks like a persimmon to me. I live in NY and have no direct experience with persimmons, but it seems like a close match judging from images online.
Comment: Persimmons are fairly common in the south. Once the fruit gets yellow, people who like them say it is improved by freezing. When I ate them directly from the tree ,I was not impressed. Deer love them straight from the tree.


What's the point of EMV when only the card is needed to shop online?

Question: In many countries, EMV is used to prevent credit and debit cards being cloned. But given that it's possible to perform online transactions using the details printed on the card, how does it add security?
Comment: A security measure can be broad or narrow; less information is needed for a card present transaction. While not *required* most online websites will ask for additional information for the verification which may be harder to get. It is reasonable to expect different solution sets for online and offline.
Comment: @Eric: The forms I've seen don't ask for anything not written on the card. e.g. http://i.stack.imgur.com/UaDcu.png
Comment: your billing address is on your credit card? The merchant can submit this information - if it doesn't match, they can deny it. If you have the physical card, you may be able to obtain some of this information in the cloning process, but if you just copied down the numbers you would have to get this info someplace else.
Comment: As an aside, there are a lot of improvements which can be made to EMV - step in the right direction, but not enough.
Answer: Thats what the VbV and Mastercard SecureCode solutions are for (also known as 3D Secure)
With merchants that implement these solutions, a secondary password, or a OTP is required to complete the transaction. This secondary password\OTP is entered on the banks site and not on the merchants site.
This PDF describes the system (and its limitations)
Answer: EMV was designed to improve the security of card present transactions (i.e. physical purchases and ATM withdrawals) and to prevent magnetic stripe card skimming.
It's unfortunate that card not present transactions can still be performed using only information printed on the card.
As Akash has mentioned in his answer, there are solutions to that problem, but they are a long way from being universally implemented.


Dependencies in case phrases

Question: Languages like Japanese are said to have case phrases (KP). I don't understand why case particles are considered heads. Why is the structure of NP+ga [KP [DP x] [K ga]] (ie the DP depends on ga)?
Comment: The concept of "head" has been overwrought, I think. It seems ridiculous to say that determiners are head of noun phrases, for instance. One can of course invent any number of special-purpose non-terminal node types for whatever purposes one wishes, but there isn't always any way to tell whether they're "there" or not. Since they're invisible, they resemble the canonical angels and pinheads problem.
Comment: What's the head of the bracketed phrase in: "the price [of the story I sold]"? The "of"?  Then how about: "[the story that I sold's] price"  Isn't the head the "'s"?  But clearly the "'s" is not in construction with the verb "sold", so it must go with the phrase "the story that I sold".  So if English can have a case phrase, why can't Japanese?
Answer: Japanese doesn't have DPs. Those words that can appear in the position associated with determiners/articles, are clearly marked for attribution. The demonstratives kono, sono, etc. contain the genitive particle -no. Others such as iwayuru 'so-called' contain attributive suffixes, here: -uru.
Concerning your question, the NP depends on the case particle, because the presence of the case particle is the most important criterion for the grammatical distribution of the entire expression NP-Case. Look at the next example:
<code>   (1) Kare-wa Tokyo-e modotta.
       he-top  T-all   return.pst
       'He returned to Tokyo.'
   (2)*Kare=wa Tokyo-o modotta.
                    -acc
</code>
In (1), the directional complement Tokyo is properly marked by the allative case particle -e (the dative particle -ni is also possible). Hence the sentence is good. Example (2) shows the accusative case particle -o instead of -e. The result is bad.
If the case particles weren't somehow head over the NPs, that effect would be difficult to explain. In fact, assuming the following structure for Tokyo-e:
(3) [KP[NPTokyo]-e]
allows one to generalize over the noun Tokyo, and to arrive at the more abstract next structure:
(4) [KP[NPNplace]-e]
That means that any noun that references a place could appear instead of Tokyo in (1).
Assuming that the place noun is head over the case particle would lead one to:
(5) [NPTokyo[case-p]]
Structure (5) views case particles as subordinate to their nouns. As a result, any case particle should be good. But example (2) shows that this is not the case.
In summary, sentence (1) isn't good because Tokyo appears; any place name or local noun would be fine. Rather the sentence is good because the allative appears, rather than another case particle (apart from the dative).
Answer: I don't have detailed knowledge of Japanese but in Urdu there are two approaches. One says that the case markers are suffixes, whilst the other assumes that they're particles and posits a KP. A KP in Urdu is something like a PP but it's headed by a case marker (K). In fact, there's a hierarchy: PP>KP>DP>NP.
Note that the categorial head of a phrase needn't be its functional (lexical) head. Functional heads are content words.

Dependencies in case phrases


Why does the Gaussian-Jordan elimination work when finding the inverse matrix?

Question: In order to find the inverse matrix $A^{-1}$, one can apply Gaussian-Jordan elimination to the augmented matrix
$$(A \mid I)$$
to obtain
$$(I \mid C),$$
where $C$ is indeed $A^{-1}$. However, I fail to see why this actually works, and reading this answer didn't really clear things up for me.
Answer: You have three types of what are called elementary matrices, representing row changes, scaling, and adding a multiple of one row to another. If you left multiply a matrix by an elementary matrix, you perform that operation; for example, with a 3x3 matrix, the elementary matrix
$$\pmatrix{1&0&0\\5&1&0\\0&0&1}$$
adds 5 times the first row to the second (can you figure out how the other two look?). If a matrix $A$ is invertible, there are a set of steps to reduce it to the identity matrix, which also means that we have some set of elementary matrices such that
$$E_nE_{n-1}\dots E_2E_1A=I$$
However, by right-multiplying by $A^{-1}$ (since $A$ is invertible), we get
$$E_nE_{n-1}\dots E_2E_1I=A^{-1}$$
So by performing the steps to reduce $A$ to the identity matrix, those same steps performed on the identity matrix create the inverse of $A$. If we start with $(A|I)$ and reduce the left side to the identity matrix, then we would end up with $(I|A^{-1})$ based on the above information, which explains the algorithm.
Comment: Very clear, thanks!
Comment: What does E1,E2... mean?
Answer: You want to find a matrix $B$ such that $BA = I$. $B$ can be written as a product of elementary matrices iff it is invertible. Hence we attempt to obtain $B$ by left-multiplying $A$ by elementary matrices until it becomes $I$. All we have to do is to keep track of the product of those elementary matrices. But that is exactly what we are doing when we left-multiply $I$ by those same elementary matrices in the same order. This is what is happening with the augmented matrix.
Comment: What does left multiplying mean?
Comment: @user57928: "left-multiply A by E" means "multiply A by E on the left", namely to obtain EA.
Answer: Let me make it concrete in the following example(@pauly-b's answer is much better).
Suppose that 4 apples(any two are the same price) and 3 bananas(any two are the same price) in city A would cost 10 euros, and 3 apples and 2 bananas 7 euros. Let's calculate how much it would cost for 1 apple and 1 banana in A? We don't need to calculate the price for each fruit, the answer is just 10 minus 7.
$\pmatrix{4&3\\ 3&2}   \cdot \pmatrix{a_A\\ b_A} = \pmatrix{10\\ 7}$
We apply Gaussian elimination by $R_1 = R_1 − R_2$
$\pmatrix{1&1\\ 3&2}   \cdot \pmatrix{a_A\\ b_A} = \pmatrix{3\\ 7}$
Obviously, the above two equations are equivalent. By the same token we can perform more such operations to make the matrix on the LHS an identity one.
$\pmatrix{1&0\\ 0&1}   \cdot \pmatrix{a_A\\ b_A} = \pmatrix{1\\ 2}$
And we get $a_A$ and $b_A$: 1 and 2. We denote the above by
$\left(\begin{array}{cc|c}
 4 & 3 & 10 \\
 3 & 2 & 7 \\
\end{array}\right)
\rightarrow
\left(\begin{array}{cc|c}
 1 & 0 & 1 \\
 0 & 1 & 2 \\
\end{array}\right)
$

Let's assume that we are in a different city B and the prices change, and we get
$\pmatrix{4&3\\ 3&2}   \cdot \pmatrix{a_B\\ b_B} = \pmatrix{11\\ 8}$
Following the same process, we can get $a_B$ and $b_B$: 2 and 1.

We can combine the two and get
$\pmatrix{4&3\\ 3&2}   \cdot \pmatrix{a_A&a_B\\ b_A&b_B} = \pmatrix{10&11\\ 7&8}$
Performing Gaussian elimination we get
$\pmatrix{a_A&a_B\\ b_A&b_B} = \pmatrix{1&2\\ 2&1}$

What if we change $\pmatrix{10&11\\ 7&8}$ in $\pmatrix{4&3\\ 3&2}   \cdot \pmatrix{a_A&a_B\\ b_A&b_B} = \pmatrix{10&11\\ 7&8}$ to $\pmatrix{1&0\\ 0&1}$?
We get the following:
$\pmatrix{4&3\\ 3&2}   \cdot \pmatrix{a_A&a_B\\ b_A&b_B} = \pmatrix{1&0\\ 0&1}$
After Gaussian elimination we get the inverse of $\pmatrix{4&3\\ 3&2}$: $\pmatrix{-2&3\\ 3&-4}$
And we can denote the above by
$\left(\begin{array}{cc|cc}
 4 & 3 & 1&0 \\
 3 & 2 & 0&1 \\
\end{array}\right)
\rightarrow
\left(\begin{array}{cc|cc}
 1 & 0 & -2 & 3 \\
 0 & 1 & 3 & -4 \\
\end{array}\right)
$
References:

Gaussian Elimination
Going from Gaussian elimination to finding the inverse matrix


Salesforce chatbot Post Survey Option disabled

Question: Can anyone guide on how to enable the Chatbot Post survey option? Do I need a License for a Post chat survey?

Surveys are already enabled in Org.
Comment: As per https://help.salesforce.com/articleView?id=snapins_chat_configure_post_chat_survey.htm&type=5 , the post chat survey feature is available with the Salesforce Feedback Management license.Can you confirm if you have this license?
Comment: Thanks, @Swetha for the quick response. currently, I don't have it. that's all I wanted to confirm
Comment: Happy I could help. I will add my comment as an answer so that others facing the same issue might find it helpful. Thanks
Answer: As per https://help.salesforce.com/articleView?id=snapins_chat_configure_post_chat_survey.htm&type=5 , the post-chat survey feature is available with the Salesforce Feedback Management license. With this license, you will be able to see the survey option.
Thanks


Any tank mates for an African clawed frog

Question: My aunt keeps forgetting to feed her African clawed frog and offered it to me. I think this frog would be cool with other fish or amphibians but I've also heard of them eating some. I would like to know if there are any suitable options for a 10 or 20 gallon tank. I would also like to know if there are any live plant options.
Comment: Don't put goldfish or Mollies in with African Clawed Frogs. I was given an aquatic frog. It turned out to be an African Clawed Frog not the dwarf variety they believed it to be. As it grew bigger than the dwarf it shredded the fins of the fancy goldfish and then started on the scales. one scale at a time. Unfortunetly I did not notice this until it was to late. The goldfish never recovered even after moving them to a different tank. It seems to be OK with an 8in. Rhino Placastomus because its skin is so tough, but Im keeping an eye on the tail fins. I came to this site to ask the same question
Answer: Try fancy guppies or balloon mollies. They are both suitable for 10-20 gallons and are top dwelling fish, community fish, so they'll add color and life to your tank with little interaction with your dwarf frog, and won't pick on him. I've learned they're hardier than most think. Plant recommendations would be Dwarf Anubias or Moss balls. Check out this list in link:
https://www.myfroggycam.com/using-live-plants-in-an-african-dwarf-frog-tank.php
Comment: Also just found this link.     http://aquaticfrogs.tripod.com/id26.html
Answer: I feel like I have to answer this, even if I am too late!
Beware of the differences between Dwarf Frogs and African Clawed Frogs. The second wikipedia article there even says:

African clawed frogs are frequently mislabeled as African dwarf frogs in pet stores. The astute pet owner will recognize the difference, however, because of the following characteristics:
-Dwarf frogs have four webbed feet. African clawed frogs have webbed hind feet while their front feet have autonomous digits.
-African dwarf frogs have eyes positioned on the side of their head, while African clawed frogs have eyes on the top of their heads.
-African clawed frogs have curved, flat snouts. The snout of an African dwarf frog is pointed.

It's important because the clawed ones grow a fair bit bigger than the dwarf ones (the size of the palm of your hand or bigger, even though they start off the size of your fingernail!) and will eat whatever fits in their mouths. And their mouths are pretty big relative to their heads. As their name suggests, they also have claws and can perform some crazy yoga to claw at the "food" they're currently putting in their mouth. Personally, I think they could and would eat a molly once they're fully grown.


Question on academic integrity and using summaries

Question: I was taking a philosophy class, which met twice weekly. Assignments for each class consisted of reading select passages from different philosophical works. In addition to the selected passages, our teacher provided recommended secondary literature/commentaries to help navigate the texts and provide different perspectives.
In regards to the readings, due to various (mostly health-related) reasons, I often fell behind. This, for the most part, was not an issue, as the essay assignments for the class concerned very specific sections of the texts. In writing these, then, what I would do was consult both online summaries of the relevant sections and peruse the relevant sections from the texts myself.
Come the final exam (for which we were provided the questions ahead of time), while I was initially concerned that my having fallen behind would hurt me, it turned out that most of the questions I could answer based on what I already knew. As I was preparing for the final question, however, I realized that I needed to really understand one section of a book that I hadn't read; this was the night before the exam. This section was really dense, so while I tried for a time, and got partway through it, I decided it would be more prudent to consult one of the recommended commentaries in order to understand what the philosopher was saying. While I was doing this, I tried a few more times to make it through the actual text again, but I didn't get that much further. The secondary sources clarified the argument the philosopher was making, and I used what I'd learnt to finish my answer. Ultimately, the information I'd gleaned from the secondary source took up only a small part of my final answer.
At the time, I felt a pang that maybe I was doing something unscrupulous, and thus that I should just rely solely on the primary text. Would it be wrong, I asked myself, to rely predominately on the secondary text given my minimal understanding of the primary text? But I also knew that I had somewhat of a history of compulsive, irrational guilt which had affected my performance in the past, and thus I was more determined not to let this hurt my performance on the exam, so I did end up using the secondary source.
After the exam, I later informed the teacher that in preparing for the final, I had consulted online/secondary sources that provided some information/ideas which I hadn't taken from the text, and he replied that this was completely fine. I realized, however, that I hadn't said specifically that I hadn't made it through the relevant section completely and with trying to understand it fully, and that maybe I should've actually clarified this as well.
The crux of my dilemma, then, is to what extent I should have read/comprehended the original text before relying on secondary texts/summaries. Generally speaking, throughout the course, while I relied a lot on secondary sources/summaries, I made efforts to read the actual texts as well. For the final, however, I tried to read the actual texts, and did to an extent, but understood it only superficially, and ultimately the bulk of my understanding came from the secondary texts/summaries. Moreover, as I was reading the primary text, I felt a bit that I was only doing it so that I could subsequently turn to the secondary text without reservations—i.e., without relying on the secondary text entirely without having read the primary text at all. It's worth noting as well that the secondary source I consulted predominately in answering this question was recommended by the teacher, and to my knowledge it was never stated explicitly that we could only use secondary commentaries after having read the primary texts.
I'm wondering whether I should feel bad about this going forward. I've come to the conclusion that, while at worst this may have been a minor infraction, it isn't worth feeling bad about and I shouldn't let this hang over me at all going forward, nor should I attempt to further clarify this situation with my teacher, especially given that the class is over.
Answer: Don't worry. There is no academic dishonesty in studying from secondary texts when preparing for a philosophy exam. Nor is there any academic dishonesty in failing to read the primary texts.
You don't need to further clarify the situation with your teacher.


Buying the full Star Citizen Game

Question: I am confused about ordering Star Citizen, does every ship purchase give access to the full game? I am reading in some places that the Aurora MR AC Starter and the Mustang Alpha AC starter are the only ones that give full access to the game + arena commander + squadron 42. Is that the case, or will purchase of another ship instead like the Aurora LN also get me full access to the entire game and Arena commander + squadron 42?
Answer: A game package is required to play.
the Aurora MR and the Mustang Alpha packages give you access to the game, arena commander, squadron 42, self-land hangar 1000 UEC and 3 months warranty.
purchasing the Aurora LN will give you the same access as the other two listed but with a different spacecraft.
any ship package looks to give you access to the game and Squadron 42 but only some give you access to Arena commander.
Requirements for Arena commander from Roberts space industries

What do I need to access Arena Commander?
To access Arena Commander one will need an RSI account and a pledge
  package which includes a ship, some credits and access to the full
  game. Specific access to the Arena Commander is also required, in the
  form of an Alpha Slot, or the Arena Commander Access Pass which can be
  bought here.

And to answer your comment only selected ships are allowed to fly in arena commander?

What ships will I be able to fly in Arena Commander?
Arena Commander currently includes the Aurora, 300, Mustang and Hornet
  series, including all released variants. Additionally, the M50,
  Gladius, Gladiator, Avenger and Cutlass Black are available for flight
  today. If I have a variant (Cutlass Blue, Cutlass Red…) can I still
  fly?
When a ship variant is unavailable, the purchase will give you access
  to the base model in Arena Commander until your ship is ready for
  flight.

cheers
Comment: that makes sense but then why do only the two starter pack explicity say: "Also includes everything you need to play Arena Commander today."
Comment: There is also an upgrade system on the RSI website. This allows you to pay some difference in cost between the ship you bought and the ship you want to buy. So, you could buy the Aurora MR package if the package has something you specifically want, and then upgrade it to a Gladius if you really wanted that ship instead.
Answer: "does every ship purchase give access to the full game?"
No,  Some are there to be added to an existing package and as such are cheaper, if it doesn't have "GAME PACKAGE" near the ship name then check the description. The easiest way is to head to the RSI homepage, "Store" and select the "Game Packages" option from the dropdown menu. The game packages start at US$45 and, until 14th Feb, will include Both games and at least 1 starting ship, after that, Squadron 42 (The single player game) and Star Citizen (MMO) will be sold as seperate packages (And most likely cost a bit more than you'd pay currently, but nothing official has been said about that pricing yet). - Towards the end of last year, they did away with module restrictions, so if you buy a game package now, you get access to everything that has been released for testing. So you'll currently get access to "Arena Commander" "Social" (sometimes referred to as planetside or artcorp) and the mini PU (aka crusader); Am guessing but would say that the "Everything you need to access Arena Commander" is a tagline from before the restrictions were lifted.
If your ship is not not flight ready yet, a similar type of ship will be made available to fly until it is.
If you're not sure about it and have some bandwidth to kill (The alpha is 30-35gb), there is a free fly week that ends on the 8th to give it a test. Otherwise browse some Youtube videos, there are a lot.
Answer: Below is advice if you intend to buy the game:
Before you buy anything, make sure your account used a referral code when signing up as this'll give you 5,000 UEC to play with. If you didn't, make a new account using this link: https://robertsspaceindustries.com/enlist?referral=STAR-WTLN-9B3S
Currently, until the 15th of February if you buy any package you'll receive access to the Alpha, the Beta, the MMO itself and Squadron 52 (Which is the single player campaign) After the 15th of February you'll have to buy Squadron 52 separately.
To buy star citizen, you have to select a package. The cheapest packages are these:
Aurora LN: https://robertsspaceindustries.com/pledge/Packages/Aurora-LN
The Aurora LN is the best package for your money.

Buying the full Star Citizen Game


SharePoint 2010 workflows not loading in SharePoint 2016

Question: Recently upgraded farm from 2010 to 2016.  Still using 2010 workflows, but the migration apparently did not do well for our custom ones.  These workflows appear to start up but do not assign tasks to approvers.  I've tried to load them in Designer 2013 but it just opens a page saying Designer cannot display the item.  There's also the concern that my Visio version being 2016 will cause a problem with it.  Should I just scrap all these old workflows and move on to the 2016 workflow platform, or is there a way to fix the 2010 ones?
Answer: you'll have to do some things...
First install all the recent updates for SharePoint Designer, there are some bug fixes in the last two sp1 upgrades
have you installed the Infopath service ? workflows 2010 require it as the workflows 2010 contain infopath forms
After that if your sharepoint designer is still displaying errors then i would remove all the cache and stop SP Designer from catching data.
and after that i would stat to check if SP designer is running into compatibility issues, i had one with SP designer and Visual studio 2015, i had to

Unistall visual studio
Unistall Sharepoint designer
install sharepoint designer
install sharepoint designer SP1 update
install all sharepoint designer patches
install visual studio again

after that check if your lists have the correct workflow associations
go to your list in SP designer
go to the list and check the workflows,
if you have missing workflow click on the workflow box and then click at the ribbon button "Associate existing workflows"
Comment: Yeah I have visual studio 2017.  The installer for SP1 says the expected version of the product was not found on the system.  Given that, I'm not sure if I even want to proceed with this.  Do you think it's about an equivalent amount of effort to just install the 2016 version of workflows?  Can that live on the same server as SharePoint?
Comment: to me looks like your SharePoint designer is bugged, i would reinstall SP designer.

sharepoint 2016 supports natively workflows 2010, i think reinstalling SP Designer will fix the  bug

There are no 2016 workflows, only 2013 and to run 2013 you have to install workflow foundation
Comment: Read my question to mean the 2013 version.  I think I can install it on the sharepoint server according to some site.  Anyway I reinstalled spd 2013 again and SP1 still wouldn't install over it. I don't see any concrete logs about the installation failure and I'm not excited about tearing apart my computer over this.  I'd rather just go with the 2013 workflows if it's not gonna work.
Comment: I eventually had to add PACKAGE.BYPASS.DETECTION.CHECK=1 to the installers on the command line because we had group policy preventing it from creating a system restore point


How do I display articles I wrote in someone else's name in my portfolio?

Question: During my pregnancy, I'd quit my job as a tutor. However, I wrote articles for my sister, who was working as a Social Media Manager and Content Creator. Now that I want to start applying for jobs, I don't know how to show these articles in my portfolio as it bears my sister's name. How do I go about it?
Answer: Writing an article (or book) in somebody else's name is called "ghostwriting".
Typically ghost writers agree under contract to remain anonymous. If you have no such agreement with your sister, and your sister will not get into any trouble if anybody learns she did not write the articles herself (and they may, once you start making it public by telling others about it), then I would just create a section of your portfolio and label it "Ghostwritten Works". Anybody hiring a writer will understand why your sister's byline is on them. And if they ask about that, explain that is the nature of ghostwriting, you let someone else take the credit (usually for pay).
Comment: ^- This. Be *VERY* careful your sister won't get into trouble.
Answer: I recently read an article about creating a writing portfolio which explained your situation perfectly.
It suggested using live links towards the original content to avoid any duplicate content and SEO penalties.
Perhaps, this is something to consider as I imagine the SM-agency will be pretty SEO savvy to know if you've published their content anywhere on the web.
Comment: While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference.  Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/17145)
Comment: @Rasdashan I have done that by mentioning "It suggested using live links towards the original content to avoid any duplicate content and SEO penalties.".


invoke lambda function with hours delay

Question: I am trying to figure out what is the best approach to invoke an aws lambda function 5 hours later. I have another lambda function that would issue multiple retrieval jobs to grab items out of aws glacier, and I need a solution to run another lambda function on each of the items once they are retrieved, which is about 5 hours. I was thinking about using sns but was wondering if there are other approaches to this. any input is appreciated.
Comment: 5 hours is a constant or do you want to run depends on other lambda functions output?
Comment: it should be constant and not dependent on the other lambda output
Comment: Ideal design would be using CloudWatch events. I have added details in answer
Answer: Update 14th November 2022:
AWS has released a new feature of EventBridge called EventBridge Scheduler which lets you schedule one-time or recurring actions like invoking a Lambda Function. In the context of the question above, scheduling to invoke a Lambda Function with hours delay, a CLI call might look like this:
aws scheduler create-schedule --name lambda-templated --expression 'at(2022-11-20T13:00:00)' \
--target '{"RoleArn": "ROLE_ARN", "Arn":"FUNCTION_ARN", "Input": "{ "Payload": "TEST_PAYLOAD" }" }' \
--flexible-time-window '{ "Mode": "OFF"}'

In this case, expression is a one-time schedule to invoke the Lambda Function on 20th November 2022 at 1pm UTC+0.
The target argument expects a certain format depending on the action you want to perform. The above format is described in the Template target docs for Lambda Invoke.
Old answer (still relevant for some cases):
Besides using CloudWatch, another interesting approach in your case would be to use AWS Step Functions:

Either use a wait state by setting a fixed period (or even a dynamic one if you provide input data to the state machine):
 {
   "Comment": "An example of the Amazon States Language using wait states",
   "StartAt": "WaitState",
   "States": {
     "WaitState": {
       "Type": "Wait",
       "Seconds": 10,
       "Next": "MyLambda"
     },
     "MyLambda": {
       "Type": "Task",
       "Resource": "arn:aws:lambda:REGION:ACCOUNT_ID:function:FUNCTION_NAME",
       "End": true
     }
   }
 }

Or you can use a separate Lambda function in a task state combined with a choice state which checks in a loop if the other function should run:
 {
   "Comment": "A state machine that submits a Job to AWS Batch and monitors the Job until it completes.",
   "StartAt": "Wait X Seconds",
   "States": {
     "Wait X Seconds": {
       "Type": "Wait",
       "SecondsPath": "$.wait_time",
       "Next": "Get Job Status"
     },
     "Get Job Status": {
       "Type": "Task",
       "Resource": "arn:aws:lambda:REGION:ACCOUNT_ID:function:CheckJob",
       "Next": "Job Complete?"
     },
     "Job Complete?": {
       "Type": "Choice",
       "Choices": [
         {
           "Variable": "$.status",
           "StringEquals": "RUNNING",
           "Next": "Wait X Seconds"
         },
         {
           "Variable": "$.status",
           "StringEquals": "SUCCEEDED",
           "Next": "Do Job"
         }
       ],
       "Default": "Wait X Seconds"
     },
     "Do Job": {
       "Type": "Task",
       "Resource": "arn:aws:lambda:REGION:ACCOUNT_ID:function:DoJob",
       "End": true
     }
   }
 }

Comment: Here is a good article about how to do the same as in #1 : https://dev.to/evanhameed99/scheduling-and-delaying-queue-messages-5254
Answer: I feel that the cloudwatch and step-functions based solutions do not scale well and they are pretty heavy code-wise.
I recommend creating two SQS queues. One will be the waiting queue, and the other one will be the execution queue.
Waiting Queue:
Set the execution queue as the deadletter queue of the waiting queue.
Set the Default Visibility Timeout equal to the time you want to wait to run the lambda (up to 12 hours).
Set maximum receives of 1.
Create a Lambda that consumes an SQS message and returns an error. Add the waiting queue as a trigger to this lambda.
exports.handler =  async function(event, context) {
  throw new Error('Go back to the waiting queue and wait');
}

Execution Queue:
Add the execution queue as a trigger to your Lambda (that you want to schedule).
Then, to schedule your lambda you need to simply post a message to the waiting queue.
The message will go to the waiting queue where it will be consumed by the error-out lambda. It will tgen sit on the waiting queue until its visibility times out and it will be pushed to the deadletter execution queue for pickup by your scheduled lambda.
Answer: The ideal way is to schedule Lambda function using CloudWatch event. Please see more details on the same here

invoke lambda function with hours delay


How to avoid InDesign adding pages automatically?

Question: I don't know why it's doing this but it keeps adding pages horizontally, when I delete those 2 on the right, it adds them again automatically.
Answer: It's because you create the document with a Primary Text Frame. InDesign automatically add pages at the end of the document while the text flows. I don't see well your image but maybe there are some invisible characters flowing. Personally I recommend checking Primary Text Frame in new documents only for novels or books with fluent text.

To avoid this, go to Preferences → Type → uncheck Smart Text Reflow
Comment: Thank God! You are the man! This was seriously bugging me haha, fixed the issue.

Thanks!


Do you experiment with unconventional ways to use design patterns?

Question: We stick to standard usages and best practices because they work and communicate intent well, but without trying new things we can't really grow. Have you ever tried something that seemed absurd but worked out really well? When it works, how do you avoid confusing other developers with non-standard usages? And what do you do when things go horribly wrong - refactor, start over, or just go with it?
Comment: How can one use LEGO in a non-standard way? :)
Comment: @rwong: I never buy those packages for my kids where you can build one thing from it. Usually I buy boxes of blocks, windows, fences etc., and make sure I remove any leaflets helpfully providing ideas what to do with them. True, relatives sometimes will buy special packages, but the kids usually start scavenge them for interesting parts the moment they are built.
Comment: @bobah: by not following the building plan that comes with the LEGO package.
Answer: Yes, but with simplicity wrappers.
Most users will only need to access through the simplicity wrappers. The system would be very familiar to them, because the simplicity wrappers are designed to be very similar to the older systems. However, advanced users who need extra power, and developers on the new system team, will need to become fluent in the new pattern.
If things go horribly wrong, the entire project has to be thrown away. This is why early feedback (integration) is important, so that you can stop loss earlier.
Also, put some effort on educating your fellows about the inside, and any special precautions needed. Put a lot of effort on testing.
Answer: All the time.
I avoid confusing other developers by only expierementing on personal projects. Id say some of the best and most of the worst code I have ever written has been for personal projects- when trying out new things.
When things go horribly wrong, since its usually just a small part I throw it away or refactor it until it is useable.


How does the internet/proxy works?

Question: I know. The title is not so specific. My question may range from "simple router at home" from "the whole internet".
I have a background in Networking, complicated answers will be apreciate, but one thing that I can't seem to understand is the relation of Proxy, ISP and the whole internet involving these two.
I have a couple of questions if you have the time to answer them.

What do I pay for when I pay my ISP for a fee at monthly basis?
What is the process when I hit enter at my keyboard when I'm using a
proxy and when I'm not using it?
Isn't suppost for ALL my requests go through my ISP server?
If I use a proxy, how can I be sure of that none of the traffic will
be seen from other source other than the proxy? (assuming there's no
MITM, sniffer, etc...)

Concerning question number 1: am I paying for a network that is used in my country/area? I pay xx€ for month and I can use this network to send requests to whoever IP i would like? When I set a proxy of 184.108.40.206, does that mean that the first one to handle my request will be 22.214.171.124 (excluding my home router) or my ISP server?
Answer:
What do I pay for when I pay my ISP for a fee at monthly basis?

In short, you are paying for access to the larger Internet through your ISPs network. Using an analogy with roads, you can think of your ISP's network as your neighborhood and city streets, and the wider Internet as the major highways. The "highways" are composed of various organizations that have agreed to physically link and exchange data with each other.
The ISP's job is to get access to the highways by making peering/transit agreements with companies that operate them (e.g. Tier 1 providers or transit providers). Then, in exchange for money, the ISPs give you access to the "city streets" they've built which will get you onto the highway. Once there, you can get to pretty much anywhere else in the world.

What is the process when I hit enter at my keyboard when I'm using a
  proxy and when I'm not using it?

Say you want to get groceries in a neighboring city. Not using a proxy would be akin to driving to the neighboring city yourself to get the groceries. Using a proxy would be like driving to your friend's house and giving him your shopping list so that he can get them for you. Now, from the point of view of the grocery store (aka the web server you wanted to access), it seems that your friend is the one getting groceries, even though he's only doing it on your behalf.

Isn't suppost for ALL my requests go through my ISP server?

Yes - assuming the proxy is not inside your home network, you would still need to use your ISP's "city streets" to get to your friend's house. (In other words, you still need to send traffic through the ISP in order to ask the proxy to download a webpage for you.)

If I use a proxy, how can I be sure of that none of the traffic will
  be seen from other source other than the proxy? (assuming there's no
  MITM, sniffer, etc...)

Can you clarify this question? If no encryption is being used, the "no sniffer" assumption doesn't make much sense because anyone between you and the proxy, and between the proxy and the website you want to visit, can see your traffic if they wanted to.
Answer: You claim to have a background in networking but do not understand these simple concepts?
1) Depending on your T&C with you ISP, you are most likely just paying for a "pipe" to the public internet, restricted to a set maximum speed limit or data volume limit without a guaranteed level of service.
2) See below explaining proxy
3) Your ISP likely doesn't have "servers" on the internet, but routers and switches connecting to a bigger upstream pipe. All of your data will always go through them as there is no other physical or logical path for the data to take.
4) You can't, without physical control of the devices there is no way of knowing. Although if your proxy service supports a VPN connection, the data will likely be encrypted so that even if it is spied on it would be useless to the person looking at it.
In this case, proxy service essentially submits all requests to/from the internet on your behalf and it to the far end it appears to be talking to your proxy service and not you directly, the physical and logical connections of your ISP are still used.
Normal interaction with Google.com, simplified for example:
Your web browser -> ISP network -> Internet Cloud -> Google
(path back is just reversed)
But when a proxy service is in use, it looks more like two separate transations like this (again, simplified):
1) Your web browser -> ISP network -> Internet Cloud -> Proxy server (STOP)
2) Proxy Server initiates new request -> Internet Cloud -> Google
(path back is reversed in two distinct steps as well)
The proxy server becomes your agent... Imagine you wanted to buy something at the store, you have two choices to buy the product, you can either buy the product yourself or send Proxy to do it for you. If you buy it yourself, the store knows some information about you such as what you look like and maybe how often you come into the store. But if you have Proxy go buy it for you, the store doesn't know you or anything about you, just that Proxy comes in buys a product, and probably a bunch of other products too. Make sense?
All of the above is talking about a "web proxy", but some proxy services use a VPN to connect to their proxy server, this is kind of the same thing, but still different. In this case all of your data (not just web traffic) is sent over an encrypted tunnel to your proxy service before going out to the internet, the information still flows through your ISP's network but it is an encrypted tunnel of data.
Comment: I have little background in Networking. I know the basics of it. I asked this question because i wasn't sure how the process worked. I wanted to make sure that my concept of the idea was correct, which was not. Nonetheless, thank you for your answer.
Comment: Sorry, I meant no offense. Saying you have a background in networking typically means you are trained and work(ed) in the field and are very familiar with the topic. I just misinterpreted your statement.

How does the internet/proxy works?


Is the usage of scales (modes) in jazz music common practice?

Question: A friend of mine told me that the usage of scales or modes in jazz music is not common. Even I heard myself in a Miles Davis interview that jazz is a tradition. So here are two questions basically: Is it common practice to use scales (modes) for jazz improvisation? Was is practiced back in the swing era, unlike the modal jazz "era"?
Comment: I actually find the first question to be poorly-phrased. *What do you mean?* Are you asking if anyone has ever played an *Eb phrygian* scale from root up to octave and back down in their solo?
Comment: The first question isn't very interesting, except in clarifying your intention. Because in a sense, **everything is scales**. You're playing something purely by ear, purely from theory (based on the changes), or some combination thereof. The changes imply scales, and you're probably hearing scales in your head. So it's all scales. Scales.
Answer:
Is it common practice to use scales (modes) for jazz improvisation?

TL;DR: Yes, of course it is.
For the start of the song, you have a melody and some chords to accompany it. After the melody has been played, the musicians start improvising solos. In order to see what are they going improvise on, they study the chords and the melody. These two belong in some certain scale(s) (usually more than one). So, when they realize what is (harmonically) going on in the song, they start improvising on top of the modes that belong in each chord, or in a scale the chords belong in.
For instance, pretty much all the jazz songs have the ii-V-I, like Dm7-G7-Cmaj7. In a cadence like that, you can improvise on C major or if you are bit more skilled, you can follow the chords and play the respective modes: D Dorian- G Mixolydian - C Ionian.
If you at the questions on this site tagged jazz you'll see many instances and queries concerning the modes/scales played in jazz.
The difference between modal jazz and jazz preceding that era, is that before modal, the musicians used chord progressions, while in the modal era, they used modes. If you listen to Miles Davis's So What, it has the same AABA form, but you won't see a chord progression there. You'll notice that the A is just D Dorian and B is Eb Dorian and that's it. Swing ear musicians didn't use this way of composing; they had chord progressions.
Comment: "So, when they realize what is (harmonically) going on in the song, they start improvising on top of the modes that belong in each chord, or in a scale the chords belong in."  I see this asserted all the time, including in educational materials written by people who are obviously excellent musicians.  I've never seen any of them present actual evidence that it provides a useful explanation of anything.
Comment: I don't play jazz, but when looking at transcriptions of jazz solos I have noticed passages that look pretty clearly to be lines created from broken chords rather than scales. I think the solos were from Charlie Christian and  Charlie Parker to set the style context (clearly this isn't modal jazz.) Mentally I took note of the broken chord lines because of the contrast with the jazz scale/chord matching method which is a common teaching method. Jazz players: please let me know if you think I'm making a big mistake here.
Comment: I've been taught (by no less than Gary Burton - in an online class, not in person), that knowledge and use of modes is central to the modern theory of Jazz improvisation. During the course, I discovered for myself that attempting to use the smallest number of major or minor scales as a basis for improvising over some very typical Jazz progressions just doesn't work. Whether one learns to do it by analysis or by ear, single-note improv in most Jazz numbers is modal improv using multiple modes in one piece. It's not just common practice, it's ubiquitous.
Answer: I've seen this quote from Charlie Parker in many places...
"I was working over 'Cherokee' and, as l did, I found that by using the higher intervals of a chord as a melody line and backing them with the appropriately related changes, I could play the thing I'd been hearing. I came alive."
The part "higher intervals of a chord as a melody line" catches my attention, because they are Parker's own words and pretty clearly indicate melody line from chord tones. Sure, he didn't say "I don't use scales." But, it's ridiculous to even think a musician would think in that way. If you are trying to weigh chord tones versus scales, the gist of Parker's quote seems clear enough: chord tones are central.
Also, it's pretty obvious that filling in a seventh chord with passing tones results in a scale. So, are scales derived from chords, or vice versa? I don't think you will get far trying to place one over the other. You obviously need both even if a melodic line is essentially derived from chord tones.


Change Wordpress Admin URL

Question: I changed my Wordpress directory structure quite a bit.  Here's what I have:
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/wordpress');
define('WP_HOME',    'http://' . $_SERVER['SERVER_NAME']);
define('WP_CONTENT_DIR', dirname(__FILE__) . '/content');
define('WP_CONTENT_URL', 'http://' . $_SERVER['SERVER_NAME'] . '/content');

So I have a content directory which contains my Plugins and Themes.  And then I have a wordpress directory which contains the core WP files, minus the wp-content folder.
With this new structure, I have to access the WP backend with this URL: http://site.dev/wordpress/wp-admin
Is there a way I can change it so I can just access it like so:  http://site.dev/wp-admin
I don't want wordpress to be in the URL.  Would this be an htaccess update I need to make, or is there a setting I can use in my wp-config.php file?
Answer: Here's an article from wordpress's site.

http://wordpress.org/support/topic/how-to-change-the-admin-url-or-wp-admin-to-secure-login

Add constant to wp-config.php
define('WP_ADMIN_DIR', 'secret-folder');
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . WP_ADMIN_DIR);

Add below filter to functions.php
add_filter('site_url',  'wpadmin_filter', 10, 3);

function wpadmin_filter( $url, $path, $orig_scheme ) {
    $old  = array( "/(wp-admin)/");
    $admin_dir = WP_ADMIN_DIR;
    $new  = array($admin_dir);
    return preg_replace( $old, $new, $url, 1);
}

Add below line to .htaccess file
RewriteRule ^secret-folder/(.*) wp-admin/$1?%{QUERY_STRING} [L]

Comment: What's the point of changing the admin URL if you are forwarding the user to the new admin URL from the default? The whole point of increasing security by switching the default admin URL is gone if you use the function in step 2 above.
Comment: @StellanLindell maybe it's not all about security, maybe I want to use 'admin' instead 'wp-admin' because a client wants me to. `jbrahy` is right, he answered correctly.
Comment: Why would you downvote me when I answered the OP? I just quoted the article from the Wordpress site.
Comment: But the security part @StellanLindell mentioned, should also be mentioned in answer. So the comment actually makes sense here! :)
Answer: I played around with this and there is a much simpler way to do this all in this one simple function below without having to muck around with anything else (create unnecessary folders, redirects, pages, etc.).
// Simple Query String Login page protection
function example_simple_query_string_protection_for_login_page() {

$QS = '?mySecretString=foobar';
$theRequest = 'http://' . $_SERVER['SERVER_NAME'] . '/' . 'wp-login.php' . '?'. $_SERVER['QUERY_STRING'];

// these are for testing
// echo $theRequest . '
';
// echo site_url('/wp-login.php').$QS.'
';

    if ( site_url('/wp-login.php').$QS == $theRequest ) {
        echo 'Query string matches';
    } else {
        header( 'Location: http://' . $_SERVER['SERVER_NAME'] . '/' );
    }
}
add_action('login_head', 'example_simple_query_string_protection_for_login_page');

Comment: There is a plugin for Joomla that makes this exact thing. I do not know why there is no available plugin that makes this.
Comment: can you please explain it with an example.please
Answer: This is very helpful topic. I made some little correction in the function and this is my version:
add_filter('site_url',  'wpadmin_filter', 10, 3);

 function wpadmin_filter( $url, $path, $orig_scheme ) {
    $request_url = $_SERVER['REQUEST_URI'];

    $check_wp_admin = stristr($request_url, 'wp-admin');
    if($check_wp_admin){
        wp_redirect( home_url( '404' ), 302 );
        exit();
    }

    $old  = array( "/(wp-admin)/");
    $admin_dir = WP_ADMIN_DIR;
    $new  = array($admin_dir);
    return preg_replace( $old, $new, $url, 1);
 }

Mainly for redirecting of wp-admin.
And most important part:
add_rewrite_rule( '^' . 'backend/(.*)','wp-admin/$1?%{QUERY_STRING}' );

To updates .htaccess rule.
Answer: All I did was moved /wp-admin folder ( inside of public_html/wordpress ) into public_html and I double checked to make sure it was going to work by renaming my WordPress folder ( I used wordpress_test, you can use anything ) and went to my site
example.com/wp-admin - it worked just the same as if I went to example.com/wordpress/wp-admin.
The only thing which is quite tricky is changing the wp-admin to something else , due to the fact the WP had coded the wp-admin throughout numerous files. Just simply changing the name causes php and other errors. Simple plugin I find will fix that easily.
Note: I didn't have to make any coding to do this. I had to change some code around for the wp-admin, because the plugin didn't do what I wanted.
Answer: Finally found a way to do it without a plugin AND WITHOUT MODIFYING WP CORE (all tutorials suggests to do so for some weird reason).
1- Copy wp-login.php and rename it to new-secret-url.php (on your root directory)
2- Open new-secret-url.php file and perform a search/replace of wp-login.php to new-secret-url.php
3- Add the following code to your functions.php:
/** Hide default login */
add_action( 'init', 'marounmelhem_hide_login' );
function marounmelhem_hide_login() {

    //Only proceed for guests
    if ( ! is_user_logged_in() ) {

        //Getting current page
        $current_url   = str_replace( '/', '', $_SERVER['REQUEST_URI'] );
        $hiddenWpAdmin = 'new-secret-url'; //Change this to your new secret wp-admin url
        $redirectNaTo  = '/';

        //Checking if accessing correct login url
        if ( $current_url == $hiddenWpAdmin ) {
            wp_redirect( '/'.$hiddenWpAdmin.'.php' );
            exit;
        }

        //Only allow requests to wp-login.php coming from correct login url
        $adminToCheck = [
            'wp-admin',
            'wp-login.php'
        ];
        if (
            in_array( $current_url, $adminToCheck )
            &&
            $_GET['action'] !== "logout"
        ) {
            wp_redirect( $redirectNaTo );
            exit();
        }
    }
}

4- This only works if you're not using any other frontend login forms, if you do, you can change:
is_user_logged_in() to possibly !current_user_can( 'subscriber' ) (or the role given in the frontend login logic)
5- Not sure if ajax calls works with the above, please let me know if you've tried it
Answer: There is one other way that will ensure quite better tactic to your secured wp-admin.
As well having own wp-admin name as perhaps: "worksersneeded/"
I did it to one of my sites, ended up in miracle where the probed SSL site was displaying different towards my site from different geo locations.
You will have to download a tool called Notepad ++:
https://notepad-plus-plus.org/download/
Unless you will be doing to much work on each of the files in the directory.
After then you need to extract the WordPress into a folder.
Then edit all files in the directory while searching after wp-admin.
Then replace all the files with your the name: "workersneeded" or your own name.
Like in notepad enter "search in files" to "find what": wp-admin/
And in "replace with": workersneeded/
Then replace all files.
You need to put into wp-config.php this line as well to monitor all problems:
ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

After you overwritten most in the WordPress directory and your wp-admin has now the name "workersneeded" you will most likely encounter slight problems with some of your WordPress plugins or themes.
That is why you will need to log them into the error_log.txt file.
After finding the errors in the file. You will most likely need to edit the .php file which still tries to connect to wp-admin. That way you can replace the file information of wp-admin to your administration folder.
You can again download your plugins and replace the same procedure as above with notepad++. That way you can make all plugins available with the new folder name.
Then upload the folder of each plugin into your wp-content directory with wp file manager plugin.
Be aware that your WordPress can't be auto-updated or updated doing so, even doing re-installation of your WordPress. You will have to do these replacements each time.
This was done with 4.9.8 version of WordPress as well as the newest 5.0.3
With 5.0.3 you get more errors into the error_log.txt file. Unknown why.

Change Wordpress Admin URL


Check-out counter at a supermarket

Question: A check-out counter at a supermarket will service one customer per unit time
if there is anyone in line. Customers arrive at the line: in each unit of time, the
probability that a single new customer arrives is $\frac13$, the probability that two arrive
is $\frac13$, and the probability that no new customer arrives is also $\frac13$. There are
initially three customers in line. Find the probability that the line empties before
it has ten persons in it.
Comment: Is there anything special or interesting about this question that makes it a puzzle and not just a simple maths textbook problem? Please see [this meta post](http://meta.puzzling.stackexchange.com/questions/2783/are-math-textbook-style-problems-on-topic) for criteria on the difference between maths puzzles (on-topic) and maths problems (off-topic).
Comment: This looks like another mathbook-type problem to me...
Comment: @Human Could you please tell about the book, its author, publisher, anything which would be helpful to cite the actual source of the puzzle(in case it is one).
Answer: There are initially three people in line. On average, the number of people doesn't change (since it either increases, decreases or remains the same with equal chances). Therefore, at any point in time, the average number of people in line is three.
Now, let $T$ be the first time the queue either empties or reaches 10 people, and let $p$ be the probability of the former. On the one hand, the expected number of people in line at time $T$ is three (as previously argued). On the other hand, the number is either 0 or 10 with probabilities $p$ and $1-p$ respectively, so the expected value can be calculated as $0\cdot(p)+10\cdot (1-p)=10(1-p)$. Therefore, $10(1-p)=3$, so $p=0.7$, for a 70% chance of an empty queue first.
Answer: It's

 7 in 10

Because

 the distribution is unbiased, meaning that the probability that the queue gains or loses $k$ people every $3$ time units is equal.

Breakdown

 $k=3: 000 | 222$
 $k=2: 001, 010, 100 | 122,212,221$
 $k=1: 011, 101, 110, 002, 020, 200 | 022, 202, 220, 112, 121, 211$
 $k=0: 111, 012, 021, 102, 120, 201, 210$

Reasoning

 After every $3$ time units, the queue has increased or decreased in size with equal probabilities, so with a starting position of $3$ we need the probability that a random walk reaches $0$ before it reaches $10$. This is equivalent to a random walk that moves towards $-1$ with probability $\frac7{10}$, and towards $1$ with probability $\frac3{10}$, so the answer is $\frac7{10}$.

Check-out counter at a supermarket


You are welcome

Question: We say thank you when pleased with someone's help or attention. Usually it is replied: you are welcome.
questions

does it mean that thanks are welcome?
is it the same sense when we say you are welcome to somebody arriving at home?
Answer: Collins defines "you're welcome" for English language learners as:

You say 'You're welcome' to someone who has thanked you for something in order to acknowledge their thanks in a polite way.

Additionally it is defined as:

In American
[Y]ou're under no obligation for the favor given;

Hope this is helpful!
Answer:
does it means that thanks are welcome?

When someone says "you're welcome", they usually mean that you were welcome to whatever you had thanked them for. For example, if the person had given you a cake and you said "thank you", if they respond "you're welcome" they're saying that you are welcome to the cake; that they are happy to give it to you. It is also often used to be polite to the person who said "thank you"; you can think of it as being almost like thanking the person who said thank you.
I hope this helps you. :)

You are welcome


In quantum teleportation what is the need for the extra X/Z gate after classical information is sent from Alice to Bob?

Question: In the Qiskit textbook, at step 4, Bob who has received the classical bits from Alice then needs to apply a X and/or Z gate depending on what the classical bits received are, why is that?
Answer: Without that fixup, the state of Bob's qubit can be in any one of the states $\alpha |0\rangle + \beta |1\rangle$ (the state we actually wanted to teleport) or $\alpha |0\rangle - \beta |1\rangle$, $\beta |0\rangle + \alpha |1\rangle$ or $\beta |0\rangle - \alpha |1\rangle$ (the states we don't want to end up with). X and Z gates are applied to fix the resulting state so that it ends up in $\alpha |0\rangle + \beta |1\rangle$ - otherwise we can't count our teleportation a a success.


clutch being depressed engages starter

Question: I have replaced the GEM module and the ignition. WHen ever I push the clutch the starter engages even with the key out. The driver side window does not roll up and the lights come on and off. What else do I need to check for or does anyone know of a site I can go to to help me solve my problem? Thanks Eric
Comment: Interesting issues - you have obviously got the electrics screwed up, perhaps an incorrect module version, or short circuits...however, without more information (type of car, versions, specific symptoms, what checks you have currently carried out etc) the question is not going to get useful answers. You can edit your question to update with this info.
Comment: Welcome to the site. In order to get a good answer for your question you will need provide detailed information on the problem. Please edit you question to provide this information, once that is done I will reopen the question.
Answer: Did you install the correct module? If so, warranty it and get a replacement. The vehicle is equipped to disable the starter unless the clutch is depressed. Your circuit is stuck on START and becomes aactive when the clutch override is disabled by the clutch being depressed. As Rory mentioned - it is impossible to offer a definitive diagnosis without being able to lay hands upon the vehicle, but I echo his sentiment that you have a defective or incorrect module.

clutch being depressed engages starter


How do I remove the pop-ups on shadowplay/ Nvidia share?

Question: Whenever I want to record for my youtube channel, these pop-ups show up in my recordings. How do I disable them, or stop them from popping up?
Answer: In order to disable the ShadowPlay notifications you have to go into the settings, there is a whole section about notifications, then you can just disable all of them or some of them.


Developing a mobile website

Question: I am using mobile tools module. It asks for path of mobile website. Does it mean that i need to develop mobile based pages again? i.e one for mobile and another for desktop ?
Answer: Mobile tools will let you differentiate between what you consider to be your 'desktop' version and your 'mobile' version via the theme you choose.  For example, www.example.org as your desktop and m.example.org as your mobile.
Mobile tools will try to redirect based on device detection, if you configure it that way.  If you want the desktop version to show on all devices, computer and mobile, you can configure it that way as well, or include the desktop version for 'desktop and mobile.'
But, if you do want a separate mobile theme, there are several existing mobile themes out for drupal.  To make that work you would have to install and enable the mobile theme, and then mobile tools will automatically select that theme when it detects the mobile based site.
Whatever version of the site you want to display on any device is very possible. It's just according to your goals for each device.
Comment: - So if i give like m.abc.com . So i have to develop this apart from drupal development rite ?
Comment: you would have to develop a new theme, yes, and then activate it. Mobile tools will then display the content in the theme for its respective devices. Aside from that, the content would be the same as it's coming from the same database, if that is what you re asking.
Comment: Hmm I could have been more clear there. All you are doing is designing two separate themes for the same Drupal installation. Then with mobile tools you are telling it how and when to select between the two themes, either device detection, or by specifying URL.
Comment: Theme thing i got u. But what about when its like m.abc.com . You mean to say when i access m.abc.com it will display same content in different theme ?
Comment: yup, that is correct. That is why you have to enable both themes. Mobile tools modules will detect that you are accessing m.abc.com and then automatically switch the theme to the mobile them for m.abc.com

Developing a mobile website


Blender 3.5 Material preview mode in Cycles, everything appears with a glow, even new objects from scratch

Question: I apologize for this inquiry, I'm sure it's very basic, but I have very little experience with Blender, and I'm asking this question after having tried for hours to solve it and without having found an answer on Google. I'm in Blender 3.5, in Cycles, and I can't understand why every time I create an object with the viewport in material preview mode, it appears with a glow (the object does not have an emissive material). I also find out that a Bloom non-default option appears now in the Shading / Render pass menu of Material preview mode. Thank you very much
Comment: Hello and welcome. Even the default cube when you create a new file? or only new objects added? Can you share your blend file https://blend-exchange.com
Answer: I found out that it was just that Bloom was activated in Eevee, and I didn't disable it. When I switch back to Cycles, it remains active in the Shading options


Magic the gathering rules

Question: If one of the spells I have can make the enemy sacrifice a plainswalker but i choose the plainswalker from the game and I do that to a general is not the general banned from the game forever?
Comment: Please try to put a little more effort into your questions - this one especially is quite hard to understand, and because of that, it's not easy to tell whether answers are useful either.
Comment: What card or cards are you describing? I agree with TheThirdMan, it's hard to understand what you're describing or what game mechanics would be involved here.
Comment: Start by using the proper names for things. There's no such thing as a "general" in MTG, and there's no such thing as being "banned from the game". (Banned cards are cards that would be allowed by a format except for the fact that they are explicitly banned from that format. This is obviously not what you're talking about.)
Answer: Nope.  When a general/commander leaves the battlefield, it's owner may choose whether to return it to the command zone or let it go to wherever it would have gone otherwise (library/hand/graveyard/exile).
From the rules:

903.
  9. If a commander would be
  exiled from anywhere or
  put into its owner's
  hand,
  graveyard
  , or
  library
   from anywhere,
  its owner
  may put it into the command zone instead.
   This replacement effect
  may apply more than on
  ce to the same event. This is an exception to rule 614.5

Your question is a bit vague but clearly deals with this rule here and so I suspect that it answers your question.

Magic the gathering rules


Why can a Lorentz transformation be interpreted as a rotation in 4D?

Question: This is basically the result of Michelson-Morley experiment:
$$
(x^0)^2 - \sum_{\mu=1}^3 (x^\mu)^2
\stackrel{!}=
(\bar x^0)^2 - \sum_{\mu=1}^3 (\bar x^\mu)^2
$$
Why can this be interpreted as a rotation?
Comment: You can think of it as a hyperbolic rotation.
Comment: In the book "Geometric algebra for physicists" by Doran and Lasenby, the authors within the formalism of geometric algebra do treat Lorentz transformation as rotation in 4-d space with the peculiar metric it has.
Comment: What does "$\stackrel{!}=$" mean? How is this different from the ordinary "="?
Answer: Short version: The Lorentz transformation is not a rotation. It's just very similar.

Medium version: Look at the similarities!
A 2D rotation matrix can be written as
$$R(\theta)=\left(
\begin{matrix}
  \cos(\theta) & -\sin(\theta)  \\
  \sin(\theta) & \cos(\theta)
 \end{matrix}\right)$$
These rotation matrices satisfy the identity $R(\theta)R(\phi)=R(\theta+\phi)$. This is equivalent to the angle addition formulas for sine/cosine. They're used  to rotate the $x$ dimension into the $y$ dimension.
A 1 space + 1 time dimension Lorentz transformation can be written as:
$$L(\alpha)=\left(
\begin{matrix}
  \cosh(\alpha) & \sinh(\alpha)  \\
  \sinh(\alpha) & \cosh(\alpha)
 \end{matrix}\right)$$
These rotation matrices satisfy the identity $L(\alpha)L(\phi)=L(\alpha+\phi)$. These are equivalent to the hyperbolic angle addition formulas. They're used  to transform the time dimension partway into the space dimension.
So mathematically, aesthetically, and almost every-which-way, the Lorentz matrices behave a lot like rotation matrices. However, even in special relativity, time and space are different. There are three spacelike axes and one timelike axis. The timelike axis stays timelike no matter how you Lorentz transform. But in Euclidean space, you can rotate your x axis into any other axis you so please. So these are NOT rotations in 4-dimensional Euclidean space. They are the analogue of rotations in 4-dimensional Minkowski space.

Long version: generalizing inner products.
If you want to generalize the notion of angles, you can start from the dot product formula: $\vec{a}\cdot \vec{b}=a_x b_x+a_y b_y+a_z b_z=\|a\|\|b\|\cos(\theta)$, with theta being the angle between them. You can write this as a matrix equation: $\vec{a}\cdot \vec{b}=\vec{a}^T I \vec{b}$, with $\vec{a}$ and $\vec{b}$ interpreted as column matrices and $I$ the identity matrix. You can imagine instead of putting an identity matrix in there you stuck in any other matrix, say $A$. So you define $\vec{a}\cdot \vec{b}=\vec{a}^T A \vec{b}$. Usually the symbol $\cdot$ is reserved for the dot product, so mathematicians like to write this as $\langle \vec{a},\vec{b}\rangle$, and physicist notation is $a_\mu b^\mu$. I'll use the matrix notation. In Euclidean geometry, you have:
$$A_E=\left(
\begin{matrix}
  1 & 0 & 0 \\
  0 & 1 & 0 \\
  0 & 0 & 1
 \end{matrix}\right)$$
In Minkowski geometry, you have:
$$A_M=\left(
\begin{matrix}
  -1 & 0 & 0 &0  \\
  0 & 1 & 0&0  \\
  0 & 0 & 1&0 \\
   0&0&0&1
 \end{matrix}\right)$$
So in this generalization, a generalized rotation $R$ should be a linear transformation that leaves all generalized angles invariant. ie, it should leave all dot products invariant. Writing that out: we send $\vec{a}$ to $R\vec{a}$ and $\vec{b}$ to $R\vec{b}$ with $R$ a linear transformation and $\vec{a}$ and $\vec{b}$ column vectors. We demand that $\vec{a}^TA\vec{b}=(R\vec{a})^T A (R\vec{b})$. If you scratch your head a little bit, and necessitate that this holds for ALL vectors $\vec{a}$ and $\vec{b}$, you'll find that this implies $A=R^T A R$.
If you plug in $A_E$, the only matrices $R$ that satisfy these are the rotation matrices (the group of rotation matrices is denoted $O(3)$). If you plug in $A_M$, the only matrices $R$ that satisfy these are the Lorentz transformations (the group of these matrices is denoted $O(3,1)$ for 3 positive signs and one negative sign in the matrix $A_M$).
Note that you can have the "length" of a vector, $\vec{a}^T A_M \vec{a}$ be negative. This makes the Lorentz inner products useless for a lot of mathematics. For example, in real analysis you don't get anything useful out of this, because the space becomes non-hausdorff, which is a big no-no. (That is, if you define $d(\vec{a},\vec{b})=(\vec{b}-\vec{a})^TA_M(\vec{b}-\vec{a})$ as a distance function, it's pretty useless). Whenever you do a volume integral or try to give a notion of distinct points, you don't use the Minkowski inner product. For this reason, mathematicians define an inner product space and explicitly include the condition of positive definiteness, which precludes using anything like $A_M$. This makes perfect sense in mathematics, but in physics you really do want to keep the Minkowski metric.
Comment: @innisfree I added a "medium version". Let me know if it's what you had in mind!
Comment: Nice one, that's what I meant
Comment: How about mentioning hyperbolic trig? Could help the similarity clearer.
Answer: Rotation changes direction of a vector without changing its length. Can you define length of a four vector to be invariant under Lorentz transformation?
Answer: A rotation matrix $R$ can be defined as a square matrix for which $R^T=R^{-1}$.
For a Lorenz transformation $\Lambda$, if we define its transpose as $(\Lambda^T)_\alpha{}^\beta=\Lambda^\beta{}_\alpha$, then we have $(\Lambda^T)^\alpha{}_\beta=(\Lambda^{-1})^\alpha{}_\beta$.


How to recompile Vim?

Question: I want to recompile Vim the exact same way Ubuntu has compiled it, but with one difference (ruby support). I have already compiled with Ruby support, but by using my own configure options, Vim --version is different in several ways from the Ubuntu version and is causing problems. If I knew how Ubuntu used ./configure I could do this.
Is there a place where I can find out how Ubuntu used ./configure for Vim while making the Ubuntu binary?
I'm guessing somewhere like http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/raring/vim/raring/files/head:/debian/ might have the answer?
Edit: this http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/raring/vim/raring/view/head:/debian/rules looks like it. Now how to use?
Edit: currently trying http://www.moosechips.com/2008/09/ubuntu-rebuild-a-source-package/
Edit: Yes, doing that worked, I'm a new "ask ubuntu" user so I can't answer my own question for 6 hours or something, otherwise I would now.
Answer: http://www.moosechips.com/2008/09/ubuntu-rebuild-a-source-package/ as in my edits solved my problem
Comment: The link does not work any more..
Comment: https://web.archive.org/web/20151213150214/http://www.moosechips.com/2008/09/ubuntu-rebuild-a-source-package/ Here it is!

How to recompile Vim?


searching within a compressed sorted fixed width file

Question: Assume I have a regular fixed width file that is sorted on one of the fields.  Given that I know the length of the records, I can use lseek to implement a binary search to find records with fields that match a given value without having to read the entire file.
Now the difficulty is that the file is gzipped. Is it possible to do this without completely inflating the file? If not with gzip. is there any compression that supports this kind of behavior?
Answer: The bzip2 file format consists of multiple independently-compressed blocks.
If you're willing to maintain an index alongside of your bzip2 file, you could
know where to lseek to.
Note: This is a duplicate of the questions:

Compression formats with good support for random access within archives?
Random access gzip stream
Multi-part gzip file random access (in Java)

These answer the same question, but also identity BGZF as a gzip-compatible output format with sync points inserted to reset the compression state.
Comment: Another gzip-compatible seekable file format is [idzip](http://code.google.com/p/idzip/). It is suitable, if you like Python.
Answer: This is totally impossible with a file compressed with zip and derivatives. Those are based on a rolling dictionary window, typically with some sort of buffer-based compression of the most significant bits of the output codes on top of that. Bottom line is that a particular sequence of bytes in a zip file is meaningless without context.
If you want to be able to randomly read a particular record out of a compressed file, you have to compress each record independently and then have an index into the file. Depending on your data, this would probably render the compression step worthless.
Answer: Pretty much all compression algo I know work in block mode, meaning a random seek isn't possible. Even LZMA which doesn't use an initial dictionary requires sequential decompression.
Stream compression means usually an adaptive lossy compression with some key that reset state (or actually cut into blocks). Details are more complex.
Now here are a couple of ideas to solve this:

Create an index: Like when you open a ZIP you can see all files in it
Cut your compressed file into blocks and then use a binary search within each block (similar actually to the first one)
Decompress in memory but actually discard any data until you found the beginning of the data you're looking for.

The last way is good for small compressed files, and the block method is good for larger compressed files. You can mix the two.
PS: Fixed with in the input, doesn't mean the compressed file will be fixed with. So it's a pretty useless info.
Answer: Building on what Wernight said, you can split your file into many fixed size subfiles before you gzip it. Your binary search can start by searching for the subfile that contains the range, then it will only need to decompress the small subfile rather than the whole thing. You can optimize by creating an upper-level file in the archive that contains the first row of each subfile.
Answer: Continuing on what Liudvikas Bukys says: If your compressed blocks have an unique header, you don't need the index. That's similar to how seeking in some compressed video formats is done. You seek to a point and look for the next header. This does need robust validation (using a checksum) though, as mis-identification is possible.
Answer: what you want is seekable compression; the dict server has dictzip which is format compatible with gzip as it stores it's seektable in a gzip extension in the header and sleuth kit has sgzip which isn't as it stores block lengths at the beginning of each of the blocks


Can I drive a Solid State Relay directly from GPIO?

Question: I was thinking of using my Raspberry Pi to control a switch (control a lamp, for instance).  I have a traditional (electromechanical) relay, but I know I will need to use an external transistor and power source to drive the relay.  My question is, does the Pi have enough power to directly drive a Solid State Relay?
Answer: Pi can drive a solid state relay directly without any issues.They are made to be operated directly from the pins.They are completely isolated and so won't damage the pi.
Most solid state relays I have seen work on input voltages of 3-30V and so should be fine.
Hope it helps.
Comment: Do you know what the current draw on a solid state relay is? Keep in mind that the GPIO of the Pi is only really rated for like 16 mA.
Answer: That should be fine.
A word of caution: If you drive physical world things like lamps, heaters, door locks and such, you'll take great care to avoid software errors, system shut down, power-ups etc. to inadvertently switch on these this.
Or you may find a (big|bad) surprise coming home.
Answer: I used a PiFace to connect to my Solid State Relays in the end.  When measured, the relays I had were drawing about 14mA, I have 5 (relays) so was over the 50mA total GPIO limit.  At the end of a cable run, I was also only just getting above the necessary 3v to switch them.
That said, it did seem to work fine from the GPIO, even with all relays engaged.  I guess there is margin in the 50mA limit.
I wasn't comfortable though, and had a PiFace anyway, so hooked up to that.  My relays seem to draw slightly less (12mA) at 5v from the PiFace, and work perfectly.  Also, when connected to the GPIO, a couple of the relays would switch at boot-up, they do not do that from the PiFace.
Answer: You can. HOWEVER this makes your Pi a critical system so you need to program it very carefully. If possible, use a secondary manual switch to engage the relays to the Pi after it booted up. Also, you may want to read about programming critical system software before actually doing that.


Cordless router in router table

Question: Are cordless trim routers compatible with any router tables?
Comment: That link will be dead in an internet moment, pretty much making this Question moot for future visitors. In general, model specific questions pretty much end up as "shopping" questions, which are off-topic here. This is the sort of ephemeral question more suited for a web search or a forum that is aimed at information that goes out of date fast (e.g., Reddit). Maybe see the [tour] to get a feel for what SE sites are all about.
Comment: That all being said, the answer to your question is probably "not officially". Plam routers don't often have table attachments. But a web search will confirm this.
Comment: Any router is compatible with router-table use if you make the 'table' yourself. I say 'table' because you don't have to make a formal table, full-size, mini or whatever — the simplest mounting for a router is just screwing it to the underside of a sheet of ply or chipboard, that you then clamp to the edge of a bench. That's it, literally. This is all some pros use, including the author of the iconic **Router Handbook** which was the bible on the subject for many years.
Answer: Probably. Trim router tables are manufactured and one or more would most likely fit this model. You could also fabricate a baseplate/mounting plate to make this trim router fit other, standard router tables if you're so inclined.
The real question is whether or not this router could handle the demands placed upon it when mounted to a table. You'll probably be happier with a corded router that has better power specifications and is built to use with a table.

Cordless router in router table


Smooth movement in a tile based game

Question: How can we make our character move smoothly across tiles? He moves tile by tile, but that looks unprofessional. In addition, when you hold down the arrow keys he zips across the screen. How can we prevent that from happening?
Comment: It's best if you reduce your code to the minimum required to demonstrate/communicate your issue/question.  Also, you might be interested in [this question](http://gamedev.stackexchange.com/questions/48227/smooth-movement-pygame/48795#48795).
Comment: I removed the unnecessary parts of your question. It's best to get to the point and not add additional code or other fluff.
Comment: You're using integers for player movement. Try using floats instead.
Answer: Smooth movement can be achieved in a number of ways. And it really depends on what kind of movement you want to allow.

Movement still restricted to tiles. This type is the easiest for doing things like collision detection and other movement checks. For this type of movement you'll simply be interpolating the position over time as you transition between tiles. It can be as simple as adding something like the following to the update loop.

Pseudo code:
 if(GetDistance(position, targetposition) > minDistance) {
     position = MoveTowards(position, targetposition, deltatime);
 }

Where MoveTowards just takes the current position and adds a portion of the distance between it and the target position.

Movement is not restricted to tiles. This gets a lot more tricky to implement. Essentially with this method you just store the position and update it via velocity. That is, change in position over time.

Holding down the arrow keys to move characters can also be implemented in a few different ways. Likely what you're doing is something like:
if(keydown(left))
   tilePosition.X--;

This would indeed cause the character to zip across the screen. Since you'd be updating the position many times per second. A bit better way to implement this would be to add a delay. Something like
if(keydown(left)) {
    if(leftKeyHeldTimer > movementDelay) {
        tilePosition.X--;
        leftKeyHeldTimer = 0;
    } else {
        leftKeyHeldTimer+= deltaTime;
    }
}

This will add a delay timer and only update the tile position when the movementDelay value has been met.
Answer: I can identify two issues. The first related to smooth movement and the second is related to the character zipping off screen.
To create a smooth movement, you can use a technique called Linear Interpolation or (LERP) to smooth movement. Basically how it works is between your starting point and end point you calculate a set of decreasingly small distances to emulate smooth movement and slowing down as the endpoint is nearly reached.
The simplest example of this function would be:
//point1 is the current position, will be starting position on first call
//point2 is the target position
//epsilon is the % of the distance between current and target you want
//to cover per game physics loop (a fixed realworld time based loop).
//The smaller the % the "smoother" the motion.

float lerp(float point1, float point2, float epsilon)
{
    return point1 + epsilon * (point2 - point1);
}

As the character moves closer to point 2 it will gradually slow down. Note though they will never actually touch point 2 but get infinitely close. You would need to correct this and if the player is less than an infinitely small distance from point 2 we can consider the player being on point 2.
The second issue you mentioned is related to your character flying offscreen. This is a result of the input being read every game loop refresh combined with the instant movement between tiles.
Ideally to solve this, in your code you need to decide

How much realworld time it would take for the character to move from point 1 to point 2.
Set your Lerp to run between point 1 and two over this duration
Read input again once point 2 has been reached to decide where to go

Smooth movement in a tile based game


Unlock a Bitcoin-qt wallet

Question: How do I unlock a bitcoin-qt wallet? I know my passphrase and all.
It says that my wallet is encrypted and locked for now so how do i unlock it?
Answer: To unlock your wallet:
Option 1: Introduce password in prompt that opens when you send coins
Option 2: Console (Help > Debug window > Console)
Type the following:
<code>walletpassphrase "passphrase" timeout
</code>
Where passphrase is your password and timeout is the number of seconds you want the wallet unlocked (i.e. 120 = 2 min). This is option is the only one when you want to do something that requires unlocking but you don't want to send coins (like dumping a private key) or when you plan to leave the wallet open and fear forgetting to lock it again.
Answer: It unlocks when you need to spend.  If you try to send money to an address, it'll ask you for a password.  You don't need a password to receive bitcoins.

Unlock a Bitcoin-qt wallet


How many graphs are there on 4 nodes with degrees 1, 1, 2, 2?

Question: I know just the basic operations on graphs using Mathematica. But I want to know how to write a code that prints all the possible combinations of a graph with a specified number of edges.

Take for example:

How many graphs are there on 4 nodes with degrees 1, 1, 2, 2?

I know the answer mathematically is 12, but I want Mathematica to print these combinations.
\Please help me and explain to me how can I write the code.
Comment: Hint: Since you only have four nodes, could you imagine building a table where each entry is a list of whether or not each node is connected to each other node for every possible graph? Could you check that table has the correct number of entries? And then could you think of a way of discarding entries in that table that do not have the appropriate degrees? Is the number of entries that remain what you want to know? And is that number equal to 12? Does this hint make the programming problem more concrete so you can make some progress on doing this?
Answer: I had an old program lying around that will generate all realizations of a degree sequence. The first vertex will have degree equal to the first element in the input list, the 2nd degree equal to the 2nd element, and so on.
The program requires my IGraph/M package for graphicality testing.
For details on how it works, see http://bolyai.cs.elte.hu/egres/tr/egres-11-11.pdf

The answer here is trivial: there are only two realizations, which are isomorphic. They have an automorphism group size of 2 (they are symmetric to reflection, see also IGBlissAutomorphismCount). Thus not all 4! = 24 permutations of vertices create distinct labelled graphs, only 4! / 2 = 12.
What if the degree sequence is a bit more complicated?
degSeqGraphList[{3, 3, 2, 2, 1, 1}] // DeleteDuplicatesBy[CanonicalGraph]

There are now 5 non-isomorphic realizations:

There have different automorphism group sizes:
In[]:= IGBlissAutomorphismCount /@ %
Out[]= {8, 1, 4, 2, 4}

There are 6! permutations of vertices, but many of these generate the same labelled graph. We can compute the total number of graphs like this:
In[]:= 6!/%
Out[]= {90, 720, 180, 360, 180}

In[]:= Total[%]
Out[]= 1530

The code for generating all labelled realizations of a degree sequence:
Needs["IGraphM`"]

removeZeros[list_] := TakeWhile[list, # != 0 &]

iter[ds_, vert_] :=
 With[{pos = Position[ds, 0]}, {Delete[ds, pos], Delete[vert, pos]}]

ClearAll[exactGen, list]; (* list is an inert head *)

exactGen[{}, edges_, _] := edges
exactGen[degseq : {d_, rest__}, edges_, vertices_] /; IGGraphicalQ[degseq] :=

  Module[{ds = {rest}, temp, newDs, newVertices},
  Function[subs,
    temp = ds;
    temp[[subs]] -= 1;
    If[IGGraphicalQ[temp],
     {newDs, newVertices} = iter[temp, Rest[vertices]];
     exactGen[newDs,
      Join[edges, list @@ Thread[First[vertices] <-> Rest[vertices][[subs]]]],
       newVertices],
     {}
     ]
    ] /@ Subsets[Range@Length[ds], {d}]
  ]

degSeqGraphList[degseq_?IGGraphicalQ] :=

 With[{verts = Range@Length[degseq]},
  Graph[verts, #, VertexLabels -> Automatic] & /@ List @@@ Cases[
     exactGen[degseq, list[], verts],
     _list,
     Infinity
     ]
  ]

Comment: Thanks. I appreciate your solution and your generalization.
Comment: @Szabolcs I have found a software gradpart based C++ (http://www.mathe2.uni-bayreuth.de/thomas_g/gradpart.html) that can quickly generate non-isomorphic graphs with a given sequence of degrees, but since the code is from the last century, I have some problems when I `make` it, and I don't know whether this software will be updated and maintained later.
Comment: I have just posted a question on the MathOverflow: https://mathoverflow.net/questions/439304/is-there-a-program-implementation-for-generating-all-non-isomorphic-graphs-with
Answer: 4X4 adjacency matrices:
am = Tuples[{0, 1}, {4, 4}];

4X4 adjacency matrices with no self-loops:
simpleam = DeleteDuplicates[(1 - IdentityMatrix[4]) # & /@ am];

Adjacency matrices for undirected graphs on 4 nodes:
undirectedam = Select[# == Transpose@# &]@simpleam;

Adjacency matrices for graphs with vertex degree sequence {1,1,2,2}:
vdegree1122am = Select[Sort[Total[#]] == {1, 1, 2, 2} &]@undirectedam;

Counts:
Length /@ {am, simpleam, undirectedam, vdegree1122am}

 {65536, 4096, 64, 12}

Associated graphs:
AdjacencyGraph[#, VertexLabels -> "Name"] & /@ vdegree1122am // Column

We can get the 12 graphs more directly, by noting that two periphery nodes (nodes with vertex degree 1) can be selected in 6 ways:
peripherynodes = Subsets[Range[4], {2}]

 {{1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}}

For each pair in peripherynodes the remaining two nodes can be ordered in 2 ways:
interiornodes = Permutations[Complement[Range[4], #]] & /@ peripherynodes;

We combine peripherynodes with associated interiornodes to get the edgelists of 12 graphs:
edgelists = BlockMap[UndirectedEdge @@ # &, #, 2, 1] & /@ (Join @@
    MapThread[Flatten /@ Thread[{#[[1]], #2, #[[2]]}] &,
      {peripherynodes, interiornodes}])

Graph[#, VertexLabels -> "Name"] & /@ edgelists // Column

Comment: Thank you for the solution. The second method of obtaining the graphs is exactly what I did to obtain them mathematically, I considered (4C2) then (2C1) to obtain the final result, and I wanted to know how to implement this idea in Mathematica. So thanks!
Answer: A one-liner:
Length@Select[Graph /@ Subsets[EdgeList[CompleteGraph[4]]],
  Sort@VertexDegree[#] == {1, 1, 2, 2} &]

EdgeList[CompleteGraph[4]] will give us all the possible edges on four vertices, Subsets will give us all the possible subsets of those edges, and Graph will turn those into graphs. (When a vertex is isolated, it will not be included in the graph, but that's not a problem for us.)
VertexDegree gives the degrees of all vertices of a graph, so Sort@VertexDegree[#] == {1, 1, 2, 2} checks if a graph has the degree sequence you want.
We Select all graphs with that degree sequence, and then find the Length of that list.
(Like the accepted answer, this would be inefficient for large graphs, in which case Szabolcs's answer is the way to go.)
Comment: Yes, I can see that. But when I tried to solve it mathematically, I used the approach of Kglr in his second solution, where he used the idea of peripherynodes and interiornodes. Is this an efficient approach?
Comment: It's situational: it doesn't give a general algorithm for an arbitrary degree sequence. So it's hard to say how efficient this is, given that for this specific problem, all of these solutions work instantly.