Search Results

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

Page 49/81 | < Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >

  • All things equal what is the fastest way to output data to disk in C++?

    - by user260197
    I am running simulation code that is largely bound by CPU speed. I am not interested in pushing data in/out to a user interface, simply saving it to disk as it is computed. What would be the fastest solution that would reduce overhead? iostreams? printf? I have previously read that printf is faster. Will this depend on my code and is it impossible to get an answer without profiling? Edit: Output data needs to be in text format, whether tab or comma separated. This will require formatting, precision, etc. Running in Windows.

    Read the article

  • what changes when your input is giga/terabyte sized?

    - by Wang
    I just took my first baby step today into real scientific computing today when I was shown a data set where the smallest file is 48000 fields by 1600 rows (haplotypes for several people, for chromosome 22). And this is considered tiny. I write Python, so I've spent the last few hours reading about HDF5, and Numpy, and PyTable, but I still feel like I'm not really grokking what a terabyte-sized data set actually means for me as a programmer. For example, someone pointed out that with larger data sets, it becomes impossible to read the whole thing into memory, not because the machine has insufficient RAM, but because the architecture has insufficient address space! It blew my mind. What other assumptions have I been relying in the classroom that just don't work with input this big? What kinds of things do I need to start doing or thinking about differently? (This doesn't have to be Python specific.)

    Read the article

  • Why is 1942/4/3 00:00:00 an illegal date in java.util.Calendar?

    - by Aleksi
    Is there something special in the date 3rd of April 1942? For some reason the the hour of day 0 (12:00 am) is illegal for this specific date. The date is accepted when a lenient calendar is used but the hour of day is incremented to 1 (1:00 am). Relevant code java.util.Calendar calendar = java.util.Calendar.getInstance(); calendar.clear(); calendar.setLenient(false); calendar.set(1942, 3, 3, 0, 0, 0); calendar.getTimeInMillis(); Exception java.lang.IllegalArgumentException: HOUR_OF_DAY at java.util.GregorianCalendar.computeTime(Unknown Source) at java.util.Calendar.updateTime(Unknown Source) at java.util.Calendar.getTimeInMillis(Unknown Source) I'd really prefer is the dates were not lenient as I don't want to accept impossible dates.

    Read the article

  • TFS get command erroneously returns "All files are up to date."

    - by NathanE
    We are just in the process of migrating our TFS repo to Mercurial as we've had enough of TFS. Unfortunately TFS has thrown us one last curve ball before it lets us go. We've wrote a script that we intend to have "get" each changeset (including timestamp, check-in comment etc) and then add them to the Mercurial repo and check it in. Unfortunately TFS is acting very strange when we execute the tf get * /version:C111 /overwrite command. It immediately returns "All files are up to date." But this is impossible. The workspace folder is empty! And viewing the details for the 111 changeset quite clearly shows that the changeset contains "stuff" i.e. the repo is certainly not empty. What could be causing this?

    Read the article

  • Ruby - Is there a way to overwrite the __FILE__ variable?

    - by Markus Orrelly
    I'm doing some unit testing, and some of the code is checking to see if files exist based on the relative path of the currently-executing script by using the FILE variable. I'm doing something like this: if File.directory?(File.join(File.dirname(__FILE__),'..','..','directory')) blah blah blah ... else raise "Can't find directory" end I'm trying to find a way to make it fail in the unit tests without doing anything drastic. Being able to overwrite the __ FILE __ variable would be easiest, but as far as I can tell, it's impossible. Any tips?

    Read the article

  • Can I prevent a user from using windows task manager to end a process?

    - by Russ
    I have a c# 4.0 application that I hear grumblings and rumors about problems with. Now, this application has a global unhandled exception handler that reports back to me with errors. I also know that it works because SOME people fill it in, and submit it. It seems though; that a large number of people do NOT fill it in, but instead, use the Windows Taskmanager to end the process. Is it possible to prevent a user from using the Windows Taskmanager to end a specific process? My goal would be that if the application crashes, the form that the user is presented with prevents the process from being ended. I'll also accept steps that would prevent the Windows Taskmanager from being launched. I know I have seen some processes come up with an "Access Denied" prompt when I try to kill it in TaskManager, however I suspect that the windows team has made this very difficult, if not impossible to achieve.

    Read the article

  • Why is super.super.method(); not allowed in Java?

    - by Tim Büthe
    I read this question and thought that would easily be solved (not that it isn't solvable without) if one could write: @Override public String toString() { return super.super.toString(); } I'm not sure if it is useful in many cases, but I wonder why it isn't and if something like this exists in other languages. What do you guys think? EDIT: To clarify: yes I know, that's impossible to at to Java and I don't really miss it. This is nothing I expected to work and was surprised getting a compiler error. I just had the idea and like to discuss it.

    Read the article

  • Binding collections to DataGridView in Windows Forms

    - by Sergey
    I'm trying to bing collection to DataGridView. As it turns out it's impossible for user to edit anything in this DataGridView although EditMode is set to EditOnKeystrokeOrF2. Here is the simplified code: public Supplies() { InitializeComponent(); List<string> l = new <string>(); l.Add("hello"); this.SuppliesDataGridView.DataSource = l; } It also doesn't work when I change collection type to SortableBindingList, Dictionary or even use BindingSource. What can be wrong here?

    Read the article

  • Do I need to syncronize thread access to an int

    - by Martin Harris
    I've just written a method that is called by multiple threads simultaneously and I need to keep track of when all the threads have completed, the code uses this pattern: private void RunReport() { _reportsRunning++; try { //code to run the report } finally { _reportsRunning--; } } This is the only place within the code that _reportsRunning's value is changed, and the method takes about a second to run. Occasionally when I have more than six or so threads running reports together the final result for _reportsRunning can get down to -1, if I wrap the calls to _runningReports++ and _runningReports-- in a lock then the behaviour appears to be correct and consistant. So, to the question: When I was learning multithreading in C++ I was taught that you didn't need to synchronize calls to increment and decrement operations because they were always one assembly instruction and therefore it was impossible for the thread to be switched out mid-call. Was I taught correctly, and if so how come that doesn't hold true for C#?

    Read the article

  • PHP: Find total number of images having same name in a folder.

    - by Muhammad Sajid
    Hi, I am creating code to upload images in a folder using PHP, & before upload an image I check that if any image with same name already exists in the folder by using below syntax: if (file_exists('profilephoto/' . 'frame.gif')) { } But actually I don't want to restrict the user to upload more images with same name & obviously it is impossible to save two images with same name , but there is a way to just find total number of images with same name & upload the next image with appending total number + 1 with image name. Now I just want to know that using PHP how could we find total number of images having same name in a folder? Thanks.

    Read the article

  • How can i allow people in my local network to access the web service in my machine?

    - by user1451704
    I have coded a web service using the Axis 2 framework and I can successfully invoke it using a test client (SoapUI) on the local machine after publishing the application in JBoss 5. I can post to the WS endpoint from the local machine and get the expected response. Now i want to allow other machines to access the web service. i changed the "localhost" to "my own fixed IP" adress at the end point location, and turned firewall off, but impossible to access the WS. Note : windows Xp SP3. Any idea ? Thanks in advance !!

    Read the article

  • Fork to shell script and terminate original process with Haskell

    - by Neth
    I am currently writing a Haskell program that does some initialization work and then calls ncmpcpp. What I am trying to do is start ncmpcpp and terminate the Haskell program, so that only ncmpcpp is left (optionally, the program can keep running in the background, as long as it's unintrusive) However, even though I am able to start ncmpcpp, I cannot interact with it. I see its output, but input appears to be impossible. What I am currently doing is: import System.Process (createProcess, proc) ... spawnCurses :: [String] -> IO () spawnCurses params = do _ <- createProcess (proc "ncmpcpp" params) return () What am I doing wrong/What should I do differently?

    Read the article

  • PHP file modification time in milliseconds

    - by Steven Rosato
    I there, I am currently writing a unit test which asserts that a file did not get modified. The test code execution takes less than one second and therefore I would like to know if it is possible to retrieve the file modification time in milliseconds. filemtime() function returns the UNIX timestamp in seconds. My current solution is using the sleep(1) function which will assure me that 1 second passed before checking if it was modified or not. I don't like that solution since it slows down the test by a great deal. I cannot assert the content equality via get_file_contents() since the data that can be rewritten would be the same. I am guessing it is impossible, is it?

    Read the article

  • Is it not possible to print a pdf from a hyperlink?

    - by andrew
    I have looked for weeks and I keep hitting dead ends. I know you can create a text or image link and tell it to "print page" in a browser. But so far, I can't get it to print a document, specifically a pdf. I would like the print dialog to show after the link is clicked and yes, the pdf linked to has been printed. Why does this seem to be such an impossible feat? I have seen it work in a Flash movie, but since I cannot access the native file I cannot see how it was done. Any advice? Thanks.

    Read the article

  • Insert line in xml doc

    - by phenevo
    Hi, I wanna insert in second line : <?mso-application progid="Excel.Sheet"?> but I'm started to think that it is impossible. Here is my base code: XmlDocument doc = new XmlDocument(); XmlReader reader = cmd.ExecuteXmlReader(); doc.LoadXml("<results></results>"); XmlNode newNode = doc.ReadNode(reader); while (newNode != null) { doc.DocumentElement.AppendChild(newNode); newNode = doc.ReadNode(reader); }

    Read the article

  • VB6 lives forever like Cobol

    - by Kb
    In the last 3-5 years I have been renewing an insurance application and a commmercial integration toolkit based on vb6. According to Microsoft's "It just works policy" the IDE is no longer supported after april 8th 2008 It still works to develop and deploy vb 6 apps. The question is: When will it be impossible to support vb6 applications, or will they live forever like Cobol applications do? Update: Microsoft statement march 2010: The Visual Basic team is committed to “It Just Works” compatibility for Visual Basic 6.0 applications on Windows Vista, Windows Server 2008 including R2, and Windows 7.

    Read the article

  • C++ DLL which can inform a calling program about its progress

    - by Felix Dombek
    My boss wants me to write a DLL in C++ (MSVC++2010) which can perform a Volume Shadow Copy which he can call from VB6 (or at a later point other languages) and which can give status updates back while it is not finished. He calls it "events". I have the feeling that I finally need to learn COM (I'd rather not ...) ... also, a callback function comes to my mind, but it's surely impossible to hand over function pointers from VB6 to C++? Can someone outline what I have to learn and how this can be accomplished, with or without COM?

    Read the article

  • Is it possible to have a variadic function in C with no non-variadic parameter?

    - by Tim
    I have the following function: void doStuff(int unusedParameter, ...) { va_list params; va_start(params, unusedParameter); /* ... */ va_end(params); } As part of a refactor, I'd like to remove the unused parameter without otherwise changing the implementation of the function. As far as I can tell, it's impossible to use va_start when you don't have a last non-variadic parameter to refer to. Is there any way around this? Background: It is in fact a C++ program, so I could use some operator-overloading magic as suggested here, but I was hoping not to have to change the interface at this point. The existing function does its work by requiring that the variable argument list be null-terminated, and scanning for the NULL, therefore it doesn't need a leading argument to tell it how many arguments it has.

    Read the article

  • In XHR, is it possible to distinguish network errors from cross-origin errors?

    - by greim
    http://www.w3.org/TR/access-control/ Reading the CORS spec linked above, it seems to be the case that it's impossible to reliably distinguish between a generic "network error" and a cross-origin access denied error. From the spec: If there is a network error Apply the network error steps. Perform a resource sharing check. If it returns fail, apply the network error steps. http://www.w3.org/TR/access-control/#simple-cross-origin-request0 In my testing, I couldn't locate any features of Firefox's implementation that seem to indicate that the resource sharing check definitely failed. It just switches readyState to 4 and sets status to 0. Ultimately I'd like the ability to pass a success callback, a general fail callback, and an optional cross-origin fail callback, to my function. Thanks for any help or insight.

    Read the article

  • How can I use jQuery for messing with a particular div, but not in the current document - in a varia

    - by bisaram
    How can I use jQuery for messing with a particular div, but not in the current document - in a variable, that contains HTML? The point is that I want to show a preview of a page (a piece of it's content) in a modal window, when the link to this page is clicked. Well, onClick I load this whole HTML into a variable via JSON and then... how would I find a particular div I need in it? It's gonna be almost impossible to parse it with PHP before converting it into JSON and giving back to jQuery processor because of a deep hierarchy. Basically, is it even possible to do smth like $( 'div#some-id' ).blabla(); not for the current document, but for the document, stored in a variable? Thx everyone in advance.

    Read the article

  • Detect if an app was uninstalled

    - by mobilekid
    Is there a way to get a system notification when an app has been uninstalled? I would like to maintain a table of all clients' info currently using my app. However, that seems impossible if there is no way to detect this event. The first solution I can think of is to have an always running service in the background listening for android.intent.action.PACKAGE_REMOVED. But then would that service be killed once the uninstallation process has ended, or would it be stopped just before the process has kicked off? Also even if this is a solution it's has the potential to put off a lot of people when they realise that part of the app is running in the background. Any suggestions? Thanks!

    Read the article

  • Storing dates i Train schedule MYSQL

    - by App_beginner
    Hi I have created a train schedule database in MYSQL. There are several thousand routes for each day. But with a few exceptions most of the routes are similar for every working day, but differ on weekends. At this time I basically update my SQL tables at midnight each day, to get the departures for the next 24 hours. This is however very inconvenient. So I need a way to store dates in my tables so I don't have to do this every day. I tried to create a separate table where I stored dates for each routenumber (routenumbers are resetted each day), but this made my query so slow that it was impossible to use. Does this mean I would have to store my departure and arrival times as datetimes? In that case the main table containing routes would have several million entries. Or is there another way? My routetable looks like this: StnCode (referenced in seperate Station table) DepTime ArrTime Routenumber legNumber

    Read the article

  • How to create a generic C# method that can return either double or decimal?

    - by CrimsonX
    I have a method like this: private static double ComputePercentage(ushort level, ushort capacity) { double percentage; if(capacity == 1) percentage = 1; // do calculations... return percentage; } Is it possible to make it of a generic type like "type T" where it can return either decimal or double, depending on the type of method expected (or the type put into the function?) I tried something like this and I couldn't get it to work, because I cannot assign a number like "1" to a generic type. I also tried using the "where T :" after ushort capacity) but I still couldn't figure it out. private static T ComputePercentage<T>(ushort level, ushort capacity) { T percentage; if(capacity == 1) percentage = 1; // error here // do calculations... return percentage; } Is this even possible? I wasn't sure, but I thought this post might suggest that what I'm trying to do is just plain impossible.

    Read the article

  • Deferred printing in Java

    - by Bober02
    I have a specific issue with general console printing and I was wondering whether anyone has a solution for it. I am trying to print a dataTable which would look like sth like this: Table ---------------------- Name |Surname | ---------------------- Mike |Mikhailowish| Rafaello|Mirena | and so on. In order to print the border of the bar I need to know what the maximum length of each column value is. I don't want to go through the whole database to find that out and then again to print it. I would rather like to do sth like: System.out.printLater(s); //herejust leave a pointer to a StringBuilder you will build ... s.append("--------"); ... System.out.printAllDeferred(); I understand the above is probably in 99.99999% chances impossible, but perhaps you guys have a clever way of achieving the above?

    Read the article

  • What is the best way to make a game timer in Actionscript 3?

    - by Nuthman
    I have built an online game system that depends on a timer that records how long it took a player to complete a challenge. It needs to be accurate to the millisecond. Their time is stored in a SQL database. The problem is that when I use the Timer class, some players are ending up getting scores in the database of less than a second. (which is impossible, as most challenges would take at least 11 seconds to complete even in a perfect situation.) What I have found is that if a player has too many browser windows open, and/or a slow computer, the flash game slows down actually affecting the timer speed itself. The timer is 'spinning' on screen so you can physically see the numbers slowing down. It is frustrating that I cannot just open a second thread or do something to allow flash to keep accurate time regardless of whatever else is going on in the program. Any ideas?

    Read the article

< Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >