Search Results

Search found 2012 results on 81 pages for 'impossible'.

Page 3/81 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Ruby and duck typing: design by contract impossible?

    - by davetron5000
    Method signature in Java: public List<String> getFilesIn(List<File> directories) similar one in ruby def get_files_in(directories) In the case of Java, the type system gives me information about what the method expects and delivers. In Ruby's case, I have no clue what I'm supposed to pass in, or what I'll expect to receive. In Java, the object must formally implement the interface. In Ruby, the object being passed in must respond to whatever methods are called in the method defined here. This seems highly problematic: Even with 100% accurate, up-to-date documentation, the Ruby code has to essentially expose its implementation, breaking encapsulation. "OO purity" aside, this would seem to be a maintenance nightmare. The Ruby code gives me no clue what's being returned; I would have to essentially experiment, or read the code to find out what methods the returned object would respond to. Not looking to debate static typing vs duck typing, but looking to understand how you maintain a production system where you have almost no ability to design by contract. Update No one has really addressed the exposure of a method's internal implementation via documentation that this approach requires. Since there are no interfaces, if I'm not expecting a particular type, don't I have to itemize every method I might call so that the caller knows what can be passed in? Or is this just an edge case that doesn't really come up?

    Read the article

  • Windows repair console, impossible?

    - by Daniel
    I found an old Windows XP SP2 in my -trash- cd can and tried it on a 30 GB FAT32 partition. Installation went fine till the copying operation was completed and XP asked for reboot. After that either it starts over again or throws invalid disk. Starting over is an infinite loop the only way I see is to choose the "Repair console" but I'm not used to a DOS box. Can anyone help me through this harmful installation?

    Read the article

  • Nested class with hidden constructor impossible in c#?

    - by luckyluke
    I' ve been doing some programming lately and faced an issue which i found weird in c#. (at least for me) public class Foo { //whatever public class FooSpecificCollection : List<Bar> { //implementation details } public FooSpecificCollection GetFoosStuff() { //return the collection } } I want the consumer of Foo to be able to obtain a reference to FooSpecificCollection, even perform some operations on it. Maybe even set it to some other property of Foo or smth like that, but not To be able to CREATE an instance of this class. (the only class that should be able to instatiate this collection should be Foo. Is my request really that far-fetched? I know that people way smarter defined c# but shouldn't there be such an option that a parent class can create a nested class instance but nobody else can't. So far I created a solution to make an abstract class, or interface available through the property and implement a concrete private class that is not available anywhere else. Is this a correct way to handle such a situation.?

    Read the article

  • Python+Windows+GStreamer = Impossible (for me)?

    - by james
    Hi :) essentially, my problem is, ater a long time searching, finding only this other question, i decided i was just going to ask my own... i am on windows 7 with python 2.6 and ossbuild GStreamer, but i am trying to get the python binding for it, and struggling. i have got gst-python from http://gstreamer.freedesktop.org/src/gst-python/ but as my eyes and research tell me, it does not work in the setup.py way, and the other question has a link to a site that he says has a binary avaiable, which no longer does, http://www.gstreamer-winbuild.ylatuya.es/doku.php?id=download and even the sdk is gone, and ossbuild dont seem to have anything useful either. so essentially, my question is, can anyone tell me a method, however convoluted, of getting my setup so if i write a script for (py)gst, with an import gst it will work? not the best of explanations... im tired k? xxx :)

    Read the article

  • The impossible inline Javascript delay/sleep

    - by trex005
    There is a JavaScript function, of which I have zero control of the code, which calls a function that I wrote. My function uses DOM to generate an iFrame, defines it's src and then appends it to another DOM element. However, before my function returns, and thus allows continued execution of the containing function, it is imperative that the iFrame be fully loaded. Here are the things that I have tried and why they do not work : 1. The SetTimeout option : 99.999% of the time, this is THE answer. As a matter of fact, in the past decade that I have been mentoring in JavaScript, I have always insisted that code could always be refactored to use this option, and never believed a scenario existed where that was not the case. Well, I finally found one! The problem is that because my function is being called inline, if the very next line is executed before my iFrame finishes loading, it totally neuters my script, and since the moment my script completes, the external script continues. A callback of sorts will not work 2. The "Do nothing" loop :This option you use while(//iFrame is not loaded){//do nothing}. In theory this would not return until the frame is loaded. The problem is that since this hogs all the resources, the iFrame never loads. This trick, although horribly unprofessional, dirty etc. will work when you just need an inline delay, but since I require an external thread to complete, it will not.In FF, after a few seconds, it pauses the script and an alert pops up stating that there is an unresponsive script. While that alert is up, the iFrame is able to load, and then my function is able to return, but having the browser frozen for 10 seconds, and then requiring the user to correctly dismiss an error is a no go. 3. The model dialogue : I was inspired by the fact that the FF popup allowed the iFrame to load while halting the execution of the function, and thinking about it, I realized that it is because the modal dialogue, is a way of halting execution yet allowing other threads to continue! Brilliant, so I decided to try other modal options. Things like alert() work beautifully! When it pops up, even if only up for 1/10th of a second, the iFrame is able to complete, and all works great. And just in case the 1/10 of a second is not sufficient, I can put the model dialogue in the while loop from solution 2, and it would ensure that the iFrame is loaded in time. Sweet right? Except for the fact that I now have to pop up a very unprofessional dialogue for the user to dismiss in order to run my script. I fought with myself about this cost/benefit of this action, but then I encountered a scenario where my code was called 10 times on a single page! Having to dismiss 10 alerts before acessing a page?! That reminds me of the late 90s script kiddie pages, and is NOT an option. 4. A gazillion other delay script out there:There are about 10 jQuery delay or sleep functions, some of them actually quite cleverly developed, but none worked. A few prototype options, and again, none I found could do it! A dozen or so other libraries and frameworks claimed they had what I needed, but alas they all conspired to give me false hope. I am convinced that since a built in model dialogue can halt execution, while allowing other threads to continue, there must be some code accessible way to do the same thing with out user input. The Code is literally thousands upon thousands of lines and is proprietary, so I wrote this little example of the problem for you to work with. It is important to note the ONLY code you are able to change is in the onlyThingYouCanChange function Test File : <html> <head> </head> </html> <body> <div id='iFrameHolder'></div> <script type='text/javascript'> function unChangeableFunction() { new_iFrame = onlyThingYouCanChange(document.getElementById('iFrameHolder')); new_iFrame_doc = (new_iFrame.contentWindow || new_iFrame.contentDocument); if(new_iFrame_doc.document)new_iFrame_doc=new_iFrame_doc.document; new_iFrame_body = new_iFrame_doc.body; if(new_iFrame_body.innerHTML != 'Loaded?') { //The world explodes!!! alert('you just blew up the world! Way to go!'); } else { alert('wow, you did it! Way to go!'); } } var iFrameLoaded = false; function onlyThingYouCanChange(objectToAppendIFrameTo) { iFrameLoaded = false; iframe=document.createElement('iframe'); iframe.onload = new Function('iFrameLoaded = true'); iframe.src = 'blank_frame.html'; //Must use an HTML doc on the server because there is a very specific DOM structure that must be maintained. objectToAppendIFrameTo.appendChild(iframe); var it = 0; while(!iFrameLoaded) //I put the limit on here so you don't { //If I was able to put some sort of delay here that paused the exicution of the script, but did not halt all other browser threads, and did not require user interaction we'd be golden! //alert('test'); //This would work if it did not require user interaction! } return iframe; } unChangeableFunction(); </script> </body> blank_frame.html : <html> <head> </head> <body style='margin:0px'>Loaded?</body> </html>

    Read the article

  • WithEvents LinkedList is it Impossible?

    - by serhio
    What is the optimal approach to a WithEvents Collection - VB.NET? Have you any remarks on the code bellow (skipping the Nothing verifications)? The problem is when I obtain the LinkedListNode(Of Foo) in a For Each block I can set myNode.Value = something, and here is a handlers leak... -Could I override the FooCollection's GetEnumerator in this case? -No. :( cause NotInheritable Class LinkedListNode(Of T) Class Foo Public Event SelectedChanged As EventHandler End Class Class FooCollection Inherits LinkedList(Of Foo) Public Event SelectedChanged As EventHandler Protected Overloads Sub AddFirst(ByVal item As Foo) AddHandler item.SelectedChanged, AddressOf OnSelectedChanged MyBase.AddFirst(item) End Sub Protected Overloads Sub AddLast(ByVal item As Foo) AddHandler item.SelectedChanged, AddressOf OnSelectedChanged MyBase.AddLast(item) End Sub ' ------------------- ' Protected Overloads Sub RemoveFirst() RemoveHandler MyBase.First.Value.SelectedChanged, _ AddressOf OnSelectedChanged MyBase.RemoveFirst() End Sub Protected Overloads Sub RemoveLast(ByVal item As Foo) RemoveHandler MyBase.Last.Value.SelectedChanged, _ AddressOf OnSelectedChanged MyBase.RemoveLast() End Sub ' ------------------- ' Protected Sub OnSelectedChanged(ByVal sender As Object, ByVal e As EventArgs) RaiseEvent SelectedChanged(sender, e) End Sub End Class

    Read the article

  • Android / Java rare and seemingly impossible exception causing force close

    - by Guzba
    Hello all, I have an interesting problem being reported to me from an android application I have published. I have a two-dimensional array that I am iterating through using two for loops like so: for (int i = 0; i < arr.length; ++i) { for (int j = 0; j < arr[i].length; ++j) { if (arr[i][j] != 0) // does stuff } } The problem is, somehow arr[i][j] != 0 is throwing an ArrayIndexOutOfBoundsException. But very rarely. I have thousands of people use the app on a daily basis and get maybe twenty force close reports. Is this something I can't avoid, maybe a problem with the phones memory, etc. or is there something I can do that I haven't thought of yet? Thanks.

    Read the article

  • impossible to install Framework 3.5

    - by yae
    Hi few days ago I formatted one of my computers (XP Home SP2 with prior updates installed). Now I am trying to install NET Framework 3.5, but display this error: [03/21/10,17:19:36] Microsoft .NET Framework 2.0a: [2] Error: Installation failed for component Microsoft .NET Framework 2.0a. MSI returned error code 1603 [03/21/10,17:20:17] WapUI: [2] DepCheck indicates Microsoft .NET Framework 2.0a is not installed. Already i have tried this to try solve this issue, but the problem persists. 1.- unistall all frameworks and reinstall from scratch 2.- clean all temps file and reinstall from scratch 3.- unistall and clean all frameworks with dotnetfx cleanup tool and reinstall from scratch 4.- install .NET Framework 3.5 full package But all these possibles solutions have failed. Any idea to solve this? Thanks in advance

    Read the article

  • Mimic what is in the Textbox - impossible?

    - by Daniel
    I have four sheets in a spreadsheet. On each sheet there is a textbox. When I type in the textbox on sheet1, I want the textboxes on sheet2, sheet3, and sheet4 to populate with the same value. I've only gotten stupid answers, so someone with real knowledge would be helpful.

    Read the article

  • Why is it impossible to produce truly random numbers?

    - by Vinoth Kumar
    I was trying to solve a hobby problem that required generating a million random numbers. But I quickly realized, it is becoming difficult to make them unique. I picked up Algorithm Design Manual to read about random number generation. It has the following paragraph that I am fully not able to understand. Unfortunately, generating random numbers looks a lot easier than it really is. Indeed, it is fundamentally impossible to produce truly random numbers on any deterministic device. Von Neumann [Neu63] said it best: “Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin.” The best we can hope for are pseudo-random numbers, a stream of numbers that appear as if they were generated randomly. Why is it impossible to produce truly random numbers in any deterministic device? What does this sentence mean?

    Read the article

  • Is it possible to create an "impossible" rooms in games?

    - by qwerty3000
    Forgive me my lack of knowlegde, but for quite a long time I asked myself whether it was possible to create a continous game space that some player could walk inside and so on, that would be absolutely impossible in reality, e.g. you have a very small house that allows you to go around it to see all sides and the full dimensions, and then, when you enter, it is like a giant hall, without any loading screen or (internal) "model change" and so on. I'm no game designer and I never needed to learn 3D-modelling, so I don't know what is possible and what isn't. And is this the same as Is the "impossible object" possible in computer graphics? this? Or is it just the same category, but not exactly the same question? Thanks.

    Read the article

  • Is there some way to access Sql server from z/OS mainframe and have the result in IBM 3270 terminal

    - by systempuntoout
    I tagged this question "impossible" because after a lot of googling, i have not find any trace\reference to a possible answer. I'm asking if there is some way\dirtytrick (possibly cheap) to access Microsoft Sql Server from z/OS mainframe (COBOL programs) and have the result in 3270 terminal emulation; i know that 3270 is a pretty old system, but in bank CED, is still very popular.

    Read the article

  • Quel est le bug le plus récalcitrant que vous ayez rencontré ? Improbable ou impossible à reproduire, racontez-nous tout

    Quel est le bug le plus récalcitrant que vous ayez rencontré ? Improbable ou impossible à reproduire, racontez-nous votre meilleure histoire de débogage Si le débogage est l'art d'enlever les bogues, la programmation doit être l'art de les créer. Une expression chère à beaucoup de développeurs qui souligne à quel point le débogage d'une application peut être important et... problématique. C'est ce que relate Patrick Thomson, un développeur blogueur qui raconte ce qu'il qualifie de "meilleure histoire de débogage qu'il ait jamais entendue". Il s'agit d'une mésaventure vécue dans les année 80 par le père de l'auteur, avec un ordinateur ancestrale ut...

    Read the article

  • Quel est le bogue le plus récalcitrant que vous ayez rencontré ? Improbable ou impossible à reproduire, racontez-nous tout

    Quel est le bug le plus récalcitrant que vous ayez rencontré ? Improbable ou impossible à reproduire, racontez-nous votre meilleure histoire de débogage Si le débogage est l'art d'enlever les bogues, la programmation doit être l'art de les créer. Une expression chère à beaucoup de développeurs qui souligne à quel point le débogage d'une application peut être important et... problématique. C'est ce que relate Patrick Thomson, un développeur blogueur qui raconte ce qu'il qualifie de "meilleure histoire de débogage qu'il ait jamais entendue". Il s'agit d'une mésaventure vécue dans les année 80 par le père de l'auteur, avec un ordinateur ancestrale ut...

    Read the article

  • The CLR has been unable to transition from COM context [...] for 60 seconds

    - by BlueRaja The Green Unicorn
    I am getting this error on code that used to work. I have not changed the code. Here is the full error: The CLR has been unable to transition from COM context 0x3322d98 to COM context 0x3322f08 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations. And here is the code that caused it: var openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); openFileDialog1.DefaultExt = "mdb"; openFileDialog1.Filter = "Management Database (manage.mdb)|manage.mdb"; //Stalls indefinitely on the following line, then gives the CLR error //one minute later. The dialog never opens. if(openFileDialog1.ShowDialog() == DialogResult.OK) { .... } Yes, I am sure the dialog is not open in the background, and no, I don't have any explicit COM code or unmanaged marshalling or multithreading. I have no idea why the OpenFileDialog won't open - any ideas?

    Read the article

  • Really impossible to have Gimp 2.8 on Ubuntu 11.10?

    - by ubuntico
    For days, I have been trying to find a solution and repositories to install Gimp 2.8 on Ubuntu 11.10. Each time I get this error: Tried to update pango via sudo apt-get install pango-graphite [sudo] password for xxx: Reading package lists... Done Building dependency tree Reading state information... Done pango-graphite is already the newest version. Then also tried sudo apt-get install libgdk-pixbuf2* Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'libgdk-pixbuf2.0-0' for regex 'libgdk-pixbuf2*' Note, selecting 'libgdk-pixbuf2.0-dev' for regex 'libgdk-pixbuf2*' Note, selecting 'libgdk-pixbuf2.0-doc' for regex 'libgdk-pixbuf2*' Note, selecting 'libgdk-pixbuf2-ruby' for regex 'libgdk-pixbuf2*' Note, selecting 'libgdk-pixbuf2-ruby1.8' for regex 'libgdk-pixbuf2*' Note, selecting 'libgdk-pixbuf2-ruby1.8-dbg' for regex 'libgdk-pixbuf2*' Note, selecting 'libgdk-pixbuf2.0-common' for regex 'libgdk-pixbuf2*' libgdk-pixbuf2-ruby is already the newest version. libgdk-pixbuf2-ruby1.8 is already the newest version. libgdk-pixbuf2-ruby1.8-dbg is already the newest version. libgdk-pixbuf2.0-doc is already the newest version. libgdk-pixbuf2.0-0 is already the newest version. libgdk-pixbuf2.0-dev is already the newest version. libgdk-pixbuf2.0-common is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 31 not upgraded. And still error :(. Please help as I do not want to upgrade to Ubuntu 12.04 just to have Gimp. Really a mission impossible????

    Read the article

  • Desktop Apps in the Windows 8 Store?!?! That&rsquo;s Impossible!!!

    - by David Paquette
    Or is it? Since Microsoft announced the Windows Store, the official word has been that desktop apps could not be distributed in the store.  But this morning I noticed this: That’s odd, but after clicking on one of these, I see that all it does is link to the website where you download Visual Studio So really, it’s not a desktop app in the store.  It’s more of an ad for a desktop app. Interestingly enough, despite the menu being ALL CAPS, Visual Studio 2012 is getting a nearly solid 5/5 stars.

    Read the article

  • How can I increase resolution when impossible to set up nvidia driver?

    - by Asimov4
    I was stuck at 1024x758 before creating an /etc/X11/xorg.conf file as follows which works well to allow me to have a resolution of 1920x1200 with the vesa driver. Section "Device" Identifier "Configured Video Device" Driver "vesa" EndSection Section "Monitor" Identifier "Configured Monitor" HorizSync 24.0 - 83.0 VertRefresh 50.0 - 75.0 EndSection Section "Screen" Identifier "Default Screen" Monitor "Configured Monitor" Device "Configured Video Device" SubSection "Display" Viewport 0 0 Depth 24 Modes "1920x1200" EndSubSection EndSection But now my display is kind of slow. I have an NVIDIA GeForce 8600GT but really cannot find how to set up the driver to work. Are there any alternatives to VESA that would work faster?

    Read the article

  • Launching matlab remotely on windows via ssh? Impossible?

    - by Bob E.
    Howdy, I am trying to run matlab remotely on windows via OpenSSH installed with Cygwin, but launching matlab in windows without the GUI seems to be impossible. If i am logged in locally, I can launch matlab -nodesktop -nodisplay -r script, and matlab will launch up a stripped down GUI and do the command. However, this is impossible to do remotely via ssh, as, matlab needs to display the GUI. Does anyone have any suggestions or work arounds? Thanks, Bob

    Read the article

  • Trojan Horse Generic.15.apnz Virus Impossible to get rid of?!

    - by DaveDev
    Hi Guys I'm new to this forum so I'm unsure whether this is the right place for a question like this. I have a Trojan Horse infection that lives in memory and seems to be impossible to get rid of. I've tried a vew AntiVirus products (Norton, Windows Essentials & AVG Free) all to no avail & I've recently tried a few bootable antivirus solutions I found here: http://www.techmixer.com/free-bootable-antivirus-rescue-cds-download-list/ Kaspersky Rescue Disk 2008 (failed - it wouldn't even load the UI, is there a newer one out there?) F Secure Rescue Disk (Updates & Scanner ran, found 10 infections, said it was going to delete or repair them, but didn't get rid of them) Avira found a load of infections but it froze when I tried to interact with the UI after the scan. Every time I run these I'll load Windows after & run AVG, and it still finds Trojan Horse Generic.15.apnz (in Services.exe) & Trojan Horse Generic.16.ARSU (in svchost.exe) Is anyone familiar with a virus like this? Can anyone suggest how to approach a solution? Thanks Dave

    Read the article

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