Skip to content

Commit 1b53939

Browse files
committed
Run script. Twitter config.
1 parent fc54cc6 commit 1b53939

File tree

2 files changed

+192
-0
lines changed

2 files changed

+192
-0
lines changed

data/twitter.config

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# This is a sample configuration file for code_swarm
2+
3+
# Frame width
4+
Width=960
5+
6+
# Frame height
7+
Height=540
8+
9+
# Input file
10+
InputFile=/Volumes/Scratch/projects/twitter_code_swarm/twitter_log.xml
11+
12+
# Particle sprite file
13+
ParticleSpriteFile=src/particle.png
14+
15+
#Font Settings
16+
Font=Helvetica
17+
FontSize=15
18+
BoldFontSize=15
19+
20+
# Project time per frame
21+
#MillisecondsPerFrame=21600000
22+
FramesPerDay=3
23+
24+
# Maximum number of background processes
25+
# Probably no more than 2 per processor needed.
26+
# N.B. If you're taking snapshots, increasing this
27+
# number will noticably increase memory usage.
28+
MaxThreads=6
29+
30+
# Optional Method instead of MillisecondsPerFrame
31+
#FramesPerDay=4
32+
33+
# Background in R,G,B
34+
Background=0,0,0
35+
36+
# Color assignment rules
37+
# Keep in order, do not skip numbers. Numbers start
38+
# at 1.
39+
#
40+
# Pattern: "Label", "regex", R,G,B, R,G,B
41+
# Label is optional. If it is omitted, the regex
42+
# will be used.
43+
#
44+
ColorAssign1="Ruby","app/(models|controllers|helpers).*|lib/.*rb|config/.*|db/.*", 255,20,10, 255,20,10
45+
ColorAssign2="Tests","(test|spec)/.*", 33,255,47, 33,255,47
46+
ColorAssign3="View","app/views/.*|public/.*\.(css|js|jpg|gif|png)", 0,255,255, 0,255,255
47+
ColorAssign4="Libraries","vendor/(plugins|gems|rails).*", 234,38,255, 234,38,255
48+
#ColorAssign5="Javascript","public/.*\.js", 255,255,0, 255,255,0
49+
#ColorAssign6="Images","public/.*(png|jpg|gif", 119,68,119, 119,68,119
50+
#ColorAssign7="Code6",".*src6.*", 136,51,17, 136,51,17
51+
#ColorAssign8="Code7",".*src7.*", 250,110,110, 250,110,130
52+
#ColorAssign9="Code8",".*src8.*", 238,102,68, 238,102,68
53+
#ColorAssign10=".*src9.*", 238,68,119, 238,68,119
54+
55+
# Save each frame to an image?
56+
TakeSnapshots=false
57+
58+
# Where to save each frame
59+
SnapshotLocation=frames/code_swarm-######.png
60+
61+
# Draw names (combinatory) :
62+
# Draw sharp names?
63+
DrawNamesSharp=true
64+
# And draw a glow around names? (Runs slower)
65+
DrawNamesHalos=false
66+
67+
# Draw files (combinatory) :
68+
# Draw sharp files
69+
DrawFilesSharp=false
70+
# Draw fuzzy files
71+
DrawFilesFuzzy=true
72+
# Draw jelly files
73+
DrawFilesJelly=false
74+
75+
# Show the Legend at start
76+
ShowLegend=true
77+
78+
# Show the History at start
79+
ShowHistory=true
80+
81+
# Show the Date at start
82+
ShowDate=true
83+
84+
# Show edges between authors and files, mostly for debug purpose
85+
ShowEdges=false
86+
87+
# Turn on Debug counts.
88+
ShowDebug=false
89+
90+
# Natural distance of files to people
91+
EdgeLength=25
92+
93+
# Amount of life to decrement
94+
EdgeDecrement=-2
95+
FileDecrement=-1
96+
PersonDecrement=-1
97+
98+
#Speeds.
99+
#Optional: NodeSpeed=7.0, If used, FileSpeed and PersonSpeed need not be set.
100+
#
101+
FileSpeed=7.0
102+
PersonSpeed=2.0
103+
104+
#Masses
105+
FileMass=2.0
106+
PersonMass=10.0
107+
108+
# Life of an Edge
109+
EdgeLife=250
110+
111+
# Life of a File
112+
FileLife=250
113+
114+
# Life of a Person
115+
PersonLife=255
116+
117+
# Highlight percent.
118+
# This is the amount of time that the person or
119+
# file will be highlighted.
120+
HighlightPct=5
121+
122+
## Physics engine selection and configuration
123+
# Directory physics engine config files reside in.
124+
PhysicsEngineConfigDir=physics_engine
125+
# Force calculation algorithms ("PhysicsEngineLegacy", "PhysicsEngineSimple"...) :
126+
PhysicsEngineSelection=PhysicsEngineOrderly
127+
128+
#Is the input xml sorted by date? It's faster and uses much less memory if it is
129+
IsInputSorted=true
130+
131+
# OpenGL is experimental. Use at your own risk.
132+
UseOpenGL=false

run.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# run.sh : code_swarm launching script
2+
# need the config file as first parameter
3+
4+
params=$@
5+
default_config="data/sample.config"
6+
code_swarm_jar="dist/code_swarm.jar"
7+
8+
# command line parameters basic check
9+
if [ $# = 0 ]; then
10+
# asking user for a config file
11+
echo "code_swarm project !"
12+
echo -n "Specify a config file, or ENTER for default one [$default_config] : "
13+
read config
14+
if [ ${#config} = 0 ]; then
15+
params=$default_config
16+
else
17+
params=$config
18+
fi
19+
else
20+
if [ $1 == "-h" ] || [ $1 == "--help" ]; then
21+
# if help needed, print it and exit
22+
echo "usage: run.sh <configfile>"
23+
echo ""
24+
echo " data/sample.config is the default config file"
25+
echo ""
26+
exit
27+
else
28+
echo "code_swarm project !"
29+
fi
30+
fi
31+
32+
# checking for code_swarm java binaries
33+
if [ ! -f $code_swarm_jar ]; then
34+
echo "no code_swarm binaries !"
35+
echo "needing to build it with 'ant' and 'javac' (java-sdk)"
36+
echo ""
37+
echo "auto-trying the ant command..."
38+
if ant; then
39+
echo ""
40+
else
41+
echo ""
42+
echo "ERROR, please verify 'ant' and 'java-sdk' installation"
43+
echo -n "press a key to exit"
44+
read key
45+
echo "bye"
46+
exit
47+
fi
48+
fi
49+
50+
# running
51+
if java -Xmx1000m -classpath dist/code_swarm.jar:lib/core.jar:lib/xml.jar:lib/vecmath.jar:. code_swarm $params; then
52+
# always on error due to no "exit buton" on rendering window
53+
echo "bye"
54+
# echo -n "error, press a key to exit"
55+
# read key
56+
else
57+
echo "bye"
58+
fi
59+
60+

0 commit comments

Comments
 (0)