ios学习--sampe code

26 篇文章 0 订阅

 

博客的地址:

http://stackoverflow.com/questions/1353130/where-can-i-find-sample-iphone-code

 

具体的地址:

http://maniacdev.com/2010/06/35-open-source-iphone-app-store-apps-updated-with-10-new-apps/

 

论坛:

https://github.com/

 

 

鼻祖:

http://sourceforge.net/

 

 中文blog:

http://houchangxi.iteye.com/blog/1137862

 

50款经典iPhone 开源应用(附代码下载)

http://hi.baidu.com/bin545/blog/item/24595e60057585c28cb10d07.html

 

Open Source iPhone Apps List – Real App Store Code Examples!

http://maniacdev.com/2010/06/35-open-source-iphone-app-store-apps-updated-with-10-new-apps/

 

23个iPhone App Store中的开源App及其源码

http://slj.me/2010/04/open-source-iphone-app-store-apps/

 

 

...................................

 

 

import pandas as pd import numpy as np import networkx as nx # 读取Excel文件中的邻接矩阵 adjacency_matrix = pd.read_excel('output.xlsx', index_col=0) # 将邻接矩阵转换为numpy数组 adjacency_matrix = adjacency_matrix.to_numpy() # 创建有向图对象 G = nx.DiGraph(adjacency_matrix) def preprocess(G): p = 0 directedGraph = nx.DiGraph() for u in G.nodes(): for v in G.neighbors(u): if (v != u): # propProb = G.number_of_edges(u, v) / G.in_degree(v) propProb = G.number_of_edges(u, v) / G.degree(v) directedGraph.add_edge(u, v, pp=propProb) # p += propProb # print(propProb) # print('平均阈值:', p/2939) return directedGraph def simulate(G, seedNode, propProbability): newActive = True currentActiveNodes = copy.deepcopy(seedNode) newActiveNodes = set() activatedNodes = copy.deepcopy(seedNode) # Biar ga keaktivasi 2 kali influenceSpread = len(seedNode) while (newActive): for node in currentActiveNodes: for neighbor in G.neighbors( node): # Harus dicek udah aktif apa belom, jangan sampe ngaktifin yang udah aktif if (neighbor not in activatedNodes): if (G[node][neighbor]['pp'] > propProbability): # flipCoin(propProbability) newActiveNodes.add(neighbor) activatedNodes.append(neighbor) influenceSpread += len(newActiveNodes) if newActiveNodes: currentActiveNodes = list(newActiveNodes) newActiveNodes = set() else: newActive = False # print("activatedNodes",len(activatedNodes),activatedNodes) return influenceSpread def flipCoin(probability): return random.random() < probability解释一下这个代码
07-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值