วันอาทิตย์ที่ 3 พฤษภาคม พ.ศ. 2558

Debian 8.0

ออกมาหลายวันแล้วสำหรับ Debian 8.0 เพิ่งมีโอกาสโหลดมาติตั้งแทนที่ Debian 7.8 ที่ออกมาไม่กี่เดือน  ลองชมหน้าตากันเลยครับ



รายละเอียดของแพคเกจต่าง ๆ ที่มาพร้อมกับ Debian 8.0 มีดังนี้

This release includes numerous updated software packages, such as:
  • Apache 2.4.10
  • Asterisk 11.13.1
  • GIMP 2.8.14
  • an updated version of the GNOME desktop environment 3.14
  • GNU Compiler Collection 4.9.2
  • Icedove 31.6.0 (an unbranded version of Mozilla Thunderbird)
  • Iceweasel 31.6.0esr (an unbranded version of Mozilla Firefox)
  • KDE Plasma Workspaces and KDE Applications 4.14.2
  • LibreOffice 4.3.3
  • Linux 3.16.7-ckt9
  • MariaDB 10.0.16 and MySQL 5.5.42
  • Nagios 3.5.1
  • OpenJDK 7u75
  • Perl 5.20.2
  • PHP 5.6.7
  • PostgreSQL 9.4.1
  • Python 2.7.9 and 3.4.2
  • Samba 4.1.17
  • Tomcat 7.0.56 and 8.0.14
  • Xen Hypervisor 4.4.1
  • the Xfce 4.10 desktop environment
  • more than 43,000 other ready-to-use software packages, built from nearly 20,100 source packages.
เห็นหน้าตาแล้วก็เลือกติดตั้งเพื่อการใช้งานให้เหมาะกับความต้องการกันเลยนะครับ

วันพฤหัสบดีที่ 5 กุมภาพันธ์ พ.ศ. 2558

Image Processing with Java on Ubutu 14.10

File GrayScale.java


import java.awt.*;
import java.awt.image.BufferedImage;

import java.io.*;

import javax.imageio.ImageIO;
import javax.swing.JFrame;

public class GrayScale {

   BufferedImage  image;
   int width;
   int height;
   
   public GrayScale() {
   
      try {
         File input = new File("submarine.jpg");
         image = ImageIO.read(input);
         width = image.getWidth();
         height = image.getHeight();
         
         for(int i=0; i<height; i++){
         
            for(int j=0; j<width; j++){
            
               Color c = new Color(image.getRGB(j, i));
               int red = (int)(c.getRed() * 0.299);
               int green = (int)(c.getGreen() * 0.587);
               int blue = (int)(c.getBlue() *0.114);
               Color newColor = new Color(red+green+blue,
               
               red+green+blue,red+green+blue);
               
               image.setRGB(j,i,newColor.getRGB());
            }
         }
         
         File ouptut = new File("grayscale_submarine.jpg");
         ImageIO.write(image, "jpg", ouptut);
         
      } catch (Exception e) {}
   }
   
   static public void main(String args[]) throws Exception 
   {
      GrayScale obj = new GrayScale();
   }
}



submarine@submarine:~/images$ ls
GrayScale.java  lena.png  submarine.jpg

สั่งคอมไพล์โปรแกรม

submarine@submarine:~/images$ javac GrayScale.java

คอมไพล์สำเร็จ

submarine@submarine:~/images$ ls
GrayScale.class  GrayScale.java  lena.png  submarine.jpg

สั่งรันโปรแกรม

submarine@submarine:~/images$ java GrayScale

แสดงผลลัพธ์จากการรันโปรแกรม

submarine@submarine:~/images$ ls
GrayScale.class  GrayScale.java  grayscale_submarine.jpg  lena.png  submarine.jpg
submarine@submarine:~/images$