This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.Sprite; | |
public class Singleton | |
{ | |
private static var _instancia:Singleton; | |
public function Singleton(pvd:ClasePrivada) | |
{ | |
}// Constructor vacío. | |
public static function instanciar():Singleton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.Sprite; | |
public class Singleton extends Sprite | |
{ | |
public function Singleton() | |
{ | |
ClasePrivada.mensaje(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.Sprite; | |
public class SingletonTest extends Sprite | |
{ | |
public function SingletonTest() | |
{ | |
var miSingleton:Singleton = Singleton.instanciar(); | |
var miSingleton2:Singleton = Singleton.instanciar(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS `users` ( | |
`agent_code` int(5) NOT NULL DEFAULT '0', | |
`username` varchar(13) DEFAULT NULL, | |
`password` varchar(32) NOT NULL DEFAULT '', | |
`hash` varchar(32) NOT NULL DEFAULT '', | |
PRIMARY KEY (`agent_code`), | |
UNIQUE KEY `hash` (`hash`), | |
UNIQUE KEY `username` (`username`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ob_start(); | |
$hostname = "localhost"; | |
$username = "usuario"; | |
$password = "password123"; | |
$database = "mibd"; | |
$mysqli = new MySQLi($hostname, $username, $password, $database); | |
$amIConnected = ($mysqli->connect_errno) ? FALSE: TRUE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
import flash.display.*; | |
import flash.net.*; | |
import flash.events.*; | |
import flash.text.*; | |
public class main extends MovieClip { | |
private static const DEFAULT_TEXT:String = "Iniciando Test..."; | |
private static const dx:int = 400; | |
private static const URL:String = "index.php"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function extraerImagen($cadenaDeTexto, $encabezado, $pieDeArchivo){ | |
$ini = strpos($cadenaDeTexto, $encabezado); | |
if ($ini == 0) return false; | |
$lon = strpos($cadenaDeTexto,$pieDeArchivo, $ini); | |
return substr($cadenaDeTexto,$ini,$lon); | |
} | |
$archivo = 'fileCarvingTest.docx'; | |
$buffer = fread(fopen($archivo, "r"), filesize($archivo)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function hex2bin($h) { | |
if (!is_string($h)) return null; | |
$r = ''; | |
for ($a = 0; $a < strlen($h); $a += 2) { | |
$r .= chr(hexdec($h{$a}.$h{($a + 1)})); | |
} | |
return $r; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static char *php_hex2bin(const unsigned char *old, const size_t oldlen, size_t *newlen) | |
{ | |
size_t target_length = oldlen >> 1; | |
register unsigned char *str = (unsigned char *)safe_emalloc(target_length, sizeof(char), 1); | |
size_t i, j; | |
for (i = j = 0; i < target_length; i++) { | |
char c = old[j++]; | |
if (c >= '0' && c <= '9') { | |
str[i] = (c - '0') << 4; | |
} else if (c >= 'a' && c <= 'f') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Carro { | |
public function __construct() { | |
$motor = new Motor(); | |
$motor->arranca(); | |
} | |
} |
OlderNewer