Jan 28, 2011

Google translation from a server side.

I want to use the Google translation from a server side.
My Ideas are 1. run javascript on a server or 2. Direct http call to Google from server with PHP.

RESULT:

I selected "#2 Direct http call".

DETAIL:


1. run javascript on a server

I found "V8 JavaScript Engine".

"V8 JavaScript Engine" is a very good Engine,
but for me, it will take much time to make goolge objects in the V8.

How to install memo.

DOWNLOAD scons-2.0.1.tar.gz
# tar xzf scons-2.0.1.tar.gz
# cd scons-2.0.1
# python setup.py install --prefix=$HOME

# svn co http://google..... V8
# tar xzf scons-2.0.1.tar.gz
# cd v8
# scon
# cd samples
# g++ -I../include shell.cc -o shellv8 ../libv8.a -lpthread -m32

Test run javascript.

#./shellv8  test.js

test.js is:

print ('Hello' + ', World');
var x = 100;
var y = 200;
print ("x * y = " + (x * y));


Some objects, window and google, not implemented in shell.
It will take much time to make these objects.

2. Direct http call to Google from server PHP.

I re-read "Google Translate API Version 2".
it's is in Labs, but it has REST API.
REST is "Representational State Transfer".

like.
https://www.googleapis.com/language/translate/v2?key=AIzaSdkdN4TfYc0&q=flowers&source=en&target=fr&callback=handleResponse&prettyprint=true

Jan 5, 2011

How to quickly, randomly select and sort using MySQL?

(ENGLISH)
How to quickly, randomly select and sort a specified number of records from a table under some conditions using MySQL?
I think that it is very difficult.
My solution has an almost randomness.
Here, "much_more_number" is about twice or greater than "specified_number".
SQL likes...
"SELECT * (SELECT *, RAND() as random FROM (SELECT * FROM table WHERE conditions LIMIT much_more_number) as x ORDER random LIMIT specified_number) as y ORDER sort_conditions"

(JAPANESE)
MySQLを用いて、一定の検索条件に該当するレコードを指定された数だけランダムに抽出しそれをソートすることを高速に行う方法とは、
これを実現することはとても難しいと思われる。
私の解答は、まあまたランダムというものです。
ここで、"much_more_number"というのは、"specified_number"の二倍とかもっと大きな数です。
SQLは、こんな感じです。
"SELECT * (SELECT *, RAND() as random FROM (SELECT * FROM table WHERE conditions LIMIT much_more_number) as x ORDER random LIMIT specified_number) as y ORDER sort_conditions"

Dec 30, 2010

Oh My God! SSL Certs automatically renewed

My SSL certificate is automatically renewed !

They said,
"We just want to let you know we've automatically
renewed the following items according to our agreement:"

$49.99
$199.99

Wooooops!

Dec 15, 2010

How to get "set A - set B" in MySQL

How to get "set A - set B" in MySQL.

A is a table. Like a group of members.
B is a table. Like a woman list of people.

A has fields. "name, role, ...".
B has fields. "name, sex (= only woman), age, ...".

We want to get "set A - set B".
This is, in set operation, "A inter (not B)".
Also, this is "Not woman subet of A".

And the SQL is:
"SELECT * FROM A LEFT JOIN B ON A.name = B.name WHERE B.name is null;"

Dec 13, 2010

Our new SSL Certificate

Our new SSL Certificate

1. serached a cheaper SSL certs seller on Google.

2. found "CheapSSLs.com" and went there.

3. thought which is better "Geotrust Rapid SSL 9.95/yr" OR "Comodo PositiveSSL $8.95 ?"

  I selected Rapid SSL. becuase PositiveSSL is 1024 bit, it's samll.

4. thought which is better 1 year or 3 years or more?

 I choosed 1 year. bacause in the next year, it'll be more chaaper.
 and I'll be able to try it again.

5. Buy, it is very easy.

6. Next I must activate it. but my old SSL is not still expired,

   It'll be expired After Dec 17 16:07:40 2010 GMT.
  
   to be continued.

Dec 9, 2010

improved PHP mathpublisher

I improved "PHP mathpublisher 0.3".

- new features


"sqrt()" "blace" sizes are optimized.

mp : minus plus mark
$  : use NON-Italic font for a word


(Japanese font) : support Japanese font
(You must need IPA font http://ossipedia.ipa.go.jp/ipafont/index.html)

- Download

You can get it from

http://www.mylovewill.com/ya/phpmathpublisher-0.3-yaruben.tar.gz


Oct 9, 2010

高校生・中学生の勉強サイト「やる勉」つくりました。

  やる勉とは

●中高生の勉強をもっと楽しく
友人と一緒に、 ケータイを使って ゲーム感覚で 楽しく勉強したい。
やる勉は、 そんな高校生中学生 の皆さんのためのサービスです。
やる勉を使えば、 いつでも、 どこでも、 気軽に、 素早く、 勉強できます。
ケータイログイン画面のQRコード
やる勉の特徴
1. 誰でも自由に教材を作れます。
2友人と一緒に教材を作れます。
3. 教材をユーザ全体で共有できます。
4. 教材作成者へ感謝のメッセージを送信できます。
5. 学習記録が残り復習自動でできます。
6ケータイだけでなく、iPhoneパソコンからも使えます。
●どんな教材
1. 単語カード : 英単語の暗記に
2. 片方向カード : 公式計算
3. 両方向カード : 元素記号化学式
4. 語順並べ : 英作文
5. 三択カード : 社会地理
6. 5W1Hカード : 歴史
7. 漢字カード : 漢字熟語の読み書きに
●中高生の保護
高校生中学生のために 安全なネット環境に配慮しています。
1メールアドレスは他のユーザに非公開
2掲示板プログ機能は、無し
3ハンドル名アイコンの公開は承認制
4教材の公開は承認制
5. 感謝のメッセージ承認制
料金
高校生中学生のために 低料金を心がけています。
12011年03月31日までは、試験運用のため無料
2. 月額315円(税込み・予定)
3. ユーザ登録後、一ヶ月無料
4. 教材作成で利用期間の延長
5. 携帯電話のパケット通信料は別途必要です。
大人の皆さんへ
やる勉は、大人の皆さんも、もちろんご利用になれます。
ご自分の自己啓発資格試験の学習ツールとしてご利用ください。

企業の社員教育ツールとしてやる勉をご活用いただくことも可能です。
専用システムをご検討される方は、弊社までお問い合わせください。