Search Results

Search found 3280 results on 132 pages for 'michael van cleave'.

Page 98/132 | < Previous Page | 94 95 96 97 98 99 100 101 102 103 104 105  | Next Page >

  • Java: PriorityQueue returning incorrect ordering from custom comparator??

    - by Michael Simpson
    I've written a custom comparator to compare my node classes, but the java priority queue is not returning my items in the correct order. Here is my comparator: public int compare(Node n1, Node n2){ if (n1.getF() > n2.getF()){ return +1; } else if (n1.getF() < n2.getF()){ return -1; } else { // equal return 0; } } Where getF returns a double. However after inserting several Nodes into the priority queue, I print them out using: while(open.size() > 0) { Node t = (Node)(open.remove()); System.out.println(t.getF()); } Which results in: 6.830951894845301 6.830951894845301 6.0 6.0 5.242640687119285 7.4031242374328485 7.4031242374328485 8.071067811865476 Any ideas why this is so? Is my comparator wrong? Thanks. Mike

    Read the article

  • Detect Application Shutdown in C# NET?

    - by Michael Pfiffer
    I am writing a small console application (will be ran as a service) that basically starts a Java app when it is running, shuts itself down if the Java app closes, and shuts down the Java app if it closes. I think I have the first two working properly, but I don't know how to detect when the .NET application is shutting down so that I can shutdown the Java app prior to that happening. Google search just returns a bunch of stuff about detecting Windows shutting down. Can anyone tell me how I can handle that part and if the rest looks fine? namespace MinecraftDaemon { class Program { public static void LaunchMinecraft(String file, String memoryValue) { String memParams = "-Xmx" + memoryValue + "M" + " -Xms" + memoryValue + "M "; String args = memParams + "-jar " + file + " nogui"; ProcessStartInfo processInfo = new ProcessStartInfo("java.exe", args); processInfo.CreateNoWindow = true; processInfo.UseShellExecute = false; try { using (Process minecraftProcess = Process.Start(processInfo)) { minecraftProcess.WaitForExit(); } } catch { // Log Error } } static void Main(string[] args) { Arguments CommandLine = new Arguments(args); if (CommandLine["file"] != null && CommandLine["memory"] != null) { // Launch the Application LaunchMinecraft(CommandLine["file"], CommandLine["memory"]); } else { LaunchMinecraft("minecraft_server.jar", "1024"); } } } }

    Read the article

  • Images not shown when publishing MVC application to virtual directory inside default web-site

    - by Michael Sagalovich
    Hi! I am developing an application using ASP.NET MVC 1 and VS2008. When I deploy it to the default web-site in my IIS6 on WinXP, all images are shown correctly, path to any given image is localhost/Content/ImagesUI/[image].[ext] When I deploy it to the virtual directory, created inside the same site, any image request returns IIS standard 404 error page, while the path is localhost/[DirectoryName]/Content/ImagesUI/[image].[ext] - that seems to be correct, true? I am mapping .* to c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll in both site and directory configurations. When this mapping is removed, images are shown correctly. However, all other URLs do not work, of course. When I am trying to open an image in browser using the URL to it, aspnet_wp.exe process is not even started (I restarted IIS to test it) - I merely get 404 or the image, depending on the presence of * mapping. Thus, I suppose it has nothing to do neither with routes registered for MVC, nor with ASP. The solution that I found is to make Content folder a virtual directory and remove * mapping from its configuration. While that's OK to some extent, I want a better solution, which will explain and eliminate the cause of the problem, not just workaround it. Thanks for your help!

    Read the article

  • How can I create a drawable which changes depends on state AND also overlay a image?

    - by michael
    Hi, I have a TextView which has a drawable changes depends on state: <TextView android:background="@drawable/textbackground"...> And my textbackground.xml is <selector> <item android:state_focused="true" android:drawable="@drawable/highlightborder" /> </selector> And highlightborder.xml is <shape xmlns:android="http://schemas.android.com/apk/res/android"> <stroke android:width="1dp" android:color="#FFFF0000" /> <solid android:color="@android:color/transparent"/> </shape> Now, how can I add an png to the background of TextView while should the highlightborder when it has focus? Thank you.

    Read the article

  • "Reloading" Bindings in Ninject2?

    - by Michael Stum
    I'm using Ninject2 for DI and I have a Module that loads data from a config file. I wonder if there is a way to tell the Kernel or the Module to reload the config? (I can trigger that through code if needed) What worries me is the lifetime of existing objects. Say I have ITest bound to TestImpl1 in Singleton Scope and I change the config to bind ITest to TestImpl2 instead. All new requests should get TestImpl2, but the classes that already requested TestImpl1 before obviously keep it. However, what if all users of TestImpl1 are gone - will TestImpl1 be properly garbage collected and disposed in case it implements IDisposable? Or will it just be orphaned? Do I have to loop through each type and call Unbind/Bind on it? Or can I just unload the entire Module and reload it while still managing any existing object?

    Read the article

  • Flex 4 itemRendererFunction problem.

    - by michael
    This is a Flex 4 application: I have created a list as the following: <s:List id="previewList" horizontalCenter="14" verticalCenter="-112" itemRendererFunction="listItemRendererFunction" click="controller.previewListClickHandler()"> </s:List> And I have the itemRendererFunction: public function listItemRendererFunction(item:Object):ClassFactory { var cla:Class = SimpleItemRenderer; if( item.save == true ) { cla = ColorItemRenderer; } else { cla = SimpleItemRenderer; } return new ClassFactory(cla); } The application works fine if the listItemRendererFunction is inside fx:Script. However, when I put the listItemRendererFunction into a class and change to the following: itemRendererFunction="controller.listItemRendererFunction" in the List component. If I run the application, I get the " Error #1009". Please advice how to fix it.

    Read the article

  • Trouble shooting openGL text textures not showing up correctly cross platform

    - by Michael Minerva
    I have been tasked with solving a problem that is outside of my domain of knowledge and I was hoping I could get some troubleshooting advice from someone more experienced with openGL (I have very little experience with openGL). We are working on a cross platform application that is implemented in a common lisp implementation called ccl. In this application we have a need to display some 3D objects that display text. On the mac, all of the text displays fine but on the PC instead of displaying the text it displays some other texture. At first I thought that maybe the wrong texture was just being referenced so I tried changing the texture number but none of the textures in the list appeared to be the text (or if it was the texture was distorted and did not look like text). I know this problem is very vague and I am not looking for someone to post a solution, but I was wondering if people could suggest places I might look to try and get a handle on this issue.

    Read the article

  • XMLHttpRequest second call always fail

    - by Michael
    I'm developing Firefox extension and inside of javascript module have function which looks like this: var ajax = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(); ajax.open('GET', url, true); ajax.onload = function () { if (ajax.readyState == 4 && ajax.status == 200) { ... } } ajax.onerror = function (e) { ... } The second call to this function always fires onerror immediately... then after that the next call is successful. What could be wrong... is it normal?

    Read the article

  • In a Visual Studio C++ project with /clr, are its dependencies also compiled to managed code?

    - by Michael
    To be a bit more clear. If I have a Visual Studio C++ solution that has two projects, say a static library with CLR support turned off, and a second project with CLR support turned on that depends on this static library, does the static library get compiled as managed code? What about libraries that the CLR project uses that are external to this solution, do they also get compiled as managed code?

    Read the article

  • Edit Mode Delete Spinner Icon for Specific TableView Rows

    - by Michael Bordelon
    I have a grouped tableview. Each section has three rows. I need to be able to delete one section at a time. Using the standard edit mode, I can make it work. However, the delete icon shows up to the left of each cell, not just the first row in each section. Is there a way to suppress the little spinner icon for all rows except the first? I am hoping there is an easy way to do this without subclassing. Thanks for your help. Here is a screenshot to help visualize it: http://picasaweb.google.com/lh/photo/ll-EJY5ACw7oqHH1xKBQ8w?feat=directlink

    Read the article

  • How can I find a gitk type of tool for hg

    - by michael
    Hi, Can you please tell me where I can find a 'gitk' type of tool for hg on ubuntu? I have tried '$ sudo apt-get install tortoisehg' but I get this: $ hgtk abort: This version of TortoiseHg requires Mercurial version 1.3.n to 1.4.n, but finds 1.5.2

    Read the article

  • Should I Split Tables Relevant to X Module Into Different DB? Mysql

    - by Michael Robinson
    I've inherited a rather large and somewhat messy codebase, and have been tasked with making it faster, less noodly and generally better. Currently we use one big database to hold all data for all aspects of the site. As we need to plan for significant growth in the future, I'm considering splitting tables relevant to specific sections of the site into different databases, so if/when one gets too large for one server I can more easily migrate some user data to different mysql servers while retaining overall integrity. I would still need to use joins on some tables across the new databases. Is this a normal thing to do? Would I incur a performance hit because of this?

    Read the article

  • Domain-Driven-Design question

    - by Michael
    Hello everyone, I have a question about DDD. I'm building a application to learn DDD and I have a question about layering. I have an application that works like this: UI layer calls = Application Layer - Domain Layer - Database Here is a small example of how the code looks: //****************UI LAYER************************ //Uses Ioc to get the service from the factory. //This factory would be in the MyApp.Infrastructure.dll IImplementationFactory factory = new ImplementationFactory(); //Interface and implementation for Shopping Cart service would be in MyApp.ApplicationLayer.dll IShoppingCartService service = factory.GetImplementationFactory<IShoppingCartService>(); //This is the UI layer, //Calling into Application Layer //to get the shopping cart for a user. //Interface for IShoppingCart would be in MyApp.ApplicationLayer.dll //and implementation for IShoppingCart would be in MyApp.Model. IShoppingCart shoppingCart = service.GetShoppingCartByUserName(userName); //Show shopping cart information. //For example, items bought, price, taxes..etc ... //Pressed Purchase button, so even for when //button is pressed. //Uses Ioc to get the service from the factory again. IImplementationFactory factory = new ImplementationFactory(); IShoppingCartService service = factory.GetImplementationFactory<IShoppingCartService>(); service.Purchase(shoppingCart); //**********************Application Layer********************** public class ShoppingCartService : IShoppingCartService { public IShoppingCart GetShoppingCartByUserName(string userName) { //Uses Ioc to get the service from the factory. //This factory would be in the MyApp.Infrastructure.dll IImplementationFactory factory = new ImplementationFactory(); //Interface for repository would be in MyApp.Infrastructure.dll //but implementation would by in MyApp.Model.dll IShoppingCartRepository repository = factory.GetImplementationFactory<IShoppingCartRepository>(); IShoppingCart shoppingCart = repository.GetShoppingCartByUserName(username); //Do shopping cart logic like calculating taxes and stuff //I would put these in services but not sure? ... return shoppingCart; } public void Purchase(IShoppingCart shoppingCart) { //Do Purchase logic and calling out to repository ... } } I've seem to put most of my business rules in services rather than the models and I'm not sure if this is correct? Also, i'm not completely sure if I have the laying correct? Do I have the right pieces in the correct place? Also should my models leave my domain model? In general I'm I doing this correct according DDD? Thanks!

    Read the article

  • ASP.NET, Visual Studio and Subversion - how to integrate?

    - by Michael Stum
    I use AnkhSVN and Visual Studio 2005 and 2008. Now, one thing that bugs me is that Ankh does not really work with ASP.NET sites. I cannot add them properly to a repository and it won't detect changes, especially because the site is on a remote server accessed through Frontpage Extensions (File = Open Site). What are the alternatives? Does a better plug-in exist? Manually downloading the files through FTP and using TortoiseSVN or svn.exe is not really the level of integration I want :) I want to stay within the Visual Studio IDE when possible. Also, I do not control the remote Server, so I can not install anything on it, which means the whole change tracking/comparison to repository has to be done on my machine.

    Read the article

  • How do you beta test an iphone app?

    - by Michael Pryor
    How can you beta test an iPhone app? I can get it on my own device, and anyone that gives me a device, I can run it on theirs, but is there a way to do a limited release via the app store for beta testing? Update: Also, see this question on getting your app onto phones without using the App Store.

    Read the article

  • DOM accessing element JS

    - by Michael
    Given the following xml <rss> <channel> ... <pubDate>20/30/2099</pubDate> ... <item> ... <pubDate>10/30/2099</pubDate> ... </item> ... <item> ... <pubDate>40/30/2099</pubDate> ... </item> ... <channel> </rss> how would I efficiently access pudDate in channel and items as array, as well as pudDate in that array.

    Read the article

  • Show Dialog Question

    - by Michael Quiles
    How can I get the Xwinnerform to stay on top an keep the main form from being clicked, I tried ShowDialog but I cant get it to work. static public bool CheckWinner(Button[] myControls) { //bolean statement to check for the winner bool gameOver = false; for (int i = 0; i < 8; i++) { int a = Winners[i, 0]; int b = Winners[i, 1]; int c = Winners[i, 2]; Button b1 = myControls[a], b2 = myControls[b], b3 = myControls[c]; if (b1.Text == "" || b2.Text == "" || b3.Text == "") continue; if (b1.Text == b2.Text && b2.Text == b3.Text) { xWinnerForm xWinnerForm = new xWinnerForm(); xWinnerForm.ShowDialog(b1.Text + " is the Winner"); } } return gameOver; } enter code here

    Read the article

  • Which class will be instantiated

    - by Michael
    Say I have 2 subclasses from UIViewController, class A and class B. In Main nib file an object is representing class A and it is set to load file from Secondary nib file. The owner of Secondary nib is of class B. The question is - from which class an object in Main nib file will be instanciated once the nib files unarchived in the memory? The reason this question arised is that I have to take care myself if such reference to external NIB file present, to ensure that the first nib's object and second nib's owner is same. Please correct me if my statement is wrong.

    Read the article

  • Is there a standardized (Meta?) Tag for the Date of a Website?

    - by Michael Stum
    One thing that search engines really suck with is the date when a website was created. You know the problem: You search for some CSS or JavaScript problem and Google returns a ton of results from 2002 explaining how to fix the problem in IE 5.5 and Netscape 4.6 while the helpful articles are buried on Page 3. There is only one use for Page 3, and meaningful search results are not it. Anyway, I just wonder if there is a standardized or at least generally accepted tag or meta tag that I can put on my own pages to indicate the date they were created? Not that it helps filtering out the old crap out of search results (especially since the people at #1 with their 2002 articles have zero incentive to change), but I'd just like to do my part :P

    Read the article

  • Perl : In splice() type of arg1 must be array, cannot be scalar dereference. How to fix?

    - by Michael Mao
    I am trying to comprehend the reference/dereference system in Perl. What I am trying to do is to remove an element by using reference: my $ref= \@{$collection{$_[0]}}; # delete($$ref[$i]); # delete works, I've tested that already splice($$ref, $i, 1); # this wouldn't do. I first tried the delete() subroutine, it works; however, it doesn't shift the index after the removed elements forward by 1, so I cannot continue working on other stuff. I then Googled and found the splice() subroutine which does delete and shift in one go. But the error feedback tells me that "Type of arg 1 to splice must be array (not scalar dereference)..." I then tried something like this: splice(@{$$ref}, $i, 1); That resulted in another error like this: "Not a SCALAR reference at...(pointing at that line)" So I am a bit puzzled, how could I handle this issue? I prefer not using any CPAN or additional library for the solution, if possible.

    Read the article

< Previous Page | 94 95 96 97 98 99 100 101 102 103 104 105  | Next Page >