M@U escribió:
Err... No se si tenga permiso para ensuciar tu post, pero... Las que existen no funcionan siempre, solo en modo de vista previa, o en un Tip ya publicado desde fuera de los foros.
Quizá sea cosa mía.
Mmm... A mi me funcionan.
ActionScript
Código ActionScript :
package
{
import fl.controls.List;
import fl.data.DataProvider;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.Event;
//------------------------------------
public class FillList extends List
{
private var _xml:XML;
//------------------------------------
public function FillList():void { }
//------------------------------------
public function setData(url:String):void
{
var request:URLRequest = new URLRequest(url);
var loader:URLLoader = new URLLoader();
loader.load(request);
loader.addEventListener(Event.COMPLETE, xmlLoaded);
}
private function xmlLoaded(e:Event):void
{
_xml = new XML(e.target.data);
dataProvider = new DataProvider(_xml);
}
//------------------------------------
}
}
PHP
Código PHP :
<?php
$dir = "./";
echo "<XML encoding='UTF-8' standalone='yes' version='1.0'>\n";
echo " <folder>\n";
if (is_dir($dir))
{
if ($gd = opendir($dir))
{
while (($archivo = readdir($gd)) !== false)
{
if ($archivo != "." & $archivo != ".." & $archivo != "list.php")
{
if (is_dir($archivo))
{
echo " <folder>$archivo</folder>\n";
}
else
{
echo " <file>$archivo</file>\n";
}
}
}
closedir($gd);
}
}
echo " </folder>\n";
echo "</XML>\n";
?>
Javascript
Código Javascript :
var expDays = 10;
var page = "popup.html";
var frecuencia=15;
var windowprops = "width=290,height=260,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes";
function GetCookie (name)
{
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen)
{
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
Flex
Código Flex :
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:modules="*" layout="absolute">
<mx:Script>
<![CDATA[
private function setModuleText1():void
{
modulo1.setTexto("texto1")
}
private function setModuleText2():void
{
var mod:IModule = modulo2.child as IModule;
mod.setTexto("texto2");
}
]]>
</mx:Script>
<mx:VBox horizontalCenter="0" verticalCenter="0" horizontalAlign="center">
<modules:module id="modulo1"/>
<mx:ModuleLoader id="modulo2" url="module.swf"/>
<mx:Button label="Button1" click="setModuleText1()"/>
<mx:Button label="Button2" click="setModuleText2()"/>
</mx:VBox>
</mx:Application>
C++
Código C++ :
#include <iostream>
using namespace std;
int dec2base(int n, int base);
int main(void) {
int num,base;
cout <<"Introduce un numero entero en base 10: "<<endl;
cin >>num;cout <<endl;
cout <<"Introduce la base a la que deseas convertir el numero:"<<endl;
cin >>base;
cout <<endl<<"El numero "<<num<<" en base 10 equivale al numero "<<
dec2base(num,base)<<" en base "<<base<<"."<<endl<<endl;
system("pause");
}
int dec2base(int n, int base) {
int n_base=0, coef=1;
while (n!=0) {
n_base+=coef*(n%base);
coef*=10;
n/=base;
}
return n_base;
}
HTML
Código HTML :
<div id="header">
<a href="index.php"><img src="img/logo.png" alt="Logo Bleend.net" width="163" height="50" border="0" class="float" /></a>
<div id="navbar">
<div id="navbar_content2"><h1>Una página de Juegos Flash Online</h1></div>
</div>
<div id="all_games">Lista completa de juegos:
<div id="all_games_select">
<form>
<select name="games" onChange='go();'>
<option>Seleccionar...</option>
<option value="jugar.php?&id=4">Fancy Pants Adventure</option>
<option value="jugar.php?&id=5">Defend your Castle</option>
<option value="jugar.php?&id=6">3D Logic</option>
<option value="jugar.php?&id=45">Totem Destroyer</option>
</select>
</form>
</div>
</div>
<br class="clearfloat"/>
<!--End Header-->
</div>
Java
Código Java :
import java.util.*;
public class QuintessentialCollection {
public static Collection fill(Collection c) {
c.add("Enterprise Server");
c.add("Department Server");
c.add("Workstation");
return c;
}
/**
* An overloaded method from the Map class.
*/
public static Map fill(Map m) {
m.put("Enterprise Server", "Sun Solaris");
m.put("Enterprise Server", "HP-UX");
m.put("Department Server", "Linux");
m.put("Workstation", "MS Windows");
m.put("Workstation", "Macintosh");
return m;
}
public static void doPrintContainer() {
Collection p1;
Map m1;
List a1 = new ArrayList();
p1 = fill(a1);
System.out.println("\n");
System.out.println("+-------------+");
System.out.println("| ArrayList |");
System.out.println("+-------------+");
System.out.println(" - Ordered group of elements");
System.out.println(" - Duplicates allowed");
System.out.println("================================");
System.out.println(" " + p1 + "\n");
List a2 = new LinkedList();
p1 = fill(a2);
System.out.println("+-------------+");
System.out.println("| LinkedList |");
System.out.println("+-------------+");
System.out.println(" - Ordered (by entry into the list) group of elements");
System.out.println(" - Duplicates allowed");
System.out.println("================================");
System.out.println(" " + p1 + "\n");
Set a3 = new HashSet();
p1 = fill(a3);
System.out.println("+-------------+");
System.out.println("| HashSet |");
System.out.println("+-------------+");
System.out.println(" - No ordering of elements");
System.out.println(" - No duplicates are allowed");
System.out.println(" - add, remove, and contains methods constant time");
System.out.println(" complexity: O(c).");
System.out.println("================================");
System.out.println(" " + p1 + "\n");
Set a4 = new TreeSet();
p1 = fill(a4);
System.out.println("+-------------+");
System.out.println("| TreeSet |");
System.out.println("+-------------+");
System.out.println(" - Ordered (by element ASCII value) group of elements");
System.out.println(" - No duplicates are allowed");
System.out.println(" - add, remove, and contains methods logarithmic");
System.out.println(" time complexity: O(log(n)), where n is the number of");
System.out.println(" elements in the group.");
System.out.println("================================");
System.out.println(" " + p1 + "\n");
Map a5 = new HashMap();
m1 = fill(a5);
System.out.println("+-------------+");
System.out.println("| HashMap |");
System.out.println("+-------------+");
System.out.println(" - No ordering on (key, value) pairs.");
System.out.println(" - A Map is an object that maps keys to values.");
System.out.println(" - Also called an Associative Array or Dictionary.");
System.out.println("================================");
System.out.println(" " + m1 + "\n");
Map a6 = new TreeMap();
m1 = fill(a6);
System.out.println("+-------------+");
System.out.println("| TreeMap |");
System.out.println("+-------------+");
System.out.println(" - (key, value) pairs are ordered on the key.");
System.out.println(" - The implementation is based on red-black tree structure.");
System.out.println(" - A Map is an object that maps keys to values.");
System.out.println(" - Also called an Associative Array or Dictionary.");
System.out.println("================================");
System.out.println(" " + m1 + "\n");
}
public static void main(String[] args) {
doPrintContainer();
}
}
XML
Código XML :
<XML encoding='UTF-8' standalone='yes' version='1.0'>
<folder>
<file>img_001.jpg</file>
<file>img_002.jpg</file>
<file>img_003.jpg</file>
<file>img_004.jpg</file>
<file>img_005.jpg</file>
<folder>thumbs</folder>
<folder>hires</folder>
</folder>
</XML>
MySQL
Código MySQL :
$result = mysql_query("SELECT * FROM example")