Jump to content

  • Log In with Google      Sign In   
  • Create Account

Tutorial Doctor

Member Since 19 Oct 2013
Offline Last Active Nov 27 2015 07:05 PM

Topics I've Started

Can a full program be stored in a photo image

09 November 2015 - 04:03 PM

I figured this was the place to ask.


I had an idea, and I supposed people with knowledge in graphics programming and theory could enlighten me. 


I had an idea that paper can be repurposed to backup computers. I don't mean printing the source code of a program on paper. What I mean is that the computer can look at an image, and execute the encoded program. Something like barcodes, but with more memory.


Barcodes store information. QR codes store information. So I tried to store a paragraph in a QR code, and it was too much to handle. 


I was wondering how much data can be stored in a pixel. Could pixels possibly store data other than color, like text? Or could colors represent text in a way? Can colors be converted to text?


This idea came about when thinking about a new type of security, which is really an old type of security. Paper.


Why paper? I don't really know yet. 


Perhaps something like a modern punch code/card system?


Any links to good resources on topics that might be of interest to me would be much appreciated. 

Introduction to Software/Game Development Repository

06 October 2015 - 02:16 PM

I have started a new Github repository aimed at getting beginners up to speed on software and game development. 

You can find it here:



Other than resources, it also has demo projects (and more are being added) of games made using the Godot game engine:



And web development projects using Brackets:



Feedback and suggestions are welcome. 


Game development section is linked to under "Create"


Scrolling background logic?

20 August 2015 - 11:46 AM

What is the logic for an infinite scrolling background given an engine with basic tools?


Also, would this be similar to the logic for a procedural level?


In a basic explanation, anyone care to give it a go?


Right now I am thinking of it like a typewriter. When the head gets to the end, it jumps back to the first position and repeats that. Am I close?

What is a wrapper? What is a Decorator?

11 August 2015 - 12:54 PM

I need the most basic, "for dummies" explanation of what a wrapper is. I posted this in "For Beginners" because I am sure someone will just starting out will have the same question.


So far my definition is:


A function that calls or returns another function


Wikipedia makes this so difficult and annoying to comprehend:




wrapper function is a subroutine in a software library or a computer program whose main purpose is to call a second subroutine[1] or a system call with little or no additional computation.


Isn't a subroutine a function?


Wikipedia says:



In computer programming, a subroutine is a sequence of program instructions that perform a specific task, packaged as a unit.


Do I have this idea right:


Sometimes I don't like the name of a function included in a library, so I put that function in a function of my own, and pass stuff into it, or return stuff from it. 


But then, what is a decorator?


I am using Python, but this paradigm shows up in several languages.




Found another quote from (http://www.programiz.com/python-programming/decorator):



Basically, a decorator takes in a function, adds some functionality and returns it.


   Edit: Found another explanation (http://thecodeship.com/patterns/guide-to-python-function-decorators/)



In other words, functions generating other functions
There is a neat shortcut for that, which is to mention the name of the decorating function before the function to be decorated. The name of the decorator should be perpended with an @ symbol.
The examples in this post are pretty simple relative to how much you can do with decorators. They can give so much power and elegance to your program. In general, decorators are ideal for extending the behavior of functions that we don't want to modify.

Python Keyword Arguments for Config files?

05 August 2015 - 04:58 PM

I saw a configuration file for a camera in a 3D program and tried to model it using python:

#useful for config files?

#If the following variable is false, no camera will exist?

def camera(**settings):
	global camsOn
	if camsOn:
		return settings
		print 'Can\'t return settings'
		return {}

cam1 = camera(mode='PERS',radius=0,focus=(0,0,0),angle=(0,0,0),frustrum=0)
cam2 = camera(mode='ORTHO')
# the power of a function is that logic can be added

print cam1['angle']

def get_settings(cam):
	global camsOn
	if camsOn:
		for settings in cam:
			print str(settings) + ' = ' + str(cam[settings])
		print 'Can\'t get settings'
		return {}


I see here I could have used a dictionary for the settings, but the advantage of having it as a function is that additional logic can be added. 

This was done pretty quickly, and is probably not the best way.


But what would be the best way?


Anyone know of any other uses for keyword arguments? I have seen a few, but this could be a cool use?


Making a class seemed to be too much.


Attempts were made here: