Projekt nvdriver přichází s ambiciózním cílem nahradit oficiální proprietární ovladač grafických karet NVIDIA vlastním clean-room open-source řešením v jazyce Rust. Modul funguje jako přímá náhrada, která plně spolupracuje s nijak neupraveným uživatelským prostorem (originální CUDA, PyTorch, nvidia-smi, llama.cpp...) s tím drobným, ale zásadním rozdílem, že driver neimplementuje umělá softwarová omezení výrobce, a tak
… více »V posledních dnech se ve veřejném prostoru množí zvěsti, že společnost Anthropic dosáhla s pomocí umělé inteligence významného průlomu v kryptoanalýze, který by mohl ohrozit šifrovací algoritmus RSA, jež chrání bankovní systémy, e-maily i digitální podpisy. Ačkoli tyto informace, šířené na sociálních sítích mimo jiné i Elonem Muskem, zatím nebyly oficiálně potvrzeny, nově vzniklá skupina předních akademiků Cryptography Incident
… více »
$posts= preg_split('/From (.+) na (.+) (Mon|Tue|Wed|Thu|Fri|Sat|Sun) (.{3}) (.{2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})/', implode(file('test.txt')), -1, PREG_SPLIT_NO_EMPTY);
while(list($key,$value)= each($posts)){
$post_split= preg_split('/Message-ID: (.+)/',$value);
$head= $post_split[0];
$message_text= $post_split[1];
preg_match('/From: (.+) na (.+) \((.+)\)/',$head,$from);
preg_match('/Subject: (.+)/',$head,$message_subject);
$post= $from[0]."\n".$message_subject[0]."\n\n".trim($message_text)."\n";
echo "$key\n<br>".nl2br(htmlspecialchars($post))."<br>\n<hr>\n";
}
Potrebuju nacist soubor a ten pak naparsovat na castiNic vic, nic min to nedela. Ja jsem jen potreboval ten kod vylepsit aby byl efektivnejsi
#!/usr/bin/env perl
use strict;
use warnings;
my $msg={};
my $header='';
my $firstFrom = qr(^From (.+) na (.+) (Mon|Tue|Wed|Thu|Fri|Sat|Sun) (.{3}) (.{2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})$);
my $headerLine = qr(^\S+:);
sub ParseHeader {
my @headerLines = split m($/), $_[0];
my $ret = {};
@$ret{qw(usr site dayOfWeek month day hour min sec year)} =
shift(@headerLines) =~ /$firstFrom/;
foreach my $line (@headerLines) {
# tady si udelej co chces se zbytkem hlavicky a nacpi do $ret
}
return $ret;
}
sub PrintMsg {
my $msg = shift;
return unless ref $msg eq 'HASH' and %$msg;
use Data::Dumper;
print Data::Dumper->Dump([$msg],['msg']);
}
while (<>) {
chomp;
?$firstFrom?o and $header = $_ and next;
if ($header) {
/$headerLine/o and $header .= "$/$_" and next;
if (/^\s*$/) {
PrintMsg ($msg); # end of header - print msg
$msg = ParseHeader($header);
$header = '';
reset;
next;
}
# falesna hlavicka
$msg->{content} .= "$/" . $header;
$header = '';
next;
}
%$msg and $msg->{content} .= "$_$/" and next;
/\S/ and die 'Header not found';
}
#!/usr/bin/env perl
use strict;
use warnings;
my $msg={};
my @header;
my $firstFrom = qr(^From (.+) na (.+) (Mon|Tue|Wed|Thu|Fri|Sat|Sun) (.{3}) (.{2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})$);
my $headerLine = qr(^\S+:);
sub ParseHeader {
my $ret = {};
@$ret{qw(usr site dayOfWeek month day hour min sec year)} =
shift() =~ /$firstFrom/;
foreach my $line (@_) {
# tady si udelej co chces se zbytkem hlavicky a nacpi do $ret
}
return $ret;
}
sub PrintMsg {
my $msg = shift;
return unless ref $msg eq 'HASH' and %$msg;
use Data::Dumper;
shift @{$msg->{content}} while $msg->{content}[0] =~ /^\s*$/;
pop @{$msg->{content}} while $msg->{content}[$#{$msg->{content}}] =~ /^\s*$/;
print Data::Dumper->Dump([$msg],['msg']);
}
while (<>) {
chomp;
?$firstFrom?o and push @header, $_ and next;
if (@header) {
/$headerLine/o and push @header, $_ and next;
if (/^\s*$/) {
PrintMsg ($msg); # end of header - print msg
$msg = ParseHeader(@header);
@header = ();
reset;
next;
}
# falesna hlavicka
push @{$msg->{content}}, @header;
@header = ();
next;
}
%$msg and push @{$msg->{content}}, $_ and next;
/\S/ and die 'Header not found';
}
PrintMsg($msg);
Tiskni
Sdílej: