This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Funciont: Backup website and mysql database | |
| #Author: licess | |
| #Website: http://lnmp.org | |
| #IMPORTANT!!!Please Setting the following Values! | |
| bak_dir=/home/backup | |
| if [ -d $bak_dir ]; then | |
| echo 'begin' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding:utf-8 -*- | |
| import requests, os, re, sys, time | |
| from time import sleep | |
| from threading import Thread | |
| reload(sys) | |
| sys.setdefaultencoding('utf8') | |
| UPDATE_INTERVAL = 0.01 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tornado.web | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| class MainHandler(tornado.web.RequestHandler): | |
| def get(self): | |
| self.write("Greetings from the instance %s!" % tornado.process.task_id()) | |
| app = tornado.web.Application([ | |
| (r"/", MainHandler), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $fileName = $_FILES['afile']['name']; | |
| $fileType = $_FILES['afile']['type']; | |
| $fileContent = file_get_contents($_FILES['afile']['tmp_name']); | |
| $dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent); | |
| $json = json_encode(array( | |
| 'name' => $fileName, | |
| 'type' => $fileType, | |
| 'dataUrl' => $dataUrl, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| This is how to track a white ball example using SimpleCV | |
| The parameters may need to be adjusted to match the RGB color | |
| of your object. | |
| The demo video can be found at: | |
| http://www.youtube.com/watch?v=jihxqg3kr-g | |
| ''' | |
| print __doc__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // grab your file object from a file input | |
| $('#fileInput').change(function () { | |
| sendFile(this.files[0]); | |
| }); | |
| // can also be from a drag-from-desktop drop | |
| $('dropZone')[0].ondrop = function (e) { | |
| e.preventDefault(); | |
| sendFile(e.dataTransfer.files[0]); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \documentclass[UTF8,10pt]{ctexart} | |
| \usepackage[a4paper,%%textwidth=129mm,textheight=185mm, %%193-8 | |
| text={160mm,260mm},centering]{geometry} | |
| \pagestyle{empty} | |
| \begin{document} | |
| \title{用散点图示范ggplot2的核心概念} | |
| \author{肖凯} | |
| \maketitle | |
| \abstract{ | |
| 本文稿是第五届R语言会议演讲内容的一部分,试图用散点图示例来说明ggplot2包的核心概念,以方便初学者快速上手。同时这也是笔者应用knitr包的一个练习。该示例所用数据是ggplot2包内带的mpg数据集。} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| allfields = $("input[required]"); | |
| $("input[required]").on("input", function(e) { | |
| if(!hasGetUserMedia()) return; | |
| //count number of invalid fields | |
| var totalGood = 0; | |
| for(var i=0, len=allfields.length; i<len; i++) { | |
| if($(allfields[i]).attr("required") && allfields[i].checkValidity()) { | |
| totalGood++; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| X = [ | |
| 1,0,3,0,0,0,0,0,1,0,0; % 7111 | |
| 1,1,0,0,0,0,0,0,0,2,1; % 8809 | |
| 1,0,1,2,0,0,0,0,1,0,0; % 2172 | |
| 1,0,0,0,0,0,0,4,0,0,0; % 6666 | |
| 1,0,4,0,0,0,0,0,0,0,0; % 1111 | |
| 1,0,0,4,0,0,0,0,0,0,0; % 2222 | |
| 1,0,0,1,0,0,0,2,1,0,0; % 7662 | |
| 1,0,1,0,2,0,0,0,0,0,1; % 9313 | |
| 1,4,0,0,0,0,0,0,0,0,0; % 0000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Back-Propagation Neural Networks | |
| # | |
| # Written in Python. See http://www.python.org/ | |
| # Modified by JSun to solve the problem here: http://www.weibo.com/1497035431/ynPEvC78V | |
| # Neil Schemenauer <nas@arctrix.com> | |
| import math | |
| import random | |
| import string |