THÂN CHÀO QUÝ BẠN
Blogger nầy chỉ tồn trử kiến thức và kinh nghiệm về nghề “Materials Testing”, “Textile Screen Printing” và “Internet Programming” của một kỹ sư đã phục vụ tại :
* Trung Tâm Khảo sát Kỹ Thuật Quân Nhu /QLVNCH “ & “ Viện Quốc Gia Định Chuẩn/VNCH”
* Xí nghiệp “Hiệp Hưng / VN” ( sãn xuất giày vãi cao su )
"Bradbury Company Inc/USA"(Textile Screenprinting,Imprinted Sportswear Programs) & “Sundance Graphics Inc / USA” ( in bông vãi sợi ) từ năm 1965 để dành cho thế hệ trẻ muốn học nghề.
Vạn Vật Thái Bình (PEACE ON EARTH).

Sunday, September 20, 2015

APPLICATION OF RETURN IN JAVA

ÁP DỤNG RETURN ARRAY CỦA JAVA ĐỂ VIẾT QUẢNG CÁO

Array là String

class Rextester{
 static String [] getResult( ) {
 System.out.println(" CỮA HÀNG BÁN THƯỜNG TRỰC NHỮNG MÓN SAU ĐÂY:"  );
            String [] array = new String[5];
            array[0] = "CAM QUÝT FLORIDA" ;
            array[1] = " SẦU RIÊNG MALAYSIA " ;
            array[2] = " MÍT TỐ NỮ VN " ;
            array[3] = " CHÔM CHÔM CÁI BÈ LONG XUYÊN VN";
            array[4] = " Muốn mua món đặc biệt xin cho order.\nHenry Baxao Cám ơn. ";
             return array;}
    public static void main(String[] args){
            /* Loop over an array returned by a method.*/
                   for(String str : getResult( )){
            System.out.println(str);}
}}
OUTPUT.
Compilation time: 0.83 sec, absolute running time: 0.13 sec, 
cpu time: 0.07 sec, memory peak: 27 Mb, absolute service time: 0.96 sec
CỮA HÀNG BÁN THƯỜNG TRỰC NHỮNG MÓN SAU ĐÂY:
CAM QUÝT FLORIDA
 SẦU RIÊNG MALAYSIA 
 MÍT TỐ NỮ VN 
 CHÔM CHÔM CAI BÈ LONG XUYÊN VN 
 Muốn mua món đăc biệt xin cho order.
Henry Baxao cám ơn . 

Permanent link: http://rextester.com/MYMDC21337

GHI CHÚ.

NHIỆM VỤ CỦA CHỮ RETURN
Chữ return được viết trong một function và có nhiệm vụ như sau.
-Chuyển về cho CALLER tất cả những gì mà function phải thi hành thí dụ  như những bài tính toán, những hóa đơn mua bán hàng, những câu viết v.v…CALLER là code mà chúng ta sẽ dùng để ‘call function’.
- Chận lại tất cả những codes sau nó không cho vận hành.
- Nếu dùng chữ return trong JavaScript thì tất cả những gì chúng ta muốn return phải viết trong round brackets (….).
-Nếu dùng chữ return trong Java Progran,  thì không dùng trong round brackets như trong JavaScript.
- Nếu muốn tồn trử returned value để xử dụng tiện lợi thì phải ‘assign it to a variable var a, var b …’ , rồi dùng alert() hay document.write() để hiển thị.
- Khi xử dụng return, nếu dùng thêm if…else thì program trở nên linh động hơn và thêm nhiều phong phú .
 
Array là integer.
còn tiếp

Monday, September 7, 2015

WHY JAVA PROGRAMMING IS THE BEST OF ALL.

TẠI SAO JAVA PROGRAMMING ĐƯỢC ƯA CHUỘNG NHẤT HIỆN NAY.
                               -----------
Bảng xếp hạng JavaScript và Java Programming được ưa chuộng nhất trên thế giới ngày nay.
JavaScript phức tạp hơn Java Programming,học lâu hơn nhưng có thể dùng để tạo hình và chữ viết di chuyển (animated pictures) rất dể dàng.Với JavaScript lồng trong HTML,chúng ta có thể làm được rất nhiều việc muốn làm theo ý muốn và chỉ cần có browser thi script sẽ hoạt động được ngay cho nên được gọi là client side script.
Còn Java program codes viết xong phải cho qua compiler,interpreter mới hoạt động được.
Cần học JavaScript trước khi học Java programming.

1.           JavaScript
2.           Java
3.           Python
4.           CSS
5.           PHP
6.           Ruby
7.           C++
8.           C
9.           Shell
10.      C#
 
1-Thí dụ đây là một Java Program đơn giản.



class Rextester {
       public static void main(String[] args) {   
           String a, b , c ,d ;
            a="HELLO FRIENDS" ;
            b="WHERE ARE YOU FROM ? ";
            c="WOULD YOU LIKE THIS COUNTRY ? "     ;
            d="Can you tell me what you already saw ? ";
     System.out.println(a +" "+ b+" "+ c +" "+d);}
}
Output.
Compilation time: 1.35 sec, absolute running time: 0.13 sec,
 cpu time: 0.07 sec, memory peak: 28 Mb, absolute service time: 1.49 sec

HELLO FRIENDS WHERE ARE YOU FROM ?  WOULD YOU LIKE THIS COUNTRY ?  Can you tell me what you already saw ? 

2-Thí dụ đây là một JavaScript tạo đồng hồ có số chuyển động trên computer-desktop .

This is the Digital Clock JavaScript created by Henry Duong in 2010.Copy and paste it in Notepad then save  as “digital clock.html”.
Open My Recent Documents,click the icon digital clock.The Clock will show up and run correctly on monitor.
-----------------------
<html>
<body>
<script>
function dongHo() {
var now = new Date() ;
var year = now.getYear() ;
var month = now.getMonth()+1 ;
var date = now.getDate() ;
var hours = now.getHours() ;
var minutes = now.getMinutes() ;
var seconds = now.getSeconds() ;
var t = year +"-"+month +"-" +date+"/" +hours+":"+minutes+":"+seconds;
 document.getElementById("clock").innerHTML=t;
setTimeout("dongHo()",1000)
}
</script>
<span onClick="dongHo()"><span style="color:blue;font-size:25px">MẤY GIỜ RỒI ?</span><br>
<span style="color:yellow;font-size:25px;background-color:red"><span id ="clock"></span>
</body>
</html>
                                ----------------------------------------
                     
Vì có 10 lý do sau đây nên Java được ưa chuộng nhất hiện nay trên thế giới:

1- Java is easy to learn.
2- Java is an Object Oriented Programming Language. Originally, a program was a logical procedure that gets input data, processes it, and produces output data.  It is the model organized around objects
3- Java has a Rich API. It provides API (Application Programming Interface) for I/O (Input / Ouput). It is a set of routines, protocols, and tools used for building software applications.
4- Powerful Development Tools.
5- Big Open Source Libraries. Beside Google, Apache many more other organizations have made a lot of libraries helping in writing Java programs much easy and faster.
6- Community Support.
7- Java is free, you pay nothing for learning.
8- Document support is perfect(Javadocs).
9- Java is Platform Independent. Write it once and run it anywhere
10- Java is Everywhere. On desktop, on mobile

                                           -----------------

Tuesday, September 1, 2015

JAVA PROGRAM CONTAINING 4 METHODS

JAVA PROGRAM CHỨA 4 METHODS .
 String display(), void run(), void go(), void start()
class Rextester {  
        String outerStr = " This is outer String .\n"  ;
class MemberClass {
        String innerStr =  " This is inner String .\n" ;     
        String display(String parameter) { 
            return innerStr +  outerStr + parameter;
        }       
    } 
    public static void main(String[] args) {
               Rextester outer = new Rextester();  
                         outer.run() ;
               Rextester outer1 = new Rextester();  
                         outer1.go() ;
               Rextester outer2 = new Rextester();  
                         outer2.start() ;
       }   
       void run() 
        MemberClass local = new MemberClass();
        System.out.println(local.display(" display is the 1st method of inner class. "));
         }
        void go() {
         System.out.println(" This is the second method of outer class.");
        } 
         void start() {
         System.out.println(" This is the third method of outer class. ");
        } 
     }
OUTPUT.
run is the 1st method of outer class.
 This is inner String .
 This is outer String . 
display is the 1st method of inner class. 
go is the second method of outer class.
start is the third method of outer class.
 

Friday, August 28, 2015

TEXTILE SCREEN PRINTING TECHNIQUES

KỸ THUẬT IN BÔNG VẢI SỢI BẰNG KHUNG LỤA

Nhằm mục đích giúp thế hệ trẻ có một
khái niệm ngắn gọn và căn bản về nghề in bông vải sợi,tài lịêu nầy đã được sọan ra qua kinh nghiệm làm việc trong nhiều năm tại California-USA.
Ngành in bông trên vải bằng khung có hai khâu chính . Khâu vẽ hình và làm phim dương bản gọi là Graphics Design-Art Work
và khâu Kỹ Thuật Sãn Xuất goị là Production Techniques.
Khâu thứ nhứt : Mời tham khảo http://www.vectorquick.com của một bạn đồng nghiệp.
* VectorQuick là cơ sở chuyên môn vẽ  lại các hình ở dạng jpegs, gifs, and pngs thành vector formats tức là dương bản. Đem đặt dương bản trên khung in có trán chất emulsion rồi chuyển hình từ dương bản vào khung in bằng cách dùng ánh sáng UV.

* Artwork được  cơ sở VectorQuick ,bạn thân của người viết bài nầy, sẽ thực xong trong vòng ít hơn 24 hours.
Khâu thứ hai : Được tóm gọn trong các logos nầy và kế tiếp
Kích thước khung lớn hay nhỏ và cần phải thực hiện đủ bao nhiêu khung hoàn toan tuỳ thuộc vào số phim dương bản (positive films) hoặc hình vẽ muốn in ra.
Khung sau khi làm xong cần để khô hoặc phơi ngoài nắng trong một thời gian để tăng độ bền bĩ cho lớp keo emlusion không bị đứt hay bể quá nhanh do sự ma sát (friction) trong khi in.Đây là một chi tiết quan trọng cần lưu ý nhưng có nhiều cơ xưởng tại Nam California bỏ quên theo kinh nghiệm của người viết bài nầy.
Giai đoạn in –Printing phase.
Trước khi bước qua công đọan nầy cần phải có sẵn sàn những dụng cụ và vật liệu như sau.
1-Máy in bằng tay hay máy chạy tự động .
2- Máy sấy khô goị la dryer được điều chỉnh đúng theo nhiệt độ cần phải có.
3-Mực in là loại mực gì : plastisol ink,water base ink,discharge ink và cần bao nhiêu màu khác nhau cùng với số lượng đủ để hòan tất công việc.
4-Sản phẫm in ra là loại vải gì cotton,nylon,polyester,acrylic,len,lua tơ tằm hoặc pha trộn đủ thứ.
5-Tuỳ theo kích thước khung in và bàn vẽ, bàn in gọi là palette được chọn phải có kích thước tương ứng

Giai đoạn phục hồi khung đã in xong-Reclaiming screens phase.
REMOVING PLASTIC OR PAPER TAPES . Soak screens with water for a while as shown the picture,then pull out tapes slowly
REMOVING INKS . Brush ink remover over the both sides of screens and then wash them out with cold water
REMOVING STENCIL AND HAZE. Spray stencil remover on both sides of screen.Depending on the stencil hardness,after 2-5 minutes wash stencil out by strong water pressure.If stubborn hazes show up on screen ,brush alkaline haze remover on them then blow them out by pressure water.
DEGREASING SCREEN . Brush degreaser detergent on both sides of screen then blow them out with spray water.This process is important.If the screen is still dirty,the coated stencil won’t adhere firmly to the screen and will break in printing phase .
còn tiếp.

Monday, August 10, 2015

HOW TO CALL A METHOD OR FUNCTION IN JAVA

PHƯƠNG PHÁP CALL MỘT METHOD HAY FUNCTION TRONG JAVA PROGRAM.
                         NĂM PHƯƠNG PHÁP CĂN BẢN.
1-   Nêu method là static thì call nó trực tiếp trong main method.
Thí du.
 
class Rextester{
   static void display(){
   System.out.println("Hello Friends ! You call me directly from inside main method\nbecause I am static");
}
    public static void main(String[] args){
                         display();
   }
}
Output.
Compilation time: 0.82 sec, absolute running time: 0.14 sec, cpu time: 0.07 seCompilation time: 0.82 sec, absolute running time: 0.14 sec,
cpu time: 0.07 sec, memory peak: 28 Mb, absolute service time: 0.97 sec
 
Hello Friends ! You call me directly from inside main method
because I am static

2- Nêu method là non-static , muốn call nó phải tạo một object cho class trong main method.

Thí du.
 
class Rextester{
    void display(){
   System.out.println("Hello Friends ! You must create an object for class inside main method to call me\nbecause I am non-static");
}
    public static void main(String[] args){
                        Rextester rx = new Rextester();
                         rx. display();
   }
}
Output.
Compilation time: 0.82 sec, absolute running time: 0.13 sec, 
cpu time: 0.06 sec, memory peak: 27 Mb, absolute service time: 0.95 sec
 
Hello Friends ! You must create an object for class inside main method
To call me because I am non-static

3-   Nếu method là non-static chứa trong Inner class hay còn gọi Member class , muốn call nó phải tạo trong main method một combined object oi của Outer class và Inner class như sau :
                           Outer.Inner  oi = new Outer().new Inner();
Thí du.
 
class Rextester {   
 static{
System.out.println("HOW TO CALL A METHOD WRITTEN INSIDE THE INNER CLASS ? ");
}
class Inner {  
          void display() {  
 System.out.println("I am the method in the Inner class.\n You must create an  object combining the Outer class with the Inner class to call me ");  
 
  public static void main(String[] args){         
Rextester.Inner  oi = new  Rextester().new Inner();
                            oi.display();
}}
Output.
  Compilation time: 1.04 sec, absolute running time: 0.13 sec, 
cpu time: 0.07 sec, memory peak: 28 Mb, absolute service time: 1.18 sec
 
HOW TO CALL A METHOD WRITTEN INSIDE THE INNER CLASS ? 
I am the method in the Inner class.

 You must create an  object combining the Outer class with the Inner class to call me 

4- Trong class Inner viết method void display().Muốn call method nầy thì tạo thêm một method nữa thí dụ void run().Trong void run() tạo một object cho class Inner , rồi call method display() trong void run().
 
class Rextester {   
 static{
System.out.println("HOW TO CALL A METHOD WRITTEN INSIDE THE INNER CLASS ? ");
}
class Inner {  
          void display() {  
 System.out.println("I am the method in the Inner class.\nCreate an object for Inner class inside the method run to call me. ");  }  
 
  public static void main(String[] args){         
Rextester  rx = new  Rextester();
                            rx.run();}
 
           void run(){
             Inner in = new Inner();
                    in.display();}
}
Output.
 Compilation time: 0.83 sec, absolute running time: 0.13 sec, cpu time: 0.1 sec, memory peak: 27 Mb, absolute service time: 0.96 sec
 
HOW TO CALL A METHOD WRITTEN INSIDE THE INNER CLASS ? 
I am the method in the Inner class.
Create an object for Inner class inside the method run to call me.

5-Nếu method display() viết trong static class Nested.Tạo object cho class Nested trong main method rồi call display() .
Thí dụ
   class Rextester{
   static class Nested{  
   void display(){    // Method having no return 
System.out.println(" Function display() is inside class Nested");}
}
    public static void main(String[] args){
           Nested ns= new Nested(); 
                        ns.display(); }
}
output.
Compilation time: 0.83 sec, absolute running time: 0.14 sec, 
cpu time: 0.09 sec, memory peak: 21 Mb, absolute service time: 0.99 sec
 
Function display() is inside class Nested
 
GHI CHÚ.
Java  programming chấp nhận trong mỗi class, chúng ta có thể viết thêm một hay nhiều classes khác có một tên chung là nested class.
Có 2 loại nested class :  
* static nested class và non- static nested class.
* non-static nested class còn được gọi là INNER CLASS hoặc MEMBER CLASS.
* class ngoài cùng gọi là OUTER CLASS.
* INNER CLASS viết trong OUTER CLASS.
* Trong bài nầy,người viết chọn OUTER CLASS là class Rextester để có thể xử dụng compiler của Rextester.com   * Taị sao chúng ta cần dùng Inner class hay Nested class? Vì muốn program được đơn giản và có tổ chức rõ ràng dễ kiểm soát(Simple and Concise),mỗi class làm một phần việc riêng.