Category: Programming

0

Phabstractic: Array Utilities

These methods are very useful for arrays, and overcomes some limitations that object conversion and array_unique have.  I would recommend using these functions instead of the built-in PHP functions for these purposes.

0

Phabstractic: Identity Trait Feature

The feature defines a static property for the using class.  This static counter remains unique on each poll for a new identity (in this case it’s an integer).  The $identityCounter must be ‘increasable’, that is, every time its accessed or ‘advanced’ it must be unique from all the identity values before it.  Counting up is a very easy way to accomplish this.

0

Adventure Game Tests

I have Unity game engine / creator, and I happen to also have Adventure Creator. This is an anticipation that I make an adventure game. I’ve always been interested in point-and-click adventure games, but I’ve become more so in the last year.

0

Phabstractic: Type Enumeration

With this data ‘type’ we would, for instance, be able to perform our own type check. However, our type check would be entirely dynamic, as opposed to a static typing system where, in short, the variables can’t change their type once they are initialized.

0

Phabstractic: Enumeration Data Type

PHP doesn’t have an enumeration data type, so I built an enumeration generator of my own. It actually won an award on phpclasses.org! It has been refactored to use the Configuration feature, formatted to follow the PSR standards as best it can, and relicensed under the MIT License.

0

Phabstractic: Configuration Trait Feature

The thing about PHP and the mixin’s I’ve developed is that they are not necessarily a class, instead the idea is that they are a trait that offers a particular feature to another class. So you define a feature, something the class can do, such as logging, or being able to hold configurations (see below) and then you can add it to a particular class.

0

Phabstractic: Range Data Type

Predicate objects are an interesting concept, which could have many uses in functional programming, in mathematical polymorphism, in input validation, etc. Ranges are a specific version of a predicate object that tests if any given value is within the maximum and minimum range defined in the object.

1

Phabstractic: Singleton Trait Design Pattern

In software engineering, the singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system.

0

Phabstractic: None Data Type

But what happens when you want to differentiate between false, 0, and null? Or in another context, what if you need a null value that is considered an object by the algorithm or language?

0

Primus, The Artificial Intelligence Server

With the success I’ve had with the open-source libraries I found for speech recognition and synthesis I’ve decided that that plan is outdated. With a little hacking I was able to glue two systems together with using Python and produce an extremely rudimentary ‘artificially intelligent’ in the manner of two days. This gives me quite a bit of hope.

0

Rudimentary Artificial Intelligence

The nice thing is that the speech recognition software is purpose fit to run on an embedded system, like the BeagleBone Black or Raspberry Pi.  This is great news, but the greater news is that this is all programmable.

0

Primus2\Falcraft: New Data Types (unordered/ordered node)

These data structures allow you to define parent and child relationships using a set of vertex information and classes. These are best suited to dealing with a tree of nodes, a common data structure encountered by optimization and artificial intelligence.

0

Primus2\Falcraft: New Data Type (leaf)

Many times in while programming you want to have a hierarchy of objects.  A hierarchy can very easily be realized as a ‘tree’ of parent elements and child elements.  This is not the only...

0

Primus2\Falcraft: New Pattern (abstract factory)

The abstract factory class in the link creates other abstract factories. This is much like the Enumeration data type which creates constants/enumerators with specific arguments. Each Abstract Factory is a throw-away object that you can use to create code dynamically for a given factory.

0

Primus2\Falcraft: New Data Type (map)

In PHP, keys in an array can only be a string or an integer.  However, in many general symbolic programming situations, you may want to be able to associate one piece of data with another.  You can establish a link between to pieces of data by setting one as a key and one as a value in an associative array.  The Map data type allows you to use any data type as a key and a value.

0

Primus2\Falcraft: New Design Pattern (publisher/observer)

One interesting note about these interfaces is that both the publisher and the observer include add and detach functions for the other.  Usually, observers only have a notify function.  Using both of these sets of functions is optional: the only set that must be implemented is on the publisher (to call the observer’s notify).

0

Primus2Falcraft: New Data Type (structure [typed])

This data structure mimics the C struct, sort of. A structure has specific fields to be taken care of or filled, some or all of these fields may have restrictions placed upon them. An object that falls under a particular genus may need to implement a specific interface, but contain modifiable members that need to be accessed generically.

0

Primus2\Falcraft: New Data Type (tagged union)

IMPORTANT This code is obsolete and has moved to another project, asherwunk/phabstractic.  For more information on the most recent version see the current blog post. Primus/Falcraft now has support for a tagged union data type....