Archive

Archive for the ‘Projects’ Category

Steps for a successful symfony living part 2

Ιουνίου 4th, 2010 ktolis No comments

You probably read about http://www.ktolis.gr/lang/el/2008/05/15/steps-for-a-successful-symfony-living-part-1/ which is a quick guide on how to get started with propel on symfony back on the days of symfony 1.2. Now Symfony 1.4 is live and doctrine is the *new* kid on the block. We need to see how to get started with this one.. Lets see..

First download the symfony 1.4.x tarball from http://www.symfony-project.org/installation/1_4 I downloaded 1.4.5 for example. Then type in the terminal :

$ tar -zxf symfony-1.4.5.tgz
$ mkdir -p lib/vendor
$ mv symfony-1.4.5 lib/vendor/symfony

This will make the lib/vendor/symfony structure with the contents of the tarball. You can now dispose of the tarball with rm symfony-1.4.5.tgz . Now you can generate a new project like so:

./syfmony generate:project snake

Now create a new placeholder application by typing

./symfony generate:app frontend

We need to type now this command to link to the right graphics too:

ln -s /<absolute.path.to>/lib/vendor/symfony/data/web/sf web/sf

Now configure the database connection by editing the file config/databases.yml:

all:
doctrine:
class: sfDoctrineDatabase
param:
dsn:      mysql:host=db_hostname;dbname=db_title
username: database_user
password: password

Edit your database/model schema at config/doctrine/schema.yml like so:

Link:
columns:
url: { type: string(256), notnull:true }
title: { type: string(256), notnull:true }    title:

and type:

s doctrine:build –all –and-load

to build the database sql, run the sql script, create the model and load the fixtures (if you have any) and thus replace anything that was there already. You are good to go. Enjoy your coffee now. You can code now :)

Categories: Tips & Tricks Tags:

Flixel tutorial part 1

Φεβρουαρίου 24th, 2010 ktolis No comments

For the uninitiated, Flixel is a game engine made in/for flash. It is said to be much faster than regular flash because it ditches vector graphics for bitmap ones.

This is a tutorial series that will try to introduce you to the flixel sdk one step at a time. So here we go with part 1.

Flixel tutorial part 1: Set up flixel for Flex.

This part is for OS X users of Flex 3.0 IDE.

Step 1: Download the latest flixel version from http://github.com/AdamAtomic/flixel/archives/master and save on your favorite location on your disk.

Step 2: Start Flex and select File -> New -> ActionScript Project

Step 3: Type your project name (Tutorial_01) and store at a convenient location

Step 4: Click on “Next” button (not Finish) and at the source path field add the path to the library you downloaded from step 1 (you expanded it right?) and then click Finish

That’s it.. you’re done!.. well almost since you aren’t using the library just yet. The Flex IDE created a file titled “Tutorial_01.as” which we’ll have to replace so replace it with this one:

package {
	import org.flixel.*;

	[SWF(width="640", height="480", backgroundColor="#000000")]

	public class Tutorial_01 extends FlxGame
	{
		public function Tutorial_01()
		{
			super(640,480,PlayState,1);
			FlxG.debug=true;
		}
	}
}

In the first lines we use a 640×480 canvas with black color and later on we pass control to the class “PlayState”. We didn’t define Playstate did we? No!. So Select File -> New -> ActionScript Class and at the window that will appear type Name: PlayState, Superclass: FlxState and hit Finish. Now paste inside this one the following:

package
{
	import org.flixel.*;

	public class PlayState extends FlxState
	{
		public var myText:FlxText;
		override public function create():void
		{
			myText=new FlxText(0,30,100,"Hello, World!");
			add(myText);
		}
	}
}

What we do here is we create a new FlxText object called myText to print on screen “Hello, World!” and then we pass it to the game engine to attach it to the rendering loop with the add() function. We don’t need to use the update() function yet as we don’t change anything yet.

Flixel uses states to manage the code. This means that when you are for example in the main screen you should create a separate FlxState called Intro and write code there on what should happen and then pass control to another FlxState called for example PlayState which will have the main game code.

Although we didn’t write much you will notice that if you click on the flash area (to activate it) and then hit ~ then you will see the flixel console (we enabled it using FlxG.debug=true). You will be able to see the flixel library version you are using and the fps you are reaching (frames per second). In the time of writing I get 58-62fps (it’s trying to stay to 60 fps) and flixel version 2.21.

This concludes part 1 of this series. Stay tuned for more :)

Categories: Projects, Tips & Tricks, main Tags:

Flash! (not Gordon)

Φεβρουαρίου 22nd, 2010 ktolis No comments

I’ve always wanted to experiment with flash but the slow versions available on Mac OS X were always a mess. Not to mention the tools. Since Flex was released as open source and the sdk was split from the IDE the situation changed. Now with the release of Flash 10.1 the plugin starts to be workable again. With 10.1 the video sites don’t crash the plugin so easily (less than 1% probability now) and the performance has gone up a bit too since they started using better technologies like Core Animation. I’ve re-installed Flex IDE on my Mac and Flex sdk 3.5 for now. I’m playing a bit with Flixel. Last time I checked (about a week ago) they had stable releases but now all you’ll find is the github link and broken documentation (besides the autogenerated API that is). All in all this tiny library supports blitting and bypasses the regular vector drawing mode. A bunch of games are already using it although in most cases the developers are high school kids. This doesn’t mean the library is less than professional. The library is more than one needs to start away with flash game development, although you’ll need external obfuscators (like mochi) and other libraries for social networking. For the time being I am experimenting with the demos (the only relevant sample code there is) and want to run some benchmarks. I will try to post them here and at the project forums for the community.

Categories: Personal, Projects, main Tags:

The start of a new era?

Ιανουαρίου 25th, 2010 ktolis No comments

As of today 7PM i’m starting the NSFD officially. I want to see how long I can stand it. As far as I know the maximum so far recorded was 44 days. I don’t know if I will hold it that long but I wil try to do so at least for 20 days. I expect great results soon and thus an altered state of mind. Time will show.

This is not the first time I am trying the experiment. The last time I tried the results were astonishing. It’s already a very stressful period but I am hoping the best. I will try posting on fb every 24 hours milestone in the hope that I don’t loose faith in me. Others made it before me so it shouldn’t be that hard to convince myself. I will try to add some low bpm exercises later on to the schedule but for the first week I already have enough stress for now.

Categories: Personal, Projects, notes to self Tags:

Page Order plugin for wordpress

Ιουνίου 17th, 2009 ktolis No comments

I had already installd “My Page Order” which uses ajax to re-order the WordPress pages but once I tried “PageMash” there is no way to go back. It’s like comparing window to osx :) . You never go back :P