Search Results

Search found 2619 results on 105 pages for 'edge transport'.

Page 7/105 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • How do i use GraphMLReader2 in Jung?

    - by askus
    I want to use class GraphMLReader to read a Undirected Graph from graphML with JUNG2.0. The code is as follow: import edu.uci.ics.jung.io.*; import edu.uci.ics.jung.io.graphml.*; import java.io.*; import java.util.*; import org.apache.commons.collections15.Transformer; import edu.uci.ics.jung.graph.*; class Vertex{ int id; String type; String value; } class Edge{ int id ; String type; String value; } public class Loader{ static String src = "test.xsl"; public static void Main( String[] args){ Reader reader = new FileReader(src ); Transformer<NodeMetadata, Vertex> vtrans = new Transformer<NodeMetadata,Vertex>(){ public Vertex transform(NodeMetadata nmd ){ Vertex v = new Vertex() ; v.type = nmd.getProperty("type"); v.value = nmd.getProperty("value"); v.id = Integer.valueOf( nmd.getId() ); return v; } }; Transformer<EdgeMetadata, Edge> etrans = new Transformer<EdgeMetadata,Edge>(){ public Edge transform( EdgeMetadata emd ){ Edge e = new Edge() ; e.type = emd.getProperty("type"); e.value = emd.getProperty("value"); e.id = Integer.valueOf( emd.getId() ); return e; } }; Transformer<HyperEdgeMetadata, Edge> hetrans = new Transformer<HyperEdgeMetadata,Edge>(){ public Edge transform( HyperEdgeMetadata emd ){ Edge e = new Edge() ; e.type = emd.getProperty("type"); e.value = emd.getProperty("value"); e.id = Integer.valueOf( emd.getId() ); return e; } }; Transformer< GraphMetadata , UndirectedSparseGraph> gtrans = new Transformer<GraphMetadata,UndirectedSparseGraph>(){ public UndirectedSparseGraph<Vertex,Edge> transform( GraphMetadata gmd ){ return new UndirectedSparseGraph<Vertex,Edge>(); } }; GraphMLReader2< UndirectedSparseGraph<Vertex,Edge> , Vertex , Edge> gmlr = new GraphMLReader2< UndirectedSparseGraph<Vertex,Edge> ,Vertex, Edge>( reader, gtrans, vtrans, etrans, hetrans); UndirectedSparseGraph<Vertex,Edge> g = gmlr.readGraph(); return ; } } However, compiler alert that: Loader.java:60: cannot find symbol symbol : constructor GraphMLReader2(java.io.Reader,org.apache.commons.collections15.Transformer<edu.uci.ics.jung.io.graphml.GraphMetadata,edu.uci.ics.jung.graph.UndirectedSparseGraph>,org.apache.commons.collections15.Transformer<edu.uci.ics.jung.io.graphml.NodeMetadata,Vertex>,org.apache.commons.collections15.Transformer<edu.uci.ics.jung.io.graphml.EdgeMetadata,Edge>) location: class edu.uci.ics.jung.io.graphml.GraphMLReader2<edu.uci.ics.jung.graph.UndirectedSparseGraph<Vertex,Edge>,Vertex,Edge> new GraphMLReader2< UndirectedSparseGraph<Vertex,Edge> ,Vertex, Edge>( ^ 1 error How can i solve this problem? Thanks.

    Read the article

  • Integration transport choice (Oracle + SQL Server)

    - by lak-b
    We have several systems with Oracle (A) and SQL Server (B) databases on backend. I have to consolidate data from those systems into the new SQL Server database. Something like that: (A) =>|---------------| | some software | => SQL Server (B) =>|---------------| where some software is: transport (A and B systems located in the network) processing business logic (custom .NET code) Due to first point, I need some queue software or something similar (like MSMQ, Service Broker or something). In another hand, I can implement a web-service instead of queue. (A) =>|---------------|-------------| | queue/service | custom code | => SQL Server (B) =>|---------------|-------------| The question is: which queue/transport framework should I use with Oracle and SQL Server databases? It would be nice, if I can post messages to MSMQ in both Oracle and SQL Server stored procedures (can I?) It would be nice, if I can call a web-service in both Oracle and SQL Server stored procedures (can I?) It would be nice, if I can use something similar in both Oracle and SQL Server stored procedures (what exactly?) What software should I prefer to my requirements?

    Read the article

  • Java: Object Array assignment in for loop

    - by Hackster
    I am trying to use Dijkstra's algorithm to find the shortest path from a specific vertex (v0) to the rest of them. That is solved and works well with this code from this link below: http://en.literateprograms.org/index.php?title=Special:DownloadCode/Dijkstra%27s_algorithm_(Java)&oldid=15444 I am having trouble with assigning the Edge array in a for loop from the user input, as opposed to hard-coding it like it is here. Any help assigning a new edge to Edge[] adjacencies from each vertex? Keeping in mind it could be 1 or multiple edges. class Vertex implements Comparable<Vertex> { public final String name; public Edge[] adjacencies; public double minDistance = Double.POSITIVE_INFINITY; public Vertex previous; public Vertex(String argName) { name = argName; } public String toString() { return name; } public int compareTo(Vertex other){ return Double.compare(minDistance, other.minDistance); } } class Edge{ public final Vertex target; public final double weight; public Edge(Vertex argTarget, double argWeight){ target = argTarget; weight = argWeight; } } public static void main(String[] args) { Vertex v[] = new Vertex[3]; Vertex v[0] = new Vertex("Harrisburg"); Vertex v[1] = new Vertex("Baltimore"); Vertex v[2] = new Vertex("Washington"); v0.adjacencies = new Edge[]{ new Edge(v[1], 1), new Edge(v[2], 3) }; v1.adjacencies = new Edge[]{ new Edge(v[0], 1), new Edge(v[2], 1),}; v2.adjacencies = new Edge[]{ new Edge(v[0], 3), new Edge(v[1], 1) }; Vertex[] vertices = { v0, v1, v2}; /*Three vertices with weight: V0 connects (V1,1),(V2,3) V1 connects (V0,1),(V2,1) V2 connects (V1,1),(V2,3) */ computePaths(v0); for (Vertex v : vertices){ System.out.println("Distance to " + v + ": " + v.minDistance); List<Vertex> path = getShortestPathTo(v); System.out.println("Path: " + path); } } } The above code works well in finding the shortest path from v0 to all the other vertices. The problem occurs when assigning the new edge[] to edge[] adjacencies. For example this does not produce the correct output: for (int i = 0; i < total_vertices; i++){ s = br.readLine(); char[] line = s.toCharArray(); for (int j = 0; j < line.length; j++){ if(j % 4 == 0 ){ //Input: vertex weight vertex weight: 1 1 2 3 int vert = Integer.parseInt(String.valueOf(line[j])); int w = Integer.parseInt(String.valueOf(line[j+2])); v[i].adjacencies = new Edge[] {new Edge(v[vert], w)}; } } } As opposed to this: v0.adjacencies = new Edge[]{ new Edge(v[1], 1), new Edge(v[2], 3) }; How can I take the user input and make an Edge[], to pass it to adjacencies? The problem is it could be 0 edges or many. Any help would be much appreciated Thanks!

    Read the article

  • /etc/postfix/transport missing; what should it look like?

    - by Thufir
    I'm following the mailman guide but couldn't locate /etc/postfix/ so created it as follows: root@dur:~# root@dur:~# cat /etc/postfix/transport dur.bounceme.net mailman: root@dur:~# root@dur:~# telnet localhost 25 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 dur.bounceme.net ESMTP Postfix (Ubuntu) ehlo fqdn_test 250-dur.bounceme.net 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN mail from:[email protected] 250 2.1.0 Ok rcpt to:thufir@localhost 451 4.3.0 <thufir@localhost>: Temporary lookup failure rcpt to:[email protected] 451 4.3.0 <[email protected]>: Temporary lookup failure quit 221 2.0.0 Bye Connection closed by foreign host. root@dur:~# root@dur:~# postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases append_dot_mydomain = no biff = no broken_sasl_auth_clients = yes config_directory = /etc/postfix default_transport = smtp home_mailbox = Maildir/ inet_interfaces = loopback-only mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-mail-stack-delivery.conf -m "${EXTENSION}" mailbox_size_limit = 0 mailman_destination_recipient_limit = 1 mydestination = dur, dur.bounceme.net, localhost.bounceme.net, localhost myhostname = dur.bounceme.net mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 readme_directory = no recipient_delimiter = + relay_domains = lists.dur.bounceme.net relay_transport = relay relayhost = smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtp_use_tls = yes smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_path = private/dovecot-auth smtpd_sasl_security_options = noanonymous smtpd_sasl_type = dovecot smtpd_tls_auth_only = yes smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key smtpd_tls_mandatory_ciphers = medium smtpd_tls_mandatory_protocols = SSLv3, TLSv1 smtpd_tls_received_header = yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes tls_random_source = dev:/dev/urandom transport_maps = hash:/etc/postfix/transport root@dur:~# root@dur:~# tail /var/log/mail.log Aug 28 02:05:15 dur postfix/smtpd[20326]: connect from localhost[127.0.0.1] Aug 28 02:06:10 dur postfix/smtpd[20326]: warning: hash:/var/lib/mailman/data/aliases is unavailable. open database /var/lib/mailman/data/aliases.db: No such file or directory Aug 28 02:06:10 dur postfix/smtpd[20326]: warning: hash:/var/lib/mailman/data/aliases lookup error for "thufir@localhost" Aug 28 02:06:10 dur postfix/smtpd[20326]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <thufir@localhost>: Temporary lookup failure; from=<[email protected]> to=<thufir@localhost> proto=ESMTP helo=<fqdn_test> Aug 28 02:06:23 dur postfix/smtpd[20326]: warning: hash:/var/lib/mailman/data/aliases is unavailable. open database /var/lib/mailman/data/aliases.db: No such file or directory Aug 28 02:06:23 dur postfix/smtpd[20326]: warning: hash:/var/lib/mailman/data/aliases lookup error for "[email protected]" Aug 28 02:06:23 dur postfix/smtpd[20326]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <[email protected]>: Temporary lookup failure; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<fqdn_test> Aug 28 02:06:28 dur postfix/smtpd[20326]: disconnect from localhost[127.0.0.1] Aug 28 02:06:49 dur dovecot: pop3-login: Login: user=<thufir>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=20338, TLS Aug 28 02:06:49 dur dovecot: pop3(thufir): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0 root@dur:~# The manual page is here.

    Read the article

  • ssL HTTPS for windows mobile 6::unable to read transport connection

    - by Santhosh
    Hi am trying Https ssl connection in my C# application...i am getting "Unable to read transport connection" for the line WebResponse response = (HttpWebResponse)request.GetResponse(); I am forcing Certificate to be accepted ServicePointManager.CertificatePolicy = new MyPolicy(); public class MyPolicy : ICertificatePolicy { public bool CheckValidationResult(ServicePoint sp, X509Certificate cert, WebRequest req, int problem) { return true; } } Working fine in WM5 may i plz know the wat is goin wrong?plz thanks in advance

    Read the article

  • Git Transport Error during push operation?

    - by CitadelCSAlum
    I am using Git Version Control witht he JGit Plugin for the eclipse IDE. when I changed the location of my repo, and when to push to the new repository. I am receiving the following error message. Cant connect to any repository: git+ssh/username@remoteIPAddressgoeshere/srv/wma/git Transport error occured during push operation: Java.IOException: Channel is Broken)

    Read the article

  • Transport Codes in OSB

    - by hakish
    hi, i am getting this 2 Internal Server Error utf-8 http:http-response-code500 What does the transport response code 2 mean? I have seen many others as well, Can someone tell me what they mean?

    Read the article

  • secure data transport between web server and database server

    - by atypicalgeek
    I'm planning on provisioning a web server and database server in a server farm environment. They will be in the same network but not in the same domain, both windows server 2008 and the database server is sql server 2008. My question being, what is the best way to secure data in transport between the servers? I've looked into IPSEC and SSL but not sure how to go about implementing either.

    Read the article

  • Finding edge and corner values of an image in matlab

    - by James
    Hi, this problem links to two other questions i've asked on here. I am tracing the outline of an image and plotting this to a dxf file. I would like to use the bwboundaries function to find the coordinates of the edges of the image, find the corner coordinates using the cornermetric function and then remove any edge coordinates that are not a corner. The important thing I need to be able to do is keep the order of the corner elements obtained from bwboundaries, so that the section traces properly. The dxf function I have that draws from the coordinates draws lines between coordinates that are next to each other, so the line has to be drawn "around" the section rather than straight between the corner points. The reason I am doing this is because there are less coordinates obtained this way, so it is easier to amend the dxf file (as there are less points to manipulate). The code I have so far is: %# Shape to be traced bw = zeros(200); bw(20:40,20:180) = 1; bw(20:180,90:110) = 1; bw(140:180,20:185) = 1; %# Boundary Finding Section [Boundary] = bwboundaries(bw); %Traces the boundary of each section figure, imshow(bw); hold on; colors=['b' 'g' 'r' 'c' 'm' 'y']; for k=1:length(Boundary) perim = Boundary{k}; %Obtains perimeter coordinates (as a 2D matrix) from the cell array cidx = mod(k,length(colors))+1;% Obtains colours for the plot plot(perim(:,2), perim(:,1),... colors(cidx),'LineWidth',2); end Coordmat = cell2mat(Boundary) %Converts the traced regions to a matrix X = Coordmat(:,1) Y = Coordmat(:,2) % This gives the edge coordinates in matrix form %% Corner Finding Section (from Jonas' answer to a previous question %# get corners cornerProbability = cornermetric(bw); cornerIdx = find(cornerProbability==max(cornerProbability(:))); %# Label the image. bwlabel puts 1 for the first feature, 2 for the second, etc. %# Since concave corners are placed just outside the feature, grow the features %# a little before labeling bw2 = imdilate(bw,ones(3)); labeledImage = bwlabel(bw2); %# read the feature number associated with the corner cornerLabels = labeledImage(cornerIdx); %# find all corners that are associated with feature 1 corners_1 = cornerIdx(cornerLabels==1) [Xcorners, Ycorners] = ind2sub(200,corners_1) % Convert subscripts The code I have is, to give a matrix Xfin for the final x coordinates (which are on the edge AND at a corner. Xfin = zeros(length(X),1) for i = Xcorners XFin(i) = Xcorners if i~= Xcorners XFin(i) = [] end end However, this does not work correctly, because the values in the solution are sorted into order, and only one of each value remains. As I said, I would like the corner elements to be in the same order as obtained from bwboundaries, to allow the image to trace properly. Thanks

    Read the article

  • Drawing Directed Acyclic Graphs: Minimizing edge crossing?

    - by Robert Fraser
    Laying out the verticies in a DAG in a tree form (i.e. verticies with no in-edges on top, verticies dependent only on those on the next level, etc.) is rather simple without graph drawing algorithms such as Efficient Sugimiya. However, is there a simple algorithm to do this that minimizes edge crossing? (For some graphs, it may be impossible to completely eliminate edge crossing.) A picture says a thousand words, so is there an algorithm that would suggest: instead of: EDIT: As the picture suggests, a vertex's inputs are always on top and outputs are always below, which is another barrier to just pasting in an existing layout algorithm.

    Read the article

  • Matlab - Propagate unit vectors on to the edge of shape boundaries

    - by Graham
    Hi I have a set of unit vectors which I want to propagate on to the edge of shape boundary defined by a binary image. The shape boundary is defined by a 1px wide white edge. I also have the coordinates of these points stored in a 2 row by n column matrix. The shape forms a concave boundary with no holes within itself made of around 2500 points. What would be the best method to do this? Are there some sort of ray tracing algorithms that could be used? Or would it be a case of taking the unit vector and multiplying it by a scalar and testing after multiplication if the end point of the vector is outside the shape boundary. When the end point of the unit vector is outside the shape, just find the point of intersection? Thank you very much in advance for any help!

    Read the article

  • Twin edges - Half edge data structure

    - by Pradeep Kumar
    I have implemented a Half-edge data structure for loading 3d objects. I find that the part of assigning twin/pair edges takes the longest computation time (especially for objects which have hundreds of thousands half edges). The reason is that I use nested loops to accomplish this. Is there a simpler and efficient way of doing this? Below is the code which I've written. HE is the half-edge data structure. hearr is a vector containing all the half edges. vert is the starting vertex and end is the ending vertex. Thanks!! HE *e1,*e2; for(size_t i=0;i<hearr.size();i++){ e1=hearr[i]; for(size_t j=1;j<hearr.size();j++){ e2=hearr[j]; if((e1->vert==e2->end)&&(e2->vert==e1->end)){ e1->twin=e2; e2->twin=e1; } } }

    Read the article

  • creating objects from trivial graph format text file. java. dijkstra algorithm.

    - by user560084
    i want to create objects, vertex and edge, from trivial graph format txt file. one of programmers here suggested that i use trivial graph format to store data for dijkstra algorithm. the problem is that at the moment all the information, e.g., weight, links, is in the sourcecode. i want to have a separate text file for that and read it into the program. i thought about using a code for scanning through the text file by using scanner. but i am not quite sure how to create different objects from the same file. could i have some help please? the file is v0 Harrisburg v1 Baltimore v2 Washington v3 Philadelphia v4 Binghamton v5 Allentown v6 New York # v0 v1 79.83 v0 v5 81.15 v1 v0 79.75 v1 v2 39.42 v1 v3 103.00 v2 v1 38.65 v3 v1 102.53 v3 v5 61.44 v3 v6 96.79 v4 v5 133.04 v5 v0 81.77 v5 v3 62.05 v5 v4 134.47 v5 v6 91.63 v6 v3 97.24 v6 v5 87.94 and the dijkstra algorithm code is Downloaded from: http://en.literateprograms.org/Special:Downloadcode/Dijkstra%27s_algorithm_%28Java%29 */ import java.util.PriorityQueue; import java.util.List; import java.util.ArrayList; import java.util.Collections; class Vertex implements Comparable<Vertex> { public final String name; public Edge[] adjacencies; public double minDistance = Double.POSITIVE_INFINITY; public Vertex previous; public Vertex(String argName) { name = argName; } public String toString() { return name; } public int compareTo(Vertex other) { return Double.compare(minDistance, other.minDistance); } } class Edge { public final Vertex target; public final double weight; public Edge(Vertex argTarget, double argWeight) { target = argTarget; weight = argWeight; } } public class Dijkstra { public static void computePaths(Vertex source) { source.minDistance = 0.; PriorityQueue<Vertex> vertexQueue = new PriorityQueue<Vertex>(); vertexQueue.add(source); while (!vertexQueue.isEmpty()) { Vertex u = vertexQueue.poll(); // Visit each edge exiting u for (Edge e : u.adjacencies) { Vertex v = e.target; double weight = e.weight; double distanceThroughU = u.minDistance + weight; if (distanceThroughU < v.minDistance) { vertexQueue.remove(v); v.minDistance = distanceThroughU ; v.previous = u; vertexQueue.add(v); } } } } public static List<Vertex> getShortestPathTo(Vertex target) { List<Vertex> path = new ArrayList<Vertex>(); for (Vertex vertex = target; vertex != null; vertex = vertex.previous) path.add(vertex); Collections.reverse(path); return path; } public static void main(String[] args) { Vertex v0 = new Vertex("Nottinghill_Gate"); Vertex v1 = new Vertex("High_Street_kensignton"); Vertex v2 = new Vertex("Glouchester_Road"); Vertex v3 = new Vertex("South_Kensignton"); Vertex v4 = new Vertex("Sloane_Square"); Vertex v5 = new Vertex("Victoria"); Vertex v6 = new Vertex("Westminster"); v0.adjacencies = new Edge[]{new Edge(v1, 79.83), new Edge(v6, 97.24)}; v1.adjacencies = new Edge[]{new Edge(v2, 39.42), new Edge(v0, 79.83)}; v2.adjacencies = new Edge[]{new Edge(v3, 38.65), new Edge(v1, 39.42)}; v3.adjacencies = new Edge[]{new Edge(v4, 102.53), new Edge(v2, 38.65)}; v4.adjacencies = new Edge[]{new Edge(v5, 133.04), new Edge(v3, 102.53)}; v5.adjacencies = new Edge[]{new Edge(v6, 81.77), new Edge(v4, 133.04)}; v6.adjacencies = new Edge[]{new Edge(v0, 97.24), new Edge(v5, 81.77)}; Vertex[] vertices = { v0, v1, v2, v3, v4, v5, v6 }; computePaths(v0); for (Vertex v : vertices) { System.out.println("Distance to " + v + ": " + v.minDistance); List<Vertex> path = getShortestPathTo(v); System.out.println("Path: " + path); } } } and the code for scanning file is import java.util.Scanner; import java.io.File; import java.io.FileNotFoundException; public class DataScanner1 { //private int total = 0; //private int distance = 0; private String vector; private String stations; private double [] Edge = new double []; /*public int getTotal(){ return total; } */ /* public void getMenuInput(){ KeyboardInput in = new KeyboardInput; System.out.println("Enter the destination? "); String val = in.readString(); return val; } */ public void readFile(String fileName) { try { Scanner scanner = new Scanner(new File(fileName)); scanner.useDelimiter (System.getProperty("line.separator")); while (scanner.hasNext()) { parseLine(scanner.next()); } scanner.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } } public void parseLine(String line) { Scanner lineScanner = new Scanner(line); lineScanner.useDelimiter("\\s*,\\s*"); vector = lineScanner.next(); stations = lineScanner.next(); System.out.println("The current station is " + vector + " and the destination to the next station is " + stations + "."); //total += distance; //System.out.println("The total distance is " + total); } public static void main(String[] args) { /* if (args.length != 1) { System.err.println("usage: java TextScanner2" + "file location"); System.exit(0); } */ DataScanner1 scanner = new DataScanner1(); scanner.readFile(args[0]); //int total =+ distance; //System.out.println(""); //System.out.println("The total distance is " + scanner.getTotal()); } }

    Read the article

  • BFS Shortest Path: Edge weight either 1 or 2

    - by Hackster
    I am trying to implement a shortest path algorithm using BFS. That is I am trying to find the shortest path from a specified vertex to every other vertex. However, its a special case where all edge weights are either 1 or 2. I know it could be done with Dijkstra's algorithm but I must use Breadth First Search. So far I have a working version of BFS that searches first for a vertex connected with an edge of weight 1. If it cannot find it, then returns a vertex connected with an edge of weight 2. After thinking about it, this is not the correct way to find the shortest path. The problem is I cannot think of any reasoning why BFS would work with weights 1 or 2, as opposed to any weight. Here is the code: public void addEdge(int start, int end, int weight) { adjMat[start][end] = 1; adjMat[end][start] = 1; edge_weight[start][end] = weight; edge_weight[end][start] = weight; } // ------------------------------------------------------------- public void bfs() // breadth-first search { // begin at vertex 0 vertexList[0].wasVisited = true; // mark it displayVertex(0); // display it theQueue.insert(0); // insert at tail int v2; while( !theQueue.isEmpty() ) // until queue empty, { int v1 = theQueue.remove(); // remove vertex at head // until it has no unvisited neighbors while( (v2=getAdjUnvisitedVertex(v1)) != -1 ){// get one, vertexList[v2].wasVisited = true; // mark it displayVertex(v2); // display it theQueue.insert(v2); // insert it } } // end while(queue not empty) // queue is empty, so we're done for(int j=0; j<nVerts; j++) // reset flags vertexList[j].wasVisited = false; } // end bfs() // ------------------------------------------------------------- // returns an unvisited vertex adj to v -- ****WITH WEIGHT 1**** public int getAdjUnvisitedVertex(int v) { for (int j = 0; j < nVerts; j++) if (adjMat[v][j] == 1 && vertexList[j].wasVisited == false && edge_weight[v][j] == 1){ //System.out.println("Vertex found with 1:"+ vertexList[j].label); return j; } for (int k = 0; k < nVerts; k++) if (adjMat[v][k] == 1 && vertexList[k].wasVisited == false && edge_weight[v][k] == 2){ //System.out.println("Vertex found with 2:"+vertexList[k].label); return k; } return -1; } // end getAdjUnvisitedVertex() // ------------------------------------------------------------- } //////////////////////////////////////////////////////////////// public class BFS{ public static void main(String[] args) { Graph theGraph = new Graph(); theGraph.addVertex('A'); // 0 (start for bfs) theGraph.addVertex('B'); // 1 theGraph.addVertex('C'); // 2 theGraph.addEdge(0, 1,2); // AB theGraph.addEdge(1, 2,1); // BC theGraph.addEdge(2, 0,1); // AD System.out.print("Visits: "); theGraph.bfs(); // breadth-first search System.out.println(); } // end main() } The problem then is, that I don't know why BFS can work for the shortest path problem with edges of weight 1 or 2 as opposed to any edges of any weight. Any help is appreciated. Thanks!

    Read the article

  • WSO2 ESB on Carbon 4.2 - Did not find the desired phase 'Transport' while deploying handler 'POXSecurityHandler'

    - by user3385500
    I'm new to WSO2 ESB and would like to try it out for some external integrations. I've installed the WSO2 Carbon 4.2 server and installed the ESB feature 4.8.1. After a restart, I'm getting some errors as below. Any tips or suggestions would be gratefully accepted. Thanks. [2014-03-06 10:01:08,521] INFO {org.wso2.carbon.mediation.initializer.ServiceBusInitializer} - Initializing Apache Synapse... [2014-03-06 10:01:08,525] FATAL {org.wso2.carbon.mediation.initializer.ServiceBusInitializer} - Couldn't initialize the ESB... org.apache.synapse.SynapseException: The synapse.xml location ././ ./repository/deployment/server/synapse-configs /default doesn't exist at org.apache.synapse.SynapseControllerFactory.handleFatal(SynapseControllerFactory.java:121) at org.apache.synapse.SynapseControllerFactory.validatePath(SynapseControllerFactory.java:113) at org.apache.synapse.SynapseControllerFactory.validate(SynapseControllerFactory.java:88) at org.apache.synapse.SynapseControllerFactory.createSynapseController(SynapseControllerFactory.java:44) at org.apache.synapse.ServerManager.init(ServerManager.java:102) at org.wso2.carbon.mediation.initializer.ServiceBusInitializer.initESB(ServiceBusInitializer.java:423) at org.wso2.carbon.mediation.initializer.ServiceBusInitializer.activate(ServiceBusInitializer.java:182) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) ... ... ... [2014-03-06 10:01:08,531] INFO {org.wso2.carbon.rule.kernel.internal.ds.RuleEngineConfigDS} - Successfully registered the Rule Config service [2014-03-06 10:01:08,553] ERROR {org.wso2.carbon.security.internal.SecurityMgtServiceComponent} - Failed to activate SecurityMgtServiceComponent org.apache.axis2.phaseresolver.PhaseException: Did not find the desired phase 'Transport' while deploying handler 'POXSecurityHandler'. at org.apache.axis2.phaseresolver.PhaseHolder.addHandler(PhaseHolder.java:75) at org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToFlow(PhaseResolver.java:68) at org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToOperation(PhaseResolver.java:104) at org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToOperation(PhaseResolver.java:110) at org.apache.axis2.description.AxisOperation.onEngage(AxisOperation.java:152) at org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:478) at org.apache.axis2.description.AxisService.onEngage(AxisService.java:827) at org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:478) at org.apache.axis2.description.AxisServiceGroup.onEngage(AxisServiceGroup.java:134)

    Read the article

  • Replace low level web-service reference call transport with custom one

    - by hoodoos
    I'm not sure if title sounds right actually, so I will give more explanation here. I will begin from very beginning :) I'm using c# and .net for my development. I have an application that makes requests to some soap web-service and for each user request it produces 3 to 10 requests for web-service, they should all run async to finish in one time, so I use Async method of the web-service generated reference and then wait for result on callback. But it seems like it starts a thread (or takes it from pool) for every async call I make, so if I have 10 clients I got to spawn 30 to 100 threads and it sounds terrible even for my 16 cores server :) So i wanted to replace low level transport implementation with my own which uses non-blocking sockets and can handle at least 50 sockets run parallel in one thread with not much overhead. But I actually dunno where to put my override best. I analyzed System.Web.Services.Protocols.SoapHttpClientProtocol class and see that it has some GetWebRequest method which I actually could use. If only I could somehow interupt the object it creates and get a http request with all headers and body from there and then send it with my own sockets.. Any ideas what approach to use? Or maybe there's something built in the framework I can use?

    Read the article

  • Matlab - Propagate points orthogonally on to the edge of shape boundaries

    - by Graham
    Hi I have a set of points which I want to propagate on to the edge of shape boundary defined by a binary image. The shape boundary is defined by a 1px wide white edge. I also have the coordinates of these points stored in a 2 row by n column matrix. The shape forms a concave boundary with no holes within itself made of around 2500 points. I want to cast a ray from each point from the set of points in an orthogonal direction and detect at which point it intersects the shape boundary at. What would be the best method to do this? Are there some sort of ray tracing algorithms that could be used? Or would it be a case of taking orthogonal unit vector and multiplying it by a scalar and testing after multiplication if the end point of the vector is outside the shape boundary. When the end point of the unit vector is outside the shape, just find the point of intersection? Thank you very much in advance for any help!

    Read the article

  • Unable to read data from the transport connection: the connection was closed

    - by webdreamer
    The exception is Remoting Exception - Authentication Failure. The detailed message says "Unable to read data from the transport connection: the connection was closed." I'm having trouble with creating two simple servers that can comunicate as remote objects in C#. ServerInfo is just a class I created that holds the IP and Port and can give back the address. It works fine, as I used it before, and I've debugged it. Also the server is starting just fine, no exception is thrown, and the channel is registered without problems. I'm using Forms to do the interfaces, and call some of the methods on the server, but didn't find any problems in passing the parameters from the FormsApplication to the server when debugging. All seems fine in that chapter. public ChordServerProgram() { RemotingServices.Marshal(this, "PADIBook"); nodeInt = 0; } public void startServer() { try { serverChannel = new TcpChannel(serverInfo.Port); ChannelServices.RegisterChannel(serverChannel, true); } catch (Exception e) { Console.WriteLine(e.ToString()); } } I run two instances of this program. Then startNode is called on one of the instances of the application. The port is fine, the address generated is fine as well. As you can see, I'm using the IP for localhost, since this server is just for testing purposes. public void startNode(String portStr) { IPAddress address = IPAddress.Parse("127.0.0.1"); Int32 port = Int32.Parse(portStr); serverInfo = new ServerInfo(address, port); startServer(); //node = new ChordNode(serverInfo,this); } Then, in the other istance, through the interface again, I call another startNode method, giving it a seed server to get information from. This is where it goes wrong. When it calls the method on the seedServer proxy it just got, a RemotingException is thrown, due to an authentication failure. (The parameter I'll want to get is the node, I'm just using the int to make sure the ChordNode class has nothing to do with this error.) public void startNode(String portStr, String seedStr) { IPAddress address = IPAddress.Parse("127.0.0.1"); Int32 port = Int32.Parse(portStr); serverInfo = new ServerInfo(address, port); IPAddress addressSeed = IPAddress.Parse("127.0.0.1"); Int32 portSeed = Int32.Parse(seedStr); ServerInfo seedInfo = new ServerInfo(addressSeed, portSeed); startServer(); ChordServerProgram seedServer = (ChordServerProgram)Activator.GetObject(typeof(ChordServerProgram), seedInfo.GetFullAddress()); // node = new ChordNode(serverInfo,this); int seedNode = seedServer.nodeInt; // node.chordJoin(seedNode.self); }

    Read the article

  • Compatibility of ESX 4 and LTO 3 with LSI2032 Dell Power Edge

    - by dbaur
    Hello, does anybody know something about the compatibility of an LTO 3 Tapedrive (PV HH LTO 3 400GB) attached to an LSI2032 SCSI-Controller? These devices are added to an Dell PowerEdge T610 Server which is listed in the certified Compatibility Guide. I can`t find any information for this controller and this tapdevice. Or are they automaticly compatible because they are options for an compatible Server? greetings Dennis

    Read the article

  • Apple iOS Apps and caching at the edge proxy

    - by Matthew Iselin
    Our network contains a growing number of iOS devices, all of which with very similar configurations. All Internet access is via a transparent proxy. We've found that iOS updates and some free apps cache fine on the proxy, but any paid apps fail to cache properly (as they seem to be encrypted to the Apple ID (?)). I'm just wondering if there's any way forward with this where we could cache the paid apps so that they are purchased n times, but downloaded from the proxy cache instead of from the Internet each time. Bandwidth caps aside, the download direct from the Internet slows everything down for everyone, regardless of fairness queueing and related 'fixes'. I know this is quite unlikely, but I figured there's nothing to lose and everything to gain before I look into other solutions (eg, QoS).

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >