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
#!perl | |
use warnings 'all'; | |
use strict; | |
use diagnostics; | |
my $phrase = '{Пожалуйста|Просто} сделайте так, чтобы это {удивительное|крутое|простое} тестовое предложение {изменялось {быстро|мгновенно} случайным образом|менялось каждый раз}'; | |
my $regex; | |
my (@match); | |
my $idx = 0; | |
$regex = qr/\{((?:[^{}]+|(??{$regex}))*)\}(?{$match[$idx++]=$1;})/s; |
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 (window,undefined) { | |
var Interface = function(interface) { return interface }; | |
Object.prototype.clone = function () { | |
var o = this; | |
if(!o || "object" !== typeof o) | |
return o; | |
var c = "function" === typeof o.pop ? [] : {}; | |
var p, v; | |
for(p in o) { | |
if(o.hasOwnProperty(p)) { |
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
var Stemmer = function ( word ) { | |
var _re = /^(разо|надо|недо|подо|пред|предо|без|бес|взо|изо|над|обо|ото|под|пра|про|до|за|на|вы|во|ко|об|не|от|па|по|су|в|о)?(.*?)(ствова|ичес|льник|льщик|льщиц|итель|тельн|анин|еват|оват|енск|инск|овит|ский|ость|янин|ение|еств|есть|тель|нича|изм|ниц|изн|ник|ист|ени|ниe|ств|чик|чиц|щик|ошк|ушк|ёшк|ышк|юшк|аст|овый|енн|онн|лив|ейш|айш|жды|учи|ючи|чив|чат|ева|ова|ыва|ива|еет|ин|то|ец|ун|ан|ян|ач|иц|их|ия|лк|ик|ни|ал|ит|ат|ев|ов|ив|ен|уч|юч|яч|шн|от|нн|ил|к|а|c|ы|и(^иб))(.*)?$/gi; | |
this.wordForm = word.toLowerCase(); | |
this.Type = function () { return typeof this.wordForm } | |
this.getRoot = function () { return this.wordForm.match("/a-z0-9/i") ? this.wordForm : this.wordForm.replace(_re,"$2"); } | |
} | |
var res = new Stemmer('турист'); | |
alert(res.getRoot()); |
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
#include <iostream> | |
#include <complex> | |
#include <vector> | |
#include <omp.h> | |
using namespace std; | |
int main() { | |
int number_to = 1000000; | |
vector<int> primes; |
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
#!perl | |
use warnings; | |
use strict; | |
use MR::Tarantool::Box; | |
my $params = { | |
account => '[email protected]', | |
application => 'mail', |
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
--- ~/dbd-pg-hstore » make test | |
cp lib/Pg/hstore.pm blib/lib/Pg/hstore.pm | |
/opt/local/bin/perl /opt/local/lib/perl5/5.12.4/ExtUtils/xsubpp -typemap /opt/local/lib/perl5/5.12.4/ExtUtils/typemap hstore.xs > hstore.xsc && mv hstore.xsc hstore.c | |
/usr/bin/clang -c -I. -pipe -O2 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector -I/opt/local/include -O3 -DVERSION=\"1.02\" -DXS_VERSION=\"1.02\" "-I/opt/local/lib/perl5/5.12.4/darwin-thread-multi-2level/CORE" hstore.c | |
clang: warning: argument unused during compilation: '-no-cpp-precomp' | |
hstore.xs:70:13: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] | |
while( ent = hv_iternext(hash) ) { | |
~~~~^~~~~~~~~~~~~ | |
hstore.xs:70:13: note: place parentheses around the assignment to silence this warning | |
while( ent = hv_iternext(hash) ) { |
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
#include <stdio.h> | |
#include <netinet/in.h> | |
#include <ev.h> | |
#define PORT_NO 3033 | |
#define BUFFER_SIZE 1024 | |
int total_clients = 0; | |
void accept_cb(struct ev_loop *loop, struct ev_io *watcher, int revents); |
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
#include <stdio.h> | |
#include <netinet/in.h> | |
#include <ev.h> | |
#define IP 127.0.0.1 | |
#define PORT_NO 3033 | |
#define BUFFER_SIZE 1024 | |
#define TIMER 5.5 // Timer to free some threads queue, in seconds |
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 | |
use Data::Dumper; | |
$LOVE= AMOUR. | |
true.cards. ecstacy.crush | |
.hon.promise.de .votion.partners. | |
tender.truelovers. treasure.affection. | |
devotion.care.woo.baby.ardor.romancing. | |
enthusiasm.fealty.fondness.turtledoves. |
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
#!perl | |
use warnings; | |
use strict; | |
my $x = [1,2,3]; | |
my $y = [2,3,4]; | |
my $t = [3,4,5]; | |
sub substract { | |
my @arrays = @_; |
OlderNewer