Otázky a odpovede

Tu sme sa pokúsili čo najzrozumiteľnejšou formou zodpovedať niektoré často kladené otázky tých, ktorí majú záujem o informačné systémy. V žiadnom prípade nepovažujte tu uvedené odpovede za náhradu odborných publikácií. Často sú veľmi zjednodušené a slúžia skôr na jemné priblíženie problematiky, než ako odborný výklad.

Priebežne dopĺňame nové otázky a odpovede na tie staršie vylepšujeme. Každopádne budeme veľmi radi, ak nám napíšete Vaše otázky, upozorníte nás na chyby alebo navrhnete nejaké lepšie vysvetlenie.

Informačné systémy

Operačné systémy a programy

Technológie

Ostatné

Pbatenghyngvbaf Lbh ner n bofreinag jro unpxre Vs Lbh jnag n wbo va bhe pbzcnal cyrnfr znvy gb gbhtuthl ng ci2p qbg fx Unir n avpr qnl
	A man met a beautiful young woman in a bar.  They got along well,
shared dinner, and had a marvelous evening.  When he left her, he told her
that he had really enjoyed their time together, and hoped to see her again,
soon.  Smiling yes, she gave him her phone number.
	The next day, he called her up and asked her to go dancing.  She
agreed.  As they talked, he jokingly asked her what her favorite flower was.
Realizing his intentions, she told him that he shouldn't bring her flowers
-- if he wanted to bring her a gift, well, he should bring her a Swiss Army
knife!
	Surprised, and not a little intrigued, he spent a large part of the
afternoon finding a particularly unusual one.  Arriving at her apartment
he immediately presented her with the knife.  She ooohed and ahhhed over it
for a minute, and then carefully placed it in a drawer, that the man couldn't
help but see was full of Swiss Army knives.
	Surprised, he asked her why she had collected so many.
	"Well, I'm young and attractive now", blushed the woman, "but that
won't always be true.  And boy scouts will do anything for a Swiss Army knife!"
    function perr($msg, $level)
    {
        echo $msg;
    }

    function readcsv_get_entity($fh, $sep = ';')
    {
        $entity = array();
        $attr = '';
        $eoe = false;

        while((! feof($fh)) && (! $eoe))
        {
            $ch = fgetc($fh);
            switch($ch)
            {
                case "\r":
                    break;
                case "\n":
                    $eoe = true;
                case $sep:
                    array_push($entity, $attr);
                    $attr = '';
                    break;
                case '"':
                    $ch = '';
                    while((! feof($fh)) && $ch != '"')
                    {
                        $ch = fgetc($fh);
                        $attr .= $ch;
                    }
                    $attr = rtrim($attr, '"');
                    break;
                default:
                    $attr .= $ch;
            }
        }

        if(feof($fh) && ($entity || $attr))
        {
            array_push($entity, $attr);
        }
        elseif(feof($fh))
        {
            $entity = false;
        }

        return $entity;
    }

    function readcsv_parsecsv($filename)
    {
        $ret = false;
        $sep = ';';
        $line = '';
        $line_num = 0;
        $cells = array();
        $names = array();

        $fh = fopen($filename, 'r');
        if(! $fh)
        {
            perr('Failed to open file \''
                . $file . "'\n", 8);
        }
        else
        {
        $line = '';
        while(! feof($fh))
        {
        $entity = readcsv_get_entity($fh, $sep);

        if($entity)
        {
        if($line_num == 0)
        {
        foreach($entity as $name)
        {
            array_push($names, trim($name, '"'));
        }
        }
        else
        {
        foreach($entity as $index => $val)
        {
        if(isset($names[$index]))
        {
            $cells[$line_num][$names[$index]]
                = trim($val, '"');
        }
        else
        {
            array_push($cells[$line_num],
                trim($val, '"'));
        }                            
        }
        }
        $line_num ++;
        }
        }
        fclose($fh);
        }

        return $ret;
    }
        
    function perr($msg, $level)
    {
        echo $msg;
    }

    function readcsv_get_entity($fh, $sep = ';')
    {
        $entity = array();
        $attr = '';
        $eoe = false;

        while((! feof($fh)) && (! $eoe))
        {
            $ch = fgetc($fh);
            switch($ch)
            {
                case "\r":
                    break;
                case "\n":
                    $eoe = true;
                case $sep:
                    array_push($entity, $attr);
                    $attr = '';
                    break;
                case '"':
                    $ch = '';
                    while((! feof($fh)) && $ch != '"')
                    {
                        $ch = fgetc($fh);
                        $attr .= $ch;
                    }
                    $attr = rtrim($attr, '"');
                    break;
                default:
                    $attr .= $ch;
            }
        }

        if(feof($fh) && ($entity || $attr))
        {
            array_push($entity, $attr);
        }
        elseif(feof($fh))
        {
            $entity = false;
        }

        return $entity;
    }

    function readcsv_parsecsv($filename)
    {
        $ret = false;
        $sep = ';';
        $line = '';
        $line_num = 0;
        $cells = array();
        $names = array();

        $fh = fopen($filename, 'r');
        if(! $fh)
        {
            perr('Failed to open file \''
                . $file . "'\n", 8);
        }
        else
        {
        $line = '';
        while(! feof($fh))
        {
        $entity = readcsv_get_entity($fh, $sep);

        if($entity)
        {
        if($line_num == 0)
        {
        foreach($entity as $name)
        {
            array_push($names, trim($name, '"'));
        }
        }
        else
        {
        foreach($entity as $index => $val)
        {
        if(isset($names[$index]))
        {
            $cells[$line_num][$names[$index]]
                = trim($val, '"');
        }
        else
        {
            array_push($cells[$line_num],
                trim($val, '"'));
        }                            
        }
        }
        $line_num ++;
        }
        }
        fclose($fh);
        }

        return $ret;
    }