Google adsense

Search

Thursday, October 28, 2010

First step for newbie on Flash

This tutorials for only newbie on flash. It is how to create the effect (fade in) of object. I think the principle of flash UI (user interface) workspace that create the object > convert to movie clip> convert to graphic > then make the effect on own created graphic object. Maybe, It’s not.

Энэ хичээл нь зөвхөн flash эхлэн суралцагчидад зориулагдсан. Обьектонд эффект яаж оруулах вэ. Миний бодлоор flash дээр ажиллах зарчим нь эхлээд обьектоо үүсгэх > movie clip руу хөрвүүлэх > graphic руу хөрвүүлэх > тэгээд graphic дээрээ эффектээ оруулж өгөх юм. Магадгүй, энэ биш ч байж болно.


Create new Flash Document. Select the File > New (keyboard shortcut Ctrl+N)

Workspace

Select the Text Tool (keyboard shortcut T) on Tools bar

Drag and Drop on the workspace

Write the text like Hello World!

Select the selectrion Tool (keyboard shortcut V) on Tools bar

Right click on the your text and click the Convert to Symbol…

Show the Convert to Symbol dialogbox. Select the Movie clip from Type then set the name that mc_helloworld. Ok click

Double click on the your text

Show it after double click.

Rigth click on the your text and click the Convert to Symbol…

Show the Convert to Symbol dialogbox. Select the Graphic from Type then set the name that gc_helloworld. Ok click

Select the first keyframe of Layer 1 on Timeline bar. Then press the F5 on keyboard to frame 15.

Rigth click on frame 15 and click the Insert Keyframe.

Click the frame 1 and select the your text. Then show the object properties dialogbox (click the Properties on bottom or from Window menu)

Select the Alpha of Color property and set the 0 (zero).

Select the frame 15 select the your text. Then show the object properties dialogbox (click the Properties on bottom or from Window menu)

Select the Alpha of Color property and set the 100.

Rigth click the frame 1 and click Create Motion Tween.

Rigth click the frame 15 and click Actions.

Write the stop();

Now, Run the movie. Select the Control > Test Movie (keyboard shortcut Ctrl+Enter).

You're done. Good Luck! :)

Thanks,

Monday, September 20, 2010

C#: Forms relationship

Calling a form method from another form. You can solved it, using the Window.Owner property. But only top-level controls can have an owner.

Нэг формоос нөгөө формын функцийг дуудах. Нэг формоос өөр формыг дуудахдаа ShowDialog функц ашигласанаар хоёр форм хоорондоо харилцаа холбоотой болдог. Харин Show функээр дуудвал хоёр форм хоорондоо холбоогүй дуудагддаг. Show функцээр дуудсан үед тухайн хоёр формын холбоог Window.Owner property -г хэрэглэн үүсгэж болно.

Example:

//Form1 coding

private void button1_Click(object sender, EventArgs e)
{
this.label1.Text = "Hello World!";
}

public void updateForm()
{
button1_Click(this.button1, null);
}

private void button2_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.Owner = this;
//f2.frmTemp = this;
f2.Show();
}

//Form2 coding
//public Form frmTemp;

private void button1_Click(object sender, EventArgs e)
{
(this.Owner as Form1).updateForm();
//(this.frmTemp as Form1).updateForm();
}

Thanks,
Info source: http://msdn.microsoft.com/en-us/library/system.windows.window.owner.aspx

Monday, September 13, 2010

Django: PyDev plugin for Eclipse

Go to the update manager (Help > Install New Software), add:

http://pydev.org/updates

Thanks,
Info source: http://pydev.org/download.html

Tuesday, September 7, 2010

Oracle: Usage

Талбаруудын өгөгдлийн төрлийг харах.
Select the column datatype using case when, concat function.

SELECT column_name,
CASE
WHEN data_type = 'DATE' then data_type
WHEN data_type = 'NUMBER' then concat( concat( concat( data_type, '(' ), concat( data_precision, case when data_scale > 0 then concat( ',', data_scale) end ) ), ')' )
WHEN data_type = 'NVARCHAR2' then concat( concat( concat( data_type, '(' ), char_length), ')' )
WHEN data_type = 'VARCHAR2' then concat( concat( concat( data_type, '(' ), concat( char_length, case char_used when 'B' then ' BYTE' end ) ), ')' )
END data_type
FROM user_tab_columns
WHERE table_name='table_name' AND (
column_name = 'columnname1' OR
column_name = 'columnname2' OR
column_name = 'columnname3'
) order by column_name;

Output:
COLUMN_NAME DATA_TYPE
columnname1 NUMBER(4)
columnname2 VARCHAR2(15 BYTE)
columnname3 DATE

Oracle: Concat Function

In Oracle/PLSQL, the concat function allows you to concatenate two strings together.
Хоёр текстийг хооронд нь холбоно.

The syntax for the concat function is:
concat( string1, string2 )

string1 is the first string to concatenate.
string2 is the second string to concatenate.

Applies To:
• Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g

For example:
concat('Tech on', ' the Net'); would return 'Tech on the Net'.
concat('a', 'b') would return 'ab'.

Thanks,
Info source: http://www.techonthenet.com/oracle/functions/concat.php

Oracle: Case when

case when x = y then a else b end

case when x < y then a when x = y then b else c end

case XYZ when 'foo' then 'moo' else 'bar' end


select a,
case
when b = '*' then 'star'
when b = '+' then 'plus'
when b = '-' then 'minus'
else '????'
end
from table_test_case_when;

Thanks,
Info source: http://www.adp-gmbh.ch/ora/sql/case_when.html

Monday, September 6, 2010

Oracle: Alter table

The ALTER TABLE statement allows you to rename an existing table. It can also be used to add, modify, or drop a column from an existing table.

Renaming a table

The basic syntax for renaming a table is:

ALTER TABLE table_name
RENAME TO new_table_name;

Adding column(s) to a table

Syntax #1

To add a column to an existing table, the ALTER TABLE syntax is:

ALTER TABLE table_name
ADD column_name column-definition;

Syntax #2

To add multiple columns to an existing table, the ALTER TABLE syntax is:

ALTER TABLE table_name
ADD ( column_1 column-definition,
column_2 column-definition,
...
column_n column_definition );

Modifying column(s) in a table

Syntax #1

To modify a column in an existing table, the ALTER TABLE syntax is:

ALTER TABLE table_name
MODIFY column_name column_type;

Syntax #2

To modify multiple columns in an existing table, the ALTER TABLE syntax is:

ALTER TABLE table_name
MODIFY ( column_1 column_type,
column_2 column_type,
...
column_n column_type );

Drop column(s) in a table

Syntax #1

To drop a column in an existing table, the ALTER TABLE syntax is:

ALTER TABLE table_name
DROP COLUMN column_name;

Rename column(s) in a table
(NEW in Oracle 9i Release 2)


Syntax #1

Starting in Oracle 9i Release 2, you can now rename a column.

To rename a column in an existing table, the ALTER TABLE syntax is:

ALTER TABLE table_name
RENAME COLUMN old_name to new_name;

Friday, September 3, 2010

Oracle: select column names and types

Хүснэгтийн талбарын нэр, төрлийг сонгож авах

select column_name, data_type, data_length
from user_tab_columns
where table_name = 'MY_TABLE';

select * from all_tab_columns where owner = 'THE_SCHEMA_OWNER';

thanks Dr. Xi (http://www.xinotes.org/notes/note/521/)

Monday, February 15, 2010

Portable Ubuntu


It's very nicely...
You can take more info from Mongolian or English.

Installing Go on Ubuntu

Info source: http://unixlab.blogspot.com/2009/11/installing-googles-go-language-on.html
See also: http://golang.org/doc/install.html
Tech talk (1 hour) (PDF)

Python + C = Go. Google's Programming Language

1. Install Pre-requisites on ubuntu.

You need gcc and some supporting software like bison to compile go. Install the following.

$ sudo apt-get install bison gcc libc6-dev ed


The go repository uses mercurial version controls system .
Install mercurial with the following command.

$ apt-get install mercurial


2. Set up the environment variables.

Create a folder named go in your home directory.

"/home/fermi"

$mkdir go


Create bin direcory inside go .

$ mkdir go/bin


The above directory will contain your go compiler.
Next, you have to set u several variables.

$ export GOROOT=/home/fermi/go/hg
$ export GOOS=linux
$ export GOARCH=386
$ export GOBIN=/home/fermi/go/bin

( Note: You need not create the folder hg. You can also add the above
four lines along with the PATH variable below to the .bashrc file
if you are planning to use go regularly.)

Update your PATH variable .

$ export PATH=$PATH:$GOBIN


Check the environment variables with.

$ env | grep '^GO'


show like this.

GOBIN=/home/fermi/go/bin/
GOARCH=386
GOROOT=/home/fermi/go/hg
GOOS=linux

3. Grab the source code from mercurial

$hg clone -r release https://go.googlecode.com/hg/ $GOROOT


Wait for downloading.

4. Compile Go

$ cd $GOROOT/src
$ ./all.bash


Wait for compiling. Process will be completed with the following message

--- cd ../test
0 known bugs; 0 unexpected bugs

5. Test go

Write a hello world program.
Create a folder named mysrc in go dir then hello.go inside mysrc dir.
hello.go as like

package main

import "fmt"

func main() {
fmt.Printf("hello, world\n")
}


To compile hello.go run.

$ 8g hello.go


The above command produced and intermediate file hello.8.
Next you have to link it.

$ 8l hello.8


The executable is placed as 8.out. Finally run the executable.

$./8.out

Thank you, Fermi (http://unixlab.blogspot.com/)