text:
Q: On Hamkins' answer to a problem by Michael Hardy Based on a post by Michael Hardy and Hamkins' answer to it Andreas Blass, Will Brian, Joel Hamkins, Michael Hardy and Paul Larson introduced a new cardinal characteristic of the continuum $\mathfrak{rr}$ and as the main result they proved $\mathfrak{b}\leq\mathfrak{rr}\leq\mathop{\bf non}(\mathcal{M})$.(See the post by Hamkins on his homepage.)
The following question is motivated by a discussion I had with my friends Shahram Biglari and Mohammad Golshani.
Let $\mathfrak{i}\mathfrak{i}$ be the smallest cardinal such that there exists a family of injective functions $i:\omega\longrightarrow\omega$ of size $\mathfrak{i}\mathfrak{i}$ that guarantees the absolute convergence of a convergent real series $\sum\limits_{n=1}^{\infty} a_{n}$. Thus it's clear that $\mathfrak{r}\mathfrak{r}\geq\mathfrak{i}\mathfrak{i}$.

Question) What happens if one considers the set of all injective functions $i:
\omega\longrightarrow\omega$ instead of permutations. More precisely is it possible to have $\mathfrak{i}\mathfrak{i}<\mathfrak{r}\mathfrak{r}<\mathfrak{c}$?

Is it possible also to have $\mathfrak{i}\mathfrak{i}=\aleph_0$? Note that if $CH$ holds then $\mathfrak{r}\mathfrak{r}=\mathfrak{c}$.

A: Let me show something about the subseries number, which I
suggested in the comments, and which I find very natural to
consider, in light of the following:
Fact. A series $\sum_n a_n$ is absolutely convergent just in
case every subseries $\sum_{n\in A} a_n$ is convergent, for every
$A\subset\mathbb{N}$.
So let us define the subseries number, denoted
$\newcommand\ss{\bf ß}\ss$ (German sharp s), to be the size of the
smallest family $\mathcal{A}$ of sets of natural numbers, such
that if a series $\sum_n a_n$ has the property that $\sum_{n\in
A}a_n$ converges for all $A\in\mathcal{A}$, then $\sum_n a_n$ is
absolutely convergent.
Clearly, $\frak{i\!i}\leq\ss$, since considering subseries amounts
to insisting on increasing injections in the context of the OP.
The splitting number $\newcommand\s{\frak{s}}\s$, in contrast,
is the smallest size of a splitting family $S$, which is a
family $\mathcal{S}$ of infinite sets of natural numbers, such
that if $B\subset\mathbb{N}$ is infinite, then there is some
$A\in\mathcal{S}$ such that $B\cap A$ and $B-A$ are both infinite,
and in this case we say that $A$ splits $B$ and that
$\mathcal{S}$ is a splitting family.
Meanwhile, ${\bf\text{non}}(\mathcal{M})$ is the size of the
smallest non-meager set in the space (it will be convenient to
consider) of all subsets of $\mathbb{N}$.
Theorem. $\s\leq\ss\leq{\bf\text{non}}(\mathcal{M})$.
Proof. For the first inequality, I shall show that every
subseries family $\mathcal{A}$, witnessing the defining property
of $\ss$, is also a splitting family. To see this (just as Will
had argued), consider any infinite set $B\subset\mathbb{N}$. Let
$\sum_n a_n$ be any conditionally convergent series whose nonzero
terms $a_n$ arise solely for $n\in B$. For example, $\sum_n a_n$
could be the alternating harmonic series, padded with $0$'s so
that the nonzero terms arise only on indices in $B$. Thus, $\sum_n
a_n$ converges, but only conditionally. So there must be some
$A\in\mathcal{A}$ such that $\sum_{n\in A} a_n$ diverges. Such a
set $A$ must have $B\cap A$ infinite, in order to have infinitely
many non-zero terms, and it must have $B-A$ infinite, in order to
differ infinitely from $\sum_n a_n$. So $A$ splits $B$, and
therefore $\mathcal{A}$ is a splitting family. So
$\s\leq|\mathcal{A}|$, as desired.
For the second inequality, I shall show that every nonmeager
family of subsets of $\mathbb{N}$ has the subseries property.
Suppose that $\mathcal{A}$ is such a nonmeager family, and we have
a conditionally convergent series $\sum_n a_n$. Since the positive
and negative terms each sum to $\infty$, it follows that any
finitely many terms of this series can be extended in such a way
to cause an additional huge oscillation; from this, it follows
that every conditionally convergent series has a comeager set of
subsets $A\subset\mathbb{N}$ for which $\sum_{n\in A}a_n$ does not
converge. Since $\mathcal{A}$ is non-meager, it must intersect
this set, and so there must be some $A\in\mathcal{A}$ for which
$\sum_{n\in A}a_n$ does not converge. So $\mathcal{A}$ has the
subseries property, as desired. QED

A: UPDATE:
Jörg Brendle, Joel David Hamkins, and I have now written a paper entitled "The subseries number" (link) in which we analyze some new cardinal invariants of the continuum related to this question.
The main topic of the paper (and its title characteristic) is the cardinal originally defined by Joel in his answer here, the subseries number $\newcommand\ss{\bf ß}\ss$. In hindsight, it seems that $\ss$ is somehow more fundamental than the cardinal $\mathfrak{ii}$ Rahman asks about in his post. In fact, it turns out that Rahman's cardinal $\mathfrak{ii}$ is just the minimum of Joel's cardinal and the rearrangement number:

Theorem: $\mathfrak{ii} = \min \{\ss,\mathfrak{rr}\}$.

The proof of this equality can be found in the last section of our paper. (Interestingly, it breaks into two cases, according to whether $\mathfrak{ii} < \mathfrak{b}$ or not.) It seems to me that this theorem, paired with the thorough analysis of $\ss$ and $\mathfrak{rr}$ in these two papers, is the strongest answer to Rahman's question that one could hope for.
Let me mention one more result from our new paper that is particularly relevant to Rahman's original post:

Theorem: In the Laver model, $\ss < \mathfrak{rr}$.

Combining this with the other theorem mentioned above, we get the consistency of $\mathfrak{ii} < \mathfrak{rr}$, answering part of the original question.

ORIGINAL POST:
Great question! My answer turned out to be pretty long, but I'll summarize the key ideas here at the top.
We can show that $\mathfrak{ii}$ is always uncountable, and we can find a natural condition under which $\mathfrak{ii} = \mathfrak{rr}$. Specifically, we can show

*

*$\min\{\mathfrak{b},\mathfrak{s}\} \leq \mathfrak{ii}.$

*$\mathfrak{rr} = \max\{\mathfrak{b},\mathfrak{ii}\}$.

Taken together, these assertions imply that $\mathfrak{ii} \neq \mathfrak{rr}$ can be true only in models where $\mathfrak{s} < \mathfrak{b}$. In other words, if you want to prove $\mathfrak{ii} < \mathfrak{rr}$ relatively consistent, then you should look at a model where $\mathfrak{s} < \mathfrak{b}$ (this happens in the Hechler model and the Laver model, for example), and then try to prove that $\mathfrak{ii} < \mathfrak{b} = \mathfrak{rr}$ in that model.
Proof that $\min\{\mathfrak{b},\mathfrak{s}\} \leq \mathfrak{ii}$:
[Recall that $\mathfrak{s}$, the "splitting number", is the smallest cardinality of a splitting family, where $F \subseteq [\omega]^\omega$ is a splitting family iff, for any infinite $A \subseteq \omega$, there is some $B \in F$ with $A \cap B$ and $A \setminus B$ both infinite.]
Suppose $\kappa < \min\{\mathfrak{b},\mathfrak{s}\}$, and let $F$ be a family of injective functions $\omega \rightarrow \omega$. We want to cook up a conditionally convergent series $\sum_n a_n$ such that, for every $f \in F$, $\sum_n a_{f(n)}$ is still convergent.
For each $f \in F$, consider $f(\omega)$, the image of $f$. Since $\kappa < \mathfrak{s}$, there is an infinite $A \subseteq \omega$ that is not "split" by any of the $f(\omega)$: that is, for all $f \in F$, either $A \cap f(\omega)$ is finite, or $f(\omega) \setminus A$ is finite.
Let $F_0$ be the set of all $f \in F$ such that $f(\omega) \cap A$ is finite, and let $F_1$ be the set of all $f \in F$ such that $f(\omega) \setminus A$ is finite. We will put $a_n = 0$ for all $n \notin A$. This allows us to safely ignore the functions in $F_0$: $\sum_n a_{f(n)}$ will always converge for $f \in F_0$ because only finitely many of the terms of this sum will be nonzero. Our goal is to figure out a way to write a conditionally convergent series, with nonzero terms only on $A$, such that the series remains convergent after applying functions in $F_1$.
I claim that we already know how to do this, more or less, because it's just another variation of Joel's padding with zeros argument. First, I'll point out what we already know from my answer to Mike Hardy's question:
If $P$ is a family of permutations of $\omega$ and $|P| < \mathfrak{b}$, then there is an infinite $B \subseteq \omega$ such that any $p \in P$ only rearranges finitely many terms of $B$, and otherwise $p$ preserves the order of the terms in $B$.
But if you look at my proof there, you'll see that we never used the fact that the members of $P$ are permutations. We only used the fact that they're injections (indeed, "almost injections" (functions where the preimage of each point is finite) would be enough). Therefore, by the same proof, there is an infinite $B \subseteq A$ such that any $f \in F_1$ only rearranges finitely many terms of $B$, and otherwise $f$ preserves the order of the terms in $B$.
To obtain our series $\sum_n a_n$, we simply write the alternating harmonic series on the members of $B$. That is, let $a_n = 0$ for every $n \notin B$, and otherwise, if $n$ is the $k^{th}$ element of $B$, let $a_n = \frac{(-1)^k}{k}$. If $f \in F_0$, then $\sum_n a_{f(n)}$ converges because it has only finitely many nonzero terms. If $f \in F_1$, then $\sum_n a_{f(n)}$ converges, because it contains all but finitely many of the nonzero terms of our original series, it has them in the same order except possibly for some finitely many of them, and otherwise everything is zero. QED
Proof that $\mathfrak{rr} = \max\{\mathfrak{b},\mathfrak{ii}\}$:
The bounds $\mathfrak{b} \leq \mathfrak{rr}$ and $\mathfrak{ii} \leq \mathfrak{rr}$ are already known, and mentioned in the question. We need to show that $\mathfrak{rr} \leq \max\{\mathfrak{b},\mathfrak{ii}\}$. To accomplish this, suppose $F$ is a family of injections $\omega \rightarrow \omega$ such that $|F| = \mathfrak{ii}$, and for any conditionally convergent series $\sum_n a_n$, $\sum_n a_{f(n)}$ diverges for some $f \in F$. We will find a family $P$ of permutations of $\omega$ such that $|P| = |F| \cdot \mathfrak{b}$, and for any conditionally convergent series $\sum_n a_n$, $\sum_n a_{p(n)}$ diverges for some $p \in P$.
Let $B$ be an unbounded family of functions $\omega \rightarrow \omega$ with $|B| = \mathfrak{b}$. For simplicity, assume that every member of $B$ is strictly increasing, and that every member of $F$ and of $B$ has co-infinite image. (The assumptions about $B$ are without loss of any generality, since we can modify $B$ to make it fit this requirement. The assumption on $F$ is less obviously benign, but it is easy to modify the definition of $p_f^g$ below to work just as easily when $f$ has co-finite image. We're making the assumption only to avoid dealing with cases in what is already a somewhat tedious definition.) For each $f \in F$ and $g \in B$, define $p_f^g$ so that

*

*If $n$ is the $k^{th}$ element of $\omega \setminus f(\omega)$, then $p_f^g(n)$ is the $k^{th}$ element of the image of $g$.

*If $n$ is in the image of $f$, then $$p_f^g(n) = f(n - |\{m < n : m \in \mathrm{Image}(g)\}|).$$
This definition is a bit involved, but the idea behind it is simple. We think of $p_f^g$ as a way of listing the terms of our series (in a different order). How do we list them? We begin by writing out all the terms in the image of $f$, in the order specified by $f$. The problem is that this does not give us a permutation of the series: lots of things have been left out, namely every term indexed by a member of $\omega - f(\omega)$. We want to add these to our list, and our plan is to let them appear on the list "slowly": we want these extra terms appear so sparsely in our rearranged series that they won't effect its convergence properties. Exactly how sparsely these terms appear is determined by $g$. We stick the first extra term in after the first $g(1)$ terms of our preliminary list, we stick another one in after $g(2)$ terms, another after $g(3)$ terms, etc.
Let $P = \{p_f^g : f \in F, g \in B\}$. Clearly $|P| = |F| \cdot |B|$. We will show that for any conditionally convergent series $\sum_n a_n$, $\sum_n a_{p(n)}$ diverges for some $p \in P$.
Suppose $\sum_n a_n$ is a conditionally convergent series, and fix $f \in F$ such that $\sum_n a_{f(n)}$ diverges. The extended real numbers
$$u = \limsup_{n \in \omega} \sum_{m \leq n}a_{f(n)}$$
$$\ell = \liminf_{n \in \omega} \sum_{m \leq n}a_{f(n)}$$
are different (this is what we mean by divergence). Let $d = \frac{u-\ell}{2}$ if $u$ and $\ell$ are both real, or $d = 1$ if either $u = \infty$ or $\ell = -\infty$. Define a function $osc: \omega \rightarrow \omega$ so that $osc(n)$ tells us when the partial sums have completed their $n^{th}$ oscillation of size $d$. Specifically, $osc(n)$ is defined to be the least number $N$ such that
$$\limsup_{osc(n-1) < m \leq N}\sum_{i \leq m}a_{f(m)} - \liminf_{osc(n-1) < m \leq N}\sum_{i \leq m}a_{f(m)} \geq d.$$
Because $B$ is an unbounded family, there is some $g \in B$ such that $g(n) > osc(2n)$ infinitely often. This implies that there are infinitely many $n$ such that there is no $m$ with $osc(n) < g(m) \leq osc(n+1)$.
I claim that $\sum_n a_{p_f^g(n)}$ diverges. Fix $N$. There is some $n \geq N$ large enough that $|a_{p_f^g(m)}|$ is much smaller than $d$ for all $m \geq n$, and that there is no $m$ with $osc(n) < g(m) \leq osc(n+1)$. This means that, between $osc(n)$ and $osc(n+1)$, the terms of $a_{p_f^g(m)}$ will look exactly like the terms of $a_{f(n)}$. By our definition of $osc$, the sum of these terms accomplish an oscillation of size $d$ or more in that interval. Thus, for arbitrarily large values of $N$, the partial sums of $\sum_n a_{p_f^g(n)}$ accomplish an oscillation of size $d$ or more after the $N^{th}$ term. Thus $\sum_n a_{p_f^g(m)}$ diverges. QED


text:
Q: post back occurs javascript listbox items lost in asp.net i have 10 list boxes in my aspx page for all 10 list boxes same function is using for some buttons i want to add listbox data to grid can you help me  my java script code shown below

function MoveItem(ctrlSource, ctrlTarget) {

   var Source = document.getElementById(ctrlSource);

   var Target = document.getElementById(ctrlTarget);

   if ((Source != null) && (Target != null)) {

       while ( Source.options.selectedIndex >= 0 ) {

           var newOption = new Option(); // Create a new instance of ListItem

           newOption.text = Source.options[Source.options.selectedIndex].text;

           newOption.value = Source.options[Source.options.selectedIndex].value;

           Target.options[Target.length] = newOption; //Append the item in Target

           Source.remove(Source.options.selectedIndex);  //Remove the item from Source

       }

   }

}
i tried a javascript above code to move items between listbox using html input button problem when i trying to save listbox.items.count giving 0 can anyone tell me why this happening and also when post back occurs listbox items lost.

A: Dear,
This is a normal, any thing changed client side to the list box will not be reflected on the server side.
you can add an onclientclick event on the button and read the items from the listbox client side and save them using AJAX, or you can read the items from the listbox client side and put them in a hidden field as a string and you can read the value of the hidden field server side.
you can read all the item from the client side, and format them in your own format as a string.
then add an asp hidden field on the page, and client side put the string that you have in the hidden field value property.
now you can access the string from the onclick event on the server side and extract the items of the list boxes.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How should I setup an additional interface to a class that already extends a generic class? So I have this class:
class TagsDao extends PGDao<Tag> {...}

PGDao has this implementation:
class PGDao<T> implements BaseDao<T, PoolClient> {...}

Let's say I want to achieve this (because I want additional typing, specific for my TagsDao class):
class TagsDao extends PGDao<Tag> implements ITagsDao {...}

If I want to create such an interface for TagsDao, does ITagsDao need to extend PGDao too?
I think these are my options for the shape of ITagsDao:
Option 1:
interface ITagsDao extends BaseDao<Tag, PoolClient> {
  method(): Promise<number>;
}

Option 2:
interface ITagsDao extends PGDao<Tag> {
  method(): Promise<number>;
}

Option 3:
interface ITagsDao {
  method(): Promise<number>;
}

I think all of these options actually work equally well.
I'm just wondering what is the best practice or if I'm missing something.
Am I over-typing ITagsDao without any benefits?
Being that TagsDao already gets all the typing of the generic class PGDao, is option 3 enough to completely type all the additional code I'll have in TagsDao? Or should ITagsDao also extend the types PGDao is based on?


text:
Q: Why I am losing cookies and session on Ajax requests in IE 9 Session cookies are working fine in Chrome and Firefox, but with IE9 and AJAX requests, I lose all session cookies.
Direct request to view
  public class AddressController : Controller
  {
    [MvcSiteMapNode(Title = "Addresses", ParentKey = "MyAccount", Key = "Addresses")]
     public ActionResult Index()
     {
        ....
         var memberId = GetKeyValues.GetMemberId(); // This works perfect.
        ...
      }

Ajax call
   $.ajax({
        url: "/Address/CheckPrimaryAddressGood?t="+ Math.random(),
        type: "Get",
        success: function(data) {
         ...

public class AddressController : Controller
{
    public ActionResult CheckPrimaryAddressGood()
        {
           ...
           var memberId = GetKeyValues.GetMemberId();
           ...
       }
 }
 public static class GetKeyValues
 {
    public static string GetMemberId()
    {
         if (HttpContext.Current.Session[keyCookie] != null)
            {
                memberId = GetMemberIdFromSession();
            }
            else if (HttpContext.Current.Request.Cookies["token"] != null)
            {
                memberId = GetMemberIdFromCookie();
            }
    }
}

From AJAX call I lost cookies values only IE9. I tried P3P override still did not work from this post P3P link
Has anyone had a similar issue? Please let me know how to resolve this. I spent already a day on this.
Edit
I just traced in Fiddler IE is not sending Header data it is just sending "Connection=Keep-Alive&Pragma=no-cache&Accept=*%2f*&Accept-Encoding=gzip%2c+deflate&Accept-Language=en-US&Host=ebiz.company.com%3a28712&User-Agent=Mozilla%2f5.0+(compatible%3b+MSIE+9.0%3b+Windows+NT+6.1%3b+WOW64%3b+Trident%2f5.0)&Origin=http%3a%2f%2febiz.spe.org%3a28712}
but Chrome: {Connection=keep-alive&Accept=*%2f*&Accept-Encoding=gzip%2c+deflate%2c+sdch&Accept-Language=en-US%2cen%3bq%3d0.8&Cookie=ASP.NET_SessionId%3d2a4tr1ymierclqsfxyfahqbc%3b+__session%3a0.5654769616667181%3ashowwarning%3dtrue%3b+__session%3a0.5654769616667181%3aBadAddressWarning%3dfalse%3b+ ....
Why?

A: These are just some ideas, which may help (and you've probably read or tried these by now). There doesn't seem to be a silver bullet.
Some other questions had similar problems, that don't seem to be exactly yours (especially since you tried P3P). Also lots of posts in general on the internet, all around the same few issues.
No Session Cookies on Internet Explorer 9 AJAX requests
Cookie blocked/not saved in IFRAME in Internet Explorer
Some ideas:

*

*One answer had problems with underscore in the url. You don't have
that, but can you try a clean one without the random parameter? Just
in case it doesn't like that.

*Lots of posts about trouble doing this
from within an iframe. If you don't have an iframe, this isn't the
problem.

*P3P, you said you tried; I saw one comment that the header
has to be set on every request, not just the ones looking for
session/cookies.

*Cross-domain / CORS problem? Doesn't look like it
with your root-relative url.

*Try an IE9 on another computer? Silly,
but maybe it's some obscure setting on your browser; zones, etc.

*Does fiddler show a session id on a regular page browsed on your site? (just to make sure it's not site-wide vs. just this ajax call).

*I usually Post ajax instead of Get (just had a lot of data), and do
have session working. This also avoided needing the cache-busting
random parameter.

*I'm using good old web forms instead of mvc, and posting to asmx. On
the asmx method, I need to decorate the server-side method.
// ScriptService and ScriptMethod are required for the jquery.ajax() call. They weren't required for jquery.post(). WebMethod needed for session.
[WebMethod(EnableSession = true)]
[ScriptMethod]
public string DoSomething() ...

A: Have you thought of using sessionStorage? check it out for firefox
https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage
for all other browsers:
https://code.google.com/p/sessionstorage/


text:
Q: How to configure VPN connection between 2 Kubernetes clusters How to configure VPN connection between 2 Kubernetes clusters.
The case is:
- 2 kubernetes clusters running on different sites
- OpenVPN connectivity between 2 clusters
- In both kubernetes clusters are installed openvpn running in separate container.
How to configure kubernetes clusters (vpn, routing, firewall configurations) so, the Nodes and Containers of any of the kubernetes clusters to have connectivity through VPN to nodes and services to the other cluster?
Thank you for the answers !!!

A: You can use Submariner to connect multiple clusters, it creates a secure and performant connection between the clusters on-premises and on public clouds, then you can export the services and access them across all clusters in the cluster set.

Usually we use this tool to create multiple K8S clusters in different geographical locations, then replicate the databases across all the clusters to avoid data loss in case of any data center incident.

A: What you need in Kubernetes is called federation.

Deprecated
Use of  Federation v1  is strongly discouraged.  Federation V1  never achieved GA status and is no longer under active development. Documentation is for historical purposes only.
For more information, see the intended replacement,  Kubernetes Federation v2.

As for using a VPN in Kubernetes, I recommend Exposing Kubernetes cluster over VPN.
It describes how to connect VPN node to kuberentes cluster or Kubernetes services.
You might be also interested in reading Kubernetes documentation regarding Running in Multiple Zones.
Also Kubernetes multi-cluster networking made simple, which explains different use cases of VPNs across number of clusters and is strongly encouraging to use IPv6 instead of IPv4.

Why use IPv6? Because "we could assign a — public — IPv6 address to EVERY ATOM ON THE SURFACE OF THE EARTH, and still have enough addresses left to do another 100+ earths" [SOURCE]

Lastly Introducing kEdge: a fresh approach to cross-cluster communication, which seems to make live easier and helps with configuration and maintenance of VPN services between clusters.

A: Submariner is a very good solution but unfortunately doesn't support IPv6 yet so if your use case has ipv6 or dualstack clusters, then it could be an issue


text:
Q: pygame sprites and pygame.display.flip() results in artifacts I'm programming a python Tetris clone for a university course. It works like charm, as long as I'm not trying to change the route of the falling blocks. When I speed them up or move the block left or right, I'm getting the artifacts, shown on the screenshot below.
The code is the same for every movement of the block:
runningBlock.update()
runningBlock.draw(field)
screen.blit(field, (20, 20))
pygame.display.flip()

while the update() method just sets the center of the moving object to a new position. screen is the gray area on the screenshot, field is the white playground on top of the grey screen. Any idea, what I'm missing in here?
BTW, frame rate is set to 30, shouldn't be the problem, should it?

A: Okay got it. I just refilled the field before updating the blocks:
field.fill((255, 255, 255))
runningBlock.update()
runningBlock.draw(field)
lyingBlocks.draw(field)
screen.blit(field, (20, 20))
pygame.display.flip()


text:
Q: Preventing Duplicates: Marketo and Salesforce Integration Marketo is used by Marketing team in the company and the Salesforce is implemented newly. Now we want to integrate them. My concern is will this integration raise to any duplicates. If so how to eradicate them and also prevent them in the future.
Any insights would be appreciated.

A: To prevent duplicates, Marketo assumes leads with the same email address are the same person. New leads with known emails are automatically merged with their matching lead in Marketo (this feature can be disabled by contacting Marketo support, which was necessary in our case).
More advanced duplicate prevention is available through a variety of tools. RingLead is one of the most popular tools for this, as it integrates with both Marketo and Salesforce. The design works well in most cases, since it sits between Marketo and Salesforce (merging identified duplicates before they sync to Salesforce).
RingLead did not work well for us (because they are focused on B2B matching, which doesn't help us), so we ended up creating a custom tool using the 'duplicate management' feature available in Salesforce.
As for duplicate cleanup, many of the duplicate prevention tools also provide this feature. We use Cloudingo for this right now, although RingLead offers this as well (but RingLead only offers mass/bulk cleanup for records with matching emails, which Marketo normally does anyway).
Both duplicate cleanup and prevention tools require a fair amount of setup, mostly to control how conflicting information in different fields should be handled (e.g., if you encounter a new title for someone, do you keep the old one, or overwrite it with the new title?). Unless you are able to set this up in a way that is completely trustworthy, someone may need to clean the dupes manually (although the tools I mentioned still help, suggesting default values based on your field conflict settings).


text:
Q: xsl-fo: force line break in table I have created a table in xsl-fo like this:
<fo:block margin-top="0.4cm">
                        <fo:table border-collapse="collapse">
                            <fo:table-column column-width="15%"
                                column-number="1" />
                            <fo:table-column column-width="16%"
                                column-number="2" />
                            <fo:table-column column-width="53%"
                                column-number="3" />
                            <fo:table-column column-width="16%"
                                column-number="4" />

                            <fo:table-header>
                                <fo:table-row>
                                    <fo:table-cell padding="2px" font-size="7px">
                                        <fo:block text-align="center" font-weight="bold">Column1
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell padding="2px" font-size="7px">
                                        <fo:block text-align="center" font-weight="bold">Column2
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell padding="2px" font-size="7px">
                                        <fo:block text-align="left" font-weight="bold">Column3
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell padding="2px" font-size="7px">
                                        <fo:block text-align="center" font-weight="bold">Column4
                                        </fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                            </fo:table-header>

                            <fo:table-body font-size="9px">

                                    <fo:table-row>
                                        <fo:table-cell padding="2px" border="0.5pt solid #cfcfcf">
                                            <fo:block text-align="center">
                                                12345678910111213
                                            </fo:block>
                                        </fo:table-cell>
                                        <fo:table-cell padding="2px" border="0.5pt solid #cfcfcf">
                                            <fo:block text-align="center">
                                                some text
                                            </fo:block>
                                        </fo:table-cell>
                                        <fo:table-cell padding="2px" border="0.5pt solid #cfcfcf">
                                            <fo:block text-align="left">
                                                some text
                                            </fo:block>
                                        </fo:table-cell>
                                        <fo:table-cell padding="2px" border="0.5pt solid #cfcfcf">
                                            <fo:block text-align="right">
                                                some text
                                            </fo:block>
                                        </fo:table-cell>
                                    </fo:table-row>

                                </xsl:for-each>
                            </fo:table-body>
                        </fo:table>
                    </fo:block>
                    <fo:block padding-top="40px">
                    some text
                    </fo:block>
                </fo:block>

The String "12345678910111213" in Column1 is written over the borders of its table-cell.
How can I force a line break in the table-cells of this column after a specific number of characters in the String?

A: By injecting a zero-width space  at the desired location.
This technique is very useful for indicating multiple possible break locations for a contiguous string, even if the room is big enough to accommodate the entire string, because the zero-width spaces are invisible.  If, however, a break is needed, the rendering knows to break the string at a space, and a zero-width space is treated as a space.
In the classroom I use the example of a URI string, where adding a zero-width space after every / will render as a regular URI (without visible spaces) and yet will break at the desired points if necessary.


text:
Q: https hapijs server not working on port 80 (ERR_CONNECTION_REFUSED) I am developing a website through HapiJS and I'm configuring SSL.
I have already created certificate and private key, and configure the TLS for Hapi server.
The problem is this, the server is started successfully on port 80 (without giving any error) but when I go to "call" the site by browser that does not respond and as a result I:
"The web page is not available (ERR_CONNECTION_REFUSED)"
If I create (I start) the server on another port, such as port 8080, the site responds properly.
For clarity I add the pieces of code that make up the hapi server:

     private server = new Hapi.Server({ debug: { request: ['error'] } });
     this.server.connection({
       port: '0.0.0.0',
       host: 80,
       tls: {
          key: fs.readFileSync(__dirname + "/user_domain_io_key.pem", 'utf8'),
          cert: fs.readFileSync(__dirname + "/user_domain_io_cert.pem", 'utf8')
       }
     });

     this.server.route({
      path: '/login',
      method: 'GET',
      handler: function(request, reply) {
         reply.view('login');
      }
     });

     this.server.start(function () {
      console.log('server running at: ' + that.server.info.uri);
     });

What I do not understand is why the site is not liable if the server start on port 80.
Do you have any advice for me? Someone has already dealt with the problem?
Thanks.

A: Don't you have the port and host parameters reversed?
Shouldn't it be
port: 80
host: '0.0.0.0'


text:
Q: Custom Action For Xtify Push Notification I use Xtify's web service for push notifications.  They have a way to perform custom action on click, but I'm not sure I'm understanding how to do it.  Basically, I want the custom action to allow me to choose which tab to open the app to.  Their link is
    http://developer.xtify.com/display/sdk/6.+Other+Implementation+Methods
What all would I need to set up in app to specifiy in push notification which tab to open up?

A: You would first need to set a delegate with a method that would be called wherever you want it to be called as specified in the documentation -
[[XLappMgr get] setDeveloperCustomActionSelector:@selector(developerCustomActionMethod:)];

Then you would need to define a method called developerCustomActionMethod which does the actual switching. You could use the following code to select which tab you need to switch to -
tabBarController.selectedViewController = [tabBarController.viewControllers objectAtIndex:2]; // will select the third tab, as tabs are ranked 0,1,2,3,....


text:
Q: ActionView::Template::Error (undefined method `strip!' for nil:NilClass) It seems I'm running into this error when I insert more than 100,000 records. I know it can support way more than that. The error is below and the code for the related classes.
2015-07-01 08:14:24.512:INFO:/:Started GET "/search?type=digital_object" for 129.118.15.44 at 2015-07-01 08:14:24 -0500|
2015-07-01 08:14:24.512:INFO:/:Processing by SearchController#search as HTML|
2015-07-01 08:14:24.512:INFO:/:  Parameters: {"type"=>"digital_object"}|
Jul 01, 2015 8:14:24 AM org.apache.solr.core.SolrCore execute
INFO: [collection1] webapp= path=/select params={facet=true&sort=title_sort+asc&facet.limit=100&qf=four_part_id^3+title^2+finding_aid_filing_title^2+fullrecord&wt=json&rows=10&defType=edismax&pf=four_part_id^4&start=0&q=*:*&facet.field=repository&facet.field=primary_type&facet.field=subjects&facet.field=source&facet.field=linked_agent_roles&fq=types:("digital_object")&fq=-exclude_by_default:true&fq=publish:true} hits=203799 status=0 QTime=15
2015-07-01 08:14:24.590:INFO:/:  Rendered G:/archivesspace/plugins/vva/public/views/search/_components_switch.html.erb (15.0ms)|
2015-07-01 08:14:24.590:INFO:/:  Rendered search/_filter.html.erb (0.0ms)|
2015-07-01 08:14:24.606:INFO:/:  Rendered search/_pagination_summary.html.erb (16.0ms)|
2015-07-01 08:14:24.637:INFO:/:  Rendered search/_inline_results.html.erb (47.0ms)|
2015-07-01 08:14:24.637:INFO:/:  Rendered search/results.html.erb within layouts/application (62.0ms)|
2015-07-01 08:14:24.653:INFO:/:Completed 500 Internal Server Error in 141.0ms|
2015-07-01 08:14:24.653:INFO:/:|ActionView::Template::Error (undefined method `strip!' for nil:NilClass):|
17:           <% elsif result["primary_type"] === "repository" %>|
18:             <%= link_to result['title'], :controller => :search, :action => :repository, :repo_id => id %>|
19:           <% else %>|
20:             <%= link_to title_or_finding_aid_filing_title( result )  , :controller => :records, :action => result["primary_type"], :id => id, :repo_id => repo_id %>|
21:           <% end %>|
22:
|
23:
|  app/helpers/application_helper.rb:22:in `title_or_finding_aid_filing_title'|
app/views/search/_inline_results.html.erb:20:in `_app_views_search__inline_results_html_erb___996910774_15116'|
app/views/search/_inline_results.html.erb:5:in `_app_views_search__inline_results_html_erb___996910774_15116'|
app/helpers/application_helper.rb:134:in `render_aspace_partial'|
app/views/search/results.html.erb:13:in `_app_views_search_results_html_erb__332589766_15048'|
app/controllers/search_controller.rb:21:in `search'|
app/controllers/search_controller.rb:20:in `search'|||

_inline_results.html.erb

<% if search_data.results? %>
  <%= render_aspace_partial :partial => "search/pagination_summary", :locals => {:search_data => search_data} %>

    <% search_data['results'].each do |result| %>
      <%
         id = JSONModel(result["primary_type"]).id_for(result['uri'])
         repo_id = JSONModel(:repository).id_for(JSONModel.repository_for(result['uri']),{}, true)
      %>

          <%= icon_for result["primary_type"] %>
          <% if result["primary_type"] === "subject" %>
            <%= link_to result["title"], {"filter_term" => search_data.facet_query_string("subjects", result["title"])} %>
          <% elsif ["agent_person", "agent_software", "agent_family", "agent_corporate_entity"].include?(result["primary_type"]) %>
            <%= link_to result['title'], :controller => :records, :action => :agent, :id => id, :agent_type => result["primary_type"] %>
          <% elsif result["primary_type"] === "repository" %>
            <%= link_to result['title'], :controller => :search, :action => :repository, :repo_id => id %>
          <% else %>
            <%= link_to title_or_finding_aid_filing_title( result )  , :controller => :records, :action => result["primary_type"], :id => id, :repo_id => repo_id %>
          <% end %>

          <%= render_aspace_partial :partial => "search/result_summary_#{result["primary_type"]}", :locals => {:obj => result} %>

    <% end %>

  <%= render_aspace_partial :partial => "search/pagination", :locals => {:search_data => search_data} %>
<% else %>

    <%= I18n.t("search_results.no_results") %>.

<% end %>

search_controller.rb
require 'advanced_query_builder'

class SearchController < ApplicationController

  DETAIL_TYPES = ['accession', 'resource', 'archival_object', 'digital_object',
                  'digital_object_component', 'classification',
                  'agent_person', 'agent_family', 'agent_software', 'agent_corporate_entity']

  VIEWABLE_TYPES = ['agent', 'repository', 'subject'] + DETAIL_TYPES

  FACETS = ["repository", "primary_type", "subjects", "source", "linked_agent_roles"]

  def search
    set_search_criteria

    @search_data = Search.all(@criteria, @repositories)
    @term_map = params[:term_map] ? ASUtils.json_parse(params[:term_map]) : {}

    respond_to do |format|
      format.html { render "search/results" }
      format.js { render_aspace_partial :partial => "search/inline_results", :content_type => "text/html", :locals => {:search_data => @search_data} }
    end
  end

  def advanced_search
    set_advanced_search_criteria

    @search_data = Search.all(@criteria, @repositories)

    render "search/results"
  end

  def repository
    set_search_criteria

    if params[:repo_id].blank?
      @search_data = Search.all(@criteria.merge({"facet[]" => [], "type[]" => ["repository"]}), {})

      return render "search/results"
    end

    @repository = @repositories.select{|repo| JSONModel(:repository).id_for(repo.uri).to_s === params[:repo_id]}.first

    @breadcrumbs = [
      [@repository['repo_code'], url_for(:controller => :search, :action => :repository, :id => @repository.id), "repository"]
    ]

    @search_data = Search.repo(@repository.id, @criteria, @repositories)

    render "search/results"
  end

  private

  def set_search_criteria
    @criteria = params.select{|k,v|
      ["page", "q", "type", "sort",
       "filter_term", "root_record", "format"].include?(k) and not v.blank?
    }

    @criteria["page"] ||= 1
    @criteria["sort"] = "title_sort asc" unless @criteria["sort"] or @criteria["q"] or params["advanced"].present?

    if @criteria["filter_term"]
      @criteria["filter_term[]"] = Array(@criteria["filter_term"]).reject{|v| v.blank?}
      @criteria.delete("filter_term")
    end

    if params[:type].blank?
      @criteria['type[]'] = DETAIL_TYPES
    else
      @criteria['type[]'] = Array(params[:type]).keep_if {|t| VIEWABLE_TYPES.include?(t)}
      @criteria.delete("type")
    end

    @criteria['exclude[]'] = params[:exclude] if not params[:exclude].blank?
    @criteria['facet[]'] = FACETS
  end

  def set_advanced_search_criteria
    set_search_criteria

    terms = (0..2).collect{|i|
      term = search_term(i)

      if term and term["op"] === "NOT"
        term["op"] = "AND"
        term["negated"] = true
      end

      term
    }.compact

    if not terms.empty?
      @criteria["aq"] = AdvancedQueryBuilder.new(terms, :public).build_query.to_json
      @criteria['facet[]'] = FACETS
    end
  end

  def search_term(i)
    if not params["v#{i}"].blank?
      { "field" => params["f#{i}"], "value" => params["v#{i}"], "op" => params["op#{i}"], "type" => "text" }
    end
  end

end

application_helper.rb
module ApplicationHelper

  def include_theme_css
    css = ""
    css += stylesheet_link_tag("themes/#{ArchivesSpacePublic::Application.config.public_theme}/bootstrap", :media => "all")
    css += stylesheet_link_tag("themes/#{ArchivesSpacePublic::Application.config.public_theme}/application", :media => "all")
    css.html_safe
  end

  def set_title(title)
    @title = title
  end

  def title_or_finding_aid_filing_title(resource)
    if resource["finding_aid_filing_title"] && !resource["finding_aid_filing_title"].nil? && resource["finding_aid_filing_title"].length > 0
      title = resource["finding_aid_filing_title"]
    elsif resource["title"] && !resource["title"].nil?
      title = resource["title"]
    else
      title = resource["display_string"]
    end
    MixedContentParser::parse(title, url_for(:root))

  end

  def icon_for(type)
    "".html_safe
  end

  def label_and_value(label, value)
    return if value.blank?

    label = content_tag(:dt, label)
    value = content_tag(:dd, value)

    label + value
  end

  def i18n_enum(jsonmodel_type, property, value)
    return if value.blank?

    property_defn = JSONModel(jsonmodel_type).schema["properties"][property]

    return if property_defn.nil?

    if property_defn.has_key? "dynamic_enum"
      enum_key = property_defn["dynamic_enum"]
      #return "enumerations.#{enum_key}.#{value}"
      I18n.t("enumerations.#{enum_key}.#{value}", :default => value)
    else
      I18n.t("#{jsonmodel_type}.#{property}_#{value}", :default => value)
    end
  end

  def params_for_search(opts = {})
    search_params = {
      :controller => :search,
      :action => :search
    }

    search_params["filter_term"] = Array(opts["filter_term"] || params["filter_term"]).clone
    search_params["filter_term"].concat(Array(opts["add_filter_term"])) if opts["add_filter_term"]
    search_params["filter_term"] = search_params["filter_term"].reject{|f| Array(opts["remove_filter_term"]).include?(f)} if opts["remove_filter_term"]

    search_params["sort"] = opts["sort"] || params["sort"]

    search_params["q"] = opts["q"] || params["q"]

    search_params["format"] = params["format"]
    search_params["root_record"] = params["root_record"]
    search_params["agent_type"] = params["agent_type"]

    search_params["page"] = opts["page"] || params["page"] || 1

    if opts["type"] && opts["type"].kind_of?(Array)
      search_params["type"] = opts["type"]
    else
      search_params["type"] = opts["type"] || params["type"]
    end

    search_params["term_map"] = params["term_map"]

    # retain any advanced search params
    advanced = (opts["advanced"] || params["advanced"])
    search_params["advanced"] = advanced.blank? || advanced === 'false' ? false : true
    search_params[:action] = :advanced_search if search_params["advanced"]

    (0..2).each do |i|
      search_params["v#{i}"] = params["v#{i}"]
      search_params["f#{i}"] = params["f#{i}"]
      search_params["op#{i}"] = params["op#{i}"]
    end

    search_params.reject{|k,v| k.blank? or v.blank?}
  end

  def set_title_for_search
    title =  I18n.t("actions.search")

    if @search_data
      if params[:type] && !@search_data.types.blank?
        title = "#{I18n.t("search_results.searching")} #{@search_data.types.join(", ")}"
      end

      facets_to_display = []

      if @search_data.query?
        facets_to_display << @search_data.facet_label_for_query
      end

      if @search_data.filtered_terms?
        facets_to_display << @search_data[:criteria]["filter_term[]"].collect{|filter_term| @search_data.facet_label_for_filter(filter_term)}
      end

      if facets_to_display.length > 0
        title += " | #{facets_to_display.join(", ")}"
      end
    end

    set_title(title)
  end

  def truncate(string, length = 50, trailing = '…')
    return string if string.length < length

    "#{string[0..50]}#{trailing}".html_safe
  end

  # See: ApplicationController#render_aspace_partial
  def render_aspace_partial(args)
    defaults = {:formats => [:html], :handlers => [:erb]}
    return render(defaults.merge(args))
  end

  def proxy_localhost?
    AppConfig[:frontend_proxy_url] =~ /localhost/
  end

end

A: The error is in your _inline_results.html.erb...
<% elsif result["primary_type"] === "repository" %>
        <%= link_to result['title'], :controller => :search, :action => :repository, :repo_id => id %>

the error is that the result['title'] is nil. so, add this line of code....
<% elsif result["primary_type"] === "repository" %>
  <% if !result['title'].blank? %>
    <%= link_to result['title'], :controller => :search, :action => :repository, :repo_id => id %>
  <% end %>

A: I got it figured out. Looks like some of the data imported had blank titles "". By updating them it was able to work.


text:
Q: Magento: add static block above footer only for Product View pages? In Magento, how can I add a static block just above the footer, but only on Product View pages? I've got it partially working by modifying catalog.xml and page/html/footer.phtml - but it's showing on all pages, which is not what I am looking for.
Also I must be able to show it so it spans both columns on a 2-column layout.
Any ideas anyone?
Cheers,
Michael.

A: If you put it into the page template view.phtml file directly then you will not have this problem.
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('macguffin')->toHtml() ; ?>

Where macguffin is your block.
You can also pull through your block title with a bit more code:
<?php $block = Mage::getModel('cms/block')->setStoreId(Mage::app()->getStore()->getId())    ->load('macguffin');
echo "<h3>".$block->getTitle()."</h3>"; ?>


text:
Q: Mock a response in Python I have two classes: RuleService and RuleRepository
In RuleService I get instance of RuleRepository.
from domain.rule.rule_repository_mysql import get_rule_repository_mysql_instance

class RuleService:
    _instance = None
    rule_repository = get_rule_repository_mysql_instance()
    def get_rule_by_id(self, rule_id):

        rule = self.rule_repository.get_rule_by_id(rule_id)

        return rule.parameters

I don't know how to mock results of following call or mock all rule object
self.rule_repository.get_rule_by_id(rule_id)

Thank you

A: You could create another, "mocked" module of the get_rule_repository_mysql_instance. For example get_rule_repository_mysql_instance_mocked and in there implement all the functions you need to be mocked for your tests. Then, instead of importing the original module you can import
from domain.rule.rule_repository_mysql import (
    get_rule_repository_mysql_instance_mocked
) as get_rule_repository_mysql_instance

You can do this under a condition like if settings.get('use_mock', False):....
If this is purely for testing, I'd recommend checking out unittest.mock implementation: https://docs.python.org/3/library/unittest.mock.html


text:
Q: Kafka console consumer ERROR "Offset commit failed on partition" I am using a kafka-console-consumer to probe a kafka topic.
Intermittently, I am getting this error message, followed by 2 warnings:
[2018-05-01 18:14:38,888] ERROR [Consumer clientId=consumer-1, groupId=console-consumer-56648] Offset commit failed on partition my-topic-0 at offset 444: The coordinator is not aware of this member. (org.apache.kafka.clients.consumer.internals.ConsumerCoordinator)

[2018-05-01 18:14:38,888] WARN [Consumer clientId=consumer-1, groupId=console-consumer-56648] Asynchronous auto-commit of offsets {my-topic-0=OffsetAndMetadata{offset=444, metadata=''}} failed: Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing the session timeout or by reducing the maximum size of batches returned in poll() with max.poll.records. (org.apache.kafka.clients.consumer.internals.ConsumerCoordinator)

[2018-05-01 18:14:38,888] WARN [Consumer clientId=consumer-1, groupId=console-consumer-56648] Synchronous auto-commit of offsets {my-topic-0=OffsetAndMetadata{offset=447, metadata=''}} failed: Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing the session timeout or by reducing the maximum size of batches returned in poll() with max.poll.records. (org.apache.kafka.clients.consumer.internals.ConsumerCoordinator)

It suggested in the warn logs that:

This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing the session timeout or by reducing the maximum size of batches returned in poll() with max.poll.records.

So, I either need to increase max.poll.interval.ms or decrease max.poll.records.
Please advise what would be the implication of each method, and which one is preferred on a different situation?

A: If you increase max.poll.interval.ms that says "it's ok to spend time processing a large batch of records" and you'll gain throughput if you can process larger batches more efficiently than smaller ones.
To decrease max.poll.records says "take fewer records so there's enough time to process them" and would favor latency over throughput.
Also consider that both are configured fine, but something else is causing performance issues within your poll loop. I would explore that first before changing configuration so you don't mask a bigger problem.


text:
Q: Extracting lines from a file by comparing with numeric values I have some data which is of the following form :
|1000|1|2|abcd
|2000|1|2|djcd
|3000|1|2|eysa
|4000|1|2|adns
|5000|1|2|absd
|6000|1|2|dsvd
|7000|1|2|bejk
|8000|1|2|qwrv
|9000|1|2|vjik
|10000|1|2|msuf

I need to write a shell script that should print all the rows in between (and including as the case maybe) two values.
Eg. Suppose 3500 and 8000 are taken as inputs, then the output must be
|4000|1|2|adns
|5000|1|2|absd
|6000|1|2|dsvd
|7000|1|2|bejk
|8000|1|2|qwrv

Can someone please tell the required command(s) to do this? Thanks!

A: try this line:
awk -F\| -v s="3500" -v e="8000" '$2>=s&&$2<=e' file

the 3500 and 8000 could be shell variables.


text:
Q: Sublime Text 3 uses a lot of CPU when typing, but about 1% in idle mode When typing in Sublime Text 3 it takes several seconds to type each letter, number, sign, etc. The problem appeared today, I haven't installed any packages for Sublime Text 3 today nor have I installed anything on my computer recently. When the problem occurred for the first time I decided to check the system resources via htop. I saw this:

I spent a long time investigating the problem and discovered that everyone who had this problem stated that the reason is file indexing, and the following solutions were proposed:

*

*Renaming/removing the 'Index' folder and letting Sublime Text recreate it.

*Adding the following to Sublime's configuration file:
{
"folder_exclude_patterns": [
    "node_modules",
    "vendor",
    "pages-desktop"
],

"index_files": false,
}

I don't have any "Index" folders in ~/.config/sublime-text-3/. I tried to remove the whole ~/.config/sublime-text-3/ folder but that didn't work. Also I don't have any Sublime Text 3 console outputs about indexing. "Indexing status" table is empty. I reinstalled the editor several times from the Ubuntu repository, from the official Sublime Text 3 site. I also tried to install older versions of the program.
Still I can't fix the problem.
My OS in Ubuntu 16.04 LTS.


text:
Q: ggvis - How to show different variables in barchart, and select any or more dynamically i have this data.frame:
    Campanas1     variable     sessions
1   Adwords       sumResults    69
2   Campa�as     sumResults     2
3   Directo       sumResults    10947
4   Email         sumResults    413
5   Referencias   sumResults    12991
6   SEO           sumResults    37693
7   Social Media  sumResults    5993
8   Others        sumResults    2

I've made a bar chart with this code:
Sesiones_Campanas1 %>% ggvis(~Campanas1, ~sessions, fill := "red") %>% layer_bars()

Question: How to put a selector for every/all Sources (from Campanas1)?
My attemp:
Sesiones_Campanas1 %>% ggvis(~Campanas1, ~sessions, fill := "red") %>%   layer_bars(input_select(label = "Fuente"),
                                                                              choices = c("Email",
                                                                                "Directo", "Adwords",
                                                                                "Campanas1", "Referencias", "SEO",
                                                                                "Social Media"))

But i get this error:
Error: length(x) not equal to 1

A: After quite a bit of a research I think I made it. The difficult part was to include the All-rows part in the drop-down menu. So, here it goes:
First of all you need 2 libraries to do it: dplyr and stringi:
library(dplyr)
library(stringi)

selector <- c('Adwords', 'Campanas', 'Directo', 'Email',  'Others', 'Referencias', 'SEO', 'Social_Media', 'All' = 'Adwords_Campanas_Directo_Email_Others_Referencias_SEO_Social_Media' )
#the selector is a vector to include all your choices

And the actual code that does what you need:
Sesiones_Campanas1  %>%  #the table
  ggvis(~Campanas1, ~sessions, fill := "red") %>% #the ggvis object
  filter(stri_detect_fixed(eval(input_select(choices=selector, label='Fuente' )) , Campanas1) ) %>%   #the difficult part. You need to use filter and stri_detect_fixed with the input select to get exactly what you need.
  layer_bars() #plot bars

I cannot upload the interactive graph (I think) so I ll upload the static all graph (But you can see the drop-down box and all of the choices there).
P.S. If the x-axis labels won't appear correctly it is because you need to increase the graph size (works both on Rstudio and on the browser)
P.S.2 A few words on how the filter line works: You need eval to evaluate the input_select outcome into a string so that it can then be matched with the stri_detect_fixed function. filter then decides which rows to be used.
And that's it!

UPDATE
In order to have the the 'all' sources selected at the beginning you need to specify the selected argument like this:
Sesiones_Campanas1  %>%
  ggvis(~Campanas1, ~sessions, fill := "red") %>%
  filter(stri_detect_fixed(eval(input_select(choices=selector, label='Fuente', selected='Adwords_Campanas_Directo_Email_Others_Referencias_SEO_Social_Media' )) , Campanas1) ) %>%
  layer_bars()

Hope this helps!!


text:
Q: Make errors - ec_asn1.o - ec_asn1.c:201: error: expected expression before 'X9_62_PENTANOMIAL' I am trying to install a separate version of Openssl 1.0.1k on Red Hat. I tried on Centos first with no real issues.
Before getting to this error I did the following:

yum install -y libxml2 libxml2-devel libxslt libxslt-devel    #not sure if this actually helped with my errors.
./config --prefix=/data/home/jboss/openssl_1.0.1/usr         \
         --openssldir=/data/home/jboss/openssl_1.0.1/etc/ssl
# missing include files.
vi ~/.bash_profile
C_INCLUDE_PATH=/usr/lib/bcc/include/
CPLUS_INCLUDE_PATH=/usr/lib/bcc/include/
export C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH
LANG=en_US           # make was giving accented a special characters. This fixed. I would set it back once I fixed to en_US.UTF-8.
vi /usr/lib/bcc/include/asm/limits.h
define INT_MAX              2147483647

After all of that, I am getting the following:

.... more on top
make[2]: Entering directory `/data01/home/s617741/openssl-1.0.1k/crypto/bn'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/data01/home/s617741/openssl-1.0.1k/crypto/bn'
making all in crypto/ec...
make[2]: Entering directory `/data01/home/s617741/openssl-1.0.1k/crypto/ec'
gcc -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM   -c -o ec_asn1.o ec_asn1.c
ec_asn1.c:201: warning: implicit declaration of function 'offsetof'
ec_asn1.c:201: error: expected expression before 'X9_62_PENTANOMIAL'
ec_asn1.c:201: error: initializer element is not constant
ec_asn1.c:201: error: (near initialization for 'X9_62_PENTANOMIAL_seq_tt[0].offset')
ec_asn1.c:202: error: expected expression before 'X9_62_PENTANOMIAL'
ec_asn1.c:202: error: initializer element is not constant
ec_asn1.c:202: error: (near initialization for 'X9_62_PENTANOMIAL_seq_tt[1].offset')
ec_asn1.c:203: error: expected expression before 'X9_62_PENTANOMIAL'
ec_asn1.c:203: error: initializer element is not constant
ec_asn1.c:203: error: (near initialization for 'X9_62_PENTANOMIAL_seq_tt[2].offset')
... continues with similar errors.

Any insight would help.

A: offsetof is defined in is defined in <stddef.h>, and used by ec_asn1.c and rand_egd.c.
However, ec_asn1.c and rand_egd.c do not include <stddef.h>:
$ cd openssl-1.0.1
$ find . -iname ec_asn1.c
./crypto/ec/ec_asn1.c
$ cat crypto/ec/ec_asn1.c | grep stddef

You should open ec_asn1.c and rand_egd.c, and add #include <stddef.h>.
-----
A bug was filed against OpenSSL for this issue: Bug 3684: Missing <stddef.h> for source files using offsetof. You can check the status in their RT Tracker. Login with username=guest, password=guest.
-----
Here's the definition from the machine I am working on in case you need it:
#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 5 || __GNUC__ > 3)
#ifndef __offsetof      /* Deprecated: for source compatibility only */
#define __offsetof(type, field) __builtin_offsetof(type, field)
#endif
#define offsetof(type, field) __builtin_offsetof(type, field)
#else /* ! (gcc >= 3.5) */
#ifndef __offsetof      /* Deprecated: for source compatibility only */
#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
#endif
#define offsetof(type, field) ((size_t)(&((type *)0)->field))
#endif /* (gcc >= 3.5) */


text:
Q: How to use controls and the +, ++ notation with Tikz? I want to draw a curved path using Bezier control points, with the notation
 <a> .. controls <b> and <c> ... <d>;

I also want to specify coordinates b and c relatively from each other (b relatively from a, and c relatively from b). For that, I'd like to use the "+" and/or "++" notation. I thought I understood it (reading the manual and another similar (old) post here), but I obviously miss something.
Here is what I do:
\draw[->, thin] (alpha.east) .. controls ++(2.5cm,0) and ++(0,1cm) .. (beta.west);
\draw [red] (alpha.east) -- ++(2.5cm,0) -- ++(0,1cm) -- (beta.west);

The second line of code is just to help me understand what I'm doing. This is what it gives:

So, it starts from alpha.east and obviously heads towards the point located at 2.5cm on its right, that's ok. But then, from Tikz manual: "Then the curve will, indeed, end at beta.west and the tangent of the curve at point beta.west
will go through the second control point."
Here my arrow near beta points downwards, which obviously shows that the tangent of the curve at beta.west does not point to my second control point!
What did I understand wrong?
Thanks a lot!
EDIT:
Thank you daleif for your answer.
So, in order to give a working example, I adapted the code given by daleif in the answer below. Here it is:
\documentclass[tikz]{standalone}

\usetikzlibrary{decorations.pathreplacing}
\tikzset{%
  show curve controls/.style={
    postaction={
      decoration={
        show path construction,
        curveto code={
          \draw [blue]
            (\tikzinputsegmentfirst) -- (\tikzinputsegmentsupporta)
            (\tikzinputsegmentlast) -- (\tikzinputsegmentsupportb);
          \fill [red, opacity=0.5]
            (\tikzinputsegmentsupporta) circle [radius=.2ex]
            (\tikzinputsegmentsupportb) circle [radius=.2ex];
        }
      },
      decorate
}}}

\begin{document}

\begin{tikzpicture}
  \node (alpha) at (0,-2) {\includegraphics[width=.17\textwidth]{alpha.png}};
  \node (beta) at (7,0) {\includegraphics[width=.25\textwidth]{beta.png}};
  \draw [show curve controls]
  (alpha.east)
  .. controls ++(2.5cm,0) and ++ (0,1cm) ..
  (beta.west);
\end{tikzpicture}

\end{document}

And here is what it gives:

So, I see my second control point isn't located as I would like, but I still don't understand why. Why isn't it located 1cm above the 1st control point?
Thanks a lot again!

A: Ok, found it.
I wasn't looking at the right place in the manual. Here is the explanation (section 13.4.1 of the manual):

"There is a special situation, where relative coordinates are
  interpreted differently.  If you use a relative coordinate as a
  control point of a Bézier curve, the following rule applies:  First,
  a relative first control point is taken relative to the beginning of
  the curve.  Second, a relative second control point is taken relative
  to the end of the curve.  Third, a relative end point of a curve is
  taken relative to the start of the curve."

A: Too long for a comment
BTW: please always provide self contained full minimal examples, not sniplets like this. Self contained examples are easier to test with.
Here is an example showing there the relative control points are. I'm using polar coords here.
\documentclass[tikz]{standalone}

\usetikzlibrary{decorations.pathreplacing}
\tikzset{%
  show curve controls/.style={
    postaction={
      decoration={
        show path construction,
        curveto code={
          \draw [blue]
            (\tikzinputsegmentfirst) -- (\tikzinputsegmentsupporta)
            (\tikzinputsegmentlast) -- (\tikzinputsegmentsupportb);
          \fill [red, opacity=0.5]
            (\tikzinputsegmentsupporta) circle [radius=.2ex]
            (\tikzinputsegmentsupportb) circle [radius=.2ex];
        }
      },
      decorate
}}}

\begin{document}

\begin{tikzpicture}
  \coordinate (A) at (0,0);
  \coordinate (B) at (5,5);
  \draw [show curve controls]
  (A)
  .. controls ++(0:5) and ++ (0:5) ..
  (B)
  ;
\end{tikzpicture}

\end{document}


text:
Q: Proving a differential equation has a unique solution, where $f(t,x)$ is decreasing. Let $f:[t_0,t_1] \times \mathbb{R} \longrightarrow{\mathbb{R}}$ a continuous function. Suppose that $f$ is a decreasing function on $x$, how can I prove that for every $x_0\in \mathbb{R}$ the problem \begin{cases} x'=f(t,x) \\ x(t_0)=x_0 \end{cases} has an unique solution?
I suppose that I should use Picard's theorem, but I dont know how to take advantage of $f$ being a decreasing function.

A: Suppose $x_1$ and $x_2$ are two solutions on $[t_0,t_1]$. Let $h(t)=(x_1(t)-x_2(t))^2$ and prove that $h$ is decreasing (that is, $h'\le0$.)

A: We have to prove two things, the existence and uniqueness of a solution.
Before starting to prove anything we have to make a really important observation. Since $f(t,x)$ is decreasing on x $$f(t,x_1)\geq f(t,x_2)\hspace{2mm}\forall t\in [t_0,t_1], \forall x_1\leq x_2$$ we get that $$(x_2-x_1)(f(t,x_2)-f(t,x_1))\leq0$$
Existence: Since $f(t,x)$ is a continous function (by hypothesis), we can use Peano's theorem which garantees the existence of a solution. Let's call this solution $\varphi(t)$.
Uniqueness: We first suppose that there existed another solution $\psi(t)$ for the same initial value problem. Let's define another function $$g(t)=(\varphi(t)-\psi(t))^2\geq0, \hspace{2mm}\forall t\in [t_0,t_1]$$
Now $$g'(t)=2(\varphi(t)-\psi(t))(\varphi'(t)-\psi'(t))=2(\varphi(t)-\psi(t))(f(t,\varphi(t))-f(t,\psi(t)))\leq0$$ for all $t\in [t_0,t_1]$.
So $g(t)$ is a decreasing function on $[t_0,t_1]$, which means that $$g(t)\leq g(t_0)=0$$ since we where assuming that $\psi(t)$ was also another solution to the IVP. At the end, we get $$g(t)\leq0 \text{  and  }g(t)\geq0\hspace{2mm}\forall t\in[t_0,t_1]$$ Which means $g(t)=0$ for all $t$ in $[t_0,t_1]$, i.e. $\varphi(t)=\psi(t)$ for all $t$ in $[t_0,t_1]$.


text:
Q: How many samples do I need to compute long tail percentiles (99.99th) I have a time series data set and I would like to compute a moving percentiles starting from median, 95th, up to 99.99th.
My question is, what should be the size of my window, i.e. how many samples do I need, to estimate long tail percentiles such as 99.99th and how do I decide that?
My naive idea is that I would need at least 10,000 samples to compute 99.99th? But is it enough?
Thank you!


text:
Q: Remove #! from url in angularjs I am trying to understand how to remove #! from the url in angularjs using ng-route .
Can please someone help me with the exact steps I need to follow in order to remove #!.
Here is the code
index.html

  Hello there

  Click Me

a02.js
var app = angular.module("testApp", ['ngRoute']);

  app.config(["$routeProvider",function($routeProvider){
    $routeProvider.when('/test',{
        template:"It's routing template"
    })
}]);

My requirement is when click on click me link it should display

It's routing template.

But when browser loads index.html the url is coming as
http://localhost:3000/index.html#!/

and when I click on Click Me link the url is coming as
http://localhost:3000/index.html#!/#test

I want this url and link to be work without #!.

A: in your js router file you need to add:
$locationProvider.hashPrefix('');
$locationProvider.html5Mode(true);

and in your index html file (head tag) you need to add:
<base href="/">


text:
Q: What's the difference between get_the_time and get_the_date? Both function returns date and time. What's the difference between them? Do you have any example? Thanks.

A: The the_date() template tag only outputs the post date once per occurrence; thus, if two or more posts have the same post date, that date is only output at its first occurrence in the Loop. The the_time() template tag outputs the post time (using any valid date/time string), as per normal.
The get_the_date() and get_the_time() template tags, however, are essentially the same. They are used to return the respective value for the_date() and the_time(). As per the Codex:

Unlike the_date() this tag will always return the date. Modify output with 'get_the_date' filter.

So, the difference lies not in the get_the_*() template tags themselves, but in the the_*() template tags that use them.

A: They are, very similar but with some nuances:
function get_the_date( $d = '' ) {
    global $post;
    $the_date = '';

    if ( '' == $d )
        $the_date .= mysql2date(get_option('date_format'), $post->post_date);
    else
        $the_date .= mysql2date($d, $post->post_date);

    return apply_filters('get_the_date', $the_date, $d);
}

function get_the_time( $d = '', $post = null ) {
    $post = get_post($post);

    if ( '' == $d )
        $the_time = get_post_time(get_option('time_format'), false, $post, true);
    else
        $the_time = get_post_time($d, false, $post, true);
    return apply_filters('get_the_time', $the_time, $d, $post);
}

*

*get_the_date() always works for current global $post,  get_the_time() allows you to specify post as argument.

*They default to different formats, stored in date_format and time_format options respectively.

*They pass output through different filters get_the_date and get_the_time plus lower level get_post_time respectively.


text:
Q: Is there a way to render PNG with gradients in Internet Explorer Mobile 7 correctly? Call me crazy, but I'm optimizing a website for the Internet Explorer Mobile 7. My main problem, besides several CSS issues, is that it seems that this browser displays 24 bit PNGs in 8 bit, that means gradients look horrible.
Anyone an idea how to fix this?

A: You need to dither the image so that it renders nicely.
Here are two links that show you how to do this:

*

*Photoshop action for Windows Phone 7 Dithering

*High Quality Dithering for Windows Phone 7


text:
Q: Deleting specific rows from oracle table I have to delete the specific rows from oracle table. Below is the table structure.

*

*For Item Id 1234 where more than 1 row with Cancel state exists it should delete last 2 rows of Cancel State such that only two records remains in table with 02/Apr/2021 to 04/June/2021 and 05/June/2021 to 06/June/2021(also 06/June/2021 gets updated to 31/Dec/3033). I have to identify all the rows where more than 1 Cancel State along with one Active state exists and then have to delete all the cancel rows except 1 cancel row and then have to update item end date to max date for that row.

*For Item Id 1235, since only one row exits of Cancel state it should gets deleted from the table. I have to identify all such rows where state is only Cancel and no Active state row exists for that Item Id and then delete them.

*For Item Id 1236, its a perfect state therefore nothing should happenes to such rows.

Item Id
Item State
Item Start Date
Item End Date

1234
Active
02/Apr/2021
04/June/2021

1234
Cancel
05/June/2021
06/June/2021

1234
Cancel
07/June/2021
30/June/2021

1234
Cancel
01/July/2021
31/Dec/3033

1235
Cancel
03/Apr/2021
03/Apr/2021

1236
Active
04/Apr/2021
05/May/2021

1236
Cancel
06/May/2021
31/Dec/3033

After deleting specific rows table would change to something like below

Item Id
Item State
Item Start Date
Item End Date

1234
Active
02/Apr/2021
04/June/2021

1234
Cancel
05/June/2021
31/Dec/3033

1236
Active
04/Apr/2021
05/May/2021

1236
Cancel
06/May/2021
31/Dec/3033

Please suggest pointers to get this done. Can this be done using sql alone ?I have not done coding in PL/SQL before.
Many many thanks in advance.

A: Indeed it is possible in SQL. Here is what worked for me.
The below snippet will hold details for Item IDs in active state:
create table active as
select *
from
(select id, state, count(*) as flg from itm group by id, state)
where state='Active';

Similarly, in the below snippet, creating a table for Item IDs in Cancel state:
create table cancel as
select *
from
(select id, state, count(*) as flg from itm group by id, state)
where state='Cancel';

Note that I've created flg variable which holds number of records with active and cancel respectively.
The below code snippet will ignore perfect Item IDs (i.e., 1236) for now.
create table target as
select a.id as a_id, a.state as a_state, a.flg as a_flg, c.*
from active as a
full join cancel as c
    on a.id=c.id
where a.flg <> c.flg;

Below code will help us to get Item IDs that needs to be analysed.
create table ads as select *, count(*) as cnt
from itm
where
 id IN (select distinct a_id from target where a_id IS NOT NULL)
 or
 id IN (select distinct id from target where id IS NOT NULL)
group by id
order by id, state, start_date, end_date;

/* The below snippet is to delete any record with only cancel */
create table fin_ads as
select * from ads
where cnt <> 1;

Below snippet will give us the final results
    /* The below snippet is to stitch records with multiple cancel */
    select id, state, min(start_date) as start format=date9., max(end_date) as end format=date9.
from fin_ads
    group by id, state
    UNION
    /* UNION is used to combine the perfect Item IDs back to the result */
    select id, state, start_date as start, end_date as end from itm
    where id IN
    (
    select distinct a.id
    from active as a
    inner join cancel as c
    on a.id=c.id
    where a.flg =c.flg)

I know this is not an optimized query and is long. Yet this gives the result as expected.
Note: Use sub-queries to reduce number of intermediate tables getting created. Hope this helps! Do let me know if this works/ facing any issues.

A: Do you want to delete and update rows in your table or merely select the described result from your table?
Then it looks like there is always at most one active row per item in the table. Your result hence shows the items with one row per status and their minimum start date and maximum end date.
The following simple query may hence already do what you want to do:
select
  item_id,
  item_state,
  min(item_start_date) as item_state_start_date,
  max(item_end_date) as item_state_end_date
from mytable
group by item_id, item_state
order by item_id, item_state;

This selects rows. If you want to delete and update rows instead, you can simpy create a table from the above result, delete rows in your original table and fill the table from the newly created one. (Or create the new table, drop the old one, rename the new one.)


text:
Q: Facebook iOS SDK and iOS6 I'm currently trying to use the Facebook SDK official pod in its 3.14.1 version (also tried 3.9, same result) but I stumble upon an issue.
Here is my code:
self->_session = [[FBSession alloc] initWithAppID:[[self class] facebookAppId]
                                      permissions:self.mandatoryPermissions
                                  urlSchemeSuffix:nil
                               tokenCacheStrategy:[FBSessionTokenCachingStrategy defaultInstance]];

[self->_session openWithBehavior:FBSessionLoginBehaviorWithFallbackToWebView
               completionHandler:^(FBSession *session,
                                       FBSessionState state,
                                       NSError *error)
{
    [self sessionStateChanged:session
                        state:state
                        error:error];
}];

This is greatly inspired from code samples given by facebook : https://developers.facebook.com/docs/facebook-login/ios/v2.0 # Step 1b: Open the session using the custom class
Here is the issue :
dyld: lazy symbol binding failed: Symbol not found: _OSAtomicDecrement32
  Referenced from: /var/mobile/Applications/01DD5CE2-39A9-40AE-A8FC-170F7387D434/Dubb.app/Dubb
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _OSAtomicDecrement32
  Referenced from: /var/mobile/Applications/01DD5CE2-39A9-40AE-A8FC-170F7387D434/Dubb.app/Dubb
  Expected in: /usr/lib/libSystem.B.dylib

By looking at their SDK code I can't see fallbacks for the OSAtomicDecrement32 in case it doesn't exist, and it in fact exists sstarting with iOS 7.1.
Any advice?
Thanks

A: I actually understood what happened here after having the same issue on iOS7.0.
The call OSAtomicIncrement32 is defined as its own function on iOS >= 7.1, but it is also defined as an inline call to other functions for iOS < 7.1.
The right definition is used depending on the min deployment target, which for me was set to '7.1' in my podfile. Changing it to:
platform :ios, '7.0'
fixed the issue!

A: I deleted and then re-installed my pods.
Then I had to change one #import statement from:
#import <FacebookSDK/Facebook.h>

to
#import <FacebookSDK/FacebookSDK.h>

Rebuilt everything, and it worked.


text:
Q: Can't figure out what i'm doing wrong with arrays -- warning i am new and learning #include <stdio.h>

int playerscores() //function asking how many points each player has
{
//  int p; //player number we are on
//  p++; //since player number starts on zero, add one to print player #1
    int n;
    n++;
    printf("how many points does player %d have?\n", n);
    scanf("%d", &n); //asking how many points and writing to variable n
    return n; //output variable n
}

int main()
{
    int n; //numberof players
    int scoret = 0; //score total
    printf("How many players are on your team?\n");
    scanf("%d", &n); //asking number of players
    int score[n];  // integer array to store player scores
    int a = 1; //starting number for loop, indicating to start on player 1
    while(a <=  n)
    {
        score[a-1] = playerscores(); //calling function and define array at position b as equal to function output
        printf("%d", score[a-1]); //me trying to trouble shoot
        a++; //next player
        scoret = scoret + score[a-1]; //adding up scores thus far
        printf("%d", scoret); //more of me attempting to trouble shoot
    }

    return scoret; //final score

}

I'm just getting into coding and trying to learn on my own, using codesdope.com. I am on the array section now. I like to write a little bit of custom code just to familiarize my self but i can't seem to figure this one out. Every time i run this, the output is some crazy big number, looks like it is the address rather than the value. I don't think i ever call the address at any point but i'm not sure what else i could be doing wrong. Thanks for your alls help!

A: In
printf("%d", score[a-1]); //me trying to trouble shoot
a++; //next player
scoret = scoret + score[a-1]; //adding up scores thus far

you need to change the order of the lines
printf("%d", score[a-1]); //me trying to trouble shoot
scoret = scoret + score[a-1]; //adding up scores thus far
a++; //next player

or change the index
printf("%d", score[a-1]); //me trying to trouble shoot
a++; //next player
scoret = scoret + score[a-2]; //adding up scores thus far

Side note: if you don't need the side effect of post-fix operator++ (as in a++), then use the prefix variant (as in ++a).

A: I've just changed the ordering of scoret variable, hope this code will work the way you want it to.
#include <stdio.h>

int playerscores(int curr_player) //function asking how many points each player has
{
    int p = curr_player; //player number we are on
    int curr_score = 0;
   // p++; //since player number starts on zero, add one to print player #1
    printf("how many points does player %d have?\n", p);
    scanf("%d", &curr_score); //asking how many points and writing to variable n
    return curr_score; //output variable n
}

int main()
{
    int n; //numberof players
    int scoret = 0; //score total
    printf("How many players are on your team?\n");
    scanf("%d", &n); //asking number of players
    int score[n];  // integer array to store player scores
    int a = 1; //starting number for loop, indicating to start on player 1
    while(a <=  n)
    {
        score[a] = playerscores(a); //calling function and define array at position b as equal to function output
        printf("%d", score[a]); //me trying to trouble shoot
        scoret += score[a]; //adding up scores thus far
        a++;
    }
    printf(" %d", scoret); //more of me attempting to trouble shoot
    return scoret; //final score
}

In the lines:
a++; //next player
scoret = scoret + score[a-1]; //adding up scores thus far

you were incrementing a to the next position in the memory before adding it to scoret and the next position seems to hold garbage values that was showing up every time in your
printf("%d", score[a-1]); //me trying to trouble shoot

line

A: There biggest issues I see here:
1) As already mentioned the local variable p / n. As you make the declaration within the function body, this variable will be initialized every time you call that function, so it will not remember the current value. Additionally, you don't initialize the variable with a value, means it could be 0 when you call it, but also any other number.
2) The issue with the big number comes from the order of the commands you execute. When you execute your loop the first time, you store your result in score[a-1] which is  score[0]. Now your issue: you increase a by 1, and afterwards you add the score to your global score, which results in scoret = scoret + score[1]. As you didn't initialize or assign something to score[1], you don'T know what'S inside, it may be 0, but maybe also 13567325.
One possibility to implement your functionality would be:
#include <stdio.h>

int playerscores(int n) //function asking how many points each player has
{
    int p = 0; //variable storing the points
    printf("how many points does player %d have?\n", n+1);
    scanf("%d", &p); //asking how many points and writing to variable p
    return p; //return p for the points
}

int main()
{
    int n = 0; //number of players
    int scoret = 0; //score total
    printf("How many players are on your team?\n");
    scanf("%d", &n); //asking number of players
    int score[n];  // integer array to store player scores

    // using a for loop -> don't need to worry about incrementing the index
    for (int a = 0; a < n; a++)
    {
        score[a] = playerscores(a); //calling function and define array at position a
        scoret += score[a]; //adding up scores thus far
    }

    printf("Total score: %d\n", scoret);

    return scoret; //final score
}


text:
Q: Encoding string C# I get a page response from a web and it is having strings like "Lluís Quílez". But i get it as "Lluís Quílez". So how do i change it back to "Lluís Quílez" in C#?
Thank you.

A: The string is HTML encoded. Use the HtmlDecode method:
s = System.Web.HttpUtility.HtmlDecode(s);

A: Check out this outstanding article which might help you ;)
and an answer to a related question here.


text:
Q: EncryptingJsonConvertor in WebAPI I tried using the solution of encrypting some properties of my class in JSON mentioned by Thomas Freudenberg. When I serialize the object using JsonConvert.SerializeObject() I get the desired result.
The class and convertor are located in a separate assembly, which is referenced in my WebAPI project. When I use the following:
[HttpPost]
[Route("api/ApiUsers/List")]
public Dto.ApiUsersResponse List(Dto.ApiUsersRequest apiUsersRequest)
{
    IEnumerable<Db.ApiUser> dbApiUsers = GetList<Db.ApiUser>(StoredProcedures.GetApiUsers);

    return new Dto.ApiUsersResponse()
    {
         ApiUsers = dbApiUsers.Select(apiUser => new Dto.ApiUser()
         {
            ClientId = apiUser.ClientId,
            ClientSecret = apiUser.ClientSecret
         })
    };
}

the result is in clear text instead. The conversion never happens.
I have tried changing the controller's response IHttpActionResult and using Ok() and Content() but to no avail.
When I try to register the convertor using:
config.Formatters.JsonFormatter.SerializerSettings.Converters.Add(new EncryptingJsonConverter());

The error is:
Cannot resolve symbol 'JsonFormatter'

What am I missing?


text:
Q: Applying a function over multiple df that are NOT combined in a list I am aware of apply/map to run functions over a list of data frames but my problem is that the function uses the name of the data frame to create col names and this doesn't work using it on a list of dfs. Is there a way how I could automate running the function on several DFs without combining them in a list?
Alternatively I could probably also change the function so it gets the names from list objects but so far I failed with this as well.
Maybe someone has a solution?
Thanks a lot!
Example data
p.vals <- seq(from=0, to=1, by=.0001)
logFCs <- seq(from=0, to=4, by=.1)
diffEx_proteins <- data.frame(protein=LETTERS[1:1000],
                      adj.P.Val=sample(p.vals, size=1000, replace=TRUE),
                      logFC=sample(logFCs, size=1000, replace=TRUE))

diffEx_proteins_2 <- data.frame(protein=LETTERS[1:1000],
                      adj.P.Val=sample(p.vals, size=1000, replace=TRUE),
                      logFC=sample(logFCs, size=1000, replace=TRUE))

list <- list(group1 = diffEx_proteins, group2 = diffEx_proteins_2)

Function
mark_significants_p.05and.001_fc1 <- function(comparison){
dat <- comparison
name <- deparse(substitute(comparison))
dat[,paste(name,"up_0.05", sep = "_")] <- dat$adj.P.Val <= 0.05 & dat$logFC >= 1
dat[,paste(name,"down_0.05", sep = "_")] <- dat$adj.P.Val <= 0.05 & dat$logFC <= -1
dat[,paste(name,"up_0.001", sep = "_")] <- dat$adj.P.Val <= 0.001 & dat$logFC >= 1
dat[,paste(name,"down_0.001", sep = "_")] <- dat$adj.P.Val <= 0.001 & dat$logFC <= -1
dat[,paste(name,"reg_0.05", sep = "_")] <- dat$adj.P.Val <= 0.05 & abs(dat$logFC) >= 1
dat[,paste(name,"reg_0.001", sep = "_")] <- dat$adj.P.Val <= 0.001 & abs(dat$logFC) >= 1
return(dat)
}

map(list, mark_significants_p.05and.001_fc1) results in cols with names starting with [[1]] but instead I would like to have the df name in it.
Thank you!
Sebastian

A: You could use imap which passes the list as well as names of it
mark_significants_p.05and.001_fc1 <- function(comparison, name){
    dat <- comparison
    dat[,paste(name,"up_0.05", sep = "_")] <- dat$adj.P.Val <= 0.05 & dat$logFC >= 1
    dat[,paste(name,"down_0.05", sep = "_")] <- dat$adj.P.Val <= 0.05 & dat$logFC <= -1
    dat[,paste(name,"up_0.001", sep = "_")] <- dat$adj.P.Val <= 0.001 & dat$logFC >= 1
    dat[,paste(name,"down_0.001", sep = "_")] <- dat$adj.P.Val <= 0.001 & dat$logFC <= -1
    dat[,paste(name,"reg_0.05", sep = "_")] <- dat$adj.P.Val <= 0.05 & abs(dat$logFC) >= 1
    dat[,paste(name,"reg_0.001", sep = "_")] <- dat$adj.P.Val <= 0.001 & abs(dat$logFC) >= 1
   return(dat)
}

purrr::imap(list, mark_significants_p.05and.001_fc1)

imap is same as map2 passed with names of list
purrr::map2(list, names(list), mark_significants_p.05and.001_fc1)


text:
Q: Второй StatusBar в проводнике [Windows 10] После установки виндовс ставил все программы подряд по своему списку, сразу не обратил внимание, что появился еще один статус бар в проводнике, к тому же на русском (язык у windows в дальнейшем был изменен на английский, а текст в статус баре остался на русском).
Так же статус бар с белым оформлением, когда в windows включена темная тема.

Вопрос: как найти программу которая его добавила и отключить.
Список установленных программ:
4K Video Downloader 4.12
7-Zip 19.00 (x64)
Adobe Flash Player 32 PPAPI
AIDA64 5.97.4600 Final
AIMP
App Installer
ASIO4ALL
Audacity 2.4.2
AutoHotkey 1.1.30.00
Bandicam
Bandisoft MPEG-1 Decoder
CCleaner
Classic Shell
ColorMania 11.0
CurseForge
Dropbox
English (United States) Local Experience Pack
Factorio [v1.0]
FileZilla Client 3.51.0
FL Studio 20
FL Studio ASIO
Game Redistributables version 1.1.1.1
Git version 2.28.0
Google Chrome
HeidiSQL 11.1.0.6116
HxD Hex Editor 2.4
Java 8 Update 271 (64-bit)
LogMeIn Hamachi
Mem Reduct
Microsoft Office профессиональный плюс 2016
Microsoft Store
Microsoft Visual C++ 2005 Redistributable - x64 8.0.61000
Microsoft Visual C++ 2005 Redistributable - x86 8.0.61001
Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.6161
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.6161
Microsoft Visual C++ 2010 Redistributable - x64 10.0.40219
Microsoft Visual C++ 2010 Redistributable - x86 10.0.40219
Microsoft Visual C++ 2012 Redistributable (x64) - 11.0.61030
Microsoft Visual C++ 2012 Redistributable (x86) - 11.0.61030
Microsoft Visual C++ 2013 Redistributable (x64) - 12.0.40664
Microsoft Visual C++ 2013 Redistributable (x86) - 12.0.40664
Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.20.27607
Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.20.27607
Microsoft Visual Studio Code (User)
Moo0 Системный монитор 1.83
Movavi Video Suite 18.1.0
MTA:SA v1.5.7
NVIDIA Control Panel
NVIDIA Графический драйвер 432.00
Overwolf
paint.net
Picasa 3
qBittorrent 4.2.5
QTTabBar ver 1043
Radmin VPN 1.1.8
Resource Hacker Version 4.7.34
Restorator 2009
RivaTuner Statistics Server 7.2.0
Screenpic 0.15.2
Skype, версия 8.66
Sound Lock
Store Experience Host
TeamViewer
Twitch
Viber
Windscribe
Xbox Identity Provider
Пакет локализованного интерфейса на русском

Виновник торжества: Classic Shell. Думал о нем в последнюю очередь.


text:
Q: Git: failed to execute git I was trying to push one of my project from vs code to github but when I click on commit button it asked me to continue instead of no changes or to change something I clicked on continue button and after 5 seconds it says "Git:failed to execute git".I have already tried git init but no effect.I don't know what to do now.I haven't clone it or trying to do so I just wanted to push one simple project from vs code to git hub
I have tried git init


text:
Q: why list and string are behaving differently while checking equality in the below case Why is the equality behaving differently? In case of list it's giving false but in case of string it's giving true  and in the last case it's strangely False
list1 = [1, 2, 3]
list2 = list1[:]
print(id(list1))
print(id(list2))
print(list1 is list2)
print(id(list1) == id(list2))

140271225865864
140271225867080
False
False
list3="hello"
list4=list3[:]
print(id(list3))
print(id(list4))
print(list3 is list4)

140271226135360
140271226135360
True
list5="hello"
list6 = ''.join(c for c in list5)
print(list5 is list6)

False

A: There are several kinds of immutable. String being the lucky one that python enforces the same copy of 'hello' is used wherever in the entire code. So
s='hello'
#many lines of code
t='hello'
id(t)==id(s)

tuple being unlucky that
s=(1,2)
#many lines of code
t=(1,2)
id(t)!=id(s)
#but you do have
hash(t)==hash(s)

List is mutable so it is guaranteed that
s=[1,2]
#many lines of code
t=[1,2]
id(t)!=id(s)
#You cannot run hash on mutables
hash(t)==hash(s) #error


text:
Q: How to understand this C++ code from Boost library? I came across the following code in the Boost library default_attribute_names.hpp. I am trying to understand the below code.
What I understand is, a function name severity() is declared which returns an object of class attribute_name. I tried to locate an implementation of this function within the library but failed. Is this some thing else than what I think. And also, what is this BOOST_LOG_API. I could not find any tutorial with such language syntax. How can I understand this code?
namespace default_attribute_names {

BOOST_LOG_API attribute_name severity();
BOOST_LOG_API attribute_name channel();
BOOST_LOG_API attribute_name message();
BOOST_LOG_API attribute_name line_id();
BOOST_LOG_API attribute_name timestamp();
BOOST_LOG_API attribute_name process_id();
BOOST_LOG_API attribute_name thread_id();

}

A: A header file is part of code that meant to be used from several Operating systems, with different compilers, and several of project types.
In windows, if you compile to a DLL, you should declare export symbols, but if you compile to a static library you shouldn't.
Another issue is when you include the header to use a DLL from other project you should import symbols from DLL, while when you use the header inside the project you should export the symbols.
Therefore, usually you can find a similar macro in each cross platform class or function.
it usually may declared like this:
//from inside a DLL (on windows) which declare the symbols:
#define BOOST_LOG_API __declspec(dllexport)

//from code which use symbols which declared in other DLL:
#define BOOST_LOG_API __declspec(dllimport)

//in static lib, or none windows code it can be empty:
#define BOOST_LOG_API

//sometimes you want to prevent name mangling by adding extern "C" to API macro. (can be used only for functions not for classes)
//so it may be: (you can add it to any of the macros)
#define BOOST_LOG_API extern "C" __declspec(dllexport)

Usually you use other macro in manner to generate the correct macro. Like this:
#ifndef BOOST_LOG_API
# ifdef WIN32
#  if defined(BOOST_LOG_EXPORT)
#   define BOOST_LOG_API __declspec(dllexport)
#  elif defined(BOOST_LOG_IMPORT)
#   define BOOST_LOG_API __declspec(dllimport)
#  else
#   define BOOST_LOG_API
#  endif
# else
#  define BOOST_LOG_API
# endif
#endif


text:
Q: create custom ggplot function and set limit for y axis dynamically I am trying to create a custom ggplot function as below and managed to do what I need by adding a fourth argument to the first function below.
The first function gives the flexibility to set the argument limit_for_y_axis to any value I want; however, I'd like to know how to make the fourth argument (limit_for_y_axis) dynamic by setting it to the max value of the var_y.
# data
dt <- data.frame(month = as.Date(c("2018-03-01", "2018-02-01", "2018-01-01")), n = c(3000,2000,1000))

# version 1 (works fine)
horizontal_bar_chart_1 <- function(data, var_x, var_y, limit_for_y_axis){
  ggplot(data, aes_q(x=substitute(var_x), y=substitute(var_y))) +
    geom_bar(stat = "identity") +
    coord_flip() +
    geom_text(aes_q(label = substitute(var_y)), hjust = -.3, color = "gray35") +
    scale_y_continuous(expand = c(0, 0),
                       limits = c(0, max(limit_for_y_axis) * 1.3)
                       )

}

# test of horizontal_bar_chart_1
horizontal_bar_chart_1(data = dt, var_x = month, var_y = n, limit_for_y_axis = dt$n)

# version 2 (doesn't work)
horizontal_bar_chart_2 <- function(data, var_x, var_y){
  limit_for_y_axis = max(data$var_y) * 1.3
  ggplot(data, aes_q(x=substitute(var_x), y=substitute(var_y))) +
    geom_bar(stat = "identity") +
    coord_flip() +
    geom_text(aes_q(label = substitute(var_y)), hjust = -.3, color = "gray35") +
    scale_y_continuous(expand = c(0, 0),
                       limits = c(0, limit_for_y_axis)
    )

}

# test of horizontal_bar_chart_2
horizontal_bar_chart_2(data = dt, var_x = month, var_y = n)

The second function gives the error message below:
Error in if (zero_range(as.numeric(limits))) { :
missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In max(data$var_y) : no non-missing arguments to max; returning -Inf
2: Removed 3 rows containing missing values (position_stack).

A: You can't use a string variable to slice a dataframe with $ which is what you are implicitly trying to do with max(data$var_y). Instead of looking for a column with name of the string you pass to var_y it's looking for a column literally named "var_y"
Replace max(data$var_y) with max(data[,var_y]) and it should work.
Edit
The way I would fix this is to make everything explicitly a string and use aes_string to define your ggplot aesthetic with strings. Constructions like the var_x = month, var_y = n in your function call are dangerous because they will change behavior if you ever create a variable called month or n and you want to use them to refer to dataframe columns. Full solution looks like this:
horizontal_bar_chart_2 <- function(data, var_x, var_y){
  limit_for_y_axis = max(data[,var_y]) * 1.3
  ggplot(data, aes_string(x=var_x, y=var_y)) +
    geom_bar(stat = "identity") +
    coord_flip() +
    geom_text(aes_string(label=var_y), hjust = -.3, color = "gray35") +
    scale_y_continuous(expand = c(0, 0),
                       limits = c(0, limit_for_y_axis)
    )

}

# test of horizontal_bar_chart_2
horizontal_bar_chart_2(data = dt, var_x = "month", var_y = "n")


text:
Q: Can a command from monkey runner be used in robotium? I have written a script in robotium which works just fine, but our application is designed in such a way that it has to interact with the Native android application which cannot be resigned. I have to click a button on the native app which cant be done through robotium. So i wanted to know if i can add a command of monkey runner in my script to click on the app.

A: solo.sendKey(20); // used for move to next object on screen //

Execute above line and stop when you get focus on your desired button
Then execute bellow line, to click on button
solo.sendKey(66); // Click On Focused Button //

For example you have 3 Objects On Screen:
[1] username [ text box ]
[2] password [ text box ]
[3] Submit [ Button ]
If you want to Click on " Submit " button using "robotium" then
solo.sendKey(20);// focus on username textbox
solo.sendKey(20);// focus on password textbox
solo.sendKey(20);// focus on Submit button
solo.sendKey(66);// Click On Submit Button

generally we send keyevents from munkey code, so i suggest you above code.
Note:
KEYCODE_DPAD_DOWN [ Constant Value: 20 (0x00000014) ]
KEYCODE_ENTER [ Constant Value: 66 (0x00000042) ]
Pasted from http://developer.android.com/reference/android/view/KeyEvent.html
I tested this on my automation application.
I hope this will help you, Thanks.


text:
Q: Where is composer's global auth.json located? Where is the global auth.json from composer located on linux?

A: Composer global files can usually be found at your home directory:
In a *nix system that is:
~/.composer

auth.json should be in there as well.
In a more general sense, on any system, you should be able to find this by executing:
composer config --list --global

or
composer global config --list

Look for the home key.
On my system, doing.
composer config --list --global | grep home

results in:
[home] /Users/yivi/.composer