Search Results

Search found 53 results on 3 pages for 'julio'.

Page 3/3 | < Previous Page | 1 2 3 

  • How to yield a single element from for loop in scala?

    - by Julio Faerman
    Much like this question: Functional code for looping with early exit Say the code is def findFirst[T](objects: List[T]):T = { for (obj <- objects) { if (expensiveFunc(obj) != null) return /*???*/ Some(obj) } None } How to yield a single element from a for loop like this in scala? I do not want to use find, as proposed in the original question, i am curious about if and how it could be implemented using the for loop. * UPDATE * First, thanks for all the comments, but i guess i was not clear in the question. I am shooting for something like this: val seven = for { x <- 1 to 10 if x == 7 } return x And that does not compile. The two errors are: - return outside method definition - method main has return statement; needs result type I know find() would be better in this case, i am just learning and exploring the language. And in a more complex case with several iterators, i think finding with for can actually be usefull. Thanks commenters, i'll start a bounty to make up for the bad posing of the question :)

    Read the article

  • 2 eventos, 2 países, 1 jornada.

    - by Noelia Gomez
    Normal 0 21 false false false ES X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-family:"Calibri","sans-serif";} El pasado Martes 23 de Octubre fue un día de gran actividad tanto en España como en Portugal. El Dialogo CxO , organizado por Econique, y en el que participó Oracle, tuvo lugar en Madrid en el Hotel Puerta de Ámerica. Este encuentro tenía como objetivo intercambiar opiniones sobre todos los aspectos relacionados con la gestión estratégica de clientes y el Contact Centre. En este marco, los asistentes tuvieron la oportunidad de realizar reuniones “one to one” con nuestros mejores expertos. Además Oracle presentó dos coloquios relacionados con la visión de las "Nuevas necesidades, estrategias y tendencias en la gestión del Marketing", de la mano de Gema Sebastian, Principal Sales Consultant de Oracle. En dichos coloquios los participantes de empresas, como Caprabo, Carrefour, Endesa, Jaguar Land Rover y Repsol (entre otros) trataron temas de máxima actualidad para los directivos de Marketing. Esta mesa redonda se centró sobre todo en el Marketing en redes sociales, compartiendo entre todos nuestra percepción de que es algo necesario pero que todavía el mercado no sabe muy bien cómo tratar. La escucha activa dentro de las redes y la posibilidad de reaccionar ante determinados factores se veía como un claro punto donde comenzar a trabajar de manera activa y donde Oracle puede ayudar. La experiencia de cliente fue otro de los puntos tratados en esta mesa, donde se dejó claro que ahora es el consumidor el que manda, el que quiere ver las cosas donde quiere y como quiere y que un mensaje de marketing ha de darse en el momento adecuado y aportando un valor real para que el consumidor lo acepte como algo interesante. Igualmente Oracle dispone de herramientas para hacer que esto sea posible. Por otro lado, en Lisboa, tenía lugar el Total Training 2012, una conferencia organizada por el Grupo IFE. En ella participaron más de 100 profesionales de los recursos humanos de las empresas más importantes de Portugal y tuvo como base de partida los conocimientos y experiencias, el intercambio de ideas y la discusión de oportunidades a las que actualmente se enfrentan los profesionales de este área. En este marco Oracle realizó una ponencia sobre “Los nuevos conceptos en RRHH”, de la mano de Julio Rodriguez, Principal Sales Consultant de Oracle, y que puso de manifiesto algunos conceptos tecnológicos relevantes para la gestión del talento que por su novedad, no eran muy conocidos por los profesionales de los RRHH cómo: · Saas (Software as a service) · BI (Business Intelligence) para RRHH · Social Networking y cómo integrarla dentro de la empresa · El mapa del talento, por fin fuera del Excel y en una aplicación · La movilidad en las aplicaciones de RRHH. Sin duda, esta fue una jornada cargada de intercambio de experiencias y de conocimientos para dos grandes áreas: los Recursos Humanos y la Gestión Estratégica del cliente. Si quieres saber más sobre la experiencia del cliente: Customer Concepts Magazine Customer Concepts Exchange in LinkedIn Customer Concepts Web TV Customer Experience @ Oracle.com Customer Experience Facebook Hub Customer Experience YouTube Channel Customer Experience Twitter Puede conocer más sobre HCM (Gestión de RRHH): Oracle Fusion Applications Oracle Fusion Human Capital Management Oracle PartnerNetwork Oracle Consulting Services Oracle Human Capital Management Blog Oracle HCM on Twitter Oracle HCM on Facebook

    Read the article

  • Given an XML which contains a representation of a graph, how to apply it DFS algorithm? [on hold]

    - by winston smith
    Given the followin XML which is a directed graph: <?xml version="1.0" encoding="iso-8859-1" ?> <!DOCTYPE graph PUBLIC "-//FC//DTD red//EN" "../dtd/graph.dtd"> <graph direct="1"> <vertex label="V0"/> <vertex label="V1"/> <vertex label="V2"/> <vertex label="V3"/> <vertex label="V4"/> <vertex label="V5"/> <edge source="V0" target="V1" weight="1"/> <edge source="V0" target="V4" weight="1"/> <edge source="V5" target="V2" weight="1"/> <edge source="V5" target="V4" weight="1"/> <edge source="V1" target="V2" weight="1"/> <edge source="V1" target="V3" weight="1"/> <edge source="V1" target="V4" weight="1"/> <edge source="V2" target="V3" weight="1"/> </graph> With this classes i parsed the graph and give it an adjacency list representation: import java.io.IOException; import java.util.HashSet; import java.util.LinkedList; import java.util.Collection; import java.util.Iterator; import java.util.logging.Level; import java.util.logging.Logger; import practica3.util.Disc; public class ParsingXML { public static void main(String[] args) { try { // TODO code application logic here Collection<Vertex> sources = new HashSet<Vertex>(); LinkedList<String> lines = Disc.readFile("xml/directed.xml"); for (String lin : lines) { int i = Disc.find(lin, "source=\""); String data = ""; if (i > 0 && i < lin.length()) { while (lin.charAt(i + 1) != '"') { data += lin.charAt(i + 1); i++; } Vertex v = new Vertex(); v.setName(data); v.setAdy(new HashSet<Vertex>()); sources.add(v); } } Iterator it = sources.iterator(); while (it.hasNext()) { Vertex ver = (Vertex) it.next(); Collection<Vertex> adyacencias = ver.getAdy(); LinkedList<String> ls = Disc.readFile("xml/graphs.xml"); for (String lin : ls) { int i = Disc.find(lin, "target=\""); String data = ""; if (lin.contains("source=\""+ver.getName())) { Vertex v = new Vertex(); if (i > 0 && i < lin.length()) { while (lin.charAt(i + 1) != '"') { data += lin.charAt(i + 1); i++; } v.setName(data); } i = Disc.find(lin, "weight=\""); data = ""; if (i > 0 && i < lin.length()) { while (lin.charAt(i + 1) != '"') { data += lin.charAt(i + 1); i++; } v.setWeight(Integer.parseInt(data)); } if (v.getName() != null) { adyacencias.add(v); } } } } for (Vertex vert : sources) { System.out.println(vert); System.out.println("adyacencias: " + vert.getAdy()); } } catch (IOException ex) { Logger.getLogger(ParsingXML.class.getName()).log(Level.SEVERE, null, ex); } } } This is another class: import java.util.Collection; import java.util.Objects; public class Vertex { private String name; private int weight; private Collection ady; public Collection getAdy() { return ady; } public void setAdy(Collection adyacencias) { this.ady = adyacencias; } public String getName() { return name; } public void setName(String nombre) { this.name = nombre; } public int getWeight() { return weight; } public void setWeight(int weight) { this.weight = weight; } @Override public int hashCode() { int hash = 7; hash = 43 * hash + Objects.hashCode(this.name); hash = 43 * hash + this.weight; return hash; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Vertex other = (Vertex) obj; if (!Objects.equals(this.name, other.name)) { return false; } if (this.weight != other.weight) { return false; } return true; } @Override public String toString() { return "Vertice{" + "name=" + name + ", weight=" + weight + '}'; } } And finally: /** * * @author user */ /* -*-jde-*- */ /* <Disc.java> Contains the main argument*/ import java.io.*; import java.util.LinkedList; /** * Lectura y escritura de archivos en listas de cadenas * Ideal para el uso de las clases para gráficas. * * @author Peralta Santa Anna Victor Miguel * @since Julio 2011 */ public class Disc { /** * Metodo para lectura de un archivo * * @param fileName archivo que se va a leer * @return El archivo en representacion de lista de cadenas */ public static LinkedList<String> readFile(String fileName) throws IOException { BufferedReader file = new BufferedReader(new FileReader(fileName)); LinkedList<String> textlist = new LinkedList<String>(); while (file.ready()) { textlist.add(file.readLine().trim()); } file.close(); /* for(String linea:textlist){ if(linea.contains("source")){ //String generado = linea.replaceAll("<\\w+\\s+\"", ""); //System.out.println(generado); } }*/ return textlist; }//readFile public static int find(String linea,String palabra){ int i,j; boolean found = false; for(i=0,j=0;i<linea.length();i++){ if(linea.charAt(i)==palabra.charAt(j)){ j++; if(j==palabra.length()){ found = true; return i; } }else{ continue; } } if(!found){ i= -1; } return i; } /** * Metodo para la escritura de un archivo * * @param fileName archivo que se va a escribir * @param tofile la lista de cadenas que quedaran en el archivo * @param append el bit que dira si se anexa el contenido o se empieza de cero */ public static void writeFile(String fileName, LinkedList<String> tofile, boolean append) throws IOException { FileWriter file = new FileWriter(fileName, append); for (int i = 0; i < tofile.size(); i++) { file.write(tofile.get(i) + "\n"); } file.close(); }//writeFile /** * Metodo para escritura de un archivo * @param msg archivo que se va a escribir * @param tofile la cadena que quedaran en el archivo * @param append el bit que dira si se anexa el contenido o se empieza de cero */ public static void writeFile(String msg, String tofile, boolean append) throws IOException { FileWriter file = new FileWriter(msg, append); file.write(tofile); file.close(); }//writeFile }// I'm stuck on what can be the best way to given an adjacency list representation of the graph how to apply it Depth-first search algorithm. Any idea of how to aproach to complete the task?

    Read the article

< Previous Page | 1 2 3