Search Results

Search found 2536 results on 102 pages for 'initialize'.

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

  • Why wont the LibGDX's main class Initialize on Android Launcher?

    - by BluFire
    So I was searching for different ways that could suit me in programming and came across LibGDX. Naturally I looked at the tutorial. As I was doing it, I was following the steps word for word, except naming the classes. In the end, I was able to create the desktop launcher for the game but not the android launcher. The following error is my error: Cannot instantiate the type Game (Game is the name of the class) I got the tutorial from http://steigert.blogspot.com.au/2012/02/1-libgdx-tutorial-introduction.html The link in the tutorial is the original but it uses jogl instead of lwjgl.

    Read the article

  • Initialize array in amortized constant time -- what is this trick called?

    - by user946850
    There is this data structure that trades performance of array access against the need to iterate over it when clearing it. You keep a generation counter with each entry, and also a global generation counter. The "clear" operation increases the generation counter. On each access, you compare local vs. global generation counters; if they differ, the value is treated as "clean". This has come up in this answer on Stack Overflow recently, but I don't remember if this trick has an official name. Does it? One use case is Dijkstra's algorithm if only a tiny subset of the nodes has to be relaxed, and if this has to be done repeatedly.

    Read the article

  • nVidia 9800 GTX+ X11 fails to initialize. no unity or lightdm

    - by rlemon
    I have just upgraded my work pc to 12.04 (not upgrade, fresh install), installing updates during the install, and after everything has loaded (with no errors) and I restart I get brought to console 1 tty login. Console 7 looks like this: IIRC I did not have to finagle with my drivers on 11.10 to get this card working. If this is in fact a driver bug I will remove this post and submit the bug but i'm not 100% confident that it is. I attempted to run unity --reset and got this: Lastly I tried $ sudo apt-get install nvidia-current which tells me nvidia-current is already the newest version. so I ran $ sudo dpkg-reconfigure nvidia-current which says /usr/sbin/dpkg-reconfigure: nvidia-current is broken or not fully installed. Anything I can try from here would be awesome. Currently the only way to get the system up and running was to shut down, plug one of my monitors into the onboard video, enable the onboard video card from the BIOS, then boot back up (and on my single monitor everything is fine). update So I have been able to boot fresh with the ext card plugged in as long as I don't take the updates with the install. past this if I only install the nvidia drivers (nvidia-current or nvidia-current-updates) from the main server (or canadian) I then get the problems.. My proposal; which I don't know where to look for: Can I try installing the previous version of this driver? In the past, on another machine I had issues with my NIC driver being funky... downgraded to the previous driver and bam everything was merry and well.

    Read the article

  • Initialize array in O(1) -- how is this trick called?

    - by user946850
    There is this pattern that trades performance of array access against the need to iterate it when clearing it. You keep a generation counter with each entry, and also a global generation counter. The "clear" operation increases the generation counter. On each access, you compare local vs. global generation counters; if they differ, the array has been reset. This has come up in StackOverflow recently, but I don't remember if this trick has an official name. Does it? One use case is Dijkstra's algorithm if only a tiny subset of the nodes has to be relaxed, and if this has to be done repeatedly.

    Read the article

  • .net remoting - Better solution to wait for a service to initialize ?

    - by CitizenInsane
    Context I have a client application (which i cannot modify, i.e. i only have the binary) that needs to run from time to time external commands that depends on a resource which is very long to initialize (about 20s). I thus decided to initialize this resource once for all in a "CommandServer.exe" application (single instance in the system tray) and let my client application call an intermediate "ExecuteCommand.exe" program that uses .net remoting to perform the operation on the server. The "ExecuteCommand.exe" is in charge for starting the server on first call and then leave it alive to speed up further commands. The service: public interface IMyService { void ExecuteCommand(string[] args); } The "CommandServer.exe" (using WindowsFormsApplicationBase for single instance management + user friendly splash screen during resource initializations): private void onStartupFirstInstance(object sender, StartupEventArgs e) { // Register communication channel channel = new TcpServerChannel("CommandServerChannel", 8234); ChannelServices.RegisterChannel(channel, false); // Register service var resource = veryLongToInitialize(); service = new MyServiceImpl(resource); RemotingServices.Marshal(service, "CommandServer"); // Create icon in system tray notifyIcon = new NotifyIcon(); ... } The intermediate "ExecuteCommand.exe": static void Main(string[] args) { startCommandServerIfRequired(); var channel = new TcpClientChannel(); ChannelServices.RegisterChannel(channel, false); var service = (IMyService)Activator.GetObject(typeof(IMyService), "tcp://localhost:8234/CommandServer"); service.RunCommand(args); } Problem As the server is very long to start (about 20s to initialize the required resources), the "ExecuteCommand.exe" fails on service.RunCommand(args) line because the server is yet not available. Question Is there a elegant way I can tune the delay before to receive "service not available" when calling service.RunCommand ? NB1: Currently I'm working around the issue by adding a mutex in server to indicate for complete initiliazation and have "ExecuteCommand.exe" to wait for this mutex before to call service.RunCommand. NB2: I have no background with .net remoting, nor WCF which is recommended replacer. (I chose .net remoting because this looked easier to set-up for this single shot issue in running external commands).

    Read the article

  • Is There Anyway to Undo a Quick Initialize from a Perc6/i VD?

    - by Carlo71
    I stupidly fast initialized an existing Raid 5 Array Virtual disk with 10 Virtual Machines after creating a new Raid 5 Array. The VDs switched order on the list of the Perc Controller. My server is a PowerEdge R710 with a Perc 6/i Raid controller running ESXi 5.1. The Bios of the R710 and the Perc 6/i controller are both running the latest firmware. I tried the steps on this article: http://www.caseyfulton.com/dell-perc-6i-fast-initialize-how-to-restore/. However the BartPE just freezes on the Windows XP slapsh page. Does anybody know a full proof method? I have backups of the VMs, however I would like to avoid restoring all of them due to time constraint.

    Read the article

  • Installing PHP APC in Fedora - Unable to initialize module ?

    - by sri
    I have been trying to install APC on my Fedora Apache Server for showing progress bar while uploading files. But I am getting the following PHP Warning while starting XAMPP. Starting XAMPP for Linux 1.7.1... PHP Warning: PHP Startup: apc: Unable to initialize module Module compiled with module API=20090626, debug=0, thread-safety=0 PHP compiled with module API=20060613, debug=0, thread-safety=0 These options need to matchin Unknown on line 0 XAMPP: Starting Apache with SSL (and PHP5)... XAMPP: Starting MySQL... XAMPP: Another FTP daemon is already running. XAMPP for Linux started. My Server Details : OS : Fedora-12 XAMPP version : 1.7.1 PHP Version : 5.2.9 APC Version : 3.1.9 I have tried the process as is mentioned in here : 1)http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html 2)http://stevejenkins.com/blog/2011/08/how-to-install-apc-alternative-php-cache-on-centos-5-6/

    Read the article

  • Overriding constructors

    - by demas
    Here is sample code: class One def initialize(*args) case args.size when 0 puts "one initialize" when 1 puts "one initialize #{args[0]}" end end end class Two def initialize(*args) if args.size == 2 then puts "two initialize #{args[0]} and #{args[1]}" else super(args) end end end one = One.new one = One.new("thing") two = Two.new("some", "other") two = Two.new("some") Now I'm launching the code and getting the error message: [[email protected]][~/temp]% ruby test2.rb one initialize one initialize thing two initialize some and other test2.rb:17:in `initialize': wrong number of arguments(1 for 0) (ArgumentError) from test2.rb:17:in `initialize' from test2.rb:26:in `new' from test2.rb:26:in `<main>' How can I call parent's constructor from class Two ?

    Read the article

  • How can i initialize an array without knowing it size?

    - by Sara
    I have a situation where i have to apply a criteria on an input array and reuturn another array as output which will have smaller size based upon the filtering criteria. Now problem is i do not know the size of filtered results, so i can not initialize the array with specific value. And i do not want it to be large size will null values because i am using array.length; later on. One way is to first loop the original input array and set a counter, and then make another loop with that counter length and initialize and fill this array[]. But is there anyway to do the job in just one loop?

    Read the article

  • How can I initialize a 2d array in Perl?

    - by Mark
    How do I initialize a 2d array in perl? I am trying the following code: 0 use strict; 10 my @frame_events = (((1) x 10), ((1) x 10)); 20 print "$frame_events[1][1]\n"; but it gives the following error: Can't use string ("1") as an ARRAY ref while "strict refs" in use at ./dyn_pf.pl line 20. This syntax only seems to initialize a 1d array as print "$frame_events[1]\n" works. Though perl doesn't give any error during the assignment.

    Read the article

  • When using out parameters in a function, is it good practice to initialize them in the function?

    - by adambox
    I have a function that uses out parameters to return multiple values to the caller. I would like to initialize them in the function, but I wasn't sure if that's a bad idea since you don't know when you call the function that it's going to change the values right away. The caller might assume that after the function returns, if whatever it was doing didn't work, the values would be whatever they were initialized to in the caller. Is it ok / good for me to initialize in the function? Example: public static void SomeFunction(int ixID, out string sSomething) { sSomething = ""; sSomething = something(ixID); if (sSomething = "") { somethingelse(); sSomething = "bar" } }

    Read the article

  • How to initialize std::vector from C-style array?

    - by dehmann
    What is the cheapest way to initialize a std::vector from a C-style array? Example: In the following class, I have a vector, but due to outside restrictions, the data will be passed in as C-style array: class Foo { std::vector<double> w_; public: void set_data(double* w, int len){ // how to cheaply initialize the std::vector? } Obviously, I can call w_.resize() and then loop over the elements, or call std::copy(). Are there any better methods?

    Read the article

  • Flash SWF not initializing until visible - can I force them to initialize?

    - by Jason
    I have an application that needs to render about 100 flash graphs (as well as other DOM stuff) in a series of rows that vertically extend many times beyond the current visible window - in other words, the users have to scroll down see see all the different graphs. This application is also dynamic and when a user changes a value in the DOM (anywhere on the page) it will need to propagate that change to all the Flash graphs at the same time. So I setup all the externalInterface callbacks and was careful to not let any JS start going until the ever-so-important "flashIsReady" call and...it worked great until I tried to update() the existing swf's with new data. Here was the behavior: - All the swfs load (initially) in both IE/Fox = good. - Updating swfs with new content works in IE but not in Fox = not good - Updating swfs with new content works in Fox --ONLY IF-- I scrolled down to the bottom of the page, then back to the top -- BEFORE -- I triggered an update(). So then I started tracing out each time a swf called the JS to say "flash is ready" and I realized, Firfox only renders swfs as they become visible. And To be honest - that's fine and actually, I am pretty sure that IE does this too. But the problem is that not only does Firefox not initialize the swf, Firefox doesn't even acknowledge the swf exists (expect for after onload) if it has not yet been visible. And the proof is that you get JS errors saying: "[FlashDOMID].FlashMethod is not a function". However, scroll down a little, wait until its visible and suddenly the trace starts lighting up "Flash Ready", "Flash Ready", "Flash Ready" and once they are all ready, everything works fine. Someone told me that FF does not init swf's until visible - can I force it? I can post code if you need...but its pretty heavy (hard to strip out the relevant from the rest) and I would like to avoid it (for your sakes) if possible. The question is simple - have you had this happen and if so, did you find a solution? Does anyone now how to force a not-yet-visible swf to initialize? Thanks guys.

    Read the article

  • How do I declare and initialize a 2d int vector in C++?

    - by FrankTheTank
    I'm trying to do something like: #include <iostream> #include <vector> #include <ctime> class Clickomania { public: Clickomania(); std::vector<std::vector<int> > board; bool move(int, int); bool isSolved(); void print(); void pushDown(); }; Clickomania::Clickomania() : board(12, std::vector<int>(8,0)) { srand((unsigned)time(0)); for(int i = 0; i < 12; i++) { for(int j = 0; j < 8; j++) { int color = (rand() % 6) + 1; board[i][j] = color; } } } However, apparently I can't initialize the "board" vector of vectors this way. How can I create a public member of a 2d vector type and initialize it properly?

    Read the article

  • initialize jquery slider with hidden input value from database.

    - by ludwigs3rd
    I'm using a slider as user input for a screen. Basically it's a bulk update screen where there is a table with multiple rows, thus multiple sliders. I created it so that the hidden value is what gets posted in the form. <td> <input class="percentageProvidedHidden" type="hidden" name='<%= "Values[" + i + "].Percentage" %>' value='<%=item.Percentage %>' /> <div class="percentageProvidedSlider"></div> </td> I have the update working just fine (move slider changes hidden input value, submit, values are updated in db), however, I can't get the damn thing to initialize with the value of the hidden input (note the "value: " parameter below). In this case I think $(this) isn't actually $('percentageProvidedSlider') but the page itself. Can someone help me get the slider value to initialize with the hidden input field? I'm using ASP .Net MVC 2 so if there are any methods I should try with that I welcome them as well. $('.percentageProvidedSlider').slider( { min: 0, max: 100, step: 25, value: $(this).parents('tr').find('input.percentageProvidedHidden').val(), slide: function(e, ui) { var mypos = ui.value; $(this).find('.ui-slider-handle').text(ui.value); }, change: function(event, ui) { var myVal = $(this).slider("option", "value"); $(this).parents('tr').find('input.percentageProvidedHidden').val(myVal); var myDropDown = $(this).parents('tr').find('select.verified'); } });

    Read the article

  • How to initialize List<E> in empty class constructor?

    - by Nazgulled
    Hi, The following code obviously doesn't work because List<E> is abstract: public class MyList { private List<E> list; public MyList() { this.list = new List<E>(); } } How can I initialize MyList class with an empty constructor if I need the list variable to be a LinkedList or a ArrayList depending on my needs?

    Read the article

  • What does "the application failed to initialize properly" mean?

    - by Mason Wheeler
    I just got a bug report from someone running an app I wrote under Windows XP. He says it won't start up. The application failed to initialize properly (0xc0150002). Click on OK to terminate the application. It works fine at my end, (under Windows 7,) and I don't have any Win7- or Vista-specific stuff in the program, so it should work on XP too. How do I go about tracking this down and debugging it?

    Read the article

  • Is possible to initialize an object in javascript in this way?

    - by Kucebe
    I'd like to initialize an object in javascript calling directly a method that belongs to it: var obj = (function(){ return{ init: function(){ console.log("initialized!"); }, uninit: function(x){ console.log("uninitialized!"); } }; }).init(); //later obj.uninit(); obj.init(); This specific example doesn't work, is there something similar?

    Read the article

  • Singletons, thread safety and structuremap

    - by Ben
    Hi, Currently I have the following class: public class PluginManager { private static bool s_initialized; private static object s_lock = new object(); public static void Initialize() { if (!s_initialized) { lock (s_lock) { if (!s_initialized) { // initialize s_initialized = true; } } } } } The important thing here is that Initialize() should only be executed once whilst the application is running. I thought that I would refactor this into a singleton class since this would be more thread safe?: public sealed class PluginService { static PluginService() { } private static PluginService _instance = new PluginService(); public static PluginService Instance { get { return _instance; } } private bool s_initialized; public void Initialize() { if (!s_initialized) { // initialize s_initialized = true; } } } Question one, is it still necessary to have the lock here (I have removed it) since we will only ever be working on the same instance? Finally, I want to use DI and structure map to initialize my servcices so I have refactored as below: public interface IPluginService { void Initialize(); } public class NewPluginService : IPluginService { private bool s_initialized; public void Initialize() { if (!s_initialized) { // initialize s_initialized = true; } } } And in my registry: ForRequestedType<IPluginService>() .TheDefaultIsConcreteType<NewPluginService>().AsSingletons(); This works as expected (singleton returning true in the following code): var instance1 = ObjectFactory.GetInstance<IPluginService>(); var instance2 = ObjectFactory.GetInstance<IPluginService>(); bool singleton = (instance1 == instance2); So my next question, is the structure map solution as thread safe as the singleton class (second example). The only downside is that this would still allow NewPluginService to be instantiated directly (if not using structure map). Many thanks, Ben

    Read the article

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