My PriorityQueue doesn't seem to sort it's elements correctly ....

Hi, here is my semi-complete program, I have removed the methods that were irrelevant to make things simple. The program is supposed to represent Graphs, and minimal spanning trees. I first have to put edges in a priority queue of type : PQEntry (Below), which are to be sorted by their 'distance'. I have not included the interfaces as they weren't necessary here (all methods are already implemented). There is no compile error, but for example when I run the program, and enter 'mst' (it shoud print the contents of the Priority Queue in the order of their distances), it puts the first few elements in order but fails to do so on the remaining elements. below is a sample run.
graph> init
graph> mst
[(4 5) = 51
, (12 14) = 51
, (7 9) = 70
, (10 11) = 60
, (8 9) = 75
, (7 8) = 100
, (3 4) = 90
, (9 10) = 95
, (4 7) = 151
, (15 16) = 110
, (5 6) = 151
, (11 5) = 600
, (11 12) = 151
, (11 13) = 200
, (12 13) = 100
, (3 7) = 300
, (13 15) = 200
, (13 16) = 200
, (14 15) = 170
, (10 4) = 400
, (14 16) = 251
graph>
class PQEntry implements Comparable {
     int node1 , node2 , distance;
     public PQEntry(int node1 , int node2 , int distance) {
          this.node1 = node1;
          this.node2 = node2;
          this.distance = distance;
     public int getPriority () {
          return distance;
     public String toString() {
          String output = "(" + node1 + " " + node2 + ")" + " = " + distance + "\n" ;
          return output;
     public int compareTo(Object o) {
          if(o instanceof PQEntry){
               if (getPriority() > ((PQEntry) o).getPriority()) {
                    return 1;
               } else if(getPriority() == ((PQEntry) o).getPriority()) {
                    return 0;
               } else {
                    return -1;
          } else {
               throw new IllegalArgumentException("o must be an instance of PQEntry");
import java.io.*;
import java.util.*;
class Main {
     final static String PROMPT = "graph> ";
     static private Graph myGraph = new GraphImp(51);
     static void initGraph() {
     myGraph.addEdge(3, 4, 90);
     myGraph.addEdge(3, 7, 300);
     myGraph.addEdge(4, 7, 151);
     myGraph.addEdge(4, 5, 51);
     myGraph.addEdge(5, 6, 151);
     myGraph.addEdge(7, 8, 100);
     myGraph.addEdge(7, 9, 70);
     myGraph.addEdge(8, 9, 75);
     myGraph.addEdge(9, 10, 95);
     myGraph.addEdge(10, 4, 400);
     myGraph.addEdge(10, 11, 60);
     myGraph.addEdge(11, 5, 600);
     myGraph.addEdge(11, 12, 151);
     myGraph.addEdge(11, 13, 200);
     myGraph.addEdge(12, 13, 100);
     myGraph.addEdge(12, 14, 51);
     myGraph.addEdge(13, 16, 200);
     myGraph.addEdge(13, 15, 200);
     myGraph.addEdge(14, 15, 170);
     myGraph.addEdge(14, 16, 251);
     myGraph.addEdge(15, 16, 110);
     public static void main(String[] args) {
          Scanner in = new Scanner(System.in);
          String[] input;
          String line;
          do {
               System.out.print(PROMPT);
               input = in.nextLine().split(" ");
               if (input[0].equalsIgnoreCase("add")) {
                    if(input.length == 4){
                         if(!input[1].equals(input[2])) {
                              myGraph.addEdge(Integer.parseInt(input[1]), Integer.parseInt(input[2]), Integer.parseInt(input[3]));
                         } else {
                              System.out.println("Error! A node cannot connect to itself");
                    } else {
                         System.out.println("Incorrect command format, enter 3 seperate integers after 'add'");
               } else if(input[0].equalsIgnoreCase("del")) {
                    if(input.length == 3) {
                         myGraph.deleteEdge(Integer.parseInt(input[1]), Integer.parseInt(input[2]));     
                    } else {
                         System.out.println("Incorrect command format, enter two seperate intgers after 'del'");
               } else if(input[0].equalsIgnoreCase("help") && input.length == 1) {
                    System.out.println("The available commands are: help, quit, add i j l, del i j, where 'i' is the source node, 'j' is the target node and the 'l' is the length of the edge between them");
               } else if(input[0].equalsIgnoreCase("quit") && input.length == 1) {
                    System.exit(0);
               } else if(input[0].equalsIgnoreCase("mst") && input.length == 1) {
                    int[][] tempMatrix = myGraph.getMatrix();
                    PriorityQueue<PQEntry> edges = new PriorityQueue<PQEntry>(51);
                    List<PQEntry> sortedEdges = new LinkedList<PQEntry>();
                    for(int i = 1; i < 51; i++) {
                         for(int j = 1; j < 51; j++){
                              if (tempMatrix[i][j] > 0) {
                                        edges.add(new PQEntry(i, j, tempMatrix[i][j]));
                         sortedEdges.addAll(edges);
                    System.out.println(sortedEdges);
               } else if(input[0].equalsIgnoreCase("print") && input.length == 1) {
                    System.out.println(myGraph.toString());
               } else if(input[0].equalsIgnoreCase("init") && input.length == 1) {
                    initGraph();
               } else {
                    System.out.println("unknown Command, enter help for lsit of valid commands");
          } while(true);
import java.util.*;
class GraphImp implements Graph {
     //contains a two-dimensional array to hold the start vertex, end vertex
     //and the distance between the two verteces.
     private int [][] matrix;
          //constructor, sets the bounds of the two-dimensional array
          public GraphImp(int size) {
               matrix = new int[size][size];
          //returns the two-dimensional array to the method calling it
          public int[][] getMatrix() {
               return matrix;
          //this method first checks whether the two nodes are within the
          //acceptable range and gives an erro if not. It then checks whether an edge exists between the nodes
          //if an edge already exists it gives the user an error message, otherwise adds the edge
          //to the two-dimensional array at the appropriate position.
          public void addEdge(int node1 , int node2 , int distance) {
               if(node1 > 0 || node1 < 51 || node2 > 0 || node2 < 51) {
                    if(matrix[node1][node2] == 0 && matrix[node2][node1] == 0) {
                         matrix[node1][node2] = distance;
                    } else {
                         System.out.println("Error! An edge already exists between the two nodes");
               } else {
                    System.out.println("Error! Atleast one of the nodes are out of range, please enter within the range 1 - 51");
          //This method first checks whether the two nodes are within the acceptable range
          //if they are not an error message is given, otherwise it checks whether an edge exists
          //between the nodes. If there already exists one is prints an error, otherwise it removes
          //the corresponding edge.
          public void deleteEdge(int node1 , int node2) {
               if(node1 > 0 || node2 > 0 || node1 < 51 || node2 < 51) {
                    if(matrix[node1][node2] != 0 || matrix[node2][node1] != 0) {
                         matrix[node1][node2] = 0;
                         matrix[node2][node1] = 0;
                    } else {
                         System.out.println("Error! No such edge exists to delete");
               } else {
                    System.out.println("Error! Atleast one of the nodes are out of range, please enter within the range 1 - 51");
          //this method
          public String toString()
               String result = "";
               for(int j = 0; j < matrix[0].length; j++){
                    for(int i = 0; i < matrix[0].length; i++){
                         if (matrix[j] > 0){
                              result = result + "(" + j + "," + i + ")" + " = " + matrix[j][i] + "\n";
               return result;

msjamalan wrote:
Hi, here is my semi-complete program, I have removed the methods that were irrelevant to make things simple. The program is supposed to represent Graphs, and minimal spanning trees. I first have to put edges in a priority queue of type : PQEntry (Below), which are to be sorted by their 'distance'. I have not included the interfaces as they weren't necessary here (all methods are already implemented). There is no compile error, but for example when I run the program, and enter 'mst' (it shoud print the contents of the Priority Queue in the order of their distances), it puts the first few elements in order but fails to do so on the remaining elements. below is a sample run.AFAIK, a sorted priority queue sorts the output returned by the queue's poll method. So if you iterate through the entire queue via the poll() method, what is spit out should be sorted. If you just print the queue itself via println, you wan't see this sorting.
Also, when posting code here, please use code tags so that your code will retain its formatting and thus will be readable -- after all, your goal is to get as many people to read your post and understand your code as possible, right?
To do this, highlight your pasted code (please be sure that it is already formatted when you paste it into the forum; the code tags don't magically format unformatted code) and then press the code button, and your code will have tags.
Another way to do this is to manually place the tags into your code by placing the tag [cod&#101;] above your pasted code and the tag [cod&#101;] below your pasted code like so:
[cod&#101;]
  // your code goes here
  // notice how the top and bottom tags are different
[/cod&#101;]Much luck!

Similar Messages

  • Sorting doesn't seem to sort by name - why?

    Having successfully migrated from Aperture to Photos I was surprised to find that the sorting function is minimal and doesn't appear to work.  With 'Keep sorted by date' unselected my pictures do not sort by name.  The only thing I seem to be able to sort by name is the Album in which I keep my folders of pictures within Photos.
    Can anyone advise?
    Thanks!

    When you changed the folder setting for iTunes, you may have noticed at the top of the dialogue box that is was changing the settings for that folder only. For instance, I did my little test on a drive named "Video". When I called up the View Options, the box specifically said Video at the top. So I knew the change was only going to affect that folder.
    There is a box at the bottom to Use as Defaults, but it still only affects that folder. I can't see a way to make the option global, which means you have to mark folders one at a time to calculate the subfolder sizes. Probably intentional as it can really slow down the Finder's response time when it has to sit there and tally up the contents of every folder you open, or reopen.

  • TS1474 ive just bought a new ipod and used it on my gf's computer using my existing apple id. it doesn't seem to take across the songs correctly, even though i've permitted it for authorisation on this computer- any ideas please?

    Please can anyone help me with my problem as shwn in the title? thanks

    Try using the manual method of syncing. You can only sync music and vides from other than your one syncing computer if you use the manual method. The manual method is included here:
    iTunes: Syncing media content to iOS devices and iPod

  • Sold BT Infinity 2 but it doesn't seem to exist!

    Hi,
    Just wanted to see if anyone else has had a simliar problem to me and if so how you are going about dealing with it. So back in August I moved into a new house. I rang BT and said that I would like a phone line and also enquired as to what Broadband they could provide.
    So the woman in the sales centre informed me that I could have BT Infinity 2 with speeds of up to 76mbs! Brilliant. So I ordered this amazingly fast Broadband and also my phone line. I'm now in November nearly 3 months on from ordering this superfast broadband and I still don't have any broadband.
    I have had 4 or 5 engineers come out now. Basically the problem is that the exchange hasn't been set up for BT Infinity 2. 
    The latest update I had was can you wait for 3 weeks and we will do a review. When they did a 'Review' on Tuesday the outcome was can you wait another week and we will give you another update.
    There must be some sort of act that they are in breach of selling a service that isn't actually available? They don't seem to give me a decent answer ever. They seem to blame BT Openreach for all the problems. 
    Just wondered if anyone has had the same problem and what you did?
    Thanks
    Gareth

    Hi sorry for not replying to anyone. Not having the internet at home is obviously an issue. The battle with the BT Muppets is still ongoing and we still don't seem to be any closer.
    Says that it is all available. Think I'm up to just about 3 months now since ordering it. I've been told 3 dates in the last 2 weeks when the problem is supposed to have been resolved only to be let down every single time. I'm not due an update until December now though! 
    Just doesn't seem to be anyone at BT that knows what they are doing or able to give you a straight answer on exactly what is going on. 
    Do BT fine BT Openreach for delays? If so I would be interested to know how much they get!
    My issue has been moved onto a specific person now because I complained. But quite honestly that has made no difference whatsoever. Just like dealing with the normal bods on the normal line! 
    I would never go with BT again even if it is just because of the poor customer service and lack of updates. Everytime they say they are going to ring me they don't and then I have to end up chasing them all the time. 
    The only reason I don't want to cancel it now is because I'm 3 months down the line and if I cancel and go with someone else I get to join the back of the queue!
    BT BROADBAND AVAILABILITY CHECKER
    Telephone Number  on Exchange WEST MALLING is served by Cabinet 42
    Featured ProductsDownstream Line Rate(Mbps)Upstream Line Rate(Mbps)Downstream Range(Mbps)Availability Date  High Low High Low    
    FTTC Range A (Clean)
    80
    63.3
    20
    20
    Available
    FTTC Range B (Impacted)
    75.6
    50.5
    20
    16.3
    Available
    WBC ADSL 2+
    Up to 1
    1 to 3.5
    Available
    ADSL Max
    Up to 1
    0.75 to 2.5
    Available
    WBC Fixed Rate
    0.5
    Available
    Fixed Rate
    0.5
    Available
    Other Offerings
    Fibre Multicast
    Available
    Copper Multicast
    Available
    For all ADSL and WBC Fibre to the Cabinet (FTTC) services, the stable line rate will be determined during the first 10 days of service usage.
    For FTTC Ranges A and B, the term "Clean" relates to a line which is free from any wiring issues (e.g. Bridge Taps) and/or Copper line conditions, and the term "Impacted" relates to a line which may have wiring issues (e.g. Bridge Taps) and/or Copper line conditions.
    Throughput/download speeds will be less than line rates and can be affected by a number of factors within and external to BT's network, Communication Providers' networks and within customer premises.
    The Stop Sale date for Datastream is from 30-Jun-2012; the Formal Retirement date for Datastream is from 30-Jun-2014. The Stop Sale date for IPstream is from 30-Nov-2012; the Formal Retirement date for IPstream is from 30-Jun-2014.
    If you have already placed an order for Broadband and now wish to change to a new supplier, then you will need to cancel the existing order with your service provider or your new request will be rejected. If you do not know who the current Service Provider is, please contact your new Service Provider, who should be able to help you to resolve this issue.
    Note: If you decide to place an order for a WBC fibre product, an appointment may be required for an engineer to visit the end user's premises to supply the service.
    Please note that postcode and address check results are indicative only. Most accurate results can be obtained from a telephone number check.
    Thank you for your interest.

  • Something doesn't seem right with start-up

    Maybe I'm going mad but something doesn't seem right. When I start-up I get the usual chime, the power light comes on, I hear the drive whir a bit, the fans have a quick blow and the I get a black screen for about 30 seconds. After this the light goes out & the screen turns grey, then I get the grey sceen + apple and the 'wheel thing' followed by the blue screen and normal start-up. Perhaps this is normal, but I'm sure I never used to get the 30 second delay with the black screen and I used to go straight to grey if you see what I mean. Am I going mad or is the delay unusual??
    Neil

    I know it's bad form to reply to your own post but thought someone might be interested to hear how I've sorted this one out. Thought I'd try starting up in safe mode and running FSCK, but having never done this before wasn't quite sure what to expect! When it started up I just got page after page of 'techno-jargon' which didn't look good - especially when every line seem to have the word error in it - can't remember exactly what it said but each line had something with USB along with numbers and letters and an error message (yes - I know this isn't very clear but the memory's beginning to fail). Anyway because this wasn't looking too good I decided to reboot and unplug everything from my USB ports (including a 7 port USB 2 hub) and restart. Lo and behold problem sorted. Then plugged it back in again and tried again - back to original problem. However noticed that the LED on my graphics tablet wasn't lighting up so unplugged that from the hub, reinstalled the drivers and tried again. Now everything seems to be back to normal. The black screen on start-up lasts just a couple of seconds and we're back to the normal start-up time. Weird, but at least I can now sleep easy!
    Neil

  • Automatic album info doesn't seem to work

    Hi. I have the setting 'Automatically download missing album artwork' checked but itunes does seem to do this. I am on-line and logged into the itunes store. Example: I have Angie Stone Mahogany Soul Cd. When I import the cd it just imports tracks by number and not by title. When I add the title and artist myself the above auto info option still doesn't work. Only when I right click the track and 'Get Album Artwork' does it work!!
    This doesn't seem to be very 'automatic' and it works perfectly well in Windows media!!
    Please tell me what I need to do to sort this. Thanks

    It's white Kind of sad to have made that purchase not very long ago only to find it is outdated, and in an Apple store at that. Oh well.
    Thanks for responding.

  • The iTunes "buy" button doesn't seem to be working. I click it and nothing happens. Anyone know why? Thanks.

    The iTunes "buy" button doesn't seem to be working. I click it and nothing happens. Anyone know why? Thanks.

    Apple made some sort of programming change on 12.26.12 to their iTunes system that suddenly made the Buy button non-functional specifically in the directly-out-of-the-box Snow Leopard (10.6.3). [I had Leopard, same as you, 10.5.8, and that was still working then. I installed Snow Leopard a couple of days ago to my MacBook, and discovered the Buy Button didn't work.
    First step: Pull down "Software Update" from the Apple menu (that annoying thing we always ignore.) If you're using Snow Leopard 10.6.3, it'll upgrade you for free to 10.6.8, and that should solve your iTunes problem. (I don't know if there are any upgrades for 10.5.8, but unlike the other ungodly system upgrades, Snow Leopard is only $20. Because Apple is growing increasingly stupid, you can't buy it online--you have to call customer care.)
    Hope this helps. Let me know if it does.

  • Doesn't seem to be including all songs in shuffle. Repeats same songs

    When in shuffle mode, doesn't seem to include all songs in the shuffle.  It repeats the same songs.

    Well, seems to me that if the computer is reading other CDs, the lens should not be a problem? If you really think it would help though, I suppose I'll try it.
    Since I posted I've tried leveling the computer because I thought that might be an issue, but I think I can rule that out.
    Could it be that I need to download some sort of driver update? I don't know when I purchased those Memorex CD-Rs that I'd been using and that worked, but the ones I just bought look a little different, so maybe they are also more advanced in some way?
    Maybe 3 or 4 discs that I put in (out of maybe 50) actually did show up on the desktop and when I tried to burn them, started burning as normal. But then about 20 seconds into it, it said something about it not being able to burn.
    I have also run Disk First Aid, which told me that there is an invalid PEOF. Could this be creating the problem?
    Thanks to anyone who can shed some light...

  • HT4889 Is it possible to use the migration assistant to transfer only some documents and data? For example, I was to transfer my music, but not my word documents. There doesn't seem to be any options to customise what you are transferring - its all or not

    Is it possible to use the migration assistant to transfer only some documents and data? For example, I was to transfer my music, but not my word documents. There doesn't seem to be any options to customise what you are transferring - its all or nothing

    LBraidwood wrote:
    Is it possible to use the migration assistant to transfer only some documents and data? For example, I was to transfer my music, but not my word documents. There doesn't seem to be any options to customise what you are transferring - its all or nothing
    Yes, that's why I recommend one have more than TimeMachine as a backup because if certain files or folders are corrupted on the TM drive, your not logging into your migrated user account or not be able to transfer it what so ever.
    Then it's a REAL PAIN and costs $99 to bit read the TM drive to get the files out, then it's mess to go through and sort all the empty placeholders from the real files as TM doesn't save duplicates in each state, just uses the previous state's copy if there are no changes.
    If you create the same named user account on the new machine, and simply transfer files via a USB thumb drive and place say music contents into the Music folder, then it will work too.
    Look into making clones of your boot drive, the benefit here is it's bootable, you can access the drive directly to pick and choose files, run the computer just like before etc.
    Most commonly used backup methods explained

  • Mini dvi to s-video/composite adapter doesn't seem to work?

    basically i'm trying to hook my rather new 2.53 ghz mac mini to my tv, which basically has rca inputs. so, having seen several laptops hooked to this tv as simply as using an s-video to composite adapter, i figured it would be as simple as getting the mini dvi to composite adapter and i'd be good. well, for some reason this doesn't seem to do anything. the other weird thing is that when i hook the cable from the composite adapter to the tv, i get a buzz out of the speakers as the connection is being made. why is a video signal having anything to do with the audio? plugging my playstation 2 into the same input works fine. why the difference?

    Boece wrote:
    !http://images2.monoprice.com/productmediumimages/47241.jpg!
    +
    !http://images2.monoprice.com/productmediumimages/48501.jpg!
    That's the setup I've used. Works great for video and photos, but webpage text can be difficult to read.
    I used the yellow composite input rather than the s-video. My old tv is inside an “entertainment center” type tv stand and is so friggin heavy, it’s a pain in the axx to move, so I just used the composite plug on the front of my tv. Since the Mac mini is sitting in front of the tv it works great:-)
    http://discussions.apple.com/thread.jspa?threadID=2430645&tstart=0
    Message was edited by: James Press1

  • Need lightroom 4.4 asmac is 10.6.8 and not compatible with anything higher. Does this come with the creative cloud? Would really like a disc but that doesn't seem to happen anymore. Currently have cs4 and d7100 hence need 4.4 to open raw Any idea

    need lightroom 4.4 asmac is 10.6.8 and not compatible with anything higher. Does this come with the creative cloud? Would really like a disc but that doesn't seem to happen anymore. Currently have cs4 and d7100 hence need 4.4 to open raw Any ideas? Is this now customer service or does adobe have a customer service team . Site not user friendly. Thanks

    Graham Giles wrote:
    Have you seen this type of problem before? I think it could be a serious issue for anyone in a similar position.
    No; but then, I've not had occasion to use TDM. I've been using firerwire drives for over 10 years, both FW400 and FW800, with no issues except a bit of instability using a B&W G3 machine.
    TDM should be safe. Using cautious, manual copying of files from the Target machine to the Host machine should not result in unexpected loss of files or damage to the Target drive's directories. It should behave exactly the same as if it were an external (to the Host) firewire drive.
    •  I don't suppose there is anything I can do to 'put back' lost items from a separate Time Machine drive which has an up to date backup on it.
    There is probably a way to do that - seems to me that's one of the reasons for a Time Machine volume.
    On the other hand, if the Time Machine volume is rigidly linked to the now-absent OS on the original drive, there may be no way to effectively access the files in the TM archive.
    I know that using a cloned drive would work well in this instance.
    I have no experience with Time Machine, so perhaps someone who has will chime in with suggestions.
    With the machine in TDM with the other machine, have you tried running Disk Utility to see if you can effect repairs to the drive?

  • Wacom Tablet doesn't seem to work all of the time?

    I have a Wacom Intuos 3 tablet, not more than a year old. I recently installed it onto my Macbook Pro and it worked fine, but when I unplugged it and came back to work with it later, it doesn't seem to work. The mouse doesn't respond to where I click on the pad.
    So, I've reinstalled this a couple of times and was able to make it work perfectly, but today when I went back to work in photoshop, it doesn't seem to be responding again.
    Does anyone have any tips? I know that Leopard likes you to eject USB devices instead of just pulling them out of the slot, but I don't see anywhere to eject it.
    Does anyone know what's up?

    Downloaded a driver from website, tablet works now.

  • HT3235 I just bought a Micro-DVI to video adapter to try and hook my MacBook Pro 13" I bought mid 2009 to my old TV, the adapter doesn't seem to fit any of the connections, is this the right adapter?

    I just bought a Micro-DVI to video adapter to try and hook my MacBook Pro 13" that I bought in mid 2009 to my old TV (svideo), the adapter doesn't seem to fit any of the connections on my macBook pro, is right adapter?

    Shootist007 wrote:
    Apple doesn't offer a MDP to AV or componet connect . Only DVI and VGA. They also don't offer one to HDMI. You have to go aftermarket to get one to HDMI.
    Quite right, but as the OP does not have component or composite connections not important.
    To the OP, this does work, but is not the cheapest, and as it appears that Apple no longer sell an SVideo adaptor cable 3rd party it will have to be.

  • 1.burned a hole in my screen can I get this repaired?  2. Even though I have it set to open up to a blank screen, no web pages, my computer (safari) continuously opens with multiple safari sites open. It doesn't seem to matter what I do, it just reverts

    1. I burned a small hole in my screen, is that fixable/replaceable? 2. Even though I have my 15" MacBook Pro set to open to empty screen when I open Safari, it constantly opens multiple previous pages. It doesn't seem to matter what I do it just reverts back to opening multiple pages. Major security risk, my bank pages have popped back up after my computer has been shut down, account numbers and all. I took my computer to an Apple store and the genious there tols me...      "honey, you can't hold your laptop on your lap, that's the problem, it's getting too hot" he honestly said that. Could someone please help me? Thanks

    Apple doesn't call its portable machines 'notebooks' instead of 'laptops' for nothing - using a MacBook Pro in your lap can cause some burns on your skin, poor ventilation, etc. So use it on a hard flat surface - not your lap, pillows, bedclothes, etc.
    As for burning a hole in your screen, you'll have to revisit the Apple Store and see how much they would charge for a new screen. It's likely to be a bit expensive.
    And if you've Safari set to re-open tabs when you restart, you can disable this feature -> Safari-Preferences-General.
    Good luck,
    Clinton

  • How does Azure Compute Emulator (or the Azure one) determine if a role is web project or something else ("The Web Role in question doesn't seem to be a web application type project")?

    I'm not sure if this is F# specific or something else, but what could cause the following error message when trying to debug locally an Azure cloud service:
    The Web Role in question doesn't seem to be a web application type project.
    I added an empty F# web api Project to a solution (which adds Global.asax etc., I added an OWIN startup class Startup etc.) and then from an existing
    cloud service project I picked Roles and
    chose Add
    -> Web Role Project in solution, which finds the F# web project (its project type guids are 349C5851-65DF-11DA-9384-00065B846F21 and F2A71F9B-5D33-465A-A702-920D77279786),
    of which the first one seem to be exactly the GUID that defines a web application type.
    However, when I try to start the cloud project locally, I get the aforementioned error message. I have a C# Web Role project that will start when I remove the F# project. I also have F# worker
    role projects that start with the C# web role project if I remove this F# web role project. If I set the F# web project as a startup project,
    it starts and runs as one would expect, normally.
    Now, it makes me wonder if this is something with F# or could this error message appears in C# too, but I didn't find anything on Google. What kind of checks are there when starting the emulator and which one needs
    failing to prompt the aforementioned message? Can anyone shed light into this?
    Sudet ulvovat -- karavaani kulkee

    Sudet,
    Yeah you are right, the GUID mentioned seems to be correct and the first one i.e. {349C5851-65DF-11DA-9384-00065B846F21} means the web application project which compute emulator uses to determine while spawning up role instances.
    You might want to compare the csproj of your C# and F# web projects which might give some pointers.
    Are you able to run your F# web project locally in IIS? If yes then you will definitely be able to run it on azure so I will recommend to test it in IIS Express first.
    Here are some other tips which you can refer or see If you are yet to do those settings
    1. Turn on the IIS Express - You can do it by navigating to project properties
    2. Install Dependent ASP.NET NuGets / Web Api dependencies (If there are any missing), Reference System.Web assembly
    Also I will suggest to refer this nice article about how to create a F# web Api project
    http://blog.ploeh.dk/2013/08/23/how-to-create-a-pure-f-aspnet-web-api-project/
    Hope this helps you.
    Bhushan | http://www.passionatetechie.blogspot.com | http://twitter.com/BhushanGawale

Maybe you are looking for

  • External USB Drive (MAC OS Extended) Problem

    I had an NTFS formatted external USB2 drive which I have been trying to format as a MAC OS Extended (journaled) drive to use with my iMac. After partitoning it with disk utility using the MAC OS Extended partition scheme the drive will not mount and

  • Can I back up individual image files to a slideshow DVD created in Premiere Elements 4.0?

    I created a Premiere Elements 4.0 Project including 3 separate photo slideshows. The slideshows were created in Photoshop Elements 6.0 and imported into my Premiere Elements project. I was hoping that when burning the project to DVD, my image files w

  • TAXINJ Procedure (Conditon types need to be created)

    Hi Experts, Can anybody explain in detail about TAXINJ Tax procedure. What are all the Condition types needs to be created to adopt in TAXINJ procedure for India. So that I can enter Exicse duties ( Basic, Additional, education cess, higher education

  • I WANT TO OPEN A PORTAL PAGE INTO A PORTAL REGION

    I have two pages published as portlets(P1,P2). P1 have a portal link to P2 and it works perfectly. My problem occurs when: 1) I create a new group of pages. 2) In this group, i create a new Portal page(P3). 3) In a region of P3 I load p1 as a portlet

  • Custom Look&Feel problems with ComboBoxEditor

    hi, im trying to create a custom look and feel and have some problems with the ComboBoxEditor. the non-editable combobox works fine, but the editable makes problems. if i select an item from the dropdown, the value doesn't get updated in the editor a