Android: converting between Strings, SpannedStrings and Spannablestrings

Question: I have a string resource called "foo". It may be a simple string... or it may contain HTML. This may change over time: I should be able to box it up as at least a SpannableString immediately upon reading whether it's HTML or not (but how??)
I want to get that raw CharSequence and first be able to display it as-is (the exact characters, not Android's "interpretation" of it). Right now I can't do that... toString() decides to rip out the parts it doesn't think I want to see.
I'd then like to be able to create a SpannableString from this and other Strings or SpannableStrings via concatenation using some method (none of the normal ones work). I'd like to then use that SpannableString to display the HTML-formatted text in a TextView.
This shouldn't be difficult, but clearly I'm not doing it right (there's very little info out there about this that I've found so far). Surely there is a way to accurately interconvert between between Strings, SpannedStrings and even Spannablestrings, without losing the markups along the way?
Note that I've already played with the somewhat broken Linkify, but I want better control over the process (no dangling unformatted "/"s, proper hrefs, etc.) I can get this all to work IF I stay in HTML at all steps, though I can't concatenate anything.
Edit 1: I've learned I can use the following to always ensure I get my raw string (instead of whatever Android decides it thinks the CharSequence really is). Nice... now, how to coax this into a SpannableString?
<string name="foo"><![CDATA[
    Some bold
]]>
</string>

Edit 2: Not sure why this didn't work earlier, but... if foo1 and foo2 are strings marked up as above (as CDATA), then one can apparently do this:
String foo1 = (String)getResources().getText(R.string.foo1);
String foo2 = (String)getResources().getText(R.string.foo2);
SpannedString bar = new SpannedString(Html.fromHtml(foo1+foo2));

Curious: is there a more straightforward solution than this? Is this CDATA business actually necessary? It seems convoluted (but not as convoluted as never quite knowing what the resource type will be... String, Spannable, etc.)
Comment: It looks like you answered your own question here. Your foo1, foo2 example above seems fine. If you don't have another concrete question you should answer your question so it is removed from the unanswered section. CDATA is necessary to embed HTML in XML because otherwise the html elements will be indistinguishable from the enclosing XML.
Answer: I had the same problem. There are two solutions according to Google API Guides.
First is to escape < mark with < in the string resource. Unfortunately, String conversion removes the tag in the background.
Second is to use Format Strings instead of XML/HTML tags. It seems simpler, faster, and evades hidden conversion problems. getString(resource, ...) works like a printf(string, ...) here.
Both work and require some code to replace given part of the string anyway (handle tags or format strings). Enjoy! =)
Answer: It appears there isn't a more straightforward way to accomplish this.


Earth bulge and axis precession

Question: We know that earth is not spherical because it spins. Does every object that spins bulge? for example a rotating wheel bulges? Also how moon and sun create the torque that shifts the axis of rotation (precession) if gravitational force acts on center of mass therefore no torque?
Comment: Related: https://physics.stackexchange.com/q/8074/2451 and links therein.
Answer: Every object that spins must be accelerating.  This means different forces (and usually stresses) from the same object at rest.  Whether it bulges or not depends on the material and its response to that stress.
If you have a steel marble spinning at 1 revolution per minute, the rotational forces on it are tiny.  Given the strength of the material, you probably would be unable to measure the deformation (or bulge) from the spin.  As the object becomes larger, weaker, and faster, the deformation would increase.

...gravitational force acts on center of mass therefore no torque ?

Gravitational force acts across an entire mass, not just at the center.  However, in some cases, the sum of these forces is identical to it acting only at the center.  This is true when you have a uniform sphere or uniform spherical shell of material.  So for things that are mostly spherical, the simplification that gravity acts only on the center of mass is reasonable, but perhaps not exact.
Because the earth deviates from a spherical shape, the sun and moon don't tug on it uniformly.  The equatorial bulge gets pulled a bit differently and allows for a small torque that can cause precession.  If the earth were exactly spherical, this torque would not exist.

Earth bulge and axis precession


SharePoint 2013 permission level

Question: Is it possible to create access / permission level where user can view / create / upload files Online, but not sync a folder / library?
Comment: No, the sync proces is an automated proces of what a user can do.
Answer: No, but the alternative is to go to the library and go into the Library Settings. From there go to the Advanced Settings and scroll down to Offline Client Availability. Set this to No and click OK.
This will block all users from being able to sync that particular library.
Comment: Thanks :) it works .. but if I want to set the permissions for stopping a folder in the library to sync but it should be visible in the Web ... is it possible ?
Comment: Disabling syncing should have no impact on the folder visibility
Comment: If I have 3 folders in the document library
FOLDER  A
FOLDER B
FOLDER C

and  Offline Client Availability YES (default ) but will not allow  FOLDER A in the document library from syncas but everything else syncas as usual , it is possible ?
Thanks again

SharePoint 2013 permission level


Why are my bitizens staying at home?

Question: My shop ran out of stock and 2 of the 3 employees went home. I have since restocked the shop but the employees are still at home. How can I get them back to work?
Answer: A bitizen's location within the tower is not representative of what they are doing.  If a bitizen has a job, they are always at work.  Do not worry that they don't appear on that floor at any given moment.
Watch the inventories.  You'll notice that they are all still going down (at least... they should be).
Answer: If a bitizen "goes home" and you want to force him back to the floor he works on select the bitizen then job->no job. Then reassign him to his original job and it will put him back on the floor where he works. As long ad you don't close the game he should stay there.

Why are my bitizens staying at home?


ARIMA(X) Validation

Question: I'm in the process of developing a new spark-based ARIMA(X) tool, and have reached the point where I need to know whether my coefficient estimates and forecasts are sensible. I can compare my results to R on the same data set, but, as my implementation is distributed while R's is in-memory, I think it's reasonable to assume that there will be some slight differences in our estimates. What I don't know is how different is too different for the coefficient estimates and forecasts? Is there a standard approach to evaluating to reasonableness of a new implementation of time series analytics?
Comment: Could you describe a bit about the data you are modeling?  Is this a single time series, many different independent time series, hierarchical time series?  Length of individual time series, frequency (or is it mixed).  Is a single time series split and you are comparing the results?  Is ensembling an option?
Answer:
Is there a standard approach to evaluating [the] reasonableness of a new implementation of time series analytics?

Yes, there is. A way to validate your build-from-scratch is to simulate an ARIMAX timeseries from a data generating process (DGP) of your choice (see e.g. http://robjhyndman.com/hyndsight/arimax/).
Call your choice of DGP-parameters $\theta$, then:

Draw a sample from the DGP.
Estimate the model's parameters: $\hat{\theta}$. Make forecasts: $\hat{y}_{T+h|T}$.
Assess $|| \hat{\theta} - \theta||_{\text{a metric}}$ and $||\hat{y}_{T+h|T} - y_{T+h}||_{\text{a metric}}$.
Repeat 1 to 3 a couple of times, also for different DGPs and sample sizes.
You either increase your confidence in the build, or find weak points that need improvement.

A sensible metric could be squared loss. Personally, I like to use the "eye-ball metric" for the forecast residuals, their distribution could be assessed by way of histogram.
Comment: This is indeed the standard procedure. There are literally thousands of papers that include Monte-Carlo Simulation sections. For a very recent reference see [Boot & Nibbering 2016 *"Forecasting using Random Subspace
Methods"*](http://papers.tinbergen.nl/16073.pdf) Section 3.
Comment: Thanks, Jim! I suspected that's what the standard procedure was. Do you happen to have a publication reference I could use, or is the Hyndman text the best one here?
Answer: What some people do is some kind of 'ordered' k-fold cross validation. (Check here, for instance.) You partition the data into $k$ partitions. Then, you fit the model on the partition 1, test on partition 2, get prediction error. Then, you fit the model on the union of partitions 1 and 2, test on partition 3, get prediction error. So on so forth, then average the prediction errors.
Comment: Yes, in a standard model development paradigm that's exactly what I'd do! However, because I literally built my ARIMAX approach from scratch, I'm looking to validate the code on data where one knows the sort of answer to expect.

ARIMA(X) Validation


Minimization using Singular value

Question: Let $A$ be a $p\times q$ matrix, with rank $q$. Show that the vector $x$ that minimizes $\|Ax\|_2$ under the constraint $\|x\|_2 = 1$ is the right singular vector of $A$ corresponding to the smallest singular value.
Answer: Let $$A = U \Sigma V^*$$ be the SVD of A. Then, because $ U$ is orthogonal,  $$ ||Ax||= ||\Sigma V^* x|| $$ If $V^*x = y$ , $  ||y||=||x||=1$ we are left with
$$||Ax||^2=||\Sigma y||^2 = \sum _i |\sigma_iy_i|^2 \geq \sum _i |\sigma_qy_i|^2 = \sigma_q^2 $$ So, the inequality holds. If $x$ is a right singular vector of $A$  then it is one of the columns of $V$. But $V$ is orthogonal, so there $i$ such that $V^*x = e_i$, hence$||Ax|| = ||\Sigma V^* x||  = ||\Sigma e_i|| = \sigma_i$. So, any singular vector of $\sigma_q$ minimises $||Ax||$ and the result follows. Note that it is unaccurate to talk of the minimiser of $||Ax||$, as the singular vectors are not unique ( we can multiply $x$ by -1).
Finally, note that every minimiser of $||Ax||$ must be a singular vector. To do this, adapt the proof of the inequality!
Answer: Hint: let $x \in \mathbb{R}^q$ and write it as a linear combination of right singular vectors of $A$. Notice that $Ax$ is a linear combination of the corresponding left singular vectors of $A$. But these are orthogonal, so you have the Pythagorean theorem, which makes it straightforward to solve the minimization problem. In particular you should find that if $x=\sum c_i v_i$ then $Ax=\sum c_i \sigma_i u_i$ so $\| Ax \|_2^2 = \sum c_i^2 \sigma_i^2$.

Minimization using Singular value


Conditions for characterizing a wave as plane wave

Question: Given a wave equation, say for example $\Psi(x,y,z,t) = a \cos\left(\omega t -\vec{k}\cdot \vec{r} \right)$, what conditions should be met for $\Psi$ to represent a plane wave?
Answer: This rather depends on your application. Your solution is a plane wave and, as you can see from your solution, the disturbance is infinite in spatial and temporal breadth. Real waves in causal systems have a definite beginning and end in time and are confined to finite volumes. Just a slight quibble: yours is a solution to the wave equation, not the wave equation itself. Your solution is a plane wave solution to the Helmholtz equation:
$$\left(\nabla^2 + \frac{\omega^2}{c^2}\right)\Psi=0$$
which is linear, so that an arbitrary linear superposition of waves of the form you give are also solutions. Indeed, given certain reasonable assumptions on $\Psi$, all solutions of this wave equations can be represented as such superpositions (see my answer here for a discussion on the limits to this statement).
The better question is "how plane is a certain disturbance?" and this is quantitatively answered by the Fourier transform: real waves are superpositions of your basic solution:
$$\Psi(\vec{r},\,t) =\int_{\mathbb{R}^3} \exp(i(\vec{k}\cdot\vec{r}-c\,|\vec{k}|\,t))\,\psi(\vec{k})\,{\rm d}^3 k$$
and you use the Fourier space function $\psi(\vec{k})$ that defines the superposition weights to measure how non-plane the true wave is. A plane wave has $\psi(\vec{k})$ tightly concentrated about one lone wavevector $\vec{k}_0$. Laser beams are roughly plane, but they are finite in spatial breadth and so they always comprise a spread of directions about the nominal direction of propagation. It is the presence of "off-axis", i.e. slightly skewed plane wave components that beat together and confine the superposition to a finite beam.
The spread in Fourier space and spread in untransformed space are bounded by the Heisenberg inequality (in quantum mechanics, the HUP arises because position and momentum space are Fourier transforms of one another). I talk more about this in this answer here, on why all laser beams diverge and also here for a more general discussion of the Heisenberg inequality.


Is there a Android POS full node wallet apps that is open source? An app that can also stake?

Question: Are there any Android Proof of Stake apps that is open source. The peercoin app seems to be a light client. Some of the apps seem to be QT transformed to Android.
Answer: I think the short answer is no, there isn't an Android full node app. Being a full node would requiring downloading and storing the entire block chain, and that is too much data for mobile devices.
I don't know of any mobile wallets that stake. And you are right that many of the apps are just the QT code transformed to Java. I think it was done this way on purpose so as to ensure that the two references are bug-for-bug compatible.


What is this British bomber?

Question: From previous answers this is probably at RAF Duxford in the mid-1930s.
Answer:
Source: wikimedia.org
I would say an Armstrong Whitworth Whitley.
Somehow the uncommon nose section looks like a special variant, maybe a radar-equipped submarine hunter?
Comment: The pictures show Armstrong Whitworth Whitley K7208, built as a Mk I, but used in 1938 as a prototype to test the aircraft with Rolls Royce Merlin engines. The nose and tail turrets were removed and faired over.

What is this British bomber?


How many parameters are required to specify a linear subspace?

Question: A problem in Peter Lax's Linear Algebra involves looking at the family of $n\times n$ self-adjoint complex matrices and asking: on how many real parameters does the choice of such a matrix depend?
This made me ask:

On how many real parameters does a choice of a $k$-dimensional subspace of $\mathbb{R}^n$ depend?

Clearly the $n-1$-dimensional subspaces as well as the $1$-dimensional subspaces are an $n-1$ parameter family, since we can specify a $1$-dimension subspace by choosing a vector up to scaling, and we can choose an $n-1$-dimensional subspace by choosing its one-dimensional orthogonal complement. This suggests that the formula should be something like ${n\choose k}-1$. I'm having trouble proving this...any ideas?
Comment: This may be helpful: http://en.wikipedia.org/wiki/Grassmannian
Comment: @user64480 Indeed, after some scrolling you'll find there: "In particular, the dimension of the Grassmannian is r(n–r);."
Comment: I would rather say that for a $k$-dimensional subspace $V\subseteq \Bbb R^n$, you need $k(n-1)$ parameters to describe it directly (a basis of vectors up to scaling), and $(n-k)(n-1)$ to describe indirectly. Though I have no proof at the moment that this is indeed the sharpest bounds possible.
Answer: You can generate an arbitrary linear subspace of dimension $d$ by applying an orthogonal transformation on the subspace spanned by the first $d$ basis vectors. However, orthogonal transformations which happen completely inside the subspace have no effect, nor do orthogonal transformations which happen completely in its complement.
Since you need $k(k-1)/2$ parameters to specify an orthogonal transformation in $k$ dimensions, the number of arguments to specify a $d$-dimensional linear subspace of $\mathbb R^n$ is
$$\frac{n(n-1)}{2} - \frac{d(d-1)}{2} - \frac{(n-d)(n-d-1)}{2}$$
To specify an affine subspace of dimension $d$, you need $n-d$ additional parameters to describe the displacement from the origin (displacements in the subspace don't change it).
Here are some examples:
To specify a $0$-dimensional linear subspace, you need $n(n-1)/2 - 0 - n(n-1)/2 = 0$ parameters. That's obvious, because there's only one 0-dimensional linear subspace.
To specify a $1$-dimensional linear subspace (a straight line through the origin), you need $n(n-1)/2 - 0 -(n-1)(n-2)/2 = n-1$ parameters. This is also clear; to specify a one-dimensional subspace, you need to specify one point on the unit sphere, which is $n-1$-dimensional.
To specify a $2$-dimensional linear subspace (a plane through the origin) in $\mathbb R^3$, you need $3\cdot2/2 - 2\cdot1/2 - 1\cdot0/2 = 2$ parameters.
More generically, from the formula you see that you need the same number of parameters to specify a linear subspace and to specify its complement, which is also obvious because one implies the other.
To specify a $1$-dimensional affine subspace (a general straight line) in $\mathbb R^n$, you need $n(n-1)/2 - 0 - (n-1)(n-2)/2 + (n-1) = 2(n-1)$ parameters. This can also be seen directly from the fact that you can write the points of the line as $\mathbf u + \lambda\mathbf v$, (2 vectors $\implies$ 2n parameters) but the length of $v$ is irrelevant (1 parameter less), and $\mathbf u$ can be changed by an arbitrary multiple of $\mathbf v$ (again, 1 parameter less).
Edit: As Elmar Zander noted, the formula for linear subspaces can be simplified significantly to $d(n-d)$.
Obviously this means that the number of affine subspaces then also simplifies to $(d+1)(n-d)$.
Comment: Great insight! I just wanted to added that the formula simplifies significantly to $d(n-d)$. You can see that even without calculation, because you have triangular numbers, and from the big triangle of edge length $n$ you're subtracting smaller triangles of edge lengths $d$ and $n-d$, such that you're left with a rectangle with side length $d$ and $n-d$.
Comment: Fantastic answer, thanks!
Comment: @Elmar, great simplification and insight. One thing I didn't understand: isn't $n(n-1)/2$ a triangle of edge length $n-1$, not $n$?
Comment: @ElmarZander: Thanks to noting this. I'll add this to the answer.
Comment: @EricAuld. You're right, the triangles have edge lengths (or rather: number of dots on each side) of $n-1$, $d-1$ and $n-d-1$ respectively. I was a bit sloppy here, but the result is the same, as you can easily visualize.


Selling options

Question: When selling an option after you bought it (not writing one) how easily are orders filled for large quantities of contracts ($25,000+) Do these sell orders usually get filled easily or not at all?
Comment: Can you tell us which stock you had in mind?  (Just BTW: please note that if you have "invented" the idea that you can buy thin options and make a billion dollars, just completely forget it, "they" are all over this and it will never work.)
Comment: @Fattie - All you need to make a pile of money with options is one stellar pick.  It's the other 99.99999 percent of one's option trades that's the problem ;->)
Comment: but my backtesting made billions @BobBaerker !!
Answer: The price of the option determines what kind of size $25,000 means.  1,000 contracts at 25  cents apiece would be hard to move, even for the most liquid option series.  Much less so for 10 contracts at $25 apiece.
Another factor would be the liquidity of a stock's options.  The entire open interest for all of the options traded in some stocks is quite low  whereas the daily trading volume for some individual strike prices in heavily traded securities  like AAPL or SPY can easily be over 25,000 contracts.

Selling options


Random Walk Problem (Integer Line)

Question: Suppose we are doing a random walk on the infinite integer line. At every step of this walk, the position of the walker is an integer point on this line. For the next step of this walk, the walker moves to one of the two adjacent/neighboring integer points with equal probability. Prove that the expected distance of the walker from the origin (i.e., the starting point of the walk) after $n$ steps is $\Theta(\sqrt{n})$.
Could we not just consider an equivalent problem: if a fair coin is flipped $n$ times, show that (WLOG) the difference in the number of flipped heads from the number of flipped tails in this sequence of flips is  $\Theta(\sqrt{n})$? Given that the expected number of heads/tails for this sequence is $\frac{n}{2}$, from the linearity of expectation, we have that the expected difference is $\frac{n}{2} - \frac{n}{2} = 0 = O(\sqrt{n})$, but clearly $0 \neq \Omega(\sqrt{n})$.
Comment: "distance" is unsigned
Answer: You need to look at the expected value for the absolute value of the difference, not the expected value for the difference.

Random Walk Problem (Integer Line)


Can I brick a laptop with UEFI firmware installed by letting software write to the first sector of my drive as to MBR?

Question: Imagine I am working with some old OS installer that thinks that my drive uses first 512 bytes for managing partitions, and it writes to it its data. Can this corrupt my system in such a way that UEFI firmware will not run boot loaders of OS that are UEFI-compatable and have been previously installed to the drive, or will firmware be able to see, once again, previously allocated GPT partitions on reboot?
Answer: Overwriting the MBR should never completely brick a regular PC, whether it's "BIOS" or "UEFI"... It may or may not make the OS unbootable, but it will not affect the pre-OS firmware and you'll still be able to boot from some other media and recreate the MBR (or at least reinstall the OS).
That aside, old programs should not cause problems for EFI systems because the 'GPT' partition table (used on most EFI disks) actually starts at the second sector – it reserves the first sector for a so-called "protective MBR", which is there specifically to remain compatible with BIOS systems and MBR tools.
Traditional MBR serves two purposes: the first 440 bytes are used for the BIOS-style "stage 1" bootloader; the remaining 72 bytes are used for the partition table.
The "protective MBR" on GPT-partitioned disks still retains the same format, except it always holds one very large "protective" partition. Your old MBR partitioning tools won't think the disk is empty; they will actually see one giant partition that covers the entire disk, and no decent tool will go as far as automatically deleting actual partitions even if they're of unknown type.

(However, if you do delete it and create new partitions, this can confuse the firmware because now the disk has two partition tables holding different information.)
Meanwhile, tools which overwrite the bootloader area will have no effect on EFI boot process, because the EFI firmware directly looks for a specific file in a specific partition – it doesn't use the old bootcode location for anything.
Comment: Small correction to that. If your system isn't pure UEFI, but UEFI with CSM (or "legacy support" as some vendors call it), it may still do an old-style MBR boot in stead of a real UEFI boot. In that case the normal problems associated with overwriting the MBR still apply.
Comment: Yeah, but in that case the disk will almost always have a "regular" MBR partition table as well, so the problem as described in OP's post will not exist in the first place. (Although mixing BIOS+GPT or EFI+MBR for internal OS disks is technically possible, it's very rarely useful and not something you'll see on a typical Windows system.)
Comment: I've seen a couple of systems with a CSM boot from the Legacy MBR partition in the GPT calling the NTLoader which then loaded Windows 7. In all cases these where factory installed PC's (cheap label supermarket brand) that had Win7 installed on a single NTFS partition on a GPT disk with CSM boot. There was a EFI folder but that didn't contain valid bootfiles for this PC. The Windows 10 Inplace Upgrade completely borked these trying to upgrade the EFI bootloader. Fresh Windows 10 install with EFi only worked just fine. Whatever the vendor posesed to sell them like that...
Comment: Whether the protective MBR covers the entire disk or not depends on the size of the disk.  If the size of the disk exceeds the maximum partition size representable using the legacy 32-bit LBA entries in the MBR partition table, the recorded size of this partition is clipped at the maximum, and the rest of the disk is ignored.


Is it possible to set the click force higher than system settings allows?

Question: Is it possible to edit whatever plist contains magic trackpad preferences (MacBook Pro 2023) on Ventura to increase the force required for regular click beyond what the "slider" in system settings allows?  I'd like it if it was approximately 25% "harder" to click and the slider in system settings isn't adaquate. Additionally--where is the .plist governing trackpad settings on Ventura?
Comment: Are you trying to prevent accidental clicking? Remember that the trackpad doesn't actually move, it just senses pressure and the 'click' is a sort of illusion.
Comment: No, I just would like it to require a "firmer" click. My thought is that there is probably a .plist somewhere where there is a value like "regular click" and a value representing the force required for a regular click, let's say "light" is 1 and firm is 10, maybe I can just manually change it to 12. My ideal click firmness is somewhere between the force click and regular click amount of firmness...
Answer: You can usually find the .plist file responsible for a given setting by changing the value in System Settings, and then sorting the view of <code>~/Library/Preferences</code> by Modification Date.
(Ideally, sort the view first, then make the change.)
However, having seen some of the code that Apple engineers write, they would undoubtedly range-check the value, and wouldn't provide a hidden 'up to eleven' capability.


Is it possible in vim to create a split view for command line use?

Question: I know about the option :!ls, but I would like to use one of the splitted interface ( after is used :sp) as a command line window. Is this possible? If it is, how do I do it?
Comment: There are plugins and/or patches to accomplish that. But you will sooner or later experience some quirks. My suggestion is to use a full-featured lightweight terminal instead, or screen/tmux.
Comment: vim8 has terminal mode built in.. see here: https://superuser.com/a/1312655/658319
Answer: Vim 8 has terminal mode built in.
You can type :ter to get access to the terminal.
To navigate through the commands in your default shell use j,k.
You can get more information by typing :h ter in VIM8.
Note: your VIM8 must have +terminal for this to work.
Answer: Unlike Emacs, Vim tries to be a bit more minimal when it comes to working with the shell. It does not have an option to include the interactive shell inside one of it's tabs or buffers.
Although there are workarounds for this. Just like you, I really like to have a bash window in the same terminal session as I have Vim running. It is super useful while editing source files. In my case I really like to have the Ruby REPL environment running so I can test out statements before I put them in the source files.
I use Tmux to accomplish the split window. In Tmux I create a split window (default key is ctrl+b, "). This will open 2 interactive shell sessions just like a split window in Vim. Then I run Vim in one of the sessions and I'm all set.
You can see from the picture below that I have split the window horizontally with bash on top and Vim on bottom.

I also use Tmux to support pair programming with others. You can read more about my setup on my blog at http://jjasonclark.com/Remote-Pairing-with-SSH-and-Tmux-on-a-Mac.
Answer: Not sure if you were looking for a GNU screen solution, or a solution using Vim's built-in splits, but if you're looking for the latter, this worked for me:
vim -O file_a.js file_b.js

That a opens both files with a vertical split.  For a regular (horizontal split), just use a lower case -o instead.
P.S. Ctrl+w, w to switch between the two (I find it a good way to differentiate screen splits and vim splits).
Comment: Though this doesn't answer the original question, this answer did answer my google search query that got me here. :)
Answer: Have you tried screen?  Any reason that wouldn't work out for you?
Comment: could you provide details on how to implement the soultion with screen?
Answer: I was looking for this for long and as much as I can say nothing good is really possible. I have tried many plugins/addons for vim but no one worked as I wanted.
This one is good though: ConqueTerm
However it has some inconsistency with colors. Give it a try maybe it works out for you.
Comment: Check this one as well: https://www.youtube.com/watch?v=5__I_cnxmPc&feature=related
Answer: You can use NeoVim, it has a built in terminal mode similar to emacs (although very new) - this lets you have it in a window like any other vim buffer


Install ubuntu 15.04 in a win 8.1 preinstalled machine with uefi

Question: I try to install ubuntu 15.04 in a Win 8.1 machine in uefi mode for dual boot. When I tried, installation stops saying "cannot install grub into sda, fatal error".  and quits installation.
I had created uefi ubuntu 15.04 using rufus from ubuntu amd64.iso. Also booted using USB created using Rufus. But the installation always stops saying the above error. EFI partition is already there. SDA is HDD (500GB).
Answer: First, you should be aware of boot mode issues. The vast majority of systems that shipped with Windows 8 or later boot Windows in EFI/UEFI mode. This configuration makes a BIOS/CSM/legacy-mode install of Ubuntu iffy at best. Unfortunately, a lot of BAD instructions tell people to enable their Compatibility Support Modules (CSMs; aka "legacy mode support" or something similar) as a routine part of installing Linux. This just complicates matters and creates problems, perhaps including the one you encountered. You can check your boot mode in the installer by dropping to a shell and looking for a directory called /sys/firmware/efi. If it's present, you've booted in EFI mode; if not, you've booted in BIOS mode. Be sure you're in EFI mode. (Assuming, of course, that Windows is in EFI mode. If you're not sure, check your partition table type. If it's GPT, Windows is booting in EFI mode. See here for more details.)
Second, it's imperative that you disable the Windows feature called Fast Startup (or various other things), as described here, among other places. This feature turns a shutdown operation into a suspend-to-disk operation, which makes it impossible to safely share partitions between OSes. As EFI boot loaders are stored on a shared FAT partition called the EFI System Partition (ESP), a failure to disable Fast Startup can cause problems when accessing the ESP and therefore a failure to successfully write GRUB. Note that there's a firmware feature that often has a name like "fast boot" that's often confused with the Windows Fast Startup feature. The firmware feature is irrelevant to this discussion. If you've disabled the firmware feature, you must still disable the Windows feature.
Third, more information is needed to fully diagnose the problem. Running the Boot Info Script will gather a lot of data and put it in a file called RESULTS.txt. You can study this file yourself or post it to a pastebin site and post the URL to your document here. We can then study it for clues about what's wrong.
Fourth, as a workaround, you can try using the USB flash drive or CD-R version of my rEFInd boot manager. Prepare the boot medium and boot using it. (You may need to disable Secure Boot if it's enabled.) rEFInd should give you the option to boot either Windows or Ubuntu. If you can boot Ubuntu with rEFInd, you can then work on fixing the boot loader problem. Maybe doing a dosfsck on the ESP would help; or you can run grub-install manually and see what sort of error messages it reports; or you can install rEFInd to your hard disk by using its PPA or Debian package. Depending on the cause, any of these actions, or various others, might help. In the meantime, you can continue using rEFInd on the external medium to boot, rather than re-install or muck about with the Ubuntu live CD, which is more limiting than the full installation.


How do I write a string search query that uses the non-clustered indexing I have in place on the field?

Question: I'm looking to build a query that will use the non-clustered indexing plan on a street address field that is built with a non-clustered index.  The problem I'm having is that if I'm searching for a street address I will most likely be using the 'like' eval function.  I'm thinking that using this function will cause a table scan instead of using the index.  How would I go about writing one in this case?  Is it just pointless to put a non-clustered index on an address3 field?  Thanks in advance.
Answer: If your LIKE expression is doing a start-of-string search (Address LIKE 'Blah%'), I would expect the index to be used, most likely through an index seek.
If you search for Address LIKE '%Blah%', a table scan/index scan will occur, depending on how many fields you return in your query and how selective the index is.
Answer: varchar fields are indexed from left to right, much the same as a dictionary or encyclopedia is indexed.
If you knew what the field started with, (ex. LIKE 'streetname%') then the index would be efficient.  However, if you only know part of the field (ex. LIKE '%something%') then an index cannot be used.
Answer: Using LIKE will not necessarily use a table scan; it may make use of an index, depending on what string you're searching against. (For instance, LIKE 'something%' is generally able to use an index, whereas LIKE '%something' is probably not, although the server may still be able to at least do an index scan in that case, which is more expensive that a straight index lookup, but still cheaper than a full table scan.) There's a good article here that talks about LIKE vs. indexes with respect to SQL Server (different DBMSs will implement it differently, obviously).
Answer: In theory the database will use whatever index is best. What database server are you using, what are you really trying to achieve, and what is your LIKE statement going to be like? For instance, where the wildcard characters are can make a difference to the query plan that is used.
Other possibilities depending on what you want to achieve are performing some pre-processing of the data and having other columns that are useful for your search, or using an indexed view.
Here's some discussion on the use of indexes with SQL Server 2005 and varchar fields.


Center Message box on Any Screen Resolution

Question: Please Help me to center the message box on fit on any screen resolution..
can you show what css or style, margins, left, right,that I can use?
Comment: It is not possible to vertically center content with arbitrary heights using just css.
Comment: I think your only option is going to be javascript. You will need to re position the box if the screen size changes.
Comment: If you can fix the content height, it's possible.
Answer: Center Horizontally
To center a div horizontally you can use margin: auto auto; width: 500px where the width is any width you want it to be.
JS Fiddle
HTML:

    Some content

CSS:
#content {
    width: 200px;
    margin: auto auto;
    background-color: #CCC;
}

Center screen with fixed dimensions
If you can fix the content height and width then it's possible to center the div both horizontally and vertically using just css. This is achieved by wrapping your content in another div, then positioning your content div's top: 50% and then subtracting half the height of it's margin from it: margin-top: -100px, assuming the height was 200px. See example below:
JS Fiddle.
HTML:

        Some content

CSS:
#wrapper {
    position: relative;
    background-color: #EEE;
    width: 200px;
    height: 200px;
    font-size: 10px;
}
#content {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    margin-top: -40px;
    margin-left: -40px;
    background-color: #DDD;
}

Pretend it's vertically centered
Also you can give a fixed margin-top (or top with position: absolute) to make it seem vertically centered in most desktop and laptop screens.
JS Fiddle
HTML:

    Some content

CSS:
#content {
    width: 200px;
    margin: 100px auto;
    background-color: #CCC;
}

Use Javascript
It is not possible to vertically center content with arbitrary height using just css. In this case you will need to use Javascript to position the div.:
The basic idea is:

you calculate the height of the content at the time you need to show the content, or when the content is loaded.
Then change any of the many css properties to position the div at the vertical center.

My personal preference is you to use position: absolute with top property. You can also use margin-top but you probably don't want this div to take up space in the box model if you have other content on the page.
JS Fiddle

    Some content

Use any of the many Javascript "plugins" available
There is a multitude of CSS frameworks around the web that provide boilerplate CSS that we use on most websites. And some of these also help with these kind of common presentation issues with small Javascript plugins. Personally I know that Twitter Bootstrap provides a Modal plugin which you can use for this purpose. There is also many jQuery plugins for the sole purpose of centering content in a page.
Conclusion
Although there is a multitude of options to achieve this, I it sad to see that CSS still does not support doing this. Maybe it's a hard thing to do across different scenarios, I don't know. From the options that I mention above, I think the Javascript option is the most versatile, and with todays browser speeds, and the likeliness that nobody would have Javascript disabled on their browser, this would be the best way to go.
Comment: You forgot the `display: table-cell; vertical-align: middle` method.
Comment: Stupid how you can have gradients and shadows and rounded corners (all which are "fashionable"), but can't do something simple/core like vertical alignment.
Comment: Thanks guys u guys helped me a lot. Keep it up
Answer: I just saw this after reading about how to do one on a CSS Techniques page.
Basically, define a little CSS:
.Absolute-Center {
  margin: auto;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
}

ADVANTAGES:

Cross-browser (including IE8-10)
No special markup, minimal styles
Responsive with percentages and min-/max-
Use one class to center any content

I have not had time to test it out, but I wanted to post it up here in the hope that it helps others.
Answer: Here is what you are searching for http://tutorialzine.com/2010/03/centering-div-vertically-and-horizontally/
You can easily make it with jquery! Or with an css solution given on this site!
Answer: You should give us your code that you have tried. Assume that you have HTML code like below:

   Hello World!

CSS code:
#message {
   width: 100px;
   height: 100px;
   margin: 50px auto;
}

Then your message box will be 100x100 and 50px from the top of the screen and automatically aligns to the center of the screen.


Possible to add a "configuration" page to my custom timer job?

Question: I would like to have a page in the central admin that allows administrators to configure a few values for the my timer job.  Is there a way that I can do this?
Answer: Absolutely, I have done this myself very recently.
You can create an Application Page that sits in the ADMIN directory in the SharePoint Root Folder. You need to add a mapped folder in Visual Studio to do this.
You can then create a Custom Action which will add a link to your application page, within any area and section within Central Administration that you wish.
Here is the tutorial I followed on MSDN for this: http://msdn.microsoft.com/en-us/library/ff798467.aspx
Also, the full reference implementation for a timer job with a config page:
http://msdn.microsoft.com/en-us/library/ff798362.aspx
Comment: +1 as usual, you are the man James.  Any suggestions on how to access that value from the timer job?
Comment: :) I've added a link to my answer which is the tutorial I followed.
Comment: Here's the tutorial for the application page for a timer job: http://msdn.microsoft.com/en-us/library/ff798356.aspx There are links here: http://msdn.microsoft.com/en-us/library/ff798362.aspx for the rest of the reference implementation.


How can I write better fight scenes?

Question: I have a science-fiction story I'm writing and it has a ton of fight scenes in it. However, I'm really bad at writing them. How could I improve?
Comment: Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
Answer: Find novels and read fight scenes, especially ones you like, but read them analytically.
Do not get immersed in the reading. Look for the technicalities. How long or short are the sentences?
Same with the paragraphs. Same with any dialogue.
What descriptions are included, and what is left out?
How much does the description depend on the setting, and how much on the emotions, and how much on the physicality.
Are the moves described in detail, or not?
How long does the whole fight scene last?
How does it begin, before anybody takes a swing?
How does it end?
Dissect the fight scene. As an exercise, try to write a completely different fight scene, but mimicking the writer very closely. Change the genre, to scifi, or the Old West, or Comedy.
But stick closely to the original in word count per sentence, in description, in sentence length and in dialogue.
Reading to learn to write is completely different than reading for the fun of it. We reveal the rules of writing by reading analytically and not allowing our imagination to carry us away, but to understand how great authors engineer their writing so their great writing carries readers away.
All the materials you need to learn are on your bookshelf. Just approach them as an analyst, an archaeologist studying an artifact to understand how it was made, what it was used for, and why, exactly, does it have the shape that it does?

How can I write better fight scenes?


How to Gift iTunes Songs from United States to friend in Vietnam

Question: I have a friend in Vietnam. I tried to gift her an iTunes song, paid for it. She got the email but could not access the song.
How can I send her iTunes music when she is residing in Vietnam? Any suggestions?
Answer: There is a Vietnamese iTunes Store that your friend (or you) can use directly. The only way for you to gift her a song is under one of the following scenarios:

You set up an Apple ID on the Vietnamese store and use that ID to gift her the song
Your friend sets up an Apple ID on the US store and you gift her the song to that ID

Both of the above are possible, but only you and she can decide whether it's worth the effort (while it's not hard to do, it's not exactly convenient). There is also the possibility that what you wanted to gift her is not available on the Vietnamese store.
My recommendation would be to contact Apple directly, probably best via this form, and explain what you wanted to do and ask them for advice about it. It may take them a couple of days to respond, but they will usually come up with a resolution (whether it is a credit on your account or some way of your friend being able to access it).


Should I make up fajr (after missing it due to sleep) again if I'm not sure if I made it up before?

Question: When I woke up I noticed I didn't pray fajr. I'm pretty sure I made it up after I woke up but I'm not 100 percent sure. A few hours later I was in a hurry and prayed my dhuhr and I left. The next day I am starting to doubt whether I made up my fajr or not. Should I disregard the doubt because I'm pretty sure that I made it up, or should I make it up again just in case? (I'm pretty sure I have whispers of shaytan if that helps you answer)
Answer: Salah/prayer must be prayed at the prescribed time :
[Surah-An-Nisa 4:103]

After performing the ritual prayer, continue to remember God- standing,
sitting, and lying on your sides- and once you are safe, keep up regular
prayer, for prayer is obligatory for the believers at prescribed times.

Try to pray on time in that case you will be 100% sure that you prayed Salah/Prayer. If any case you missed Salah/Prayer then you can pray that immediately after remembering it.
These may help you in remembering your prayed Salah/prayer:

You can also download any Salah/Prayer tracker app, there are alot of apps which help you keep track of each salah/prayer

You can make a schedule on a piece of paper for all obligatory prayer and after praying a salah/prayer, just mark it on the schedule
Answer: Unless you are 100% sure you didn't go with the most certain thought. It sounds dumb but maybe take a note of all salahs you pray so your mind is content
Answer: First, any prayer you have missed could be done whenever you remember them as the prophet Mohammad PBUH have told us, and if you have doubts whether you have prayed or not, the best thing to do is to pray what you missed and cut the doubts completely.


Moving entries from one Google Keep list to another

Question: Say I have two lists in Google Keep.  Is there a clean way to move an entry from one list to another?  If neither list is "opened" I can't even select an entry from either one, and if one list is "opened" the other one is inaccessible, so I'm not sure what to do.
Answer: The fastest way is to open one note, copy all its content, then paste it into the other note.
You could open two browser windows side-by-side with the source note in one and the target in the other to make it easier.
Answer: The previous answer is correct:

Open the first note.
Select the desired lines, Copy.
Open the second note.
Select the insertion point, Paste.

As this Google Support thread indicates, dragging between Keep lists is not supported, and Google has no plans to add that feature.
BTW, Google Tasks supports inter-list dragging.
BTW 2, if you need to copy multiple checklist items in Keep, click the dots menu, Hide  Checkboxes. Copy as plain text, then revert to Show Checkboxes.


Span dimension, vector space dimension, spanning set

Question: If the dimension of the span of a subset $X$ is equal to the dimension of the vector space $V$, is $X$ a spanning set of $V$?
Comment: If the dimensions are finite then yes. The reason is that *any* large enough set of linearly independent vectors form a basis.
Answer: In a space $V$ of dimension $n$ the only subspace $X$ of dimension $n$ is $V$ itself. Indeed, if there is a vector $v$ which is not in this subspace then the span of $X\cup \{v\}$ would have dimension greater than the dimension of $V$ which is impossible. Hence $X$ must be equal to $V$.


Do all gene mutations in pathogens lead to more harmful consequences for humans?

Question: It seems that the concern we always hear is that bacteria and viruses mutate to dodge our treatments either through random mutations or survival of the fittest. Do harmful living things ever mutate to become not harmful?
Answer: Mutations are random; the (pathogenic) bacteria (or any living being) will randomly acquire mutations that may be beneficial, deleterious or neutral to its fitness. Only beneficial and neutral mutations will survive the selection. Random mutations and survival of the fittest are not two independent mechanisms. The random mutations can alter the fitness as I mentioned and natural selection ensures the survival of the fittest.
Many pathogens have reduced genome (number of genes) compared to their free living relatives (Weinert and Welch, 2017). This is because they lack most of the genes required for synthesis of different metabolites required for survival. They rather obtain these metabolites from the host and hence they have the parasitic lifestyle. It is not possible for the pathogens to acquire that many genes to stop being pathogenic and become a free-living organism. It may be possible via lateral gene transfer wherein a bacteria may obtain an entire gene (or a set of genes) from another bacteria but the likelihood of that happening to convert a pathogenic bacteria to a non-pathogenic bacteria is negligible.
It is certainly possible that pathogens might lose the activity of some of the pathogenic genes (for example those required for toxin production) due to mutations. However, they may no longer be efficient pathogens and would be outgrown by the others who still retain those genes.
Comment: @John that would perhaps not be that straightforward. It depends on several parameters so making a general statement on that would be risky. AFAIK, there is a post here that exactly addresses that topic.
Comment: Its also worth mentioning pathogens often evolve to be LESS harmful, not killing your host is a good thing, most of the really deadly pathogens are are ones that jumped from a different host species, and have not had a chance to evolve to be less harmful.
Comment: @John it's often even more simple than jumping from different host species. A commensal microbe that finds itself in the wrong niche on the same host can all of a sudden become a big problem. A happy bug in your colon is an unhappy bug in your urethra, for example. Much of infectious disease comes from inconclusive negotiations for symbiosis.


How to run X-Wing Alliance on modern hardware?

Question: I'm trying to play X-Wing Alliance on my Windows XP with Core 2 Quad Q6600 and GeForce 8800GT, but I have to disable all graphics acceleration and I'm still getting major rendering glitches. Did anyone manage to properly configure this game (and/or the system) to run on modern hardware? If not, which virtual machine will most likely support this game?
Answer: You'll probably need to play around with XWA Hacker, from a guy named Reimar.  You can obtain it at the XWA Upgrade forums.  The thread I linked to has to do with graphical glitches, which sounds like what you want.
I believe I had this working a few years ago on my machine, so I think it's possible.
Another path you could take is to try emulating it through DOSBox or virtualizing an older operating system.  One of those should work well for you.
Answer: This may be a little off topic, but yesterday I successfully started X-WING in a MS-DOS 6.22 virtual machine, set up with VMWare Player. At first I tried VirtualBox but EMM386 didn't work properly. With VMWare I had no problem to configure the OS to have enough memory to start the game. I assume X-Wing Alliance would run with VMWare too. Of course you may stumble across other issues than me. Let us know how you did it in the end.
Comment: Yep, most Virtual Machines will help you with running old games, I've used VirtualBox for running SimGolf and Theme Hospital - I think GOG distribute their copy of Theme Hospital with DOSBOX as their method of getting it to run on modern OSes as well...
Comment: This morning I installed and ran XWA on WinXP that was modified to run on Win7. I have no idea what the modification is, but I could play the game without obvious graphics issues. But I don't have such an up-to-date GPU.
Comment: Yes, I'd agree this is off topic. Even though X-Wing might have a lot of value history and story wise, from the perspective of non story random  clashes is largely rendered obsolete by X-Wing Alliance, and so this answer is a little bit noisy here. However the suggestion is fine.


important debian packages auto-removable

Question: I'm in a situation where apt shows 1000+ packages on my system marked as auto-removable. Amongst those are many that I know I need. I've resolved the situation by setting those to manually installed. But that results in almost half the packages in my system showing up as 'manually installed'. I ran into trouble when upgrading my system to the current stable version of Debian (apt-get dist-upgrade), and none of the 'manually installed' packages were upgraded. Again, I resolved the situation by setting all the 'manually installed' packages to automatically installed. That made the upgrade possible. But now all the upgraded, formerly 'manually installed' packages are again auto-removable. I tried finding not installed meta-packages that through their dependencies would at least reduce the auto-removable list. But without success. - Is there no way to get back to a situation where the packages marked as auto-removable are really those I don't need?
Comment: "I ran into trouble when upgrading my system to the current stable version of Debian" Are the auto-removable packages Jessie ---but you have kept Stretch?
Comment: Which command did you run for `apt` to display those packages?  I would like to experiment on my VM...
Comment: arochester: Before the upgrade my autoremovable packages were Jessie. Now they are Stretch.
Comment: Alex: I used the command "manual=$(apt-mark showmanual); apt-mark auto $manual" That is to make all packages that were marked as manually installed to be marked automatically installed. The output of the command apt-mark showmanual, i.e. all the package names, is put into the variable $manual which is then used in the second command. - I hope this is what you were asking.
Answer: Finally I was thinking: what do I do when I install a new system? - Install a minimal system and then add what I need in addition. So I tried this:
aptitude install ~pstandard ~pimportant ~prequired
which should make sure at least a minimal functioning system would not be 'autremoved', containing all packages of priorities Required, Important and Standard.
However the command returned an error code: "Unable to apply some actions, aborting"
Not very informative, but I then replaced the command whith a longer version:
required=$(aptitude search ~prequired -F"%p"); apt-get install $required;
important=$(aptitude search ~pimportant -F"%p"); apt-get install $important;
standard=$(aptitude search ~pstandard -F"%p"); apt-get install $standard;
That also threw a couple of errors which were, however, easily resolved. Then I listed the still autoremovable packages with:
apt-get --dry-run autoremove | grep -Po 'Remv K[^ ]+' | sort > autoremovable.txt
one name per line and found & additionally installed those I knew I needed. Having done that there were still 757 packages in my 'autoremovable' list. Those I then removed with
apt-get autoremove
Then I rebooted and the system came back up fine.
Answer: Possibly you are misunderstanding "auto-removable". If a packet is installed automatically as a dependency of other packages, it is marked as "automatically installed" or "auto-removable" (as opposed to "manually installed").
This only means that if all other packages that need a particular are removed, then this automatically installed package is considered as a candidate for auto-removal, which you have to do explicitly. It does not mean that these packages are somehow in danger of being removed while they are still needed.
On the other hand, marking a package as "manual" means "the user has explicitly chosen to install this package, with this particular version, and the user is responsible for upgrading it".
So the usual way to handle things is to install those packages you need (which will mark them "manual"), upgrade them manually or let them semi-manually upgrade with dist-upgrade, and let the library packages etc. be marked as "auto", so the package system can remove those at will, and re-install variants or different versions as needed.
TL;DR: Don't worry about auto-removable packages, keep them that way.
Comment: dirkt: "It will be marked "auto", and get auto-removed the next time you "take out the trash" when the package that used it is removed in the future." - That is exactly what is NOT working. If I do that I remove, as I said, 1000+ packages from my system, amongst them many that I do need.
Comment: You may be right that I'm worrying too much. And I know that my autoremovable packages are not in danger, at least as long as I don't type "apt-get autoremove" and hit return twice in a state of somnambulism (as I once did). My point is that I formerly used apt-get autoremove to 'take out the trash', typically to get rid of libraries that are no longer needed etc.. Now I don't know how to identify the 'trash' any more.
Comment: You identify it the same way as before: Do you need a library because you want to develop against it? Install it explicitely, it gets marked "manual", it won't get auto-removed. You only installed a package because it was a dependency of some other package? It will be marked "auto", and get auto-removed the next time you "take out the trash" when the package that used it is removed in the future. So, nothing has changed.


Some issues trying to read a file with cbc.read.table function in R + using filter while reading files

Question: a)I'm trying to read a relatively big .txt file with the function cbc.read.table from the colbycol package in R. According to what I've been reading this package makes job easier when we have large files (more than a GB to be read in R) and we don't need all of the columns/variables for our analysis. Also, I read that the function cbc.read.table could support the same read.table's parameters. However, if I pass the parameter nrows (in order to get a preview of my file in R) I get the following error:
#My line code. I'm just reading columns 5,6,7,8 out of 27
i.can <- cbc.read.table( "xxx.txt", header = T, sep = "\t",just.read=5:8, nrows=20)
#error message
Error in read.table(file, nrows = 50, sep = sep, header = header, ...) :
formal argument "nrows" matched by multiple actual arguments

So, my question is: could you tell me how can I solve this problem?
b) After that, I tried to read all instances with the following code:
i.can.b <- cbc.read.table( "xxx.txt", header = T, sep = "\t",just.read=4:8) #done perfectly
my.df <- as.data.frame(i.can.b) #getting error in this line
Error in readSingleKey(con, map, key) : unable to obtain value for key 'Company' #Company is a string column in my data set

So, my question is again: How can I solve this?
c) Do you know a way in which I can filter (by conditions on instances) while reading files?
Answer: If you want a preview, then just use read.table with nrow=20 and the colClasses argument set to read your columns.


Subversion: How to export changed, modified, and deleted files my local copy?

Question: I want to migrate changes made on a local copy on a development machine to a local copy on a production machine. What's the best way to export changes from my local copy?
Comment: What is "local copy"? Subversion doesn't have such objects. If you want to get correct answer, you **have to use** standard terminology
Answer: The way I would do this would be to commit the changes on the development machine to the repository, then update the production machine checkout. That ensures that everything is logged and updated properly.
However, I presume that isn't a desirable option for your situation (or you didn't do a checkout from the repository on your production server), so the easiest way would be to export your development machine checkout, then overwrite the production machine copy. If you don't delete the production copy, then only the files in your development export will overwrite, and you'll keep any production-specific files you may have (logfiles, etc.).
A slightly less-risky option (and the one I'd do, for safety's sake) would be to copy just those files that have been modified in the development checkout, and overwrite their counterparts in the production copy. This is much more manual (unless you write a script to automate the copy-into-production), but you're guaranteed not to overwrite anything you didn't intend to on the production copy.
I've done all three methods before, and I honestly prefer the first one for simplicity, reversibility, and logging. If something is wrong, I can immediately revert back to the last stable copy, and it's extremely easy to check what version of the codebase the production is using.
Answer: If "local copy" have to be translated as "Working Copy" and these WC linked to the same Repository and URL in repo, you can

Commit changes from DEV WC
Update WC on PROD side

PS - if you don't want commit scrap to trunk, you can relocate to any other location inside repo before commit, and relocate PROD WC before update
Answer: Here's a rather heavy weight, buy effective approach. If it feasible to have both directories accessible from the same machine, e.g. as Windows shares or as temporary mounts, use a tool such as WinMerge or Meld to find out what the differences are and to choose which files to copy over.
Otherwise export the revision that's on your production machine to an empty directory on the development machine; use the same tool to remove common files in the exported source tree and to copy your changes to it. At this point your export directory will contain the files you want to copy to the production machine.


Can nitrogens in urea be protonated?

Question:
Is it possible in very acidic solutions for the nitrogens ($\ce{N}$) to get another $\ce{H+}$, making it $\ce{R-NH2+-R}$? Since it has a free electron pair, it might be possible right? If so, at which pH?
Answer: Reagents/solutions that are acidic enough will protonate the urea group, just not where you think. The most basic site is the oxygen. Perhaps this is a surprise.
The lone pairs on the nitrogen atoms are delocalized (see resonance depiction below).

The oxygen atom has the most electron density. Below is an electron density map, where ${\mathrm{\color{red}{red}}}$ represents areas of high electron density and $\mathrm{\color{blue}{blue}}$ represents areas of low electron density. You can see the area around the oxygen atom is red and yellow, while the areas around the nitrogen atoms are green.

This image is from "The effect of intermolecular hydrogen bonding on the planarity of amides" by James A. Platts, et al. published in Phys. Chem. Chem. Phys., volume 2012, issue 14, page number 11944-11952, DOI:10.1039/C2CP41716B. The image is copyright the Royal Society of Chemistry and released under a Creative Commons Attribution 3.0 Unported license.
Protonating the oxygen atom leads to a cation where the positive charge is delocalized (better, more stable).

Protonating one of the nitrogen atoms leads to a cation where the positive charge is localized (worse, less stable).
Comment: @4C0G about pH=0. "the equilibrium constant of urea monoprotonation can be given
a value of 1.93 with an uncertainty of about 5%." http://pubs.acs.org/doi/abs/10.1021/j100135a013
Answer: Well, yes but no. The nitrogen's lone pair is in resonance with the $\ce{C=O}$ π bond. They form a π system not unlike the allyl anion. This is usually depicted for the amide case, but there are no significant differences in the urea case.

Instead, the oxygen has an accesable lone pair perpendicular to the π system, so it is typically protonated first. This happens at low pH values; you typically need sulphuric acid or hydrochloric acid to get quantitive protonation.

Can nitrogens in urea be protonated?


How to implement covariate balancing propensity score?

Question: I'm using the CBPS package in R to calculate covariate balancing propensity scores following Imai and Ratkovic 2014. However, I'm a bit confused. The scores that I get from the CBPS package -- are those both weights and propensity scores or just weights? Do I use those scores to weight my covariates only or do I match on closest scores and then weight my covariates?
Answer: The CBPS object that is the output of a call to CBPS() contains both $fitted.values, which are the estimated propensity scores, and $weights, which are the estimated weights. You can match on the estimated propensity scores or perform some kind of weighting (e.g., IPW for the ATE, weighting by the odds for the ATT) using the propensity scores or the weights. In theory, calculating weights from the estimated propensity scores yourself should yield the same weights that are supplied by CBPS() using the corresponding formula, but I've encountered some issues where this is not true, and so I trust the estimated propensity scores more.
Glad to see this package being used! I find it vastly outperforms twang and is much faster. If you want to check balance on your covariates, I recommend the cobalt package, which has methods for CBPS objects.
Comment: Thanks for the reply. When doing IPW, do you use the weights (`$weights`) or propensity scores (`$fitted.values`)?
Comment: It really shouldn't matter. If you're estimating the ATT, try `with(cbps.out, all.equal(weights, ifelse(treat == 1, 1, fitted.values/(1-fitted.vales))`. If `TRUE`, it doesn't matter whether you use the produced weights or manually create weights with the propensity scores. (`cbps.out` is the output of a call to `CBPS()`, and `treat` is your treatment variable.)
Answer: You should decide first if you want to use matching or weighting. the command of $fiited.values will provide you the propensity scores but you can also get weights by using $weights. However, you should keep in mind that you cannot get ATT in case of multiple treatments. CBPS package currently only provides ATE for multiple treatment and ATT is only available in case of binary treatments.
Comment: Before that, figure out why covariate adjustment is not adequate, ignoring the propensity score.


QGIS Python Intro Text

Question: After reading replies regarding starting a mapping business, I think I'd better read a Python book.  Any intro-level Python books to recommend?
Mila
Comment: The title and question text sound like two different questions: 1) intro into python for QGIS, 2) beginner-level general python. Which one are you looking for?
Answer: I would strongly recommend "Python Geospatial Development" by Erik Westra (published by Packt).  It covers GDAL/OGR, Shapely, connecting to PostGIS and even an intro to GeoDjango among other things.  Specifically, this book is aimed at using Python for GIS as the name suggests and will possibly be more immediately relevant than a generic Python book (at least to start with).
I would also highly recommend the free on-line tutorial series called Geoprocessing with Python Using Opensource GIS.  It is a little old but nonetheless very good.
Python is an excellent language for scripting and making stuff work in the FOSS4G world and you will get quick results from your learning/coding effort.  However, if you are wanting to get into programming and hope that your consultancy will pick up programming-related work, you may want to consider C# or some other .NET language, as there doesn't seem to be much call commercially for Python scripters (despite it being used so much in day-to-day geoprocessing).
Answer: The Dive into Python book is free online, and it's a very good reference. If you want to buy one, I would recommend Beginning Python by Magnus Lie Hetland.
There are tons of libraries out there for working with spatial data in Python, but a nice starting point is Chris Garrard's online Python programming class.
Answer: I started with "Learning Python the Hard Way", available in printe, pdf (very cheap) or online (free). It's example based so I thought it's was easier to go through it.
I went to Python Geospatial Development after.

QGIS Python Intro Text


How to set Project Priority using VBA

Question: I'm writing a macro (in VBA) for Project 2010 and one of the things I'd like to accomplish is setting the Project Priority.
I've looked around MSDN but can't seem to find any information regarding this - no property, method or object that allows me to do this. Am I overlooking something, or is there really no way to edit the Project Priority?
Answer: The Project priority field for some reason doesn't show in the Object Browser or in the Intellisense, but if you look through a Project object while debugging, you'll see it, and you can set it with this code:
<code>Dim proj As Project
Set proj = Application.ActiveProject
proj.Priority = 100
</code>
Tested in Project 2010 64-bit, and the updated priority appears in the Project -> Project Information -> Priority field in the UI.

How to set Project Priority using VBA


J2 or B Visa for Postdoc's spouse

Question: My spouse and I are both recent PhDs. Spouse has got a post-doc position in the US and will be applying for a J1 visa. I expect to get a post-doc (also in the US) only a few months down the line.
Now, I am considering two approaches:

Apply for a J2 dependent visa, then apply for J1 when I get the post-doc position.
Use my existing, valid (multiple-entry) B1/B2 visa to travel to the US, then apply for a J1 when I get the post-doc position.

What are the pros and cons of either approach? Are there rules for 'conversion'/tranfer from from J2 to J1 or B to J1? Does either require travelling back to, and applying from the home country?
PS: Although this seems to be a Travel.SE question, I ask here because it pertains to the J visa which is specific to academia.
PS2: We're both Indian citizens.
Comment: It could also be an Expatriates.SE question, because you want to switch to a long-term (over 6 months) visa.
Answer:
Are there rules for 'conversion'/transfer from from J2 to J1 or B to J1? Does either require travelling back to, and applying from the home country?

There are no particular rules. When you apply for J1, you need to go out of the US, not necessary India, e.g. Canada.
Advantages of J2 over B1/B2:

You can work. However, in order to do so, you need to obtain a work permit (EAD) first, and this process often takes 3 months.
Staying time in the US is longer. You are dependent of your spouse, you can stay in the US as long as him/her (indicated in your DS-2019), even after your J2 visa is expired.

On the other hand, you have to leave the US before the day your B1/B2 is expired.
This may be a disadvantage for you on a J2 visa: it is required by the law that J2 dependent needs to be covered by a health insurance that satisfies some requirements (please google yourself since I do not remember all the details). If you buy it independently, it can cost thousand(s) per month. While you can have cheaper health insurance from your university after you start your post-doc.
Your spouse's university may also have health insurance for partner, but it may require you to buy the whole year as your spouse, etc.
B1/B2 doesn't need a heath insurance. However, if you are unlucky to get sick/injured in the US, it is not uncommon at all that one day in the hospital (in particular in the emergency room) can cost you more than 10 thousands or more.

J2 or B Visa for Postdoc's spouse


One point compactification of the tangent bundle

Question: Is there a smooth variety $X$ which is a one point compactification of the tangent bundle of $\mathbb P^1$?
Comment: No. Consider $SO(3) \cong T^1(S^2) \subset X$. This splits $X$ into two pieces. The piece containing infinity is homeomorphic to the one-point compactification of $SO(3) \times [0,\infty)$, also known as the cone on $SO(3)$. This space is not even a manifold, which it would be if $X$ were smooth.
Answer: Did you mean $P^1({\mathbb C})$?
Then, no, because it would a smooth rational projective surface, and we know all of them: blow-ups of $P^2$ or $n$-th Hirzebruch surface.
Comment: This is a bit nonaccurate --- there are other smooth rational surfaces, obtained by blowups. But a smooth one-point compactification would also have Picard group of rank 1, and this property leaves only one possibility --- $\mathbb{P}^2$,
Comment: Right! I forgot blow-ups...
Answer: No, there is not; one way to see this is from an alternative description of the 1 point compactification $T \mathbb{P}^1 \cup \{\infty\}$.
Notation/convention: For a locally free sheaf $\mathcal{F}$ on a variety $X$, the associated geometric vector bundle is $V(\mathcal{F}) := \mathrm{Spec}_X \mathrm{Sym}^* \mathcal{F}^\vee$.
Claim: $T \mathbb{P}^1 \cup \{\infty\}$ is isomorphic to the cone over a conic $C \subset \mathbb{P}^2$. Explicitly, $T \mathbb{P}^1 \cup \{\infty\} \simeq V(xy - z^2) \subset \mathbb{P}_{xyzw}^3$ (which is singular at the vertex $[0, 0, 0, 1]$).
Step 1: $T \mathbb{P}^1 \simeq V(\mathcal{O}(2))$. Since $T \mathbb{P}^1$ is a line bundle on $\mathbb{P}^1$ it must be $\mathcal{O}(d)$ for some $d$. To compute $d =2$ one can use the Euler sequence
$$
0 \to \mathcal{O} \to \mathcal{O}(1)^{\oplus 2} \to \mathcal{T} \mathbb{P}^1 \to 0
$$
Step 2: In general, if $X \subset \mathbb{P}^n$ is a projective variety, and $C(X) \subset \mathbb{P}^{n+1}$ is the projective cone over $X$ with vertex $v = [0, \dots, 0, 1]$, then $C(X) \setminus \{ v \} \simeq V(\mathcal{O}_X (1))$.
When $X = \mathbb{P}^n$ itself the isomorphism can be described geometrically as follows: over a point $L \in \mathbb{P}^n$ corresponding to a line $L \subset \mathbb{C}^{n+1}$, the fiber of $V(\mathcal{O}(1))$ is the space of linear functionals $\lambda: L \to \mathbb{C}$. For each such $\lambda$ we get an embedding $\iota_L \times \lambda: L \to \mathbb{C}^{n+2}$ (here $\iota_L : L \to \mathbb{C}^{n+1}$ is the inclusion). So, we obtain a morphism $\varphi: V(\mathcal{O}(1)) \to \mathbb{P}^{n+1}$ sending $(L, \lambda) \mapsto \mathrm{im}(\iota_L \times \lambda)$. One can check that $\mathrm{im} \varphi = \mathbb{P}^{n+1} \setminus \{ [0, \dots, 0, 1] \} $.
Step 3: Now apply step 2 to a conic $C \subset \mathbb{P}^2$. Since $C$ is the image of the 2nd Veronese (a.k.a. 2-uple) $\mathbb{P}^1 \to \mathbb{P}^2$ coming from the complete linear system of $\mathcal{O}_{\mathbb{P}^1}(2)$, under the isomorphism $\mathbb{P}^1 \simeq C$ we have $\mathcal{O}_C (1) \simeq \mathcal{O}_{\mathbb{P}^1}(2)$.


Smtp can't send mail Message get successful but mail not getting?

Question: I havn't get mail but message comes succesfully. please help me from smtp. And also i have use in HTMl mailing in template.
Answer: If Joomla receives a code associated with a successful delivery, then it was delivered.
If it does not reach the target, then there is something wrong in mailing configuration.


CentOS 7 linux-firmware - how to trim it?

Question: CentOS 7 has merged a number of firmware packages into 'linux-firmware' and made these a dependency of kernels.  Is there an easy way to create a stripped down version of this, removing those firmware packages that I know I don't need because I never installed them for CentOS 6 on the same platforms?
Answer: First it is worth mentioning that the linux-firmware source RPM in the source for a number of RPMs, one of which is linux-firmware plus some other (typically WiFi related) firmware files.  It looks like the mechanism that is used to split the source files between the different RPMs can be used to trim linux-firmware further, if you are careful.
The process looks like it should be this:

Download the linux-firmware source RPM and install it
Copy the SPEC file, update the version (add a prefix) so that you can distinguish your version from the original and save as a new SPEC file.
Copy the existing %package -n and %file -n code to create a new sub-package (let's call it unwanted-firmware)
In the SOURCE directory, untar the source files so that you can see what source you will/not want
Identify all unwanted source (for example I know there are no WiFi cards or Radeon video cards in the hardware I'm using) and add the appropriate files to the list of files for unwanted-firmware
When done, rebuild linux-firmware, remembering to use the updated SPEC file.

You should end up with your smaller, custom linux-firmware RPM, a new unwanted-firmware RPM and the other additional firmware files that linux-firmware creates.
You will want to thoroughly test your new system and check logs etc for broken firmware; if you find some then you might need to tweak your unwanted-firmware file list.
Comment: There's a nasty gotcha. The SPEC file has code to trim the 'everything' list of files down to remove those placed into other firmware files.  This code does not seem to work properly for %dir lists so my initial attempt has created an `unwanted-firmware` RPM but the files inside are still in the `linux-firmware` RPM too :-(.
Comment: In the SPEC file, about line 295, you will find this:
`sed -i -e '/^iwlwifi/d' linux-firmware.files` (split over two lines)
Look carefully because this is trimming files from the iwlwifi directory!  You want to add your extra directories here and also be careful because some directory names clash with files that you might also want to trim.  But there is plenty of fat to trim here if you need to.


OpenDS: Which attribute tells that an account was locked due to password expiration

Question: I have requirement to show status (locked or unlocked ) of all accounts in OpenDS 2.2.
I have come to know that pwdAccountLockedTime is present if account gets locked due to too many unsuccessful attempts. So by checking this attribute, I am able to pick account locked due to this reason.
Now I need to identify accounts which were locked due to password expiration. Is there any attribute which tells this?
I need to retrieve this attribute in my java client application.
Any help in this regards would be greatly appreciated.
P.S. - I have checked other threads and forums but none of the solutions given seem to be working - like checking pwdLockedTime (I could not find this attribute).
Answer: You can check the status of an account and get details of locked account using the manage-account utility.
When the password has expired, there is no marker that it's locked. The server uses the pwdChangedTime and the currentTime to see if the difference exceeds the expiration time.
Kind regards,
Ludovic.


Is this sentence grammatically wrong?

Question: I would have never done that.
Someone told me that ONLY "I would never have done that" is correct.
I always heard both and read both.
If it is not correct could you please tell me why?
Comment: Sergio, to me they are different. The former implies you have really done something that you didn't want and the latter seems refer to something that you wouldn't do and wont do.
Comment: @Carlo_R This makes sense to me.  I think you should make it an answer.
Comment: @Zibbo bz, thank you, but after John Lawler responded I think there is nothing to add.
Answer: It's not so much that it's not "correct". Correct English is a myth that English teachers spread.
It's unusual, though, because the usual rule for negative placement requires that the negative go after the first auxiliary verb.  The first auxiliary verb in this sentence is would, so it's normal to say

I would never have done that.

However, although would /wʊd/ is the first auxiliary verb, it's contracted with the following auxiliary verb have /hæv/ in speech, to form a complex auxiliary would've /'wʊdə(v)/; the final /v/ is usually dropped, especially before a consonant.
Some people may interpret would've as a single auxiliary verb -- especially since it works as a semantic union, referring to a judgement of past likelihood. If so, then they can use it as the First Auxiliary Verb within the meaning of the usual rule, and put a negative after that.

I would've never done that. (/'wʊdə'nɛvər/)
this would always be contracted in speech,
but in spelling, many people avoid contractions,
even though they would read it aloud that way.
I would have never done that. (pronounced as above)

Some can even recontract that negative; I've heard native speakers say

I would'ven't done that.  /(/'wʊdəvən'dənðæt/)
instead of the more normal
I wouldn't've done that. /(/'wʊdənə'dənðæt/)

So, it's not wrong, it's just a different interpretation.
Let this be a lesson about the value of others' judgements on "correctness".

Is this sentence grammatically wrong?


Non-EU family member traveling to Schengen countries?

Question: I am non-EU family member married to a Romanian citizen. I am currently residing in Romania and I have temporary residence card here. As Romania is in EU but not in Schengen area, can we travel together visa-free within EU and Schengen countries ?
Comment: You are covered by the EU freedom of movement as the spouse of an EU citizen, just like the spouse of any other EU citizen. Until 2014, there used to be restrictions for Romanians and Bulgarians but not anymore. Whether that means you can travel visa-free or merely have access to easier visas depends on your specific situation (and especially whether you are a resident of Romania, another EU country or not in the EU at all), like it does for all EU citizens. You should add these details to the question or look up earlier questions on this site to find out.
Comment: I edited my answer after you accepted it, so I am concerned that you may not notice an important fact: your residence card is not necessarily (and in fact probably isn't) an article 10 card.
Comment: @phoog this question is not a duplicate of the one mentioned as in that question the person in question is living in a country different to his own and therefore subject to local laws not treaty laws.
Answer: You can travel visa-free only if you have a "residence card of a family member of a union citizen" issued under article 10 of the free movement directive (or if you are a citizen of a country whose nationals don't require visas in the Schengen area).  A residence card issued by Romania to the spouse of a Romanian citizen is not necessarily an article 10 card.
If you do not have an article 10 card, EU countries other than Romania must issue you a visa free of charge and on the basis of an expedited procedure. The grounds for refusal of that visa are strictly limited.
These provisions are also dependent on your traveling with or joining your spouse.  In case you are not, you'll need a regular Schengen visa.
As Relaxed pointed out in a comment, it appears that your concern stems in part from the fact that Romania is not yet a full participant in the Schengen agreement.  These rules apply to all EU countries, not just Schengen countries, because they are based on the EU right of freedom of movement.  Your situation in the Schengen area is therefore similar to that of someone married to a British or Irish citizen.
Your Romanian spouse can, of course, travel visa-free in the entire European Union.
Comment: @Relaxed thanks. I had also forgotten to mention that the right of free movement extends only to family who accompany or join the EU national, animportant condition.
Comment: +1, excellent summary! Maybe add a sentence to stress that Romanians are fully covered by the EU freedom of movement, on a par with other EU citizens and that the difficulties with the membership to the Schengen area do not affect that (I am guessing that's what had the OP concerned)?


Unit testing classes through other test classes

Question: Suppose I am using TDD to create some class A. After I am done and have a "green" bar, I decide that I want to extract some class B with only static methods from class A using some refactoring tool. I now have class A and class B both fully unit tested, but only through the test class for class A. Should I also now create a test class specific to functionality of class B, even though that would be duplicating test?
Comment: Duplicate to: http://stackoverflow.com/questions/21482602/should-i-write-tests-for-class-a-if-its-covered-from-class-b/21482748#21482748
Answer: As always, it depends on your context. What do you care about?
Overall behaviour
If you're building a system for internal use, or even a public (web) service, where the software you're shipping is the entire system, you don't have to care too much about a single class. If you're building a system, then test the system.
As long as it's covered by tests, you know that your system behaves correctly. However, you may run into a situation that after some months, you realize that you no longer need the original A class, so you delete it and its corresponding unit tests. This may cause test coverage of B to drop, so it may be a good idea to keep an eye on code coverage trends.
Unit behaviour
If you're building a (class) library, or framework, you're shipping each public class as part of the product. If you have multiple users of your library, you'll need to start thinking about how to avoid breaking changes.
One of the most effective ways to avoid breaking changes is to cover each class by unit tests. As long as you don't change the tests, you know that breaking changes are unlikely if all tests are green. However, that requires that you test all your public classes and members.
Thus, if you extract B to a public class, it's now a class that other consumers may depend on, and it would be a breaking change if you change it. Therefore, you should cover it with new tests. If you're building a unit, then test the unit.
Comment: I certainly didn't intend to be harsh, just giving and object oriented comment to an oop tagged question. I didn't pick on extracting classes in general, just classes like B. I'm pretty certain its name is going to be something lika AHelper, and we don't want that, do we?
Anyway, you're damn right it would be better if it was written as functional modules in F#! :)
Comment: I addition to Marks answer I would like to add that creating such a class as B is a code smell to me. It doesn't have to be that way of course, but chances are that its purpose will be unclear, and probably is in violation of the SOLID principles. If you find yourself having problems naming the class, that's probably the case.
Comment: @spacedoom Isn't that a bit harsh? Extracting a class from another class can be a perfectly valid Refactoring. The fact that in this case it's static may be a code smell, but since I know that you're an F# fan, perhaps a static class is just a functional module waiting to materialize. However, SOLID it isn't, I agree with that :)
Answer: From what you have described the answer is to create another new test.  If either changes by you (or someone else who is not familiar with the "shared test") the other class will in no longer be tested.
If this seems wasteful, put the common test code in a third class...


What's the block cipher mode of my PEM certificate?

Question: How can I find out the mode block cipher used in a PEM certificate I have?
It's been generated with an intermediate CA that does sha256WithRSAEncryption but I need to find out if it's a GCM or CBC to properly configure some devices.
Answer: Certificates only contain public keys for an asymmetric algorithm such as RSA or ECC. They do not contain symmetric keys, which is what operates using block ciphers in the various modes.
Symmetric keys are established during the SSL handshake, and are based on the list of ciphers presented by the server and negotiated with the client at the time the connection is made. The mode of operation is defined as part of each listed cipher.
To assert your clients can use CBC or GCM, you will need to go to your server's configuration and ensure those algorithms are on the list of valid ciphers. You don't have to worry about including extra ciphers because your clients will not negotiate to use an algorithm they don't support.
(You may want to remove algorithms from the list for other reasons. You probably don't want to support using weak algorithms or very short keys, for example.)
Comment: Partial exception: if the algorithmidentifier for the key in the cert is RSASSA-PSS it can only be used with TLS1.3, and TLS1.3 supports only AEAD ciphers: yes to GCM CCM and ChaCha/Poly (which is a stream not block cipher), no to CBC.
Comment: @dave_thompson_085 if the clients 'require CBC', they almost certainly don't support ChaCha. Won't hurt to have it in the server's list, but the "properly configure some devices" means it probably won't apply to them.


Outposts vs new cities in Fallen Enchantress

Question: What's a point of building outposts instead of cities? It seems there is no penalty for having a lot of cities, so why waste pioneer on an outpost?
Answer: You can only found cities in certain places on the map. You can build an outpost anywhere, giving you a lot of flexibility because it expands your borders.  It allows you to "seize" distant resources (which go to the city nearest to the outpost in question -- you can check which city receives the benefit by clicking on the outpost)
Additionally, you can do some nifty upgrades on outposts, suppressing random monsters within the boarders and speeding up the movement of your units (among other things).  Outposts have a specific strategic use in FE.  They're not intended to replace cities; when correctly used they complement and bolster your cities.
Comment: Also, one of the possible upgrades for an outpost gives +1 growth to the city it's tied to -- and if you build a new city that's closer to the outpost than the original city, the boost gets shifted to the new city. So that's a good way to jumpstart growth in a new city as well as a way to claim territory/resources before your rivals get to them.
Comment: It look like there is minimum 5 tiles between cities. So you cant build closer.


How to install Android voip by using jingle with webrtc?

Question: I have installed gclient and get jingle code.
I followed this link(https://github.com/lukeweber/webrtc-jingle-client)

tools/badit_android.py --->success
second step mvn install was stoped after this line.was this ending? still have any?
<code>[INFO] /home/liv/VOIP/VOIP-android/android-ndk-r8d-lin/ndk-build [-C, /home/liv/VOIP/VOIP-android/kumar/trunk/android/voice-client-native, NDK_APPLICATION_MK=jni/default_debug.mk, -j, 2, NDK_APP_OUT=/home/liv/VOIP/VOIP-android/kumar/trunk/android/voice-client-native/obj/default_debug, all]
</code>
run this command:
<code>build/android/gdb_apk -p com.tuenti.voice.example -s VoiceClientService -l android/voice-client-native/obj/${build_profile}/local/${app_abi}
</code>
got error message:

Debug package com.tuenti.voice.example
  Assume native shared library is under android/voice-client-native/obj//local/
  No com.tuenti.voice.example running?
  Try this: adb shell am start -a android.intent.action.VIEW  -n com.tuenti.voice.example/.SomethingActivity (Something might be ContentShell)

*)run try this command got error this error:

Starting: Intent { act=android.intent.action.VIEW cmp=com.liv.network/.LoginActivity }

really i dont know what will i do for run this project? really this readme file is very difficult to see and run.
what is the procedure for xmpp jingle voip enable for my project.why i do this step? i dont know get the reason.Please help me
send the link for any sample project using jinglelib for voip
Answer: try this http://www.youtube.com/watch?v=f0NU-E8l_qQ
I am also trying it out, but get stuck after building successfully and then fail to find the 'libs' folder/directory.
Comment: I've also tried this link and failed to find 'libs' folder.


Can a logo using licensed fonts be trademarked?

Question: I made a logo using fonts with a free license for commercial use, my clients wants to trademark the logo. Can he do it? My concern is that even with the license, the creator of the font still own the copyright, and I am not sure if you can trademark a graphic that includes a copyrighted item. He asked me to sign a document call "assignment" where it states that is all my original artwork (which is BUT the fonts) and I want to make sure everything is clear and legal.
Comment: I'm voting to close this question as off-topic because it's a legal question, and not a graphic design question.
Comment: Sounds like a legal question. For a lawyer.
Comment: The questions is more about the trademark (using  fonts) than the document :)
Answer: Depends

Trademarks, design patents and copyrights
There are three types of protection that can be afforded to typefaces
and fonts in addition to basic license agreements: trademark, design
patent and copyright. These are intended to keep non-licensees from
copying the fonts in some way and passing them off as original
material. They each have implications for the computer support person.
The Trademark system is the weakest form of protection, allowing only
the font name itself to be protected. Hermann Zapf's popular typeface
PalatinoTM is arguably the most copied typeface in the world. Many
companies made their own identical versions of it (including the Book
Antiqua distributed in the past by Microsoft), but had to change the
name. This means that no one is allowed to use a currently existing
typeface name for a new font, even if the fonts are completely
unrelated.
The Design Patent system is the strongest, but most uncommon type of
protection. The designation is relatively rare because of the cost and
effort involved, but is powerful. It is the only US legal precedent
that protects the actual design - the individual shapes of the letters
in a font. The Lucida font family (designed by Bigelow and Holmes)
were some of the first digital fonts to be given a patent. If a
designer were to copy them, even by redrawing them from scratch using
pencil and paper, he would be in serious legal trouble.
The Copyright system is the most commonly used type of protection, but
has also been the most vague and difficult to enforce. There is no
explicit protection for fonts or typeface designs in US copyright law.
Hence, fonts have, until recently, fallen between the cracks in the
justice system.
http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=UNESCO_Font_Lic

I grabbed the following from this lawsuit:

The names of particular fonts may be protected by a
trademark. This is the weakest form of protection because only the
font name itself is being protected. For example, the letters that
make up the trademarked font Palatino can be copied but the name must
be changed.
URW++ was involved in a 1995 lawsuit with Monotype Corporation for
cloning their fonts and naming them with a name starting with the same
three letters. As typeface shapes themselves cannot be copyrighted in
the United States, the lawsuit centered on trademark infringement. A
US court decided that Monotype's trademarks were "fanciful" and did
not have descriptive value of the actual products. However it also
decided that URW was confusing the public deliberately because "the
purloining of the first part of a well-known trademark and the
appending of it to a worthless suffix is a method of trademark
poaching long condemned by the courts." The court issued an injunction
preventing URW from using their chosen names.

and one more example from the same source

In 21 January 2016,[17] Font Brothers filed a lawsuit against Hasbro,
claiming that Hasbro used the "Generation B" font for its My Little
Pony product without permission. Font Brothers claimed that Hasbro had
refused to comply with their licensing request. They are also claiming
substantial damages, from loss of revenue for this misuse, and
requesting a jury trial to resolve this matter.[18]
https://en.wikipedia.org/wiki/Intellectual_property_protection_of_typefaces#Trademarks

Sorry in advance for wikipedia
Comment: I'm not a lawyer. These are just some starting points for you to do your own research.


Fiber Channel adapter statistics Linux

Question: Anyone know how to get Fiber Channel adapter performance statistics out of Linux? I.E throughput.
Answer: You can treat it like normal I/O device and collect information using iostat during high I/O/. You can also use tools like iozone.
Answer: You could look at the files in /sys/class/fc_host/hostX/statistics (where X is the number of your HBA), computing a rate from the absolute numbers.
The number are in hex (0x...) for some obscure reason. This works for Emulex (lpfc) and Brocade (bfa) HBAs at least.

Fiber Channel adapter statistics Linux


Why the "Diverse Ion Effect" increases Ksp?

Question: I've read in chemwiki about the diverse ion effect. Assuming I have an aqueous solution of $\ce{NaCl}$ and an associated $K_\mathrm{sp}$. If I add $\ce{KI}$ there is an associated $K_\mathrm{sp}'$ for $\ce{NaCl}$ where $K_\mathrm{sp}' > K_\mathrm{sp}$. This actually means that I can dissolve more $\ce{NaCl}$ than I could before. Why does this happen? Shoudln't the new solution actually be closer to saturation and $K_\mathrm{sp}' < K_\mathrm{sp}$?
Answer: To illustrate the "diverse ion effect", we will study how the solubility of $\ce{AgCl}$ changes in absence and presence of $\ce{NaNO3}$, given that the molar solubility product of $\ce{AgCl}$ is $1.76 \times 10^{-10}$.
The exact definition of the solubility constant is: $$K_{sp}= a(\ce{Ag+}).a(\ce{Cl-})=[\ce{Ag+}].\gamma(\ce{Ag+}).[\ce{Cl-}].\gamma(\ce{Cl-})$$
Where $a(\ce{Ag+})$ and  $a(\ce{Cl-})$ are the activities of these ions, and $\gamma(\ce{Ag+})$ and $\gamma(\ce{Cl-})$

In dilute solutions, i.e. absence of $\ce{NaNO3}$:  $$\gamma(\ce{Ag+})=\gamma(\ce{Cl-})=1$$
So, the solubility of $\ce{AgCl}$ is equal to $$[\ce{Ag+}]= \sqrt{K_{sp}}= 1.33 \times 10^{-5}$$
In presence of $\ce{NaNO3}$ of a concentration of $0.1 \mathrm{mol/kg}$, then
$$[\ce{Ag+}]= \sqrt{K_{sp}}/ \sqrt{(\gamma(\ce{Na+}).\gamma(\ce{NO3-})}
= 1.33 \times 10^{-5}/ (0.769)= 1.73 \times 10^{-5} $$
i.e. in the presence of a soluble salt, the molar solubility of a slightly soluble salt increases.