惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy International News Feed
WordPress大学
WordPress大学
Security Latest
Security Latest
Cyberwarzone
Cyberwarzone
K
Kaspersky official blog
Cisco Talos Blog
Cisco Talos Blog
Microsoft Security Blog
Microsoft Security Blog
G
GRAHAM CLULEY
N
News | PayPal Newsroom
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog
美团技术团队
J
Java Code Geeks
I
Intezer
The Cloudflare Blog
SecWiki News
SecWiki News
S
Secure Thoughts
Microsoft Azure Blog
Microsoft Azure Blog
V2EX - 技术
V2EX - 技术
C
Cyber Attacks, Cyber Crime and Cyber Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Spread Privacy
Spread Privacy
D
DataBreaches.Net
S
Security Affairs
Help Net Security
Help Net Security
S
Securelist
F
Full Disclosure
C
Check Point Blog
F
Fortinet All Blogs
Know Your Adversary
Know Your Adversary
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
阮一峰的网络日志
阮一峰的网络日志
The Register - Security
The Register - Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
人人都是产品经理
人人都是产品经理
博客园_首页
G
Google Developers Blog
Google Online Security Blog
Google Online Security Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
Application and Cybersecurity Blog
Application and Cybersecurity Blog
H
Hacker News: Front Page
L
LINUX DO - 热门话题
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LangChain Blog

K.I.S.S

身在 Kimi 的 800 天 写在 Kimi K2 发布之后:再也不仅仅是 ChatBot macOS 按域名切换 DNS 解析 | K.I.S.S 为什么说 GPT 是无损压缩 | K.I.S.S 握着你的手训一个类GPT语言模型 (二) | K.I.S.S 握着你的手训一个类GPT语言模型 (一) | K.I.S.S Rosetta in Linux Virtual Machine on Apple Silicon Fit an Overfit with MegEngine 把 CUPS 扔进 docker 里 ASUS Chromebook Flip | K.I.S.S GPG 与 SSH Agent 转发 使用 dnsmasq 和 ipset 的策略路由 YubiKey 4 简介与配置 | K.I.S.S 定制GH60机械键盘 | K.I.S.S Debian 网络安装内核参数 | K.I.S.S 我的 Vim 配置 | K.I.S.S Libinput 与 Udev | K.I.S.S 给妹子看的 Arch Linux 桌面日常安装 | K.I.S.S 修复GTK3 CSD外观 | K.I.S.S 握着你的手教你画哀女王 | K.I.S.S R.I.P Google Reader | K.I.S.S Richard Stallman仍然是对的 | K.I.S.S Scala 自定义控制结构 | K.I.S.S 入手Wacom Bamboo CTL470 | K.I.S.S 转个型? | K.I.S.S Wish List | K.I.S.S pulseaudio音量问题 | K.I.S.S 入手yubikey,一点小心得 | K.I.S.S 迁移到Octopress | K.I.S.S 自动更新DNSPod记录 | K.I.S.S Linux 用作 IPv6 网关 | K.I.S.S Conky从豆瓣获取MPD专辑封面 | K.I.S.S 我和Linus大学时那些事儿 | K.I.S.S Micro$oft依然是那副老德行 | K.I.S.S 用PulseAudio TCP Forwarding实现网络传声 | K.I.S.S 利用tmpfs加速gnome-shell overview模式Applications索引 | K.I.S.S 新的短网址 | K.I.S.S 紧张的一个月 | K.I.S.S 5月11日活动有感 | K.I.S.S 西电开源社区2011年Tee 最终版 | K.I.S.S 多头多尾的Linux | K.I.S.S Linux的中文名称怎么翻译呢? | K.I.S.S iPhone使用OpenVPN | K.I.S.S 我的人人网敏感词 | K.I.S.S 纪念钱立生老师 | K.I.S.S twitter键盘控:Twittperator | K.I.S.S 天生的暴力倾向? | K.I.S.S The Open Source Spirit | K.I.S.S Libreoffice | K.I.S.S Hello world! | K.I.S.S The Beginning | K.I.S.S About Me | K.I.S.S
Python 调用gnuplot的例子 | K.I.S.S
2010-11-26 · via K.I.S.S

最近和lvzongting一块儿做一些仿真,不想用matlab了,原因有:

  • 商业软件,用破解版毕竟不好

  • 难以实现分布式计算和并行计算

  • 太慢 考虑之下决定用可爱的Python,因为

  • God,it’s so simple!

  • 完善的类库,数学功能不亚于matlab

  • 比matlab通用,再也不需要“一切都是矩阵”了

  • 灵活

  • 自由,开源

为了实现 网络变型的仿真,先做一个框架,也算为python练练手

#!/usr/bin/env python
import numpy
import Gnuplot, Gnuplot.funcutils
import matplotlib.pyplot as pl
import time
import sys

def lzt_1(num,x):

    x=numpy.random.randint(0,100,[num,2])

    return x

def lzt(num,x):               #all the array of x
 
    xx=numpy.random.randint(-1,2,[num,2])
    #print xx
    x=x+xx
    
    return x

if __name__=='__main__':
    #the part of init #
    g = Gnuplot.Gnuplot(debug=1) #init of gnuplot

    #print sys.argv[1]
    step=10                      #default step is 10
    if len(sys.argv) > 1:
        step=int(sys.argv[1])    #first argv is step of simulation
    num=100                      #default num is 100
    if len(sys.argv) > 2:      
        num=int(sys.argv[2])     #second argv is step of simulation
    range_x_min=[-10,-10]
    range_x_max=[110,110]        #rang of simulation default is 100*100
    x=numpy.random.randint(0,100,[num,2])       #print x

    for i in range(0,step):      
        print i
        #the part of iterative #
        x=lzt(num,x)             #the function of controling the node
        #the part of plot #
        y=x.tolist()             #change to list in order to plot
        y.append(range_x_min)    #add de range point
        y.append(range_x_max)
        g.plot(y)                #point
        #raw_input('Please press return to continue...\n')
        time.sleep(0.1)

就是这样,程序没有什么实际意义,也没啥算法,几个类库的调用,一个仿真的框架而已。