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 a plant face rec machine | |
| # The class PlantFaceRecognitionSystem can be imported by other programs | |
| import os | |
| os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # 减少TensorFlow日志输出 | |
| # 尝试不同的导入方式 | |
| try: | |
| import tensorflow as tf | |
| from tensorflow.keras.models import load_model, Model, model_from_json |
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
| # Code for recognizing ten groups of photos. The codes for recognizing two, three, and five groups of photos follows the same structure, differing only in the number of groups. | |
| # 1. 自动数据分割:从leaves文件夹自动分割train/val/test | |
| # 2. 独立平均图片生成类 | |
| import os | |
| import sys | |
| import warnings | |
| import random | |
| import shutil |
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
| {"name":"C.N.1","description":"Things which are equal to the same thing are also equal to one another.","references":[]} | |
| {"name":"C.N.2","description":"If equals be added to equals, the wholes are equal.","references":[]} | |
| {"name":"C.N.3","description":"If equals be subtracted from equals, the remainders are equal.","references":[]} | |
| {"name":"C.N.4","description":"Things which coincide with one another are equal to one another.","references":[]} | |
| {"name":"C.N.5","description":"The whole is greater than the part.","references":[]} | |
| {"name":"Def.1.1","description":"A point is that which has no part.","references":[]} | |
| {"name":"Def.1.10","description":"When a straight line set up on a straight line makes the adjacent angles equal to one another, each of the equal angles is right, and the straight line standing on the other is called a perpendicular to that on which it stands.","references":[]} | |
| {"name":"Def.1.11","description":"An obtuse angle is an angle greater than a right angle.","references":[]} | |
| {"name":"Def.1.12 |
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
| ;; parsec.clj | |
| (defmacro =>> | |
| "Threads the state through the parsers. Inserts state as the | |
| parameter in the first parser. If there are more parsers, | |
| inserts the first residue as the second state in second parser, etc. | |
| If a parser throw exception, throw it and exit, else return all bind result | |
| as a dictionay and residue data. | |
| " | |
| [data & forms] | |
| (loop [data (list (list return {}) data), forms forms] |
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
| package main | |
| import ( | |
| "fmt" | |
| "github.com/Dwarfartisan/pgears" | |
| "time" ) | |
| var Engine *pgears.Engine | |
| type Usertbl struct{ | |
| Name string `field:"name" pk:"true"` | |
| Signup_date time.Time `field:"signup_date"` | |
| } |
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
| var sep = function(s, p) { | |
| var fun = function(state){ | |
| return choice(sep1(s, p), []) | |
| }; | |
| parsec(fun); | |
| return fun; | |
| }; | |
| sep.prototype = parsec; | |
| var sep1 = function(s, p) { |
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
| //either parsec | |
| pub fn either<T, R>(x: Parsec<T, R>, y: Parsec<T, R>)->Either<T, R> { | |
| Either{ | |
| x: x, | |
| y: y, | |
| } | |
| } | |
| impl<'a, T, R> FnOnce<(&'a mut VecState<T>, )> for Either<T, R> { | |
| type Output = Status<R>; |
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
| pub trait BinComb<L, R, T> { | |
| type S; | |
| fn left(&self)->&mut Parsec<L, Self::S>; | |
| fn right(&self)->&mut Parsec<R, Self::S>; | |
| } | |
| pub struct Either<R, S>{ | |
| x: Parsec<R, S>, | |
| y: Parsec<R, S>, | |
| } |
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
| use std::vec::Vec; | |
| use std::iter::{Iterator, Map}; | |
| pub trait Functor<A, B, F: FnMut(&A) -> B> { | |
| type Output; | |
| fn fmap(&self, f: F ) -> <Self as Functor<A, B, F>>::Output; | |
| } | |
| pub trait FunctorMut<A, B, F: FnMut(&A) -> B> { | |
| type Output; |
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 urllib2 | |
| opener = urllib2.build_opener(urllib2.HTTPHandler) | |
| with open("/storage/pic/logo.png") as f: | |
| data=f.read() | |
| request = urllib2.Request("http://localhost:8080/logo.png", data=data) | |
| request.add_header("Content-Type", "image/png") | |
| request.get_method = lambda:"PUT" | |
| url = opener.open(request) |