h1

ODE

May 30, 2009

ODE is shorted for Open Dynamics Engine. It is a library for simulate Physics engine. This link explains the step of installing ODE;however, it provides some mistake about make process because it used an old version, ode-0.10.0.

I use new version of ODE, 0.11.1 and the new way of make is “premake4 vs2008″ , vs2008 is a version of .NET tool.

h1

DEKA process

April 30, 2009

I love this…..

“Find a problem. Research it.
Throw ideas at it. Invent. Get feedback.
Build something. Break it quickly. Make it better.
Decide on the product. Plan, organize, and bring it to life.
Build some, test them hard and thoroughly.
Push to production. Support as required.
Find a new problem.”

–http://www.dekaresearch.com/process.shtml

h1

OpenMP g++-4 & Multi-core programming

March 24, 2009

I’ve just read the article here about Multi-core programming that will become the next generation of software development. I think it is very interesting due to almost every computer today has been being processed by multi-core technology such as core 2 duo etc.

After reading, I downloaded cygwin — a linux runtime for windows environment

g++-4 -fopenmp -Wall -o hellomul hellomul.c

http://openmp.org/wp/openmp-compilers/

Games at Miniclip.com - Bloxorz
Bloxorz

Get the block to fall into the square hole.

Play this free game now!!
h1

Almost forget

February 17, 2009

I actually did lot of works last months. First of all, it is about web programming on finsonline. Second, the rss widget.

I wrote this blog to remind my usage about PHP’s function mb_substr() for Thai character

h1

project Task 3

January 8, 2009

Learn XNA basic from website

- ThaiXNA.com > article > 2D

http://www.thaixna.com/index.php?option=com_content&task=view&id=90&Itemid=29

- Step for doing

1. Copy code line by line and execute it.

2. Add second ball into screen.

3. Remove second ball out of screen.

Due to 15 Jan 2009 period 3 room software lab.

h1

Project Task II

December 4, 2008

1. Write more details about combat process by using UML diagram (sequencial).

2. Write more details about event phrase.

3. Design unique players more than only set different colors.

h1

Project I (Card Game) — Task 1

November 30, 2008

1.1 Create overall flow chart.

1.2 Sketch graphic design 4 cards.

Next meeting will be on Thr 4 December 2008.

h1

What a beautiful POV-RAY

October 22, 2008

After I had read this article, I really impress her story and I’m curious to know about her research and study. I found something interesting about her study while she was a graduate student at Japan. It’s called, pov-ray. Wow, what’s it! After I read its tutorial, I got the example below.

This is my first code.

#include “colors.inc”
#include “stones.inc”
background { color Cyan }

camera {
location <7, -2, -10>
look_at <0,1,2>
}

sphere{
<0,1,5>,3
texture {
pigment { color Yellow }
}
}

box {
<-1, 0, -1>,
<1, 0.5, 3>
texture {
T_Stone25
scale 4
}
rotate y*20
}
light_source { <5,5,-3> color White}

My first pov-ray image

My first pov-ray image

h1

My surprise on jquery

October 1, 2008

Last week, I got stuck in the problem about manipulating images gallery on wordpress’ sidebar. I do not want to reload the whole web page every time users click next or previous button. I have tried to use every web technology that I have known such as Ajax and Javascript etc; however, I think it is a little bit difficult if I want to learn to use them in a short time.  Finally, I came across the solution by using jquery. As I used it in the first time, I found it was very interesting and useful for web designer.

This is the example that I use to manage my images list.

<script src=”jquery-1.2.6.min.js” type=”text/javascript”></script> <script type=”text/javascript”><!–
// we will add our javascript code here

(function($) {

// Add repeat method to String object
String.prototype.repeat = function(n){
return new Array(n + 1).join(this);
};

// Add leading_zeros method to jQuery
$.leading_zeros = function(n, total_digits){
n = n.toString();
return ‘0′.repeat(total_digits – n.length) + n;
};

})(jQuery);

$(document).ready(function(){

var counter = 2;
$(“div”).hide();
$(“div#1″).show();
for(var i=1; i<=counter; i++)
{
$(“div#”+i).show();
}

$(‘#next-button’).click(function(){
// increment and pad the counter
if(counter >= 5) return;

var pcounter = $.leading_zeros(counter+=2, 1);

for(var a=pcounter-1; a<=pcounter; a++)
{
$(“div#”+a).show();
}

for(var b=1; b<= pcounter-2; b++)
{
$(“div#”+b).hide();
}
});

$(‘#previous-button’).click(function(){
// decrement and pad the counter

if(counter == 2) return;

//var pcounter = $.leading_zeros(counter-=2, 1);
counter -= 2;

//alert(‘counter’+counter);
for(var x=counter+2; x>counter; x )
{
//alert(x);
$(“div#”+x).hide();
}

for(var y=counter-1; y<=counter; y++)
{
$(“div#”+y).show();
}
});

});
// –></script>
<div id=”1″><a><img alt=”" width=”100″ height=”100″ /></a></div>
<div id=”2″><a><img alt=”" width=”100″ height=”100″ /></a></div>
<div id=”3″><a><img alt=”" width=”100″ height=”100″ /></a></div>
<div id=”4″><a><img alt=”" width=”100″ height=”100″ /></a></div>
<div id=”5″><a><img alt=”" width=”100″ height=”100″ /></a></div>
<button id=”previous-button”>Previous</button>
<button id=”next-button”>Next</button>

This code is used to create next and previous function to manage the flaw of images in gallery

h1

How to use free sdk for Actionscript 3.0

September 14, 2008

Step by step for creating flash application with free sdk

1. Download flex_sdk_3.zip from free sdk

2. After extracting zip file, we will find the “mxmlc.exe”, which is in bin folder, for compile *.as files and generate .swf file.

3. Let start first swf with AS3.0

  • Create Hello.as file
  •         package
           {
    	      import flash.display.Sprite;
    	      public class Hello extends Sprite {}
           }
  • Drag it to mxmlc.exe file on Windows Explorer or use dos command.
  • mxmlc.exe will generate hello.swf file on the same directory of mxmlc.exe

4. Advance examples

  • Draw Shape
  • package {
    	import flash.display.Sprite;
    	import flash.display.Shape;
    	import flash.display.Graphics;
    
    	public class Rectangles extends Sprite {
    
    		public function Rectangles() {
    
    			drawColoredRectIn(graphics, 0xFF0000);
    
    			var rect:Shape = new Shape();
    			drawColoredRectIn(rect.graphics, 0xFFFF00);
    			rect.x = 50;
    			rect.y = 50;
    			addChild(rect);
    		}
    
    		private function drawColoredRectIn(target:Graphics, color:int):void {
    			target.lineStyle(1, 0x000000);
    			target.beginFill(color);
    			target.drawRect(0, 0, 100, 100);
    		}
    	}
    }

5. Embed Assets

  • Embed asset from library
  • This example will show the import of movieclip and then tell it to move by using Event
    mechanism from actionscript.
    
    First, you have to create MovieClip by using Flash IDE and then
    name its linkage and deploy swf file. In this case, I created 'star' movieclip
    and name it as 'star' in linkage library. when you have to embed to AS3.0 code,
    you have to refer to its name. Every asset in code has to assign to Class object
    and then will be casted to class that users want to use in application.
    package
    {
    	import flash.display.Sprite;
    	import flash.events.Event;
    
    	public class EmbedAssets extends Sprite
    	{
    	   [Embed(source="images/trophy.png")]
    	   private var TrophyImage:Class;
    
    	   //Import star movieclip that embeded in Asset.swf
    	   [Embed(source="swfs/Asset.swf", symbol="star")]
    	   private var SatelliteAnimation:Class;
    
    	   public function EmbedAssets()
    	  {
    	     var star:Sprite = new SatelliteAnimation();
    	     addChild(star);
    	     star.addEventListener(Event.ENTER_FRAME, onEnterFrame);
    
    	    addChild(new TrophyImage());
    	 }
    
    	private function onEnterFrame(event:Event):void
    	{
                    // currentTarget refer to 'star'
    		event.currentTarget.x += 10;
    	}
        }
    }

Good References
Embedding resources with AS3.0
AS3.0 with Free Flex SDK