text:
Q: Should Stack Exchange in general be awarding "A"s for Effort? This just came up again:

homework is not acceptable if the asker has made no effort whatsoever

I'm developing a bit of an involuntary twitch that manifests itself when I encounter the word "effort" on Stack Overflow these days.
Don't get me wrong — effort is good. At least, productive effort is good. But seeing the word thrown around so often without any qualifications makes me start to wonder if we're not becoming that teacher who punishes students for finishing their assignments too quickly by forcing them to sit motionless until the rest of the class has finished. That is, we're more concerned with seeing folks visibly struggle than we are with the results of their labors.
Surely the important goal here is the production of well-asked, well-answered questions, right? Not visible self-flagellation...
I've observed one other rather nasty manifestation of this attitude: folks flagging or voting to close straightforward "How can I do X using Y?" questions. These tend to crop up a lot when there is a new OS or API release, and when the documentation is lacking or incomplete they're often quite useful — but again, there seems to be this idea that because the asker didn't log 50 hours trying to re-invent the wheel first, the question is inappropriate — regardless of how clearly written or generally useful it is.
I was hoping to forestall this when we rolled out the new close reasons back in June, with off-topic reasons targeted specifically at poor quality questions asking for help debugging or writing code. "Describe a specific problem" they read, "Demonstrate a minimal understanding of the topic". I wrote those to mean, "tell us what you know, and what you need to know"...
...but every time I ask someone else to interpret them, I hear, "Oh, those are for questions that don't show enough effort".
I'm sorry, but... When I'm trying to solve a problem and searching for similar questions on Stack Overflow, I really don't care how much effort the asker demonstrates in his question. In fact, unless that effort translated directly into a clear, concise question that I can easily identify as being close to my own and then quickly scroll past to get to the answers, I'm rather resentful of ostentatious displays of effort.
Am I being crazy here? Selfish? Or are those of you throwing out "must demonstrate effort" left and right perhaps missing the point?

A: Stack Overflow is going the way of Usenet.
No, I don't mean that the quality is going down. I mean that the moderation of questions on Stack Overflow is focusing more and more on the effort made by the asker to conform to the group norms, and less and less on the goal of "collectively increasing the sum total of good programming knowledge in the world".
Stack Overflow sought out to "build a great library of canonical answers". A key characteristic of Stack Exchange, which distinguishes it from other forms of knowledge sharing on the web such as discussion groups and blogs, is that its tidbits of knowledge are searchable. We don't bury gems in 100 pages-long threads. We don't tell people to search the web, 'cause I'm sure this was answered back in '09 (or at least we shouldn't), nor do we answer for the 43278th time: we close the question as a duplicate of the '09 question. We edit posts to make sure they stay up to date. If someone comes up with a better answer three years down the line, we tell them to share their knowledge on the existing question. It's the "Wikipedia of long tail questions" — the Wikipedia of the non-notable. And we filter questions: we only want the answerable ones, not "how long is a piece of string" or "should I wear the blue tie or the green tie".
The answers… Stack Exchange is all about the answers. Questions are just an enabler. When you need to know something, you might search for a question, but the answers are what you're after.
And yet… asking a good question is hard. So we ask people to put effort in asking their question. We grant people brownie reputation points for asking, albeit half as much per upvote as for answers.
I've sometimes wondered if halving the reputation for questions had been the right decision. I find that writing an answer is for the most part straightforward: 1. understand the question; 2. gather the facts; 3. find a solution; 4. explain. Asking a question is less forgiving: did I provide all the necessary background? Am I stating all the relevant facts? Have I not bogged down the question in unnecessary detail? Am I targeting the right audience? Have I sufficiently oriented the question so that I won't get inapplicable answers, yet not so much that I'd drive off non-obvious solutions? Reputation should in principle be an incentive to write good questions, like it is an incentive to write good answers.
Then again, what do askers care about reputation? By and large, askers don't want reputation¹. They want answers. So maybe reputation isn't so important an incentive anyway. Score is, though — a high-scoring question is more likely to attract answerers, and thus answers.
However score isn't such a good indication of a good question. A good question must be answerable, and score doesn't really indicate this. Plenty of well-written questions are unanswerable — because they're too subjective, too broad, off-topic, etc. Fortunately we have another tool to judge questions: closing. Closing determines whether a question is answerable.
Closing is clearly of value to the community — it's what determines whether the topic calls for answers, for those slices of knowledge that the site is about. Answer score has an obvious use in showing the good answers from the bad. What about question score? Question score has two major effects:

*

*The effect on the asker: the votes on a question factor in the asker's reputation.

*The effect on the community: the score on a question determines to some extent how much attention it gets.

If the asker's goal is aligned with the community's, then all is well: the asker wants answers, so the asker wants attention, so the asker wants a high-scoring question. But often there's a drift. Upvotes on a question are seen as a reward, and downvotes are seen as a punishment. Put effort into the question, get an upvote. Show no effort, get a downvote.
Yet the amount of effort by the asker is not a good indication of a good question.
If I spend a week debugging a 1000-line piece of code, and post it on Stack Overflow in desperation, that's a lot of effort². I may show my analysis, explain all the investigation steps I've taken… and the result will still be an ad hoc exercise in finding the needle in a haystack, useless to anyone else because no one else has exactly my code. On the contrary, a copy-paste of a homework or book exercise is the epitome of laziness³ yet is likely to be useful to many — well-designed homework exercises teach something, and building a canonical repository of solutions to exercises would be in fact a worthwhile use of Stack Exchange.
I've written thousands of answers on Stack Exchange, and I don't think that my most useful answers correspond to the best questions. In fact, detailed, researched questions often have a frustrating trait — they're buried in details that turned out to be irrelevant, which makes them poor duplicate targets, which makes posting detailed, canonical answers a waste. The most useful question for a canonical answer is one that gets to the point quickly and doesn't meander into side issues.
Over time, when a poor question has a good answer, one of two things tend to happen. Either the question gets closed, which is a waste of a good answer; or the question is improved, and thereafter upvoted (because it's now good), and the correlation between its score and the effort by the original asker is lost. Closing the question is detrimental to the community: the right thing is to forget about judging the asker and judge only the question.
When closing starts to be about effort, this does the community a disservice. Voting on questions is supposed to be about effort; closing is supposed to be about answerability.
One of the custom close reasons on Stack Overflow is "Questions asking for code must demonstrate a minimal understanding of the problem being solved." One of the custom close reasons on Security is "Questions asking us to break the security of a specific system for you are off-topic unless they demonstrate an understanding of the concepts involved and clearly identify a specific problem." I like these close reasons: in essence, they say "if you're so out of your element that you wouldn't be able to understand the answer, let the grown-ups talk". There's no point in answering when the asker, or future visitors with the same question, wouldn't benefit from the answer. Unfortunately, on Stack Overflow, the close reason is often interpreted as requiring effort from the asker. No, that's not it. The asker may be trying very hard just to post that question, but if he's too far out of his depth, the question is useless. Conversely, the asker may have spent 30 seconds asking how to undo a mistake, and yet it's such a common issue, and fairly easy to fix, that this tidbit of knowledge is widely useful.
On a forum, when you write an answer, you're helping the asker individually. You don't want to waste your time on a lazy, demanding asker. On Stack Exchange, you're helping everyone with the same question, now or in five years' time. In five years, the amount of effort shown by the asker will be utterly irrelevant. What will matter is how many other people have found your answer useful.
Effort is a terrible thing to factor into question closure.
The problem you discuss in your question is real, and worrying. By insisting on effort, the Stack Overflow community is moving away from the goal of building a canonical repository of answers, and more towards being a forum with peculiar habits. But the question in your title is not the right one. We shouldn't be basing so many judgements on effort. Effort is the wrong problem.
I read the first couple of paragraphs and skipped your rant. Are you going to propose solutions or what?
That's a tough one.
When I started participating on Stack Exchange, I didn't see much point in downvoting questions. Either a question was answerable, or it should be closed. If the question was well-written and interesting I'd upvote it. Then gradually I started to want to convey a message that this question is bad and you should be ashamed. Because, yes, there are plenty of bad questions — not merely off-topic or ill-suited for Stack Exchange but what the hell are you on. Downvote.
Yet I often face the duality of the question score. If a lazy, badly written, poorly researched original post leads to a great answer, the question should be improved. We should downvote the asker but upvote the thread. Does that mean we should downvote or upvote the question? This dichotomy is very common.
Sorry, I'm falling back into rambling mode. Ok, so despite not using regular expressions, we have two problems.

*

*Our primary problem is to build a great library of canonical answers.

*Our secondary problem is to keep a decent signal-to-noise ratio on the demand front.

To solve our primary problem, the score of a question must indicate how useful it is. To solve our secondary problem, the score of a question must indicate how much effort went into it. We're back to this: question scores can't make up their mind whether they're rating the thread or the asker.
If it was only for problem #1 then we could do away with question score. We could even go further and do away with question ownership. What matters is the answers, so the question should belong to the community! Edit, edit away. Make each question awesome.
However I don't think this is realistic. Answering is hard work, we can't answer everything, we need quality control.
We could separate the two scores: have a score for the original question (contributing to the asker's reputation), and a score for the current state of the question (contributing to the thread's rank in searches). But maintaining two scores would be awfully complex. These scores would start out identical and gradually diverge over time as the question is edited. This system would be too hard to understand.
So I don't have anything radical to propose. Let's stick with the statu quo, with the schizophrenic question score. It's not too bad as long as we remember to distinguish score from answerability. Effort is a big part of question score. But it should not leak into closing.
Closing is all about answerability. Closing isn't about the asker, it's about the community. "No effort" is not, should not be, must not be a reason to close.
Answering no-effort questions is not "awarding 'A's". Answering is imparting knowledge to thousands of people, of which a measly one happened to ask the question.
Stack Overflow needs to stop worrying about effort and learn to love the answers.
¹  Answerers aren't always after reputation either, but I think they're pretty much universally after positive attention, whether this attention takes a numerical form or not.
²  I should cite an example at this point, but I'm sure you know what I'm talking about.
³  Ok, not quite. It's trumped by a scan of a homework exercise.

A: Consider this flow. Someone posts a crap question. Someone else sees a kernel of internet usefulness in it, edits the question into shape, answers it. Who gets the rep, and subsequently the trust to push moderator buttons? The original, well, depositor. This is, from some sort of cosmic fairness standpoint, a reason to want to close rather than downvote.
What if, instead, we had no close votes? Any question that got a negative score and stayed there for a few days would, well, disappear. The justification is as follows: we want to remove the clutter of crap.
How would posters know what to fix without close reasons? Well, there are comments.
How would we get rid of spam? With flags.
In short, Shog's logic seems to lead in the direction of: if you think that this question is not going to lead to a better internet, downvote it. The site will take care of the rest.
As I read the traffic here, that leaves one bit of sociology. Help Vampires, we hates them. Many people 'round here, and I'm amongst them, get steamed by the spectacle of people trying to get something for nothing. Even if their question might become a popular internet resource (for other vampires?), we don't want to enable students to cheat their teachers and themselves, or people being paid to do a job to get away with gross ignorance. And we don't want them accruing rep.
The 'demand effort' department is, thus, part of the social contract. Some of us are willing to write answers if we can feel that we're not being suckered into doing other people's proper work.
The 'just downvote' system handles this. I'd downvote rather than answer.
What about the tendency of the unwashed masses to deliver scads of upvotes to crap questions? The 'close vote' system's 'giant downvote' is a way for people who have rep to outvote people who don't have rep.
Well, gang, if you like that, why not admit it, and make it explicit. Give people bigger downvotes as they earn more rep. And, as before, eliminate close votes.

A: For me it is really simple. I like answering questions if I think OP can (and wants to) learn something from it. If someone just wants code or debug a huge block of code (and therefore wants to abuse me as a free code monkey), it's not worth my time and energy trying to make an answer. It doesn't matter if OP knows anything about the subject, but from the nature of the question you can tell if

*

*Someone wants to learn something from it

*Someone will be able to understand your answer

Showing attempted solutions can or cannot be useful in a question. If the question is very simple, and the answer is very simple it is probably not needed to "show effort". If the question is confusing, because OP doesn't understand what the problem is, it requires a lot of effort to produce a correct (and useful) answer. Showing effort in that case means "I did everything I could to make the problem as simple as possible for you". The answer to a question should not take significant more effort than asking the question itself.
Should a question showing 'effort' be rewarded somehow? I don't think it should reputation-wise or something like that. Questions that show less effort than it takes to answer them should however be closed. What is 'effort' (or enough 'effort') should be judged on a case-by-case basis.

A: I've been conscious for some time of the fact that demanding that the question asker show their working can sometimes prove counter-productive. The trouble is that if the question asker has set off down completely the wrong path, then their description of their efforts so far is just noise.
For example, consider this edit of mine:
https://stackoverflow.com/posts/7092613/revisions
Leaving aside the stylistic and grammar fixes, most of what I did in that edit was removing everything the question asker had written about what they'd tried so far. And that made it a better question, at least from the 'body of knowledge' perspective, since it's now more succinct and easier to read, and doesn't distract the reader with an attempted solution that was totally misguided. I make many edits like this, that essentially just strip bullshit out of questions to reduce them to the shortest form possible that provides all necessary information, because that's what I expect to be most useful to future visitors.
Unfortunately, I fear that if it had originally been asked in its current form, it would have been downvoted and hit with "What have you tried?" comments.

A:
Should Stack Overflow be awarding "A"s for Effort?

No.
Effort doesn't make a question a good question or a bad question. Someone who doesn't know how to debug their code won't be able to ask a good question. They may put forth a lot of effort in writing the question and providing details, however, if they can't debug, chances are their problem is simply a logic issue or a typo, resulting in a question/answer that is useful to only 1 person that will then never be used again, making it not useful. These kinds of questions used to get closed as too localized.
Examples:
Jquery prepend html syntax error " and '
Very common inner quote issue.
hidden element isn't shown by jquery
Duplicate id.
Add a speed paramater to the jquery plugin "Shorten"
Modifications to a plugin that isn't being maintained by it's author.
How to get all divs of a certain class and add innerHTML
Using a non existent method, doesn't know why it doesn't work.
The first two are just very common questions that come up and get answered several times a day. the third is someone asking for us to make modifications to a plugin for them (This question is actually a good question, it just would have been nice if he would have at least tried.) I don't even know what to say about the fourth question, he can't even see that there are errors happening on his page.
I don't think effort really applies in most cases. Either the person debugs the issue and creates a great question, or they don't and it's a poor question.
Someone who knows how to debug properly will generally include some of that debugging in the question itself, and if they don't, they will when we ask for it. I think lack of debugging skills is 90% of the problem. Answering a poor question anyway simply bypasses the problem, resulting in more poor questions. I rather try solving this problem than contribute to it by answering these poor questions.

A: It's not about Effort. It's about Respect.
The line I draw for moderation is based on the probability someone will say, "Try X" and the OP will respond, "I already tried X". To which the person will inevitably comment, "Try Y" and the OP will then say, "But I already tried Y!" (without having it in their question originally).
It all comes down to respecting the time of people who answer. If a question doesn't show that respect, I'm more likely to downvote it or to close it. It's not about effort, it's about respect.
You can show almost no effort towards solving the problem yourself but if your question respects other people's time, it's fine.
Examples of questions that do not respect other people's time:

*

*"{{text of assignment}}: Need answer"

*"{{A and B}}: Benchmark this for me."

*Complete sum of problem is a vague, "It doesn't work. Tell me why."

An example of a Question that shows no effort but respect other people's time:

*

*"I'm trying to filter two properties in angular JS, the filter documentation (link to it) doesn't make it clear how to filter on a property. The example doesn't even show what I'm looking for. Using the following code ((text of code)), how do I filter on an inexact match of this property?"

Sometimes people conflate Effort with respect.  Showing effort is one way to show respect, but certainly not the only way.  Your original text of 'minimal understanding' comes close to what we're trying to get out of a user, but I feel like the text should actually say (something to the effect of):

Questions asked on Stack Overflow should respect other people's time.  Showing respect is pretty easy: Take care to spell out your problem, use punctuation, format your code, and tell us exactly why something isn't working.  Saying, "It's not working" without being more specific forces people to spend precious time they could be using to help you to get more information so they can help you. You don't need to spend hours trying to solve the problem yourself before coming to us, but we do ask that you write your question with other people's time in mind.

A: I would like to distinguish between effort in formulating the question and effort in solving the problem. When I want to kill a post, it is mostly for a lack of the former.

A: The wording could perhaps use some improvement. Because it is so vague, everyone has their own interpretation of it.
For me, I view it as what I was told it would be for when the reasons were first brought up. When someone is directly requesting work in its entirety be done for them. To me it is the goto "help vampire" close reason.
Is this correct? I am not sure, but I am fairly certain no one really feels like turning in other people's homework assignments or re-inventing the wheel for them.
By the way, how would I write something like facebook but with more content in php? A+ please, I look at facebook all the time.

A: Visible effort is entirely beside the point.
If it's a good question -- one that might get googled, or others are likely to benefit from reading / learning -- then who cares how much effort the poster put in?
The question has to be clear and answerable -- and toward that end, some folks are better at asking questions than others; I've seen a lot of helpful comments try to nudge the poster to ask the question in a better way.
As for respect (for the answerer's effort) -- again -- beside the point.  Not even Rodney Dangerfield could figure that one out.  If it's a good question...great.  If it's not, you can help to improve it, close it, or ignore it.  Mundane, anticlimax -- as Kermit and Fozzy would say -- 'Movin' right along...'

A: What is wrong with answering a (simple) question instead of commenting: "try google", downvote the topicstarter and get 10 upvotes for that comment. Who's not showing any effort in this case? :)
Usually 9 out of 10 googles about code lead you straight back to stackoverflow.

A:
Surely the important goal here is the production of well-asked,
  well-answered questions.

Agreed.
So a follow-on question:

Are we producing well-asked & answered questions which are accessible
  to the public?

When I ask google to help me find the answer to a programming problem, google often directs me towards Stackoverflow.  The quality of the first SO answer that google directs me to is often "good" (subjective opinion of mine).  Sometimes google's first SO answer is inadequate, but usually one of  the next few SO answers is "good".  I suspect that google directs towards "good" SO answers because those answers are visited more often.
Anyway, my point is that google does a good job of filtering the "bad" questions out of SO requests.
In my experience, Yes… we produce well-asked & answered questions which are accessible to the public.
In spite of a great quantity of "unworthy" questions, SO "distributes" well-asked questions with answers.
Now more to your question.
Some SO questions show ineffective effort:

*

*Homework where the well-asked question is really asked by the teacher without effort by the student,

*Code copied from a blog post plus the question of "How can I do [whatever] with this blog code"

*"Here's my great idea in detail without code, please do all the coding entirely for me"
On my more-patient days I comment the questioner requesting a better question.  On my more-impatient days I vote to close the question.
There is one class of ineffective effort question that I take the time to answer:
"I'm new here and I have only a few reputation points and I want to learn how [whatever] works".
Sometimes the questioner may not be far enough up the learning curve to even ask an effective question.
In this case, I don't mind taking time to bring the learner up to speed with a well-answered response.
I personally believe that a second important goal is to give help to those who "intend" to put in effort but who can't muster up a well-asked question. ("Help will always be granted here at Hogwarts for those who ask—and are willing to put in present or future effort")
It seems to me that answering these type of "willing to learn" questions eventually helps SO by giving the inexperienced questioner a chance become an experienced answerer.

A: I agree that effort in any form should be recognized. At the same time though, many users will ask a question on Stack Overflow simply because they don't know anything about the topic and actually aren't able to put in "effort" because of their lack of knowledge.
The demand for effort in a question portrays Stack Overflow as not being a good first resource, because it implies that the OP MUST have some former idea of the concept and have displayed that. I think that that shouldn't be the case, but at the same time, there has to be some standard on questions asked. There does seem to be a good standard in place and relatively easy-to-follow guidelines for question asking, but isn't clear exactly what the minimal "effort" required for a question seems to be. CUrrently, that seems to be determined by the community when they read a question and immediately post "Please see how to ask a question Here" or "Please do some research into the topic first."
My understanding of Stack Overflow is that it both is and isn't a place where answers can be doing the effort for the users, depending on the situation. The threshold for whether a question displays enough effort seems to arbitrary sometimes and other times obvious. Anyway, that's just what I think.
In terms of the title of this post, how would the "A"s translate into something tangible? Most people would assume reputation points, but what if a separate system could be implemented, that would update concurrently to regular reputation points? That could allow the user to achieve recognition for their "effort," but not go overboard to achieve reputation points. It could even be a track of badges that might eventually reward the OP with reputation points after 5 or so.
What do you think?

A: I think part of the trouble is that the system rewards answers to bad questions. If a Help Vampire (like the term, haven't heard it before!) posts a question with no code for example.
Not wanting to shoot-down a new user, you might comment to prompt him — 'What in particular do you not understand?', 'Can you show us the code for X and we'd be better able to help you', etc.
In the time you're adding your comment, or maybe cleaning up the formatting of the question itself, another user, Fred, has posted the complete solution to the question. Let's say this gets upvoted & accepted by the questionner — that's 25 rep points to Fred.
Fred has recently just joined & wants to increase his rep quickly to unlock more features of the site. This question was brilliant! He knew the answer off the top of his head & gained (at least) 25 points in 2 minutes.
& now we want Fred to start down-voting these questions — instead leaving comments or editing them? Why would he do that, when he can find similar questions & watch his rep rocket up?

I know we say that reputation isn't a measure of how good you are, it's how trusted you are by the community. The trouble here is that

*

*New users don't necessarily take that on-board.

*Fred should be less trusted by the community rather than more at this stage — he's adding to the problem.

Solution (?)
Why don't we use the question's score as a multiplier to the rep gained from an answer? E.g.

*

*A question is ranked <0, answerer gets 0 rep

*A question is ranked 0–10, answerer gets normal rep

*A question is ranked 11–100, answerer gets 1.5x rep

*A question is ranked >100, answerer gets 2x rep

The particular numbers above aren't important & would have to be weighed correctly, but it would actively discourage what at the moment is far too prevalent — answering bad questions for the hope that the questioner will upvote, even if it's useless to everyone else.
If answering a bad question was pointless, people wouldn't jump in to do it. & the reason we've so many bad questions, is that the questioner knows this too — they could put in effort and form a proper question, but if they don't bother, they'll still probably get the answer they're looking for before the question gets closed.

A: As per Stack Overflow,

Stack Overflow is a question and answer site for professional and
  enthusiast programmers.

Having said that, any question on Stack Overflow (part of Stack Exchange), I believe, is expected to be related to programming.
Regarding the question on homework or in fact work-related questions, there may be a few reasons why a question is asked.

*

*Logic/pseudocode {not programming code related} [primary solution to the task]

*Error or exception during run

*Configuration issues

*Lack of documentation/sample for APIs

*Better or elegant solution (use of libraries, API, and tools)

*Inconsistent/Unexpected behavior

*Performance, etc.

Before we ask a question, it would be great if we have the answer to 1. For all other below, it may not be irrelevant to ask questions, even if it might seem of less research. As someone mentioned, we shouldn't be reinventing the wheel.
I have seen posts where people ask/comment: "Don't you use Google?"
Yes! People do. And they still may ask a question because they believe that answers on Stack Overflow are more credible rather than some random blog posts or incomplete documentation.
Also recently, on Google, if we search for any programming-related questions, Stack Overflow is one of the first links with relevant information. So it would be great if we build a database of good questions. Good necessarily doesn't mean not simple or not straightforward. It may mean something which is unique and can (or in future may be) searched for.
The only thing, we may need to follow is to ask a question as cohesive as possible; like just sticking to the point of issue/question. Also, presentation (including good formatting) matters to get good attention.

A: Unfortunately, a great many questions I see are simply:
"I copy/pasted some code from somewhere and it doesn't work - please give me working code"
It comes under a lot of guises, but it often boils down to this. The OP isn't interested in making any effort because he isn't interested in the problem - he just wants to finish so he can get paid and go home. I'm sure we've all encountered cases where OPs have actually become somewhat surly with others who are explaining the solution but refusing to provide working code samples.
Showing some effort doesn't even require a basic understanding of what you are trying to do. It could even be simply writing your question clearly, or explaining how you think something works, or merely saying, "I have no idea how X creates Y - can someone put me on the right track so I can follow up on my own?". "Showing some effort" is a little bit like Art - you know it when you see it.
Most (many? some?) of us here are interested in teaching and nurturing, not just providing free labor. When we ask the users to "show some effort", it is both to ensure ourselves that we have a willing learner, and to teach the OP the early steps of how to investigate the problem for himself.
My answer assumes, of course, that we aren't simply trying to make a giant repository of answers to every question. I'm in the wrong place if we are.

A: Quick point. This is a bad question with no research effort and does not show the slightest nugget of effort:
Convert int to string?
Should it be closed? It's been viewed nearly 100,000 times and is the first result in google when you search for convert int to string c#.
Questions with no effort can be very useful if someone else needs the same piece of information

So if bad questions can be useful (maybe) a duplicate of a bad question is really, really not useful.
This for me raises another point, I see a lot of bad questions that already have a perfectly good answer in the system. I also see people making a lot of points by reiterating the same answers to these questions over and over again.
And why not, the system rewards answering a duplicate but it does not reward finding the duplicate and flagging it as such?

A: Often, when people put a bit of additional effort into solving their problem before they come to SO, they will find the solution without even needing to ask, because the answer already exists somewhere else.
That's the kind of behavior we're trying to encourage.  It, in theory, reduces our workload.

and the show more effort line that many people give is mostly talk anyway.
If a question is

*

*clear enough to understand

*concise enough to post a brief solution to

*and interesting enough for future users to take utility from

it will be well received, regardless of how much effort the poster actually has shown toward solving the problem himself.

A:
Surely the important goal here is the production of well-asked, well-answered questions, right? Not visible self-flagellation...

When I ask for effort, what I'm really looking for is a starting point, some context for where the problem actually exists. So many XY Questions are easily answered by seeing a code sample. Without that, it's like trying to diagnose engine trouble over the phone... even the expert Tappet brothers end up divided over the problem (much more the solution).
The average no-code-included question I see is so vague that nearly every answerer invents a completely different context into which they can inject their awesome knowledge. It's like a rorschach test... you see nails if you've got a hammer, or screws if you've got a screwdriver. Answering becomes a crapshoot... who can guess the OP's actual problem? In the meantime, considerable effort is expended in the comment sections of the question and answer trying to define the OP's actual situation (and what they want). This is effort that could have been used answering one or two other user's questions, had the question been asked clearly in the first place.
Basically, in my opinion, you can't have a well-asked question without some effort and, more often than not, some documentation of that effort.

folks flagging or voting to close straight-forward "How can I do X using Y?" questions. These tend to crop up a lot when there is a new OS or API release, and when the documentation is lacking or incomplete they're often quite useful

This is largely answered by the above, but a single statement by the OP to the effect of "I looked in the documentation [link] and can't find an adequate answer" will, in every case I've seen, result in upvotes and answers. Without that, every reader is forced to go look at the documentation themselves, wasting time and effort. Some just vote to close.

unless that effort translated directly into a clear, concise question that I can easily identify as being close to my own and then quickly scroll past to get to the answers, I'm rather resentful of ostentatious displays of effort.

I've seen plenty of questions which include long blocks of code in an attempt to display "effort". I agree that this is annoying, and I don't accept these as evidence of effort. To me, "effort" is defined as having worked intelligently toward a solution, not just brute exertion. Like target shooting, I'm not interested in someone who has blindly fired off 10 shots and nothing hit. I'm interested in someone who made the effort to line up the shot, but missed. That's someone I want to help.
More important than the worthiness of the asker, though, is the quality of the site as a whole. Asking the OP to show a minimal amount of work helps to produce clearer and more useful questions for other, future readers. Without some effort on the askers part, the site becomes cluttered with questions that are either simple, uninteresting duplicates; or questions that are so extremely specific as to be useless to other engineers. It is for the benefit of the site as a whole, as well as the OP, that we should be asking the OP to show us what they've tried and where they're stuck.

I'll also add that effort leads to much more interesting questions. If you make a habit of stopping and asking every time you meet the slightest resistance, your questions are not going to be very creative or well thought out. But if you are decent at what you do and have put in considerable effort to achieve some result and are still having trouble, well then by golly you may just have an awesome question. Awesome questions lead to lots of rep, high page views and, for Stack Overflow, increased ad revenue. That's good, right?

A: Shog, you're attacking a straw man here. You should know better than that.
Folks aren't looking for "effort" because they think displays of struggle are some sort of magic pixie dust, able to turn a terrible, useless question into gold. They're looking for effort because the lack thereof is the most blatantly obvious hallmark of the thousands of terrible, terrible questions asked every day on Stack Overflow.

*

*Lack of research effort leading to countless duplicates.

*Lack of effort describing the problem, leading to unclear and misleading questions.

*Lack of presentation effort, leading to hard to read questions.

When I pick a question at random off of the list of the newest, there's a pretty good chance that it sucks. And while I may not be able to describe what the author needs to do to fix it, I can sure as shootin' identify what he didn't do... and that all boils down to a lack of effort.
Maybe your lazy teacher just doesn't want to spend time grading yet another half-assed exam, and hopes that by forcing the student to sit there he'll be forced to put some more thought into his work purely for something to do...
Of course, as understandable though that may be, it's also naive. "Show more effort" is terrible guidance, as the number of questions with "effort" in the form of long, pointless code listings demonstrates. JDB nails it: we don't want to see "effort" so much as we want context!
Show your work
Geobits points out that a better analogy here are those "show your work" marks your teachers used to leave on your math homework.
When a good teacher imposes this requirement on his students, it's not about proving that they've put effort into the problems they've been asked to solve - it's to establish what they know so that he can teach them what they don't. Assuming your students understand the basic concepts involved is dangerous - if you're wrong, they may be too far behind to catch up by the time you find out. By showing their work, you're able to see exactly where they went wrong, and address the specific problem.
The same thing applies on Stack Overflow. And just as there are annoying, time-wasting teachers who demand to see long division next to the solutions to algebra problems, there are annoying people who demand to see "what you've tried" for questions where the only sane answer is "nothing, because I don't know what to try - that's why I'm asking!"
A minimal understanding
There's a famous interview with Richard Feynman, where he was asked the perfectly reasonable question, "how do two magnets attract or repel each other?" To which he responded,

I can't explain that attraction in terms of anything else that's familiar to you. For example, if we said the magnets attract like if rubber bands, I would be cheating you. Because they're not connected by rubber bands. I'd soon be in trouble. And secondly, if you were curious enough, you'd ask me why rubber bands tend to pull back together again, and I would end up explaining that in terms of electrical forces, which are the very things that I'm trying to use the rubber bands to explain. So I have cheated very badly, you see. So I am not going to be able to give you an answer to why magnets attract each other except to tell you that they do. And to tell you that that's one of the elements in the world - there are electrical forces, magnetic forces, gravitational forces, and others, and those are some of the parts. If you were a student, I could go further. I could tell you that the magnetic forces are related to the electrical forces very intimately, that the relationship between the gravity forces and electrical forces remains unknown, and so on. But I really can't do a good job, any job, of explaining magnetic force in terms of something else you're more familiar with, because I don't understand it in terms of anything else that you're more familiar with.

Without communicating what he already knows, the asker creates a prohibitively difficult task for the answerer... He must assume a certain level of knowledge in order to answer, but if he gets it wrong he will waste both his time and that of the reader. The preferable option is to assume that the asker knows nearly as much as himself, as this greatly reduces the amount of background information that must be conveyed - but if he does this and the asker returns confused, his efforts were wasted - and indeed, the more likely scenario is that the asker's knowledge is far less than his own, since otherwise he would've probably solved the problem on his own.
Therefore, it is best for everyone if the asker holds a minimal understanding of the problem domain when he asks his question. If I can assume, when encountering a question on changing fuel injectors, that you know how to use standard tools and take basic precautions around gasoline, I can provide a much more direct, useful answer - likewise, if you're asking how to shuffle an array using C#, I should be able to assume that you know how to use the language itself, are familiar with the basics of the standard library, etc.
So, how does one identify an asker who lacks a minimal understanding? Well... First off, it requires that you have a minimal understanding of the topic. If you have zero knowledge of the subject matter, you're going to do a pretty poor job of identifying questions that experts on the topic will struggle to answer. Lots of folks ran face-first into this problem when trying to review questions in the close queue - if you don't filter the list down to topics where you have some knowledge, it becomes very difficult and frustrating to review them.
And so this is where your "minimal understanding" close reason, as nice as it sounds, falls apart: identifying effort is easy, but gauging understanding can be impossibly hard.
What do you know, and what do you need?
Going back to JDB's answer, there's a much more straighforward way to describe what we're looking for here. A reasonable question needs:

*

*Context!

*A clear statement of the problem!

*An explanation for why the obvious solution (if one exists) didn't work.

This could be as simple as, "How can I do #2 in #1 when #3 is unavailable" or as elaborate as a multi-page back-story and code listing. As long as all the elements are present, it's an answerable question with at least the potential to be useful to others.
And what do you know... The venerable How To Ask page lays out these very same criteria:

Tell us what you found (on this site or elsewhere) and why it didn't meet your needs.
...
Be specific
...
give us details and context

Indeed, the old "Not a Real Question" close reason captured these as well:

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form.

And Ilmari Karonen works his way around to the same conclusion, suggesting:

Questions ... should be based on real problems that you face, not on idle speculation, impossible hypotheticals or exercise problems with no relevance outside the classroom.

These are all great catch-all descriptions for this sort of question, with the caveat that they don't provide much in the way of specific guidance for the asker. But let's back away from close reasons for a minute... For all the attention it gets, closing is neither the most convenient, nor most effective way to handle these questions.
Strategies for handling low-quality questions
During all of the recent discussions surrounding the close queue backlog, something's been bothering me... A pretty big chunk of the backlog is taken up by questions flagged or voted on using this "minimal understanding" reason. That's not surprising in the least - but it's a horribly inefficient way of dealing with these questions. It takes 5 voters to close a question, and because some amount of subject knowledge is required to properly evaluate them finding the right voters is extra-difficult. Meanwhile, folks who interpret the reason as "no effort shown" are pushing more and more questions into the queue every day...
...If they just down-voted the questions, a privilege available to nearly everyone flagging them, they'd drop out of sight a lot faster.
As shocking as the notion that someone might get their work done for free is, that's not a particularly compelling reason to put a lot of effort into closing a question. And if we factor out the downvoting guidance ("This question does not show any research effort; it is unclear or not useful") from our close reasons, they could become considerably more straightforward.
The only question left then becomes: can we live without our super downvote?

A: I just wrote a long winded rant on the subject of minimal understanding/effort, deleted it and decided to go with this instead...
A good measure of effort in my opinion, is the "What have you tried?" test. I'm talking about the article not the snarky comment...

When you're asked "what have you tried?", it doesn't mean "show me the
  code you've written, or piss off". What you have to do is at least try
  to help yourself – and the trying is the important thing.
Not just for avoiding pissing off someone who would otherwise be
  willing to give freely of their valuable time to help you, but
  actually for your own development. Do it enough times and the number
  of questions you'll actually have to ask will start to go down. You'll
  also be in the position to help others (including me), and that way
  everybody wins.
So next time you're considering asking a question, you'd better be
  ready with a convincing answer when you're asked "What have you
  tried?"
If your answer amounts to "not a lot", take my word for it: the next
  question you get back will be "then why should I help you?"

"Show your effort" or "Must demonstrate a minimal understanding" are just the next generation of "What have you tried?" They are born out of frustration and can be used either constructively or destructively. It's up to the community to decide which way to turn.
It really comes down to maintaining a reasonably helpful attitude while holding back the flood of people who probably shouldn't be helped.

A: For me, effort means an attempt to research/ solve the problem. It doesn't have to mean that the user spent an hour spinning his wheels.
Tell me why the google results don't work, or tell me that google didn't return anything.
In your case of new technology, the user should have looked at the docs. If there aren't any docs, then the user should state as much.
Why do I ask for effort? Questions a lot of times can be too broad. If the user has done something, it provides scope; it provides direction. It means I don't have to waste my time with things that they have already tried; it means I can see better what they are trying to do.

A: I've always thought that the point of "homework questions must show some effort" was simply to discourage people from copying and pasting (sometimes literally, sometimes by manually retyping) each and every exercise from their textbook or exercise sheet to Stack Exchange.
Sure, it's a real easy way to ask a lot of questions (and an even easier way to get your homework done), and typically the questions will even be on topic and interesting (because the teacher or textbook author tried to make them so).  But it's not what the Stack Exchange network really should be for.
Of course, most people would consider it just fine to ask for help with the occasional tricky exercise that you can't solve.  But people who only do that aren't really contributing anything useful or original to the community — they're just being help vampires.

Fundamentally, I think all the longstanding issues with homework questions arise from a complicated "impedance mismatch" between the Stack Exchange model on one hand, and the general idea of homework exercises on the other.
Basically, the Stack Exchange system is based on the idea of people helping each other solve practical problems they face in their daily life, and thereby building a useful repository of practical knowledge and generally making the world a better place.  To quote the "What is Stack Exchange?" page (emphasis mine):

"We welcome questions that are clear and specific, representing real problems that you face; Stack Exchange is not the place for conversation, opinions, or socializing."

Homework questions, however, are not "real problems" in this sense — they're artificial, made-up problems designed to train your problem-solving skills.  Answering such questions doesn't "make the Internet a better place"; the only people it helps are those asked to solve that particular homework exercise (and even then, the help may backfire in the long run, if they just use Stack Exchange as a substitute for actually learning to solve the problems themselves).
Part of the problem, however, is that, by design, good homework questions are interesting.  They're the kind of questions that make people want to answer them, that make people think "Ooh, I know this one!"  So those questions tend to easily get answers, even when they're actually so localized that they really have no practical use outside the classroom.
So we have a class of questions that are trivially easy to ask (because you just need to copy the question from elsewhere) and attract a lot of answers (and often, consequently, upvotes), but typically contribute next to no lasting value to the site, or to the Internet as a whole.  It's no wonder some people don't like them.
And, of course, just to make things more complicated, not all homework questions are bad questions: some are in fact based on real problems one might face outside a classroom, and even if they aren't, they often (by design) demonstrate some practically relevant technique or principle that a good answer may bring to the foreground and generalize upon.  So just saying "homework questions are bad, mmkay" doesn't really cut it — not all of them are bad, just many of them.

So, granting that demanding askers to "visibly struggle" in an effort to show effort isn't the answer, what should we do about copy-and-paste homework questions?
My modest proposal would be to add a new closing reason (or perhaps replace one of the existing reasons) to reflect the wording I highlighted above, something like:

"not a real problem
Questions on [site] should be based on real problems that you face, not on idle speculation, impossible hypotheticals or exercise problems with no relevance outside the classroom."

Or perhaps it might be better to focus on the "copy-and-paste" rather than the "homework" aspect, and close them with:

"verbatim copy
Questions asked here must be original and based on real problems that you face, not copied verbatim from other sources (including textbooks, exercise sheets or other websites). If you wish to ask about a specific aspect of a problem presented elsewhere, please explain in your own words how the problem matters to you and what parts of it you need help with."

(I'm not entirely happy about that last sentence: it feels too long, and still doesn't fully communicate what I wanted to get at, which is that "I saw this problem elsewhere and can almost solve it, except for..." or "I saw this asked before, but I don't think the answers are right, because..." are generally OK, whereas "I got this for homework, please solve it for me!" isn't.  But it's a start.)
Edit: Struck out the "not a real problem" suggestion above.  As noted in the comments below, it's been tried and it didn't work well.  I do still think there might be some merit to the "verbatim copy" close reason, as it more specifically focuses on the minimal-effort "Here's my homework, do it for me!" questions we don't really want.  Besides, a lot of the really verbatim copy-pasted questions are probably somewhat iffy even on just copyright grounds alone.

A: For me the real meaning of the Demonstrate a minimal understanding of the topic close reason is:
This person did not show any effort of making the question readable, useful whatsoever. That is the real problem.
If someone does not provide code that's not the end of the world. But being just lazy and not caring should be closed. Often others need to ask for clarification, format the question, tags, correct grammar ...
Show some effort of making a good question for future visitors too, then all is fine.

A:
I'm sorry, but... When I'm trying to solve a problem and searching for similar questions on Stack Overflow, I really don't care how much effort the asker demonstrates in his question. (...) I'm rather resentful of ostentatious displays of effort.

You're fighting a strawman.
Most of these low quality questions display no effort whatsoever: the information is a simple Google away -- more often than not on this very site, at that. Sites like "Let me google that for you" may pass off as rude and get rejected, but they'd be a perfect fit for scores of questions asked on SO.
Also, the threshold is extremely low. Something as simple as "my problem is different from this other SO question" or "The doc [link] is unclear" demonstrates enough effort (i.e. OP used Google) and attracts upvotes and answers.
Here's a different suggestion: add a "I have googled my question" checkbox on the form that allows to ask a question. If left unchecked, submit the question to google in a new tab when the form is submitted.

A: I believe "How can I do X using Y?" should have their place on Stack Overflow.
Many times a user tries starting to learn a new technology and wants to start with one working simple example - and I believe this is usually a very good approach when starting with a new technology.
In these cases, even basic research can be very time consuming, as the user doesn't yet know the relevant sources.
On the other hand, many times a solution for such an answer (or at least some guidance about how to approach the solution) is a no-brainer for an experienced user.
Additionally, these questions can be helpful to other new users of the same technology.
Considering these, there should be room for 'newbie' questions, as long that:

*

*Some minimal research was done, or at least there's a reason why it wasn't.

*The question should be clear

*The user should expect short answers, or be referred to more specific sources.

A: I'll keep this short and sweet, because I mainly want to talk about one major problem that hasn't been emphasized in the other answers: low effort questions require way too much mindreading.
The main reason I will vote to close low effort questions is that answering them is not about applying your knowledge of the language/library to the kind of problem they're describing, but an exercise in guessing the asker's intent. Having tried to answer these kinds of questions in the past, I know how often they result in the asker dismissing your solution entirely because it's not what they had in mind.
What they had in mind may have been something sensible, or something completely wrongheaded that results from their poor understanding of the tool they're using. Unless you can somehow intuit their exact situation from the details they've provided, you risk putting a lot of effort into an answer that will go completely ignored. Reputation points aren't everything, but they do provide a nice acknowledgement of your effort. Low effort questions break that feedback loop, drawing you into a back and forth with the asker that means the more effort you put in, the more they come back at you with new hurdles and obstacles.


text:
Q: GTK Application doesn't run on windows I'm a beginner programmer and I've looked around the internet for a solution to this and am still looking. I found someone in this forum with a similar problem, however he is using GtkSharp and I'm using Gtk+. Basically I wrote a program in CodeBlocks using GTK+ (initially I was going to do it on windows but it would not install properly and after several days I just gave up and installed CodeBlocks on my Ubuntu). However, now after I made a release of my program and am trying to run it on a windows computer it does not work. I believe GTK is properly installed on this computer (the demo from the read me worked after I installed GTK). Any help would be appreciated.
Also, if someone can give me a heads up on this: Would my program require for every computer using it to have installed the GTK library?

A: On Windows you have to ship your program with the GTK libraries. Unfortunately packing is not so easy and all the currently available packages from gtk.org are outdated 2.16 or 2.22 and do not work well (themes are broken with missing icons and colors).
There are a few annoying bugs on windows like mouse enter/leave events not generated correctly.
If your program runs on one platform but not on the other it is very likely that you have an error in your program and because this is when you can see and feel the differences of the platforms pretty fast. So try to check again for GTK warnings.
And you have to provide more info, there is no way to help you with this information. YOu have to narrow the error problems to get help.
By the way, i wouldn't consider GTK a cross platform toolkit anymore, because it is only well maintained on Unix. Windows and MacOSX ports are a constant pain in the ass. That there is still no 3.0 binary distribution is just shamefull.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Avoid manually creating folders first to move files within them I have some files, for example
the punisher return.cbr
the punisher new adventure.cbr
undiscovered country america.cbr
undiscovered country canada.cbr

I need to move files in this way
the punisher
     |
     +--- the punisher return.cbr
     +--- the punisher new adventure.cbr

undiscovered country
     |
     +--- undiscovered country america.cbr
     +--- undiscovered country canada.cbr

I test this script
@echo off
setlocal EnableExtensions DisableDelayedExpansion
for /F "eol=| delims=" %%I in ('dir /AD /B /O-N 2^>nul') do if exist "%%I*.cbr" move /Y "%%I*.cbr" "%%I\"
endlocal

but it works only if before I create manually the punisher and undiscovered country folders before to run script.
I need to avoid manually creating folders to move files

A: Best solution (there are many):
You can use RoboCopy with the /MOV parameter and it will create the directory for you.
Example: RoboCopy c:\FromHere\SomeDir c:\ToHereEvenThoughItDoesntExist\SomeOtherDir "%%I" /MOV

A: Add the
mkdir command
to the script:
@echo off
setlocal EnableExtensions DisableDelayedExpansion
for /F "eol=| delims=" %%I in ('dir /AD /B /O-N 2^>nul') do (
  mkdir "%%I"
  if exist "%%I*.cbr" move /Y "%%I*.cbr" "%%I\"
)
endlocal

The enableextensions option will make mkdir ignore an
existing folder without error (see setlocal).


text:
Q: Stack vertically 5 2D-arrays in diagonal to build a whole 2d-array l have 5 adjacency matrices (nump arrays) : A, B, C, D, E. each of dimension [20,20].
Given A, B, C, D, E, l would like to build F which stacks the 5 adjacency matrices. Since we have 5 2D arrays of [20,20] then F is of dimension [20*5,20*5] as follow :
F=np.zeros((100,100))
    F=[
       [A,0,0,0,...,0],
       [0,...,B,...,0],
       [0,...,..,C,0],
       [0,.........D,..,0],
       [0,...........,E],
    ]

such that :
 A is indexed at F[0][:20]
 B is indexed at F[1][20:40]
 C is indexed at F[2][40:60]
 D is indexed at F[3][60:80]
 E is indexed at F[4][80:100]

What is the efficient numpy way to do that for larage number of adjacency matrices ?.  Let's, we have  n adjacency matrices to stack in a diagonal of new 2D array of [n*20,n*20]

A: You could use scipy.sparse.block_diag:
>>> AtoE = np.add.outer(np.arange(5, 10), np.zeros((3, 3), int))
>>> scipy.sparse.block_diag(AtoE).A
array([[5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9]], dtype=int64)

Sparse storage may be a good idea, anyway.
Alternatively, here is a more direct method in case you definitely want to use dense arrays:
>>> A = AtoE[0]
>>> N, N = A.shape
>>> k = len(AtoE)
>>> out = np.zeros((k, N, k, N), A.dtype)
>>> np.einsum('ijik->ijk', out)[...] = AtoE
>>> out.reshape(k*N, k*N)
array([[5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9],
       [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9]])


text:
Q: Finding the solution of: $5^m -m^n=mn$ I want to find all solutions to:
$5^m -m^n=mn \tag*{}$
Where $(m,n) \in \mathbb{N}$
I rearranged and got:
$5^m= m^n + mn \tag{1}$
Taking$\bmod 5$ on both sides I got:
$5|m \text{ or } 5|m^{n-1}+n\tag*{}$
I am having a problem with how to proceed from here. Any help would be appreciated. Thanks.
EDIT $1$:
I tried to find the parity of $(m,n)$. Taking$\bmod 2$ in $(1)$. We get:
$1 = m^n + mn \bmod 2 \tag*{}$
Note that if $m$ is even, it doesn't satisfy the equation above, and if $m$ is odd and $n$ is odd too doesn't satisfy so $\boxed{\text{m is odd and n is even}}$

A: *

*As noted in the comments by @Cheerful Parsnip, $m$ itself must be a power of $5$, indeed $m=5^c$. [Indeed: As rearranging yields $$5^m = mn+m^n,$$ the only way this could be satisfied is if $m$ divides $5^m$, which implies that the only prime dividing $m$ is $5$ [or that $m=1$].]

*Thus, for any $n$ and $m$ that are solutions, $m$ must be a power of $5$ so writing $m=5^c$, the following equation holds:
$$5^{5^c}-5^{cn} = n 5^c.$$

*Now for every positive integer $M$, let us write $\nu_5(M)$ the largest power of $5$ that divides $M$. Then for any $(m,n)$ that are solutions,
$$\nu_5(5^{5^c}-5^{cn}) = \nu_5(n5^c), $$ where $m=5^c$.

*As $5^{5^c}-5^{cn}$ is a positive integer, it follows that the strict unequality $5^{5^c}>5^{cn}$ holds, and thus $5^{5^c}$ is a larger power of $5$ than $5^{cn}$ is, and thus
$$\nu_5(5^{5^c}-5^{cn})= \nu_5(5^{cn})$$ $$=\nu_5(n5^c).$$

*Now, $\mu_5(5^{cn}) =cn$, whereas $\nu_5(n5^c)=\nu_5(n)+c.$ Plugging these in yields
$$cn = \nu_5(n)+c.$$

*This has no solutions for integers $c >0$ and $n>1$ however. [Indeed, the strict inequality $\nu_5(M) <\log_4(M) \le M-1$ for $M>1$ holds; indeed $5^{\log_4(M)} > 4^{\log_4(M)} = M$. So fpr such $n$ and $c$ the string of inequalities $\nu_5(n)+c < n-1+c < cn$ holds, and thus the equation $cn=\nu_5(n)+c$ indeed cannot hold for any integers $c>0$ and $n>1$.] So for the equation in 5. to hold for some $c>0$, the integer $n$ must be $1$. For $n=1$ however, the equation $5^m=m+m=2m$, which cannot hold for any positive $m$. So indeed, if the original Diophantine equation has solutions, $c$ must be $0$.

*So this leaves, with $m=5^c$, only $c=0$ as a possibility for any solution $(m,n)$. And so $m=1$, and $n$ such that $5-1^n=n$. So the only solutions are $(m,n)=(1,4)$.

ETA: There is another simpler way. First note the following: Let $x$ and $y$ be two nonnegative integers w $y >x$. Then $5^y-5^x \ge 4×5^x$. Thus, note as before that $m$ must be a power of $5$ and thus so must $m^n$, and that $5^m > m^n$, because $5^m-m^n$ is $mn$ a positive integer. Then if $m$ and $n$ are solutions, then $$5^m-m^n = nm \ge 4m^n,$$ so $m$ must be $1$. Then finish as in 7. above.


text:
Q: SAME content of PDF have DIFFERENT hash values Is it possible that same content of a pdf  have different HASH value ?
database value "Hello  World"   => convert into PDF =>generate HASH =>Save HASH into Database
Now,After one year
scenario 1:
Generate HASH from Same PDF  => Generate HASH => compare generated HASH with saved Database HASH Value
Both Hash value will be same or different ?
scenario 2:
Generate again New PDF
database value "Hello  World"   => convert into New PDF =>generate HASH =>  compare generated HASH with saved Database HASH Value
Both Hash value will be same  or different ?
Is there any possibility that Both HASH will be different in CORDA Blockchain ?

A: Hash of a file is generated based on the entire file (including all metadata) not just the content.
Hence two file having similar content doesn't necessarily mean that they have the same digital fingerprint. There is no guarantee that two files with similar content would produce similar hashes.


text:
Q: Histogram not displaying properly I am working on a diametric class distribution data, with over 10,000 individuals, and I wanted to make a histogram to show the results, but I am having a problem when I try to plot it.
When I tried using the histogram function
histogram(data)

I get a histogram that is calculating the percentage of individuals
Histogram using the histogram function
Then I tried using qplot function
qplot(data, geom = "histogram")

And got a histogram like the one you can see in image 2
qplot function
So I thought maybe is a problem with the y-axis scale so I tried using ylim() and the plot I got was only the axis with no data
Could someone please tell me what I'm doing wrong?
I'm trying to get a histogram like the one in image 3Histogram goal
I really appreciate your help to point out if I am not adding other codes or maybe redirect me to a cheat sheet that can clarify some things
thanks

A: Try to use the ggplot2 package, for example:
library(ggplot2)
ggplot(data = [YOUR_DATA], aes([YOUR_VARIABLE])) +
  geom_histogram()

EDIT:
Looking at your desired result, I think you want to use barplot() instead of histogram().


text:
Q: Can't touch a visible button while the soft-keyboard is active I'm doing a simple chat-client and wish to be able to write a message in my editText and without closing the soft-keyboard click the "Send"-button which is right next to the editText and is fully visible. This cannot be done currently.
MY XML

    <FrameLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/connect"
            android:id="@+id/connectButton"
            android:layout_gravity="right|top"
            android:onClick="ConnectButtonClicked"/>

        <Button
            style="?android:attr/buttonStyleSmall"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:text="@string/send"
            android:id="@+id/sendButton"
            android:enabled="false"
            android:layout_gravity="right|bottom"
            android:onClick="SendButtonClicked"/>

        <EditText
            android:layout_width="228dp"
            android:layout_height="wrap_content"
            android:ems="10"
            android:id="@+id/messageEditText"
            android:layout_gravity="left|bottom"
            android:inputType="textLongMessage" />

        <EditText
            android:layout_width="190dp"
            android:layout_height="50dp"
            android:ems="10"
            android:id="@+id/usernameEditText"
            android:layout_gravity="left|top"
            android:inputType="textPersonName" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="391dp"
            android:text=""
            android:id="@+id/chatTextView"
            android:layout_gravity="center"
            android:layout_marginTop="100dp"
            android:layout_marginBottom="100dp"
            android:maxLines="100"
            android:scrollbars="vertical"/>
    </FrameLayout>

</RelativeLayout>

RELEVANT CLASS CODE
public class ChatClientMainActivity extends ActionBarActivity
{
    Socket socket;
    private ServerListener serverListener;
    private Thread listenerThread;
    public Handler messageHandler;
    private TextView chatTextView;
    private EditText usernameEditText;
    private EditText messageEditText;
    private Button sendButton;
    private Button connectButton;
    private int PORT = 2001;
    private String hostAddress = "192.168.1.3";

    private static class HandlerExtension extends Handler
    {
        private final WeakReference<ChatClientMainActivity> currentActivity;

        public HandlerExtension(ChatClientMainActivity activity){
            currentActivity = new WeakReference<ChatClientMainActivity>(activity);
        }

        @Override
        public void handleMessage(Message msg)
        {
            ChatClientMainActivity UIActivity = currentActivity.get();

            if (msg != null)
            {
                Bundle tempBundle = msg.getData();
                UIActivity.PrintMessage(tempBundle.getString("chatMessage"));
            }
            else
            {
                // ALERT MESSAGE
            }
        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chat_client_main);

        messageHandler = new HandlerExtension(this);

        chatTextView = (TextView) findViewById(R.id.chatTextView);
        chatTextView.setMovementMethod(new ScrollingMovementMethod());
        connectButton = (Button) findViewById(R.id.connectButton);
        sendButton = (Button) findViewById(R.id.sendButton);
        usernameEditText = (EditText) findViewById(R.id.usernameEditText);
        messageEditText = (EditText) findViewById(R.id.messageEditText);
        messageEditText.setOnKeyListener(new View.OnKeyListener(){
            @Override
            public boolean onKey(View v, int keyCode, KeyEvent event){
                if(keyCode == event.KEYCODE_ENTER){
                    SendButtonClicked(v);
                    InputMethodManager imm = (InputMethodManager)getSystemService(
                            Context.INPUT_METHOD_SERVICE);
                    imm.hideSoftInputFromWindow(messageEditText.getWindowToken(), 0);
                    return true;
                }
                return false;
            }
        });

        //InputMethodManager imm = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);
        //imm.SoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
    }

    public void SendButtonClicked(View view)
    {
        String message = messageEditText.getText().toString();
        if (!message.equals(""))
            ServerListener.SendMessage(message);
        messageEditText.setText("");
    }

    public void ConnectButtonClicked(View view)
    {
        if (connectButton.getText().toString().equals("Connect"))
        {
            if (usernameEditText.getText().toString() != "")
            {
                if (usernameEditText.getText().length() <= 10)
                {
                    String username = usernameEditText.getText().toString();
                    listenerThread = new Thread(new ServerListener(this, "192.168.1.3", username, messageHandler));
                    listenerThread.start();

                    sendButton.setEnabled(true);
                    connectButton.setText("Disconnect");
                    usernameEditText.setEnabled(false);
                    PrintMessage("Welcome to the chat!");
                }
                else
                {
                    // "Username max length is 10 characters"
                    //
                    // Dialog dialog = new Dialog(null);
                    // TextView txt = (TextView)dialog.findViewById(R)
                }
            }
            else
            {
                // "Enter a username!"
                // Dialog dialog = new Dialog(null);
            }
        }
        else if (connectButton.getText().toString() == "Disconnect")
        {
            QuitChat("Disconnect");
            sendButton.setEnabled(false);
            connectButton.setText("Connect");
            usernameEditText.setText("");
            usernameEditText.setEnabled(true);

            // listenerThread.a
        }
    }

    public void PrintMessage(String lineToPrint)
    {
        Time now = new Time();
        now.setToNow();
        String timeString = now.format("%H:%M ");
        final String line = timeString + ": " + lineToPrint + "\n";
        messageHandler.post(new Runnable()
        {
            @Override
            public void run()
            {
                chatTextView.setText(chatTextView.getText() + line);
                chatTextView.invalidate();
            }
        });
    }

    public void QuitChat(String input) {

        ServerListener.SendMessage("LOGOUT");

        //Quit chat
    }
}

A link to my java- and xml-files as well as a screen-shot of the situation:
https://www.dropbox.com/sh/8dfbq6c2xjkoqi5/AAA726NdFj5EjoyLyE94ecPWa?dl=0
There is an equivalent question for iOS but without an applicable answer.
Can't click button when soft-keyboard is visible
Any ideas? Thanks in advance!
SOLVED
The problem was caused by this line in my layout xml:
"android:scrollbars="vertical"/>".
I'm new to Android-programming so if anyone can explain why then that would be great and I will accept that as an answer!


text:
Q: How to get the current running office instance version number using VBA? I am developing Microsoft Office Add-in, I have to read the registry values of the current instance of the office in which my add-in will run.
Is there any way I can get the current office version number of add-in instance?
I have searched and found this solution. But it's is not working.
Thanks if anyone from you can help.


text:
Q: AbsListView LayoutParams Set Layout Gravity How can I set the layout gravity for AbsListView.LayoutParams?
I am using this in a custom array adapter where I need to set the layout gravity based on a variable. My list child contains a linear layout root but in the adapter, I cannot set the LinearLayout params as i get the error that LinearLayout.LayoutParams cannot be cast to AbsListView.Layout params.
So, I tried to set the layout_gravity for an AbsListView, but it has no option for a gravity.
How can I set the layout_gravity programatically in this case?
EDIT: (Added source code)
The Listview Parent
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/messaging_background"
    android:orientation="vertical"
    android:padding="2dp" >

    <ListView
        android:id="@+id/messageThread"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/list_separator"
        android:layout_alignParentTop="true"
        android:layout_marginTop="5dp"
        android:cacheColorHint="#00000000"
        android:divider="@null"
        android:dividerHeight="2dp"
        android:fastScrollEnabled="false"
        android:listSelector="#00000000"
        android:transcriptMode="disabled" />

    <View
        android:id="@+id/list_separator"
        android:layout_width="match_parent"
        android:layout_height="1.0dip"
        android:layout_above="@+id/footer"
        android:background="@android:color/white" />

    <LinearLayout
        android:id="@+id/footer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal" >

        <ImageButton
            android:id="@+id/filter"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_weight="0.1"
            android:background="@null"
            android:contentDescription="@string/message_filter_button"
            android:scaleType="fitCenter"
            android:src="@drawable/filter" />

        <EditText
            android:id="@+id/send_message_text"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="0.8"
            android:imeOptions="actionSend"
            android:inputType="textMultiLine"
            android:maxLines="6"
            android:scrollbarAlwaysDrawVerticalTrack="true"
            android:scrollbarDefaultDelayBeforeFade="200"
            android:scrollbarFadeDuration="300"
            android:scrollbarStyle="outsideOverlay"
            android:scrollbars="vertical" />

        <ImageButton
            android:id="@+id/send"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_weight="0.1"
            android:background="@null"
            android:contentDescription="@string/send_message_button"
            android:scaleType="fitCenter"
            android:src="@drawable/send_btn" />
    </LinearLayout>

</RelativeLayout>

The Listview Child
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:background="@drawable/incoming"
    android:orientation="horizontal" >

    <TextView
        android:id="@+id/messaging_bubble_content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:fontFamily="sans-serif-light"
        android:maxWidth="200dp"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textIsSelectable="true" />

    <TextView
        android:id="@+id/messaging_bubble_time"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:fontFamily="sans-serif-light"
        android:gravity="center"
        android:paddingRight="5dp"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textIsSelectable="false" />

    <ImageView
        android:id="@+id/messaging_bubble_megaphone"
        android:layout_width="20dp"
        android:layout_height="match_parent"
        android:contentDescription="@string/message_child_megaphone"
        android:src="@drawable/megaphone"
        android:visibility="gone" />

</LinearLayout>

What should I call in the getView of my adapter to push the child to the right according to a variable in the adapter?
EDIT 2:
A possible solution:
Wrap the whole child under another element under the root and then you can set gravity instead of layout gravity which can be easily done using the setGravity() method.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:id="@+id/messaging_bubble_wrapper"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:background="@drawable/incoming"
        android:orientation="vertical"
        tools:ignore="UselessParent" >

The second linear layout is useless but having it gets the job done!

A: To change the gravity you could wrap the existent row layout in another layout(FrameLayout for example) and then simply set the gravity on the LinearLayout from that extra layout(which now can be moved inside the parent).
To avoid adding an extra level in the layout you could keep the current row layout and replace the root LinearLayout with a RelativeLayout and change the position of the views inside it according to your desired gravity.

A: I solved this problem by creating another "useless view (in eclipse's words)" under my root element.
I set the width of the parent to match_parent and then changed the gravity to move the "useless view" left or right. The setGravity(Gravity.LEFT) method is allowed on the AbsListView.

A: I think you need to get rid of the ListView. Replace the ListView with a FrameLayout and use the layoutinflater to add the "listview" child into the FrameLayout. When using the layoutinflater set the FrameLayout.LayoutParams with the gravity property assigned to the root of the child (LinearLayout). Good luck.

A: You can set the gravity of the child's content with setGravity():
View child;
boolean left;

child.setGravity(left ? Gravity.LEFT : Gravity.RIGHT);

And the child should be changed to android:layout_width="match_parent".


text:
Q: Search Bar with Maps app behavior (navigation bar full width when selected) I'm trying to display a search bar that would have exactly the same behavior as the one in native Maps app. I mean:

*

*search bar in the title view of my navigation bar

*when selected, the search bar occupies the full width of my navigation bar and I display the SearchDisplayController

So far, I managed to get the following behavior:

As you can see above, I can't manage to get the search bar to occupy the full width on selection. Though, full width + cancel button seems like the default behavior for search bar that are hooked with SearchDisplayController, at least if the search bar was not added to the navigation bar!
Am I missing an obvious way of doing that? Or do I have to customize the navigation bar by myself when searchBarShouldBeginEditing is called?

A: As long as I do not have the perfect solution, I'm doing the following. But I'm still open to something better!!
- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar {
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(onCancel)];
    [UIView animateWithDuration:0.1 animations:^(){
        self.navigationItem.leftBarButtonItem = nil;
    }];
return YES;
}

- (void)onCancel {
    [self.searchController setActive:NO];
}

- (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar {
    [UIView animateWithDuration:0.1 animations:^(){
        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"OpenMenuButton.png"] style:UIBarButtonItemStylePlain target:self action:@selector(openSideMenu:)];
    }];
    self.navigationItem.rightBarButtonItem =self.doneButton;
    return YES;
}

Besides, I'm wondering if Maps app actually use a navigation controller because there are custom behaviors (width of the titleView, animation of the leftBarButton out of the screen) that surprise me.

A: Are you looking for something like UISearchDisplayController + UISearchBar ?
http://petersteinberger.com/blog/2013/fixing-uisearchdisplaycontroller-on-ios-7/


text:
Q: Having some trouble clearing a textbox - tkinter - Python I've read a few threads all over the internet regarding clearing a text box on tkinter. Basically everyone says it's simple:
text.delete("1.0", END)

However, perhaps it has something to do with the way I structured it, or the way I'm calling it, but for some reason, this does not work for me. It simply does nothing.
I've tried re-positioning the def, and re-writing the text.delete("1.0", END) in a number of ways, most of which lead me to other errors, but I cannot seem to get this to work.
Ultimately, what I'm trying to accomplish is that when I click a button, the text box will clear, before populating with new information.
Below is my code.
from tkinter import *
from PIL import Image, ImageTk
import functions

class MainWindow(Frame):
    def __init__(self, parent):
        Frame.__init__(self, parent)
        self.parent = parent
        self.initUI()

    def initUI(self):
        self.parent.title("pyTicket")

# TOOLBAR ####################################################
        toolbar = Frame(self.parent, bd=1, relief=RAISED)

        self.img = Image.open("Icons\startupcheck.png")
        eimg = ImageTk.PhotoImage(self.img)
        startupButton = Button(toolbar, text="Re-Check ", image=eimg, compound="left", relief=RAISED, command=self.StartUpChecker)
        startupButton.image = eimg
        startupButton.pack(side=RIGHT, padx=2, pady=2)

        toolbar.pack(side=TOP, fill=X)

        self.parent.config(menu=menubar)
        self.pack(anchor=N, side=TOP, fill=X, expand=False)
# TOOLBAR ####################################################

# TEXTBOX ####################################################
        self.textbox = Text(self, wrap="word", height=5)
        self.textbox.pack(side="bottom", fill="both", expand=True)
        self.textbox.tag_configure("TextBox", foreground="#b22222")
        self.pack(anchor=S, side=BOTTOM, fill=BOTH, expand=True)
# TEXTBOX ####################################################

# Functions ###################################################
    def StartUpChecker(self):
        self.clear_text()
        functions.StartUpChecker()

    def clear_text(self):
        self.textbox.delete("1.0", END)

class TextRedirector(object):
    def __init__(self, widget, tag="stdout"):
        self.widget = widget
        self.tag = tag

    def write(self, str):
        self.widget.configure(state="normal")
        self.widget.insert("end", str, (self.tag,))
        self.widget.configure(state="disabled")
def main():
    root = Tk()
    #Width X Height
    root.geometry("500x300+300+300")
    root.update()
    root.minsize(400,200)
    app = MainWindow(root)
    root.mainloop()

if __name__ == '__main__':
    main()

A: You don't appear to actually use the TextRedirector class in the code you posted, but if you're using it in your actual code, note that its .write() method leaves the textbox in a disabled state - which prevents ALL modifications, even those resulting from code instead of direct user action.  Your .clear_text() method needs to temporarily enable the textbox so that you can modify it, exactly as .write() does.


text:
Q: how to set up https? i heard that http is not good. for instance i do a basic http authentication, and that some hackers can figure out the password by snooping (i dont know what this is ).
so i was advised to install HTTPS.
how can i do this ?
apt-get install https or SSL ? what is the difference ?
i have my own dedicated server.

A: This Apache FAQ should be useful reading and starting point.
You can also start at the Wikipedia HTTPS page.
There is also a Linux Journal Flash video on setting up a https server with apache.

A: You need to have mod_ssl installed for apache in order to get SSL support.  If it isn't already packaged with httpd, you'll have to look for a mod_ssl in apt(sorry, I don't have ubuntu to test, but I would assume it is just an "apt-get mod_ssl").
If you are only worrying about encrypting the traffic so people can't pick out clear-text login credentials, I would recommend a self-signed cert as churnd stated.

A: If your server is hosted, check with your host about providing a signed SSL certificate.  These cost $$, but are required for a valid secure connection.  You can roll your own, but you are not a valid Certificate Authority, so people who visit your site will get a warning that the SSL cert is not signed by a valid CA.  Not a big deal if they know you or it's just for your own use, as the security is about the same... it's just a matter of trusting who the security comes from.  Here's a good howto for rolling your own.

A: Your questions:
SSL is a way of making a secure connection.  The traffic is encrypted so that only the sender and receiver can see the actual information.  HTTPS is ssl for HTTP.  The endpoints agree to encryption and no one other than the server and client can see the info.  SSL can also authenticate, using (hopefully) unforgeable certificates that prove that one side is who they claim to be.
Basic authentication has the password encoded.  This means it's goes through a simple encoding transform (Base64) that is easy to reverse and see the real data.  If someone has access to your network, or any network between your server and the client actually, they can see the base network traffic (the slang term for this is snooping, or sniffing) and easily see the username and password.  If you use HTTPS, this is encrypted, and can not be seen.
To get https working, you need the https code in your server (from apt-get) and a certificate.  The certificate tells people who the server is (the authentication above).  You can either purchase a certificate, in which they'll ask you some info to prove some company or whatever, and sell to you.  Or you can create a self-signed certificate for free.
To get the 'who are you' part of the authentication to work, they have a 'web of trust'. I can say i'm anyone i want, but how can i prove it?  Well, if you buy a certificate, the issuer says 'I trust this guy is google.com'.  And your web browser trusts the big issuers so they trust that they say you are google.com.  But your self-signed cert will be trusted by no-one.  So your browser will complain.  If this is for internal intranet use, you can just tell them to ignore it.  Internet users will be harder to convince, and you may eventually just need to buy one.
This isn't all free from a computing standpoint.  Any https traffic will need to be encrypted.  That takes CPU.  Also, your content is essentially uncacheable, meaning more hits to your server.  Check your server resource limits after the change.
Also, you didn't ask, but Basic Authentication isn't the best authentication.  Besides the absolute need to encryption, there is no easy way to log out.


text:
Q: CSS - Changing between landscape and portrait positions I try to adapt my website to smartphones. I used media types to do it:
@media only screen and (min-device-width:320px) and (max-device-width:480px) and (orientation:landscape) {
    /* Style here */
}
@media only screen and (min-device-width:320px) and (max-device-width:480px) and (orientation:portrait) {
    /* Style here */
}

Testing: I charge the webpage and it looks perfectly (portrait mode for example), change the orientation of the smartphone and the webpage adapt to landscape mode perfecly, but comeback to portrait mode and the website turns to the "PC mode" (Don't using landscape-mode).
What can I do to fix this?

A: I solved it.
I used another media type:

@media (orientation:portrait){
}

(for example for portrait mode)
and now it works every time I change the orientation.


text:
Q: Can't implement activity scenario I found in Google Example instrumented test something like this:
@Before
public void launchActivity() {
  ActivityScenario.launch(MainActivity.class);
}

But i can't implemented ActivityScenario in my project.
I should add something to gradle or what ?
If I past import androidx.test.core.app.ActivityScenario; no help, i have test red in AndroidStudio.
How to implement AndroidScenario ?

A: Try adding androidx.test:core:<currentVersion> dependency to your gradle.
Like "androidx.test:core:1.0.0-beta02" or whatever the current version is.


text:
Q: Alterar fundo de botão Bootstrap 4 Qual seria a forma correta, de alterar o fundo de um botão no bootstrap 4, para uma cor personalizada:
<button class="btn btn-primary btn-lg">Buscar</button>

para
<button class="btn btn-primary btn-lg" style="background-color: #BLABLA">Buscar</button>

Pensei em adicionar um background-color, no atributo style direto no button, mas será que essa é a forma mais correta?

A: Crie um arquivo .css com as suas próprias definições e carregue-o após o .css do Bootstrap.
Ficaria assim:
<!-- CSS DO BOOTSTRAP -->
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<!-- CSS PESSOAL -->
<link rel="stylesheet" type="text/css" href="seu_css.css">

No arquivo seu_css.css você coloca:
.btn-primary{
   background-color: #BLABLA;
}

Isso fará com que TODOS os botões Bootstrap .btn-primary fiquem com a cor de fundo #BLABLA. Caso não queira alterar a classe .btn-primary de forma global, crie uma classe personalizada:
.btn-pessoal{
   background-color: #BLABLA;
}

E adicione essa classe que você criou no botão:
<button class="btn btn-primary btn-lg btn-pessoal">Buscar</button>

A: Basta você olhar o código CSS do Bootstrap e então verificar o que acontece em cada classe como por exemplo a classe .btn-primary pois dependendo do estado (hover,disabled e etc) do botão ele pode ter cores diferentes.
Após identificar todas as classes você pode simplesmente criar um arquivo com essa mesma classe ou outro nome, só mudando as cores:

.btn-personalizado {
  color: white;
  background-color: red;
  border-color: red;
}

.btn-personalizado:hover {
  color: #fff;
  background-color: orange;
  border-color: orange;
}

.btn-personalizado:focus,
.btn-personalizado.focus {
  color: #fff;
  background-color: black;
  border-color: black;
  box-shadow: 0 0 0 0.2rem rgba(49, 132, 253, 0.5);
}

.btn-personalizado:active,
.btn-personalizado.active,
.show>.btn-personalizado.dropdown-toggle {
  color: #fff;
  background-color: gray;
  border-color: gray;
}

.btn-personalizado:active:focus,
.btn-personalizado.active:focus,
.show>.btn-personalizado.dropdown-toggle:focus {
  box-shadow: 0 0 0 0.2rem rgba(49, 132, 253, 0.5);
}
<!-- BOOTSTRAP -->
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<!-- ESTILO PERSONALIZADO -->
<link rel="stylesheet" type="text/css" href="estiloPersonalizado.css">

<button class="btn btn-primary ">Buscar</button>
<button class="btn btn-personalizado ">Personalizado</button>

A: No arquivo css :
.btn-primary {
    background-color: #BLABLA;
}


text:
Q: Is there a way to add a smooth/ease transition effect to jQuery? I have this code to modify the position of an element on my page when user scrolls page a certain position of the page:

Is there a way to add an effect similar to the CSS transition: all 0.5s ease to this when the scrollTop effect triggers?

A: As long as you have access to the CSS file and are allowed to edit it, the simplest way to achieve the easing effect would be to add the required transition setting to the element via CSS. Any transition setting that is added to the element via CSS will remain applicable for property changes done through JavaScript also.

jQuery(window).scroll(function() {
  if (jQuery(window).scrollTop() > 50) {
    jQuery("#tab_toggle #tab_toggle_bg").attr("style", "top: 45% !important");
  } else {
    jQuery("#tab_toggle #tab_toggle_bg").removeAttr("style");
  }
});
#tab_toggle {
  width: 100%;
  height: 500px;
  position: relative;
}
#tab_toggle_bg {
  position: absolute;
  background: red;
  color: white;
  text-align: center;
  line-height: 140px;
  width: 140px;
  height: 140px;
  top: 0%; /* an initial value for the property that needs to be transitioned is also required */
  transition: all 0.5s ease;  /* add the required timing function - ease, ease-in, ease-in-out, linear */
}

    Scroll the page for more than 50px.