[Solved] How to detect a returning visitor, and redirect to a specific URL? [closed]

function setCookie(c_name,value,exdays) { var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value=escape(value) + ((exdays==null) ? “” : “; expires=”+exdate.toUTCString()); document.cookie=c_name + “=” + c_value; } gets cookie function getCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(“;”); for (i=0;i<ARRcookies.length;i++) { x=ARRcookies[i].substr(0,ARRcookies[i].indexOf(“=”)); y=ARRcookies[i].substr(ARRcookies[i].indexOf(“=”)+1); x=x.replace(/^\s+|\s+$/g,””); if (x==c_name) { return unescape(y); } } } if(getCookie(‘visited’)) { location.href=”https://stackoverflow.com/questions/13655941/redirecturl”; }else { setCookie(‘visited’,1,365); } tutorial for cookies … Read more

[Solved] Detect the position of a pattern of numbers in a matrix in R [closed]

According to your new rules, may be this helps: data1 <- data #changing some elements to test the code data1[2,8] <-2 data1[4,1] <- 1 ##The code is for the row indx <- which(t(sapply(split(data1 == pattern, row(data1)), { function(x) colSums(sapply(1:(length(x) – 3), function(i) x[seq(i, i + 3)]), na.rm = TRUE) == 4 })), arr.ind = TRUE) … Read more