Quick sort en pascal

Aqui les dejo el codigo de el quick sort para pascal, este codigo yo lo hice

PROGRAM quicksortin;

{ MoYo }

USES CRT;

CONST

elementsinuse = 10; { number of elements in the array }

TYPE

thearraytype = array [1..elementsinuse] OF INTEGER; { the array type }

VAR

thearray : thearraytype; { the array declared }
first, last : integer; { the lower and upper value}
temp : integer;

{**********************************************************}

PROCEDURE swap (VAR x, y : integer); { procedure to switch the numbers }

VAR

temp : integer;

BEGIN

temp := x;
x := y;
y := temp;

END;

{**********************************************************}

{ the procedure to get the data or the quick sort }

PROCEDURE qsort(VAR thearray : thearraytype; first : integer;
last : integer);

VAR

right, left : integer;
midpoint : integer;

BEGIN { qsort }

midpoint := thearray[(first + last) div 2]; { get the midpoint }
right := first; { set left to lower }
left := last; { set right to upper }

REPEAT { begin repeat }

WHILE (thearray[right] <>
right := right + 1; { add to 1 to left }

WHILE (thearray[left] > midpoint) DO { is thearray[right] > midpoint}
left := left – 1; {set right minus 1 }

IF (right <= left) THEN { is left <>
BEGIN
swap (thearray[right], thearray[left]);
right := right + 1; {set left + 1 }
left := left – 1; {set right – 1}
END;

UNTIL right > left; { end repeat }

IF (first <>
qsort (thearray, first, left);
IF (right <>
qsort(thearray, right, last);

END;

{ procedure for the quick sort }

PROCEDURE quicksort(thearray : thearraytype ; elementsinuse : integer);

VAR

first : integer;

BEGIN

first := 1;
last := elementsinuse;

IF first <>

qsort(thearray, first, last) { the quick sort process, call the qsort procedure }

END;

BEGIN { main }

thearray[1] := 4;
thearray[2] := 15;
thearray[3] := 54;
thearray[4] := 64;
thearray[5] := 84;
thearray[6] := 5;
thearray[7] := 24;
thearray[8] := 1;
thearray[9] := 8;
thearray[10] := 9;

quicksort(thearray, elementsinuse)

END. {main }

Bubble sort en pascal

bueno aqui les dejo el codigo de el bubble sort en pascal, yo lo hice.

BUBBLE SORT CODE

PROGRAM bubblesorting;

{ MoYo }

USES CRT;

CONST

elementsinuse = 10;

TYPE

thearraytype = array [1..10] OF INTEGER;

VAR

currentindex, currentpass : integer;
tempvalue : integer;
thearray : thearraytype;

PROCEDURE bubble (thearray : thearraytype; elementsinuse : integer);

BEGIN

IF elementsinuse > 1 THEN
FOR currentpass := 1 to elementsinuse – 1 DO
FOR currentindex := 1 to elementsinuse – 1 DO
IF (thearray[currentindex + 1 ] <>

Vulnerabilidad en múltiples navegadores permite acceso a archivos remotos

FrSIRT ha anunciado una vulnerabilidad que afecta a los principales navegadores, y que podría ser explotada por atacantes remotos para conseguir acceso no autorizado a archivos arbitrarios.

El fallo reside en un error de diseño donde los eventos de pulsación de teclas son cancelables a través de código JavaScript, lo que puede ser aprovechado por atacantes remotos para hacer que los usuarios suban archivos arbitrarios desde un sistema vulnerable a un sitio malicioso. Para ello será necesario convencer al usuario atacado para que visite una página web maliciosamente creada y que realice determinadas acciones (como escribir un determinado texto en un campo de texto), lo que provoca que un archivo arbitrario sea subido de forma automática.

Al contrario de lo habitual, este problema no se restringe a un solo navegador, sino que se ven afectados Mozilla Firefox 1.5.0.4 y versiones anteriores, Mozilla SeaMonkey 1.0.2 y anteriores, Netscape 8.1 y anteriores, Mozilla Suite 1.7.13 y anteriores, Internet Explorer 6 y 5.01. Además se ha confirmado la publicación de un exploit de demostración como prueba de concepto del problema.

Fuente: Boletines de seguridad Oxygen3