การทำลายน้ำบนภาพด้วย Java (Java Image Watermarking)
อันดับแรกต้องไป ดาวน์โหลด library watermarker-0.0.4.jar มาก่อน แล้วก็ตามด้วย dozer-4.2.1.jar หลังจากนั้นก็ add JAR file ลงไปใน Project ของเรา
Grails RunApp: : Error starting Sun’s native2ascii
ปัญหา RunApp: : Error starting Sun’s native2ascii ตอนสั่ง $ grails run-app ปัญหาบน ubuntu
[Google Maps Geocoding] ลอง Parse Json ด้วย Groovy + Java (Netbeans)
โปรเจ็คตลกๆมาอีกแล้ว เพราะโปรเจ็คนี้ผมใช้ Json Lib + Groovy + Java แต่ผมใช้ Groovy ดึง json (URL.text) แล้วใช้ Java เป็นตัวแกะ jsonObject เป็น jsonArray หลังจากนั้นเอาข้อมูลโยนกลับไปให้ Groovy ถอดเอาเฉพาะส่วนที่ต้องการออกมา (ในที่นี้คือ coordinates — latitude ,longitude นั่นแหละ) ดูวุ่นวายมาก ทั้งๆที่ เขียน Groovy อย่างเดียวก็ได้ เพราะ Json Lib ก็ลองรับ groovy หรือจะเขียน Java เพียวๆ เลยก็ได้ เรื่องของเรื่องคืออยากเขียน Java ร่วมกับ Groovy อีกครั้ง เพราะไม่ค่อยถูกกับ Java จริงๆ มันดูเวื่นเว้อ มันเขียนเวิ่นเว้อด้วย ยาวๆ งงๆ (อาจเป็นเพราะไม่ได้ศึกษาอย่างลึกซึ้ง) groovy [...]
[cache] Grails Project : การตัดคำภาษาไทย(ด้วย Java) และประมวลผลด้วย Grails
ครึกครื้นอยากเขียน … พอดีได้โจทย์ซึ่งเป็น Senior Project ของเพื่อน แต่ว่าอยากทำเลยเอามาลองเสียหน่อย (ฝึกเขียน grails ด้วยการทำ โจทย์) ได้ความรู้ + ประสบการณ์ มากเลยทีเดียว เพราะว่า เพิ่งเริ่มจับ grails แล้วทำงานแบบเป็นชิ้นเป็นอัน ครั้งนี้ก็ครั้งแรก แต่ก่อนหน้านี้มีใช้ grails + xfire ในการทำ project วิชา SOAp ก็เรียบร้อยไป (แต่ client ใช้ nusoap + codeigniter) เล่นกันทีเดียวคุ้ม
Twitter Follow Back Script
517 sudo gem update –system 518 sudo gem install rubygems-update 519 sudo update_rubygems 520 sudo gem install twitter #!/usr/bin/env ruby require ‘rubygems’ require ‘twitter’ config = YAML::load(open(".twitter")) httpauth = Twitter::HTTPAuth.new(config[’email’], config[’password’]) base = Twitter::Base.new(httpauth) base.followers.each do |follower| if !follower.following begin base.friendship_create(follower.id, true) rescue puts "An error occurred: #{$!}" end puts "Created friendship with [...]
[Pre] GitHub Command (Blog From Terminal)
nazts-macbook:~ NAzT$history | grep git 68 grails create-app gitdemo 69 cd gitdemo/ 79 cd gitdemo/ 80 git init 81 git add . 82 git commit -m “initial checkin”
[Twitter] Follow กลับ คนที่มา Follow เรา
Script Follow กลับ ด้าวยภาษา ruby ก่อนอื่นต้องลง twitter gem ด้วยคำสั่ง sudo gem install twitter (อย่าลืมอัพเดต ก่อนด้วยนะ) ไฟล์ config มีหน้าตาเป็นแบบนี้นะ FILE (.twitter) email: my_twitter_email password: my_twitter_password #!/usr/bin/env ruby require ‘rubygems’ require ‘twitter’ config = YAML::load(open(".twitter")) httpauth = Twitter::HTTPAuth.new(config[’email’], config[’password’]) base = Twitter::Base.new(httpauth) base.followers.each do |follower| if !follower.following begin base.friendship_create(follower.id, true) rescue puts "An error occurred: [...]
วิธีการใช้ GLUT บน MAC ด้วย Eclipse
Glut With Eclipse On Mac ก่อนอื่นเราต้องใช้ (Use This) #include <OpenGL/gl.h> #include <GLUT/glut.h> แทนที่จะใช้ (Instead Of) #include <GL/gl.h> #include <GL/glut.h> แล้ว คลิกขวาที่ Project ด้านซ้ายมือ เลือก Properties เลือก “C/C++ Build:Properties” มองหาและไปที่ “Tool Settings” เลือกไปที่ “Mac OS X C++ Linker : Miscellaneous” เพิ่มใช่ช่อง “Linker flags” field: ด้วย -framework GLUT -framework OpenGL



![[Google Maps Geocoding] ลอง Parse Json ด้วย Groovy + Java (Netbeans)](http://www.together.in.th/wp-content/uploads/2010/01/Picture-5-150x150.png)