C++ Tutorial (49) – Absolute n00b spoonfeed

by admin on Friday 3 September 2010


Video tutorials about programming in the C++ programming language. Part 49: * ‘delete’ing heap memory * bypassing scope by passing memory address Pardon my imperfect english. Forum: cpptutorials.freeforums.org If you have any suggestions about how to make this video clearer, more n00b helpful, and explanatory, please send me a message. If you have any C++ questions, please comment.



Alice Programming

by admin on Wednesday 1 September 2010


Alice is an innovative 3D programming environment that makes it easy to create an animation for telling a story, playing an interactive game, or a video to share on the web. Alice is a freely available teaching tool designed to be a student’s first exposure to object-oriented programming. It allows students to learn fundamental programming concepts in the context of creating animated movies and simple video games. In Alice, 3-D objects (eg, people, animals, and vehicles) populate a virtual world and students create a program to animate the objects. In Alice’s interactive interface, students drag and drop graphic tiles to create a program, where the instructions correspond to standard statements in a production oriented programming language, such as Java, C++, and C#. Alice allows students to immediately see how their animation programs run, enabling them to easily understand the relationship between the programming statements and the behavior of objects in their animation. By manipulating the objects in their virtual world, students gain experience with all the programming constructs typically taught in an introductory programming course.



Best C++ Programming Tutorial: Hello World the Easy Way

by admin on Monday 30 August 2010


This is a quick tutorial in how to program is C++. In this video you will make the “Hello World” Program. It’s very easy, most people make it sound complicated, but with my easy to follow video you’ll learn programming in C++ in no time! This tutorial will teach you how to use simple functions and have the compiler say “Hello World” Or my way “What’s Up!!!” Hello World just sounds kind of lame. Either way you can have it say what ever you want. After this video you’ll know how to have the compiler say what ever you want! IK Animation Immortal king animation



PHP Path Resolution – Now PHP 5.3 compatible!

by LiraNuna on Sunday 29 August 2010

Presenting the PHP 5.3 compatible version of my PHP path resolution class!

Why there should be a difference? Because my original version used create_function, which… created a whole new function object every time you used one of the class’s methods. This was very memory expensive and even incurred a slight performance hit.

The new version uses PHP 5.3′s anonymous functions to create more readable code in addition to reducing memory consumption and execution time.

As usual, the source code is under the WTFPL for you to enjoy without any restrictions.

<?php
 
/**
 * @class Path
 *
 * @brief Utility class that handles file and directory pathes
 *
 * This class handles basic important operations done to file system paths.
 * It safely renders relative pathes and removes all ambiguity from a relative path.
 *
 * @author Liran Nuna
 */
final class Path
{
	/**
	 * Returns the parent path of this path.
	 * "/path/to/directory" will return "/path/to"
	 *
	 * @arg $path	The path to retrieve the parent path from
	 */
	public static function dirname($path) {
		return dirname(self::normalize($path));
	}
 
	/**
	 * Returns the last item on the path.
	 * "/path/to/directory" will return "directory"
	 *
	 * @arg $path	The path to retrieve the base from
	 */
	public static function basename($path) {
		return basename(self::normalize($path));
	}
 
	/**
	 * Normalizes the path for safe usage
	 * This function does several operations to the given path:
	 *   * Removes unnecessary slashes (///path//to/////directory////)
	 *   * Removes current directory references (/path/././to/./directory/./././)
	 *   * Renders relative pathes (/path/from/../to/somewhere/in/../../directory)
	 *
	 * @arg $path	The path to normalize
	 */
	public static function normalize($path) {
		return array_reduce(explode('/', $path), function($a, $b) {
			if($a === 0)
				$a = "/";
 
			if($b === "" || $b === ".")
				return $a;
 
			if($b === "..")
				return dirname($a);
 
			return preg_replace("/\/+/", "/", "$a/$b");
		}, 0);
	}
 
	/**
	 * Combines a list of pathes to one safe path
	 *
	 * @arg $root	The path or array with values to combine into a single path
	 * @arg ...		Relative pathes to root or arrays
	 *
	 * @note		This function works with multi-dimentional arrays recursively.
	 */
	public static function combine($root, $rel1) {
		$arguments = func_get_args();
		return self::normalize(array_reduce($arguments, function($a,$b) {
			if(is_array($a))
				$a = array_reduce($a, 'Path::combine');
			if(is_array($b))
				$b = array_reduce($b, 'Path::combine');
 
			return "$a/$b";
		}));
	}
 
	/**
	 * Empty, private constructor, to prevent instantiation
	 */
	private function __construct() {
		// Prevents instantiation
	}
}

Syndicated via RSS From: http://www.liranuna.com

Get free white papers delivered direct to your inbox from IT Knowledge Hub! Register now for cutting edge webcasts, reports, and white papers in your area of expertise.


Pathfinding in C++

by admin on Saturday 28 August 2010


C++ implementation of a program that finds the shortest path in the maze. Program moves left, right, up, down.


Copyright © 2010 IT Knowledge Hub LLC | Advertise | Contact | Privacy Policy | Terms of Use | Register