This file contains hidden or 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
#ifndef _TIDX_TAD_ | |
#define _TIDX_TAD_ | |
#include <iostream> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include "../template/files.hpp" | |
#include "../template/lists.hpp" | |
#include "List.hpp" |
This file contains hidden or 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 com.thejavalistener.post.jndiintrospector; | |
import java.io.IOException; | |
import java.io.PrintWriter; | |
import javax.naming.Context; | |
import javax.naming.InitialContext; | |
import javax.servlet.ServletException; | |
import javax.servlet.annotation.WebServlet; | |
import javax.servlet.http.HttpServlet; |
This file contains hidden or 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 com.thejavalistener.post.jndiinstrospector; | |
import javax.ejb.Stateless; | |
@Stateless | |
public class MiEJB | |
{ | |
public String saludar(String nombre) | |
{ | |
return "Hola, "+nombre; |
This file contains hidden or 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 com.thejavalistener.post.jndiintrospector; | |
import javax.naming.Binding; | |
import javax.naming.Context; | |
import javax.naming.InitialContext; | |
import javax.naming.NamingEnumeration; | |
public class JndiIntrospector | |
{ | |
public static void print() |
This file contains hidden or 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 com.thejavalistener.post.simple; | |
public class DemoArrays | |
{ | |
public static void main(String[] args) | |
{ | |
int arr[] = new int[10]; | |
for(int i=0; i<arr.length; i++) | |
{ |
This file contains hidden or 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 com.thejavalistener.post.simple; | |
import java.util.Scanner; | |
public class Fibonacci | |
{ | |
public static void main(String[] args) | |
{ | |
// scanner me permite leer datos por consola | |
Scanner scanner = new Scanner(System.in); |
This file contains hidden or 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 com.thejavalistener.post.simple; | |
import java.util.Scanner; | |
public class Factorial | |
{ | |
public static void main(String[] args) | |
{ | |
// scanner me permite leer datos por consola | |
Scanner scanner = new Scanner(System.in); |
This file contains hidden or 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
// ... | |
// obtengo el signo | |
char sign = keys[i][UIndex.SIGN].charAt(0); | |
// si los dos valores son iguales => paso al proximo | |
if( comp==0 ) | |
{ | |
continue; | |
} |
This file contains hidden or 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
@Override | |
public int compare(T o1, T o2) | |
{ | |
for(int i=0; i<keys.length; i++) | |
{ | |
// tomo el i-esimo atributo de la clave | |
String key = keys[i][UIndex.KEY]; | |
// obtengo los valores a comparar y comparo | |
Comparable<T> value1 = (Comparable<T>)UBean.invokeGetter(o1, key); |
This file contains hidden or 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
public class BeanComparator<T> implements Comparator<T> | |
{ | |
private static final int KEY=0; | |
private static final int SIGN=1; | |
private String[][] keys = null; | |
public BeanComparator(String pkline) | |
{ | |
// explorar la cedana y la separa en pares (signo,key) |
NewerOlder