Categoría: IT

IT

Uso de hilos en Delphi

Una forma sencilla de usar hilos en Delphi. Basta con usar synchronize correctamente 🙂 Contenido de la función uses System.Classes, System.SysUtils, Vcl.Forms; procedure Wait(Proc: TProc); var Thread: TThread; begin Thread := TThread.CreateAnonymousThread(procedure() begin Proc; end); Thread.FreeOnTerminate := True; Thread.Start; while…

Leer más — Uso de hilos en Delphi
IT

Obtener la IP de conexión desde AWS (PHP)

Al usar un servidor de Amazon, al consultar la IP del servidor se muestra la IP privada. Por eso lo hice para obtener la IP pública. <? if(in_array(substr($_SERVER[‘SERVER_ADDR’], 0, 3), array(‘172’))) if(strrpos(gethostname(), ‘.compute.internal’)!==false) $_SERVER[‘SERVER_ADDR’] = file_get_contents(‘http://169.254.169.254/latest/meta-data/public-ipv4’); echo $_SERVER[‘SERVER_ADDR’]; ?>

Leer más — Obtener la IP de conexión desde AWS (PHP)
IT

Monitoreo del registro (Delphi)

Instrucciones de uso procedure RegistryMonitor(RootKey: HKEY; Key: string; Proc: TProc; WatchSub: boolean); begin TThread.CreateAnonymousThread(procedure var Reg: TRegistry; Event: cardinal; begin Reg := TRegistry.Create; Reg.RootKey := RootKey; if Reg.OpenKeyReadOnly(Key) then begin Event := CreateEvent(nil, False, False, nil); if Event > 0…

Leer más — Monitoreo del registro (Delphi)
IT

Análisis morfológico, instalación y uso (PHP)

Entorno de instalación: CentOS 7 básico, PHP 7 yum install gcc-c++ java-1.7.0-openjdk-devel python-devel zlib-devel openssl openssl-devel git -y wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz tar xf Python-3.* cd Python-3.* ./configure make make altinstall pip3.6 install JPype1-py3 pip3.6 install konlpy cd .. wget https://bitbucket.org/eunjeon/mecab-ko/downloads/mecab-0.996-ko-0.9.2.tar.gz tar…

Leer más — Análisis morfológico, instalación y uso (PHP)