This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************** | |
OmegaT - Computer Assisted Translation (CAT) tool | |
with fuzzy matching, translation memory, keyword search, | |
glossaries, and translation leveraging into updated projects. | |
Copyright (C) 2010 Alex Buloichik, Didier Briel | |
2011 Briac Pilpre, Alex Buloichik | |
Home page: http://www.omegat.org/ | |
Support center: http://groups.yahoo.com/group/OmegaT/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Written by Olivier Mengué | |
use utf8; | |
use strict; | |
use warnings; | |
use AnyEvent; | |
use AnyEvent::HTTP; | |
my @urls = qw( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alternate implementation of https://metacpan.org/module/STEVAN/Promises-0.03/lib/Promises/Cookbook/TIMTOWTDI.pod | |
# that can run the requests in parallel | |
# See also a more concrete application of this: https://gist.github.com/dolmen/6306377 | |
my $all_product_info = {}; | |
my $cv = AnyEvent->condvar; | |
$cv->begin; | |
http_get('http://rest.api.example.com/-/product/12345', sub { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getFileExtension(i) { | |
// i will be a string, but it may not have a file extension. | |
// return the file extension (with no period) if it has one, otherwise false | |
var pat1= /(.*\.)(\w+)/i; | |
if (i.match(pat1)){ | |
//alert( i.replace( /(.*\.)(\w+)/i ,'$2') ) ; | |
var out=i.replace( pat1 ,'$2') ; | |
alert(out); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function longestString(i) { | |
// i will be an array. | |
// return the longest string in the array | |
var max_elem=''; | |
for(j=i.length; --j;){ | |
if (typeof i[j] == 'string' && i[j].length>max_elem.length){ | |
max_elem=i[j]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use feature ':5.10'; | |
use Marpa::XS; | |
use Data::Dumper; | |
# | |
# a simple CSS snippet for testing | |
# | |
my $text = q{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use feature ':5.10'; | |
use Marpa::XS; | |
use Data::Dumper; | |
# | |
# a simple CSS snippet for testing | |
# | |
my $text = q{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# By: Jeremiah LaRocco | |
# Use translate.google.com to translate between languages. | |
# Sample run: | |
# gtrans.pl --to french --from english This is a test | |
# Ceci est un test | |
# | |
use strict; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# By: Jeremiah LaRocco, Nikolay Mishin (refactoring) | |
# Use translate.google.com to translate between languages. | |
# Sample run: | |
#gtrans.pl --from en --to ru --text "This is a test" | |
use Modern::Perl; | |
use LWP::UserAgent; | |
use Getopt::Long; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Carp; | |
use Getopt::Long; | |
use Pod::Usage; | |
use File::Basename qw/fileparse/; | |
use File::Spec; | |
use Spreadsheet::ParseExcel; |