text:
Q: Normally distributed from 0 to 99th percentile Assume the length of waiting at supermarket is approximately normally distributed with mean 6 minutes and standard deviation 1.5 minutes.
(1) What length of the waiting time constitutes the 99th percentile ($Φ_.99$)?
My way is
For 99th percentile, find p(z > 2.327) = .01
find (y-6)/1.5 = 2.237 <=> y = 9.4905. For 0th percentile, y should be negative infinity. However, it does not make sense since we talk about time here. We should take 0 instead.
The waiting time length is between 0 and 9.4905
Could anyone please check (1) for me?

A: I assume (1) and (2) mean the same thing here.
What you have done is reasonable, except you have rounded at the wrong time: if the normal approximation was exact, the value would be closer to $9.4895$ then to $9.4905$, but there is in any case no good reason for being any more precise than $9.49$ minutes or perhaps $9$ minutes and $29$ seconds if you prefer sexagesimal.
As you say, a normal approximation cannot be exact if negative values are impossible.  Your approach of putting this very small amount (about $0.00003$) at $0$ rather than negative is probably the most sensible thing to do.
In real life, queuing times are often zero and can have a right skewed distribution and so a normal approximation is probably inappropriate.


text:
Q: How to get the error code when there is error in powershell? My snippet is something like this:
$msg=Remove-Item -Recurse -Force C:\users\bkp  2>&1
if ($LASTEXITCODE -eq 1)
{
  "Encountered error during Deleting the Folder. Error Message is $msg. Please check." >> $LogFile
  exit
 }

The folder C:\users\bkp does not exist. Even though $msg gives me the error message $LASTEXITCODE is still 0. How do I capture as a flag?

A: You can use the $? automatic variable to determine the result of the last command.  If you need access to the actual error, you can use the $Error automatic variable.  The first item in the array is the last error thrown:
Remove-Item -Recurse -Force C:\users\bkp 2>&1
if( -not $? )
{
    $msg = $Error[0].Exception.Message
    "Encountered error during Deleting the Folder. Error Message is $msg. Please check." >> $LogFile
    exit
}

A: $LASTEXITCODE is strictly for command line programs to return their status. Cmdlets that are built into PS, such as Remove-item return their errors in up to 3 ways. For warnings, they write messages (or other .NET objects) to the "warning stream". In PSv3 there is a straightforward way to redirect that stream to a file: cmdlet blah blah blah 3>warning.out. The second is via the error stream. That stream can be redirected as well ... 2>error.out, or more typically errors are caught with try/catch or trap, or written to a variable with the -ErrorVariable parameter (see help about_commonparameters). The third way is for errors to be "thrown". Unless caught (try/catch or trap), a thrown error will cause the script to terminate. Thrown errors generally are subclasses of the .NET class system.Management.Automation.ErrorRecord. An ErrorRecord provides a lot more information about an error than a return code.
If remove-item fails due to a file not found error, it writes a System.Management.Automation.ItemNotFoundException to the error stream. Using a try/catch you can filter for that specific error or other specific errors from remove-item. If you are just typing in PS commands from the command line you can enter $error[0]|select-object * to get a lot of info on the last error.

You could do this:
try {
  Remove-Item -Recurse -Force C:\users\bkp  2>&1
} catch {
  # oops remove-item failed. Write warning then quit
  # replace the following with what you want to do
  write-warning "Remove-item encounter error: $_"
  return # script failed
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Prove that every open set in $\mathbb{R}$ is the union of an at most countable collection of disjoint segments. My attempt:
We know that $\mathbb{Q}$ is dense in $\mathbb{R}$.Now, we consider an open set $S$ in $\mathbb{R}$ then let $x \in S$, $x$ is an interior point of $S$ and we can get an open ball $(x-r,x+r)$ ,$r>0$ contained in $S$. Since $\mathbb{Q}$ is dense, let $q_1 \in (x-r,x+r)$.Now, $q_1 \in (x-r,x+r)$ and let $r_1=|q_1-x|$.We consider the rational number $ > r_1$ (which is possible to choose as $\mathbb{Q}$ is dense ) and let us call it $d_1$ and we consider the open ball $(q_1-d_1,q_1 +d_1)$ which will contain $x$.
We pick $x' \in S$ , and consider $r_2>0$ such that $(x'-r_2,x'+r_2) \cap (q_1-d_1,q_1+d_1) = \phi$ , if such an $r_2$ doesn't exist then we can conclude that $x' \in (q_1-d_1,q_1+d_1)$. Repeating this process we can conclude that the open set $S $ can be written as the union of disjoint segments.
Since $\mathbb{Q}$ is countable then it can be shown that union of this disjoint segment is also countable.
I am trying to do Rudin on my own and need someone to cross check my proofs.I know this might be a duplicate but if someone goes through my proof and picks up my mistake and a probable way out that would be helpful.

A: On open set $S$ you can say that elements $x,y\in S$ are related if the closed interval (or singleton) determined by them is a subset of $S$.
(So $x\sim y$ if $x=y$ or $x<y$ and $[x,y]\subseteq S$ or $y<x$ and $[y,x]\subseteq S$)
This relation can be shown to be an equivalence relation and the equivalence classes can be shown to be open.
Now the density of $\mathbb Q$ comes in in order to prove that there are at most countable equivalence classes.

A: Well being technically correct the fact that "reapeting this process we can conclude something" doesn't prove anything unless you show that in fact we can conclude it.
The basic idea of the proof is that we can approximate every open interval in $\mathbb{R}$ using open intervals with rational ends.
Take any open set $U\subseteq\mathbb{R}$. Now take $x\in U$ - by the definition there exist an open interval s.t $x\in I\subseteq U$. For such interval $I$ we can find an interval $J$ s.t $I\subseteq J\subseteq U$ and there's no "larger" interval in $U$ containing $J$. Take a family of all such maximal intervals in $U$. Every segment contains rational so that solves the countability. Can you see that every interval in such family is disjoint?

A: We use the following facts: the connected open subsets of $\mathbb R$ are the open intervals. The union of two connected sets with a point in common is connected, so if two intervals have a point in common, then their union is an interval.
A careful proof, in steps:
$1).\ $ Every open set $U$ is a disjoint union of intervals:
Fix $x\in U$ and let $C_x$ be the union of all intervals in $U$ that contain $x.\ C_x$ is not empty because $U$ is open.
Claim: $C_x$ is an interval. It is clearly open. So now suppose $y,z\in C_x$ and $y<w<z.$ Then, $y$ and $z$ are contained in intervals $I_y$ and $I_z$, each of which is contained in $U$ and contains $x$. And since they are connected and have the point $x$ in common, their union $I:=I_y\cup I_z$ is connected and so is an interval. But now we are done because $I$ contains $y$ and $z$ and so must contain $w$. Hence, $C_x$ is an interval.
$2).\ C_x\cap C_y=\emptyset$ whenever $x\neq y.$ For, if $z\in C_x\cap C_y$ then $C_x\cup C_y$ is a union of two intervals with the point $z$ in common, and so is an interval. It follows that  $C_x\cup C_y\subseteq C_x$ and $C_x\cup C_y\subseteq C_y$ so $C_x\cup C_y\subseteq C_x\cap C_y.$ Then, $C_x\cup C_y=C_x\cap C_y.$ That is, $x=y$.
$1).\ $ and $2).\ $ show that $U=\bigsqcup_{x\in U} C_x$
$3).\ $ The union is actually countable: this follows immediately, for we may choose a rational $r_x$ in each $C_x$, and note that since the $C_x$ are disjoint, $r_x\mapsto C_x$ injects a subset of the rationals into $\{C_x\}_{x\in U}.$


text:
Q: How to improve Jaxb unmarshaller performance I want to marshal and unmarshal like below:
 I want to unmarshal xml from <keyName>value</keyName> to  HashMap
class A{
     private String name;

     private List<B> list;
    }

    class B{
     private Map <String, String> map;
    }

Xml:
<A>
  <name>name</name>
  <BList>
    <B>
      <key>value</key>
      <key>value</key>
    </B>
  </BList>
</A>

I want to unmarshal the xml to Class A. I was using  @XmlAnyElement. When I unmarshal A at with a large size XML Blist.size=100000, the performance is not ideal. What should I do to improve the performance?

A: This is an XML snippet according to your description:
<doc>
  <data>
    <someKey>someValue</someKey>
    <otherKey>otherValue</otherKey>
  </data>
</doc>

This is the class for data's type:
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MappingType", propOrder = {
    "any"
})
public class MappingType {

    @XmlAnyElement(lax = true)
    protected List<Object> any;

    public List<Object> getAny() {
        if (any == null) {
            any = new ArrayList<Object>();
        }
        return this.any;
    }
}

To unmarshal:
void unmarshal() throws Exception {
    JAXBContext jc = JAXBContext.newInstance( PACKAGE );
    Unmarshaller m = jc.createUnmarshaller();
    JAXBElement<?> obj = (JAXBElement<?>)m.unmarshal( new File( XMLIN ) );
    DocType dt = (DocType)obj.getValue();
    MappingType mt = dt.getData();
    for( Object elobj: mt.getAny() ){
        System.out.println( "object: " + elobj.getClass() );
    }
    System.out.println( "done" );
}

Output
object: class com.sun.org.apache.xerces.internal.dom.ElementNSImpl
object: class com.sun.org.apache.xerces.internal.dom.ElementNSImpl
done

Processing the DOM elements is up to you, but what else can you expect?


text:
Q: Is it possible to have a Android Studio formatted project to work on Eclipse? I have succeed to run my android project from Eclipse to Android Studio simply by generating its gradle build (without changing the project's structure).
I would like to change this project structure to the Android Studio's format, however im afraid this p**roject will not be working anymore in Eclipse**.
Have someone did this before?Did the re-structured project still working in Eclipse? (I have a bad feeling about this)
Note : If you wondering why i dont try it before asking, its because the project is fairly complicated (around 5 libraries also need to be restructured and i only know a very little about gradle) so it will be nice if i know it will be working.
Thanks everyone.


text:
Q: Java RMI and synchronized methods I'm studying the book "Distributed Systems" (by Tanenbaum & Van Steen) and they say something that seems to conflict to what seems to be instead thought by many on Java RMI and synchronized methods.
What I thought is that using a synchronized method on a Remote Object implementation (so the real implementation running at the server) concurrent execution of that method is prevented even when the calls to that method are from different clients machines (calling the method via a Proxy... aka a Stub).
I've seen that a lot of people have the same opinion, look here for example: Java RMI and Thread Synchronization questions
In the book it's instead said that concurrent execution of synchronized methods is not prevented when using RMI.
Here's the relevant excerpt from the book (you can read the bold sentence only, but you can read the context if you prefer to):

Logically, blocking in a remote object
  is simple. Suppose that client A calls
  a synchronized method of a remote
  object. To make access to remote
  objects look always exactly the same
  as to local objects, it would be
  necessary to block A in the
  client-side stub that implements the
  object's interface and to which A has
  direct access. Likewise, another
  client on a different machine would
  need to be blocked locally as well
  before its request can be sent to the
  server. The consequence is that we
  need to synchronize different clients
  at different machines. As we discussed
  in Chap. 6, distributed
  synchronization can be fairly complex.
An alternative approach would be to
  allow blocking only at the server. In
  principle, this works fine, but
  problems arise when a client crashes
  while its invocation is being handled
  by the server. As we discussed in
  Chap. 8, we may require relatively
  sophisticated protocols to handle this
  situation, and which that may
  significantly affect the overall
  performance of remote method
  invocations.
Therefore, the designers of Java RMI
  have chosen to restrict blocking on
  remote objects only to the proxies
  (Wollrath et al., 1996). This means
  that threads in the same process will
  be prevented from concurrently
  accessing the same remote object, but
  threads in different processes will
  not. Obviously, these synchronization
  semantics are tricky: at the syntactic
  level (ie, when reading source code)
  we may see a nice, clean design. Only
  when the distributed application is
  actually executed, unanticipated
  behavior may be observed that should
  have been dealt with at design time.
  [...]

I think that the paper "A Distributed Object Model for the Java System" (available here) is referenced in the text by the note Wollrath et all, 1996 between parenthesis. However the only relevant paragraph I've found on that paper is this one:

Due to the differing failure modes of local and remote
  objects, distributed wait and notification requires a
  more sophisticated protocol between the entities involved
  (so that, for example, a client crash does not
  cause a remote object to be locked forever), and as
  such, cannot be easily fitted into the local threading
  model in Java. Hence, a client can use notify and wait
  methods on a remote reference, but that client must be
  aware that such actions will not involve the actual remote
  object, only the local proxy (stub) for the remote
  object.

Am I interpreting the text in the wrong way or is in fact stated that synchronized methods are "not so synchronized" when using RMI?

A: What your first reference is saying is that within a single VM instance, invocations on an RMI Stub (client to an RMI server) will be internally synchronized. That is, the stub (or proxy, as the text seems to call it) itself will prevent multiple threads from concurrently invoking a method on the remote server. It clarifies, however, that two VMs each with stubs for a remote server will not be blocked from concurrently invoking the remote server (which is obvious, because they cannot share a lock, and RMI itself does not prevent concurrency at the server). If this is undesirable, the RMI server will have to implement a locking mechanism to prevent multiple concurrent invocations.
The second reference does not in anyway contradict the first. The second merely clarifies that if you try to synchronize on a stub, it will only be locked locally, and will not impact the concurrency of the remote server.
Combining the two texts, we can read that synchronizing on a stub will prevent the multiple threads in the same VM from concurrently accessing the remote, but will not prevent threads in distinct VMs from concurrent access.

A: As far as I know each call to an RMI server will create a new thread (witnessed by my log files from 2000) on server side. If you do synchronizing at server side you should be safe. I faced some ancient warnings from literature as you posted. As an practicioner I prefered to run the software for a month or so and decided it was stable enough for for production. I'm Sorry if this  isn't not satisfying.

A: You should also be aware that Java multi-threading has changed significantly since 1996. The notify() and wait() methods that were part of the original language design got a lot of flack from concurrency experts and in Java 5 (2004, says wiki) high level concurrency objects like the ReentrantLock were introduced which are now the preferred way of doing things.
So the criticisms you mention are probably correct, but outdated.

A: You are correct. The text is wrong. RMI stubs are thread-safe and can be invoked simultaneously by multiple threads within a single client JVM. I'm not aware of any statement or text by Wollrath et all that says anything different, and I've been following this topic since 1997.
Specifically:

What I thought is that using a synchronized method on a Remote Object implementation (so the real implementation running at the server) concurrent execution of that method is prevented even when the calls to that method are from different clients machines (calling the method via a Proxy... aka a Stub).

You are correct.

In the book it's instead said that concurrent execution of synchronized methods is not prevented when using RMI.

The book is not only wrong, it is stating an impossibility. How exactly could RMI prevent synchronization from working?

Logically, blocking in a remote object is simple. Suppose that client A calls a synchronized method of a remote object.

Then blocking occurs at the server, by the normal operation of Java.

To make access to remote objects look always exactly the same as to local objects, it would be necessary to block A in the client-side stub that implements the object's interface and to which A has direct access.

Rubbish. The fact that the remote method implementation is synchronized does everything that is necessary.

Likewise, another client on a different machine would need to be blocked locally as well before its request can be sent to the server.

Again this is rubbish.

The consequence is that we need to synchronize different clients at different machines.

Rubbish again.

An alternative approach would be to allow blocking only at the server.

'Allow'? What does this mean? A synchronized method is synchronized. You can't disallow it.

In principle, this works fine, but problems arise when a client crashes while its invocation is being handled by the server.

Again rubbish. No such problems arise. The server recovers from this situation either via a read timeout or an write exception or even successful completion of the remote method. In all three cases, the method exits, the synchronization lock is released, and life continues.

As we discussed in Chap. 8, we may require relatively sophisticated protocols to handle this situation, and which that may significantly affect the overall performance of remote method invocations.

Nonsense.

Therefore, the designers of Java RMI have chosen to restrict blocking on remote objects only to the proxies (Wollrath et al., 1996).

I am not aware what else this could refer to other than the excerpt you quoted, and I've read that paper many times. If the authors want to rely on this paper they should have provided a quotation and a proper citation to chapter and verse.
In any case the designers of RMI made no such choice. There was no such choice to make. synchronized is synchronized whatever the RMI designers may or may not have wished, and similarly notify() and wait() are final. They weren't free to make any choice. The quotation you provided isn't a 'choice': it is merely a statement about the semantics of Java.

Am I interpreting the text in the wrong way or is in fact stated that synchronized methods are "not so synchronized" when using RMI?

I think you're reading it correctly, and it's completely and utterly wrong, and not only wrong but obviously wrong. How could it possibly be right?
Java RMI doesn't, and indeed cannot, alter or remove or extend the semantics of synchronized in any way.


text:
Q: Meaning of $\int_{x_0}^{x} P(x,y) dx$ since $x$ is a variable I am following Morris-tenenbaum ordinary differential equation which has the proof for the sufficient condition for the exactness of a DE,
Given,  $\frac{\partial {f(x,y)}}{\partial {x}} = P(x,y)$,
$\frac{\partial {f(x,y)}}{\partial {y}} = Q(x,y)$
So, $f(x,y)=\int_{x_0}^{x} P(x,y) dx +R(y)$
I do not get what exactly what this integration would mean since it is integrating from a constant to a variable.

A: Assume that $P$ and $Q$ are defined all over the place. We are looking for a function $$f:\>(x,y)\mapsto f(x,y)\in{\mathbb R}$$
satisfying
$${\partial f\over\partial x}=P(x,y),\quad {\partial f\over\partial y}=Q(x,y)\qquad\forall\,(x,y)\ .$$
At this point the author makes the Ansatz
$$f(x,y):=\int_{x_0}^xP(t,y)\>dt+g(y)\ ,\tag{1}$$
with a new unknown function $g$ which depends on only one variable.
For any given $x_0$ and $y$ the integral $\int_{x_0}^xP(t,y)\>dt$ is well defined, and depends on $x$. You can think of it in the following way: The function $P$, depending on $x$ and the "parameter" $y$, is integrated  along the horizontal segment going from $(x_0,y)$ to $(x,y)$.
The question now is: Can a function $f$ of the "special form" $(1)$ solve the given problem, when $g$ is chosen suitably? This question is dealt with on the succeeding lines of your book, I hope.


text:
Q: Browser version on api 16 -18 on genymotion Is there a way to check the version of browser on android devices with API level 16-19(Android 4.1 to 4.3) when calling the webview? I can't seem to get the browser version using developer tools on chrome.I have read that dev tools are only for android 4.4 and up, but is there a workaround?
TYIM!


text:
Q: I might need some help on this Complex Fourier Series Problem Here is the problem:
Use the complex Fourier Series on $[-L,L] $ with complex coefficients to find a representation of
$\frac{1}{2L} \int_{-L}^{L} |f(x)|^{2} dx$
Here is my attempt:
The complex Fourier Series is represented as
$f(x) = \sum_{n=0}^{\infty} C_n e^{\frac{n \pi x}{L}}$
Initializing the absolute value function would imply
$|f(x)|^{2} = |\sum_{n=0}^{\infty} C_n e^{\frac{n \pi x}{L}}|^{2}$
            $ \leq |\sum_{n=0}^{\infty} C_n|^{2}*|e^{\frac{n \pi x}{L}}|^{2}$ = $|\sum_{n=0}^{\infty} C_n|^{2}$
This is by Cauchy-Schwarz. Am I on the right track about this?
I appreciate all of your help.

A: Note that
\begin{align*}
\frac{1}{2L}\int_{-L}^L \mathrm{e}^{\mathrm{i} \frac{n \pi x}{L}} \mathrm{e}^{\mathrm{i} \frac{-m \pi x}{L}} \mathrm{d} x = \delta_{n,m}
\end{align*}
I.e. the basis functions $\mathrm{e}^{\mathrm{i} \frac{n \pi x}{L}}$ are orthogonal.
So note that for $N$ finite, we have
\begin{align*}
& \left \| \sum_{n = 0}^N C_n \mathrm{e}^{\mathrm{i} \frac{n \pi x}{L}} \right \| \\
& = \sum_{n = 0}^N \vert C_n \vert^2
\end{align*}
 With the inner product defined above, we have
\begin{align*}
& \frac{1}{2L} \int_{-L}^L \left \vert \sum_{n = 0} ^\infty C_n \mathrm{e}^{\mathrm{i} \frac{n \pi x}{L}} \right \vert^2 \mathrm{d} x \\
& =  \frac{1}{2L} \int_{-L}^L \left \vert \lim_{N \rightarrow \infty}  \sum_{n = 0} ^N C_n \mathrm{e}^{\mathrm{i} \frac{n \pi x}{L}} \right \vert^2 \mathrm{d} x \\
& =\left \| \lim_{N \rightarrow \infty}  \sum_{n = 0} ^N C_n \mathrm{e}^{\mathrm{i} \frac{n \pi x}{L}} \right \| \\
& = \lim_{N \rightarrow \infty} \left \|  \sum_{n = 0} ^N C_n \mathrm{e}^{\mathrm{i} \frac{n \pi x}{L}} \right \| \\
& = \sum_{n = 0}^\infty \vert C_n \vert^2
\end{align*}
You may move the limit in front of the norm because norms are continuous.


text:
Q: Fragments view reference gets destroyed - viewpager, trying to change content dynamically I have a viewpager attached to a tabbed layout and its on page changed listener looks like this
 private void setPageChangeListener(FragmentStatePagerAdapter pagerAdapter) {
    mViewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener () {
        @Override
        public void onPageSelected(int position) {

            FragmentLifecycleHelper fragment = (FragmentLifecycleHelper) pagerAdapter.getItem(position);
            if (fragment != null) {
                fragment.onResumeFragment();
            }
        }
    });
}

Now in my child fragments i create the views like this
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mFragmentView = inflater.inflate(R.layout.drawer_account, container, false);
    Log.d(TAG, "OnCreateView()");
    printLog();
    return mFragmentView;
}

which saves a reference to the view (i assume getView() does the same).
Whatsoever, now the called interface method is supposed to change the icon and the fab onClick listener of the hosting activity, the problem is whenever onResume is called the view reference is null.
This is my onResumeFragment()
  /********************* INTERFACE METHODS ******************************/
@Override
public void onResumeFragment() {
    Log.d(TAG,"onResumeFragment()");
    printLog();
    if(mFragmentView != null){
        ((MainActivity) getActivity()).setFabIcon(MainActivity.FAB_ICON.PLUS);

        ((MainActivity) getActivity()).setFabClickListener(v -> {
            // TODO
        });
    }

}

printLog() just prints the current status of the view reference.
Whenever i log this onCreateView of Fragment 1 gets called when i am in fragment 0 or 3 (so neighbour fragments) onResume then gets called when i actually switch to the correct view. But then getView() and my own reference both return null and i get a NPE if i try to access the hosting activity


text:
Q: Switching circuit for changing HIGH- / LOW-level-trigger On my smart home controlling PCB I want to add some relays. As I want to be flexible with signaling I want to add a jumper to be able to switch between HIGH and LOW level triggering the relay (3V3 from a RPi).
Since I have no idea how to change the trigger level with only one jumper as it is e.g. on the following module (see jumper on the bottom right side) I'd appreciate any help on how to planing this circuit.

A: The relay module in the image has an EL354 optocoupler which has two anti-parallel LEDs instead of one. Hence, the optocoupler can be used with any polarity between pin 1 and 2. This leads me to believe that the circuit works in a similar way like this.

If the jumper J1 is connected to Vcc, the circuit will become active-low. If it is connected to GND, the circuit will become active-high. This circuit just explains the basic working of how the trigger level is changed and you may have to refine it for it to work practically.

A: This would also work.

When the jumper is bridging pin 2 and 3, the NPN transistor is controlled directly by passing 3.3V as signal.
When the jumper is bridging pin 2 and 1, the NPN transistor is controlled through the PNP transistor by passing 0V as signal.


text:
Q: How to keep two directories on two unconnected machines in sync via emailing of delta-archives My situation is that I have two directories on two different computers (one Windows machine, OSX machine) and I need to keep the two directories on the two machines in sync (= mirrored), so that they contain the same files and subdirectories. The files in the directories are text files, images and the occasional binary file.
My Problem is that the two machines are not connected via LAN/WAN. The only way to move data between them is via email.
So I'm looking for a way to sync the directories by emailing back and forth small delta-archives which I than can extract on each machine. How can I do this with a tool like rsync or unsion? I figure, the system needs to maintain a tracking file which contains a list of all files with timestamps from the other machine effectively remembering that machine's "last seen" state.

A: This can be done using Mercurial with PatchBomb and Mbox extesions.
The entry point for getting knowledge is here: http://mercurial.selenic.com/wiki/CommunicatingChanges


text:
Q: R Markdown / Quarto - Avoid loading package every time I knit a document Simple question but can't find a solution.
I have a quarto document (but this apply to Markdown as well) in which I use R to execute some code. Obviously, in the first chunk of the document, I load the packages needed (let's say for example):
```{r setup}
library(tidyverse)
library(survival)
library(survminer)
```

Now, everytime I knit the file to render the document, these packages are loaded, which can be pretty time consuming especially if you have a long list of packages to import. using cache=TRUE doesn't seem to work properly. Is there anyway to avoid loading the package everytime I knit the document, and only load them when they are not loaded in the environment/in the first knit call of the session at least?

A: The usual way to run Quarto or RMarkdown is in a clean session, not in the current session.  So you normally only have a minimal set of packages already loaded.
If you run rmarkdown::render( ... ) in a session, that doesn't happen, and things will run in the current session.  That will speed up library() calls a lot, because they do nothing if the package has already been attached to the search list.
I don't know if something similar is available for Quarto, but in any case, it's a risky strategy:  what you hope for from an RMarkdown or Quarto document is something that is reproducible. If you run in the current session, you run the risk of getting results that depend on variables in the current session.
I'd advise you to identify which packages are slow to load, and try to follow @Arthur's suggestion from a comment:  precompute the objects that those packages produce, and just load them in the document.  Then you may not need the package at all.


text:
Q: Google Analytics double listing with and without slash I've an issue with url with/without slash:
https://www.example.com/mypage/
https://www.example.com/mypage
In GA, they're counted as 2 different pages, how can I fixed it with filters ?
Thanks for your help !

A: In general, you should avoid having your website show exactly the same content with two different URLs. It seems from your question that both /mypage and /mypage/ are the same page. You should have your webserver redirect from one to the other (choose which one) and then your Analytics code will be correct.
It is possible to create a filter in Google Analytics if you can't change it on your server. I am not sure there is one really good way to write the filter, so I would direct you to what appears to be a decent existing writeup: http://www.lunametrics.com/blog/2010/12/17/cleaning-urls-google-analytics/

A: You can also add Default page in View Settings. GA will then merge rows and show as one row. You may want to read here https://support.google.com/analytics/answer/1009675
screenshot of view settings


text:
Q: Responsive horizontal page sliding I want to create horizontal responsive page navigation as illustrated by the below image :

This is what I have managed to do : DEMO

$(document).ready(function () {
    var slideNum = $('.page').length,
        wrapperWidth = 100 * slideNum,
        slideWidth = 100/slideNum;
    $('.wrapper').width(wrapperWidth + '%');
    $('.page').width(slideWidth + '%');

    $('a.scrollitem').click(function(){
        $('a.scrollitem').removeClass('selected');
        $(this).addClass('selected');

        var slideNumber = $($(this).attr('href')).index('.page'),
            margin = slideNumber * -100 + '%';

        $('.wrapper').animate({marginLeft: margin},1000);
        return false;
    });
});
html, body {
    height: 100%;
    margin: 0;
    overflow-x:hidden;
    position:relative;
}
nav{
    position:absolute;
    top:0; left:0;
    height:30px;
}
.wrapper {
    height: 100%;
    background: #263729;
}
.page {
    float:left;
    background: #992213;
    min-height: 100%;
    padding-top: 30px;
}
#page-1 {
    background: #0C717A;
}
#page-2 {
    background: #009900;
}
#page-3 {
    background: #0000FF;
}
a {
    color:#FFF;
}
a.selected{
    color: red;
}

.simulate{
    height:2000px;
}

        page 1
         page 2
         page 3

page 1

Simulated content heigher than 100%

page 2

Simulated content heigher than 100%

page 3

Simulated content heigher than 100%

I have however hit a few brick walls, as mine is responsive to a certain degree, its just as you scale it needs to stick to the page its on and not reveal the others.
Also if the pages are long it shows a scroll bar which is perfect, but on the last slide there is a gap as wide as the scroll-bar.
I have the following Requirements:

*

*Needs to be Responsive

*pages need to be able to be long (800px) and still scrollable, without the gap on the last one.

*needs to work on minimum ie9

A: Horizontal page sliding
with left-margin animation
This jQuery snippet :

*

*Calculates the number of slides and set the width of the wrapper accordingly.

*According to which link is clicked, left-margin is animated on the wrapper to show the corresponding slide with a smooth transition

*Toggles the class of the clicked link for active link highlighting

Note that this solution:

*

*Uses only one menu occurence to minimize markup and prevent content repetition.

*Requires only the jQuery library

*works for a dynamic number of slides

$(document).ready(function() {
  var slideNum = $('.page').length,
    wrapperWidth = 100 * slideNum,
    slideWidth = 100 / slideNum;
  $('.wrapper').width(wrapperWidth + '%');
  $('.page').width(slideWidth + '%');

  $('a.scrollitem').click(function() {
    $('a.scrollitem').removeClass('selected');
    $(this).addClass('selected');

    var slideNumber = $($(this).attr('href')).index('.page'),
      margin = slideNumber * -100 + '%';

    $('.wrapper').animate({
      marginLeft: margin
    }, 1000);
    return false;
  });
});
html,
body {
  height: 100%;
  margin: 0;
  overflow-x: hidden;
  position: relative;
}

nav {
  position: absolute;
  top: 0;
  left: 0;
  height: 30px;
}

.wrapper {
  height: 100%;
  background: #263729;
}

.page {
  float: left;
  background: #992213;
  min-height: 100%;
  padding-top: 30px;
}

#page-1 {
  background: #0C717A;
}

#page-2 {
  background: #009900;
}

#page-3 {
  background: #0000FF;
}

a {
  color: #FFF;
}

a.selected {
  color: red;
}

.simulate {
  height: 2000px;
}

    page 1
    page 2
    page 3

page 1

Simulated content heigher than 100%

page 2

Simulated content heigher than 100%

page 3

Simulated content heigher than 100%

A: "as you scale it needs to stick to the page its on and not reveal the others"
To achieve this, keep a reference to the current page element and then do a no-delay scrollTo this element when the window is resized:
var currentPage; //here is where we will hold the reference
jQuery('a.scrollitem').click(function () {
    var targetPage = $(jQuery(this).attr('href'));
    jQuery('a.scrollitem').removeClass('selected');
    jQuery(this).addClass('selected');
    jQuery('.toggle').css({'display':'none'});
    jQuery('.wrapper').scrollTo(targetPage, 1200, function(){
        jQuery('.toggle').css({'display':'block'});
    });
    currentPage = targetPage; //here is where we set the reference
    return false;
});

//and here we do a no-delay scrollTo
$(window).resize(function(){
    if(!!currentPage){
        console.log('window resized.  scrolling to: ', currentPage.attr('id'));
        jQuery('.wrapper').scrollTo(currentPage);
    }
});

This makes it pretty responsive, in my opinion.
pages need to be able to be long (800px) and still scrollable, without the gap on the last one.
To get rid of that gap, I just make all pages a little longer than they need to be.  The scrolling is not affected by this since the pages are left-justified with left:0;.  I suspect that the other pages had the same gap and and that the gaps on those pages were covered by the scroll bar.
.page {
    width: 110%;
}

needs to work on minimum ie9
I'm afraid I can't help in this regard; I have only IE11 installed.  But hey, it works great in IE11.
Working fiddle


text:
Q: Does ArcGIS Server include Tracking Server? I want to create a vehicle tracking application. I have ArcGIS Desktop and ArcGIS Server. Can I create application for real time with these two software? I saw in ESRI site another server called Tracking Server. Does ArcGIS Server include Tracking Server or the Tracking Server is another product?

A: In the Tracking Server marketing material it says:

Tracking Server is an independent server product that is not
  integrated with ArcGIS for Server.

A: You can use arcgis serer with the tracking extension though. It is an option when you register it.


text:
Q: Get coordinates of start and end of a view Android Im trying to get the start and end coordY of a view in Android to create a animation.
I tried with the event OnTouch but I just can access to the initial coordY.
I tried to with MotionEvent but it didnt work.
public boolean onTouch(View v, MotionEvent event)
        {
            float x = event.getX();
            float y = event.getY();
            //Log.d("S&R", "Y "+y);
            switch (event.getAction() & MotionEvent.ACTION_MASK)
            {
                case MotionEvent.ACTION_DOWN:
                    Log.d("S&R", "ACTION_DOWN");
                    break;
                case MotionEvent.ACTION_UP:
                    Log.d("S&R", "ACTION_UP");
                    break;
                case MotionEvent.ACTION_MOVE:
                    Log.d("S&R", "ACTION_MOVE");
                    break;
            }
            return false;
        }

I only want to know if if the touch was up-to-down or down-to-up.
How could I do it?
Thank you.

A: I got it!
public boolean onTouch(View v, MotionEvent event) {

            boolean isReleased = event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL;
            boolean isPressed = event.getAction() == MotionEvent.ACTION_DOWN;
            boolean isMoved = event.getAction() == MotionEvent.ACTION_MOVE;

            if(isPressed){
                Log.d("S&R","isPressed");
                lastY=event.getY();
                return true;
            }

            else if(isReleased){
                Log.d("S&R","isReleased");
                lastY=event.getY();
                return true;
            }

            else if(isMoved)
            {
               //Log.d("S&R","MOVE");
               Log.d("S&R","lastY=> "+lastY+" currentY=> "+event.getY());

               if(event.getY()<lastY)
               {
                   Log.d("S&R","up");

               }
                else if(event.getY()>lastY)
               {
                   Log.d("S&R","down");

               }
                lastY=event.getY();
                return true;
            }
            return false;
        }

Thanks for all guys.


text:
Q: How to define a link path I'm trying to figure out how to make an app with Rails 4. I keep getting stuck on basic things and I don't seem to be able to identify principles to use going forward.
I have a profile model and a industry model. The associations are:
Profile:
has_and_belongs_to_many :industries, join_table: 'industries_profiles'

Industry:
has_and_belongs_to_many :profiles, join_table: 'industries_profiles'

In my profile show page, I'm now trying to link to the industry page:
<% @profile.industries.limit(5).each do |industry| %>

    <%= link_to industry.sector.upcase, industry_path(@industry) %>

<% end %>

I can't find anything that works for this link.
I have tried the following:
industry_path(@profile.industry)
industry_path(@profile.industry_id)
industry_path(industry)
industry_path(profile.industry)
industry_path(industry.id)
industry_path(industry_id)

But all of them are guesses. I don't know how to ready the API dock so I can't understand any of its content.
Can anyone see how to link to a show page of the other side of the HABTM association for a single record?

A: You can grab a list of your routes by running rake routes | grep industry in your command line, which will give you a table with the prefix, action, and uri pattern. For example:
   industries GET    /industries(.:format)           industries#index
              POST   /industries(.:format)           industries#create
 new_industry GET    /industries/new(.:format)       industries#new
edit_industry GET    /industries/:id/edit(.:format)  industries#edit
     industry GET    /industries/:id(.:format)       industries#show
              PATCH  /industries/:id(.:format)       industries#update
              PUT    /industries/:id(.:format)       industries#update
              DELETE /industries/:id(.:format)       industries#destroy

In your case, you should look at the show path. Which is industry and you append _path to the end of whatever your prefix is above, which comes out to be industry_path. And since you have declared your variable industry when defining your loop, you can use that instead of the instance variable.
Short answer: industry_path(industry)


text:
Q: IF/ELSE Performance in Stored Procedures I found this article that explains using IF/ELSE statements in a SP can cause performance deterioration over using separate SPs for each 'branch'. http://sqlmag.com/t-sql/if-statements-and-stored-procedure-performance
But I have an SP which selects the same columns, from the same tables, and only the WHERE clause changes depending on what variables are present. Here is an example:
IF @Variable1 IS NOT NULL
 BEGIN
   SELECT
        *
   FROM
     dbo.Table1
   WHERE
     Column1 = @Variable1
  END
ELSE IF @Variable1 IS NULL AND @Variable2 IS NOT NULL
 BEGIN
  SELECT
   *
  FROM
   dbo.Table1
  WHERE
   Column1 = Column1
   AND
   Column2 = @Variable2
 END

So in this example, is it better to have 2 seperate SPs to handle the different variables or is it ok to have it all in one like this?
(I know using SELECT * is not good practice. I just did it for the sake of example)

A: Normally, I wouldn't worry about this, although you should look at the white paper referenced by Mikael Eriksson which has a copious amount of useful information on this subject.  However, I would remove the Column1 = Column1 statement in the else branch, because that could potentially confuse the optimizer.
What the article is referring to is the fact that the stored procedure is compiled the first time it is run.  This can have perverse results.  For instance, if the table is empty when you first call it, then the optimizer might prefer a full table scan to an index lookup, and that would be bad as the table gets larger.
The issue may be that one of the branches gets a suboptimal performance plan, because the data is not typical on the first call.  This is especially true if one of the values is NULL.  This doesn't only occur with if, but that is one case where you need to be sensitive to the issue.
I would recommend the following:

*

*If your tables are growing/shrinking over time, periodically recompile your stored procedures.

*If your tables are representative of the data, don't worry about splitting into multiple stored procedures.

*Your examples should do an index lookup, which is pretty simple.  But monitor performance and check execution plans to be sure they are what you want.

*You can use hints if you want to force index usage.  (Personally, I have needed hints to force particular join algorithms, but not index usage, but I'm sure someone else has had different experiences.)

For your examples, an index on table1(column1) and table1(column2) should suffice.
The summary of the advice is not to fix this until you see there is a problem.  Putting the logic into two stored procedures should be for fixing a problem that you actually see, rather than pre-empting problem that may never exist.  If you do go with a two-procedure approach, you can still have a single interface that calls each of them, so you still have the same API.  In other words, the one procedure should become three rather than two.


text:
Q: Как реализовать «плавную» смену блоков? Здравствуйте!
Подскажите, пожалуйста, как реализовать следующую вещь: есть страничка, на страничке контент и внутри него ссылка. При клике на ссылку, контент «уезжает» влево за экран, а на его место справа из-за экрана «въезжает» блок с новым контентом.
Спасибо за помощь!
A: В jquery есть такая функция animate() которая позволяет все делать плавно


text:
Q: How to functionally compose Scala's Either If I have one or more Either values how can I compose them in a functional way so that I can log an error if there is a left value but continue in the function if there is a right value. For example
def composeEither(ethr: Either[Error, String]): Either[Error, String] = {
     ethr match { case Left(err) => log.error(err.getMessage) }

     //this obviously will not work but something like map that is right biased
     ethr map { e => e } //Just for the sake of example - there might be a different either calculated within the map
}

Let me know if there is anything else I can add to make my question more clear.

A: Something like this, maybe:
  ether
   .right
   .flatMap(anotherEither(_).right)
   .flatMap(yetAnother(_).right)
   .left
   .map { err => logError(_.getMessage); err }


text:
Q: Include close vote sort by creation date In the 10k tools, we only get a limited number of returned results, with little control over which posts are returned.
Given that Age close votes after 14 days, regardless of views, allowing recasting, it would be nice if the 10k tools allowed users to hone in specifically on the questions that are at risk of having the close votes age away.
I am trying to avoid the problem of "close votes age away not because people want to leave the questions open, but because the questions simply haven't yet been looked at".
Currently, the 10k tools have lots of ways for us to see the questions that have recently been close voted, but because of vote ageing, what we really want to see are questions that have been close voted as long ago as possible, to make sure a decision gets pro-actively made, not left open by default.
Essentially, I want to give more visibility on questions that fit under the the following SEDE criteria, without having to wait for Sunday for the returned questions to reset.
I considered posting this on MSO, as it's not really a problem for smaller sites, but I figured that if it happened it would probably be a network wide change, and it might matter on the largest non-Stack Overflow sites.
Response to @Oded: The CV queue does not take care of this case because the secret sauce that decides which questions pop up in review often tends towards newer questions, not older ones. Additionally, at least on Stack Overflow, the number of questions up for review is dwarfed by the number of reviews that occur. On a high-review day, we are lucky to get 4000 reviews, which has mostly been happening recently because we are in the middle of an enormous burnination effort. If not in this effort, we would be lucky to get 2000 reviews in one day, which is only a quarter of the number of tasks under review. However, we still typically have somewhere between 7000 and 10000 questions that need to be reviewed, so, on average, half of those questions get one reviewer per day - which won't close a post, because you need 5 reviewers. This is why the SO Close Vote Reviewers chatroom colludes to make sure everyone is working on the same tags, using a SEDE query to choose which tags to work on. The proof is in the pudding - the active reviewers wouldn't take such steps if it weren't necessary to actually get questions closed.


text:
Q: Rotation of Oculus Touch Controller in A-Frame / Three.js Does anyone know how to find the current rotation of an Oculus Touch Controller? - in A-Frame, or more likely combination of A-Frame and Three.js.
I want the current rotation to use it to control other objects.
Thanks!

A: Getting the controller position and rotation is the same as any other entity via DOM:
 el.getAttribute('rotation');

or THREE.js:
 el.object3D.rotation

Example logging rotation in console


text:
Q: How can i generate Salesforce case Id's? decode/encode base62 base64 I need to be able to generate salesforce object (cases) Id's, so i can create links for my robot assistant :-).
I believe you can use the API , but this option is out of reach for me :-(
So, Reading about salesforce objects, it seems to be
of the format.
3 Digits (Object) / 12 Digits (Record) / (Optional) 3 Digits (Error Correction)
our cases number range from 1500 upwards,
here some examples.
1716=50060000003FS87
1717 = 50060000003FSJt
1718 = 50060000003FTFD
1800=50060000003Fkcw
2000-50060000003GIRK
so, for case 2000
500               60000003GIRK
(object type)     (case number)
I've tried decoding/encoding both an integer '2000' and the string '2000' with base64 and base62 , and nothing comes up.
It this some kind of hash? are these ID's not directly related to the case number? i.e are the generated.
Is it some kind of one way hash?
I just want to say, I'd like the ID, for say case 10000, and to generate the correct ID to take me there! :-)
Any ideas would be a great help.

A: As per @superfell's comment, Id's in Salesforce are generated from an internal sequence number. While you could guess at what the next ID will be, your could never be certain that some other process is also creating records at the same time.
Also, you have no way of getting Salesforce to accept Ids that you generate externally. I.e. only Salesforce can assign a new record Id.
The APIs are the standard way of creating new records in an integration.
The post What are Salesforce ID's composed of? might be useful.
If you have an external system for generating Ids you could use them as the external Id in a custom field. If opens up options for referencing that record without knowing the Salesforce assigned Id.


text:
Q: WFS & Feature Access -> Database connection / Database support (ArcGIS 10.2) Over the last two days I've tried to set up and to use a postgreSQL database to use WFS and Feature Access.
I've also started a thread in the esri forums, but I hope that I can reach a wider audience here.
Some basic information, what I've done

*

*ArcGIS 10.2 installed on Windows Server 2012

*PostgreSQL 9.2.2 64Bit is installed on the same server as well as PostGIS 2.0

*I've edited the pg_hba.conf to have remote access.

*I've copied the necessary 32Bit client files (libeay32.dll, libiconv-2.dll, libintl-8.dll, libpq.dll, ssleay32.dll) (which I've downloaded from the Customer Portal-> Package: PostgreSQL_Client_Libraries_for_Windows_101_130031.exe) into the \bin-Directory of my ArcGIS Desktop 10.2 installation.

*I've copied the necessary 64Bit client files (libeay32.dll, libintl.dll, libpq.dll, ssleay32.dll) (which I've downloaded from the Customer Portal-> Package: PostgreSQL_Client_Libraries_for_Windows_101_130031.exe) into the \bin-Directory of my ArcGIS Server 10.2 installation. I'm even not sure, if I need this....

*I've copied the necessary st_geometry file (stored in the Installation folder of your ArcGIS installation (D:\Programs\ArcGIS 10.2\Desktop10.2\DatabaseSupport) into the \lib-Directory of my PostgreSQL 9.2.2
installation.

*I've registered the database and the folder via the ArcGIS Server manager in the data store tab. I'm not sure if this right or necessary!?

*The connection via pgAdmin works. I can connect to the database using pgAdmin. Here I have three tables: http://imgur.com/pkY0LmV

*The connection via "ArcCatalog-> Add Database Connection" is finally working. I can connect to the database. As a database I can only select "postgis20" as a database?! Any idea, why it's like that?! http://imgur.com/rQYpjbc I think that it has to be postgres, hasn't it?

From now on I don't know how, what are the next steps.
Can anybody confirm that the above mentioned steps are right?
And it would be awesome if someone of you could give me some tips, how I have to work on or what are the next steps. Do I have to "Enable Geodatabase"? Do I have to create an Enterprise Geodatabase with the ArcToolbox Tool? I've spent too many hours without having success :(
My goal: Enabling WFS and Feature Access.
Thanks a lot
Edit Started from scratch regarding database. See each second comment of this post and answer. Btw:...first time for me using stackexchange.com.

A: It sounds like your next step is to simply create a service with the desired capabilities enabled.
Open arcmap, add the data you want.
Symbolize and make it look like you want.
  You might take a look at these web seminars and the esri video channel
when you publish your service you make sure to check the capabilities section and enable the desired output.
After selecting the desired capabilities go to each section and configure the options.

Then you will need to consume those services in your application/viewer of choice.
As per your follow on question about postgres (should probably be by itself).
Look in the \install dir\postgres\ver#\data\ folder for the pg_hba.conf
Edit the host section with your machine and connection type. There is some help in that file and more online.


text:
Q: How to get file preview pane in Ubuntu 12.04 and nautilus It seems like the default file manager in Ubuntu 12.04 is nautilus, that does not have a file preview option! This is a really important requirement for me and I am missing the good old file preview pane in Windows 7 or Mac OS X.
There are a few options in Ubuntu for instance; gloobus-preview but then it is activated when we press the space-bar and the preview occupies the center of the screen, so it almost blocks the view. Now, is there any way I can install an add-on, maybe to the nautilus manager in Ubuntu 12.04 and get this side-pane for previewing files.

*

*What are the other options available otherwise?


text:
Q: Javascript create 2 arrays from object data I have some data and I need a loop which creates 2 arrays...
So I first create the 2 arrays:
namelist = [];
countList = [];

{
    "id": "622",
    "name": "main",
    "sub": {
        "637": {
            "id": "637",
            "name": "name 1",
            "stats": {
                "count": 5
            }
        },
        "638": {
            "id": "638",
            "name": "name 2",
            "stats": {
                "count": 10
            }
        }
    }
}

The desired result for this example would be:
For namelist:
['name 1', 'name 2']

For countList:
[5, 10]

How can I do this?

A: for(var key in obj.sub){
    nameList.push(obj.sub[key].name);
    countList.push(obj.sub[key].stats.count;
}

A: var nameList = [];
var countList = [];

var myObj =
{
    "id": "622",
    "name": "main",
    "sub": {
        "637": {
            "id": "637",
            "name": "name 1",
            "stats": {
                "count": 5
            }
        },
        "638": {
            "id": "638",
            "name": "name 2",
            "stats": {
                "count": 10
            }
        }
    }
};

for(var key in myObj.sub){
    nameList.push(myObj.sub[key].name);
    countList.push(myObj.sub[key].stats.count);
}

console.log(nameList);
console.log(countList);

A: Object.keys may help you to walk through object properties. Example related to your object:
var namelist = [],
  countList = [],
  obj = {
    "id": "622",
    "name": "main",
    "sub": {
      "637": {
        "id": "637",
        "name": "name 1",
        "stats": {
          "count": 5
        }
      },
      "638": {
        "id": "638",
        "name": "name 2",
        "stats": {
          "count": 10
        }
      }
    }
  };

Object.keys(obj.sub).forEach(function(item) {
    namelist.push(obj.sub[item].name);
    countList.push(obj.sub[item].stats.count);
});

console.log(namelist, countList);

Working example: https://jsfiddle.net/ry0zqweL/
Obviously, you can optimise it in many ways. It's just illustrating one of the many solutions.


text:
Q: Message queue for IPC with fork and want to know whether the processes 'share' the message buffer or just copy and 'show' to the other process I am student and was programming with fork() in C for multi-process matrix multiplication.
but while I was doing this, I had question about
when we use IPC with MESSAGE QUEUE, then,
If I put
struct message_buffer{
long mtype;
int result[100][100];
}

like this,
 I know this is not efficient because the space is copied all the time as message but...
I thought that is the only way all processes can share result table....(is there another way?)
anyway If I put the result array table like that,
then in where memory place the result table is created??...
they create the place in kernel place and REALLY 'share' that place but with the abstraction as message?
or
the message buffer are created in one main process and not share, but just copy and show to the other process.
pleaseeeeee give me a tip :'( really want to know....
and if they don`t share the message buffer, then how can I make the processes 'share' the common place?
thank you......


text:
Q: Update function on click I want to call a function which I call currently with each page-load ALSO with a click of the element #call-button. This is my current function:
window.addEventListener("load", function() {}

I hope a wrong solution clarifies a bit what I mean. So I am asking how to do that one here correctly:
window.addEventListener("load" || "#call-button.click" , function() {}

A: One way of doing it is bind the function to click of the element. And on window load trigger the element's click

document.getElementById('call-button').addEventListener('click', function() {
  alert('Called!!!');
});

function onLoad(){
  document.getElementById('call-button').click();
}
<body onload="onLoad()">
<button id="call-button">Click Me</button>
</body>

A: This function isn't defined, it is bounded to the event.
You can either do a click listener on your element and copy the function part, or you can create the function and both your listeners will call the function.


text:
Q: Boosting 3.0 - 4.6 Volts to 5V I found this circuit that will auto switch between power between USB (5V) or a LiPo Battery (3.0V - 4.2V range).

The schottky diode, D4, can have a voltage drop of about 0.4V which is too high for me. I need the voltage to be 5V with 0.2V tolerance at the maximum. I'm thinking of using an IC similar to U2 in the schematic. But rather than a 3.3V output step-down IC, I'll need a 5V boost output one and at least a 600mA output.
Is there an IC that can do that even with a 4.6V input?


text:
Q: Codeigniter : on selection of a value from drop down change value of checkbox I have 3 tables say:-
invoice_details, customer_details and bill_address.
The invoice form has a dropdown and a checkbox. Customer names are listed in the dropdown from the customer table. And when I select a customer name the checkbox values must have the corresponding billId.
so when I mark the checkbox, the value of checkbox must be the billId of that customer name that has been selected. I hope my question is clear.
view page:-

 Customer *
 <select class="form-control" name="customerId" id="customerId">
   <option value="0">Choose....</option>
     <?php
      if ($customer) {

       foreach ($customer as $row) {

        echo "<option value='".$row->customerId."'>".$row->customer_name."</option>";
      }

     } ?>

     </select>

  <input type="checkbox" name="checkbox" value="bill">
  Bill To

How could I do this? please help me...
customerId is common in all 3 tables.
Table details:-
bill_address(billId, customerId, street, city, state, country).
customer_details(customerId, customer_name, phone, email,..).
invoice_details(invoiceId, customerId, billId, date, status,..).

A: view page of Invoice Form:-

 Customer Name*
 <select class="form-control" name="customerId" id="customerId">
   <option value="0">Choose Customer Name</option>
     <?php
      if ($customer) {

       foreach ($customer as $row) {

        echo "<option value='".$row->customerId."'>".$row->customer_name."</option>";
         }
       }
      ?>

     </select>

Jquery Ajax Code:- Add this code in Invoice Form view Page before closing  Tag.

Contoller Code:-
public function get_data_in_bill_checkbox(){

    $customerId = $this->input->post("customerId");

    $BillTableDta = $this->db->get_where('bill_address',array('customerId'=>$customerId))->row_array();

           $billData = "Bill To";
              foreach($BillTableDta as $bill)
              {
                $billData.='<input type="checkbox" name="billcheckbox" value="'.$bill.'">';
              }
               echo $billData;
           }

Note:- For more Reference see this https://api.jquery.com/change/

A: You can use the following let me know if it worked using the triangle.:-)

    <form action="" method="POST">
        Customer *
        <select class="form-control" name="customerId" onchange="this.form.submit()" id="customerId">
        <option value="0">Choose....</option>
        <?php
            if ($customer) {

            foreach ($customer as $row) {

            echo "<option value='".$row->customerId.'/'.$row->customer_name."'>".$row->customer_name."</option>";
            }

            }
        ?>
        </select>
    <?php
        if(isset($_POST['customerID'])){
        $true=checked;
        $data=explode("/",$_POST['customerID']);
        $id=$data[0];
        $name=$data[1];
        }
        else {
        $true="";
        }
    ?>

        <input type="checkbox" <?php if(isset($true){ echo $true; } ?> name="checkbox" value="<?php if(isset($id){ echo $id; } ?>">
        <?php if(isset($name) { echo $name; } ?>

</form>


text:
Q: PHP - generating JSON output     $showcaseObject = new stdClass();
    $generalObject = new stdClass();
    $generalObject->roundCorner = 0;
    $generalObject->borderStroke = 2;
    $generalObject->backgroundColor = '#fff';

    $showcaseObject->general = $generalObject;

    echo json_encode($showcaseObject);
and i get something like this
{"general":{
 "roundCorner":"0",
 "borderStroke":"2",
 "backgroundColor":"#ffffff"
 }
}

Now i want to get something like this
{"general":{
 "round-corner":"0",
 "border-stroke":"2",
 "background-color":"#ffffff"
 }
}

i try to change above code like under code, and get syntax error, unexpected '='
 $generalObject->round-corner = $row->general_round_corner_radius;
 $generalObject->border-stroke = $row->general_border_stroke;
 $generalObject->background-color = $row->background_color;

Help me !

A: You could use the brace syntax when defining the object members:
$showcaseObject = new stdClass();
$generalObject = new stdClass();
$generalObject->{'round-corner'} = 0;
$generalObject->{'border-stroke'} = 2;
$generalObject->{'background-color'} = '#fff';

$showcaseObject->general = $generalObject;

echo json_encode($showcaseObject);

This brace syntax allows you to use expressions rather than just identifiers.

A: To convert first form to second, traverse over each key and convert the keyname.
foreach ($generalObject as $keyName => $keyValue) {
    $newKey = strtolower(preg_replace('/([^A-Z])([A-Z])/', "$1_$2", $keyName));
    $generalObject[$newKey] = $keyValue;
    unset($generalObject[$keyName]);
}
To access them (this is what you're having a problem with), use bracket notation:
$generalObject['hyphenated-name']

A: I think the easiest way may be to simply do some string replacement on the JSON strings that you have, to get the hyphen characters in where they couldn't be automatically inserted due to php's allow variable charset:
$showcaseObject = new stdClass();
$generalObject = new stdClass();
$generalObject->roundCorner = 0;
$generalObject->borderStroke = 2;
$generalObject->backgroundColor = '#fff';

$showcaseObject->general = $generalObject;

$jsonStr = json_encode($showcaseObject);
$jsonStr = str_replace('"roundCorner":', '"round-corner":', $jsonStr);
$jsonStr = str_replace('"borderStroke":', '"border-stroke":', $jsonStr);
$jsonStr = str_replace('"backgroundColor":', '"background-color":', $jsonStr);

echo $jsonStr;


text:
Q: How can I skip HBase rows that are missing specific column family? For example, a HBase table has columnFamilyA, columnFamilyB and columnFamilyC, for some rows, columnFamilyA does not have any column in it. I would like to scan the table and return only the rows that have at least one column in columnFamilyA.
What kind of filter should I use?  I checked SingleColumnValueFilter, but it seems to only work with specific column other than columnFamily. I need all rows where columnFamiliyA contains at least one column. Not just data in columnFamiliyA, but the entire row.

A: If you need only data from columnFamiliyA you can use addFamily method on Get or Scan objects.

A: Or you can do scan of scan. First do scan for columFamilyA cols. Then get the rows of first scan.


text:
Q: Extracting Structure data to assign them in matrix with variable size I have a stucture of contourdata of an image in MATLAB. Is is as follows:
s =
1x59 struct array with fields:
    level
    numel
    xdata
    ydata
 %s(k).level contains the contour level height of the k-th line.
% s(k).numel contains the number of points describing the k-th line.
% sk).isopen is True if the k-th contour is open and False if it is closed.
% s(k).xdata contains the x-axis data for the k-th line as a column vector.
% s(k).ydata contains the y-axis data for the k-th line as a column vector

I must to extract s(k).xdata and s(k).ydata into matrix with variable size. This is the program i have made
for k=1:59;
    if (k==1);
        i(k)=s(k).numel;
        [i,2]=size(S{k}(:,:));
        x=s(k).xdata;
        y=s(k).ydata;
        S{k}(:,:)=[x y];
    elseif (k>1 && k<=59)
        i(k)=s(k).numel;
        l=i(k-1)+i(k)
        [i,2]=size(S{k}(:,:));
        x=s(k).xdata;
        y=s(k).ydata;
        S{k}(:,:)=[x y];
        S(:,:)=[S{k-1}(:,:);S{k}(:,:)];
    end
end

??? Error: An array for multiple LHS assignment cannot contain numeric value
Can anyone help me?
Thank you so much in advance!

A: The following should replace all of your code:
S = cell2mat(arrayfun(@(x)[x.xdata x.ydata],s','UniformOutput',false))

This makes a cell array with elements your code calls [x y] and combines it into one array S.
Note that calling size in your code doesn't set the size of S{k}, it just tries to set i to the size.


text:
Q: InputStream interference in a Two-way file transfer through sockets After editing my code with y'all suggestions, as well as condensing the code to where i can pinpoint the line of code that is causing the problem.
Server code:`
public class Server2 {
public static void main(String args[]) throws Exception {

    ServerSocket servsock = null;
    Socket sock = null;
    int SOCKET_PORT = 12362;

    InputStream is = null;
    FileInputStream fis = null;
    BufferedInputStream bis = null;

    OutputStream os = null;
    FileOutputStream fos = null;
    BufferedOutputStream bos = null;

    String FILE_TO_SEND = "SFileToBeSent.txt";
    String FILE_TO_RECEIVED = "CFileReceived.txt";
    int FILE_SIZE = 6022386;

    try {

        System.out.println("Server created.");
        servsock = new ServerSocket(SOCKET_PORT); // creates servsock with socket port
        while (true) {

            System.out.println("Waiting for connection...");
            try {

                sock = servsock.accept(); // accepts a socket connection
                System.out.println("Accepted connection : " + sock);
                System.out.println();

                os = sock.getOutputStream(); // sets Output Stream using the sockets output stream
                is = sock.getInputStream(); // get input stream from socket

                // ----------------------------------------------------------------------------------------------------
                // ----------------------------------------------------------------------------------------------------

                // send file
                File myFile = new File(FILE_TO_SEND); // creates a file using file to send path
                byte[] bytearraySent = new byte[(int) myFile.length()]; // creates a byte array the size of myFile

                try {

                    // reads the contents of FILE_TO_SEND into a BufferedInputStream
                    fis = new FileInputStream(myFile); // creates new FIS from myFile
                    bis = new BufferedInputStream(fis); // creates BIS with the FIS
                    bis.read(bytearraySent, 0, bytearraySent.length); // copies the BIS byte array into the byte array

                    // prints to console filename and size
                    System.out.println("Sending " + FILE_TO_SEND + "(" + bytearraySent.length + " bytes)");
                    System.out.println("byte array from file to send:" + bytearraySent);

                    // copies the byte array into the output stream therefore sending it through the
                    // socket
                    os.write(bytearraySent, 0, bytearraySent.length);
                    os.flush(); // flush/clears the output stream
                } finally {

                    fis.close();
                    bis.close();
                }

                System.out.println();
                System.out.println("sendFile complete");
                System.out.println();

                // ----------------------------------------------------------------------------------------------------
                // ----------------------------------------------------------------------------------------------------

                // receive file
                int bytesRead;

                byte[] bytearrayReceived = new byte[FILE_SIZE]; // creates byte aray using file size
                fos = new FileOutputStream(FILE_TO_RECEIVED); // creates file from path
                bos = new BufferedOutputStream(fos); // creates BOS from FOS
                int current = 0; // equals the two integers for comparisons later
                try {

                    System.out.println(String.format("Bytes available from received file:  %d", is.available()));

                    System.out.println("byte array from file to receive:  " + bytearrayReceived); // debug purposes

                    while ((bytesRead = is.read(bytearrayReceived)) != -1) {

                        System.out.println("amount of bytes that was read for while:  " + bytesRead);

                        bos.write(bytearrayReceived, 0, bytesRead);
                        System.out.println("bos.write");

                        current += bytesRead;
                        System.out.println("current += bytesRead;");
                    }
                    System.out.println("File " + FILE_TO_RECEIVED + " downloaded (" + current + " bytes read)");
                } finally {

                    fos.close();
                    bos.close();
                }

                System.out.println();
                System.out.println("receiveFile complete");
                System.out.println();

                // ----------------------------------------------------------------------------------------------------
                // ----------------------------------------------------------------------------------------------------

            } // end of try
            finally {

                // if any streams or sockets are not null, the close them
                if (os != null)
                    os.close();
                if (is != null)
                    is.close();
                if (sock != null)
                    sock.close();
            } // end of finally
        } // end of while
    } // end of try
    finally {

        if (servsock != null)
            servsock.close();
    } // end of finally
}

}
public class Client2 {
public static void main(String args[]) throws Exception {

    Socket sock = null; // used in main
    String SERVER = "localhost"; // local host
    int SOCKET_PORT = 12362; // you may change this

    InputStream is = null;
    FileInputStream fis = null;
    BufferedInputStream bis = null;

    OutputStream os = null;
    FileOutputStream fos = null;
    BufferedOutputStream bos = null;

    String FILE_TO_RECEIVED = "SFileReceived.txt";
    String FILE_TO_SEND = "CFileToBeSent.txt";
    int FILE_SIZE = 6022386;

    try {

        sock = new Socket(SERVER, SOCKET_PORT);
        System.out.println("Connecting...");
        System.out.println();

        // get input and output from socket
        is = sock.getInputStream(); // get input stream from socket
        os = sock.getOutputStream(); // get output stream from socket

        // ----------------------------------------------------------------------------------------------------
        // ----------------------------------------------------------------------------------------------------

        // receive file
        int bytesRead;

        byte[] bytearrayReceived = new byte[FILE_SIZE]; // creates byte aray using file size
        fos = new FileOutputStream(FILE_TO_RECEIVED); // creates file from path
        bos = new BufferedOutputStream(fos); // creates BOS from FOS
        int current = 0; // equals the two integers for comparisons later
        try {

            System.out.println(String.format("Bytes available from received file:  %d", is.available()));

            System.out.println("byte array from file to receive:  " + bytearrayReceived); // debug purposes

            while ((bytesRead = is.read(bytearrayReceived)) != -1) {
                System.out.println("amount of bytes that was read for while:  " + bytesRead);

                bos.write(bytearrayReceived, 0, bytesRead);
                System.out.println("bos.write");

                current += bytesRead;
                System.out.println("current += bytesRead;");

            }
            System.out.println("File " + FILE_TO_RECEIVED + " downloaded (" + current + " bytes read)");
        } finally {

            fos.close();
            bos.close();
        }

        System.out.println();
        System.out.println("receiveFile() complete");
        System.out.println();

        // ----------------------------------------------------------------------------------------------------
        // ----------------------------------------------------------------------------------------------------

        // send file
        File myFile = new File(FILE_TO_SEND); // creates a file using file to send path
        byte[] bytearraySent = new byte[(int) myFile.length()]; // creates a byte array the size of myFile

        try {

            // reads the contents of FILE_TO_SEND into a BufferedInputStream
            fis = new FileInputStream(myFile); // creates new FIS from myFile
            bis = new BufferedInputStream(fis); // creates BIS with the FIS
            bis.read(bytearraySent, 0, bytearraySent.length); // copies the BIS byte array into the byte array

            // prints to console filename and size
            System.out.println("Sending " + FILE_TO_SEND + "(" + bytearraySent.length + " bytes)");
            System.out.println("byte array from file to send:" + bytearraySent);

            // copies the byte array into the output stream therefore sending it through the
            // socket
            os.write(bytearraySent, 0, bytearraySent.length);
            os.flush(); // flush/clears the output stream
        } finally {

            fis.close();
            bis.close();
        }

        System.out.println();
        System.out.println("sendFile() complete");
        System.out.println();

        // ----------------------------------------------------------------------------------------------------
        // ----------------------------------------------------------------------------------------------------

    } // end of try
    finally {

        if (sock != null)
            sock.close();
        if (os != null)
            os.close();
        if (is != null)
            is.close();
    } // end of finally
}

}
Server output:--------------------
Server created.
Waiting for connection...
Accepted connection : Socket[addr=/127.0.0.1,port=51565,localport=12362]
Sending SFileToBeSent.txt(32 bytes)
byte array from file to send:[B@4e25154f
sendFile complete
Bytes available from received file:  0
byte array from file to receive:  [B@70dea4e
Client output--------------------
Connecting...
Bytes available from received file:  32
byte array from file to receive:  [B@4e25154f
amount of bytes that was read for while:  32
bos.write
current += bytesRead

I still have the issue with InputStream, and i have found out through debugging that both the server and client get stuck on the while() statement that is in the receive section. For the server, it stops immediately, whereas the client goes through the while loop once then stops when it hits the while statement.
If anyone has any suggestions or solutions, then it would be much appreciated!

A: First , your receiveFile method should read input and write output in a loop.
Second, please close files after done or you may have a resource leak.
public static void receiveFile() throws IOException {
byte[] mybytearray = new byte[FILE_SIZE]; // creates byte aray using file size
fos = new FileOutputStream(FILE_TO_RECEIVED); // creates file from path
bos = new BufferedOutputStream(fos); // creates BOS from FOS
int current = 0; // equals the two integers for comparisons later

try {
    while ((bytesRead = is.read(mybytearray)) != -1) {
        bos.write(mybytearray, 0, bytesRead );
        current += bytesRead;
    }
    bos.flush(); // clears the buffer
    System.out.println("File " + FILE_TO_RECEIVED + " downloaded (" + current + " bytes read)");
} finally {
  bos.close();
}

}


text:
Q: Finding latitude & longitude values for both ends of a road I am looking for a way to find latitude and longitude values of both ends of any given road. So for example if there was a site or tool that did this, I would just have to provide a road name (and maybe post/zip code) and it would give me the latitude and longitude values.

A: There really is no other way to approach this than using GIS software. What you are describing is the guts of what GIS is. Unless you are lucky enough to discover that someone else has done this exact thing at the same place you are requiring, this is something that has to be built from scratch.

A: Manually, using Google Maps you can right click "What's Here" on any location (start/end points of given road) and it will give you decimal degree lat/long values.
If you have access to GIS software and datasets there are faster ways to get multiple values for multiple streets


text:
Q: Input Form Selectable Images I am looking to create an option within a form to choose a theme for the page. The options need to be displayed as images so the user can see what the theme looks like. What is my best way to implement this?

A: I'd suggest something like:
<fieldset>
<legend>Theme</legend>

<input type="radio" name="theme" id="theme_sunset" value="sunset">

<input type="radio" name="theme" id="theme_moonlight" value="moonlight">

...


text:
Q: The experience you requested uses Expo SDK v(null), but this copy of Expo Client requires at least v35.0.0 I decided to return to an Expo app I was developing last year and was using expo-sdk:v33.0.0 and it was working.
I tried to use a solution of Squirrl from similar question, but still no luck. Tried removing node_modules and yarn_install. Here's my package.json:
enter
"dependencies": {
 "@react-native-community/masked-view": "^0.1.7",
 "@react-navigation/material-bottom-tabs": "^5.1.1",
 "@react-navigation/material-top-tabs": "^5.1.1",
 "@react-navigation/native": "^5.0.9",
 "@react-navigation/stack": "^5.2.3",
 "axios": "^0.18.1",
 "date-fns": "^1.29.0",
 "dotenv": "^8.2.0",
 "expo": "^33.0.0",
 "expo-font": "~5.0.1",
 "lodash": "^4.17.15",
 "native-base": "^2.13.1",
 "react": "16.8.3",
 "react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
 "react-native-gesture-handler": "~1.2.1",
 "react-native-modal": "^11.5.4",
 "react-native-paper": "^3.6.0",
 "react-native-platform-touchable": "^1.1.1",
 "react-native-reanimated": "1.0.1",
 "react-native-safe-area-context": "^0.7.3",
 "react-native-safe-area-view": "^1.0.0",
 "react-native-status-bar-height": "^2.1.0",
 "react-native-tab-view": "^2.13.0",
 "react-native-vector-icons": "^5.0.0",
 "react-redux": "^5.1.0",
 "redux": "^4.0.1",
 "redux-axios-middleware": "^4.0.0",
 "redux-persist": "^5.10.0",
 "save": "^2.4.0",
 "victory-native": "^30.6.0"
"devDependencies": {
 "babel-preset-expo": "^5.0.0",
 "nodemon": "^2.0.2",
 "react-native-dotenv": "^0.2.0"

The app was working with these dependencies that time.
1st issue is that error says Expo SDK v(null). But version is specified in both package.json and app.json.
2nd issue is error says Expo client requires v35.0.0. How can i run the app without upgrading sdk from v33 to v35

A: This is what worked for me.
Run npm i -g expo-cli (You may have to use sudo if on a Mac. I did.) then run expo upgrade
Follow the prompts and it should work.


text:
Q: How can I add condition that required or not in select vue.js 2? My component vue is like this :
<template>
    <select class="form-control" v-model="selected" required @change="changeLocation">
        <option v-for="option in options" v-bind:value="option.id" >{{ option.name }}</option>\
    </select>
</template>
<script>
    export default{
        props: ['type'],
        ....
    };
</script>

I want to add condition in select
If type = 1, on the select not display required like this :
<select class="form-control" v-model="selected" @change="changeLocation">

If type = 2, on the select display required like this :
<select class="form-control" v-model="selected" required @change="changeLocation">

How can I do it?

A: You can bind data to plain HTML attributes. It doesn't need to be a component property.
<select class="form-control" :required="type == 2" ...></select>

Doing this, the select element will only have the required attribute if type == 2.


text:
Q: libvirt management is slow under ubuntu I've just done a fresh install of KVM/Qemu under Ubuntu 14.04.2 on an older (C2D gen) server with dual quad core xeons and 24 gb of ram. I'm finding that I'm waiting for operations in virsh for around 10-20 seconds. I can understand that some commands take time to complete, but feel that virsh dumpxml test.domain (glorified cat test.domain.xml) and virsh list shouldn't be taking this long to complete. Is this a well known bug? How can I fix it?

A: Nevermind. I forgot that I installed Kimchi on there to manage it. Killed the process and everything is much better. Derp...


text:
Q: Dirichlet's theorem possible generalization Looking at the generalizations of Dirichlet's theorem on arithmetic progressions, I have not seen one that I thought about recently:
Possible generalization
Let $a,k$ be positive coprime integers, and $S$ some set of positive integers such that:
(i) $\forall x\in S$, $\gcd\left(a,x\right)=\gcd\left(k,x\right)=1$
(ii) $\sum_{x\in S} x^{-1}=\infty$
Then, there are infinitely many prime numbers of the form $ax+k$.
This possible generalization seems sound with some examples I have thought about. For instance:

*

*$a=2$,$k=1$, $S=\{x:2n-1, n\in \mathbb N\}$ (the sequence $ax+k$ contains all the primes of the form $4k+3$, already proved there are infinitely many).

*$a=2$,$k=1$, $S=\{x:p, p\in \mathbb P\}$ (infinitely many Sophie Germain primes conjecture).

I would like to know if there is some recent paper related to the conjecture, and assessment about how difficult could it be to prove it, as well as some mathematical machinery that you would recommend me to study in order to try to attack it.
Thanks!

A: This conjecture is false. Some counterexamples:

*

*One can take $a=2$ and $k=1$ again, but take $S=\{7,13,19,25,\dots\}$; then $ax+b$ is a multiple of $3$ for every $x\in S$.

*One can also take $a=k=1$ and take $S=\{3,5,7,8,9,11,13,14,15,\dots\}$ to be the set of all numbers $x$ such that $x+1$ is composite.


text:
Q: Disaster recovery advice
Possible Duplicate:
Disaster recovery plan development best practicies or resources?

We are in the process of starting an internal evaluation about the disaster recovery procedures for our datacenter.
Can you suggest any good book/site that you consider influential in this field?
Thanks.

A: Please, see this other question on the same topic.


text:
Q: How to pass HTTP header information to a SonarQube Server running behind a Proxy? We have a SonarQube Server running behind IIS which is configured as a reverse proxy and we are trying to implement SSO for SonarQube by delegating user authentication to IIS. Now SonarQube is expecting HTTP header information related to authenticated users.

*

*Where can we find those HTTP header information in IIS?

*How do we pass them to SonarQube?

Expected HTTP Headers in SonarQube.

*

*X-Forwarded-Login

*X-Forwarded-Name

*X-Forwarded-Groups

Any help would be greatly appreciated.
Thank you!:)


text:
Q: Is there any good Terran (SC2) replay pack of one player? I want to see how his build (whatever it is) work with different opponents.
(And of course steal and perfect it :) )

A: Here are a list of Brad_OK Vods which you will find more useful:

*

*TvP

*TvT Part 1, Part 2

*TvZ Part 1, Part 2
But you asked for a replay pack, not Vods.
There aren't a ton of replay packs that are SC2 compatible, most are only compatible with the beta.  The issue is that SC2 hasn't been out long enough for good replay packs to be coming out.


text:
Q: How do I create a provisioning profile that allows developers on my team or clients to use early-stage builds of an unreleased app? Context: We're an app development agency that has recently enrolled in the (paid) Apple Developer Program as an organization.
Problem: We'd like to both

*

*a.) easily share WIP iOS projects with other team members so that they can test the software on their own iPhones or iPads

*b.) easily share WIP iOS projects with clients so they can give feedback on next steps.

Our current process is that we get the device UDIDs for every work device of every developer on our team and also for our clients. Once we have those UDIDs, we create a brand new provisioning profile and then compile (or "archive" in Xcode terminology) the WIP app using this profile.
But this has downsides:

*

*code that we've already compiled must be recompiled when the client sends us a new device (e.g. adding the iPhone UDID of a new project manager on their team)

*despite every developer on our own team being connected to our organization as a developer-class user in App Store Connect > Users, I don't know of any way to compile (/
"archive") an IPA such that anyone on my team can run it on their phone.

Does anyone have any ideas on how to solve this pair of problems? Any pointers are highly appreciated.

A: Our org has an "enterprise" profile, used to archive a daily IPA which is published as a "Beta" build via a pipeline. Anybody in the org (without being devs) can just install the app, like you'd do from the App Store.
For hosting the app/build, you can use MS App Centre, which should solve your use case (and it also offers a free tier, to experiment and get a hang of it).


text:
Q: Java Linked List unique Keyword Sorting I'm trying to read a file (in this case a text file with song lyrics) and create a linked list using only unique strings from said file. There cannot be any two same strings in the list. It needs to be stored in a Linked List and can't use the built-in one for it. Right now this is what I have:
public String createSuperList(String newKey) {
    SuperLink newSuperLink = new SuperLink(newKey);
    SuperLink current = first;
    if(isEmpty()) {
        incertLast(newKey);
    } else if (newSuperLink != last) {
        while(current != newSuperLink && current != null){
            if(current.equals(newSuperLink)){
                return null;
            } else {
                incertLast(newKey);
            }
            current = current.next;
        }
    } else {
        return null;
    }
    return newKey;
}

HOW THE NEWKEY IS SENT TO THIS METHOD:

    File file = new File("MYFILEPATH");
    try {
        Scanner sc = new Scanner(new FileInputStream(file));
        while (sc.hasNextLine()) {
            content = sc.next();
            if(SuperList.createSuperList(content) == null){
                BabyList.incertLast(content);
            }
        }
        sc.close();
    } catch (FileNotFoundException fnf) {
        fnf.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
        System.out.println("\nProgram terminated Safely...");
    }

The newKey is the string that I'm comparing to the rest of the Linked List to see if it is repeated anywhere in the list and, if it is seen in the List somewhere, it will return a null.
My issue right now is that it just keeps going and there's no stopping (runaway), it doesn't end at all. The program doesn't stop. I keeps looping forever. I had it running for an hour with nothing changing and it still running.
Right now what its suposed to do Is create a LinkedList called superLinkList that only has unique words in it.
This is going to be a markov text generator that uses 2 linked lists.
EDIT_1: So I fixed the infianite run time issue but Its still not checking if its unique or not.
Updated Code:
public Boolean createSuperList(String newKey) {
    SuperLink newSuperLink = new SuperLink(newKey);
    SuperLink current = first;
    boolean i;
    if(isEmpty()){
        incertLast(newSuperLink.toString());
    }
    while(current != newSuperLink && current != null){
        if(current.equals(newSuperLink)){
            System.out.println("Not unique Item");
            i = false;
        } else {
            System.out.println("Unique Item");
            i = true;
        }
        current = current.next;
    }

    if(i = true){
        return true;
    }else{
        return false;
    }

}

EDIT_2:
Okay so now its a nullpointerexception. The NPE is at the while loop. Specifically its current.keyWord. Im not sure how to change this so that It will work. Im not sure why its throwing an error here....
Code:
public Boolean createSuperList(String newKey) {
    SuperLink newSuperLink2 = new SuperLink(newKey);
    SuperLink current = first;
    boolean i = false;
    if (isEmpty()) {
        incertLast(newKey);
    }
    while (!current.keyWord.equals(newSuperLink2.keyWord) && current != null) {
        if (current.keyWord.equals(newSuperLink2.keyWord)) {
            System.out.println("Not unique Item");
            i = false;
            break;
        } else {
            System.out.println("Unique Item");
            i = true;
        }
        current = current.next;
    }
    if (i = true) {
        return i;
    } else {
        return i;
    }

}

A: You can solve your problem in a few lines:

*

*read values into a LinkedHashSet (set preserving the order of insertion)

*convert the result new LinkedList<>(linkedHashSet)


text:
Q: How to remove permissions of a user on an item using Onedrive Graph API? Summary:
I'm trying to remove permission of a user on an item using Onedrive Graph API, but I'm always getting 403 Forbidden. I'm using a business account and it's working fine for everything else; adding permissions to users, creating folders, uploading files, etc..
I'm following this documentation https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/permission_delete?view=odsp-graph-online.
What am I doing wrong?
Request made:
Method: DELETE
Url: https://graph.microsoft.com/v1.0/me/drive/items/01CFGODSVE5ZR7NAHG3FGLXM3G2YXDNYPF/permissions/aTowIy5mfG1lbWJlcnNoaXB8bWFyaW9AZXVyb21pYi5mcg
Authorization: Bearer eyJ0e...
Response of the request made:
{
    "error": {
        "code": "notAllowed",
        "message": "Operation not allowed",
        "innerError": {
            "request-id": "23fe15ec-9e3a-4c78-8a82-52be07db60d4",
            "date": "2019-04-19T11:10:20"
        }
    }
}

Postman Request & Response:

https://i.ibb.co/y8wcsh8/postman.png
C# Code:
public dynamic RemoveItemPermission(string itemId, string permissionId)
{
    string graphUrl = $"https://graph.microsoft.com/v1.0/me/drive/items/{itemId}/permissions/{permissionId}";
    HttpWebRequest request = WebRequest.CreateHttp(graphUrl);
    request.Headers.Add("Authorization", "Bearer " + AccessToken);
    request.Method = "DELETE";

    var response = request.GetResponse();
    using (StreamReader reader = new StreamReader(response.GetResponseStream()))
    {
        return JsonConvert.DeserializeObject<dynamic>(reader.ReadToEnd());
    }
}

A: Thanks for the very detailed question Carlos! Based on what you provided we did track down an issue with deleting direct access permissions that were granted to specific users. We disabled the problematic code and so hopefully your issue is now resolved. Definitely let us know if that's NOT the case.

A: According to Microsoft Documentation, you can delete only not inherited permissions.
Only sharing permissions that are not inherited can be deleted. The inheritedFrom property must be null
https://learn.microsoft.com/en-us/graph/api/permission-delete?view=graph-rest-1.0&tabs=http