Barebones application for visualizing swarms (2D)
by Vershun on May.16, 2009, under Visualizing Swarms
So I’ve decided to play around a bit for my own giggles and make some swarm stuff. Emergent behavior is the bee’s knees and I think it will be a lot of fun to code up some visual representations of it.
This is the very first step in the processes. It’s not quite a “framework,” but more of a template. Click to activate the ants, slide to change the speed.
You can right click and view source. The code is very rudimentary and the only slightly interesting part is how the ants decide to move.
var stuckCounter:int = 90;
do
{
var randomAngle:uint = rotation + ((Math.random() * stuckCounter) - (stuckCounter / 2));
var randomDistance:uint = Math.random() * 70 + 10;
var randX:int = randomDistance * Math.cos(randomAngle * (Ant.TO_RADIANS));
var randY:int = randomDistance * Math.sin(randomAngle * (Ant.TO_RADIANS));
stuckCounter++;
} while (environment.isObstructionInPath(x, y, x + randX, y + randY));
The code is pretty self explanatory (hopefully), but basically the ant is choosing a random direction within its scope (45 degrees both left and right of it’s current rotation), generates a random distance to travel, and checks with the environment to make sure there’s no obstructions within its projected trajectory. If there’s an obstruction, add 1 degree to the randomizer and repeat. Using randomly chosen angles along with a slow increase in the randomized range helps give a more realistic look of obstacle avoidance than other methods (say, flipping rotation).
I’ll be adding more to this section when I get some motivated down time to play, but this week it’s all about the R&R.
Some Meetings this Week
by Vershun on Apr.16, 2009, under Random
What: Off-the-wagon AA Meeting
Where: Alley behind Pat’s Pub
When: Sunday 3AM
Topic: This meeting will mainly be for warmth. Dan said he’ll bring the booze.
What: Smokers Break Group
Where: Right outside the building
When: During the time we should be working
Topic: We will vary topic of conversation from the latest office gossip to newest cancer treatments.
What: Consortium of Public School Students
Where: Karen’s Mom’s Basement
When: Tuesday after school
Topic: We will delve into the proper use and handling of handheld firearms. Moving target practice afterward for interested parties.
What: Hipster Colloquium
Where: The local coffee shop. No, not THAT corporate trash one, the other one.
When: Jill’s break
Topic: We’ll pseudo-intellectually complain about important things such as society, government, and foreign affairs. Other issues that we’re too worthless to ever change will also be discussed. Toward the end of the meeting we’ll express our overwhelming individuality by discussing obscure music we all listen to and planning new fleeting trends that we all follow.
What: A Banker’s Dozen
Where: Central Park (location might be moved to the Plaza Hotel pending a government subsidy)
When: 12 PM, Friday (after hours)
Topic: Fantastic presentation from some of the leading experts on how to use the government and taxpayer money to profit from a failing business. This will be followed by an open discussion on new investment strategies, such as buying expired milk for cheap in hopes it turns into Gouda cheese.
Easter Boredom Project: The Adaptive Culture Model
by Vershun on Apr.13, 2009, under Computers
So 3-4 years ago I picked up a really neat book on Swarm Intelligence and in it there were a few pages on the Adaptive Culture Model. I really liked the concept (algorithmically simple and pretty) so I coded up a quick and dirty OpenGL app for it.
Well, for whatever reason, I thought of it a couple days ago and took a day off doing actual work to play with ACM in Flex.
Quick concept rundown. So basically (from what I remember, don’t quote me) the adaptive culture model describes how information is spread throughout a population, specifically beneficial traits. I guess an example of this would be success and proximity. You notice a neighbor being successful, so you incorporate some of their traits into your life in hopes of you being more successful. This goes from neighbor to neighbor until the successful traits are assimulated into the whole population. Geography is just an example. This can also model information spreading through virtual networks and other such fun stuff.
I implemented a quick and dirty presentation of this concept in Flex. Success is rated by closeness to the target color you choose. When you click on a couple squares it randomly checks a neighbor to see if it is more successful. If it is, the neighbor assimilates one of its neighbors traits, which in this case is randomly either the red, green, or blue component. If the square updates it notifies its neighbors of the change and they go through the same process.
You can change the color while the program is running if you feel like it. There’s a lot more stuff that’s easily configurable but I got bored of this and am setting it aside for a while. I’ll release the source when I come back to it later.
It might take a few clicks for the process to start. Just select your color and keep clicking; when the queue starts filling up you’ll know.
Stem Cellz
by Vershun on Apr.12, 2009, under Random
As few of you are aware, for the past many Mondays I have been playing coed volleyball with a few high school buddies on a team called the Guppies. For our last game we went out to celebrate the season with some Dairy Queen. ”Celebrate,” might be a misleading term; we lost every single game we played. It was less of a victory celebration and more of the kind of celebration one might have when being released from torture. If you’re wondering, yes I have thought about it, and after deep self-analysis and reflection I have decided that sucking at volleyball is slightly more gay than just playing it.
Good things did come out of it, though. Like plans for our new movie: Stem Cellz, which features a killer fetus that lassos its victims with its umbellical cord.

He Will Defetus All
We have a few good scenes for it too, but I’ll let them be surprises to you when it hits the big screen.
For production inquires or any other sort of interaction that will land us free money, please contact me.
Tink
by Vershun on Apr.07, 2009, under Random
… Tinkerbell?

Hey Tink! Where are you hiding?!

Quick lame update and things to come
by Vershun on Mar.30, 2009, under Lame
Well it’s been forever since I’ve written anything and for some reason I keep getting returning hits so I assume you people want something from me. So here’s my boring quick-and-dirty post about my life and then things to expect from this site in the future.
For those of you unfortunate enough to talk with me during my existential/quarter-life crisis; it’s over. I’m now a Nihilist for the most part and I’m loving every second of it. I love to argue so losing my Athiestic beliefs have opened up a whole new range of debating: specifically the validity of math and science. I’ve found that by believing in nothing I’m open to experience anything and that has changed my entire perception of existence. So uhhh… I’m happy and stuff I guess :-B
So I have a couple of jobs now. Working at ClickFox doing Flex and Java which keeps me busy. Also working on a site called Vindogle, which should be up fairly soon. Other than staying busy all the time I have a wonderful gal that I’m quite fond of and I’m excited to finally see Dougie in Paraguay.
OK so things coming sometime this year to this site because they’ve been on my list for a while. I have a few articles that are quarter to half written that I never got around to finishing; I’ll do that. Also expect some sort of Flash-based data visualization for decentralized distributed computing (that one might take a hot minute).
Anyway, I promise I’ll keep up on this more when I have free moments.
Hidden Flash Applications as Distributed Computing Clients
by Vershun on Dec.31, 2008, under Computers
Made a quick and dirty program that I ran last night.
So it sends a request for a “work unit” on a different server I have running a PHP script that builds some simple XML that looks something like:
<assignment>
<type>MD5</type>
<hash>6ded1c8c8b157a391e618ca39eb11e39</hash>
<prefix>Ab$x</prefix>
</assignment>
The program grinds through building MD5 hashes using the prefix and the next 2 characters. Since this was just a test I’m only testing 126 characters so each work unit generates 15876 MD5 hashes and compares it to the target hash defined in the XML.
I made it so it’ll never find the hash because I wanted to test full work unit work so after it failed to find a match it returns its results to the server and requests a new assignment from the server.
Rinse. Repeat.
So I got 57 hits during the testing phase with a return of 1128 work units. This is roughly 18 million MD5 hashes tested.
I’m probably not going to pursue the MD5 collision thing (there’s much better ways of finding collisions instead of just brute forcing it anyway), but it’s an example of how hidden Flash applications can be used to put your traffic to work.
Random Images
by Vershun on Dec.15, 2008, under Lame
OK so I was going to just get rid of this blog but for whatever reason it has a PR rating so I might keep it around. I’m definitely going to be changing quite a few things around here after I finish up the 3 projects I have queued up. This blog will be moved to blog.vershun.com. I’ll probably stop doing posts with any sort of substance (there’s pretty much none of that already) and instead become a lot more project-oriented, which is what vershun.com will be about. This blog will truly be used as an outlet for my weird,which was its original intention (see identifying a zombie, smoking, and mediocre sex guide for more details).
BUT since I have a new server and haven’t posted in a while, here’s some random pictures. I’m posting them just cause I’ve been playing with PS recently and have really nothing else to post right now. Plus there’s not enough pictures on the internet yet.

Bad picture but two of the best and brightest people I know, love, and miss. Amateur caving in Cusco.
I might post again soon I have a few things I want to write I just haven’t gotten around to them.
Kinda like a really wussy rendition of that scene from The Rock
by Vershun on Nov.07, 2008, under Manhattan
It had been a long day. Long, LONG day. When Laura and I got back to her apartment we decided to call it a night since we both were exhausted. “I should have a cig before we crash out,” I had said. Stupid.
So Laura and I are joking around, as per the usual, and she said something particularly funny which gave me a bit of a kneejerk reaction. I wish I could remember the joke but I was busy putting my right foot down onto air.
The fences around Brooklyn are ornate and beautiful. They’re also hard. And sharp. If you happen to be laughing at your friend’s joke and fall onto one of them, it hurts.
Fences and gravity in cahoots against my giggles.
+
=
Now, it just felt like I got the wind knocked out of me, so when Laura yelled “OH MY GOD ARE YOU ALRIGHT?” I laughed and said I was fine.
“No you’re not… you’re bleeding.”
The feeling you get when you look down and see blood spreading through your shirt could probably be best described as “unnerving.” I applied pressure for a few seconds until I realized that it wasn’t too bad of a wound. My breathing was fine, heart was intact, and I didn’t have an iron rod through my body.
Holla at a sternum.
So Laura was about to get an ambulance but we decided we’d just cruise instead; no point in spending money for an ambulance and it was such a nice night.
I made her take a picture with me before we set off. If she looks uncomfortable it’s because she is.
We go to the first hospital that my GPS finds, which is a mile away and was some random Brooklyn hospital. When we get there we fill out a computer touch screen asking me my name, age, and the problem, which Laura awesomely put “Hole in chest bleeding.”
I was 2nd in line. Oh well.
Everyone called my doctor “Dr. Spikes” in the acute ward because of his spikey hair. I thought it was ironic.
Worst. Hospital. Ever. Took them about an hour to even see me once I got the stretcher thing. Threw a bandage on it and IV’d me up. The Jamacan nurse was awesome and kept calling me the “luckiest guy alive.” When I left we hugged; I was her favorite patient of the night. She was my favorite Jamacan ever (much nicer than experience with one waiting for the Chicago L who made a slicing-your-neck motion).
Dr. Spikes wanted a CAT scan of me, “just to be sure.” So I drank a shitton of disgusting liquid and then got to wait around another 2 hours while they “prepped” (drank, I assume).
The CAT scan was pretty sweet. When they put the activator liquid in they said, “You might feel some warmth in your arm and have a metallic taste in your mouth. That’s normal.” By no means was that “normal” to me but it certainly is kickass. They should have continued on though and said, “the warmth will spread throughout your body and eventually hit your pelvic region. This will make you feel like you just shit and pissed yourself and you’ll have to lay awkwardly for another 2 minutes until you can get up and survey the damage.”
I didn’t shit myself. Win.
So the scan results were suppost to take “30 minutes.” I was finally released 2 hours later. It wasn’t so bad though because Dr. Spikes let me go outside to smoke, which I was a little weirded out about since the CAT scan was supposed to be looking for if I was bleeding into my lungs, but whatever… he’s a doctor.
Laura was hilarious the entire time and God bless her little heart she stayed with me in the hospital throughout the entire 5 hour ordeal. She didn’t even want to come outside for that initial smoke in the first place.
Snapped when we got back:
And that was my night. Missed my flight to San Francisco in the morning for my cousin’s wedding. Suck.














