forked from burakbayramli/books
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
BB
committed
Jun 11, 2017
1 parent
16459f1
commit 79c2a01
Showing
77 changed files
with
97,666 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
.DS_Store |
Empty file.
22 changes: 22 additions & 0 deletions
22
Social_Network_Analysis_for_Starupts/chapter1/ACME_advice.net
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
*network NetworkX | ||
*vertices 10 | ||
1 Conrad 0.0 0.0 ellipse | ||
2 Samuel 0.0 0.0 ellipse | ||
3 Alice 0.0 0.0 ellipse | ||
4 Jim 0.0 0.0 ellipse | ||
5 Dave 0.0 0.0 ellipse | ||
6 Cindy 0.0 0.0 ellipse | ||
7 Brad 0.0 0.0 ellipse | ||
8 Frida 0.0 0.0 ellipse | ||
9 Angie 0.0 0.0 ellipse | ||
10 Mary 0.0 0.0 ellipse | ||
*edges | ||
1 8 1.0 | ||
1 6 1.0 | ||
2 8 1.0 | ||
2 6 1.0 | ||
3 8 1.0 | ||
5 8 1.0 | ||
7 10 1.0 | ||
8 9 1.0 | ||
8 10 1.0 |
22 changes: 22 additions & 0 deletions
22
Social_Network_Analysis_for_Starupts/chapter1/ACME_orgchart.net
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
*network NetworkX | ||
*vertices 10 | ||
1 Angie 0.0 0.0 ellipse | ||
2 Samuel 0.0 0.0 ellipse | ||
3 Jim 0.0 0.0 ellipse | ||
4 Alice 0.0 0.0 ellipse | ||
5 Dave 0.0 0.0 ellipse | ||
6 Cindy 0.0 0.0 ellipse | ||
7 Brad 0.0 0.0 ellipse | ||
8 Frida 0.0 0.0 ellipse | ||
9 Conrad 0.0 0.0 ellipse | ||
10 Mary 0.0 0.0 ellipse | ||
*edges | ||
1 4 1.0 | ||
2 6 1.0 | ||
3 4 1.0 | ||
4 9 1.0 | ||
4 7 1.0 | ||
5 6 1.0 | ||
6 8 1.0 | ||
6 9 1.0 | ||
9 10 1.0 |
30 changes: 30 additions & 0 deletions
30
Social_Network_Analysis_for_Starupts/chapter1/generate_acme.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import networkx as net | ||
|
||
o=net.Graph() | ||
|
||
o.add_edge('Conrad','Mary') | ||
o.add_edge('Conrad','Cindy') | ||
o.add_edge('Conrad','Alice') | ||
o.add_edge('Alice','Brad') | ||
o.add_edge('Alice','Angie') | ||
o.add_edge('Alice','Jim') | ||
o.add_edge('Cindy','Samuel') | ||
o.add_edge('Cindy','Dave') | ||
o.add_edge('Cindy','Frida') | ||
net.draw(o) | ||
|
||
a=net.Graph() | ||
a.add_edge('Cindy','Samuel') | ||
a.add_edge('Cindy','Conrad') | ||
a.add_edge('Samuel','Frida') | ||
a.add_edge('Conrad','Frida') | ||
a.add_edge('Alice','Frida') | ||
a.add_edge('Angie','Frida') | ||
a.add_edge('Dave','Frida') | ||
a.add_edge('Mary','Frida') | ||
a.add_edge('Brad','Mary') | ||
a.add_node('Jim') | ||
net.draw(a) | ||
|
||
net.write_pajek(o,'../chapter1/ACME_orgchart.net') | ||
net.write_pajek(a,'../chapter1/ACME_advice.net') |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
""" | ||
LJ_fetch.py | ||
Created by Maksim Tsvetovat on 2011-04-28. | ||
Copyright (c) 2011 __MyCompanyName__. All rights reserved. | ||
""" | ||
|
||
import sys | ||
import os | ||
import networkx as net | ||
import urllib | ||
|
||
|
||
def read_lj_friends(g, name): | ||
# fetch the friend-list from LiveJournal | ||
response=urllib.urlopen('http://www.livejournal.com/misc/fdata.bml?user='+name) | ||
for line in response.readlines(): | ||
#Comments in the response start with a '#' | ||
if line.startswith('#'): continue | ||
|
||
# the format is "< name" (incoming) or "> name" (outgoing) | ||
parts=line.split() | ||
|
||
#make sure that we don't have an empty line | ||
if len(parts)==0: continue | ||
|
||
#add the edge to the network | ||
if parts[0]=='<': | ||
g.add_edge(parts[1],name) | ||
else: | ||
g.add_edge(name,parts[1]) | ||
|
||
def snowball_sampling(g, center, max_depth=1, current_depth=0, taboo_list=[]): | ||
# if we have reached the depth limit of the search, bomb out. | ||
print center, current_depth, max_depth, taboo_list | ||
if current_depth==max_depth: | ||
print 'out of depth' | ||
return taboo_list | ||
if center in taboo_list: | ||
print 'taboo' | ||
return taboo_list #we've been here before | ||
else: | ||
taboo_list.append(center) # we shall never return | ||
|
||
read_lj_friends(g, center) | ||
|
||
for node in g.neighbors(center): | ||
taboo_list=snowball_sampling(g, node, current_depth=current_depth+1, max_depth=max_depth, taboo_list=taboo_list) | ||
|
||
return taboo_list | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
def main(): | ||
g=net.Graph() | ||
# read_lj_friends(g,'kozel_na_sakse') | ||
snowball_sampling(g,'kozel_na_sakse') | ||
|
||
|
||
if __name__ == '__main__': | ||
main() | ||
|
19 changes: 19 additions & 0 deletions
19
Social_Network_Analysis_for_Starupts/chapter4/9_11_attrib.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Hani Hanjour,77_Pentagon | ||
Majed Moqed,77_Pentagon | ||
Nawaf Alhazmi,77_Pentagon | ||
Salem Alhazmi,77_Pentagon | ||
Khalid Al-Mihdhar,77_Pentagon | ||
Mohamed Atta,11_WTC North | ||
Waleed Alshehri,11_WTC North | ||
Wail Alshehri,11_WTC North | ||
Satam Suqami,11_WTC North | ||
Abdul Aziz Al-Omari,11_WTC North | ||
Marwan Al-Shehhi,175_WTC South | ||
Fayez Ahmed,175_WTC South | ||
Ahmed Alghamdi,175_WTC South | ||
Hamza Alghamdi,175_WTC South | ||
Mohand Alshehri,175_WTC South | ||
Ziad Jarrah,93_Penn | ||
Ahmed Alnami,93_Penn | ||
Ahmed Al Haznawi,93_Penn | ||
Saeed Alghamdi,93_Penn |
Oops, something went wrong.