
软件与计算
文章平均质量分 67
麦好
硕士/量化投资协会成员
展开
-
python3.6-深入浅出视频
【课程收益】适合人群 python小白,大数据和机器学习编程程序员上机实践为主线以最快的速度上手快速入门,还学到了python3的核心知识https://edu.youkuaiyun.com/course/detail/9897...原创 2018-11-23 13:08:31 · 1477 阅读 · 0 评论 -
C语言随笔-去掉仅有\n的行
#include <stdio.h>int main(int argc, const char * argv[]) { char str[128]; char *linep; strcpy( str, "12 35 56\n12 33 87\n\n\n\n" ); printf("%s", str); linep=strtok(str,"\r...原创 2018-10-26 20:16:05 · 1735 阅读 · 1 评论 -
python2手记-除法
&gt;&gt;&gt; from __future__ import division&gt;&gt;&gt; 5/22.5&gt;&gt;&gt; 5//22&gt;&gt;&gt;原创 2018-09-28 15:27:39 · 463 阅读 · 0 评论 -
python 3随笔-input与eval
>>> s= input('--> ')--> hello,world>>> s'hello,world'>>> input([prompt])如果存在提示参数,则将其写入标准输出,而不使用尾随换行符。然后,函数从输入中读取一行,将其转换为字符串(去掉尾随的换行符),并返回该字符串。当读取EOF时,会引发EOFEr...原创 2018-09-10 09:10:30 · 1858 阅读 · 0 评论 -
pygame随笔-窗口内图像抖动
#!/usr/bin/env python2# -*- coding: utf-8 -*-"""Created on Mon Aug 27 11:16:32 2018@author: myhaspl"""import sys, pygamepygame.init()size = width, height = 320, 240speed = [2, 2]black =...原创 2018-08-30 18:40:50 · 5332 阅读 · 0 评论 -
c++随笔【文字弹跳】(cocos2d)
#include "HelloWorldScene.h"#include "cocostudio/CocoStudio.h"#include "ui/CocosGUI.h"#define MOVELABEL 101USING_NS_CC;using namespace cocostudio::timeline;Scene* HelloWorld::createScene(原创 2018-01-19 16:23:39 · 558 阅读 · 0 评论 -
c++随笔【string】
//// main.cpp// cpplearn1//// Created by myhaspl on 2017/12/3.// Copyright © 2017年 myhaspl@myhaspl.com. All rights reserved.//#include using namespace std;int main(int argc, const char *原创 2018-01-04 23:23:31 · 320 阅读 · 0 评论 -
c++随笔【get,getline】
input a string=>y1:hello worldinput a string=>y3:goodinput a string=>y4:aaadddarwhello worldgoodaaadddarwProgram ended with exit code: 0//// main.cpp// cpplearn1//// Created by myhaspl on原创 2018-01-04 17:03:42 · 339 阅读 · 0 评论 -
c++随笔【cin,char[]】
input a string=>y1:locationinput a string=>y3:my bookhelloworldlocationhello,world!my820Program ended with exit code: 0//// main.cpp// cpplearn1//// Created by myhaspl on 2017/12/3.// Copyrig原创 2018-01-01 20:18:52 · 1137 阅读 · 0 评论 -
c++随笔【数组】
//// main.cpp// cpplearn1//// Created by myhaspl on 2017/12/3.// Copyright © 2017年 myhaspl@myhaspl.com. All rights reserved.//#include using namespace std;int main(int argc, const char *原创 2017-12-29 09:22:01 · 226 阅读 · 0 评论 -
c++随笔【static_cast】
//// main.cpp// cpplearn1//// Created by myhaspl on 2017/12/3.// Copyright © 2017年 myhaspl@myhaspl.com. All rights reserved.//#include using namespace std;int main(int argc, const char *原创 2017-12-28 22:17:01 · 305 阅读 · 0 评论 -
c++随笔【unicode】
//// main.cpp// cpplearn1//// Created by myhaspl on 2017/12/3.// Copyright © 2017年 myhaspl@myhaspl.com. All rights reserved.//#include using namespace std;int main(int argc, const char *原创 2017-12-25 22:57:10 · 295 阅读 · 0 评论 -
C++随笔【智能输出】
//// main.cpp// cpplearn1//// Created by myhaspl on 2017/12/3.// Copyright © 2017年 myhaspl@myhaspl.com. All rights reserved.//#include using namespace std;int main(int argc, const char *原创 2017-12-25 21:55:04 · 329 阅读 · 0 评论 -
c++随笔【显示数值,八进制,十六进制等】
#include using namespace std;int main(int argc, const char * argv[]) { // insert code here... int x1; int x2; int x3; x1=21; x2=21; x3=21; coutoct ; cout"x1:"endl; couthe原创 2017-12-22 22:50:29 · 477 阅读 · 0 评论 -
python标准库手记【3】
# -*- coding: utf-8 -*-"""Spyder EditorThis is a temporary script file."""import repattern="媒体"text="过度消费消费的另一个显著现象是网购和社交媒体在其中起到了推波助澜的作用。相当比例的受访者认为社交媒体增强了他们的购物欲(中国大陆72%、香港66%、台湾55%、德国23%、意大利4原创 2017-05-18 22:56:04 · 755 阅读 · 0 评论 -
python标准库手记【2】
bogon:pylearn myhaspl$ python learn1.pyInfo: name:myhasplage:26welcome to china # -*- coding:utf-8 -*-import stringvalues={'name':'myhaspl','age':26}t=string.Template("""name:$nameage:$agewelcom原创 2017-05-15 21:29:05 · 542 阅读 · 0 评论 -
windows关闭端口
net start mpssvcnetsh advfirewall set allprofiles state onnetsh advfirewall set allprofiles firewallpolicy allowinbound,allowoutboundnetsh advfirewall firewall add rule name="deny tcp 445" dir=in prot原创 2017-05-14 23:39:27 · 1042 阅读 · 0 评论 -
python标准库手记【1】
# -*- coding:utf-8 -*-import stringmyStr1="hello,world"myStr2="您好,世界"print myStr1print myStr2print "=========="print string.capwords(myStr1)transTable=string.maketrans('elo您','ELO你')print myS原创 2017-05-14 11:42:32 · 597 阅读 · 0 评论 -
unity3d随笔-7
using System.Collections;using System.Collections.Generic;using UnityEngine;public class mycube : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame原创 2017-04-03 19:12:53 · 556 阅读 · 0 评论 -
unity3d随笔-6
using System.Collections;using System.Collections.Generic;using UnityEngine;public class CameraFollow : MonoBehaviour { public float distance = 18;//距离 public float rot = 0;//横向弧度 priv原创 2017-03-27 16:27:08 · 504 阅读 · 0 评论 -
unity3d随笔-5
圆周长公式弧长计算公式:n是圆心角度数,r是半径,l是圆心角弧长。L=n(圆心角度数)× π(1)× r(半径)/180(角度制)L=α(弧度)× r(半径) (弧度制)一个平角是 π 弧度。 即 180度=π弧度 由此可知: 1度=π/180 弧度 ( ≈0.017453弧度 ) 因此,得到 把度化成弧度的公式: 弧度=度×π/180 Mathf.Sin正弦 stati原创 2017-03-24 12:08:47 · 596 阅读 · 0 评论 -
unity3d随笔-4
using System.Collections;using System.Collections.Generic;using UnityEngine;public class Tank : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once原创 2017-03-24 09:47:00 · 559 阅读 · 0 评论 -
unity-随笔2
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.SceneManagement;public class test : MonoBehaviour { public string username = ""; public stri原创 2017-03-20 18:04:44 · 517 阅读 · 0 评论 -
unity3d随笔-1
using System.Collections;using System.Collections.Generic;using UnityEngine;public class test : MonoBehaviour { public string username = ""; public string password = ""; public string原创 2017-03-20 12:24:42 · 497 阅读 · 0 评论 -
ocaml学习随笔-1
utop # let rec my_listprint items =match items with|first::the_rest->printf "%s\n" first;my_listprint the_rest|[]->"";;val my_listprint : string list -> string = ─( 21:原创 2017-03-08 21:54:06 · 759 阅读 · 0 评论 -
OC-8
//// ViewController.m// test//// Created by myhaspl on 16/12/6.// Copyright (c) 2016年 myhaspl@myhaspl.com. All rights reserved.//#import "ViewController.h"@implementation ViewController原创 2016-12-08 22:58:29 · 596 阅读 · 0 评论 -
OC-7-释放池,指针
释放池,指针//// main.m// test//// Created by myhaspl on 16/11/4.// Copyright (c) 2016年 myhaspl@myhaspl.com. All rights reserved.//#import int main(int argc, const char * argv[]) { //@auto原创 2016-11-04 16:51:27 · 568 阅读 · 0 评论 -
OC-6
//// main.m// mylearn//#import #import "Mypoint.h"@implementation Mypoint@synthesize z;-(void) print{ NSLog(@"(%i,%i)",myx,myy);}-(void)setx:(int)x{ myx=x;}-(void)sety:(int)y{原创 2016-09-13 13:42:06 · 561 阅读 · 0 评论 -
OC笔记-5
//// main.m// mylearn//#import #import "Mypoint.h"@implementation Mypoint@synthesize z;-(void) print{ NSLog(@"(%i,%i)",myx,myy);}-(void)setx:(int)x{ myx=x;}-(void)sety:(int)y{原创 2016-09-07 22:17:37 · 519 阅读 · 0 评论 -
oc笔记-4
//// main.m// mylearn//#import #import "Mypoint.h"@implementation Mypoint{ int myx; int myy;}-(void) print{ NSLog(@"(%i,%i)",myx,myy);}-(void)setx:(int)x{ myx=x;}-(void原创 2016-09-05 22:45:45 · 494 阅读 · 0 评论 -
oc笔记-3
//// main.m// mylearn//#import #import "Mypoint.h"@implementation Mypoint{ int myx; int myy;}-(void) print{ NSLog(@"(%i,%i)",myx,myy);}-(void)setx:(int)x{ myx=x;}-(voi原创 2016-09-04 21:48:56 · 535 阅读 · 0 评论 -
OC笔记-2
//// main.m// mylearn//#import @interface Mypoint:NSObject-(void) print;-(void) setx:(原创 2016-09-01 12:04:07 · 531 阅读 · 0 评论 -
oc笔记-1
2016-08-31 21:11:54.883 mylearn[596:34753] 102016-08-31 21:11:54.884 mylearn[596:34753] 122016-08-31 21:11:54.884 mylearn[596:34753] 0xa2016-08-31 21:11:54.885 mylearn[596:34753] 3.1415932016-08-3原创 2016-08-31 21:21:15 · 478 阅读 · 0 评论 -
PYTHON-正则match
>>> x=r'(\D*)(\d*)(.*)hello'>>> m=re.match(x,y )>>> m.groups()('xxxxxx', '23434', 'yyy111yyyzzz ')>>> m.groups(0)('xxxxxx', '23434', 'yyy111yyyzzz ')>>> m.group(0)'xxxxxx23434yyy111yyyzzz hel原创 2016-08-05 15:53:48 · 1015 阅读 · 0 评论 -
python手记-twisted(5)
聊天室# -*- coding: utf-8 -*-#DeepChat 0.1#author:myhaspl@myhaspl.com#license:LGPLfrom twisted.internet.protocol import Factoryfrom twisted.protocols.basic import LineReceiverfrom twisted.internet原创 2016-07-21 15:12:12 · 1592 阅读 · 0 评论 -
python手记-twisted(4)
from twisted.internet.protocol import Protocolfrom twisted.internet import reactorfrom twisted.internet.protocol import Factoryfrom twisted.internet.endpoints import TCP4ServerEndpoint#http://blog原创 2016-07-09 17:22:10 · 3735 阅读 · 0 评论 -
python手记-twisted(3)
from twisted.internet.protocol import Protocolfrom twisted.internet import reactorfrom twisted.internet.protocol import Factoryfrom twisted.internet.endpoints import TCP4ServerEndpointclass Echo(原创 2016-07-08 18:48:12 · 3396 阅读 · 0 评论 -
python手记-twisted(2)
关闭连接Xshell 5 (Build 0655)Copyright (c) 2002-2015 NetSarang Computer, Inc. All rights reserved.Type `help' to learn how to use Xshell prompt.[c:\~]$ telnet 120.55.*.* 8001Connecting to 120.55.*.*:8001.原创 2016-07-07 17:51:07 · 2726 阅读 · 0 评论 -
python手记-twisted(1)
python手记原创 2016-07-07 10:30:39 · 1840 阅读 · 0 评论 -
arduino随笔(3)
红绿灯//2016-4-12// This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public// License as published by the Free Software Foundation原创 2016-04-14 17:48:51 · 5487 阅读 · 0 评论