Software: http://www.nongnu.org/cvs/
Login
cvs -d:método_acceso*:user@host:/path login
Emitir un log de tags: archivo, revisión actual head, branch y su revisión actual, todas las revisiones
cvs -d:método_acceso*:user@host:/path_1 rlog path_2 (relativo a path_1)
Emitir un reporte histórico: movimiento, fecha hora, revisión, archivo, path
cvs -d:método_acceso*:user@host:/path_1 history path_2 (relativo a path_1) -c
*método_acceso: pserver, local, etc.
jueves, 21 de noviembre de 2013
martes, 5 de noviembre de 2013
Tokens - programa en Perl para parsear XML
Sinopsis
use Tokens;
open my $regex_fh, '<', $ARGV[0]; #regex.txt
open my $target_fh, '<', $ARGV[1]; #file.txt
my $target;
{
local $/ = undef;
$target = <$target_fh>; #the content
$target =~ s/\n/ /g;
}
my $regex;
{
local $/ = undef;
$regex = <$regex_fh>; #the content
}
printAll parse $target, $regex;
Códio (archivo: Tokens.pm):
=pod
Copyright 2013 Gabriel Czernikier
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
=cut
use strict;
#package declarations
sub digest_single;
sub parse_programme;
sub printAll;
my @token_separator = ('<', '/', '"', '=', '>', ' ');
my @REGEX;
my @MASK;
my $long_tokens;
my @DIGEST_SINGLE;
sub min_token_separator_left {
my $regex = shift;
my $T;
$regex =~ /([@token_separator])/og;
my $min = (pos $regex) - (length $1);
my $T = $1;
return ($T, $min) if $regex =~ m/([@token_separator])/o;
}
sub min_token_separator_right {
my $regex = shift;
$regex =~ /.*([@token_separator])/og;
my $min = (pos $regex) - (length $1);
my $T = $1;
return ($T, $min) if $regex =~ m/([@token_separator])/o;
}
sub expand_left {
$_[0] =~ s/^\(\?:(?:[^)]|\)[^+*])+\)\*//;
$_[0] =~ s/^\(\?:((?:[^)]|\)[^+*])+)\)\+/\1\(\?:\1\)\*/;
}
sub trim_left {
$_[0] =~ s/^\(\.\*\?\)//;
}
sub expand_right {
$_[0] =~ s/\(\?:(?:[^)]|\)[^+*])+\)\*$//;
$_[0] =~ s/\(\?:((?:[^)]|\)[^+*])+)\)\+$/\(\?:\1\)\*\1/;
}
sub trim_right {
$_[0] =~ s/\(\.\*\?\)$//;
}
sub digest_single {
my $target = shift;
my $regex = shift;
return unless $regex ne '';
my $token_desde = shift;
my $token_hasta = shift;
return @{$DIGEST_SINGLE[$token_desde][$token_hasta]} if defined $DIGEST_SINGLE[$token_desde][$token_hasta];
my ($T, $pos)=min_token_separator_left($regex);
return unless $target =~ /$regex/ or defined $pos;
$target =~ /($regex)/g;
my $digit = 2;
while( my $cg = eval '$'.$digit++ ) {
goto VISITING if $cg =~ /$long_tokens/;
}
my $pff = (pos $target);
my $pii = $pff - (length $1) if defined $pff;
VISITING:
return ($token_desde, $token_hasta, $pii, $pff) unless defined $pos;
my $re = $regex;
expand_left $re;
($T, $pos)=min_token_separator_left($re);
my $pos_aux = $pos+length($T);
$re =~ s/.{$pos_aux}//;
trim_left $re;
my ($td, $th, $pi, $pf) = digest_single $target, $re, $token_desde+1, $token_hasta;
$re = $regex;
expand_right $re;
($T, $pos) = min_token_separator_right($re);
$re =~ s/(.{$pos}).*/\1/;
trim_right $re;
my ($td2, $th2, $pi2, $pf2) = digest_single $target, $re, $token_desde, $token_hasta-1;
$DIGEST_SINGLE[$token_desde][$token_hasta] = [$token_desde, $token_hasta, $pii, $pff] if (defined $pii) && ($pff-$pii>=$pf-$pi || !defined $pi) && ($pff-$pii>=$pf2-$pi2 || !defined $pi2);
return @{$DIGEST_SINGLE[$token_desde][$token_hasta]} if defined $DIGEST_SINGLE[$token_desde][$token_hasta];
$DIGEST_SINGLE[$token_desde][$token_hasta] = [$td, $th, $pi, $pf] if (defined $pi) && ($pf-$pi>$pff-$pii || !defined $pii) && ($pf-$pi>=$pf2-$pi2 || !defined $pi2);
return @{$DIGEST_SINGLE[$token_desde][$token_hasta]} if defined $DIGEST_SINGLE[$token_desde][$token_hasta];
$DIGEST_SINGLE[$token_desde][$token_hasta] = [$td2, $th2, $pi2, $pf2] if (defined $pi2) && ($pf2-$pi2>$pff-$pii || !defined $pii) && ($pf2-$pi2>$pf-$pi || !defined $pi);
return @{$DIGEST_SINGLE[$token_desde][$token_hasta]} if defined $DIGEST_SINGLE[$token_desde][$token_hasta];
$DIGEST_SINGLE[$token_desde][$token_hasta] = [];
return @{$DIGEST_SINGLE[$token_desde][$token_hasta]};
}
sub token_count {
my $regex = shift;
my @matches = $regex =~ /[@token_separator]/og;
return scalar @matches;
}
sub digest_multiple {
my $target = shift;
my @R = @REGEX;
my $regex_num = 0;
my $Pos_Ini;
my $Token_Desde;
my $Token_Hasta;
my $Pos_Fin;
my $Regex_Num;
my @DIGEST_MULTIPLE = ();
while( defined(my $regex = shift @R)) {
@DIGEST_SINGLE = undef;
my ($token_desde, $token_hasta, $pos_ini, $pos_fin) = digest_single $target, $regex, 0, token_count($regex);
return $token_desde, $token_hasta, $pos_ini, $pos_fin, $regex_num if($token_desde==0 && $token_hasta==token_count($regex));
push @DIGEST_MULTIPLE, [$token_desde, $token_hasta, $pos_ini, $pos_fin, $regex_num] if defined $pos_ini;
$regex_num++;
}
$regex_num = 0;
while(@DIGEST_MULTIPLE!=0) {
my ($token_desde, $token_hasta, $pos_ini, $pos_fin) = @{shift @DIGEST_MULTIPLE};
if(defined $pos_ini && $pos_fin!=0 && ($pos_ini<$Pos_Ini || !defined $Pos_Ini)) {
$Pos_Ini = $pos_ini;
$Token_Desde = $token_desde;
$Token_Hasta = $token_hasta;
$Pos_Fin = $pos_fin;
$Regex_Num = $regex_num;
}
$regex_num++;
}
return $Token_Desde, $Token_Hasta, $Pos_Ini, $Pos_Fin, $Regex_Num if defined $Pos_Ini;
}
sub parse_programme {
my $target = shift;
return if $target eq '';
my ($token_desde, $token_hasta, $pos_ini, $pos_fin, $regex_num) = digest_multiple($target);
if(not defined $pos_ini) {
#my $oldfh = select;
#select STDERR;
#print "$ARGV[1], [ini-no-parseable]${target}[fin-no-parseable]\n";
#select $oldfh;
return $target;
}
my $mask_right = @MASK[$regex_num];
my $repetitions = token_count($mask_right)-$token_hasta;
$mask_right =~ s/.*((?:[@token_separator][^@token_separator]*){$repetitions})$/\1/;
my $mask_left = @MASK[$regex_num];
$mask_left =~ s/^((?:[^@token_separator]*[@token_separator]){$token_desde}).*/\1/;
my $match = $target;
$match =~ s/(.{$pos_fin}).*/\1/;
$match =~ s/.{$pos_ini}//;
my $produccion = $mask_left . $match . $mask_right;
$target =~ /(.{$pos_ini})/;
my $target_left = $1;
$target =~ /.{$pos_fin}(.*)/;
my $target_right = $1;
return $produccion, +[parse_programme $target_left], +[parse_programme $target_right];
}
sub printAll {
return if @_==0;
if (@_==1) {
print "[ini-nonparse]${_[0]}[fin-nonparse]\n";
return;
}
printAll @{$_[1]};
print "[ini-prod]${_[0]}[fin-prod]\n";
printAll @{$_[2]};
}
sub parse {
my $target = shift;
my $regex = shift;
while($regex =~ /^(.+)$/mg) {
my $_ = $1;
my $other = $_;
$other =~ s/\(\?:(.+?)\)\+/\1/g;
$other =~ s/\.\*\?//g;
push @MASK, $other;
s/(\.\*\?)/\(\1\)/g;
push @REGEX, $_;
}
$long_tokens = join '|', grep length>=3,keys %{+{ map +($_=>undef), map /\w+/g, @REGEX }};
parse_programme $target;
}
1;
Input:
regex2-group.txt
<MyTag1 myAttr1=".*?" myAttr2=".*?">(?:<MyTag2 myAttr3=".*?" myAttr4=".*?">.*?</MyTag2>)+</MyTag1>
regex3-multiple.txt
<MyTag1 myAttr1=".*?" myAttr2=".*?">(?:<MyTag2 myAttr3=".*?" myAttr4=".*?">.*?</MyTag2>)+</MyTag1>
<Foo myFoo=".*?" myFoo2=".*?"><Bar1 myBar1=".*?" myBar1b=".*?" myBar1c=".*?"></Bar1><Bar2 myBar2=".*?" myBar2b=".*?"><Bar2Sub1>.*?</Bar2Sub1></Bar2></Foo>
<MyA myA=".*?"><MyAB>(?:<MyB myB=".*?"></MyB>)+</MyAB><MyAC>(?:<MyC myC=".*?"></MyC>)+</MyAC></MyA>
<TagT attrT=".*?">.*?</TagT>
file2-broken-left-broken-right-repetitions.txt
Tag2 myAttr3="myVal3Pre" myAttr4="myVal4Pre">MyText1Pre</MyTag2><MyTag2 myAttr3="myVal3" myAttr4="myVal4">MyText1</MyTag2></MyTag1><MyTag1 myAttr1="myVal1b" myAttr2="myVal2b"><MyTag2 myAttr3="myVal3b" myAttr4="myVal4b">MyText1b</MyTag2><MyTag2 myAttr3="myVal3bPos" myAttr4="myVal4bPos">MyText1bPos</MyTag2></MyTag1><MyTag1 myAttr1="myVal1c" myAttr2="myVal2c"><MyTag2 myAttr3="myVal3c" myAttr4="myVal4c">MyText1c</MyTag2><MyTag2 myAttr3="myVal3cPos" myAtt
file3-broken-left-broken-right-repetitions-multiple.txt
Tag2 myAttr3="myVal3Pre" myAttr4="myVal4Pre">MyText1Pre</MyTag2><MyTag2 myAttr3="myVal3" myAttr4="myVal4">MyText1</MyTag2></MyTag1><Foo myFoo="foo-123" myFoo2="foo-456"><Bar1 myBar1="bar-123" myBar1b="bar-456" myBar1c="bar-789"></Bar1><Bar2 myBar2="bar-135" myBar2b="bar-790"><Bar2Sub1>BarSubText</Bar2Sub1></Bar2></Foo><MyTag1 myAttr1="myVal1b" myAttr2="myVal2b"><MyTag2 myAttr3="myVal3b" myAttr4="myVal4b">MyText1b</MyTag2><MyTag2 myAttr3="myVal3bPos" myAttr4="myVal4bPos">MyText1bPos</MyTag2></MyTag1><MyA myA="MYa-123"><MyAB><MyB myB="MYb-123"></MyB><MyB myB="MYb-456"></MyB><MyB myB="MYb-123-bis"></MyB></MyAB><MyAC><MyC myC="mycR"></My M&; <MyTag1 myAttr1="myVal1c" myAttr2="myVal2c"><MyTag2 myAttr3="myVal3c" myAttr4="myVal4c">MyText1c</MyTag2><MyTag2 myAttr3="myVal3cPos" myAtt <TagT attrT="valueT">TextT-pr
use Tokens;
open my $regex_fh, '<', $ARGV[0]; #regex.txt
open my $target_fh, '<', $ARGV[1]; #file.txt
my $target;
{
local $/ = undef;
$target = <$target_fh>; #the content
$target =~ s/\n/ /g;
}
my $regex;
{
local $/ = undef;
$regex = <$regex_fh>; #the content
}
printAll parse $target, $regex;
Códio (archivo: Tokens.pm):
=pod
Copyright 2013 Gabriel Czernikier
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
=cut
use strict;
#package declarations
sub digest_single;
sub parse_programme;
sub printAll;
my @token_separator = ('<', '/', '"', '=', '>', ' ');
my @REGEX;
my @MASK;
my $long_tokens;
my @DIGEST_SINGLE;
sub min_token_separator_left {
my $regex = shift;
my $T;
$regex =~ /([@token_separator])/og;
my $min = (pos $regex) - (length $1);
my $T = $1;
return ($T, $min) if $regex =~ m/([@token_separator])/o;
}
sub min_token_separator_right {
my $regex = shift;
$regex =~ /.*([@token_separator])/og;
my $min = (pos $regex) - (length $1);
my $T = $1;
return ($T, $min) if $regex =~ m/([@token_separator])/o;
}
sub expand_left {
$_[0] =~ s/^\(\?:(?:[^)]|\)[^+*])+\)\*//;
$_[0] =~ s/^\(\?:((?:[^)]|\)[^+*])+)\)\+/\1\(\?:\1\)\*/;
}
sub trim_left {
$_[0] =~ s/^\(\.\*\?\)//;
}
sub expand_right {
$_[0] =~ s/\(\?:(?:[^)]|\)[^+*])+\)\*$//;
$_[0] =~ s/\(\?:((?:[^)]|\)[^+*])+)\)\+$/\(\?:\1\)\*\1/;
}
sub trim_right {
$_[0] =~ s/\(\.\*\?\)$//;
}
sub digest_single {
my $target = shift;
my $regex = shift;
return unless $regex ne '';
my $token_desde = shift;
my $token_hasta = shift;
return @{$DIGEST_SINGLE[$token_desde][$token_hasta]} if defined $DIGEST_SINGLE[$token_desde][$token_hasta];
my ($T, $pos)=min_token_separator_left($regex);
return unless $target =~ /$regex/ or defined $pos;
$target =~ /($regex)/g;
my $digit = 2;
while( my $cg = eval '$'.$digit++ ) {
goto VISITING if $cg =~ /$long_tokens/;
}
my $pff = (pos $target);
my $pii = $pff - (length $1) if defined $pff;
VISITING:
return ($token_desde, $token_hasta, $pii, $pff) unless defined $pos;
my $re = $regex;
expand_left $re;
($T, $pos)=min_token_separator_left($re);
my $pos_aux = $pos+length($T);
$re =~ s/.{$pos_aux}//;
trim_left $re;
my ($td, $th, $pi, $pf) = digest_single $target, $re, $token_desde+1, $token_hasta;
$re = $regex;
expand_right $re;
($T, $pos) = min_token_separator_right($re);
$re =~ s/(.{$pos}).*/\1/;
trim_right $re;
my ($td2, $th2, $pi2, $pf2) = digest_single $target, $re, $token_desde, $token_hasta-1;
$DIGEST_SINGLE[$token_desde][$token_hasta] = [$token_desde, $token_hasta, $pii, $pff] if (defined $pii) && ($pff-$pii>=$pf-$pi || !defined $pi) && ($pff-$pii>=$pf2-$pi2 || !defined $pi2);
return @{$DIGEST_SINGLE[$token_desde][$token_hasta]} if defined $DIGEST_SINGLE[$token_desde][$token_hasta];
$DIGEST_SINGLE[$token_desde][$token_hasta] = [$td, $th, $pi, $pf] if (defined $pi) && ($pf-$pi>$pff-$pii || !defined $pii) && ($pf-$pi>=$pf2-$pi2 || !defined $pi2);
return @{$DIGEST_SINGLE[$token_desde][$token_hasta]} if defined $DIGEST_SINGLE[$token_desde][$token_hasta];
$DIGEST_SINGLE[$token_desde][$token_hasta] = [$td2, $th2, $pi2, $pf2] if (defined $pi2) && ($pf2-$pi2>$pff-$pii || !defined $pii) && ($pf2-$pi2>$pf-$pi || !defined $pi);
return @{$DIGEST_SINGLE[$token_desde][$token_hasta]} if defined $DIGEST_SINGLE[$token_desde][$token_hasta];
$DIGEST_SINGLE[$token_desde][$token_hasta] = [];
return @{$DIGEST_SINGLE[$token_desde][$token_hasta]};
}
sub token_count {
my $regex = shift;
my @matches = $regex =~ /[@token_separator]/og;
return scalar @matches;
}
sub digest_multiple {
my $target = shift;
my @R = @REGEX;
my $regex_num = 0;
my $Pos_Ini;
my $Token_Desde;
my $Token_Hasta;
my $Pos_Fin;
my $Regex_Num;
my @DIGEST_MULTIPLE = ();
while( defined(my $regex = shift @R)) {
@DIGEST_SINGLE = undef;
my ($token_desde, $token_hasta, $pos_ini, $pos_fin) = digest_single $target, $regex, 0, token_count($regex);
return $token_desde, $token_hasta, $pos_ini, $pos_fin, $regex_num if($token_desde==0 && $token_hasta==token_count($regex));
push @DIGEST_MULTIPLE, [$token_desde, $token_hasta, $pos_ini, $pos_fin, $regex_num] if defined $pos_ini;
$regex_num++;
}
$regex_num = 0;
while(@DIGEST_MULTIPLE!=0) {
my ($token_desde, $token_hasta, $pos_ini, $pos_fin) = @{shift @DIGEST_MULTIPLE};
if(defined $pos_ini && $pos_fin!=0 && ($pos_ini<$Pos_Ini || !defined $Pos_Ini)) {
$Pos_Ini = $pos_ini;
$Token_Desde = $token_desde;
$Token_Hasta = $token_hasta;
$Pos_Fin = $pos_fin;
$Regex_Num = $regex_num;
}
$regex_num++;
}
return $Token_Desde, $Token_Hasta, $Pos_Ini, $Pos_Fin, $Regex_Num if defined $Pos_Ini;
}
sub parse_programme {
my $target = shift;
return if $target eq '';
my ($token_desde, $token_hasta, $pos_ini, $pos_fin, $regex_num) = digest_multiple($target);
if(not defined $pos_ini) {
#my $oldfh = select;
#select STDERR;
#print "$ARGV[1], [ini-no-parseable]${target}[fin-no-parseable]\n";
#select $oldfh;
return $target;
}
my $mask_right = @MASK[$regex_num];
my $repetitions = token_count($mask_right)-$token_hasta;
$mask_right =~ s/.*((?:[@token_separator][^@token_separator]*){$repetitions})$/\1/;
my $mask_left = @MASK[$regex_num];
$mask_left =~ s/^((?:[^@token_separator]*[@token_separator]){$token_desde}).*/\1/;
my $match = $target;
$match =~ s/(.{$pos_fin}).*/\1/;
$match =~ s/.{$pos_ini}//;
my $produccion = $mask_left . $match . $mask_right;
$target =~ /(.{$pos_ini})/;
my $target_left = $1;
$target =~ /.{$pos_fin}(.*)/;
my $target_right = $1;
return $produccion, +[parse_programme $target_left], +[parse_programme $target_right];
}
sub printAll {
return if @_==0;
if (@_==1) {
print "[ini-nonparse]${_[0]}[fin-nonparse]\n";
return;
}
printAll @{$_[1]};
print "[ini-prod]${_[0]}[fin-prod]\n";
printAll @{$_[2]};
}
sub parse {
my $target = shift;
my $regex = shift;
while($regex =~ /^(.+)$/mg) {
my $_ = $1;
my $other = $_;
$other =~ s/\(\?:(.+?)\)\+/\1/g;
$other =~ s/\.\*\?//g;
push @MASK, $other;
s/(\.\*\?)/\(\1\)/g;
push @REGEX, $_;
}
$long_tokens = join '|', grep length>=3,keys %{+{ map +($_=>undef), map /\w+/g, @REGEX }};
parse_programme $target;
}
1;
Input:
regex2-group.txt
<MyTag1 myAttr1=".*?" myAttr2=".*?">(?:<MyTag2 myAttr3=".*?" myAttr4=".*?">.*?</MyTag2>)+</MyTag1>
regex3-multiple.txt
<MyTag1 myAttr1=".*?" myAttr2=".*?">(?:<MyTag2 myAttr3=".*?" myAttr4=".*?">.*?</MyTag2>)+</MyTag1>
<Foo myFoo=".*?" myFoo2=".*?"><Bar1 myBar1=".*?" myBar1b=".*?" myBar1c=".*?"></Bar1><Bar2 myBar2=".*?" myBar2b=".*?"><Bar2Sub1>.*?</Bar2Sub1></Bar2></Foo>
<MyA myA=".*?"><MyAB>(?:<MyB myB=".*?"></MyB>)+</MyAB><MyAC>(?:<MyC myC=".*?"></MyC>)+</MyAC></MyA>
<TagT attrT=".*?">.*?</TagT>
file2-broken-left-broken-right-repetitions.txt
Tag2 myAttr3="myVal3Pre" myAttr4="myVal4Pre">MyText1Pre</MyTag2><MyTag2 myAttr3="myVal3" myAttr4="myVal4">MyText1</MyTag2></MyTag1><MyTag1 myAttr1="myVal1b" myAttr2="myVal2b"><MyTag2 myAttr3="myVal3b" myAttr4="myVal4b">MyText1b</MyTag2><MyTag2 myAttr3="myVal3bPos" myAttr4="myVal4bPos">MyText1bPos</MyTag2></MyTag1><MyTag1 myAttr1="myVal1c" myAttr2="myVal2c"><MyTag2 myAttr3="myVal3c" myAttr4="myVal4c">MyText1c</MyTag2><MyTag2 myAttr3="myVal3cPos" myAtt
file3-broken-left-broken-right-repetitions-multiple.txt
Tag2 myAttr3="myVal3Pre" myAttr4="myVal4Pre">MyText1Pre</MyTag2><MyTag2 myAttr3="myVal3" myAttr4="myVal4">MyText1</MyTag2></MyTag1><Foo myFoo="foo-123" myFoo2="foo-456"><Bar1 myBar1="bar-123" myBar1b="bar-456" myBar1c="bar-789"></Bar1><Bar2 myBar2="bar-135" myBar2b="bar-790"><Bar2Sub1>BarSubText</Bar2Sub1></Bar2></Foo><MyTag1 myAttr1="myVal1b" myAttr2="myVal2b"><MyTag2 myAttr3="myVal3b" myAttr4="myVal4b">MyText1b</MyTag2><MyTag2 myAttr3="myVal3bPos" myAttr4="myVal4bPos">MyText1bPos</MyTag2></MyTag1><MyA myA="MYa-123"><MyAB><MyB myB="MYb-123"></MyB><MyB myB="MYb-456"></MyB><MyB myB="MYb-123-bis"></MyB></MyAB><MyAC><MyC myC="mycR"></My M&; <MyTag1 myAttr1="myVal1c" myAttr2="myVal2c"><MyTag2 myAttr3="myVal3c" myAttr4="myVal4c">MyText1c</MyTag2><MyTag2 myAttr3="myVal3cPos" myAtt <TagT attrT="valueT">TextT-pr
martes, 3 de septiembre de 2013
DB2 - manejar jerarquías de idiomas
En DB2, seleccionar datos de una tabla "tabla_origen", buscando con una "mi_clave_busqueda" que tiene multiplicidad n (los datos están en n idiomas), de los cuales me interesa recuperar el idioma que (para mí) tenga mayor prioridad, si no el siguiente, y así sucesivamente.
with mis_idiomas
as(
select * from table (
select 'es', 1 from
sysibm.sysdummy1 union all
select 'fr', 2 from
sysibm.sysdummy1 union all
select 'en', 3 from
sysibm.sysdummy1 union all
select 'he', 4 from
sysibm.sysdummy1
) as t (idioma,
ord)
),
T2 as(
select tor.mi_clave_busqueda,
min(ord) as ord from tabla_origen tor inner join mis_idiomas
ml on tor.cod_idioma=ml.idioma group by tor.mi_clave_busqueda
)
select tor.mis_valores_buscados
from T2 inner join mis_idiomas ml on T2.ord=ml.ord inner join tabla_origen
tor on T2.mi_clave_busqueda=tor.mi_clave_busqueda and ml.idioma=tor.idioma
miércoles, 14 de agosto de 2013
Perl Net::LDAP::SimpleServer
Adaptaciones sobre el módulo LDAP Server para Windows (Strawberry Perl)
Lista de adaptaciones (continúa más abajo):
- Relajación de condiciones de bind:
- Cuenta principal (principal account)
- Validación de contraseñas
Ubicación del archivo:
%Strawberry_Perl%\site\lib\net\ldap\SimpleServer\ProtocolHandler.pm
CPAN: http://search.cpan.org/~russoz/Net-LDAP-SimpleServer-0.0.17/lib/Net/LDAP/SimpleServer.pm
Código:
package Net::LDAP::SimpleServer::ProtocolHandler;
use strict;
use warnings;
# ABSTRACT: LDAP protocol handler used with Net::LDAP::SimpleServer
our $VERSION = '0.0.17'; # VERSION
use Net::LDAP::Server;
use base 'Net::LDAP::Server';
use fields qw(store root_dn root_pw allow_anon);
use Carp;
use Net::LDAP::LDIF;
use Net::LDAP::Util qw{canonical_dn};
use Net::LDAP::FilterMatch;
use Net::LDAP::Constant (
qw/LDAP_SUCCESS LDAP_AUTH_UNKNOWN LDAP_INVALID_CREDENTIALS/,
qw/LDAP_AUTH_METHOD_NOT_SUPPORTED/ );
use Scalar::Util qw{reftype};
use UNIVERSAL::isa;
use Data::Dumper;
sub _make_result {
my $code = shift;
my $dn = shift || '';
my $msg = shift || '';
return {
matchedDN => $dn,
errorMessage => $msg,
resultCode => $code,
};
}
sub new {
my $class = shift;
my $params = shift || croak 'Must pass parameters!';
my $self = $class->SUPER::new( $params->{input}, $params->{output} );
croak 'Parameter must be a HASHREF' unless reftype($params) eq 'HASH';
croak 'Must pass option {store}' unless exists $params->{store};
croak 'Not a LDIFStore'
unless $params->{store}->isa('Net::LDAP::SimpleServer::LDIFStore');
croak 'Must pass option {root_dn}' unless exists $params->{root_dn};
croak 'Option {root_dn} can not be empty' unless $params->{root_dn};
croak 'Invalid root DN'
unless my $canon_dn = canonical_dn( $params->{root_dn} );
$self->{store} = $params->{store};
$self->{root_dn} = $canon_dn;
$self->{root_pw} = $params->{root_pw};
$self->{allow_anon} = $params->{allow_anon};
chomp( $self->{root_pw} );
print STDERR "*** new ***\n";
return $self;
}
sub unbind {
my $self = shift;
$self->{store} = undef;
$self->{root_dn} = undef;
$self->{root_pw} = undef;
return _make_result(LDAP_SUCCESS);
}
sub bind { ## no critic (ProhibitBuiltinHomonyms)
my ( $self, $request ) = @_;
select(STDERR);
$| = 1;
print STDERR '===== bind =====' . "\n";
#print STDERR Dumper($self);
print STDERR Dumper($request);
my $ok = _make_result(LDAP_SUCCESS);
if ( not $request->{name}
and exists $request->{authentication}->{simple}
and $self->{allow_anon} )
{
return $ok;
}
print STDERR qq{not anonymous\n};
# As of now, accepts only simple authentication
return _make_result(LDAP_AUTH_METHOD_NOT_SUPPORTED)
unless exists $request->{authentication}->{simple};
print STDERR qq{is simple authentication\n};
return _make_result(LDAP_INVALID_CREDENTIALS)
unless my $binddn = canonical_dn( $request->{name} );
print STDERR qq#binddn is ok ($request->{name}) => ($binddn)\n#;
#print STDERR qq#handler dn is $self->{root_dn}\n#;
#return _make_result(LDAP_INVALID_CREDENTIALS)
# unless uc($binddn) eq uc( $self->{root_dn} );
print STDERR qq{binddn is good\n};
my $bindpw = $request->{authentication}->{simple};
chomp($bindpw);
#print STDERR qq|comparing ($bindpw) eq ($self->{root_pw})\n|;
#return _make_result(LDAP_INVALID_CREDENTIALS)
# unless $bindpw eq $self->{root_pw};
return $ok;
}
sub _match {
my ( $filter_spec, $elems ) = @_;
my $f = bless $filter_spec, 'Net::LDAP::Filter';
return [ grep { $f->match($_) } @{$elems} ];
}
sub search {
my ( $self, $request ) = @_;
my $list = $self->{store}->list;
#my $basedn = $request->{baseObject};
select(STDERR);
$| = 1;
#print STDERR '=' x 50 . "\n";
print STDERR '===== search =====' . "\n";
print STDERR Dumper($request);
#print STDERR Dumper($list);
my $res = _match( $request->{filter}, $list );
#print STDERR Dumper($res);
return ( _make_result(LDAP_SUCCESS), @{$res} );
}
1; # Magic true value required at end of module
=pod
=encoding utf-8
=head1 NAME
Net::LDAP::SimpleServer::ProtocolHandler - LDAP protocol handler used with Net::LDAP::SimpleServer
=head1 VERSION
version 0.0.17
=head1 SYNOPSIS
use Net::LDAP::SimpleServer::ProtocolHandler;
my $store = Net::LDAP::SimpleServer::LDIFStore->new($datafile);
my $handler =
Net::LDAP::SimpleServer::ProtocolHandler->new({
store => $datafile,
root_dn => 'cn=root',
root_pw => 'somepassword'
}, $socket );
=head1 DESCRIPTION
This module provides an interface between Net::LDAP::SimpleServer and the
underlying data store. Currently only L
is available.
=head1 METHODS
=head2 new( OPTIONS, IOHANDLES )
Creates a new handler for the LDAP protocol, using STORE as the backend
where the directory data is stored. The rest of the IOHANDLES are the same
as in the L module.
=head2 bind( REQUEST )
Handles a bind REQUEST from the LDAP client.
=head2 unbind()
Unbinds the connection to the server.
=head2 search( REQUEST )
Performs a search in the data store.
=head1 SEE ALSO
Please see those modules/websites for more information related to this module.
=over 4
=item *
L
=back
=head1 AUTHOR
Alexei Znamensky
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Alexei Znamensky.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=head1 BUGS AND LIMITATIONS
You can make new bug reports, and view existing ones, through the
web interface at L.
=head1 DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
=cut
__END__
Lista de adaptaciones (parte 2):
- Corrección del bug TAG 13 ASN
Net::LDAP::Server versión 0.43, solamente cambia el método "new"
# Net::LDAP::Server
sub new {
my ($proto, $input, $output) = @_;
my $class = ref($proto) || $proto;
my $self = fields::new($class);
#print STDERR Dumper($input);
#print STDERR Dumper($output);
binmode($output, ':raw');
binmode($input, ':raw');
$self->{in} = $input;
$self->{out} = $output || $input;
return $self;
}
Alternativamente, se puede crear un .bat con lo siguiente:
set PERLIO=raw
C:\strawberry\perl\site\bin\ldapd.bat
Lista de adaptaciones (continúa más abajo):
- Relajación de condiciones de bind:
- Cuenta principal (principal account)
- Validación de contraseñas
Ubicación del archivo:
%Strawberry_Perl%\site\lib\net\ldap\SimpleServer\ProtocolHandler.pm
CPAN: http://search.cpan.org/~russoz/Net-LDAP-SimpleServer-0.0.17/lib/Net/LDAP/SimpleServer.pm
Código:
package Net::LDAP::SimpleServer::ProtocolHandler;
use strict;
use warnings;
# ABSTRACT: LDAP protocol handler used with Net::LDAP::SimpleServer
our $VERSION = '0.0.17'; # VERSION
use Net::LDAP::Server;
use base 'Net::LDAP::Server';
use fields qw(store root_dn root_pw allow_anon);
use Carp;
use Net::LDAP::LDIF;
use Net::LDAP::Util qw{canonical_dn};
use Net::LDAP::FilterMatch;
use Net::LDAP::Constant (
qw/LDAP_SUCCESS LDAP_AUTH_UNKNOWN LDAP_INVALID_CREDENTIALS/,
qw/LDAP_AUTH_METHOD_NOT_SUPPORTED/ );
use Scalar::Util qw{reftype};
use UNIVERSAL::isa;
use Data::Dumper;
sub _make_result {
my $code = shift;
my $dn = shift || '';
my $msg = shift || '';
return {
matchedDN => $dn,
errorMessage => $msg,
resultCode => $code,
};
}
sub new {
my $class = shift;
my $params = shift || croak 'Must pass parameters!';
my $self = $class->SUPER::new( $params->{input}, $params->{output} );
croak 'Parameter must be a HASHREF' unless reftype($params) eq 'HASH';
croak 'Must pass option {store}' unless exists $params->{store};
croak 'Not a LDIFStore'
unless $params->{store}->isa('Net::LDAP::SimpleServer::LDIFStore');
croak 'Must pass option {root_dn}' unless exists $params->{root_dn};
croak 'Option {root_dn} can not be empty' unless $params->{root_dn};
croak 'Invalid root DN'
unless my $canon_dn = canonical_dn( $params->{root_dn} );
$self->{store} = $params->{store};
$self->{root_dn} = $canon_dn;
$self->{root_pw} = $params->{root_pw};
$self->{allow_anon} = $params->{allow_anon};
chomp( $self->{root_pw} );
print STDERR "*** new ***\n";
return $self;
}
sub unbind {
my $self = shift;
$self->{store} = undef;
$self->{root_dn} = undef;
$self->{root_pw} = undef;
return _make_result(LDAP_SUCCESS);
}
sub bind { ## no critic (ProhibitBuiltinHomonyms)
my ( $self, $request ) = @_;
select(STDERR);
$| = 1;
print STDERR '===== bind =====' . "\n";
#print STDERR Dumper($self);
print STDERR Dumper($request);
my $ok = _make_result(LDAP_SUCCESS);
if ( not $request->{name}
and exists $request->{authentication}->{simple}
and $self->{allow_anon} )
{
return $ok;
}
print STDERR qq{not anonymous\n};
# As of now, accepts only simple authentication
return _make_result(LDAP_AUTH_METHOD_NOT_SUPPORTED)
unless exists $request->{authentication}->{simple};
print STDERR qq{is simple authentication\n};
return _make_result(LDAP_INVALID_CREDENTIALS)
unless my $binddn = canonical_dn( $request->{name} );
print STDERR qq#binddn is ok ($request->{name}) => ($binddn)\n#;
#print STDERR qq#handler dn is $self->{root_dn}\n#;
#return _make_result(LDAP_INVALID_CREDENTIALS)
# unless uc($binddn) eq uc( $self->{root_dn} );
print STDERR qq{binddn is good\n};
my $bindpw = $request->{authentication}->{simple};
chomp($bindpw);
#print STDERR qq|comparing ($bindpw) eq ($self->{root_pw})\n|;
#return _make_result(LDAP_INVALID_CREDENTIALS)
# unless $bindpw eq $self->{root_pw};
return $ok;
}
sub _match {
my ( $filter_spec, $elems ) = @_;
my $f = bless $filter_spec, 'Net::LDAP::Filter';
return [ grep { $f->match($_) } @{$elems} ];
}
sub search {
my ( $self, $request ) = @_;
my $list = $self->{store}->list;
#my $basedn = $request->{baseObject};
select(STDERR);
$| = 1;
#print STDERR '=' x 50 . "\n";
print STDERR '===== search =====' . "\n";
print STDERR Dumper($request);
#print STDERR Dumper($list);
my $res = _match( $request->{filter}, $list );
#print STDERR Dumper($res);
return ( _make_result(LDAP_SUCCESS), @{$res} );
}
1; # Magic true value required at end of module
=pod
=encoding utf-8
=head1 NAME
Net::LDAP::SimpleServer::ProtocolHandler - LDAP protocol handler used with Net::LDAP::SimpleServer
=head1 VERSION
version 0.0.17
=head1 SYNOPSIS
use Net::LDAP::SimpleServer::ProtocolHandler;
my $store = Net::LDAP::SimpleServer::LDIFStore->new($datafile);
my $handler =
Net::LDAP::SimpleServer::ProtocolHandler->new({
store => $datafile,
root_dn => 'cn=root',
root_pw => 'somepassword'
}, $socket );
=head1 DESCRIPTION
This module provides an interface between Net::LDAP::SimpleServer and the
underlying data store. Currently only L
is available.
=head1 METHODS
=head2 new( OPTIONS, IOHANDLES )
Creates a new handler for the LDAP protocol, using STORE as the backend
where the directory data is stored. The rest of the IOHANDLES are the same
as in the L
=head2 bind( REQUEST )
Handles a bind REQUEST from the LDAP client.
=head2 unbind()
Unbinds the connection to the server.
=head2 search( REQUEST )
Performs a search in the data store.
=head1 SEE ALSO
Please see those modules/websites for more information related to this module.
=over 4
=item *
L
=back
=head1 AUTHOR
Alexei Znamensky
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Alexei Znamensky.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=head1 BUGS AND LIMITATIONS
You can make new bug reports, and view existing ones, through the
web interface at L
=head1 DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
=cut
__END__
- Corrección del bug TAG 13 ASN
Net::LDAP::Server versión 0.43, solamente cambia el método "new"
sub new {
my ($proto, $input, $output) = @_;
my $class = ref($proto) || $proto;
my $self = fields::new($class);
#print STDERR Dumper($input);
#print STDERR Dumper($output);
binmode($output, ':raw');
binmode($input, ':raw');
$self->{in} = $input;
$self->{out} = $output || $input;
return $self;
}
C:\strawberry\perl\site\bin\ldapd.bat
martes, 13 de agosto de 2013
SAP / ERP
Recursos para aprender SAP:
http://stackoverflow.com/questions/518226/how-should-i-start-learning-about-sap
https://open.sap.com/about/opensap
https://training.sap.com/v2/content/opensap
http://scn.sap.com/people/david.donnachie/blog/2013/08/13/do-it-yourself-learning
http://scn.sap.com/community/events/sapphire-now/blog/2012/11/19/a-view-on-learning-from-capgemini
Figura: Niveles en los que opera SAP. "A four level pyramid model of different types of Information Systems based on the different levels of hierarchy in an organization." Fuente: http://en.wikipedia.org/wiki/Information_systems
Info suplementaria: Software CRUD: http://en.wikipedia.org/wiki/CRUD
http://stackoverflow.com/questions/518226/how-should-i-start-learning-about-sap
https://open.sap.com/about/opensap
https://training.sap.com/v2/content/opensap
http://scn.sap.com/people/david.donnachie/blog/2013/08/13/do-it-yourself-learning
http://scn.sap.com/community/events/sapphire-now/blog/2012/11/19/a-view-on-learning-from-capgemini
Figura: Niveles en los que opera SAP. "A four level pyramid model of different types of Information Systems based on the different levels of hierarchy in an organization." Fuente: http://en.wikipedia.org/wiki/Information_systems
Info suplementaria: Software CRUD: http://en.wikipedia.org/wiki/CRUD
Matemática
1.
7.
8.
![\\[0\parindent] \lim_{n \to \inf} \frac{1^2+2^2+3^2+...+n^2}{n^3} = \\[2\baselineskip] = \lim_{n \to \inf} \frac {(n+1)^3 - 1 - 3 \frac{n(n+1)}{2} - n}{3n^3} = \\[2\baselineskip] = \lim_{n \to \inf} \frac {(n+1)^3}{3n^3} - \frac{1}{3n^3} - \frac {3n(n+1)}{6n^3} - \frac{n}{3n^3} = \\[2\baselineskip] = \lim_{n \to \inf} \frac {1}{3} - 0 - \frac {n+1}{2n^2} - \frac{1}{3n^2} = \frac{1}{3}](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_shUJnwX4fjdht5am9FnzJHS2I0rLwbaCGwI1KUCCstNxFFFQUem8-r9bhxhFZhbuF4k-x7uHHaE8L9u-ia52Vxu1BZACAbr6iMHhDiC4g5CESvd5Iz52BQjEIqaGxCtP28ODvgpPqZiqSzGgka4ukXbM-icvKTPNug_2e-2VG2R0KqhPgSg9v1fGp-cvcGxDncpieYC1_ppUB8f1v94ORfZiKlcXamzdOmgPynZoOwST4DyaEf7haIXeKFrm4uh0bX22yaK_Bm1TNsvaJDDlXvNeg-xdVfgA_5NxaCY9Y1ahOTTGrV167mS1wjGLsmp5pmmgtMK5OxdaD8PYHQdAgD_PCgXz_u1-p0HIvQ1IN1ZmeaYMKHcUSMehw0EjQDSQr7nFLA3cUfjtvh-Pn9bY2gEJjdpRFLbxxghHZWNJLzaLw5bDcuLj5LAiZl9aPgAsH2WrqAWjY004MzNK1BEdCpsmCEQ-WWnOosaGv6RpJ3NHjPQ4qdgxdkZyIVXgEroeHIJdYX7jnJC1Fokdz7GpUnAAJzDqqJeXrdRj1ELY_-18HTj-33UbRT8y38iqgaWLlvR8GzepxFU-YBgHXGd03raBoRW6Bj-1bOTUxbHNEVOn_80XD4znYrc6LcEFHW8jGjKDisiLIJf3x9NuamWfdMkhOj46OOzRH96mbzQgYM4tk6cInJHXfEefN5g353x0ed8NnPTQtpOc7dbsW1nbr4TReXVaw1qhi3yWZkt1T0PniiTOQkFxfMVkDbnS5opLL76LNogIlR2qgd8bWVRsC4x5gpbtcz2-491bwx5aZWXL4C1DjI_TewGkyERt8kqZeLBbACRQ3K4c9R8x4h1rsSlmmuO7V7j8wy5fo02QPapLd3hvP8i3bLQHgech8B5MXgJYdAATuSSr_otxGaoQO7HDAkIRJVEPxkPBudpJUNWo8LSmHFF6WCfs50gwMBxXMkG1sxZBO1bmDMCmOCJtTYndMp19-eDfdKSETG1Vhmsu1Rk-iAGlT5PS07IlDyyNQodjgOLMAti0xB6BqpCST2VxfBtEQihntO8soNZjylHBkchHETGmVRDWmdJdHJSVJJmRNuK9xrdaPLTe6EBdQ2DZIb6jHxkELnq5rryNpmB3jsn8SroMWOigCw1jLszZefWy14oqr5k9z4_qhdlnA9wG0qKnrGLnktmu4diVY_D-6hf2RWsVdHRu-wGeHMX8otDEe2WQtLB_fgyC1TMcfWyDdDNmF9ubC5F4xxjjtTjOQ1tFJSvth5q_h0upqEHYlZO_uHFIwnomWe9LvUsVA=s0-d)
9.
10.
29.
30.
31.
32.
Integral
Positivism and Software Engineering
When Aristoteles stated his geocentric theory, the sustained theories were hard to explain without complex formulas describing weird trajectories about the other corps over the system.
About the same idea, Greek mechanics was largely accepted for describing accurately enough trajectories of objects near the grounth and above the heights. But it still miss something...
In my humilde opinion, the success key which lead Galileo and Newton theories superseed their ancestors was that these are based on postulates of equality among all the interveinig elements of analysis. In other words, each element being under analysis posseses undistinguishable properties over the others, and any of them hasn't special atributes and/or governementship over the others: The apple goes towards the Earth, and the Earth does the same towards the apple all simultaneously; A hunt walks it's way over the Earth's surface, and the Earth moves arround its centre as a reaction to the strength excerced by the hunt steps.
"Logic carries you from A to B, imagination everywhere", and "There's 1 thing more valuable than knowledge: imagination", are quotes from Einstein, this makes me question if the status we attribute to intelligence should be reevaluated.
I'm still wondering, what would Arquimedes have mean to say when he said "Give me a standpoint and I'll move the world".
Your post raised my interest up!
7.
8.
9.
10.
29.
30.
31.
32.
Un optimista ve una oportunidad en toda calamidad, un pesimista ve una calamidad en toda oportunidad.
-- Winston Churchill. (1874-1965) Político inglés.
El pesimista sabe rebelarse contra el mal. Sólo el optimista sabe extrañarse del mal.
-- Gilbert Chesterton. (1874-1936) Escritor británico.
Diferencial
y=x2, obtener: Ay, dy (x2: x elevado al cuadrado, Ay: delta y, dy: diferencial de y)
Ay = f(x+Ax) - f(x) =
= (x+Ax)2 - x2 =
= x2 + 2xAx + Ax2 - x2 =
= 2xAx + Ax2
dy = f'(x) dx =
= 2x Ax (*)
* Recordar:
x' = 1 (*2)
dx = x' Ax = Ax (*3)
*2 Recordar:
(1): lím Ax->0 Ax/Ax = x' (derivada de 1 variable con respecto a sí misma, toda variable está en función de sí misma x = f(x) / x = x)
(2): lím Ax->0 Ax/Ax = lím Ax->0 1 = 1
Por (1) y (2): x' = 1
*3 Recordar:
lím Ax->0 Ax/Ax = x'
Ax / Ax = x' + alfa / Ax -> 0 => alfa -> 0
Ax = x' Ax + alfa Ax
dx = x' Ax = Ax (diferencial de la variable independiente con respecto a sí misma, obviamente por ser independiente)Integral
lím i → ∞ ∑ f(xi) ∆xi = ∆x lím i → ∞ ∑ f(xi) = ∫def.[a..b] f(x) ∆x, ∆x0 = ∆x1 = ... = ∆xi = ∆x, i → ∞ <=> ∆x → 0
∫def.[a..b] f(x) ∆x = primitiva de f(b) - primitiva de f(a) = primitiva de f(b).g(z) - primitiva de f(a)
si primitiva de f(a) = 0:
∫def.[a..x] f(x) ∆x = primitiva de f(x) = primitiva de f(x). g(z) = ∫def.[a..x] f(x) ∆x.g(z) = ∫def.[a..x] f(x) dx
si no:
∫def.[a..x] f(x) ∆x = ∫def.[a..x] f(x) g(z1)-g(z0), g(z1)-g(z0)=∆x
si F(x) = x => dx = ∆x
si y=F(x) ^ x=G(z) => dx = f(x) . g(z) . ∆z
si no => dx = f(x) ∆x
primitiva de f(x) = primitiva de f(x).g(z)
Matemática, teoría de juegos, software libre
Positivism and Software Engineering
When Aristoteles stated his geocentric theory, the sustained theories were hard to explain without complex formulas describing weird trajectories about the other corps over the system.
About the same idea, Greek mechanics was largely accepted for describing accurately enough trajectories of objects near the grounth and above the heights. But it still miss something...
In my humilde opinion, the success key which lead Galileo and Newton theories superseed their ancestors was that these are based on postulates of equality among all the interveinig elements of analysis. In other words, each element being under analysis posseses undistinguishable properties over the others, and any of them hasn't special atributes and/or governementship over the others: The apple goes towards the Earth, and the Earth does the same towards the apple all simultaneously; A hunt walks it's way over the Earth's surface, and the Earth moves arround its centre as a reaction to the strength excerced by the hunt steps.
"Logic carries you from A to B, imagination everywhere", and "There's 1 thing more valuable than knowledge: imagination", are quotes from Einstein, this makes me question if the status we attribute to intelligence should be reevaluated.
I'm still wondering, what would Arquimedes have mean to say when he said "Give me a standpoint and I'll move the world".
Your post raised my interest up!
Suscribirse a:
Entradas (Atom)