Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
vinjn
Blog:
http://weibo.com/vinjnmelanie
vinjn's Profile
2
Posts
2
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Yet another match-5 puzzle game ColorLines4M
[1 Reply]
14-Feb-2013 05:15 PM
Forum:
Share your Work
http://vinjn.github.com/processing_sketch/ColorLines4M/
ColorLines4M is a clone of
Color Lines
.
I made this as a VDay gift.
Sample of Microsoft Bing translation API usage.
[6 Replies]
13-Dec-2011 12:16 AM
Forum:
Share your Work
Following is a simple code explaining how to do translation via Bing api.
http://www.bing.com/toolbox/bingdeveloper/
A valid app id must be applied before use bing translation service.
But you can use my appId as provided...
String bingTranslate(String query, String langFrom, String langTo)
{
//first encoding to url style
try
{ query = URLEncoder.encode(query,
"UTF-8"
); }
catch
(Exception e) { } String appId =
"78280AF4DFA1CE1676AFE86340C690023A5AC139"
; String url =
"
http://api.microsofttranslator.com/V2/Ajax.svc/Translate?appId=
"
+ appId+
"&from="
+ langFrom +
"&to="
+ langTo +
"&text="
+ query;
return
loadStrings(url)[
0
]; }
//Chinese -> English
String translateChinese(String query) {
return
bingTranslate(query,
"zh-cn"
,
"en"
); }
//
English -> Chinese
String translateEnglish(String query) {
return
bingTranslate(query,
"en"
,
"zh-cn"
); }
void
setup() { println(translateChinese(
"今天星期几啊"
)); println(translateEnglish(
"Every dog has its day!"
)); }
«Prev
Next »
Moderate user : vinjn
Forum