I want to export results of my Kriging calculation to raster or some other format. My aim is to take this converted file and intersect it with another SpatialPointDataFrame (location of the point doesn't have to be the same, so that is the reason of conversion). The goal is equivalent of "Extract values To Points" in ArcGIS - thus, merge information from kriging and another SPDF for one locations.   For second part, I imagine just to use raster::intersect(krig, SPDF). But how to get raster data for my Kriging? I tried to raster::rasterize  r &lt;- raster(ncols = length(ux), nrows = length(uy))  # length(ux), length(uy) krig.rst&lt;-rasterize(krig.est, r, "var1.pred")   and   krig.rst&lt;-rasterize(krig.est, r, "var1.pred", fun = function(x, ...) c(min(x))   The raster seems to be calculated, but I can't display it.  Please, is the problem in my raster dimension (nrow, ncol, ncell)? How can I assigned it? My first thought was that 1 cell of matrix (from Kriging) will correspond to 1 pixel of raster with assigned value, but I am obviously wrong.    Long reproductible exemple adapted from here:   library(sp) library(gstat) library(RColorBrewer)  # https://rpubs.com/nabilabd/118172 # packages for manipulation &amp; visualization suppressPackageStartupMessages({   library(dplyr) # for "glimpse"   library(ggplot2)   library(scales) # for "comma"   library(magrittr) })  data(meuse)  # create spdf meuse.spdf&lt;-meuse  # convert to spdf coordinates(meuse.spdf) &lt;- ~ x + y    # calculate voronoi tesselation - will be needed to create underlying point data voronoipolygons = function(layer) {   require(deldir)   crds = layer@coords   z = deldir(crds[,1], crds[,2])   w = tile.list(z)   polys = vector(mode='list', length=length(w))   require(sp)   for (i in seq(along=polys)) {     pcrds = cbind(w[[i]]$x, w[[i]]$y)     pcrds = rbind(pcrds, pcrds[1,])     polys[[i]] = Polygons(list(Polygon(pcrds)), ID=as.character(i))   }   SP = SpatialPolygons(polys)   voronoi = SpatialPolygonsDataFrame(SP, data=data.frame(dummy = seq(length(SP)), row.names=sapply(slot(SP, 'polygons'),                                                                                                     function(x) slot(x, 'ID')))) } meuse.voro &lt;- voronoipolygons(meuse.spdf)     # create underlying grid s.grid &lt;- spsample(meuse.voro, type = "regular", n = 6000)  # calculate kriging  # create variogram lzn.vgm &lt;- variogram(log(zinc)~1, meuse.spdf) # calculates sample variogram values  lzn.fit &lt;- fit.variogram(lzn.vgm, model=vgm(1, "Sph", 900, 1)) # fit model  plot(lzn.vgm, lzn.fit) # plot the sample values, along with the fit model  # calculate kriging lzn.kriged &lt;- krige(log(zinc) ~ 1, meuse.spdf, s.grid, model=lzn.fit)   # extract the unique x and y locations in the grid ux&lt;-unique(coordinates(lzn.kriged)[,1]) uy&lt;-unique(coordinates(lzn.kriged)[,2])  # extract the predicted values and format var1.pred into a matrix of gridded values predmat3 &lt;- matrix(lzn.kriged$var1.pred, length(ux), length(uy))  # display the data  filled.contour(x = seq(0,1, length.out = nrow(predmat3)),                y = seq(0,1, length.out = ncol(predmat3)),                z = predmat3,                col = brewer.pal(6,"Purples"), nlevels = 5)
I am trying to do kriging by gstat package through R.   Here is my Code:  krg&lt;-krige(var ~ 1,data,grid,model=vgm,nmax=30)   But each time I recive this warning:  1: In predict.gstat(g, newdata = newdata, block = block,  ... :    Warning: Covariance matrix (nearly) singular at location [1,4501,0]: skipping...   and when I try to plot it by spplot this error appears:  Error in seq.default(zrng[1], zrng[2], length.out = cuts + 2) :    'from' cannot be NA, NaN or infinite In addition: Warning messages: 1: In asMethod(object) :   complete map seems to be NA's -- no selection was made 2: In min(x) : no non-missing arguments to min; returning Inf 3: In max(x) : no non-missing arguments to max; returning -Inf   Here is the full code: You can download my data through this link:  and here is my full code:  library(gstat)                                          library(sp) library(raster)  coordinates(Mydata) &lt;- ~East + North proj4string(Mydata) &lt;- CRS("+proj=utm +zone=10+datum=WGS84") ext &lt;- as(extent(Mydata), "SpatialPolygons") r &lt;- rasterToPoints(raster(ext), spatial = TRUE) proj4string(r) &lt;- proj4string(Mydata)  v1 &lt;- variogram(cpue_female ~ 1, Mydata) vgm_mod_omni &lt;- vgm(psill = 0.0003, model = "Mat", range = 50000, nugget = 33, kappa = 0.5) G1 &lt;- krige(cpue_female ~ 1, Mydata, r, vgm_mod_omni, nmax = 30) gridded(G1) &lt;- TRUE spplot(G1)
Partition of a set and Hall's theorem When I go to any github.com page in Chrome, I get a big ugly error:  You attempted to reach github.com, but the server presented a certificate issued by an entity that is not trusted by your computer's operating system. This may mean that the server has generated its own security credentials, which Chrome cannot rely on for identity information, or an attacker may be trying to intercept your communications. You cannot proceed because the website operator has requested heightened security for this domain.  The same thing happens (in Chrome and with curl) when I go to  too. This strange problem started about a week and a half ago. Here's what I see when I click the broken lock icon in the address bar:   But gist.github.com works just fine:   It doesn't work with curl either:  Everything works fine in Firefox. How can I fix my root CA problem? Here's what it looks like in Firefox:   Update: I noticed that the first certificate in the chain is different in my broken Chrome/Safari as compared to Chrome on my other computer.   (There's no nasty red X anymore because I trusted it in Safari.) See how the issuers are different? What can I make of that? How does the Battle Booster work? I received the 80% battle point booster. It has 500 minutes on it and says the booster is only consumed when battle points are earned. Does this mean I can play 500 minutes of matches during a week and earning the bonus points? Or does it wear off in 500 minutes after equipping it?  Also it says my team is granted a 16% bonus. Does this stack? Do i get another 16% if I and another player wears it? Since it's a new item with the present chest it would be wise to use it later if the bonus does not stack. Disable sleep on laptop lid close in tty1 I'm using Ubuntu Desktop 15.10 on a laptop and it runs an Apache server with SSH as well. When using a GUI, I have the power options set to not sleep at all even when the laptop lid is closed, but recently I stopped the X-System and am now using TTY1 instead to save resources. However, in TTY1, if I close the laptop lid, the computer goes to sleep and prevents the SSH and Apache server from working. Any way to prevent this easily? The realistic answer I bet is to use Ubuntu Server instead (unless I'm mistaken and Ubuntu Server will also sleep on lid close) but I don't exactly want to switch yet unless there's an easy way to switch to it like you can switch from ubuntu-desktop to lubuntu-desktop? Any advice is welcome to prevent the computer from sleeping I'm trying out  with gnuplot to generate the data.  This works by having pgfplots write some stuff to an external file, run gnuplot on the file, and then use the generated data to plot the graph.  The problem I'm having is that I get different behaviour under xelatex as pdflatex or lualatex.  In xelatex, the data file is littered with ^^I whereas in the other two formats these are tabs.  It appears that the code ^^I is getting stored as a macro which then gets written out to the file, so possibly there's something funny going on with the ^^I syntax: xelatex is reading it literally.  Indeed, when I do \show\pgfplots@TAB (the macro in question) then for pdflatex and lualatex then I get a literal tab whereas for xelatex I get ^^I.  So how do I get a tab in xelatex?  And why isn't \gdef\pgfplots@TAB{^^I} working?  (The previous line in the code, by the way, is \catcode`\^^I=12 - I don't know if that has anything to do with it.) How do I determine the shutter count on a EOS 60D body? Reversing Drop Bars If I need to sit more upright on an old Fuji road bike, can I turn the drop handlebars upright and reversed so that they come up and then point to the rear?  I haven't seen anything on the net from anyone who has done that. Say we have two integers $n$ and $k$, such that $0 &lt; k &lt; n$ and $gcd(n, k) = 1$.  Why is it that if we take every integer $x\in\{0,\dots, n-1\}$ and compute $k\cdot x \ (mod \ n)$, we get as remainders all numbers from $0$ to $n-1$, with no repeats?  In other words, why is $\ f:\{0,\dots,n-1\}\rightarrow\{0,\dots,n-1\}$, $\ f(x)=k\cdot x\ (mod\ n)$ a bijection for $k,n\in\mathbb{N},\ gcd(k,n)=1$? When applying dropout in artificial neural networks, one needs to compensate for the fact that at training time a portion of the neurons were deactivated. To do so, there exist two common strategies:   scaling the activation at test time inverting the dropout during the training phase   The two strategies are summarized in the  below, taken from .  Which strategy is preferable, and why?    Scaling the activation at test time:    Inverting the dropout during the training phase: Can I set up a Mac for a multi head / multi user environment? An infinite subset of a countable set is countable In my book, it proves that an infinite subset of a coutnable set is countable. But not all the details are filled in, and I've tried to fill in all the details below. Could someone tell me if what I wrote below is valid?  Let $S$ be an infinite subset of a countable set $T$. Since $T$ is countable, there exists a bijection $f: \mathbb{N} \rightarrow T$. And $S \subseteq T = \{ f(n) \ | \ n \in \mathbb{N} \}$. Let $n_{1}$ be the smallest positive integer such that $f(n_{1}) \in S$. And continue where $n_{k}$ is the smallest positive integer greater than $n_{k-1}$ such that $f(n_{k}) \in S$. And because $S$ is infinite, we continue forever. Now consider the function $\beta : \mathbb{N} \rightarrow S$ which sends $k \rightarrow f(n_{k})$.   So in order for $S$ to be countable, $\beta$ would have to be a bijection. $\beta$ is injective since if $f(n_{k}) = f(n_{j})$, then $n_{k} = n_{j}$ because $f$ is injective. We also can conclude $k = j$ because the various $n_{i}$ chosen were strictly increasing.   Edit: $\beta$ also needs to be surjective. So for every $r \in S$ there exists a $q \in \mathbb{N}$ such that $\beta(q) = f(n_{q}) = r$. We know that $f^{-1}(r) \in \{n_{1}, n_{2}, ..., n_{k} ... \}$, so we can let $f^{-1}(r) = n_{d}$. Thus $\beta(d) = f(n_{d}) = r$. Lets say I have a loop in Bash:  for foo in `some-command` do    do-something $foo done   do-something is cpu bound and I have a nice shiny 4 core processor. I'd like to be able to run up to 4 do-something's at once.  The naive approach seems to be:  for foo in `some-command` do    do-something $foo &amp; done   This will run all do-somethings at once, but there are a couple downsides, mainly that do-something may also have some significant I/O which performing all at once might slow down a bit. The other problem is that this code block returns immediately, so no way to do other work when all the do-somethings are finished.  How would you write this loop so there are always X do-somethings running at once? What is a glue record? This is a  about DNS glue records.   What exactly (but briefly) is a DNS glue record?  Why are they needed and how do they work? How do I do a clean install of Yosemite? Is a Cauchy sequence - preserving (continuous) function is (uniformly) continuous? Let $(X,d)$ and $(Y,\rho)$ be metric spaces and $f:X\to Y$ be a function and suppose for any Cauchy sequence $(a_n)$ in $X$, $(f(a_n))$ is a Cauchy sequence in $Y$.  Is $f$ continuous?  Let $f$ be continuous, is it uniformly continuous? Do I need a UK visa? How and where to apply? Vector spaces for the irreducible representations of the Lorentz Group An image alt="" text should contain information about that image in the context of the page, so for instance if you have an article about cats on skateboards and then a photograph of the cat on his skateboard you'd probably give it the alt text of alt="Fluffy pulling some mad tricks on his pimped-out board".          &ndash; Wireframes created with   However, what should happen when that image is a link to a page (such as the Wikipedia cat page)?  I don't think there is any point using the title attribute here because screenreaders just ignore that when an alt attribute exists - the only people who would see the title attribute are mouse users who hover over the image, so that excludes keyboard only users too. It's not really any benefit to accessibility to include a title in this situation (Overall the title attribute is a bit useless really).  So, what should the image ALT text say in this case?   states:     Provide text alternatives for any non-text content so that it can be changed into other forms people need, such as large print, braille, speech, symbols or simpler language.    Therefore giving it the alt text of cat article page on Wikipedia is incorrect because that doesn't describe the image, neither does skateboarding cat image that links to the wikipedia article because the alt text should refer to the image itself, not the link associated with it. Can we get wordpress.stackexchange.com added to the list of off-topic redirection sites? I'm noticing a lot of WordPress questions being asked on Stack Overflow lately. I can't flag these to be moved to wordpress.stackexchange.com because it's not in the list:    Can it be added? Are there any other Stack Exchange sites worth adding? How to send data to a serial port and see any answer? On Linux, I want to send a command string (i.e. some data) to a serial port (containing control characters), and listen to the response (which also usually might contain control characters).   How can I do this as simplest as possible on Linux? An example is appreciated!