Jeffkillian.com initially started as a Geocities website when I was in 6th grade. Over the years, it has slowly evolved into a place where I can practice and become familiar with web development as it progresses. I started out coding with Microsoft Frontpage, then moved to Dreamweaver. Initially, there was very little coding, and it was all WYSIWYG. However, as I learned more, I could make it more interactive.


I incorporate drawings and blog posts to keep those that are interested updated. Through the evolution of the website, I was forced to learn HTML, PHP, CSS, XML, jQuery, javascript, and the handling of MySQL Databases. I've put online some code samples.
Gifntext.com

I've always been frustrated that there's no easy way to create gifs with text over them, so I've been working on a side project to do just that. It allows you to add text to a gif.

Simulating and rendering water from liquidfun.js, a box2d port
After some significant development in dangeraffe there was still one thing that really bugged me that I wasn't able to solve. Water just didn't feel right.

Rather than being a continuous liquid, it was just a series of differently sized balls. While the balls did have physics that mimicked liquid flow/properties, I couldn't stand how it looked. I had no idea even where to begin, but after a bit of googling, I was able to find a helpful page that explained the term I was looking for: Rendering.

In essence, I had the locations of all of the balls given to me by the liquidfun engine. What I wanted to do was find a way to render(display) those balls, without displaying the actual balls that were there. Instead I wanted to display something that moved and flowed like water, and looked like one coherent unit when all together.
I ended up on a blog post about Liquid Simulation in WebGL by Chris Wellons, which looked like it was right up my alley. However, it mentioned using something called WebGL, which I had never heard of at the time. From what I coudl tell, it was a way to take some stress off of the CPU when rendering, and instead use the GPU. Again, this was a foreign language to me, so I ignored it. Chris had made a bottle like simulation , and broadly detailed the steps needed to render water:
  1. Do a physics simulation of balls in a container
  2. Render the simulation onto a raster
  3. Blur the image
  4. Apply a threshold
Steps 3 and 4 were the crucial part. They were the actual solution to the question "how do you turn the balls in liquidfun/box2d into a liquid-like substance?"

While I won't get into too much detail about the actual mechanics behind rendering, (you can find more here), you must first blur the balls, and then you apply a threshold. Blurring the balls makes them appear more as one continous body. Applying the threshold allows a clear cut outline of any given water bodies. If the image is above the threshold, we paint it black (or in the case of water, blue). If it is not above the threshold, we paint it white.
While testing, you can alter the threshold to see what it would be best as. Too small, and nothign shows up because everythign is too blurred. Too big, and the threshold does not have any affect, and you get a blurred image.

Blurring and Thresholding
Now that I knew I had to use a blur and a threshold, (and because I had never worked with WebGL), my first thought was to look for a javascript library that would do this for me. My thought was, because my image is on a canvas, I can simulate all of the water balls on a seprate canvas, apply the blurring and thresholding, and then draw the image on that canvas. I looked at a bunch of different libraries, the most helpful were The problem with the libraries above is that they are all javascript based. glfx.js is actually a webgl framework, but I didn't even know enough to know that this is what I should be using, and that it was different. While I was able to get a tiny implementation running via stackblur, it required copying the red,green, and blue values for every pixel on the canvas. I had to do this every frame (the game runs at around 60 fps), and then redraw this on a new canvas. This was much too process intensive, and I was getting at maximum 5 or 6 frames per second. It was at this point that I decided to take a break, and admit defeat....or so I thought.

I developed some new features, but still couldn't get the water rendering out of my head. About three weeks later I decided to revisit the issue, and try from a fresh start. My new implementatation started as an actual copy of the bottle simulation mentioned before. I didn't know WebGL, and wasn't about to learn it. Water was important, but my time could better be used implementing other features. Therefore, I copied the entire bottle simulation repository, and pasted it into my directory. I then worked backwards, figuring out the coordinates relative to my coordinates, deleting the spikes on the sides, and so on. Eventually, I had a bottle simulation that was running over dangeraffe. The canvases were overlaid, with the bottle simulation being above dangeraffe.

I was able to transfer my points via an array to the bottle simulation, but the simulation kept crashing. This was a result of it having a memory leak from using an outdated version of box2d. I spent a while porting the included box2d into liquidfun.js (aka B.Vec2>b2Vec2, B.World>b2World...). I was relying on this fixing the memory leak, and it did.

The last step was to map the water points that I currently had in dangeraffe into points that were appropriate for the bottle simulation. This was the part that took the longest, as it turns out the y axes are inverted and the bottle simulation goes from -1 to 1 on both axes. Once I had a function that could map my points to the bottle canvas, it was just a matter of calling the render function from my source dangeraffe code, and we ended up with beautiful flowing water. It's not the prettiest implementation, but I'm not exactly going for coding points. Dangeraffe is for me, as much of a coding learning tool as it is a game, so the fact that the code is not pristine for the rendering is just fine by me :).
Adding A Custom Notification/Ringtone Sound to your Galaxy S6

Making the custom file available

1. Open the My Files application(The default file manager on Samsung devices). By default this is in the tools folder.
2. Under Local Storage, open the Device Storage option
3. Browse to the audio file, long press on it, tap MORE in the upper right, and select the Copy option
4. On the new screen that appears, under Local Storage, open the Device Storage option

5. Under Device Storage, find the "Notifications" folder (or Ringtones folder if you are adding a ringtone), open it, and tap PASTE HERE


Selecting it
6. Open up your phone's Settings
7. Under Device select Sounds and Notifications

8. Select Ringtones and Sounds

9. Tap either Ringtone or Default Notification Sound, depending on what you are changing

10. On the opened list, select your audio file to activate it.

Box2d/LiquidFun b2EdgeShape
In implementing the paintbrush in dangeraffe I found an interesting aspect of b2Edgeshapes: they cannot collide with each other.

My setup for the brush is to continually draw a line from the last point where the mouse was to the current point. Whenever the current point changes, draw a line between the last and current point, and then update the last point to be the current point.

Each of these lines is a b2EdgeShape, and I'd then attach them to a body and things would work. However, I didn't anticipate that b2EdgeShapes can't collide with each other. It also seems like they have some weird properties that are not ideal for creating proper collisions. Though not ideal, rather than drawing a line in box2d it would make more sense to draw a very short/long rectangle. The only tricky part about this is rotating the rectangle correctly.

Below is the commented code for drawing a rectangle from a previous point (this.lastbrushPos) to the current point (currPos):
Drawing.prototype.addBrushStroke = function(point) {
    var color = "#000000"; //make the brushstroke black

    //currPos and this.lastbrushpoint are points relative to the center point of the body
    var currPos = new b2Vec2(point.x - this.start.x, point.y - this.start.y); //Make it relative to where you start

    //the length of the line is the distance between the points
    var width = Point.distance(currPos, this.lastBrushPos);

    if (width < .5) return; //For optimization, only draw lines when it is greater than .5 

    //Drawing a body requires knowing where it's center will be. This midpoint is the center.
    var midPoint = getMidpoint(currPos, this.lastBrushPos);

    //We will rotate around the midpoint to a certain angle.
    var angle = getAngleBetweenPoints(currPos, this.lastBrushPos);

    //Initialize the brushStrokeProperties
    var brushStrokeProps = {
        color: color,
        desc: "brushStroke",
        extDesc: "Custom Object",
        width: width,
        height: .25,
        density: 8,
        angle: angle,
        classID: 1,
        canTrash: 1,
        offSet: midPoint
    };
    //Create the fixture definition
    var brushStrokeFixDef = createFixtureDef(brushStrokeProps);

    //Add the fixture to the body
    addFixtureToBody(brushStrokeFixDef, this.drawing);

    //Update the old position to be the new position.
    this.lastBrushPos = currPos;
    return;
};
The initialization of brushStrokeProps, createFixtureDef, and addFixtureToBody is code specific to me. They allow creation of bodies and fixtures to be a lot easier in the long run. They can be found in BodyGen.js.

getAngleBetweenPoints does exactly what it states-it gets the angle between two points. Keep in mind, this works for my coordinate system which has Y increasing as we get lower on the screen.
function getAngleBetweenPoints(p1,p2){
    var newPoint=new Point(p1.x-p2.x,p1.y-p2.y);
    var pointAngle = Math.atan2(newPoint.y, newPoint.x);//get the point angle
    return pointAngle;
}
Where to Buy Chance The Rapper's Acid Rap On Vinyl (and other info)
Below you'll find the information I found when I was looking to get Chance the Rapper's Acid Rap on vinyl. I'm writing this to spare others the same research I did, and to get the information all into one place.

To set things straight, there is not an official release of "Acid Rap" on vinyl. The only official release of "Acid Rap" has been via download online. There was a bootleg CD that came about, and actually managed to make it into the billboard top 100 but the CD has since been discontinued.

Pressing
The reason you can't find an official release (and probably won't in the future) is because the album features some samples that were never cleared. Despite this, vinyl-digital decided to press the album in 2014, limiting the pressing to 1000 hand-numbered copies (original sale page, obviously out of stock). Vinyl Digital pressed in three different colors:
Despite pressing the same amount of yellow and pink records, the pink is more sought after as it matches the art of the sleeve. The album cover features art from chance the rapper's official mixtape, and has the tracklisting for the two double-sided LPs on the back:
Though I'm not an audiophile, the quality of the sound on the record I received was very good. I cannot hear a quality difference between this bootleg and other officially pressed records that I have. From various sources online, the quality of vinyl-digital bootlegs is excellent.

Where to get it
Vinyl digital has not stated they intend to make more pressings, so you could try them first, but the odds are they will still be sold out. There have also been a few floating around on eBay, but the most reliable place to get it is via discogs.com. If you don't care about the color, the clear albums were going for around $30 a few months after it was released, but have been steadily climbing in price (currently, the cheapest is around $50+shipping). The starting price for pink is around $228+shipping.


More Images


Thanks to user Billobatch on reddit for some images
Conclusion to the Ballpit

If you didn't know, a while back I created a ballpit with my two roommates. It was exactly as we'd hoped it to be, and we had a bunch of fun playing in it and making various puns. After two years of ownership, I was moving into an apartment, and no longer had the space for it. As sad as it was, I knew I had to let it go.

I decided to post an ad on craigslist to see if anybody was interested. I was going to leave it at that, but driving to work the next day I had an idea. What if I could get the fact that a ballpit was being sold on air? Now I'd gone my whole life without ever paying for radio advertisements, and I'll be damned if I was about to break that streak. So I called in during a commercial break, and had a little chat with the hosts. I figured if I called in, maybe they'd mention it for a bit on their show. Fortunately for the ballpit, and unfortunately for me and my radio-awkwardness, they were recording the call. Once the commercials were over, they eventually played our conversation in full. Lucky me.

As it turns out, I received over 20 responses. Some just wanted more information, some just wanted to say the post was funny. I was able to sell it for $375, which gives the world the concrete fact that ballpits depreciate at a rate of $25 every two years. After it was sold, I still got emails inquiring. Many were wondering, now that it was gone, how do build their own. To make things easier so I didn't have to copy and paste the same thing to each inquiry, I made a page which helps you plan out making your ballpit. Making that page was also a good refresher in php and javascript, so it was a win for me as well.

Fast forward 9 months or so, and I see a thread on reddit for another ballpit being sold in Madison. The ad is similar enough that you can tell they based their ballpit off of mine (structure is the same, sippy cups, same dimensions, ball numbers, etc). However, I could tell it was not my baby because the ball colors were way off.

Overall, it was a great journey, and I would advise anyone who is thinking of building a ballpit to just get some balls and do it.

Flywheel Toy

I was browsing reddit and came across this flywheel toy. It's a really neat demonstration of physics. I looked online trying to find one to buy, but it looks like the guy made it himself.

1st Annual Killian Family Turkey Trot

The first annual Killian family turkey trot was this morning, and it went off without a hitch.  I was a huge success, and everyone involved had a great time.  Race results are now online, and can be viewed here.

Dangeraffe - 11/6 Update

Today, I added a few new things to Dangeraffe:

September, 2014

I've recently gotten back into learning new coding languages, and I'm trying my hand at javascript and java. I was ultimately interested in making an Android game - if only to learn the basics of how that all works - but am putting that on hold. I had an idea for a game where there is a very lovely giraffe who is a victim of his own surroundings. 

The basic premise is a sandbox with a giraffe, and you can play around with him and do various physics related things. To get the physics aspect right, I initially wanted to use jbox2d and java in order to create an applet. However, that turned out to be much more of a pain to install. I then had the idea of honing up my web skills, and making the game with javascript/HTML5/CSS. This is so far turning out to be a lot more fun. It doesn't have all the functionality that can come with Java, but it's a blast to learn and see what happens to the poor giraffe.

As of now, there's just a giraffe you can drag around a physics sandbox, and you can press any key to give him a space helmet. Take a look at it here.

Want more? Check the blog archives
Untitled Document