DECLARATION:
-in general, a multidimensional array definition can be written as..
data-type variable-name [subscript1][subscript2]
ex. int cards[4][12];
------------------------------------
INITIALIZATION:
-like the one-dimensional arrays, they can be initialized on their definition
-the syntax underscores that it is an array of arrays
ex. int cards[4][12] = { {arg1, arg2,...argn}, {arg1, arg2,...argn} };
-only size of the first dimension can be excluded
ex. float matrix [][3] = { {1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0} };
------------------------------------
PROCESSING:
-still, operations must be carried out on an element-by-element basis.
ex.1
matrix[0][0] = 1.0;
matrix[0][1] = 0.0;
matrix[0][2] = 1.0;
ex.2
for(i=0; o<3; i++){
for(j=0; j<3; j++){
printf("%f", matrix[i][j]);
}
printf("\n");
}
Wednesday, February 24, 2010
Wednesday, February 10, 2010
PHP: functions
In this tutorial I will show some helpful codes where you can get the data from the SQL using a the PHP
SELECT * FROM table1 WHERE column1 LIKE '%a';
-displays all the data that ends with letter 'a'
SELECT * FROM table1 WHERE column1 LIKE '%a%';
-displays all the data with letter 'a'
SELECT * FROM table1 WHERE column1 LIKE 'a%';
-displays all the data that starts with letter 'a'
SELECT * FROM table1 WHERE column1 LIKE '_ _ _ _';
-displays all the data but limits the displayed data to only 4 characters
SELECT * FROM table1 WHERE column1 IN ("an", "be", "cy");
-displays all the data that starts with 'an', 'be' and 'cy'
SELECT * FROM table1 ORDER BY name;
-displays all the data but sorted by its 'name'
SELECT * FROM table1 LIMIT 20;
-displays only the first 20 data
SELECT COUNT(*) FROM table1 WHERE column1 = 'asdf';
-displays the number of data that have 'asdf' entry
SELECT MAX(column1) FROM table1;
-determine what data have the highest entry
SELECT * FROM table1 WHERE column1 LIKE '%a';
-displays all the data that ends with letter 'a'
SELECT * FROM table1 WHERE column1 LIKE '%a%';
-displays all the data with letter 'a'
SELECT * FROM table1 WHERE column1 LIKE 'a%';
-displays all the data that starts with letter 'a'
SELECT * FROM table1 WHERE column1 LIKE '_ _ _ _';
-displays all the data but limits the displayed data to only 4 characters
SELECT * FROM table1 WHERE column1 IN ("an", "be", "cy");
-displays all the data that starts with 'an', 'be' and 'cy'
SELECT * FROM table1 ORDER BY name;
-displays all the data but sorted by its 'name'
SELECT * FROM table1 LIMIT 20;
-displays only the first 20 data
SELECT COUNT(*) FROM table1 WHERE column1 = 'asdf';
-displays the number of data that have 'asdf' entry
SELECT MAX(column1) FROM table1;
-determine what data have the highest entry
Sunday, February 7, 2010
PHP: Parsing string to integer
(int)$var
(int) the way to convert a string to integer
$var the sample variable
Wednesday, January 27, 2010
Flex: create a function
public function calculate():void{
var x = 1;
}
function is a an indication that the statement is a function
var x = 1;
}
function is a an indication that the statement is a function
Friday, January 22, 2010
Flex: declare a variable
var input:Number;
var is an identity that it is a variable
input is the variable name
Number is the data type or what kind/type of variable it is.
semicolon(;) known as the terminator. It tells the program the statement only ends there.
The following are some of the common data types in Flex:
String
Array
Class
Container
Date
Effect
Error
int
other samples:
var input:Number = new Number;
public var input:Number;
private var input:String;
var input:String;
NOTE: private and public functions will be discuss in other post
Thursday, January 21, 2010
my first post
hello everyone!
in this blog, i will do a tutorial in any language i know like C, Java, HTML, Flex, PHP, etc.
Hope you'll learn a lot in this blog
Thank you!
in this blog, i will do a tutorial in any language i know like C, Java, HTML, Flex, PHP, etc.
Hope you'll learn a lot in this blog
Thank you!
Subscribe to:
Posts (Atom)
