3/30/2008

Google Analytics

I have used Google Analytics, so target url is this blog.

Most popular page in this blog is My open source have new features 2 in period from a day of start blog to today.

I written this page about my open source's new feature that is enable to load uv coordinate and texture file infomation from 3ds file.

3/27/2008

Define local function in Ruby

I will write code like procedural language with Ruby ;-)

Next codes are to define local function and to call it from main function.


  1. def OutputFile
  2. infile = open("filename")
  3. while line = infile.gets
  4. print line
  5. end
  6. end
  7. begin
  8. OutputFile()
  9. end

3/24/2008

Define Class Method in Ruby

Today, I study the way to define class method in ruby.

This way help me to make tiny utility function.

Following codes are the way.

  1. module MyModule
  2. class Utility
  3. def Utility.writingSignLine(f)
  4. f.print "#"
  5. for i in 0...77
  6. f.print "="
  7. end
  8. f.print "\n"
  9. end
  10. end
  11. end

Keynote is the 3 line.

This line expresses to define next codes as class method code.

Calling way is simple.

It's next!

  1. f = open(file_name, "w")
  2. MyModule::Utility::writingSignLine(f)

3/23/2008

Good 3D Model Site

I have found a good site about 3d model.

URL is this.

There are models that are STAR WARS, Dragon Ball and so on.

Especially Darth Vador and Millenium Falcon like good model!


3/21/2008

The way to make directory with Ruby

If I make a directory with ruby.

  1. #!/usr/bin/ruby
  2. begin
  3. directory_name = Dir::pwd + "/" + "test"
  4. if FileTest::directory?(directory_name)
  5. return
  6. end
  7. Dir::mkdir(directory_name)
  8. end


Above codes allow
me to create a directory.

1 line expresses that this file is ruby process.

2 line is Main thread starting sign, 8 line is end sign.

4 line checks to exists or not.

7 line real make directory.


3/20/2008

Long Time No See Ruby!

I studied Ruby 5 years ago.

At the time, I did know object oriented, c++, computer science.
Therefore, I did not understand good elements of Ruby.

Now, I have grown up at that time!
I see document of ruby.

I understand that ruby is good programming language!!

Ruby is ideal object oriented programming.

Next codes are that I wrote yesterday.


#!/usr/bin/ruby

=begin
Hello !
Tomorrow, I will install ruby-el in My laptop-machine.
=end

# define my class
module My
class Data
attr_accessor :param, :index

# This method is original method
def output
p @param
p @index
end

# This method is constructor
def initialize( index, param)
@index = index
@param = param
end

end
end


# Following codes main thread!
begin


data = My::Data.new(10, "Hello Ruby!!")

p data.param

end

3/18/2008

Improve Code

Now, A part of code of my open source is dirty and likes mud.

There is dirty code in user interface.

I builded user interface with gtk+ library.

When I written my open source, I did not have so much time.

But, I improve code of user interface.

3/16/2008

I can not join debian session

I can not finish to write a report of the software license, so I do not join debian study session.

I regret not to join this session.

3/09/2008

vector erase

Vector in stl allow me to erase element.
This way is calling "erase" method.

Following codes are sample.


#include < iostream >
#include < vector >
using namespace std;

int main(void)
{
vector< int > tmp;

tmp.push_back(1);
tmp.push_back(2);
tmp.push_back(3);
tmp.push_back(4);

for( int i = 0;i < tmp.size(); i++){
cout << tmp[i] << endl;
}

cout << "erase" << endl;
vector< int >::iterator ite = tmp.begin();
ite++;
ite++;
tmp.erase(ite);
for( int i = 0;i < tmp.size(); i++){
cout << tmp[i] << endl;
}
return 0;
}

3/08/2008

I want to join debian study session in japan

I caught news Debian study session.

The date is 03/15/2007, the place is Google Tokyo office.

Detailed announcement page is url.

Time limit to join is 3/13.

Before I do, is to write report about possible of only data package, trouble with license or my favorite license.

3/03/2008

My open source have new features 2

My open source have new features that are loading uv value and texture file name in 3ds.

This picture is sample.