Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Thursday, March 31, 2016

Building a Basic Render Farm


Parallel computing is really neat. Obviously, it's important in science where you can break computational tasks into smaller parts and distribute the work among many discrete systems. But for rendering, it's incredibly important. Take Pixar, for example. They have a massive rendering farm and yet it sometimes takes them more than a day to render a single frame because of the complexity of the scene (hundreds of lights, shadows, etc.) This project clearly won't reach those levels, it's just to show that it can be done fairly easily to tween images across another using ImageMagick on multiple computers.

Wednesday, October 28, 2015

An Actual Guide to Accessing Google Datastore in PHP!

You've scoured the Internet, you've asked your friends, and you've complained about it for ages. Now, prepared to be stunned!

First off, let's give a quick run down of what Google Datastore (henceforth abbreviated as GDS) actually is. Google D... I mean GDS... is a SQL-ish database. It works very similarly, but there are a few key differences.

First, let's draw some parallels between the two. First off, GDS doesn't have databases. Instead, it has "namespaces", the default of which has no name. This can be useful to partition different applications within the same project. Next, GDS will not have tables, instead it will have "kinds" of  "objects". Objects are analogous to rows. Because each instance of an object can have or not have certain properties, it's more a object than a row. This guide assumes you understand all of these concepts. If you don't, I suggest glancing at the overview found at the Google Developer Site.

Now for the interesting stuff. How to actually use this. I use a great project that I found called "PHP-GDS" which is an adapter library to work with the Google API Client for PHP. The newest version at the time of this writing, 2.0 Beta, is leaps and bounds over the previous 1.x generation of the library. It uses Protocol Buffers to work with the datastore faster and more efficiently than before. The webpage says it isn't ready for production use, but quite frankly I've had fewer problems with version 2 with ProtoBuf than I did with the standard API use in 1.x versions.

Let's walk through how to configure PHP-GDS step by step.