Monday, April 28, 2008

Yahoo Go SDK กับ เก็บบล็อกชาวบ้าน

http://www.narisa.com/blog/patrickz/index.php?
http://www.narisa.com/blog/patrickz/index.php?s=2a706888b75cb7991858c1b060e0267f&showentry=1534

http://www.blognone.com/node/6681

http://www.funambol.com/blog/capo/2008/01/yahoo-go-because-we-all-love-sdks.html
ํYahoo Go! SDK
http://mobile.yahoo.com/developers/platform;_ylt=Ajm45K1X6D15tFdqV49pyml8tQcJ

Tuesday, January 08, 2008

Yahoo Go: because we all love SDKs

If you are a mobile developer, you are already a frustrated individual. You dream of a world with one mobile operating system and one SDK (wait, are you sure, take a look at what you have in front of you...), instead Yahoo at CES has just announced yet-another-mobile-SDK.

Damn, can't life in mobile be easier?

If you want to build a mobile app today, you can choose from:
  • JavaME: great reach but you need to develop one app per phone, so that's about one billion slightly different apps... But just slightly.
  • Symbian: not a bad idea, big reach, stable platform, maybe boring. I could even build a JavaME app and tweak it to become native.
  • Windows Mobile: very small market share and not growing, but easy to build. Tough, who wants to build for a Microsoft operating system? Really uncool... If my boss forced me to do it, I will. But please boss do not force me to do it.
  • iPhone: that would be cool, the thing attracts girls and its market share will boom fast (although the device is not really robust). Wait, I have to hack it and there are no APIs. Even cooler! It might get boring when they announce the SDK in February, though...
  • Android: whooo!! supercool. Too bad there are no devices and it will take a few years for it to have a meaningful marketplace. Hey, but you can get money from Google with the Android Challenge...
  • BREW: what? No, please. I do not want to develop in a box with high walls.
  • PalmOS: is it still alive?
  • Flash: nice, but it is ready for prime time? It could actually be the answer to JavaME portability in the long run. Wait and see.
  • A dozen variations of Linux, lead by OpenMoko (because I like them), including Maemo and many others: go for it, man! We need people that love to dream in this world! Worst case scenario: you'll port it back to Android in a year. It is a mobile Linux variation, after all.
  • Another ten or so I forgot, like Sony PSP and many more
When you think you are done with the list, boom! Yahoo comes up with a mobile platform over a mobile operating system. A sort of a middle layer that allows you to develop your applications on top of that. Not that far, as a concept, from JavaME or Flash. Certainly, more focused in scope.

The issue? Well, a mobile platform over an operating system might be a bit large in size and slow as hell. Hey, you can always hope in Moore's law.

The opportunity? Well, they already ported their platform over the other operating systems. If they make it really consistent (doable), you develop once and it will run everywhere. That's a developer dream.

The risk? Well, for your app to succeed, you need the underlying technology to succeed. If people do not download Yahoo Go on their phone because it is too large and too slow, you are toasted. Uuhhmmm.

Overall, I like Yahoo's move.

They needed to come up with something (anything ;-) to counter Google and Apple. They did it.

I am a fan of the mobile widget concept, as you might remember. In one of my first posts on this blog, I mentioned Yahoo going for WAP but my prediction was they would go back to mobile widgets one day. They did it.

Now they just have to make sure consumers love the platform and developers build the widgets. The problem is that the two are linked. One drives the other. And getting developers mind share in mobile is very very hard these days...

Good! Luck! To! Yahoo!



Yahoo! เปิดตัว SDK สำหรับมือถือ

tags:

ช่วงนี้งาน CES จัดที่ลาสเวกัส หลายบริษัททยอยใช้เวทีนี้เปิดตัวผลิตภัณฑ์ใหม่กันชุดใหญ่

ของ Yahoo! ได้ดำเนินรอยตามแอปเปิลและกูเกิล โดยเปิดตัว SDK สำหรับมือถือกับเค้าบ้าง เพียงแต่ที่ต่างออกไปคือไม่ใช่ SDK เฉพาะรุ่นเหมือนแอปเปิล หรือระบบปฏิบัติการแบบกูเกิล แต่เป็นแพลตฟอร์มที่รันบนระบบปฏิบัติการของมือถือที่มีอยู่ในตลาดอยู่แล้วอีกชั้น

แพลตฟอร์มนี้มีชื่อว่า Yahoo! Mobile Developer Platform โดยจะเรียกแอพพลิเคชันเป็น Mobile Widget ซึ่งเขียนด้วยภาษา Blueprint (เป็น XML+XForms เหมือนกับ XUL หรือ XAML คือไม่ได้เป็นภาษาโปรแกรมมิ่งเต็มตัว) เจ้า Mobile Widget เหล่านี้จะรันได้ 2 ที่ คือ

  • โทรศัพท์มือถือที่ลง Yahoo! Go 3.0 ได้ (ปัจจุบันมีประมาณ 30 รุ่น มี BlackBerry, Nokia และ Sony Ericsson ส่วน LG กับ Motorola ออกข่าวแล้วว่ากำลังทำอยู่)
  • โฮมเพจของ Yahoo! เวอร์ชันมือถือ (สำหรับโทรศัพท์ที่รััน Yahoo! Go 3.0 ไม่ได้)

ผมตามไปดูในเว็บไซต์ของ Yahoo! รู้สึกจะยังไม่ค่อยเรียบร้อยดี คือสามารถดาวน์โหลดได้เฉพาะตัว Yahoo! Go 3.0 Beta แต่ส่วนของ widget กับตัว SDK ยังไม่มีให้ดาวน์โหลด (มีแต่เอกสาร และ XML Schema ของภาษา Blueprint) ก็คิดว่าคงจะตามมาในเร็วๆ นี้ครับ

ที่มา - CNET, Ars Technica, WebWare

Sunday, April 27, 2008

คอมไพล์ GD บน Linux

ที่มา http://www.numvarn.com/blog/node/4
เนื่องจากตั้งแต่ติดตั้ง package บน Linux ที่ Tom ลงไว้
ไม่เคย compile ด้วยตัวเองสำเร็จ ต้องพึ่ง RPM หรืออย่างน้อยก็ YUM เสมอๆ

วันนี้ check ว่า Server จริง ก็เป็น RHEL5 ถ้าเกิดต้องลง GD ขึ้นมาจริงๆ ยังไงก็ต้อง Compile เอง
ก็เลยเอาเวบนี้ http://www.numvarn.com/blog/node/4
มาเป็นแนวทาง

jpegsrc.v6b.tar
libpng-1.2.5.tar
Compile PHPใช้เวอร์ชั่น php-5.2.0.tar

# ./configure --prefix=/usr/local/apache2/php \
--with-zlib \
--with-xml \
--enable-cli \
--enable-exif \
--enable-ftp \
--enable-mbstring \
--enable-mbregex \
--enable-dbx \
--enable-sockets \
--with-gd \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--with-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache2/bin/apxs
#make
#sudo make install

ทำการติดตั้งเรียบร้อยแล้วให้ทำการแก้ไขค่า Config ของ Apache ให้รู้จักกับ PHP ได้โดยแก้ไขไฟล์ /usr/local/apache2/conf/httpd.confโดยทำการเพิ่มAddDefaultCharset UTF-8 และ
AddType application/x-httpd-php .phpเพิมเติม :
ลิงค์ที่สามารถเข้าไปหาข้อมูลเพิ่มเติมได้อืก
http://www.phpmac.com/

ก็มั่วๆไป พอดี Tom ช่วยเรื่อง php ก็สบายหน่อย ใช้ได้แล้วหละ

Friday, April 25, 2008

ใช้ yum

วันนี้ได้ใช้ yum เนื่องจาก download มา compile เองไม่ได้ตามเคย
ที่จริงตั้งใจจะใช้แค่ jpgraph เฉยๆ แต่มันต้องการ lib-gd

บน Windows ก็ไม่มีปัญหาอะไร แค่ไป un comment ออกซะ
ที่ file php.ini
extension=php_gd2.dll ออกซะ จะได้โหลดมาใช้ อย่าลืม restart

แต่บน linux มันดันไม่มี php.ini แล้วถ้าจะให้มีมันต้องทำอะไรนิดหน่อย
ซึ่งนิดหน่อยนี่เราไม่กล้าทำ ก็เลยพยายามใช้ yum ลงแทน

yum เป็น tools ตัวนึงที่จะทำการ download และ install package ต่างๆที่ dependency กันอย่างมากมาย
ถ้าเราทำเองเราต้องโหลด version นี้ เพื่อที่จะเข้ากับ version นี้ เป็นทอดๆ ไม่รู้จบ

ใช้ Yum ดีกว่า เพื่อฉลองความสะดวก และเพิ่มความโง่ให้กับผู้ใ้่ช้งาน ซึ่งผมยินดี

ก็ใช้ yum install php-dg บน test localhost เป็น fedora8 ก็โอ แต่ server ของ Tom ดันเป็น RHEL4 ซึ่งเก่าจริงๆ จนไม่มี package ตามที่ header มันเรียกหา ทำให้ ใช้ Yum ไม่ได้

ที่จริงมันแย่กว่านั้น เพราะมันไม่มี yum ด้วยซ้ำ ซึ่งก็ต้องไปโหลดมาเอง เอา version ใหม่จัดก็ไม่ได้นะ
Redhat4 ต้องใช้ version 2 ลองมาแล้ว
http://linux.duke.edu/projects/yum/download/2.6/ <-== ไปหา RPM มาลงเองซะก่อน ด้วยความโง่ก็ทำอะไรไม่ได้ คอมไพล์เองไม่เป็น ก็เลยพยายามแก้ /etc/yum.conf เอง เพราะมันไม่มีไฟล์ yum.repos.d นี่นา จริงๆก็ลองสร้างเอง แต่สุดท้ายระบบมันก็มา edit ที่ yum.conf ก็เลย edit ตรง แก้ไปให้มันไปชี้ path ที่ redhat version 7 แทน โหลดได้บาง package แต่ก็ error ลอง search ได้ solution จากคนนี้ http://fixunix.com/redhat/262625-fedora-core-4-yum-repository.html > The Fedora Core 4 repository seems to have been suspended. Is there
> another copy of this repository online ? And if so how do I pointmy
> machine at it ?
>
> I have a machine that will not run Fedora Core 5 or later and need to add
> some packages.


I added the following line to the '[base]' section in
'/etc/yum.repos.d/fedora-legacy.repo' :-

baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os

This now redeems my old Fedora Core 4 machine

It also seems there are alot of extra packages availiable possibly ?

Aaron

นี่ไง baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os

ก็เลยลอง ตอนนี้กำลังโหลดอยู่ ผลเป็นไงเดี๋ยวรู้กัน

ปล repository ของ RHEL
http://mirror.dulug.duke.edu/pub/yum-repository/

Thursday, April 24, 2008

php.ini อยู่ไหน


Article:
PHP 4.3 and Mac OS X
Subject: where is php.ini
Date: 2003-01-17 00:45:01
From: anonymous2

Anyone know where php.ini is installed after completing this process? I couldn't find it in /etc or /usr/lib/php.

Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • where is php.ini
    2003-02-28 18:40:14 tychay [Reply | View]

    The default compile of php no longer installs a php.ini file.

    There are two included with the php distribution php.ini.dist and php.ini.recommended(?).

    The place to put the config file is in /etc/php.ini (if using Apple's directives) or /usr/local/etc/php.ini (if using the default configure, or Mark's compile). The quick way to find out (assuming php4.3+) is

    bash-2.05a$ php -r "phpinfo();" | grep Configuration
    Configuration File (php.ini) Path => /etc
    Configuration

    If you can't do that (because you are using pre 4.3, for shame!) then try the script another post mentioned.

    Hope this helps,

    terry chay
    tychay at php dot net
    • where is php.ini
      2005-06-10 07:46:19 zicco [Reply | View]

      if php -r does not work for your vertion of php, you can do (Linux only):

      echo ""|php |grep Configuration

บน linux
หาได้โดย php -r "phpinfo();" | grep Configuration หรือ echo ""|php |grep Configuration ดีเนอะ

jpgraph วาดกราฟด้วย php ง่ายๆ

สำหรับ mobile อยากได้ง่ายที่สุด คือไม่ต้องถึงกับเป็น flash ต้องการเป็น image ธรรมดา Jpeg หรือ Png ก็ได้
ไปโหลดที่
http://www.aditus.nu/jpgraph/jpdownload.php

ดูคำแนะนำ
http://php.deeserver.net/webboard/odshow.php?No=11345

search เจอะได้อีกเยอะ คนไทยเอามาใช้ ต้องแก้เรื่อง Font นิดนึง
ผมยังไม่ได้ลองแก้เลย เดี่ยวต้องลองหน่อย

Tuesday, April 22, 2008

web service

สร้าง complex type จาก database table หรือ สร้างมือสร้าง method และ add ลงไปใน web service
เพิ่ม case ใน @test_xxxxxxservice
ดู wsdlhttp://xxxx.beta/start/Xxxxxxservice/xUserStats
ทดสอบhttp://xxxx.beta/@test_Xxxxxxservice.php?func=xUserstats&act=xgetRecentVisitors

ระวังตัวใหญ่คัวเล็ก

วงเล็บเปิดปิด if ใน php
และ

Complex type ต้่องตรงกันเด๊ะๆ จึงจะออกมา ระวัง Array ซ้อน Array พลาดมา 2 ทีแล้ว
ดันให้ query สร้าง complex type แล้วลืมห่อ s อีกรอบอ่ะ

ใช้ print_r ออกมาดูก่อนก็ได้

Monday, April 21, 2008

summary openfire info

I.setup
- step 1: execute installer
windows : just double click
linux : using rpm to install
in case of updating : just use rpm -U

- step 2: use browser to connect to port 9090 eg. http://xxxx:9090 as setup wizard
set language, time and database connection string that you should setup it first. see next topic.

II.configure external database.
Openfire provide database script in (/opt)/openfire/resources/database folder.
choose script that match with your DB server. Now we use Mysql then select "openfire_mysql.sql".
Copy it to your pc.

Go to mysqladmin (phpMyadmin or any MysqlGui). Create new database then run script openfire_mysql.sql.


In case of to change database after wizard installation..
- edit /opt/openfire/conf/openfire.xml
find and edit ..


com.mysql.jdbc.Driver
jdbc:mysql://xxxx:3306/openfire_linux
xxxx
xxxx
select 1
true
true
5
15
1.0




III.configure to enable http-bind in openfire (base on openfire version 3.5.0)
enable "HTTP Binding" and set port to selected port
at 'Server' tab > 'Server Setting' > 'HTTP Binging' column in the left


add system properties below if not exist
xmpp.httpbind.client.requests.polling = 0
xmpp.httpbind.client.requests.wait = 10

IV.configure to enable http-bind in apache
see http://www.igniterealtime.org/community/message/156841 and do as suggestion.
if still have problem, see http://www.linuxquestions.org/questions/linux-server-73/authentication-error-openfirejwchat-http-binding-612818/


Config the httpd.conf file of apache

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so


ServerName localhost
DocumentRoot /var/www/jwchat

Options +MultiViews

AddDefaultCharset UTF-8
ProxyPass /http-bind/ http://127.0.0.1:8080/http-bind/


V.Increase java memory
See installation manual : http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/install-guide.html
windows Gui - create file name 'openfired.vmoptions' in {openfire path}/bin
- In this file, add the following lines...
-Xms512m
-Xmx1024m
- Restart openfire
windows service - same as normal but change filename to 'openfire-service.vmoptions'

linux manual run- edit /opt/openfire/bin/openfire.sh as http://www.igniterealtime.org/community/message/167950
linux service - see http://www.igniterealtime.org/community/message/151499
- edit /etc/sysconfig/openfire
- find and replace this line
OPENFIRE_OPTS="-Xms256m -Xmx512m"

VI.Add plugin
We can do it at web admin consule (http://xxxx:9090)
'Plugins' tab > Avaliable plugins
select to add plugins by click plus green button in the right (+).

useful plugin is 'User Import Export' plugin. because when we need to change database server, we can use this plugin to migrate all information of user in database without password problem.



VII.Manage user account : Use web admin console > 'Users/Group' tab > user > user summary
If we already installed 'user import/export' plugin, you will see 'Import/Export' sub tab...that we use this to import/export user from/into CSV format.

VIII.See concurrent user and manage (kick user) : also use web admin console > 'Sessions' tab > Active session > Client session
to kick user, use close connection X red button (x) at the right.



.. to enable or disable many feature of openfire, you can find some menu from web admin, rare case as to change database destination need to config in file in {openfire folder}/conf folder.



IX. Testing with ./jabsimule
See link http://www.ejabberd.im/benchmark
1. increase ulimit -n to more than defallt (I use 100000)
2. to generate userm use testsuite tools

cvs -z3 -d:pserver:anonymous@jabbertest.cvs.sourceforge.net:/cvsroot/jabbertest co testsuite
cd testsuite/
cp Makefile.linux Makefile
make userreg

in this package, it
have many tools inside..
use ./userreg to grnerate user name test_{number} to server. (use this tools is enought)
use ./pasvlogin to simulate authentication only with many user.


./userreg -h localhost -u 3000 -n 1
<-h openfire host>
<-u number of users to generate>
<-n number of start user> ex. want to genarate 100 user
we use -n 1 to generate from test_1 to test_100

after that we need to increase to 1000 users
we should us -u 900 -n 101 to generate 900 users start at number test_101

3. get jabsimul to generate bulk of user
wget http://www.ejabberd.im/files/other/jabsimul.tar.gz
tar xzf jabsimul.tar.gz

configure
in {installed folder}/jabsimule/jab_simul/jab_simul.xml

you can download example from 'http://tkabber.jabber.ru/files/badlop/jab_simul.xml.chat60'
to use, rename it to jab_simul.xml

run
call ./jab_simul
or ./jab_simul xxxx.xml if you like to use another configured file


limitation that we have found from using
1. jabsimul cannot simulate user more than around 7000 user per instant
so, you need to use more than 1 instant to simulate more user.
as...

17000

2. number of user to create cannot more than around 50000 ()

like below, jabsimul will occur 'segmentation falut'.


4900056000

to fix you can only reduce number to 50000,
as 4900050000

However, to simulate more user, you can edit jab_simul.xml to change 'resource' or create new series of user account.
(I use import/export plugin to rename from test_xxx to eidos_xxx)




see connerent user in web admin console, session tab.


create script test.sh
nohup /home/sang/jabsimul/jab_simul/jab_simul jab_simul_max${1}.xml > test${1}.log &
use
./test.sh 1 to run 1st configuration
./test.sh 2 to run ... config

X. Increase number of concurrent users which openfire server can support
see how to Increase java memory..
moreover, we found that we need to change ulimit of openfire server too.

XI.Connection Manager
1. go to http://www.igniterealtime.org/projects/openfire/connection_manager.jsp
download and extract connection manager
tar -xzvf connection_manager_3_0_0.tar.gz
mv connection_manager /opt

2. See documentation and installation guide in {connection manager folder}/documentaion/index.html

3. Check that server already install java jdk version more than 1.5 by java -version command
if not, you need to download new verion of java .rpm from java.sun.com

4. Go to openfire web admin(xxxx:9090) Server > Server settings > Connection managers
- tick enable, set port and set password
- click save setting

4. back to connection manager, edit configuration at {connection manager folder}/conf/manager.xml

find and fill information to it

enados.beta

5262

xxxx

5. to use more than 1 connection manager, you have to change this tag in xml file



cm1

1


5



madatory field is 1 that it is idenfied number of connectin manager
which have to be unique number in each connection manager.

6. To enable DNS and HTTP-Bind. We still cannot use this feature..
- To use httpbind it need some servlet java library and change to 'true'..
but It still have a problem with web client (xmpp4js) cannot connect.
- To use DNS, please find more information in connection manage documents

7. run {connection manager folder}/bin/cmanager.bat for windows or chamager.sh for linux

7.1 to increase java vm or fix some problem about java command calling to incorrect java jdk

go to {connection manager folder}/bin ,we can call java bu full path as below

/usr/java/jdk1.6.0_05/bin/java -Xms512m -Xmx1024m -jar ../lib/startup.jar

(in enados.beta I have already created script name is sangrun.sh in {CM folder}/bin)


XII.Clustering
see.. http://www.igniterealtime.org/community/docs/DOC-1471


====================
summary


configure database destination (connection string) : /opt/openfire/conf/openfire.xml at: jdbc:mysql://xxxx:3306/openfire_linux
configure Java VM Size : /etc/sysconfig/openfire at: OPENFIRE_OPTS="-Xms256m -Xmx512m"
configure Connection Manager : /opt/connection_manager/conf/manager.xml

In 'web admin of openfire' you can

change XMPP port,web admin port,SSL enable : at Server > Server manager > Server information > Edit Server Properties
Http bind port, Http bind configure : at Server > Server manager > System Properties
Custering (need to upgrade to Enterprise first) : at Server > Server manager > Clustering
Database stat : at Server > Server manager > Database
logs error : at Server > Server manager > logs

Connection manager : at Server > Server setting > Connection Managers
File transfer : at Server > Server setting > File Transfer Settings