What property of the reals prevents us from constructing a bijection between the reals and the natural numbers?

Question: I have seen the diagonal proof that implies such a construction is impossible, but I do not understand what property the reals possess that prevents this construction from happening.
I am asking because I'm trying to understand what it really means for there to be multiple sizes of infinity.
EDIT: The answers I'm getting are not quite the kind I am looking for. I'm looking for a more abstract answer. If we have two collections of things, one being the size of the natural numbers (call it A) and one being the size of the real numbers (call it B), what property does B possess that A does not that (intuitively) prevents a bijection from being constructed between the two.
Comment: Uncountability. The property of being too big.
Comment: It isn't anything algebraic about the reals. It's just a factor of the size of the set of real numbers.
Comment: @gammatester: but that's the point! The OP is asking a question of the form: if we have too things and one is bigger than the other, then what property of the bigger thing makes it bigger? It isn't circular to say that the property that distinguishes between a red door and a blue door is colour. Likewise it isn't circular to say that the property that distinguishes between a set and a bigger set is size.
Comment: maybe the different types of [infinity](https://www.youtube.com/watch?v=elvOZm0d4H0) might be a start.
Comment: @RoddyMacPhee is right, the reals are uncountably infinite, natural numbers countably infinite.
Comment: @Quality but $f(a)= \sqrt(a)$ doesn't map all reals to natural number.
Comment: @benjamin, the algebraic numbers are countable! See https://math.stackexchange.com/questions/50655/proving-the-countability-of-algebraic-numbers
Comment: @RoddyMacPhee Presumably, that was in reply to the comment: "how would you map something to $\sqrt 2$ only using a function involving the natural numbers." That (the original comment above) was what I'd call at best an uninformative response.
Comment: How are you defining the real numbers - definitions differ, though isomorphism/uniqueness of the reals is provable in various contexts. But if you want to know which part of the definition makes the difference, you need to specify all the components.
Comment: Simple, not all inverses are covered; in other words, how would you map something to $\sqrt{2}$ only using a function involving the natural numbers?
Comment: @BenjaminMoss  You could define the function$ f(2)= \sqrt{2}$
Comment: @RoddyMacPhee I never implied that it did.
Comment: @Quality ah but you did imply a point of a function but can that function be bijective ? if not then there's not a 1 to 1 correspondence which would imply the same cardinality.
Comment: https://math.stackexchange.com/questions/130788/isnt-there-a-bijection-between-real-numbers-and-natural-numbers What I said originally was in line with a few comments in this question, I'm not sure how my response was uninformative
Comment: sorry correction: there's not a bijection which would be the indicator of equal cardinality.
Comment: @BrianO: Isn't this a circular argement? You effectively say,
the reals uncountable because they are uncountable.
Comment: It would be helpful to consider a simpler example. E.g., consider the set $X = \{0\}$ with one element and the set $Y = \{0, 1\}$ with two elements. What abstract properties of $X$ and $Y$ prevent us constructing a bijection between $X$ and $Y$? I can't think of any answer other than the difference in cardinality, i.e., the non-existence of a bijection between $X$ and $Y$. What would you like to see in a more "intuitive" explanation why $1 \neq 2$?
Comment: Perhaps someone can give the kind of answer you're looking for if you demonstrate it for finite sets.  I have one set being the same size as the set of planets (call it P) and one being the size of the set of fingers on my hand (call is A).  What property does B possess that A does not that (intuitively) prevents a bijection from being constructed between the two?
Comment: @gammatester It's a joke. I don't think it's helpful to ask, "What *property* of set $A$ makes it bigger than set $B$?" *Being bigger than* is a relation, and the only "property" of $A$ that could account for its being bigger than $B$ smuggles in $B$: the property of not being bijectable with B$.
Answer: It would be the supremum axiom: The fact that for every bounded above set there exists a least upper bound, i.e. supremum. This implies the existence of irrational numbers within the reals.
For example, $\sqrt{2}$ would be the supremum of the bounded above set $[0,\sqrt{2})$.
For you to have an intuition of what is going on, you can think of the natural/rational number line as a number line full of holes whereas the real number line is absolutely continuous. The holes in the natural number line are obvious (for example between $1$ and $2$ we have $1.1, 1.5,\ldots$) and those in the rational number line are the ones left by the irrational numbers.
Comment: @gammatester If you try to do this with the algebraics in place of the reals, how do you know that the resulting "antidiagonal" real will be algebraic? (It won't.)
Comment: Why does this prevent the existence of the bijection/injection? The hole argument seems to be the same for algebraic numbers instead of reals.
Answer: When you construct an infinite decimal in the diagonlization argument, the least upper bound axiom of $\mathbb{R}$ guarantees that the infinite decimal you've constructed is actually a real number; if you tried to perform the diagonlization argument with $\mathbb{Q}$, that would be your stumbling block.
Answer: The underlying truth is the following:
Given any set $X$ there is no surjective map $f: \>X\to{\cal P}(X)$.
This means that ${\cal P}(X)$ has "essentially more elements" than $X$, say $2^n$ compared to the $n$ elements of $X$, if $X$ is finite.
Proof. Consider an arbitrary map $f: \>X\to{\cal P}(X)$. This map assigns to each $x\in X$ a subset $A_x\subset X$. Now look at the special set
$$Q:=\{x\in X\,|\, x\notin A_x\}\quad \in{\cal P}(X)\ .$$
I claim that $Q\notin f(X)$; hence $f$ is not surjective. Assume to the contrary that $Q=f(x_*)$ for some $x_*\in X$. We now argue about the membership of $x_*$ in $Q$. By definition of $Q$ and of $x_*$ one has
$$x_*\in Q\quad\Leftrightarrow\quad x_*\notin f(x_*)\quad\Leftrightarrow \quad x_*\notin Q\ ,$$
which is absurd.$\quad\square$


Do athletes attending religious colleges (BYU, ND, etc.) need to be of that faith?

Question: This might not be the correct community so I can close/move my question.
I'm just curious.  Do student athletes attending religious universities need to be of that faith?  I can think of several universities (BYU, Notre Dame, Liberty, etc.) which are religious but I'm curious if they need to be of that faith.  If the school limits that all students/student athletes are of that faith, that would limit the pool of athletes they could recruit, which would put them at a competitive disadvantage.
Comment: I would say this is off-topic because it's about the procedure of law more so than sports. If you weren't asking about athletes (but college employees for example), the answer remains the same.
Answer:
Do athletes attending religious colleges (BYU, ND, etc.) need to be of that faith?

No, because of federal law. BYU has a nondiscrimination statement that states the following (emphasis mine, based on your question):

... Therefore admission preference is reserved for members of the Church in good standing; however, as required by federal law (including Title IX and Section 504), BYU does not unlawfully discriminate against applicants for admission or employment based upon sex, race, creed, religion, national origin, age, or disability who meet the requirements; ...
Answer: The answer is no, students do not need to be of that faith.
What is true about the "religious" colleges is that they are sponsored by churches of that faith. And perhaps "faith" is a "tiebreaker" when choosing between applicants. As a practical matter, good athletes are scarce enough so that "athlete" trumps "faith."
But the U.S. government will not provide Federal funding to schools that limit enrollments to one faith. One college, Bob Jones University, tried to impose certain (non-religious) limitations on enrollment, and lost its Federal funding.


Is this a way to construct mathematics?(logic vs. set theory)

Question: I recently asked a question about the fact that logic and set theory seems circular.
 link
I got a lot of good and thoughtful answers, that probably explain everything, but I must admit I did not understand them all (not the fault of any of the people who answered).
So I am wondering if someone can check the "recipe" I have below, and if this is a sufficient or ok way to view the construction of mathematics?

Before creating mathematical logic we just have to know what some something means. We assume we know these things:
1.1 We know what a string is, and we know what symbols is. We also know what ordered sequences of symbols is, even though we have not formalized what it is.
1.2 We can talk about function symbols and relation symbols, and we know that there are rules when writing these things. But we have not yet made a formal definition of functions and symbols.
1.3 We know what the equality symbol is, and we create rules on how to use it in our logic language. But we do not have any more precise definition of what it is, other than a symbol, and our own intuitive meaning.
1.4 We have an idea about the natural numbers, and we are allowed to use these as symbols, even though we have not created them.
1.5 We can use the induction principle on proving things about our logical language. We assume that if something holds for "the base"-object, and if something should hold for an arbitrary object then it also also for its "successor", then it must hold for all the objects starting with the base-object and all the successors. We just assume that this holds, and that we can use it?
We then create the language of mathematical logic.
We create set-theory:
3.1 Here we formalize ordered pairs in terms of sets.
3.2 We formalize what a function and a relation is in terms of sets (cartesian-product etc.).
3.3 We formalize equality as a particular relation.
3.4 We define and create the natural numbers in terms of sets.
3.5 We create an axiom of mathematical induction in terms of the natural numbers? In other words, we assume that induction holds, just as we did before we created the logical language?

And hence we do not have any circularity in using set theory before it was created?
Is this a correct way to view the construction of mathematics? If it is wrong I would love answers, but I would very much love answers in a list form, where it is explicitly stated what we do from the start and where we end up etc..
Comment: Correct? That depends on who you asked. I'm sure that there are prominent mathematicians on pretty much every opinion on the spectrum of "This is very wrong" to "That's the right way". And several others which are not on that spectrum at all.
Comment: @AsafKaragila Thank you. I guess another way would be to ask if this in some way explains why it is allowed to use elements of set theory in creating mathematical logic, before set theory is created. I understand there are many ways of doing this, and that we probably can view the foundation of mathematics in many different ways. Put another way maybe: Is this an "ok" explanation to explain why books on mathematical logic are allowed to use the terms/objects/words in section 1., before set-theory is created?
Comment: Yes. This is how set theory is used to investigate models of set theory. We formalize the theory internally to a mathematical theory that will provide us with formal and nice tools to simplify some of the work which will be tedious and boring otherwise.
Comment: @AsafKaragila When you say "models of set theory", can this mean all of mathematics, that this is what you do to investigate mathematics? And with forming the theory internally, do you mean that we use the theory as help to create a formal langugage(logic), and then we formalize the set-theory with the help of logical language? Sorry for beeing a little slow.
Comment: Your recipe seems to be good. But what are you going to do with power-sets? You haven't mentioned them at all. If you accept existence of the exponentials $A^B$, you accept existence of power-sets as well.
Comment: Power-sets may cause a lot of troubles.
Comment: Are you describing 'construction' of mathematics or set theory, specifically?
Comment: We start out with a context-free grammar.  We add a bit of meaning, and inference rules about how we can manipulate the symbols in our context free grammar. Sets are part of first-order logic, Second-order logic we build up from propositions, up to predicates, we then add in quantification, and qualification etc.
Comment: @user119615 Sorry, isn't mathematical induction a theorem once we take existence of an inductive set as given?
Comment: Researching the ZFC axioms may be helpful for finding the answer to your question. Here is a Wikipedia page on the ZFC axioms: https://en.wikipedia.org/wiki/Zermelo%E2%80%93Fraenkel_set_theory .
Answer: You are mixing up two things which are similar only by pure coincidence. The meta-language, and the study of mathematical logic.
In mathematics, generally, we use the meta-language, to formalize and model something, either from some platonic idealistic world or from our universe. This is the language you describe as the things we assume exist, the very primal things like finite strings and so on. We don't actually assume their existence, these are our tools for building new mathematical objects.
The study of mathematical logic, on the other hand, is taking small slices of this meta-language, and using the very tools created by the meta-language, to study these slices and gain insight, the same way we do with the movement of planets. (Remember Gödel, we can't really take everything in one go!).
Comment: I agree in general, but I wouldn't say "pure coincidence". We are thinking about our own thinking, so we usually want what we build to resemble the way we already think. (Or we might also look at whether the same tools could build something different from that way we usually think.)
Comment: Yes, you are probably right. Kind of a stretch.


How to interpret results from R anova in quantile regression?

Question: Here is a sample output:
anova(fit1,fit2);
Quantile Regression Analysis of Deviance Table

Model: op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + inp8 + inp9
Joint Test of Equality of Slopes: tau in {  0.15 0.3  }

  Df Resid Df F value Pr(>F)
1  9     1337  0.5256 0.8568

Warning messages:
1: In summary.rq(x, se = "nid", covariance = TRUE) : 93 non-positive fis
2: In summary.rq(x, se = "nid", covariance = TRUE) : 138 non-positive fis

How to interpret the above results??
Does the anova() function give the best model, for tau=0.15 vs. tau=0.3?
Comment: I think it would help to tell people what fit1 and fit2 are
Answer: The interpretation of the result of a joint test of equality of slopes is that overall, the effect of the entire set of coefficients is uniform across quantiles.
Understand that this is not a test of the performance of your two models, it simply tests whether slope coefficients of those models, from several quantiles, can be considered not different.


Loop in a bash script with adb command

Question: I'm beginning with bash ans I'm trying to loop in a shell script to pull different apk's from my android device.
I've got a file with apk's paths
apkpaths.txt

/data/app/com.naver.linewebtoon-1/base.apk
/data/app/com.game5mobile.lineandwater-1/base.apk

I read this file and try to applicate this script but only the first apk is pulled but three times. How can I create a single file app.apk for each apk I pull with the adb command line ?
<code>#!/bin/bash

filename="$1"
while IFS=: true; do
 line=''
 read -r line
  if [ -z "$line" ]; then
    break
  fi
  END=3
  for i in $(seq 1 $END);
    do adb shell cat $line > app$i.apk;
  done
   #echo "$line"
done < "$filename"
</code>
Thank you
Comment: I would suggest removing your for loop that is coded to loop 3x's. Let your while loop read every line from the file and than execute your adb command for each line/apk
Comment: use `adb pull` for binary files.
Answer: <code>#!/bin/bash
fileNum=1
while IFS='' read -r line || [[ -n "$line" ]]; do
    adb shell cat $line > app$fileNum.apk
    let "fileNum++"
done < "$1"
</code>
Comment: Error : fileNum++: command not found
Comment: sorry it should be let "fileNum++"
Comment: That's what you wrote ? Indeed I have a "syntax error: operand expected (error token is "+")"

Loop in a bash script with adb command


add text before block is being displayed in region content

Question: I have a block that I want to display in my Content region which works fine but the block is always fix aligned in the top left corner (float: left property). How can I set it so, that my content displays above the block in my region?
Answer: Assign this css code to one class of your block ( or the #id )
.your-block-class-name:before {
  content: "";
  display: table;
}

Comment: switch the order in admin/structure/block and set the Main page content block before the block-simplenews
Comment: I tried this like: `div#block-simplenews-0:before {
  content: "";
  display: table;
}` but nothing happened, maybe you could have a look at the page yourself: http://spabc.com/content/hills-restoration-process - I'd like to have the block `id="block-simplenews-0"` displayed below `id="block-system-main"`


Modify default browser behavior so that images load in max resolution

Question: I'd like to modify my browser (Firefox Quantum 57.0.1, 64-bit) so that images open in max resolution rather than auto-scaling to fit the browser window when I navigate to an image URL.
My programming background does not include any web development so I wouldn't know where to start on this project; I've experimenting with the developer tools console as a starting point. Based on the readout from the dev tools console and  related posts here I am hypothesized that the HTML snippet <meta name="viewport" content="width=device-width; height=device-height;"> controls default auto-sizing that occurs when I open images. Is there a simple modification I can make to consistently open to max resolution instead of auto-sizing anytime I use the browser to look at a new image?
Am I on the right track? Can anyone provide some pointers? Is this a feasible browser modification?
NB: apologies to the inevitable senior user editing this post for incorrect tags or nomenclature - I don't have any experience in
Comment: https://www.hongkiat.com/blog/disable-image-auto-resize-in-firefox/ this seems to work
Comment: You mean on your own browser?
Comment: @VilleKoo it works! If you'd like to post the steps in an answer I'll mark it correct. Otherwise I'll self-answer.
Comment: I would imagine that user style sheets might come in handy here. Not sure if Firefox supports these, however.
Comment: @domsson Firefox does support CSS stylesheets using the [style editor](https://developer.mozilla.org/en-US/docs/Tools/Style_Editor) tab in the developer tools console. Can you suggest a particular CSS stylesheet "rule" to implement the mod I described?
Comment: @VilleKoo Yeah -- I want to modify my browser so that it opens images in max resolution rather than auto-scaling them. Are dev tools the right place to start or I am totally off in that regard?
Answer:
Type about:config in the Firefox address bar
Search for browser.enable_automatic_image_resizing
Change it to false

source


What does $N(x|\mu, \sigma^2)$ mean?

Question: I am supposed to show that $f(x) = \sum_{k=1}^{K}\pi_k N(x|\mu_k, \sigma_{k}^2)$ complies with the properties of a density function but I have no idea how to do this since I am not sure what $N(x|\mu_k, \sigma_{k}^2)$ means.
I know $X \sim N(\mu, \sigma^2)$ means that the random variable X follows a normal distribution with mean $\mu$ and variance $\sigma^2$. I'm just not sure how $x|\mu_k$ changes things.
This is probably a very silly question but your help will be appreciated.
Comment: It's worth nothing that this is **not** standard notation, so feel vindicated in your confusion.
Comment: @CliffAB what is the standard notation for this? I came to this asking the same question as the OP
Answer: $N(x|\mu, \sigma^2)$ combines the two notations: $x \sim N(\mu, \sigma^2)$ and $p(x| \mu, \sigma^2)$. So it reads: $x$ is normally distributed with parameters $\mu, \sigma^2$.
Answer: Here, it means the normal PDF:
$$\mathcal{N}(x|\mu,\sigma^2)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-(x-\mu)^2/2\sigma^2}$$
The $\mu,\sigma^2$ in given side means that you can treat them as known quantities.
Comment: Ooh ok I see. Thought there was something more to it. Thank you!

What does $N(x|\mu, \sigma^2)$ mean?


Commerce module can't be enabled

Question: I have installed the Commerce module but when I want to enable it, it does not give me the opportunity to check the checkbox, do you know how I can solve it?
Comment: Welcome to Drupal Answers! Did you install the module via composer? If not, maybe a dependency is missing? But that should be mentioned in the "Extend" page or if you use drush it should be reported in the terminal.
Comment: As the project page states, `Commerce 2.x should only be installed via Composer. The zip files on this page are provided for informative purposes only.`
Comment: thank you very much, I'm not very expert, where can I find the composer?
Comment: Get composer: https://getcomposer.org/, how it integrates with Drupal: https://www.drupal.org/docs/develop/using-composer/manage-dependencies
Answer: Manually
If you install the module manually then module dependencies are not getting installed automatically. Some required dependent modules might be missing. If you add these dependent missing modules manually then it works.
Using composer
If you install the module using composer then that module is installed with their dependencies,  and there is no need to manually install the dependency modules.
For best practices use composer for module installation.
Refer to this documentation for the installation of the commerce module :
https://docs.drupalcommerce.org/commerce2/developer-guide/install-update/installation
Also refer to this document for installing modules using composer:
https://modulesunraveled.com/drupal-8-composer-and-configuration-management/installing-and-uninstalling-modules-composer

Commerce module can't be enabled


Learning how to sight sing without prior singing

Question: I am starting music school (masters prep program for adults who have a bachelor's degree in something non-music related) and along with theory, I will need to learn how to sight sing.  I am a 28 year old male with a deep voice, and I simply sing very very poorly; I simply do not sing.
How will I learn how to sight sing if my ability to sing is very, very poor?
If it is possible (I assume it must be) for me to learn, what would be the first things the music school will teach me in an introductory sight singing course in order to prepare me to sight sing?
Thanks.
EDIT: I am a composer and can sight read music, so my theory knowledge and practical knowledge is beyond the basics (intervals, harmony, etc).  I can't "sing" and do not understand how I will be able to walk into a classroom and just start "singing" notes.
Is it just simply a matter of making a vocal noise and matching it to a pitch played on an instrument, for example?
Comment: The usual mantra on this site - find a teacher for at least a couple of lessons. It's by far the easiest6 and best way. If you can't read music, you won't be able to sight-sing anyway. So learn what the dots are about, first.
Comment: Can you be more specific? Is it that you really can't find the notes, or just that you don't like the sound?
Comment: And learn to recognize intervals by ear -- if you don't know what a M3 or m6 sounds like you certainly won't be able to sing the interval!
Comment: OP here: Sorry I forgot to mention that I compose classical and am beyond the basics (I sight read in both clefs, and have composed in alto, soprano, and tenor clefs).  Sorry I figured that was assumed information.
Comment: If it makes you feel better, I am a similar age. Having competed sight singing (all As thanks to nice teachers) and a music degree, I still don't like my voice and don't sing. The challenge for sight singing was learning to control my voice, so it took me a lot more work than the people who were used to singing, even poorly.
Comment: Thanks Josiah; that helps.  I don't particularly look forward to having to sing in front of a bunch of other people, but if it will help my composition then I will.  Do you have any advice for someone like me so that I don't completely drag behind the first semester?
Answer: We don't know the program--you'll need to talk to someone there to find out what exactly the prerequisites are.  Usually this is the kind of question that the teacher for the course you're going to take would be happy to answer.
In general for introductory theory courses they won't care at all about the quality of your voice, only that you can produce more-or-less accurate pitches.  If you have trouble, say, matching a sustained pitch in your range that someone plays on the piano, or singing a simple melody (like "Mary had a little lamb") without wandering far off key, then you may need to work on that first--your program's faculty should be able to connect you with resources.  Otherwise, I'd guess you're ready.  But again that's just a guess, ask someone there.  I'm sure they're used to people having worries about exactly this issue.
Answer: You should start by making sure what your range is ie the notes you can comfortably sing. Baritones also have 'deep' voices make sure you are certain of what type of singer you are exactly.
When you have done this the fun part begins.
You can start of by just singing along with the piano. No words just try to match the sound the piano makes (Be certain the piano is tuned)
Then you can start with basic scales and when you are done with them you could try intervals.
All these things also helps with your aural skills so 20 minutes in front of the piano should help out tremendously with this.
Answer: Unless you are going to be a singer, don't worry too much about vocal quality.  Obviously, there are books you can read on vocal pedagogy to help with healthy singing technique, but probably not necessary in your case; ask your singer friends for some pointers and I'm sure they'll be happy to help you out.
One of the ways I learned to sight-sing that was actually helpful was to get copies of scores and recordings of major classical works, such as the Bach B-minor mass, pick a line to read, hit play and try to keep up.
In a class, it is not the worst thing in the world to lose your sense of tempo, but in any real professional situation, keeping time is more important than anything else, and being able to get back on if you do make a mistake.  This is why the recordings are helpful: they are relentless.
Answer: As others have said: most sight-singing classes don't care if your voice sounds well. It's all about reading, keeping rythm and holding pitch. It's not a voice lesson. You're not becoming an opera singer, you're developing a more intimate relation to written music.
For holding pitch, which I suspect is your main concern, a lot of it is about building confidence, more than voice technique.
First step for me was convincing myself I had the necessary range (being: an octave and a half, almost two, as almost everyone does). I had a lot of help from a tuner-app on my phone. Just make some vocal noise, in your low range, and in your high range, without straining yourself, and notice what notes you reach, you already will be amazed. Thing is: you almost certainly have the range to sing, you just need to practise to make it reliable. And this takes only time.
A second step was to realize that male singing (even when you have a deep voice) in the high range, sounds a bit, well, girlish. It took some time for me to realize that this is part of singing! You're not really singing if you are just using your voice in your normal speaking range. You have to get out of it. Just listen to the radio and realize: all those male singers are singing quite high, pop, rock, classical,... all of them.
Third, realize that to prevent your voice from breaking when going from your high region to the low and vice versa, you need to relax your singing muscles. To be able to relax, while singing relatively easy pieces (as you probably will in the beginning) is mostly a psychological issue. Don't worry, relax! It's ok.
Lastly, just do this, don't be ashamed, you won't be the only one in your class with no or little experience in singing. You're there to learn. Sticking your head out will be the fastests way for you to learn and will probably help the others too, by showing that you don't have to be perfect.


how to give permission to user on their own pods pages content with 'add' and 'edit' options only?

Question: How to give permission to user on their own pods pages content with 'add' and 'edit' options only?  I am using PHP, Apache, MySql and  wordpress.
Please, give me code examples.
I am using following code:
<?php
$object = new Pod('dreams');
$object->ui = array('title' => 'My Pod' ,'add_fields' => array('name' ,'position','photo','bio','eom'),'edit_fields' => array('name' ,'position','photo','bio','eom','approved'));
    //load Pod
    $pod = new Pod('dreams');

    if(current_user_can('administrator')) {
        //set publicForm() visible fields for admins
       $object->ui = array('title' => 'My Dream' ,'add_fields' => array('name' ,'position','photo','bio','eom'),'edit_fields' => array('name' ,'position','photo','bio','eom','approved'));
    pods_ui_manage($object);
    } else if(is_user_logged_in()) {
    // Get the last URL variable
    $slug = pods_url_variable('1');
    $Edit = new Pod('team', $slug);
    $name = $Edit->get_field('name');
    $author_id = $Edit->get_field('author_id'); // GET AUTHOR FROM POD
     $user_id = $current_user->ID;
    global $current_user;   // GET USER INFO
    get_currentuserinfo();
$object->ui = array('title' => 'My Dream' ,'add_fields' => array('name' ,'position','photo','bio','eom'),'edit_fields' => array('name' ,'position','photo','bio','eom','approved'));
    pods_ui_manage($object);
 // $edit_listing = (($author_id == $current_user->ID) || (current_user_can('manage_options') == true) ? true : false); //

}; ?>

Create a Dream

What is this Dream, what do I want to do, accomplish, achieve?

Does this Dream involve someone else?

What tools are available to help achieve this Dream?

What steps can I take to help me achieve this Dream?

<?php  $pod->publicForm($fields); ?>

Now the user can also see and edit all other user posts. But this should not be so.
Answer: In your "ui" array, you want to add an additional 'where' and 'edit_where' clause.
'where' => 'p.author_id = ' . $user_id,
'edit_where' => array('author_id' => $user_id)


Handle jquery event of one page to another page

Question: I am using jquery to opening a lightbox.I am using two pages for it(Because my requirement is
to fetch the lightbox content from another page).Here is my code for fisr page on which i have written the code for opening the lightbox
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

This is the main content. To display a lightbox click here

And here is My Code Where the content for lightbox is
the page in light.html

Hello this is sandeep

        Widevision technology

indore Close

The above code is Working fine though.The problem is in closing the lightbox.Since i have fetch the lightbox content from another page(light.html).My close event code is  as you can see above  written on index.html
$('#close').click(function(){
        $('div.white_content').css("display","none");
    });

The above code is not working but if i move above code to light.html ,it will work.But i want to make it work from index.html.AS the open event is working from this page why not close event?
Answer: Try changing .click(function() { into .live('click', function() {
see jquery live api doc
Comment: alternatively you could also try to bind the click event after the lightbox has been loaded (probably in the callback of your ajax call), but live should generally do the trick
Comment: sidenote: be aware not to bind the click event a second time on the already existing `a#close`


Use insertUI to create different kind of shiny widgets

Question: I have the shiny app below in which the user may select between one or more column names from the  data frame.
name<-c("John","Jack","Bill")
value1<-c(2,4,6)
add<-c("SDF","GHK","FGH")
value2<-c(3,4,5)
dt<-data.frame(name,value1,add,value2)

Then for every selection he makes the relative pickerInput() may be displayed below. The issue is that I would like to set a diffrent widget for specific columns. Let's say that I would like to set those with  numeric values as sliderInput(). I have 2 versions below of the same app. So if any solution is applicable to on of them it would be ok.
app1
library(shiny)
library(shinyWidgets)
library(DT)
# ui object
ui <- fluidPage(
  titlePanel(p("Spatial app", style = "color:#3474A7")),
  sidebarLayout(
    sidebarPanel(
      pickerInput(
        inputId = "p1",
        label = "Select Column headers",
        choices = colnames( dt),
        multiple = TRUE,
        options = list(`actions-box` = TRUE)
      ),
#Add the output for new pickers
      uiOutput("pickers")
    ),

    mainPanel(
    )
  )
)

# server()
server <- function(input, output) {

  observeEvent(input$p1, {
#Create the new pickers
    output$pickers<-renderUI({

      div(lapply(input$p1, function(x){
        pickerInput(
          inputId = x#The colname of selected column
            ,
          label = x #The colname of selected column
            ,
          choices = dt[,x]#all rows of selected column
            ,
          multiple = TRUE,
          options = list(`actions-box` = TRUE)
        )
      }))
    })
  })
}

# shinyApp()
shinyApp(ui = ui, server = server)

app2
library(shiny)
library(shinyWidgets)
library(DT)

name<-c("John","Jack","Bill")
value1<-c(2,4,6)
add<-c("SDF","GHK","FGH")
value2<-c(3,4,5)
dt<-data.frame(name,value1,add,value2)

# ui object
ui <- fluidPage(
  titlePanel(p("Spatial app", style = "color:#3474A7")),
  sidebarLayout(
    sidebarPanel(
      pickerInput(
        inputId = "p1",
        label = "Select Column headers",
        choices = colnames( dt),
        multiple = TRUE,
        options = list(`actions-box` = TRUE)
      ),
      tags$div(id = "add_ui_here")

    ),

    mainPanel(
    )
  )
)

# server()
server <- function(input, output) {

  # store currently selected columns
  selected_columns <- c()

  observeEvent(input$p1, {

    # determine pickerInputs to remove
    input_remove <- !selected_columns %in% input$p1
    input_remove <- selected_columns[input_remove]

    # remove inputs
    if (!is.null(input_remove) && length(input_remove) > 0) {
      for (input_element in input_remove) {
        removeUI(selector = paste0("#", input_element, "_remove_id"))
      }
    }

    # determine pickerInputs to add
    input_add <- !input$p1 %in% selected_columns
    input_add <- input$p1[input_add]

    # add inputs
    if (length(input_add) > 0) {
      for (input_element in input_add) {
        insertUI(
          selector = "#add_ui_here",
          where = "afterEnd",
          ui = tags$div(id = paste0(input_element, "_remove_id"),
                        pickerInput(
                          inputId = input_element
                          ,
                          label = input_element
                          ,
                          choices = dt[, input_element]
                          ,
                          multiple = TRUE,
                          options = list(`actions-box` = TRUE)
                        ))
        )
      }
    }

    # update the currently stored column variable
    selected_columns <<- input$p1
  },
  ignoreNULL = FALSE)

}

# shinyApp()
shinyApp(ui = ui, server = server)

Answer: Check if the selected variable is numeric or character and assign the appropriate widget.  Try this code.
name<-c("John","Jack","Bill")
value1<-c(2,4,6)
add<-c("SDF","GHK","FGH")
value2<-c(3,4,5)
dt<-data.frame(name,value1,add,value2)

# ui object
ui <- fluidPage(
  titlePanel(p("Spatial app", style = "color:#3474A7")),
  sidebarLayout(
    sidebarPanel(
      pickerInput(
        inputId = "p1",
        label = "Select Column headers",
        choices = colnames( dt),
        multiple = TRUE,
        options = list(`actions-box` = TRUE)
      ),
      #Add the output for new pickers
      uiOutput("pickers")
    ),

    mainPanel(
    )
  )
)

# server()
server <- function(input, output) {

  observeEvent(input$p1, {
    #Create the new pickers
    output$pickers<-renderUI({
      div(lapply(input$p1, function(x){
        if (is.numeric(dt[[x]])) {
          sliderInput(inputId=x, label=x, min=min(dt[x]), max=max(dt[[x]]), value=min(dt[[x]]))
        }
        else if (is.character(dt[[x]])) {
          pickerInput(
            inputId = x#The colname of selected column
            ,
            label = x #The colname of selected column
            ,
            choices = dt[,x]#all rows of selected column
            ,
            multiple = TRUE,
            options = list(`actions-box` = TRUE)
          )
        }

      }))
    })
  })
}

# shinyApp()
shinyApp(ui = ui, server = server)

Comment: thanks but only numeric values are displayed now. I want pickerinputs for non numeric and sliders for numeric.


Como alterar a tag Jumbotron no bootstrap no navegador google chrome?

Question: Observem com atenção a imagem;

Agora dá uma olhada no código

JWB Tecnologia

Este portal foi criado para auxiliar as empresas e
            profissionais que buscam informações sobre Sistemas ERP. Para
            ajudá-lo em sua pesquisa, selecionamos as principais informações
            sobre Sistema ERP para que esta ferramenta possa contribuir ao
            máximo para a melhoria da qualidade de seus serviços e a
            competitividade de sua empresa.

            <h:link styleClass="btn btn-lg btn-warning">Download App</h:link>
            <h:link styleClass="btn btn-lg btn-default">Loja Virtual</h:link>
            <h:link styleClass="btn btn-lg btn-warning">Lista de ERP</h:link>

Criei um projeto JSF + Maven, ele está corretamente configurado para ter Bootstrap no projeto, sendo que não consigo mudar a cor da tag  Jumbotron como no modelo abaixo;
http://jsfiddle.net/juanmendez/C4Sjg/
esse é meu código no meu arquivo bootstrap.css
.jumbotron {
    padding-top: 30px;
    padding-bottom: 30px;
    margin-bottom: 30px;
    color: inherit;
    background-color: #eee;
}

modifiquei para ficar assim, mas não tive sucesso na pagina
.jumbotron {
    padding-top: 30px;
    padding-bottom: 30px;
    margin-bottom: 30px;
    background-color: #ff3600;
    color: white;
}

O arquivo que estou tentando alterar é o bootstrap.css, talvez não esteja tendo sucesso por causa de uma bombagem.
A pergunta é;
Como faço para alterar a cor da tag Jumbotron?
OBS: todos os navegadores tenho o resultado esperado somente não tenho no google chrome
===========================================================================
Minha pagina
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<h:head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <h:outputStylesheet library="css" name="bootstrap-theme.css" />
    <h:outputStylesheet library="css" name="bootstrap-theme.min.css" />
    <h:outputStylesheet library="css" name="bootstrap.css" />

    <h:outputScript library="js" name="jquery-2.1.4.min.js" />
    <h:outputScript library="js" name="bootstrap.js" />
    <h:outputScript library="js" name="bootstrap.min.js" />

</h:head>

<h:body data-spy="scroll" data-target="#my-navbar">

            <button type="button" class="navbar-toggle" data-toggle="collapse"
                data-target="#navbar-collapse">

            </button>

            <h:link styleClass="navbar-brand">Quem somos</h:link>

            <h:link styleClass="btn btn-warning navbar-btn navbar-right">Download agora</h:link>

<h:link>Fotos</h:link>

<h:link>Características</h:link>

<h:link>Faq</h:link>

<h:link>Fale Conosco</h:link>

JWB Tecnologia

Este portal foi criado para auxiliar as empresas e
                profissionais que buscam informações sobre Sistemas ERP. Para
                ajudá-lo em sua pesquisa, selecionamos as principais informações
                sobre Sistema ERP para que esta ferramenta possa contribuir ao
                máximo para a melhoria da qualidade de seus serviços e a
                competitividade de sua empresa.

                <h:link styleClass="btn btn-lg btn-warning">Download App</h:link>
                <h:link styleClass="btn btn-lg btn-default">Loja Virtual</h:link>
                <h:link styleClass="btn btn-lg btn-warning">Lista de ERP</h:link>

                Frases de Grandes Empresários Leia com atenção

Seus clientes mais insatisfeitos são sua melhor fonte de
                        aprendizado.

                    Bill Gates

Não deixe o barulho da opinião dos outros abafar sua voz
                        interior. E mais importante, tenha a coragem de seguir seu coração
                        e sua intuição. Eles de alguma forma já sabem o que você realmente
                        quer se tornar. Tudo o mais é secundário.

                    Steve Jobs

Não deixe o barulho da opinião dos outros abafar sua voz
                        interior. E mais importante, tenha a coragem de seguir seu coração
                        e sua intuição. Eles de alguma forma já sabem o que você realmente
                        quer se tornar. Tudo o mais é secundário.

                    Mark Zuckerberg - fundados do Facebook

Inscreva-se agora

Digite seu nome e e-mail

            <form action="" class="form-inline">

                    <h:outputLabel value="Nome" />
                    <h:inputText styleClass="form-control" id="subscription" />

                    <h:outputLabel value="Email " />
                    <h:inputText styleClass="form-control" id="email" />

                <h:button styleClass="btn btn-default" value="Cadastrar" />
            </form>

                Trabalhos Realizados Verifique as Imagens

                    <h:graphicImage library="imagens" name="highway.jpg" />
                    alt="Text of the image" />

Sistema de controle de trafeco

Foi implementado um sistema para o governo do RS

                    <h:graphicImage library="imagens" name="river.jpg" />
                    alt="Text of the image" />

Sistema Integrado em São Lourenço

Foi para o governo do estado

                    <h:graphicImage library="imagens" name="street.jpg" />
                    alt="Text of the image" />

Street heading

Sistema para pavimentação privada

                    <h:graphicImage library="imagens" name="painting.jpg" />
                    alt="Text of the image" />

Ana Paola de Souza Alves

Foi implementado um sistema integrado

                Features. Some of the coolest Features of this app.

This is the heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam
                    mauris tortor, eleifend sit amet fringilla ac, tincidunt id massa.
                    Proin et odio mattis, venenatis lacus vel, faucibus elit

                <h:graphicImage library="imagens" name="imac.jpg"
                    styleClass="img-responsive" />

This is the heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam
                    mauris tortor, eleifend sit amet fringilla ac, tincidunt id massa.
                    Proin et odio mattis, venenatis lacus vel, faucibus elit

                <h:graphicImage library="imagens" name="smartphone.jpg"
                    styleClass="img-responsive" />

This is the heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam
                    mauris tortor, eleifend sit amet fringilla ac, tincidunt id massa.
                    Proin et odio mattis, venenatis lacus vel, faucibus elit
                    777777777777777777777777777777777777777777777777777

                <h:graphicImage library="imagens" name="user.jpg"
                    styleClass="img-responsive" />

This is the Heading

Nam velit est, tempor vel posuere et, auctor a lectus.
                            Aenean gravida, est accumsan dictum rhoncus, lectus mi suscipit
                            lacus, suscipit accumsan augue tellus vitae dolor. Morbi in
                            euismod dui

This is the Heading

Nam velit est, tempor vel posuere et, auctor a lectus.
                            Aenean gravida, est accumsan dictum rhoncus, lectus mi suscipit
                            lacus, suscipit accumsan augue tellus vitae dolor. Morbi in
                            euismod dui

This is the Heading

Nam velit est, tempor vel posuere et, auctor a lectus.
                            Aenean gravida, est accumsan dictum rhoncus, lectus mi suscipit
                            lacus, suscipit accumsan augue tellus vitae dolor. Morbi in
                            euismod dui

                FAQ. Engaging with consumers.

                         Question one?

Lorem ipsum dolor sit amet,
                            consectetur adipiscing elit. Donec egestas non urna in fringilla.
                            Praesent consequat est at feugiat faucibus

                         Question Two?

Lorem ipsum dolor sit amet,
                            consectetur adipiscing elit. Donec egestas non urna in fringilla.
                            Praesent consequat est at feugiat faucibus

                         Question Three?

Lorem ipsum dolor sit amet,
                            consectetur adipiscing elit. Donec egestas non urna in fringilla.
                            Praesent consequat est at feugiat faucibus

Twitter

Facebook

YouTube

© Copyright @ 2015 Desenvolvido por Wladimir

</h:body>

meu projeto
Answer: Acredito que o problema aqui seja parte do que citei nesta pergunta:

Fontes não são exibidas quando usado com JSF

Você não pode carregar o bootstrap.js e bootstrap.min.js juntos

bootstrap.js é pra desenvolvimento
bootstrap.min.js é pra produção

Aqui:
    <h:outputScript library="js" name="jquery-2.1.4.min.js" />
    <h:outputScript library="js" name="bootstrap.js" />
    <h:outputScript library="js" name="bootstrap.min.js" />

Mude para se for produção:
    <h:outputScript library="js" name="jquery-2.1.4.min.js" />
    <h:outputScript library="js" name="bootstrap.min.js" />

Mude para se for desenvolvimento:
    <h:outputScript library="js" name="jquery-2.1.4.min.js" />
    <h:outputScript library="js" name="bootstrap.min.js" />

Quando carrega o bootstrap.js ele carrega também o .map

Com o CSS também, algo como:

Se for produção, use somente:
 <h:outputStylesheet library="css" name="bootstrap.min.css" />
 <h:outputStylesheet library="css" name="bootstrap-theme.min.css" />

Se for desenvolvimento, use somente:
 <h:outputStylesheet library="css" name="bootstrap.css" />
 <h:outputStylesheet library="css" name="bootstrap-theme.css" />

Note que o tema sempre deve vir depois do bootstrap, pra não quebrar a hierarquia.
Não edite os arquivos originais
Ao invés de modificar os arquivos do bootstrap, que ao meu ver é uma péssima pratica pois pode conflitar com updates futuros, você deve criar um .css a parte e ele deve vir depois dos demais, deve ficar assim:

Ambiente de desenvolvimento:
<h:head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <h:outputStylesheet library="css" name="bootstrap.css" />
    <h:outputStylesheet library="css" name="bootstrap-theme.css" />
    <h:outputStylesheet library="css" name="main.css" />

    <h:outputScript library="js" name="jquery-2.1.4.min.js" />
    <h:outputScript library="js" name="bootstrap.js" />
</h:head>

Ambiente de produção:
<h:head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <h:outputStylesheet library="css" name="bootstrap.min.css" />
    <h:outputStylesheet library="css" name="bootstrap-theme.min.css" />
    <h:outputStylesheet library="css" name="main.css" />

    <h:outputScript library="js" name="jquery-2.1.4.min.js" />
    <h:outputScript library="js" name="bootstrap.min.js" />
</h:head>

Neste arquivo main.css adicione:
.jumbotron {
    padding-top: 30px;
    padding-bottom: 30px;
    margin-bottom: 30px;
    color: inherit;
    background-color: #eee;
}

Ambiente de desenvolvimento
É o ambiente usado apenas para a criação, desenvolvimento e testes do software criado ou mantido por você ou por uma equipe.
Ambiente de produção
É o ambiente usado apenas para gerar a produção ou o trabalho que o software deve realizar, por exemplo se for um software de fluxo de caixa usado em uma rede (interna ou externa) quando o usuário o usa é o que chamamos de "produção". Neste ambiente geralmente (preferencialmente) não fazemos atualizações, manutenções e testes diretamente no software, já que isto pode afetar o funcionamento, para isto usamos o ambiente de desenvolvimento e depois de tudo corrigido (geralmente) colocamos o servidor em modo de manutenção ou "leitura" e então você deve subir os arquivos.
Arquivos .min
Os arquivos .min.js e .min.css são usados somente (geralmente) no ambiente de produção, é uma versão compactada do CSS e JS originais.
No ambiente de desenvolvimento usamos apenas o .js e o .css (sem .min).
Comment: @wladyband mesmo com criando um main.css? Você editou muito o arquivo bootstrap.css?
Comment: @wladyband Faça backup da pasta css, apague tudo que tiver haver com bootstrap da pasta, baixe o bootstrap limpo (sem edições) e copie o bootstrap.css e bootstrap-theme.css "limpos" na pasta CSS, após isto crie o arquivo main.css e coloque ele nesta ordem: `

`. Então edite apenas o main.css.
Comment: @wladyband Editei a resposta, nela agora tem o código de como deve chamar o main.css e a ordem que deve ficar os .css, espero que ajude.
Comment: nossa cara, muito obrigado pegou, está funcionando certinho, valeu mesmo.
Comment: muito obrigado por me informa, mas o problema persisti.
Comment: eu somente alterei aquela parte do código do bootstrap.
Answer: Eu não entendi direito se esse bootstrap que vc tá alterando é o que vc criou ou é o css do thema do bootstrap..
Mas para alterar existem tres maneiras:
1 - na hierarquia dos seletores (ex. #SeletorPai .jumbotron {});
2 - na hierarquia dos arquivos (ex. chamar o arquivo bootstrap.css depois de todos os outros arquivos css);
3 - ou colocar a tag !important ampos o propriedade (ex.  background-color: #ff3600 !important; )
Uma dica é manter o padrão do documento.. se vc tá usando o nome da cor, continua usando o nome, se tá o usando os hexadecimal, usa somente os hex (substitui whit por #fff)


How to pull data from Service to Activity?

Question: Im working on my first app with service. I have created normal android service that handles GPS and few other things. Everything seem to work but... I don't know how to interact with that service from Activity.
My service class holds User class, and that class holds current GPS position and some other variables.
public class PxService extends Service
{
    public static final User user;
...

}

My goal is to access User class (or members) from activity.
My service is not bound service, because I want it to run when my app is closed (as far I know bound service cannot work when app is not running, but maybe I'm wrong).
Any help with that?
Answer: You can saving User in database.
Or you can Implement for User class interface Parcelable (or Serializable) and flush user object in intent BroadcastReciever like that:
in service
Intent intent = new Intent("YOUR_ACTION);
intent.putExtra("user", user);
sendBroadcast(intent);

and in BroadcastReceiver
@Override
public void onReceive(Context context, Intent intent) {
    if (intent.getAction().equals("YOUR_ACTION")) {
        User user = (User) intent.getParcelableExtra("user);
    }
}

Don't forget register your broadcastreciever.
This is simple article how to using this method.
http://www.truiton.com/2014/09/android-service-broadcastreceiver-example/
UPDATE
Comment by this "as far I know bound service cannot work when app is not running, but maybe I'm wrong". You can use Service method startForeground(int id, Notification notification)
Documentation:

Make this service run in the foreground, supplying the ongoing
  notification to be shown to the user while in this state. By default
  services are background, meaning that if the system needs to kill them
  to reclaim more memory (such as to display a large page in a web
  browser), they can be killed without too much harm.  You can set this
  flag if killing your service would be disruptive to the user, such as
  if your service is performing background music playback, so the user
  would notice if their music stopped playing.
Comment: But I want that data to be available "on Activity demand", not "when service broadcasts it"...
Comment: Notifies service via same broadcast) which will initiate the sending user by other broadcast))
Comment: I do not know essentially of your problem. Maybe better method be a an Activity call startService, and wait until service work all it needed and returns User?


How to convert a .crt string into a .der certificate binary and save it into Redis?


Proof the increment variance of the Scaled Random Walk

Question: Start by defining the Symmetric Random Walk:
$$ M_t = \sum_{i=1}^{t}X_i, ~~ \text{with}~X_0=0  $$
where $X_i$ is equal to 1 or -1 with $p=(1-p)=0.5$.
Consider $t > s$, the variance of its increments is:
\begin{equation}
\begin{split}
VAR(M_t - M_s) & =  VAR \Big( \sum_{i=s+1}^tX_i\Big)~\text{by indepence of} ~ X_i \\
& = \sum_{i=s+1}^t VAR(X_i) = t-s
\end{split}
\end{equation}
Now define the Scaled Symmetric Random Walk:
$$ W^{(n)}(t) = \begin{cases} \dfrac{1}{\sqrt{n}}M_{nt}, & \mbox{if }~t=\dfrac{m}{n}~\in~  \mathbb{N} \\ \mbox{linear interpolation}, & \mbox{if } t~\in~ \Big( \dfrac{m}{n}, \dfrac{m+1}{n} \Big) \end{cases} $$
Now suppose $~t > s~$ and $~t = l/n~$ and $~s = m/n~$ are integers, now how is possible to obtain the following variance?
$$ VAR(W^{n}(t) - W^{n}(s))   $$
I tried this way:
\begin{equation}
\begin{split}
 VAR(W^{n}(t) - W^{n}(s)) & = VAR\Big( \dfrac{1}{\sqrt{n}} (M_l - M_m) \Big) \\
& = \dfrac{1}{n}VAR(M_l - M_m)
\end{split}
\end{equation}
Then by applying the passages of the normal random walk reported above, I obtain:
$$ VAR(W^{n}(t) - W^{n}(s)) = \dfrac{1}{n} (t-s) $$
But I know that the correct formula should be $t-s$. Where is my error?
Answer: You forget an $n$ in the index. After "I tried this way", second equivalence, you should apply:
$$
M_l - M_m = M_{tn} - M_{sn}
$$
Comment: No because it is $M_{tn}$ that becomes $M_{l}$ since $t = l/n$.
Comment: Okay then the problem is later, see above.
Answer: In the last step of the derivation, you applied the preliminary result incorrectly.  The correct substitution is $l$ and $m$ instead of $t$ and $s$.
\begin{align}
\frac{1}{n}\operatorname{Var}(M_l - M_m) = \frac{1}{n}(l - m). \tag{1}
\end{align}
Now substitute $l = tn,~ m = sn$ back to $(1)$ yields the desired formula.
Comment: I edited your post by using the `\operatorname` as it was only used once and subsequently removed the space at the beginning (& +1).
Comment: Thank you. I have been noticing the extra space or line at the beginning when preamble is used for a while.  Don't like it either.


Paypal transaction tracking with Wordpress insert query?

Question: I have done a transaction by sandbox mode on PayPal and I am using the Wordpress platform. The problem is my insert query was not executed.
After transaction, I have redirected the page from sandbox to xyz.com/payments-recieved and here I have printed the array and got this
Array
(
    [tx] => 44K35922JH447994H
    [st] => Completed
    [amt] => 29.00
    [cc] => USD
    [cm] =>
    [item_number] =>
    [sig] => NXsJYzHJsIoReedCjkhnpWPQgoqLa5j4fAxcqk+CxJqgVHjdlBB/yWx0h4JVez/e2k+OOKeuhdgh/YxcD0bcR8JwmCd3GFE5N2UxoOws2JusqegLytKpcp6PmEb92aj9B1+e6MMHOf5VKjwX0z50imRiRtjYUSRasFT5IKiNbyA=
)

After that I am trying to insert all the details into the table and here is my full code.
<?php
    /*
        Template Name: All Payments History
    */
    get_header();

    echo "Thanks for choosing our plan
";
    echo "
";print_r($_REQUEST);

    global $wpdb; //global query variable

    if($_GET['st']=="Completed") /*check if transaction successfull or not*/
    {
     $item_transaction = $_GET['tx'];
     $item_price = $_GET['amt'];
     $item_currency = $_GET['cc'];
     $item_no = $_GET['item_number'];
        $wpdb->insert("wp_paypal_payments_tracking", array(
        "transaction_id" => $item_transaction,
        "amount" => $item_price,
        "currency_type" => $item_currency,
        "item_number" => $item_no,
        ));
        echo "Payment Done Successfully";
    }
    get_footer();
?>

How we can fire insert query is there any problem in my code, please let me know and help me out.
Best Regards!!!
Comment: what error is showing ?
Comment: Switch on error showing $wpdb->show_errors();
Comment: In which file I can use this? And what I will get after enable this.? Dear please let me know @Andrew Schultz
Comment: @Campy just put it after global $wpdb; line.
Comment: @AndrewSchultz ok let me check this what it is showing and get back to you.
Comment: @AndrewSchultz Hey dear I have done with another transaction but Don't find any errors. What can I do now?
How I insert the details in the table? Please help.

And after transaction I have received this
Array
(
    [tx] => 3RA54961H14867235
    [st] => Completed
    [amt] => 29.00
    [cc] => USD
    [cm] =>
    [item_number] =>
    [sig] => scLH/oMz+Q0+arHSabEPju068IFOcpsnu5Mb77AkvDJ0S9LO0ZOjvLx68ojre4Y2ZWFB/dWNz3RtzCzwiY5p5zI8uRhbPoBZRwlIOTU8XRqif9Ni2g/E/Wc4LL6gs0fpo618MN4pFnbina2sYi6fyzhOQoS5se+4vBywzhG0X0E=
)
Comment: Is there anyone who can help me please??
Answer: You can insert using the query, where wp_paypal_payments_tracking is your table name, you can change it
if ( !empty( $_REQUEST) && $_REQUEST['st']=='completed' ){
    $wpdb->insert( 'wp_paypal_payments_tracking', array(
        'tx' => $_REQUEST['tx'],
        'st' => $_REQUEST['st'],
        'amt' => $_REQUEST['amt'],
        'cc' => $_REQUEST['cc'],
        'cm' => $_REQUEST['cm'],
        'item_number' => $_REQUEST['item_number'],
        'sig' => $_REQUEST['sig'],
    );
}

Comment: I will check and let you know mate.
Comment: Great, keep it up @Campy


Adding multiple user inputs into one variable in Bash

Question:
I am fairly new to unix bash scripting and need to know if this is possible. I want to ask user for their input multiple times and then store that input in to one variable.
userinputs=   #nothing at the start

read string

read string
 #this should add this input along with the other input

so if the user enters "abc" when asked first time, it add's "abc" in $userinputs
then when asked again for the input and the user enters "123" the script should store it in the same $userinputs
this would make the $userinput=abc123
Answer: The usual way to concat two strings in Bash is:
new_string="$string1$string2"

{} are needed around the variable name only if we have a literal string that can obstruct the variable expansion:
new_string="${string1}literal$string2"

rather than
new_string="$string1literal$string2"

You can also use the += operator:
userinputs=
read string
userinputs+="$string"
read string
userinputs+="$string"

Double quoting $string is optional in this case.

See also:

How to concatenate string variables in Bash?
Comment: can I use this in a while loop to keep asking for the user's input until they enter a certain character like * and all the users input are saved in just one variable?
Comment: Yes, @M.Azeem, you could do that.
Answer: You can concatentate variables and store multiple strings in the same one like so:
foo=abc
echo $foo # prints 'abc'
bar=123
foo="${foo}${bar}"
echo $foo # prints 'abc123'

You can use the other variables, or the same variable, when assigning to a variable, e.g. a="${a}123${b}". See this question for more info.
You don't have to quote the strings you're assigning to, or do the ${var} syntax, but learning when to quote and not to quote is a surprisingly nuanced art, so it's often better to be safe than sorry, and the "${var}" syntax in double quotes is usually the safest approach (see any of these links for more than you ever wanted to know: 1 2 3).
Anyway, you should read into a temporary variable (read, by default, reads into $REPLY) and concatentate that onto your main variable, like so:
allinput=
read # captures user input into $REPLY
allinput="${REPLY}"
read
allinput="${allinput}${REPLY}"

Beware that the read command behaves very differently depending on supplied switches and the value of the IFS global variable, especially in the face of unusual input with special characters. A common "just do what I mean" choice is to empty out IFS via IFS= and use read -r to capture input. See the read builtin documentation for more info.


How to correctly run cables on servers in a data center?

Question: I've read about a few key points, e.g. run all ethernet cables on the right side, all power on the left side, but if possible I'd like to know what you guys do from experience? For example, how do you deal with different cable lengths, where do you put the slack, yet keep it orderly? What's important to keep the cables easily accessible for maintenance?
Thanks guys!
Comment: Small world, I'm just doing some digging on this myself (new rack).  Not sure how you can keep power to one side if you go down the dual PDU route.  One thing keeps recurring - cable ties (plastic or velcro) and lots of them!
Comment: http://reddit.com/r/cableporn
Answer: From experience we don't use the "cable management arms" because they just get in the way and impede airflow. That's just us though, you'll find lots of arguments for and against and its not a matter of right or wrong, it's matter of "right for you".
Cabling:

I like the idea that network cabling runs down one side and power the other where possible. Don't let this become a religion if your needs make this impossible, however. Sometimes you have power requirements that make this impossible - whatever else you do, you should maintain separation of power and data cables as much as possible and certainly never bundle them together.
You need to label all cables, both ends. Have a dymo labeller available at all times and don't be shy about using it to label anything that might be confusing.
Plan cable runs, and try and use cable of the right length.
Keep different types of network cabling seperate. Don't mix bundles of different kinds of cables.
Remember bend radius - don't pull cable tight.
You will need a lot of cable ties, both velcro and plastic, use the plastic strips to hold cable that you expect to be there for long term access, and use velcro for stuff that might be changed. Remember that you're not just keeping the place tidy with these ties, you're supporting the cable too.
Don't "pinch" cable too tightly with plastic ties either, remember that you can damage the cable both by pinching it and by cutting the wrong thing later if you've made it just too gosh darn tight to get your cutters around just the plastic tie. And this could really ruin your day if its a power cable - data centres can be dangerous places - no really, I've had electric shocks twice (due to faulty equipment, not me cutting power cables) and trust me, it stops being funny when it starts being you.
If you have a suspended floor, or overhead cable baskets, use them. They can be great for cable runs between cabinets, certainly much better than the cats cradles through the side panels I've seen. You'd only want stuff that was permanent done this way though and don't forget to label both ends.

Other considerations: Cabling can be more than just network and power cables, and good cabinet layout is more than just cabling.

Think about where you will site SAN boxes, tape libraries and switches in a cabinet and plan around good access to those. (don't forget to keep tape libraries at a convenient height for changing tapes!)
Don't forget to leave space for a KVM box plus monitor tray if you need one - and room to run cables for it of course.
Make use of both sides of the cabinet - switches should go at the back of the cabinet.
Whatever you do, remember airflow - cool air should come in at the 'front' of the cabinet and leave at the back. Don't install the servers the wrong way round and don't impede airflow.
Think about how the cabinet will be used - do people need to access it frequently? Will changes be made to hardware on a frequent basis? Plan accordingly.

Most importantly of all
Whatever else you decide to do, decide to document it as a standard and stick to this standard. Being consistent is one of the most important things you can do.
Answer: You should definitely keep power and Ethernet separated as much as possible, to prevent inductive loading of the low-voltage Ethernet from the high voltage/current A/C.  In building code, low voltage cannot run parallel to high voltage.
We get rid of cable slack by buying 12", 18", and 24" power cables so we can use exactly as much cable as needed.  Ditto for the Ethernet side, though usually there's some slack to take up there.  So in those cases I loop the cable at the server end and zip-tie them, making sure not to make the bends too tight -- say 3/4" loop where they bend.
For us, the KVM is more problematic, because our KVM supplier stopped making the 2', 3', and 4' cables, so everything is 6'.  But, same sort of thing, loop at the server end.
We use the 3M "command adhesive" loops on the sides of the racks to keep the wires tidy off to the side.  These work very well, fit in pretty much any cabinet, and are relatively cheap.
Answer: It helps if there is some cable management support, then just follow it. For example, Dell offers an 'arm' that can be attached into the back of the server.
If this is not available then you need to plan ahead. Normally you would have telco equipment (switches, firewall, routers etc.) at the top, so all cables for network will
fall down.
It depends by the length of the power cords but I think the best will be to install power switches in the middle and that goes well with short power cables, again if you have them.
It is always a good idea to pull network cables on one side and power on the other side.
Some people  leave 1U space free in between equipment but this is if you can afford it.
I would search on Google for cable management as well to find some pictures.
Comment: If you do leave a gap between equipment that gap should be filled with a blanking plate.
Comment: I thought the 1U space in between equipment is bad because it allows cold aisle air to mix with hot aisle air, instead of forcing the cold air through your server? Also I didn't buy the Dell Management Arm because I read so many bad reviews about it (blocking air flow etc.).
Comment: yes -sorry you will need the blanking plate. the benefit of this is you have more space to maneuver your cables.


What is a good program structure for a simple hitTest multi level game in AS3?

Question: I already made a 25 level simple hitTest game (mechanics are similar to flappy bird, when you hold down your mouse button the hero goes up, and if you aren't holding it he goes down and the goal is to come to the right side of the screen) and I have used a very bad code in my opinion. I have made one layer and one frame for all 25 levels, and in the frame I have a onEnterFrame function and in it 25 of these
if(currentFrame==x){
do something
}

because in some levels I have objects with certain instance names which I don't have on other levels, and if I don't have them on other levels, and they are mentioned in the code outside of the if function I get a syntax error (null object not found, I think it's error #1009) and also my game lags very much on AIR for android. In AS2 I have made this game much better but AS3 is pretty much different and I can't use the same 'strategy' for making the game. I would just appreciate if anyone could help me and tell me what should my code look like, like should I somehow avoid the syntax error of missing objects of certain instance names, or should I somehow write the code in each frame... Thanks in advance!
Answer: Luka, a simple way that you can avoid that problem is to simply check whether the object exists before you execute your code.
if(mc && /*other conditions*/){
//execute code
}

I feel your pain when it comes to putting a game together in a sloppy way. A couple years ago I put together an AS2 game that was spread out across about 25 flash files! I was too inexperienced and ignorant at the time to realize that that planning was not the most efficient.
Answer: AS3 is an object oriented programming language while AS2 is basically just a script language, they are not too similar... You better not use the same strategy as you did in AS2 because they are so different, that it will fail. Try to use classes, arrays / vectors. For example, create a Wall class and put the instances inside an array or a vector, then loop through the array/vector and search for collisions, if you remove a wall then remove it from that array/list aswell.


Why have there been more 100-win and 100-loss teams in MLB?

Question: I read an article which noted that there have been 3 or 4 100-win and 100-loss teams in Major League Baseball every season since 2018, but not very often before then.
Years with three or more 100-win teams:
2022: 4
2021: 3
2019: 4
2018: 3
2017: 3
2003: 3
2002: 3
1998: 3
1977: 3
1942: 3
Years with three or more 100-loss teams:
2022: 4
2021: 4
2019: 4
2018: 3
2002: 4
1985: 3
1965: 3
1964: 3
1962: 3
1961: 3
1954: 3
1912: 3
1908: 3
Why is this happening more often in recent years?
Answer: Different eras in MLB have had different reasons for this, but mostly it comes down to the incentive structures for teams competing.
In the 1960s, there was considerable expansion, and even beyond expansion you had teams like the Athletics which were essentially an expansion team in 1961 (in the pre-Chuck Finley era they were basically a AAA team for the Yankees, despite actually an MLB team), hence the 1961-1965 100 loss teams.
In the era between then and 2010 or so, teams made a good part of their money on ticket sales.  A team that loses 100 games isn't selling many tickets.  Look at this history of baseball revenue; it's somewhat old, but it includes this point:

By 2002, media revenue exceeded gate revenue for the average MLB team.

Prior to 2002, thus, gate revenue was more than the media revenue.  Thus, a team needed to at least make some attempt to win to bring in fans (unless they were the Cubs, anyway).  Winning 70-80 games was useful, even if it didn't have a shot at the playoffs; fans wanted a decent chance to watch a winning game.
In the 2018+ era, the incentives for teams to win 80 games are basically gone - television revenues are off the charts.  Just looking at local television revenue, the total league sum was over 2 billion dollars in 2019.  Compare that to gate revenue - a small market team that gets even 20k fans per game for 80 games (1.6 million total attendance) is making maybe a hundred million?
The one we can easily see is the Atlanta Braves - as they're owned by a publicly traded company - and they made $135M in gate revenue last year, which of course was a bit of a banner year for them; in down years they. made more like $50M.  So fielding a World Series winner was worth $85M to them - not bad, for sure.  But look at the earlier bumps in that graph; fielding a decent team is only worth around $10M, which is much less than their TV revenue (over $80M under their old contract, and going up $120M by 2027, see the current details on the Braves TV contract.)
Thus, there's a huge incentive to do really well - they increased their revenue by the same amount as their TV contract alone by winning the World Series!  But there's very little incentive to field a decent but not amazing team.  Instead, the incentive is perverse - pay nothing to the players so you make as much as possible (since there is no real salary floor), and win very few games, and then get better draft picks for a few years.  This is the Houston Astros and Chicago Cubs models that netted both teams a World Series win.
Those wins, in 2016 and 2017, undoubtedly had some direct relation to the timing you see above - some teams saw the total teardown/rebuild model as more effective and thus were fine with 100+ losses, and the 100+ loss teams contributed to more 100+ win teams as well as some teams going more "all in".


Installing the Waypoints plugin

Question: I'm using Drupal 8.5.4 and I have installed the Advanced CSS/JS Aggregation module. I'm trying to install the Waypoints plugin without success via the module: jQuery waypoints (still on alpha1 for D8). Is there a way to simply install the plugin manually?
Answer: Yupp, simply download the Waypoints library, extract and rename the folder to just waypoints, then put it into themes/custom/MYTHEME/libs or into modules/custom/MYMODULE/libs and follow one of the following instructions:
Adding stylesheets (CSS) and JavaScript (JS) to a Drupal 8 theme
Adding stylesheets (CSS) and JavaScript (JS) to a Drupal 8 module

Basically all you have to do is to create the corresponding MYTHEME/MYMODULE.libraries.yml file
waypoints:
  js:
    libs/waypoints/lib/jquery.waypoints.min.js: {}
  dependencies:
    - core/jquery

and then attach the library to all pages via hook_page_attachments() or hook_page_attachments_alter() inside the MYTHEME.theme or MYMODULE.module file.
<?php

function MYTHEME/MYMODULE_page_attachments_alter(&$attachments) {
  $attachments['#attached']['library'][] = 'MYTHEME-or-MYMODULE/waypoints';
}

Installing the Waypoints plugin


Drupal 7 sessions wiped after changing settings.php

Question: Yesterday afternoon I had an administrator uncomment and modify the $base_url variable in our production environment. Any changes made in the repository fires off a redeployment which has never been an issue. Upon the server coming back up, we started receiving complaints that user's who were now logged out.
Does changing settings.php do something behind the scenes that I'm unaware about (session.cookie_lifetime or session.gc_max_life).
I do not have access to the database nor can I retrieve it from our prod environment.
Any help is appreciated so that we don't run into this issue again!
Answer: This is likely due to the value changing, which changes the way they are recorded:
https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/drupal_settings_initialize/7.x
$base_url and $cookie_domain - changing these values in settings.php will affect any user who was authenticated before if the values change, and will need to re-authenticate.
Comment: Yup, those values affect the cookie domain, so the old cookie no longer matches.


Como criar um processo filho a um processo existente no windows - C/C++

Question: Preciso chamar via CreateProcess() ou outra função do windows um processo e vincular a um processo já existente, é possível?
obrigado!
Comment: Especifique melhor o que está querendo, tente por um exemplo.
Comment: Um programa x está executando no windows, quero via outro programa, identificar esse processo (essa parte já fiz) e criar um outro processo (chamar outro programa) vinculado como sub-processo ao programa que eu identifiquei anteriormente. No linux usa-se o comando Fork() para atribuir um subprocesso a um processo já rodando. Gostaria de fazer algo semelhante no windows.
Comment: O que consegui foi criar um sub-processo do programa que estou executando, mas nao consegui criar um subprocesso de um outro programa (processo).
Comment: Como se faz isso no Linux?  Que eu saiba, `fork()` só cria processos filhos do processo que o invoca, nunca de um terceiro processo. Como é que um terceiro processo, que não sabe que ganhou um filho, seria capaz de coletá-lo quando terminar (via `waitpid()` e aliados)?
Comment: é verdade @Wtrmute o fork() cria somente filho dele mesmo. Mas minha indagação é justamente essa, é possivel criar um processo e vincular a um terceiro?
Answer: Infelizmente, não. A CreateProcess() (bem como a fork() em Unix) criam processos ligados ao processo que os criou (por exemplo, é a ele que eles reportam status de saída, é dele que eles herdam as variáveis de ambiente, etc.). Um terceiro processo não saberia que teve um filho criado por outrem para receber o status de saída ou coisa que o valha.
Se você precisa criar um processo que se comunique com outro, já existente, o Windows tem várias opções de Comunicação Interprocessual (IPC, na sigla em inglês) que você pode tentar usar. Mas o processo preexistente tem que dar suporte a esses métodos de comunicação.
Em ultimíssimo caso, DebugActiveProcess() e aliados (principalmente WriteProcessMemory() podem te permitir (sob certas circunstâncias) a injetar informação num processo ativo, mas o modo de determinar o mapeamento de variáveis para endereços de memória é extremamente não-trivial. Adicionar código, então, para fazer com que o processo depurado execute CreateProcess() ele próprio e gere o processo físico exige um conhecimento de linguagem de máquina bastante profundo, e pode no final das contas não atender o seu verdadeiro requisito, seja ele qual for.


Build em slave Jenkins com JDK não previamente instalado

Question: Eu tenho um servidor Jenkins que orquestra meu build. De modo geral, ele realiza builds mais leves, mas eu preciso do slave para fazer o build de projetos GWT pelo SSD. Eu tenho alguma liberdade com esse slave, mas ele é um recurso emprestado de outra empresa.
Por sinal, nessa máquina que a outra empresa cedeu gentilmente, existe um Jenkins servidor no qual se realiza o build do produto dessa outra empresa. E não gostaria de importunar com eventual mudança de JDK sem ter controle de que a mudança será completamente sandboxed para não afetar o produto alheio.
Opções de JDK de builds disponíveis:

Configurei o Jenkins para fazer o build com JDK8u91 conforme a imagem:

Obtendo a seguinte mensagem de erro:

Installing PATH/TO/SLAVE/tools/hudson.model.JDK/JDK_8u91/jdk.exe
  [JDK_8u91] $ PATH/TO/SLAVE/tools/hudson.model.JDK/JDK_8u91/jdk.exe /s ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress INSTALLDIR=PATH\TO\SLAVE\tools\hudson.model.JDK\JDK_8u91 /L PATH\TO\SLAVE\tools\hudson.model.JDK\install2115761959202298069log
  ERROR: SEVERE ERROR occurs
  org.jenkinsci.lib.envinject.EnvInjectException: java.io.IOException: Cannot run program "PATH/TO/SLAVE/tools/hudson.model.JDK/JDK_8u91/jdk.exe" (in directory "PATH\TO\SLAVE\hudson.model.JDK\JDK_8u91"): CreateProcess error=740, A operação solicitada requer elevação
  at org.jenkinsci.plugins.envinject.service.EnvInjectVariableGetter.getBuildVariables(EnvInjectVariableGetter.java:91)
    [... linhas omitidas por aparentarem serem irrelevantes ...]
  Caused by: java.io.IOException: Cannot run program "PATH/TO/SLAVE/hudson.model.JDK/JDK_8u91/jdk.exe" (in directory "PATH\TO\SLAVE\tools\hudson.model.JDK\JDK_8u91"): CreateProcess error=740, A operação solicitada requer elevação
  at java.lang.ProcessBuilder.start(Unknown Source)
    [... linhas omitidas por aparentarem serem irrelevantes ...]
  Caused by: java.io.IOException: CreateProcess error=740, A operação solicitada requer elevação
      at java.lang.ProcessImpl.create(Native Method)
    [... linhas omitidas por aparentarem serem irrelevantes ...]

Acessei o servidor slave e rodei a linha de comando de instalação manualmente no prompt com permissões de administrador:
PATH/TO/SLAVE/tools/hudson.model.JDK/JDK_8u91/jdk.exe /s ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress INSTALLDIR=PATH\TO\SLAVE\tools\hudson.model.JDK\JDK_8u91 /L PATH\TO\SLAVE\tools\hudson.model.JDK\install2115761959202298069log

Porém, ao tentar fazer o build novamente, obtive exatamente a mesma mensagem de erro. Como se o Jenkins não tivesse identificado a existência do JDK recém instalado.
Ao tentar selecionar JDK8u25, o Jenkins pensou que estava instalado porque não tentou rodar o instalador, mas na real está com uma inconsistência no sistema porque o executável não se encontra no lugar desejado:

[projeto-gwt] $ OTHER\JENKINS\tools\hudson.model.JDK\JDK_8u25\jdk1.8.0_25/bin/java -cp PATH/TO/SLAVE/maven31-agent.jar;PATH\TO\SLAVE\tools\hudson.tasks.Maven_MavenInstallation\MVN_311\boot\plexus-classworlds-2.5.1.jar;PATH\TO\SLAVE\tools\hudson.tasks.Maven_MavenInstallation\MVN_311/conf/logging jenkins.maven3.agent.Maven31Main PATH/TO/SLAVE/tools/hudson.tasks.Maven_MavenInstallation/MVN_311 PATH\TO\USER\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\3\893ffc3-1f519d29 PATH/TO/SLAVE/maven31-interceptor.jar PATH/TO/SLAVE/maven3-interceptor-commons.jar 51822
  ERROR: Failed to parse POMs
  java.io.IOException: Cannot run program "OTHER\JENKINS\tools\hudson.model.JDK\JDK_8u25\jdk1.8.0_25/bin/java" (in directory "PATH\TO\SLAVE\workspace\GeoSales_Portal\portal"): CreateProcess error=2, O sistema não pode encontrar o arquivo especificado
      at java.lang.ProcessBuilder.start(Unknown Source)
    [... linhas omitidas por aparentarem serem irrelevantes ...]

Como fazer a instalação do JDK via Jenkins no slave sem precisar de acessos elevados?
Ou então, como contornar essa situação, instalar de modo sandboxed o JDK e conseguir indicar ao Jenkins isso?

Sobre corrigir o projeto GWT para fazer o build ficar rápido... estamos trabalhando nisso. São 109 classes que tratam das requisições assíncronas do GWT, feitos passando HashMap e recebendo List ou List<HashMap> como resposta. Sim, foi feito raw originalmente. Mas o trabalho do legado é muito grande para corrigir, estamos trabalhando desde o ano passado entre uma customização e outra para diminuir o tempo que o GWT fica processando o oráculo tipando as coisas, ou usando classes específicas para o fim necessário.
Mas isso não é viável consertar no curto prazo...
Comment: faz sentido, jnlp é extensao de Java Web Start, aqueles serviços em que você baixa um applet... Nesse link q colei uma das possiveis saidas é rodar o agent JNLP como serviço no Windows remoto.
Comment: O slave está rodando como serviço de Windows lá do outro lado? Talvez isso aqui dê uma luz (nao tento responder não tenho nenhuma maquina Windows aqui pra tentar replicar o problema, haha): https://community.smartbear.com/t5/TestComplete-General-Discussions/Jenkins-execution-gt-The-requested-operation-requires-elevation/td-p/144347
Comment: @nunks.lol não é serviço, `jnlp` faz sentido? Esse nome me veio à cabeça
Comment: @nunks.lol, minha VPN não está funcionando. Segunda eu tento explorar essas opções
Answer: Ainda estou lutando para tentar solucionar de modo mais elegante. Considerei a resposta do @nunks.lol elegante, pondo o serviço e tudo o mais, mas como o servidor é Windows eu simplesmente não consegui fazer muito.
Depois de cansar de resolver elegantemente, resolvi tentar opções na marra. Então, encontrei esse link aqui que fala sobre configurar JDK no Jenkins e percebi um detalhe importante:

JDK can also be installed by intimating Jenkins to do the task. The check box install automatically needs to be checked in this case.

Em tradução livre:

JDK também pode ser instalada intimando o Jenkins para realizar a tarefa. O check box "install automatically" precisa estar checada neste caso

Bem, eu já havia conseguido instalar manualmente o JDK desejado. Então, e se eu desejasse simplesmente evitar a instalação automática?
Bem, executei a instalação manual:
PATH/TO/SLAVE/tools/hudson.model.JDK/JDK_8u151/jdk.exe /s ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress INSTALLDIR=PATH\TO\SLAVE\tools\hudson.model.JDK\JDK_8u151 /L PATH\TO\SLAVE\tools\hudson.model.JDK\install2115761959202298069log

E, na configuração das JDKs do Jenkins, adicionei a JDK JDK_8u151_SLAVE com o check "install automatically" desselecionado. Ficou assim:

Então, no build do job que necessitava usar o slave, selecionei para rodar com essa JDK:

Com isso, o Jenkins não tentou instalar por cima do JDK instalado, usando o já instalado.
Answer: Decidi registrar aqui uma resposta, a partir deste Q&A e da documentação da ferramenta TestComplete, especificando configurações necessárias para execução em instalações Jenkins em Windows.
O que me fez chegar a tal artigo foi o cerne da mensagem de erro apresentada na pergunta:

Caused by: java.io.IOException: CreateProcess error=740, A operação solicitada requer elevação

Em inglês, para futura referência cruzada:

java.io.IOException: CreateProcess error=740, The requested operation requires elevation.

Esse tipo de mensagem ocorre quando é necessário que o usuário executante tenha permissões de Administrador, ou ao menos permissões mais elevadas do que as de um usuário comum, e pelos comentários você parece estar utilizando slave via JNLP: modo em que o servidor remoto abre uma página do Jenkins master e baixa um applet de agente, útil para situações em que o master não pode abrir conexão diretamente. O agente JNLP deve acessado e executado manualmente uma vez na máquina remota e depois instalado como serviço para que o procedimento manual não seja mais necessário, conforme documentação do modo slave JNLP.
Assim, pela mensagem de erro apresentada, é grande a possibilidade de que seu agente slave não esteja sendo executado como serviço no Windows remoto, sem permissões de administrador.
O que me causa certo estranhamento é ele requerer elevação para executar uma JDK, algo que eu achava que poderia ser executado por qualquer usuário:

ERROR: SEVERE ERROR occurs
  org.jenkinsci.lib.envinject.EnvInjectException: java.io.IOException:
  Cannot run program
"PATH/TO/SLAVE/tools/hudson.model.JDK/JDK_8u91/jdk.exe" (in directory
  "PATH\TO\SLAVE\hudson.model.JDK\JDK_8u91"): CreateProcess error=740, A
  operação solicitada requer elevação at
  org.jenkinsci.plugins.envinject.service.EnvInjectVariableGetter.getBuildVariables(EnvInjectVariableGetter.java:91)

Será que a JDK do slave é configurada para, ao subir, abrir portas de rede só acessíveis a usuários privilegiados? Isso explicaria mensagem de erro análoga em Linux, mas não sou particularmente versado nas características de segurança do Windows.
Em tempo, pode ser uma boa consultar a documentação do Jenkins para verificar se algum outro modo de configuração de slave não lhe é mais vantajoso.
Outro link que pode ajudar (peço desculpas se for algo muito básico, como disse não conheço muito de Windows e não tenho máquina aqui para testar esse setup) é este artigo sobre serviços Windows, explicando como registrar a execução de serviços, como vinculá-los a usuários específicos e como lhe conferir acesso interativo à interface de usuário. Caso seu build Jenkins necessite executar comandos na GUI, como interagir com mouse e teclado, talvez você precise habilitar essa última propriedade, e a mensagem de erro recebida pode decorrer dessa falta de permissão, como citado no link do início desta "resposta", na documentação do TestComplete.
Comment: Dia de testar a solução...
Comment: @JeffersonQuesado hahah, boa sorte!
Comment: Não consegui colocar como serviço u.u Não soube usar o "sc" para fazer isso
Comment: Consegui de um jeito alternativo do qual eu não me orgulho, mas insistirei mais nessa sua solução ainda
Comment: Vou tentar insistir mais na opção dos serviços... Enquanto isso, rodar uma JDK instalada manualmente quebrou o galho: https://pt.stackoverflow.com/a/252849/64969 ; isto é, até alguém sem querer selecionar a opção que instala o JDK automaticamente, que vai sobrescrever o que instalei manualmente =)
Comment: Legal! Eu não tinha atinado que essa execução tratava da instalação da JDK, aí realmente precisa ser admin. E se você der um nome e um caminho personalizados para a JDK que instalou manualmente, algo fora dos padrões utilizados pelo Jenkins, para evitar que uma instalação automática sobrescreva a coisa toda? Pelo link que você postou na sua resposta, parece que o Jenkins aceita qualquer coisa.
Answer:  no dashboard aparecem deve ingressar nas configurações gerais de jenkins
Comment: Sua resposta pode ser melhorada adicionando informações fundamentais. Basta [edit] para adicionar mais detalhes, como citações ou documentação para que outras pessoas possam confirmar que sua resposta está correta. Você pode encontrar mais informações sobre como escrever boas respostas [na Central de Ajuda](/help/how-to-answer).
Comment: Não vi como isso pode contornar o problema de instalar a JDK na máquina do jenkins secundário por falta de permissão.


This is a question on Computer architecture basically on logic gates

Question: Question is
1) design a truth table for three processor when p1 is off then others are off or p2 is on and others are off
2) design a chip with minimum number of logic gates
Comment: Hello! Please refer to [ask]. Include what research you've done, what steps did you take.
Comment: ^  it looks like it could be a HW question and it's okay to ask these type of questions. However, it is not okay to ask these type of questions without providing evidence of research or effort IMHO... Doing so will cause many to downvote and even flag your question.
Answer: I can give you boolean expression, and I think it can't solve your both question easily!
As given statement1 : when p1 is off then others are off
you can give !p1 -> !p2 && !p3
then, you can simplify it. !(!p1)||(!p2&&!p3) is result
As given statement1 : ** p2 is on and others are off 2**
you can give p2 -> !p1&&!p3
also, simplify it then you can get !p2 || (!p1&&p3)
Last, combine both statement use given or. So, you can get (!(!p1)||(!p2&&!p3))||(!p2 || (!p1&&p3))
And then you can use it to draw truth table by use different value of p1, p2 and p3!


I want my LinkItem to get target="_blank" if my node has the checkbox checked

Question: I'm not sure if hook_preprocess_node is the right hook. But I cant find the setting for target in the LinkItem. Can you help me?
A different approach I failed is to extended the FieldWidget of Link and add a checkbox to toggle the target setting. I wasn't able to save this setting though...
class TargetLinkWidget extends LinkWidget {
  public static function defaultSettings() {
    return ['target' => ''] + parent::defaultSettings();
  }

  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
    $element = parent::formElement($items, $delta, $element, $form, $form_state);

    $element['target'] = [
      '#type' => 'checkbox',
      '#title' => t('Open link in new window'),
      '#value' => '_blank',
      '#default_value' => $this->getSetting('target'),
    ];
    return $element;
  }
}

Comment: Please elaborate: where is the field displayed, in a view as the tags suggest? Then it is fairly easy: load the link twice, one with target set, one without. After that add the checkbox field and rewrite results to be `[field_link]` and no results behaviour (treat 0 as empty) to `[field_link_1]`.
Comment: Thank you. Yes I have a view which displays a bunch of nodes. These all have a link, some external some internal. The editor wants to choose wheither to open the link in a new tab or not.
Your idea is great as a temporal workaround. If I understood it right the editor has 2 link fields, one with target blank and one without and toggles them with a checkbox.
Comment: Not quite, I'll explain in my answer.
Answer: According to your answer to my comment on the question, you are using a view. To have my solution work, it needs to display fields, not teasers.
First off, you do not need to add an additional field to the node type/content type.
All you need to do is to add the already displayed link field in views a second time. All fields get a views internal machine name which is often identical to the field's machine name. However, if you add a field twice, you will end up with two machine names, thus you can determine which version of the rendered field to use at some point.
So, you end up having the same field (Link - field_link) showing up twice in your view's field list. The one added first will be accessible through the token [field_link], the second one by using [field_link_1].
In the first one's settings, choose the plain URL formatter and then go to the "Rewrite result" section. Select the option to output the field as link and enter [field_link] as url and _blank for target:

Finally, set the option "Exclude from display". Repeat that with the second link field, but use [field_link_1] as url and do not set the target.
With both field instances set up and excluded from display, add your checkbox field which may have the machine name field_link_is_external.
Now you need to rewrite that field to be [field_link]:

If the checkbox is checked, the link version with target set "_blank" will be shown.
Next, you need to set the "No result behaviour" as follows:

If the checkbox is not checked, it's value is zero, hence we treat 0 as empty and thus the second link field (w/o target) will be shown.
And that's all there is to it. No need for any editor to enter some url twice. They just need to set the link and decide whether or not to check that checkbox.
Comment: This works great! Even though i did it a little different. I rewrote my Textfield to: `{{ field_kachel_text }}`
My target field is set to output 0/1 and the link plain Text. Thank you so much!


REST API call to filter resource

Question: I'm building a REST API, i have a resource say Movies.
1) POST : movies/

2). GET : movies/{movie_id}

call 1) creates a post.
call 2) when movie_id supplied, it returns specific movie's details, otherwise returns all movies.
Now i have to filter out the movies based on movie attributes like popular, rating etc
My doubts is :
Should there be separate URL for filtering the movies something like
GET: movies/filter/

This call will have GET parameters like popuplar, rating etc And based on those parameters movies can be filtered out.
Not sure what is the standard way to handle this case, please share your thoughts on this,
Comment: Seems a nice way to go, as this clearly defines what each request is supposed to do.
Comment: Yeah, query parameters should be a good way to go
Answer: I have seen two basic approaches in this case. One is the one you suggested, which is to use a separate URL movies/filter/ and filter them out. The classic example is cars/colors/red/maker/porsche.
The other is to use query params, which is, when possible, my preferred approach.
GET /movies?year=2010&actor=Carrey

Variants can include multiples of each (URL encoded appropriately, of course)
GET /movies?year=[2010,2011]&actor=Carrey

I like this approach because it clearly says, "get a list of movies, but limit by these properties".
Two variants I have seen and sometimes used, when necessary, are attempts to separate out actual search terms in query params from other submissions. These generally come up when you need to use query params for things other than search.
The first is a hybrid, that says, "only search, and treat query params as search terms, in a particular sub path. So something like:
GET /movies/filter?year=2010&actor=Carrey

Or if you prefer
GET /movies/search?year=2010&actor=Carrey

A variant is to flag any search terms
GET /movies?search.year=2010&search.actor=Carrey

Finally, a variant I do not like much is to have a /search path
GET /search/movies?year=2010&actor=Carrey

It sometimes is necessary, but I do not like it because search is an action, not a resource, and thus is not very RESTful of a path. But others may like it.

REST API call to filter resource