The library is a simple API in Ruby for Microsoft Translator V2

MsTranslate

The library is a simple API in Ruby for Microsoft Translator V2

The Microsoft Translator services can be used in web or client applications to perform language translation operations. The services support users who are not familiar with the default language of a page or application, or those desiring to communicate with people of a different language group.

Installation

Add this line to your application’s Gemfile:

gem 'ms_translate'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ms_translate

Usage

first step set your appId

$ MsTranslate::Api.appId = 'MyRealAppId'

traNslate method:

$ MsTranslate::Api.translate('Hello World!)
$ => Ciao, Mondo!

Method not implemented

  1. Microsoft.Translator.AddTranslation Method
  2. Microsoft.Translator.AddTranslationArray Method

Test

You need to insert your appId into

# File 'spec/lib/ms_translate/api_spec.rb'
@api_real =  'INSERT_YOUR_APPID'

Contributing

  1. Fork it
  2. Create your feature branch (
    git checkout -b my-new-feature

    )

  3. Commit your changes (
    git commit -am 'Added some feature'

    )

  4. Push to the branch (
    git push origin my-new-feature

    )

  5. Create new Pull Request

Author

endorse

WaYdotNET, you can follow me on twitter @WaYdotNET or take a look at my site waydotnet.com

Copyright

Copyright (C) 2012 Carlo Bertini – @WaYdotNET

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Padrino-admin Twitter Bootstrap v2.0 is ready

(Padrino Admin TwitterBootstrap 2.0)

  • Padrino-Modal: rack-flash and delete function into modal 😀
  • highlights error field
  • tof helper: Automatic replace true or false with relative image (list.slim and list.haml)
  • Breadcrumbs
  • Automatic time_ago_in_words when column model is created_at or updated_at
  • Migrate function for MiniRecord

Padrino-Modal

All result from rack-flash and delete request, now is automatic insert into modal javascript plugin

highlights error field

tof_helper

Automatic replace true or false with relative image (list.slim and list.haml)

Breadcrumbs

Automatic Breadcrumbs system:

time_ago_in_words

Automatic time_ago_in_words when column model is created_at or updated_at

MiniRecord migrate

Migrate function for MiniRecord

Demo:

http://padrino.waydotnet.com/admin
user: test@padrinorb.cpm
password: test

By WaYdotNET

Padrino Admin another new layout (based on Twitter Bootstrap v2.0-wip)

http://glowing-leaf-7114.heroku.com/admin/
user: test@padrinorb.com
pass: test

PLEASE DON’T CHANGE LOGIN/PASSWORD

Additional feature:

  • ✔ Padrino-Modal: rack-flash and delete function into modal 😀
  • ✔ highlights error field
  • ✔ tof helper: Automatic replace true or false with relative image (list.slim and list.haml)
  • ✔ Breadcrumbs
  • ✔ Automatic time_ago_in_words when column model is created_at or updated_at
  • ✔ Migrate function for MiniRecord

clone my repository and enjoy 😀

https://github.com/WaYdotNET/padrino-framework

See the code and comment please !!!!

CoffeScript (1.1.1) on Windows: simple method !

CoffeScript (1.1.1) on Windows: simple method !


Inspiration: http://blog.mnasyrov.com/post/2872046541/coffeescript-on-windows-how-to-roast-coffee

To use CoffeScript you need:

  1. Node.js
  2. CoffeeScript
  3. Batch file to run CoffeeScript

 

STEP 1: Node.js

 

I’m very very lazy dev… 😀
And i don’t recompile NodeJs into Windows….. but I’m using v0.4.7 from http://node-js.prcn.co.cc/ [many thx]
and install into:

D:>cd ToolsNodeJsbin

D:ToolsNodeJsbin>node --version
v0.4.7

 

STEP 2: CoffeeScript

 

Use the last version , grab it from https://github.com/jashkenas/coffee-script
and install into:

D:ToolsCoffeeScript

Check version

D:ToolsNodeJsbinnode /cygdrive/D/Tools/CoffeeScript/bin/coffee --version
CoffeeScript version 1.1.1

Node.js need unix-path


Step 3: Batch file

 

I don’t know well bat syntax, and my code is VERY VERY ugly.. but it works 😛

 

@echo off

:: Directories of the tools
SET coffeeDir=D:ToolsCoffeescriptbin
SET nodeDir=D:ToolsNodeJsbin

:: var
SET a=%1
SET b=%2
SET c=%3
SET d=%4
SET e=%5
SET f=%6
SET g=%7
SET h=%8
SET i=%9

:: Check input value if exist and if it's option or file

:A
IF "%a%"=="" GOTO :B
IF "%a:~0,1%"=="-" GOTO :B
FOR /f %%o IN ('%nodeDir%/cygpath.exe -a -u %1') DO SET a=%%o
:B
IF "%b%"=="" GOTO :C
IF "%b:~0,1%"=="-" GOTO :C
FOR /f %%o IN ('%nodeDir%/cygpath.exe -a -u %2') DO SET b=%%o
:C
IF "%c%"=="" GOTO 😀
IF "%c:~0,1%"=="-" GOTO 😀
FOR /f %%o IN ('%nodeDir%/cygpath.exe -a -u %3') DO SET c=%%o
😀
IF "%d%"=="" GOTO :E
IF "%d:~0,1%"=="-" GOTO :E
FOR /f %%o IN ('%nodeDir%/cygpath.exe -a -u %4') DO SET d=%%o
:E
IF "%e%"=="" GOTO :F
IF "%e:~0,1%"=="-" GOTO :F
FOR /f %%o IN ('%nodeDir%/cygpath.exe -a -u %5') DO SET e=%%o
:F
IF "%f%"=="" GOTO :G
IF "%f:~0,1%"=="-" GOTO :G
FOR /f %%o IN ('%nodeDir%/cygpath.exe -a -u %6') DO SET f=%%o
:G
IF "%g%"=="" GOTO :H
IF "%g:~0,1%"=="-" GOTO :H
FOR /f %%o IN ('%nodeDir%/cygpath.exe -a -u %7') DO SET g=%%o
:H
IF "%h%"=="" GOTO :I
IF "%h:~0,1%"=="-" GOTO :I
FOR /f %%o IN ('%nodeDir%/cygpath.exe -a -u %8') DO SET h=%%o
:I
IF "%i%"=="" GOTO :COMMAND
IF "%i:~0,1%"=="-" GOTO :COMMAND
FOR /f %%o IN ('%nodeDir%/cygpath.exe -a -u %9') DO SET i=%%o

:COMMAND
FOR /f %%o IN ('%nodeDir%/cygpath.exe -a -u %coffeeDir%') DO SET p=%%o
%nodeDir%node %p%/coffee %a% %b% %c% %d% %e% %f% %g% %h% %i%

 

set the PATH environment variable contains a path to coffee.bat

the name of the file is very important,  in my case it works well with coffee-rack

Enjoy

Many thanks to:

Mikhail Nasyrov => http://blog.mnasyrov.com/post/2872046541/coffeescript-on-windows-how-to-roast-coffee
Node.js self-contained Windows binaries => http://node-js.prcn.co.cc/index.html
Jeremy Ashkenas => http://jashkenas.github.com/coffee-script/

[OT-SPAM] Pubblicità Ottica di mia morosa :D

Non volevo intasare il muro, ma se non lo faccio rischio la pelle :D:D:D:D:D:D

Siccome l ottica di mia morosa presenta la sfilata in spiaggia questa domenica ( a Cattolica) , ecco l invito (ovviamente non serve per entrare ma solo come pubblicità)

 

perando di vedre qualche volto conosciuto al DotNETMarche

 

ciao a tutti e scusate lo spam !!!!!

Struttura OpenOttica

Il nome del programma è “OpenOttica” visto che ho intenzione di rilasciare i codici sorgenti di questo applicativo (appena ho tempo mi leggo un paio di licenze e ve la comunico).

 Prima di tutto va detto che verrà sviluppato con il .NET 2.0 e come database Mysql/SQLExpress/SQLite poi da decidere quale utilizzare in “produzione”.

Altra cosa, se un giorno riesco cerco di farlo girare pure su MONO …. ma non credo, visto che ancora ci sono delle PINVOKE che SQLite utilizza e che MONO allo stato attuale non supporta.

 

Incominciamo……

Per realizzare questo progetto, ho intenzione di utilizzare NHibernate

Prima di tutto vediamo come ho intenzione di dividere la struttura del progetto, almeno cosi’ se avete intenzione di aiutarmi, criticare, e tutto quello che vi viene in mente, ben accetto :D:D:D:D

 

  • Domain Model 
  • Persistance ( con l integrazione di NHRepository o Rinho.Commons)
  • UI (qui è il caso di vedere se farlo Winform o Webform, od entrambi)
  • Utilities

Fino a qui facile, si tratta semplicemente di 4 progetti di Vs.NET

Ovviamente ci saranno anche i vari test da fare:

  • Domain Model.Test
  • Persistance.Test

Per fare i test utilizzo NUnit