My experience and tips with code_swarm and many questions...

426 views
Skip to first unread message

bp84

unread,
Nov 24, 2010, 5:20:50 PM11/24/10
to codeswarm
Hi,

Well, my experience with code_swarm wasn't so easy, but finally I got
it to work for me and the results are great!

I'll try to summarize everything. First off, I'm using Rictic's fork.
But many things here still apply to the original. Let me explain.

The best result I get is on OSX 10.5.8. What I do is that I git clone
the repository, then add its /bin path to my path:

export PATH=$PATH:path/to/code_swarm/bin/

Then I go the the directory of the project I want to visualize and
simply do: code_swarm
As soon as it starts drawing, I go to the code_swarm menu and I do
quit. Then I look inside the project dir and there's a new
dir: .code_swarm. It contains log.xml (the result of the output of git
log processed by the python convert script - which is all automatic
with Rictic's) and project.config. On my rig, it's THIS .config file
that I have to modify to make things work the way I want i.e. enable
snapshot frames etc. The resulting frames will go to the /frames
folder in the code_swarm folder (NOT the .code_swarm dir in the
project dir I was just talking about). I kept trying to modify the
sample.config file and what not in the code_swarm folder and was
getting no frames and no setting would change anything before I
realized all of this.

Here's the config I use (some of the comments are mine):
-------------------------------------
# This is a sample configuration file for code_swarm - where are those
settings really documented??

# Input file - in the non rictic original code, this will be the
output file (activity.xml) generated by the python script on the
activity.log that was first output from the "git log" command whereas
here this is all done automatically and the end result is found in
the .code_swarm dir in the project repository as log.xml

InputFile=log.xml

#Is the input xml sorted by date? It's faster and uses much less
memory if it is

IsInputSorted=true

##Output
# Save each frame to an image? Use false when testing.

TakeSnapshots=true

# Where to save each frame - That will be a folder in the code_swarm
directory - create it beforehand. Later on if you use ffmpeg, there's
reference to the number of digits here i.e. %05d.png - here I use only
digits.

SnapshotLocation=code_swarm_frames/#####.png

# Color assignment rules
# Keep in order, do not skip numbers. Numbers start
# at 1.
#
# Pattern: "Label", "regex", R,G,B, R,G,B
# Label is optional. If it is omitted, the regex
# will be used.
#
#In some examples, I see rather paths to different folders and there's
no reference to file extensions?? And where does the "misc" type come
from since it appears #during execution but is not referenced here???
#

ColorAssign1="Tests",".*test.*", 153,255,255, 153,255,255
ColorAssign2="Localizations","(.*(\.mo|\.po))|(.*\.lproj.*)",
110,200,90, 110,200,90
ColorAssign3="C",".*(\.c|\.cpp|\.h)", 237,0,0, 237,0,0
ColorAssign4="Python",".*(\.py|\.pyx)", 65,105,225, 65,105,225
ColorAssign5="CSharp",".*(\.cs|\.csproj)", 255,255,0, 255,255,0
ColorAssign6="Other Source Code",".*(\.rb|\.erb|\.hs|\.sql|\.m|\.d|
\.js|\.pl|\.sh|\.lhs|\.hi|\.hpp|\.cat|\.inf|\.sys|\.dll|\.as|\.cmake
\.java)", 255,102,51, 255,102,51
ColorAssign7="Documents/Images",".*(\.txt|\.html|\.tex|\.tmpl|\.css|
\.xml|\.yml|\.json|\.png|\.jpg|\.gif|\.jpeg|README|COPYING|LICENSE|
AUTHORS|\.asciidoc|HACKING)", 238,130,238, 238,130,238

#This is terribly painfully slow on my old mac, in fact it stalls.
Does it carry eye candy???
DrawNamesHalos=false

##Core settings
MaxThreads=4
#I think this will translate to about 1 sec of video for 6 hours of
real time project.
FramesPerDay=144

#Older methods of establishing frames
#MillisecondsPerFrame=21600000
#MillisecondsPerFrame=43200000

#Yeah
UseOpenGL=true

Width=800
Height=600

Font=SansSerif
FontSize=10
BoldFontSize=14

#What the hell are these? Not sure.

DrawFilesSharp=true

# Draw fuzzy files

DrawFilesFuzzy=false

# Draw jelly files

DrawFilesJelly=true

# Show the Legend at start

ShowLegend=true

# Show the History at start - Are there other options to histogram
height/width for instance?

ShowHistory=true

# Show the Date at start

ShowDate=true

# Amount of life to decrement - default -2-2-1 - Not sure about this
either.

EdgeDecrement=-2
FileDecrement=-2
PersonDecrement=-1

#Speeds.
#Optional: NodeSpeed=7.0, If used, FileSpeed and PersonSpeed need not
be #set.
#Left to default

FileSpeed=7.0
PersonSpeed=2.0

#Masses

FileMass=1.0
PersonMass=10.0

# Life of an Edge - An "edge" you say?

EdgeLife=300
EdgeLength=50

##With lots of frames these should be long like this

# Life of a File
FileLife=1000
# Life of a Person
PersonLife=750

HighlightPct=8

#These refer to a text file that contains some other params, any clue
on possible arguments?

PhysicsEngineConfigDir=physics_engine

# Force calculation algorithms ("PhysicsEngineLegacy",
"PhysicsEngineSimple"...) :

PhysicsEngineSelection=PhysicsEngineOrderly

# then place png files named after the usernames of committers in
# the data/local_avatars directory
# data/local_avatars/default.png is used by default
# Uncomment to not use avatars
#AvatarFetcher=NoAvatar
# To use local avatars, uncomment this line:
#AvatarFetcher=LocalAvatar
--------------------------------------------
I really really wish the options in the .config file were better
documented...

So this just works great. But my old Mac is slow so I'd like to run
this under my other rig i.e. Windows XP/Ubuntu. OMG that was a pain.
It's confusing here because I tried both the original code and
Rictic's and I use Rictic's in the same fashion as the original code
because of issues I have with all of this.

First off git: if I ever have to do it manually. The wiki section
about OSX 10.6 and Git here is wrong for me:
http://code.google.com/p/codeswarm/wiki/GeneratingAVideo

There is no git-log command and --name-status is in one block so it
should read like this on one single line and on my XP, this requires
double quotation marks instead of single by the way.:
git log --name-status --
pretty=format:'%n------------------------------------------------------------------------
%nr%h | %ae | %ai (%aD) | x lines%nChanged paths:' > activity.log

Then I'm not even talking of the need for the jdk for the build to
work. I had created as per instructions the JAVA_HOME and also added
the proper python, ant, and jdk to my PATH, but still the building of
code_swarm wouldn't work. It was always referring to JRE6 even thought
all my paths were properly set!!! I found on google I needed to copy
tools.jar from someplace to some other place, most likely put it in
the lib folder, whatever.

Then, the python convert_logs script doesn't work for me under XP. If
I install Python 3.1, it gives a syntax error, if I install 2.7, it
gives and indentation error, both around l 433 or 463 (Ubuntu 10.10
behaves like 2.7 - indentation error - I haven't tested Ubuntu more
than that). It doesn't work. But of course, I can use the log.xml file
from my OSX setup here, whether I'm using the original code or
Rictic's fork. In both cases I can't do the python thing so Rictic's
taking care of this doesn't work and it's complaining about python.
Anyways. But if I edit the .config to input the log.xml file, it's
different...

In this case, what I do under XP is I go to the code_swarm folder,
edit the sample.config file to input my log.xml from my OSX, and run
the run.bat from command inside the code_swarm folder. Yeah, in this
case if I try calling the run.bat inside a project repository, it
complains it's not finding the .class files that are in the code_swarm
folder, and it never creates a .code_swarm folder like it does on my
OSX - go figure. So it'll work if I use the original codeswarms_0.1or
Rictic's, in both cases using almost the same .config file (except for
physics engine Orderly vs. Legacy). But it's visually nicer and
different on Rictic's so I'm using that. Visually it's equal to my OSX
version, the only thing is I can't enable OpenGL, contrary to OSX.
Whether I use the original or rictic's, I get this error when I enable
OpenGL:

java.lang.RuntimeException: You need to use "Import Library" to add
processing.o
pengl.PGraphicsOpenGL to your sketch.
at processing.core.PApplet.createGraphics(PApplet.java:1219)
at processing.core.PApplet.size(PApplet.java:990)
at processing.core.PApplet.size(PApplet.java:934)
at code_swarm.setup(code_swarm.java:190)
at processing.core.PApplet.handleDisplay(PApplet.java:1368)
at processing.core.PGraphics.requestDisplay(PGraphics.java:
690)
at processing.core.PApplet.run(PApplet.java:1542)
at java.lang.Thread.run(Unknown Source)

The only difference is that under the original code, a little 1 inch
by inch java box appears with nothing in it whereas Rictic'c just
writes the error and stays there.

So what is this? I researched, I added this to code_swarm.java in /
src :

import processing.core.PApplet;
import processing.core.PFont;
import processing.core.PImage;
import processing.opengl.PGraphicsOpenGL;

I tried modifying the build.xml to include more of the stuff I found
in the export.txt inside the /lib folder. I admit to not fully
understanding what I'm doing here. If I add these import, ant will
compile fine with no errors, but I get the same error about OpenGL
when I try to do run.bat. I tried modifying run.bat at the java line
to add more jar there like the gluegen-rt etc. Same thing.

And no I don't have the voltron lib. What the hell is that anyway.
What is the fullscreen library that I could remove to fix this? Those
are posts I read on the web. I don't have all the knowledge to
understand this java compiling OpenGL related things. Am I missing
some file from "Processing" or what?? Or maybe the opposite, I should
remove a file somewhere? I would really like any info on this.

Also, I'll dump my env variables under XP:

JAVA_HOME:C:\Program Files\Java\jdk1.6.0_22
PATH:%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:
\Program Files\QuickTime\QTSystem\;C:\apache-ant-1.8.1\bin;C:\Program
Files\Git\cmd;D:\Git_CS\code_swarm\bin;D:\Git_CS\code_swarm\build;D:
\Git_CS\code_swarm;C:\Python27;C:\apache-ant-1.8.1\bin
CLASSPATH:.;C:\Program Files\QuickTime\QTSystem\QTJava.zip;D:\Git_CS
\code_swarm\build

So for XP, in summary, I run from the application folder using a
log.xml file generated on my OSX - because python runs there and does
the conversion. And I can't use OpenGL on XP, whether it's with the
original code swarm or Rictic's, whereas, I can under OSX.

Finally, I use this to encode the .png files under OSX and it's fast
and clean :

ffmpeg -f image2 -r 24 -i %05d.png -sameq filename.mov -pass 2

I took ffmpeg from the package contents of ffmpegX and put it under /
usr/bin or /usr/local/bin I can't remember.

So hope this helps someone maybe...

Any help on these issues would be appreciated!!

Thank you :)

BankP

Farid Zakaria

unread,
Nov 24, 2010, 9:59:18 PM11/24/10
to bp84, codeswarm
Wow. I'll have to try this at work tomorrow.
Thanks! :)

I'll let you know if the steps helped, and if so lets update the wiki!

Farid Zakaria
Software Engineering Undergraduate
University of Waterloo



--
You received this message because you are subscribed to the Google Groups "codeswarm" group.
To post to this group, send email to code...@googlegroups.com.
To unsubscribe from this group, send email to codeswarm+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/codeswarm?hl=en.


bp84

unread,
Nov 25, 2010, 3:59:40 AM11/25/10
to codeswarm
Hi,

Ok, thank you!

Also, during execution, press ? to display a menu and try P for
popular nodes. This setting is nice yet I can't find the switch to
make it automatic in the .config, I've tried ShowPopular, ShowNodes,
ShowFiles=true, whatever.

I also use a few settings differently in my .config file after playing
with the ? menu etc.:

NodeSpeed=7.0
ShowEdges=true - supposedly for debug but I find it highlights
interactions...
DrawFilesFuzzy=true
DrawFilesJelly=true
DrawFilesSharp=false

Also, take a look at the particle.png file in your code_swarm /src
dir. This 50x50 pixel png is what the dots are. So I made one of
60x60. Must be black and white. Better simple with high sharpen of a
feature i.e lens flare one circle with good contrast for example.
Making this png too big makes everything confused I find... but with
the right touch it can add to the visuals, as the dots are drawn
bigger to represent higher usage...

Yes, this app if very nice and I wish you could do even more, like
playing with the histogram size. I just wish I knew how to modify the
code_swarm.java to do this etc.

Hope you have fun with this!

Take care!




On Nov 24, 9:59 pm, Farid Zakaria <farid.m.zaka...@gmail.com> wrote:
> Wow. I'll have to try this at work tomorrow.
> Thanks! :)
>
> I'll let you know if the steps helped, and if so lets update the wiki!
>
> Farid Zakaria
> Software Engineering Undergraduate
> University of Waterloo
>
> ...
>
> read more »

bp84

unread,
Nov 26, 2010, 2:24:41 AM11/26/10
to codeswarm
Questions and some thoughts...

-What's the quickest way to draw only one segment of the log.xml file?
If you want only snapshots from such to such a date. Ok, going in the
xml file is feasable to leave only the entries you want but hey, with
stamps that look like unix time formats or whatever, it's not user
friendly. On a related note, could the content of the xml file go
further in terms of data extraction I mean it contains the email
address of the comitter and the file modified and time stamp. Could it
contain also a weight in terms of "diff" or lines contributed or other
things which in turn could be drawn either seperately or to augment
actual representations? The format should be better documented with
tools to use any type of logs - I think a fork exists for focusing on
specific dev contribution and one for using wiki as source but it's
not unthinkable to have any type of input with simple reformatting
tools... for instance irc logs contain time stamps, user handle,
number of words/sentences per user etc. then in the .config you could
have a rawinput=filename and it would try to parse that.

-.config file options for : popular nodes and histogram. What is the
option to have the popular nodes appear and not have to go through the
"?" menu the "p"? If the histogram could be configurable, that would
be also great. Could these "float" oustide the main window or their
position on the screen be modifyable?

-since the dot is a particle.png in /src, could there be a .config
option like particletimes=1.x so that the size could be modified, like
1.5 times the png etc.? Also, if we use color codes for different file
extensions in the project, couldn't we also use different particle.png
through options in the .config?

-control of the animation: could you zoom in or out? or specify in
the .config an email address that you always want to see appear in the
center, or allow for individual positioning of developpers through
emails with syntax similar to the code coloring in the .config but
instead of rgb you could have x,y? Could an option be introduced to
specify a minimum distance between devs so that they don't overlap
unless certain conditions apply i.e. space constraints? Could an
option be introduced for coloring and changing width of edges i.e. the
lines between devs and code etc.? Can the background color be changed?
Also, maybe having a small scale version of the big picture appearing
i.e. picture in picture would be nice... Finally, maybe a way to
output to snapshots without outputting to sceen for faster process...
with again the parameter in the .config.

I think things like that and better documentation could improve this
outstanding project!

Hope this can help!

Thanks!
> ...
>
> read more »

bp84

unread,
Nov 26, 2010, 3:14:44 AM11/26/10
to codeswarm
Btw, I forgot this line in my .config file I put up here.. I noticed
it when I started playing with the particle.png image:

ParticleSpriteFile=src/particle.png

As I pointed out, making this too big will yield funky visual results.
Also, the .config file settings must be balanced depending on some
factors like lenght of time of the rendering and the number of
contributors. In big projects it can become messy visually, so file
and name time parameters should be reduced, with a small particle..
because when you have 500+ hits on a file over a period of time, you
will see huge dots etc. Obviously you won't also be using a
frameperday of 144 for year long projects. 1 or 2 frames will suffice
for a day, unless you want to stare at opengl fireworks fountains for
hours lollll. Frames per day throttling in real time would be nice...

Thanks!
> ...
>
> read more »

bp84

unread,
Nov 26, 2010, 1:30:26 PM11/26/10
to codeswarm
Here are my "final" .config settings.

Highlights are better colors, better balance for an early/starting dev
project, and also found a few new settings while parsing the
code_swarm.java in /src i.e. background=r,g,b font vs boldfont etc but
still no "Popular Nodes", which I have to trigger manually ("p") which
seem to produce some odd behavior:

------------------------
InputFile=log.xml
IsInputSorted=true
TakeSnapshots=true
SnapshotLocation=code_swarm_frames/#####.png

ColorAssign1="C",".*(\.c|\.cpp|\.h)", 255,0,0, 255,0,0
ColorAssign2="Python",".*(\.py|\.pyx)", 65,105,225, 65,105,225
ColorAssign3="CSharp",".*(\.cs|\.csproj)", 255,255,0, 255,255,0
ColorAssign4="Other Source Code",".*(\.rb|\.erb|\.hs|\.sql|\.m|\.d|
\.js|\.pl|\.sh|\.lhs|\.hi|\.hpp|\.cat|\.inf|\.sys|\.dll|\.as|\.cmake
\.java)", 255,99,71, 255,99,71
ColorAssign5="Documents/Images",".*(\.txt|\.html|\.tex|\.tmpl|\.css|
\.xml|\.yml|\.json|\.png|\.jpg|\.gif|\.jpeg|README|COPYING|LICENSE|
AUTHORS|\.asciidoc|HACKING)", 138,43,226, 138,43,226
ColorAssign6="Tests",".*test.*", 153,255,255, 153,255,255
ColorAssign7="Localizations","(.*(\.mo|\.po))|(.*\.lproj.*)",
110,200,90, 110,200,90

DrawNamesHalos=false
ShowUserName=true
MaxThreads=2
FramesPerDay=144
UseOpenGL=true
Width=800
Height=600
#BoldFont=
Font=SansSerif
FontSize=9
BoldFontSize=10
FontColor=245,245,245
Background=0,0,0
DrawNamesSharp=true
DrawNamesFuzzy=false
DrawFilesFuzzy=true
DrawFilesJelly=true
DrawFilesSharp=false
ShowLegend=true
ShowHistory=true
ShowDate=true
ShowEdges=true
EdgeDecrement=-8
FileDecrement=-3
PersonDecrement=-2
NodeSpeed=7.0
#FileSpeed=5.0
#PersonSpeed=2.0
FileMass=2.0
PersonMass=9.0
EdgeLife=140
EdgeLength=12
FileLife=1000
PersonLife=750
HighlightPct=8
PhysicsEngineConfigDir=physics_engine
PhysicsEngineSelection=PhysicsEngineOrderly
ParticleSpriteFile=src/particle.png
---------------------------------------------

This is a code swarm using those settings and my own 50x50
particle.png :

http://vimeo.com/17218868

Notice I enabled "Popular nodes" on the top right. I can't find the
switch in the .config so I just press "p" as soon as the rendering
starts!!! The code_swarm.java contains a reference to showpopular but
it's not using the .config file for input like the other settings,
it's only waiting for a "p" keystroke...

I encountered some weird behavior pressing "p" early on while doing
snapshots, or maybe it's minimizing the code_swarm window or
something, I would get 12kb frames that were black with a column of
"Legend:" on the left and a column of "Popular Nodes:" on the right...
The weirdest thing. If it started doing that I had to restart my Mac
for this to stop, and when restarted I get only one shot at pressing
"p" before it would do it again??? I lowered maxthread to 1 or 2 and
still I could have that behavior. I had a finder window opened on the /
frames dir that I kept behind the code_swarm window so just the sie
column appears on its right during execution so that I can monitor
the .png output. Mind you my Mac is old so maybe it's related to that!

Finally, I notice you can edit the code_swarm.java in /src then simply
run "ant" in the code_swarm dir to recompile it and early on in the
code you have ParticleSize=2 and changing that will make the particle
bigger but also the histogram bar fatter lolll. Because it's used for
both so you're better off editing the particle.png!!!

Hope that helps!!

Thanks for your interest!
> ...
>
> read more »

Rich

unread,
Nov 26, 2010, 2:14:56 PM11/26/10
to bp84, codeswarm
On 11/26/10 09:24, bp84 wrote:
> Questions and some thoughts...
>
> -What's the quickest way to draw only one segment of the log.xml file?
> If you want only snapshots from such to such a date. Ok, going in the
> xml file is feasable to leave only the entries you want but hey, with
> stamps that look like unix time formats or whatever, it's not user
> friendly.

personally i found just doing limited svn log & converting to xml pieces
i need to fully work for me :)

i haven't checked all the emails to list lately, so maybe my biggest
problem with codeswarm has been mentioned already - although probably not.

and that's "developer circles" all gravitating towards the center of the
area and piling on top of each other... has anybody found a way to
specify sort of a minimum distance between developer nodes ?
...
--
Rich

Farid Zakaria

unread,
Nov 26, 2010, 2:21:41 PM11/26/10
to Rich, bp84, codeswarm
My issues were specifically working it with perforce. I still havn't managed to try bp84's suggestions at the start of this thread (plan to).

Maybe allso bp84 you can just attach your config file versus copy/paste?

Thanks:)

Farid Zakaria
Software Engineering Undergraduate
University of Waterloo


bp84

unread,
Nov 26, 2010, 5:24:27 PM11/26/10
to codeswarm
Hi,

Thanks for your suggestion about better tailoring my source logs...
just means I have to learn git a bit more. Will try!

As for the devs gravitating towards the center, I don't find that's
happening all that much for me, I mean with a small startup project
like the one I've used for the video I posted. I'm using the
PhysicsOrderly engine from Rictic's fork. But to better prototype your
concern I cloned the repo of "git" itself with years of dev and set
frameperday=2. Sure soon enough it was a fountain of openGL stars and
it's pretty but useless... I find what helped was setting aggressively
PersonDecrement= to -10 or -15 to help clear a lot of the clutter and
it's still intense but much clearer, and I guess PersonLife could help
if shortened. I guess you have to play with those settings and others
depending on what you want to clear up but the decrement settings can
remove lots of clutter as I said and the same can be done with Files.

But yeah it would be nice if the icons would "bounce" of each other I
guess but soon space would be missing for huge projects unless a very
high res. would be used with the processing power... what resolution
do you use and what settings?

---

Farid, well I'd gladly attach the .config but I have no such feature
I'm using this straigtht from my browser. But I'm using the latest I
posted. I adapt the .config for each project, mainly based on # of
devs etc like I just explained. I just discovered code_swarm days ago,
I'm not even a developper so I can't do java except I can move a bit
the positioning of items like popular nodes and the legend, having a
hard time playing with that histogram... rect(x,y,width,height) loll
so it's really trial and error for me.

---

Hope you guys can make it work to your liking!!!

Thanks for replying!!

bp84

bp84

unread,
Nov 26, 2010, 5:43:36 PM11/26/10
to codeswarm
I just modified the code_swarm.java and then I do "ant" in the
code_swarm dir to recompile it..:

boolean showPopular = true; ##so that it appears automaticaly -
popular nodes

and the popular nodes list position... a simply one

/**
* TODO This could be made to look a lot better.
*/
public void drawPopular() {
CopyOnWriteArrayList <FileNode> al=new
CopyOnWriteArrayList<FileNode>();
noStroke();
textFont(font);
textAlign(LEFT, TOP);
fill(fontColor, 200);
text("Popular Nodes (touches):", 3, 105);
for (FileNode fn : nodes.values()) {
if (fn.qualifies()) {
// Insertion Sort
if (al.size() > 0) {
int j = 0;
for (; j < al.size(); j++) {
if (fn.compareTo(al.get(j)) <= 0) {
continue;
} else {
break;
}
}
al.add(j,fn);
} else {
al.add(fn);
}
}
}

int i = 1;
ListIterator<FileNode> it = al.listIterator();
while (it.hasNext()) {
FileNode n = it.next();
// Limit to the top 10.
if (i <= 10) {
text(n.name + " (" + n.touches + ")", 10, 105 + (10 * i++));
} else if (i > 10) {
break;
}
}
}

Just added that 3,10,105 to align the popular nodes list under the
Legend that is on the top left because I find it more convenient like
that. But don't ask more of me in java really lolll. As I said I tried
playing with the histogram but I'm bad at this. I wish I could make
the histogram shorter than 320px, maybe only 100, but with lots of
vertical in the spikes, that looks more like a "widget" sort of thing.
I wish I could "box" those elements(Legend, popular nodes, histogram)
so that dots and devs can't "get in" etc.

Seems like it's going to be lots of work for someone like me lolll.

Take care!

bp84

bp84

unread,
Nov 27, 2010, 2:20:58 AM11/27/10
to codeswarm
Btw the physicsengineorderly.java contains these comments...

@brief A modification of the Legacy engine to prevent people from
piling up in the center

So you might want to check that out... As I said I don't have much
pilling up, just too much stuff happening so this can be trimmed with
settings as disussed. I guess someone could play around with the
engine to go further into behavior...

Take care!

bp84

unread,
Nov 27, 2010, 3:47:37 AM11/27/10
to codeswarm
Along the lines of time limiting the render, if found out you just
have to do this with git in your project's repository:

git pull
git log --since(or use also "--until" I think)=YYYY/MM/DD --name-
status --
pretty=format:'%n------------------------------------------------------------------------
%nr%h | %ae | %ai (%aD) | x lines%nChanged paths:' > activity.log

Then use the convert script in the code_swarm/bin:

python convert_logs.py -g <PATH TO YOUR GIT REPO>/activity.log -o
activity.xml

Then take that activity.xml and rename it to log.xml and put it in
the .code_swarm dir of your project repo, making sure your .config
that's there also reflects that input file. (InputFile=log.xml)

And voila!

Thanks!

Nawglan

unread,
Nov 27, 2010, 1:09:59 PM11/27/10
to code...@googlegroups.com
The config setting to show the legend is:
ShowLegend = true

There are also, ShowHistory (histogram), ShowDate (in bottom right
corner), and ShowEdges (draws line between nodes)

Here's my config for a project I'm working on at work:

# This is a sample configuration file for code_swarm (rictic)

# Frame width
Width=1280
#Width=640
#Width=1920

# Frame height
Height=762
#Height=480
#Height=1080

# Input file
InputFile=data/data.xml

#Font Settings
Font=SansSerif
FontSize=10

BoldFont=SansSerif
BoldFontSize=14

# Particle sprite file
ParticleSpriteFile=particle.png

# Project time per frame
#MillisecondsPerFrame=21600000

# Optional Method instead of MillisecondsPerFrame
FramesPerDay=10

MaxThreads=8

# Background in R,G,B
Background=0,0,0

# Color assignment rules
# Keep in order, do not skip numbers. Numbers start
# at 1.
#
# Pattern: "Label", "regex", R,G,B, R,G,B
# Label is optional. If it is omitted, the regex
# will be used.
#

ColorAssign1="Dojo",".*/dojo.*", 226,18,255, 226,18,255
ColorAssign2="Ajax",".*/ajax/.*", 255,0,0, 255,0,0
ColorAssign3="Components",".*/components/.*", 255,121,40, 255,121,40
ColorAssign4="Docs",".*/docs/*", 0,255,0, 0,255,0
ColorAssign5="S1000D",".*/S1000D/.*|.*/s1000d/.*", 255,192,40, 255,192,40
ColorAssign6="2361C",".*/2361C.*|.*/2361c.*", 192,255,240, 192,255,240
ColorAssign7="Sage",".*/sage/.*|.*/sagebundle/.*", 132,255,48, 132,255,48
ColorAssign8="HPUX",".*/hpux/.*", 48,70,255, 48,70,255
ColorAssign9="cgi-bin",".*/cgi-bin/.*", 127,249,255, 127,249,255
ColorAssign10="Data",".*/data/*", 152,127,255, 152,127,255
ColorAssign11="Libs",".*/lib/.*", 141,62,255, 141,62,255
ColorAssign12="Images",".*/icons/.*|.*/img/.*|.*\.gif|.*\.png",
244,255,118, 244,255,118
ColorAssign13="Web",".*/templates/.*|.*/css/.*|.*/wwwroot/.*",
255,118,214, 255,118,214

# Save each frame to an image?

TakeSnapshots=true

# Where to save each frame

SnapshotLocation=frames/frame-#####.png

# Draw names (combinatory) :
# Draw sharp names?
DrawNamesSharp=true
# And draw a glow around names? (Runs slower)
DrawNamesHalos=false

# Draw files (combinatory) :
# Draw sharp files
DrawFilesSharp=false
# Draw fuzzy files
DrawFilesFuzzy=true
# Draw jelly files
DrawFilesJelly=false

# Show the Legend at start
ShowLegend=true

# Show the History at start

ShowHistory=false

# Show the Date at start
ShowDate=true

# Show edges between authors and files, mostly for debug purpose
ShowEdges=false

# Turn on Debug counts.
ShowDebug=false

# Natural distance of files to people
EdgeLength=35

# Amount of life to decrement

EdgeDecrement=-2
FileDecrement=-2
PersonDecrement=-1

#Speeds.
#Optional: NodeSpeed=7.0, If used, FileSpeed and PersonSpeed need not be set.
#
FileSpeed=7.0
PersonSpeed=1.0

#Masses
FileMass=1.0
PersonMass=100.0

# Life of an Edge

EdgeLife=250

# Life of a File

FileLife=225

# Life of a Person

PersonLife=255

# Highlight percent.
# This is the amount of time that the person or
# file will be highlighted.
HighlightPct=5

## Physics engine selection and configuration
# Directory physics engine config files reside in.


PhysicsEngineConfigDir=physics_engine
# Force calculation algorithms ("PhysicsEngineLegacy",
"PhysicsEngineSimple"...) :

#PhysicsEngineSelection=PhysicsEngineMaxwellsDemon
PhysicsEngineSelection=PhysicsEngineOrderly

#Is the input xml sorted by date? It's faster and uses much less
memory if it is
IsInputSorted=true

UseOpenGL=false

GravatarFallback=wavatar
AvatarSize=25

bp84

unread,
Nov 27, 2010, 3:40:53 PM11/27/10
to codeswarm
Thank you!

But I wasn't talking about the "legend", which indeed is triggered by
ShowLegend=true. I was talking about the "Popular nodes(touches)",
which shows files mostly touched, in real time, and which can only be
triggered by pressing "p" when the animation starts.

But recompiling codeswarm.java with "boolean showPopular = true" will
do the trick!

Finally, looking at your config, I find "persondecrement=-1" to be
"not enough" when there's too much action. -8 or -10 will clear up the
visuals a lot...

Take care!

bp84

unread,
Nov 27, 2010, 3:51:29 PM11/27/10
to codeswarm
One thing I haven't tried in your config is "personMass" with a high
value like you (100)... I use "9"... my impression was a high mass
made the devs and files move all over the place before "settling
down"... I will try!

Thanks again!

bp84

unread,
Nov 28, 2010, 2:22:19 AM11/28/10
to codeswarm
Hi!

Well, I have tried PersonMass=100 and I don't see a big difference...
maybe the dots remain more stable around the dev with that when lots
of things happen, or the devs move less I'm not sure. With a very high
value like 1000, the devs seem to move slower and "brake" often...
Maybe it makes sense to set it like at 100 like in your config.

I've come to the conclusion that there is no such perfect config after
all. It all depends on the timeframe rendered, framesperday used and
screen real estate vs performance. I find as I said before that for a
shorter time interval project, longer life for objects and smaller
decrement will reveal many things, whereas for a years spanning
projects, shortlived objects may be required to provide a clear
picture of what's really happening... But I still don't fully
understand those options...

Take care!

bp84

bp84

unread,
Nov 28, 2010, 5:41:07 AM11/28/10
to codeswarm
For use with Framesperday=144 because with 144 you can see the hours
passing by....in codeswarm.java changed this line to provide TIME with
the date:

// Formats the date string nicely
DateFormat formatter = DateFormat.getDateTimeInstance();

Don't know how to make date and time 2 separate lines later on in the
code but that'll do for now!!

Thank you!

bp84

Farid Zakaria

unread,
Nov 30, 2010, 2:05:55 PM11/30/10
to bp84, codeswarm
@bp84,

I finally had a chance to look over the Rictic's fork and your steps.
It seems tailored only for non Perforce repositories (git or SVN).

Do you have any experience getting it to run with perforce?

Thanks,

Farid Zakaria
Software Engineering Undergraduate
University of Waterloo


bp84

unread,
Dec 1, 2010, 12:12:36 AM12/1/10
to codeswarm
Hi Farid,

I have never even heard of Perforce in my entire life. I'm not a
developer so I don't use git, svn or perforce, but reading a little
bit I saw that perforce is a similar concept. DVCS. First it would be
helpful if you indicated your platform and hardware. In 5 minutes
research I could see this:

-You have options to output logs in perforce I think "p4 changes" and
"p4 describe":

p4 [g-opts] changes [-i -t -l -L -c client -m max -s status -u user]
[file[RevRange]...]

http://www.perforce.com/perforce/r10.1/manuals/cmdref/describe.html#1040665

So it's possible to output something to file... and rename it
activity.log or whatever so this can yield a log file which can then
be converted with the python script, look at some examples here :

http://code.google.com/p/codeswarm/wiki/GeneratingAVideo. But that's
beside the point.

When you look inside the converts_log.py file you see this line early
on:

p.add_option( "-p", "--perforce-path", dest="perforce_path",
metavar="<log file>", help="get data from perforce and save it to
standard event xml")

then later in the code you see:

def parse_perforce_path(file_handle, opts):
changelists = run_marshal('p4 -G changelists "' +
opts.perforce_path + '"')
file_key_re = re.compile("^depotFile")
for changelist in changelists:
files = run_marshal('p4 -G describe -s "' +
changelist['change'] + '"')
for fi in files:
for key_name, file_name in fi.iteritems():
if file_key_re.match(key_name):
yield Event(file_name, int(changelist['time'] +
'000'), changelist['user'])



def run_marshal(command):
import marshal

# run marshal.load in a loop
results = []
stream = os.popen(command,'rb')
try:
while 1:
results.append(marshal.load(stream))
except EOFError:
pass
stream.close()
return results

class Event(object):
""" Event to hold all of the separate events as we parse them from
the logs. """

def __init__(self, filename, date, author):
self.filename = filename
self.date = date
self.author = author

def properties(self):
"""returns a dict of properties and their names for XML
serialization"""
return {
"date": str(self.date),
"filename": self.filename,
"author": self.author
}

# Some version control system's logs are not in chronological
order, so
# this compare method will return a compare of the date
attributes.
def __cmp__(self, other):
return cmp(self.date, other.date)
---------
so actually it uses p4 -G changelists and describes. Whatever.

So it means that using "python convert_logs.py -p --(don't know if the
-- is required as this wasn't for git see above posts)/
pathtoperforcerepo -o activity.xml" will yield an xml formatted file
that can be used.

This would all be what you would do if you needed to do this manually,
but I think you can just run code_swarm inside your perforce repo as I
did with a git repo(or would you need to run it inside a special dir
in your repo that is used to dump logs??), because I believe the
process is automatic with Rictic's and the output file will be log.xml
in the dir .code_swarm inside your perforce repo. If it ends up not
working like that, you can extract manually and convert the data as
explained here... the final .xml file is nothing more than something
like this:

<?xml version="1.0" encoding="utf-8"?>
<file_events><event date="1131165012000" author="jun...@cox.net"
filename="git-svnimport.perl"></event> etc. other events like this
then </file_events>

and that's it. If you or anyone knows a quick way to convert the
"event date" string to a normal date let me know!

I'm sure there's enough info in this thread now for you to make many
tests with this!!

Hope it works and don't hesitate to document your experience!

Take care!

bp84



On Nov 30, 2:05 pm, Farid Zakaria <farid.m.zaka...@gmail.com> wrote:
> @bp84,
>
> I finally had a chance to look over the Rictic's fork and your steps.
> It seems tailored only for non Perforce repositories (git or SVN).
>
> Do you have any experience getting it to run with perforce?
>
> Thanks,
> Farid Zakaria
> Software Engineering Undergraduate
> University of Waterloo
>
> > codeswarm+...@googlegroups.com<codeswarm%2Bunsu...@googlegroups.com>
> > .

bp84

unread,
Dec 1, 2010, 12:29:14 AM12/1/10
to codeswarm
Also, take a look at this:

https://github.com/gmcnew/code_swarm/commit/9300c2ed165c96b3c6c9707d0230583d05fe9862

on sept. 10th of this year... the author of the code states that
perforce repo analyzing was broken in the convert_logs.py script so he
submitted a pull request for 1 line modification, which you can try in
your script if you have issues...:

l.126 - author GMCNEW:
- create_event_xml(parse_perforce_path(opts.perforce_path),
output)
+ create_event_xml(parse_perforce_path(opts.perforce_path,
opts), output)

Hope this helps!

bp84

On Dec 1, 12:12 am, bp84 <bank.pa...@gmail.com> wrote:
> Hi Farid,
>
> I have never even heard of Perforce in my entire life. I'm not a
> developer so I don't use git, svn or perforce, but reading a little
> bit I saw that perforce is a similar concept. DVCS. First it would be
> helpful if you indicated your platform and hardware. In 5 minutes
> research I could see this:
>
> -You have options to output logs in perforce I think "p4 changes" and
> "p4 describe":
>
> p4 [g-opts] changes [-i -t -l -L -c client -m max -s status -u user]
> [file[RevRange]...]
>
> http://www.perforce.com/perforce/r10.1/manuals/cmdref/describe.html#1...
> ...
>
> read more »

Rich

unread,
Dec 1, 2010, 2:38:30 AM12/1/10
to bp84, codeswarm
On 12/01/10 07:12, bp84 wrote:
...

> <?xml version="1.0" encoding="utf-8"?>
> <file_events><event date="1131165012000" author="jun...@cox.net"
> filename="git-svnimport.perl"></event> etc. other events like this
> then</file_events>
>
> and that's it. If you or anyone knows a quick way to convert the
> "event date" string to a normal date let me know!

on the commandline for unix timestamp :

date -d@<timestamp>

these also seem to include milliseconds, so for this specific case it
might be :

> date -d@1131165012
Sat Nov 5 06:30:12 EET 2005

note the timezone and dst differences !

> I'm sure there's enough info in this thread now for you to make many
> tests with this!!
>
> Hope it works and don't hesitate to document your experience!
>
> Take care!
>
> bp84

...
--
Rich

Wirt Wolff

unread,
Dec 1, 2010, 2:52:56 AM12/1/10
to bp84, codeswarm
Excerpts from bp84's message of Tue Nov 30 22:12:36 -0700 2010:

>
> ... the final .xml file is nothing more than something like this:
>
> <?xml version="1.0" encoding="utf-8"?>
> <file_events><event date="1131165012000" author="jun...@cox.net"
> filename="git-svnimport.perl"></event> etc. other events like this
> then </file_events>
>
> and that's it. If you or anyone knows a quick way to convert the
> "event date" string to a normal date let me know!

I mostly use bash's "date" from gnu coreutils. Really old versions
don't have this, but I think most current systems would. There are
also ways in perl, python... every language has its own mess of date
and time tools.

Anyway, with plain old bash, say you want to use a variable $cs_time
to store various xml dates to check a few times in the shell via reverse
history search, or to build into a script. The code swarm event
xml uses three extra zeros compared to shell epoch time. This might
be a java or python thing. They probably want to be able to specify
dates later than the year 2286. so that's why the ${xxx:0:10} stuff
is in the following.

(You can also use 'date -f some_file_of_cs_dates' on a bunch at once
instead of 'date-d'.)

$ cs_time=1131165012000
$ #
$ # locale time
$ date -d @${cs_time:0:10}
Fri Nov 4 21:30:12 MST 2005
$ #
$ # universal time
$ date -ud @${cs_time:0:10}
Sat Nov 5 04:30:12 UTC 2005
$ #
$ # You can add formatting too. See man date.
$ #
$ date -ud @${cs_time:0:10} +%F
2005-11-05
$ date -ud @${cs_time:0:10} +'%F %X'
2005-11-05 04:30:12 AM
$ #
$ # current locale epoch time for comparison
$ date +%s
1291189351

Hope that helps. Thanks for sharing your experiences and enthusiasm
about codeswarm in this thread.
--
wmw

bp84

unread,
Dec 1, 2010, 11:35:51 AM12/1/10
to codeswarm
Hi!

Thank you both Rich and Wirt for your insights about the 'date'
command in bash! I'll keep your info for future reference. What was
great is that you made me understand the 3 extra digits so I can use a
tool like http://www.onlineconversion.com/unix_time.htm to finally do
a quick conversion whereas if I kept the 000, it gave me funky
results. Now it works and it's useful when you're inside the xml log
file.

I'm using code_swarm on my old Mac but I mainly use WinXP for everyday
use, and I also have Ubuntu.

Funniest thing is that OS X 10.5.8 has bash 3.2 for terminal yet that
'date' command doesn't support the usage you described.... ah Steve
what did you do to bash!!!

Honestly if it wasn't for the fact that I can't enable the UseOpenGL
option in code_swarm I would be using all of this in WinXP(more on
openGL later on) because it's my main machine. But only OSX allows me
to use OpenGL and has the terminal I like to use! I find using command
prompt in windows to be such a pain really. Unix is so great compared
to that!

Anyways I digress,
Thank you guys!

Have a nice day!

bp84

Rich

unread,
Dec 1, 2010, 12:17:29 PM12/1/10
to bp84, codeswarm
On 12/01/10 18:35, bp84 wrote:
> Hi!
>
> Thank you both Rich and Wirt for your insights about the 'date'
> command in bash! I'll keep your info for future reference. What was
> great is that you made me understand the 3 extra digits so I can use a
> tool like http://www.onlineconversion.com/unix_time.htm to finally do
> a quick conversion whereas if I kept the 000, it gave me funky
> results. Now it works and it's useful when you're inside the xml log
> file.
>
> I'm using code_swarm on my old Mac but I mainly use WinXP for everyday
> use, and I also have Ubuntu.
>
> Funniest thing is that OS X 10.5.8 has bash 3.2 for terminal yet that
> 'date' command doesn't support the usage you described.... ah Steve
> what did you do to bash!!!

note that 'date' is not bash builtin. osx either has some bsd variant of
it, or maybe outdated gnu one (see --version output). but that's a bit
offtopic for this list :)

> Honestly if it wasn't for the fact that I can't enable the UseOpenGL
> option in code_swarm I would be using all of this in WinXP(more on
> openGL later on) because it's my main machine. But only OSX allows me
> to use OpenGL and has the terminal I like to use! I find using command
> prompt in windows to be such a pain really. Unix is so great compared
> to that!
>
> Anyways I digress,
> Thank you guys!
>
> Have a nice day!

...
--
Rich

bp84

unread,
Dec 1, 2010, 1:55:04 PM12/1/10
to codeswarm
Hey thanks for the info! Just shows my level of inexperience Unix and
Linux! And it is off topic... :)

So here's something on topic... ;)

Code_swarm doesn't work for me with UseOpenGL under WinXP SP3. I
decided I'd document this entirely.

Running a stock run.bat with UseOpenGL=true gives me this error:

Exception in thread "Animation Thread" java.lang.RuntimeException: You
need to use "Import Library" to add processing.opengl.PGraphicsOpenGL
to your sketch.
at processing.core.PApplet.makeGraphics(PApplet.java:1165)
at processing.core.PApplet.size(PApplet.java:970)
at processing.core.PApplet.size(PApplet.java:930)
at code_swarm.setup(code_swarm.java:195)
at processing.core.PApplet.handleDraw(PApplet.java:1372)
at processing.core.PApplet.run(PApplet.java:1300)
at java.lang.Thread.run(Unknown Source)

I mean, so be it, but I don't even know what a "sketch" is so I tried
many things I read in different posts to fix this:

-modifying the build.xml to list more libraries like this since ant
uses this, I thought it would "link" the stuff:
...
<target name="build" depends="init" description="Compiles">
<echo>Running BUILD</echo>
<mkdir dir="${build}" />
<path id="library.classpath">
<pathelement path="lib/" />
<pathelement location="lib/core.jar" />
<pathelement location="lib/xml.jar" />
<pathelement location="lib/jogl.jar" />
<pathelement location="lib/opengl.jar" />
<pathelement location="lib/vecmath.jar" />
<pathelement location="lib/svnkit.jar" />
<pathelement location="lib/swing-layout-1.0.3.jar" />
<pathelement location="lib/gluegen-rt.jar" />
<pathelement location="lib/jogl.dll" />
<pathelement location="lib/jogl_awt.dll" />
<pathelement location="lib/jogl_cg.dll" />
<pathelement location="lib/jogl-natives-windows-i586.jar" />
<pathelement location="lib/lib/libgluegen-rt.jnilib" />
<pathelement location="lib/libjogl.jnilib" />
<pathelement location="lib/libjogl_awt.jnilib" />
<pathelement location="lib/libjogl_cg.jnilib" />
<pathelement location="lib/tools.jar" /> ---this one comes
from the jdk in /lib, I put a copy in code_swarm/lib
<pathelement location="lib/jogl-natives-linux-i586.jar" />
<pathelement location="lib/jogl-natives-macosx-universal.jar" /
>
<pathelement location="lib/jogl-natives-macosx-ppc.jar" />
<pathelement location="lib/libjogl_awt.so" />
<pathelement location="lib/libjogl_cg.so" />
<pathelement location="lib/libjogl_drihack.so" />
<pathelement location="lib/libjogl.so" />
</path>
...
-adding import javax.media.opengl.*; and import processing.opengl.*;
and/or specifically import processing.opengl.PGraphicsOpenGL; or
anything that comes from http://en.wikipedia.org/wiki/Java_OpenGL (the
imports in the examples) to the beginning of codeswarm.java in /src
and recompiling with 'ant' (don't have the patience to add all these
imports to all source files... should I??) Don't laugh lolll.
-trying to extract the class files from all the libs and putting them
all over the dir tree so that they can be "picked up" since the java
paths and classpath and JAVA_HOME finally confuses me and the app was
complaining about specific missing classes, even though they're inside
the jars in the /lib dir.
-trying along those lines to extract missing class files and repacking
them inside the code_swarm.jar

As you can see, I'm trying real hard. All these things failed. Then I
was inspired by the export.txt file in the /lib dir. So I decided I
would add stuff to the java call line in the run.bat. As I was adding
things, the error messages changed and it was clear I was going
somewhere. Finally I put everything I could find in my /lib dir so it
looks like this:

java -Xmx1000m -classpath dist/code_swarm.jar;lib/core.jar;lib/
xml.jar;lib/vecmath.jar;lib/opengl.jar;lib/jogl.dll;lib/
jogl_awt.dll;lib/jogl_cg.dll;lib/jogl-natives-windows-i586.jar;lib/
gluegen-rt.jar;lib/jogl-natives-linux-i586.jar;lib/jogl-natives-macosx-
ppc.jar;lib/jogl-natives-macosx-universal.jar;lib/jogl.jar;lib/
svnkit.jar;lib/swing-layout-1.0.3.jar;lib/xml.jar;lib/tools.jar;lib/
libjogl_awt.so;lib/libjogl_cg.so;lib/libjogl_drihack.so;lib/
libjogl.so;lib/libgluegen-rt.jnilib;lib/libjogl.jnilib;lib/
libjogl_awt.jnilib;lib/libjogl_cg.jnilib;. code_swarm %params%

Now I got this when I do run.bat:

Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError:
no jogl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at
com.sun.opengl.impl.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:
189)
at com.sun.opengl.impl.NativeLibLoader.access
$000(NativeLibLoader.java:49)
at com.sun.opengl.impl.NativeLibLoader
$DefaultAction.loadLibrary(NativeLibLoader.java:80)
at
com.sun.opengl.impl.NativeLibLoader.loadLibrary(NativeLibLoader.java:
103)
at com.sun.opengl.impl.NativeLibLoader.access
$200(NativeLibLoader.java:49)
at com.sun.opengl.impl.NativeLibLoader
$1.run(NativeLibLoader.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at
com.sun.opengl.impl.NativeLibLoader.loadCore(NativeLibLoader.java:109)
at
com.sun.opengl.impl.windows.WindowsGLDrawableFactory.<clinit>(WindowsGLDrawableFactory.java:
60)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:
106)
at
processing.opengl.PGraphicsOpenGL.allocate(PGraphicsOpenGL.java:170)
at processing.core.PGraphics3D.setSize(PGraphics3D.java:316)
at processing.core.PApplet.makeGraphics(PApplet.java:1137)
at processing.core.PApplet.size(PApplet.java:970)
at processing.core.PApplet.size(PApplet.java:930)
at code_swarm.setup(code_swarm.java:194)
at processing.core.PApplet.handleDraw(PApplet.java:1372)
at processing.core.PApplet.run(PApplet.java:1300)
at java.lang.Thread.run(Unknown Source)

So then I looked at the run.sh to compare a bit... I saw it includes
one element that the run.bat doesn't include insofar as the java line
is concerned: -Djava.library.path=lib/ so I added this to my run.bat
and it looks like this now:

java -Xmx1000m -classpath dist/code_swarm.jar;lib/core.jar;lib/
xml.jar;lib/vecmath.jar;lib/opengl.jar;lib/jogl.dll;lib/
jogl_awt.dll;lib/jogl_cg.dll;lib/jogl-natives-windows-i586.jar;lib/
gluegen-rt.jar;lib/jogl-natives-linux-i586.jar;lib/jogl-natives-macosx-
ppc.jar;lib/jogl-natives-macosx-universal.jar;lib/jogl.jar;lib/
svnkit.jar;lib/swing-layout-1.0.3.jar;lib/xml.jar;lib/tools.jar;lib/
libjogl_awt.so;lib/libjogl_cg.so;lib/libjogl_drihack.so;lib/
libjogl.so;lib/libgluegen-rt.jnilib;lib/libjogl.jnilib;lib/
libjogl_awt.jnilib;lib/libjogl_cg.jnilib;. -Djava.library.path=lib/
code_swarm %params%

And this seems to solve some of it because it doesn't complain about
"no jogl in java.library.path" anymore but I get another (final)
error:

Exception in thread "Animation Thread" java.lang.RuntimeException:
java.lang.IllegalArgumentException: argument type mismatch
at
com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.newPlatformInfo(JAWT_DrawingSurfaceInfo.java:
86)
at
com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.platformInfo(JAWT_DrawingSurfaceInfo.java:
52)
at
com.sun.opengl.impl.windows.WindowsOnscreenGLDrawable.lockSurface(WindowsOnscreenGLDrawable.java:
189)
at
com.sun.opengl.impl.windows.WindowsOnscreenGLContext.makeCurrentImpl(WindowsOnscreenGLContext.java:
57)
at
com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
at
processing.opengl.PGraphicsOpenGL.detainContext(PGraphicsOpenGL.java:
224)
at
processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:269)
at processing.core.PApplet.handleDraw(PApplet.java:1365)
at processing.core.PApplet.run(PApplet.java:1300)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.newPlatformInfo(JAWT_DrawingSurfaceInfo.java:
83)
... 9 more

Whether I put the import lines in codeswarm.java or not changes
nothing here.

What the hell. This is beyond my skill. The code_swarm window appears
but remains blank (white). And I have to close to terminate the
process... This is where I'm at right now trying to run code_swarm
with UseOpenGL=true on my WinXP rig. Of course it runs without OpenGL
but it's slow!!!!

Finally, I found somewhere someone who had the following error, which
I had at some point and I thought it was my real error:

Exception in thread "Animation Thread" java.lang.NullPointerException
at code_swarm.loadRepEvents(code_swarm.java:880)
at code_swarm.setup(code_swarm.java:315)
at processing.core.PApplet.handleDraw(PApplet.java:1372)
at processing.core.PApplet.run(PApplet.java:1300)
at java.lang.Thread.run(Unknown Source)

This seemingly complex error (for me) happens because I mistyped the
java command in the run.bat file : the java line should finish by
%params% and I had typed $params%, which generates this error. This
happens to people who play a lot adding library paths to their
run.bat. I realized tons of errors can be generated with spaces and
wrong punctuation inside run.bat, especially for the java command
line. Java parameters are finicky. So it's a false error here.

So that's it. Sorry if this is a bit repetitive and long. I just
wanted to make sure it's clearly documented.

I just have this feeling that I'm missing some java classes on my
machine... something else than the JDK? Are all those opengl things
inside my jdk and jre? Or is it my hardware because this is a netbook
atom n270 with Intel GMA 945 express? At least with this info someone
with XP and a Nvidia or ATI card can test this and post if he gets
those same errors...

Hopefully I'll figure it out at some point!

Thank you for your interest!

Good day to you!

bp84

On Dec 1, 12:17 pm, Rich <ric...@nakts.net> wrote:
> On 12/01/10 18:35, bp84 wrote:
>
>
>
> > Hi!
>
> > Thank you both Rich and Wirt for your insights about the 'date'
> > command in bash! I'll keep your info for future reference. What was
> > great is that you made me understand the 3 extra digits so I can use a
> > tool likehttp://www.onlineconversion.com/unix_time.htmto finally do

bp84

unread,
Dec 1, 2010, 3:44:35 PM12/1/10
to codeswarm
Hi,

A good idea to make sure that everything in /lib gets parsed by
run.bat i.e. the java command with classpath, without having to
tediously edit run.bat all the time is referenced to here:

http://groups.google.com/group/codeswarm/browse_thread/thread/bdad5d0e12e2f19d#

+if java -Xmx1000m -classpath dist/code_swarm.jar:`ls lib/*.jar | tr
'\n' ':'`:. code_swarm $params; then

I want to do this for WinXP but of course there is no "ls" and what is
that "| tr '\n' ':'`"? Translate characters with a new line... The ':'
is what separates the entries. I guess it removes the CR between
entries of the "ls" output then puts ":" in between each...

This of course doesn't solve my issue but just makes it easier to
test... for instance if I decide to update or add more files from
http://jogamp.org/jogl/www/ ??
to my /lib dir. I've tried quickly already to extract files from the
website to the dir and I get different errors, meaning maybe some of
the errors I had before were solved and new ones appear?? At the same
time I think the blank app window didn't appear at all so maybe this
isn't going in the good direction...

We'll see...

Thank you!
> %params% and I had typed $params%, which generates this error. This ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages