Search Results

Search found 73851 results on 2955 pages for 'time machine'.

Page 19/2955 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Checking the time in Objective-c?

    - by Moshe
    how can I get the current time in hh:mm format? I need to be able to tell between AM and PM and compare between the current time and a second time as well. I'm sure it's a silly function but i can't seem to figure it out.

    Read the article

  • Time complexity with bit cost

    - by Keyser
    I think I might have completely misunderstood bit cost analysis. I'm trying to wrap my head around the concept of studying an algorithm's time complexity with respect to bit cost (instead of unit cost) and it seems to be impossible to find anything on the subject. Is this considered to be so trivial that no one ever needs to have it explained to them? Well I do. (Also, there doesn't even seem to be anything on wikipedia which is very unusual). Here's what I have so far: The bit cost of multiplication and division of two numbers with n bits is O(n^2) (in general?) So, for example: int number = 2; for(int i = 0; i < n; i++ ){ number = i*i; } has a time complexity with respect to bit cost of O(n^3), because it does n multiplications (right?) But in a regular scenario we want the time complexity with respect to the input. So, how does that scenario work? The number of bits in i could be considered a constant. Which would make the time complexity the same as with unit cost except with a bigger constant (and both would be linear). Also, I'm guessing addition and subtraction can be done in constant time, O(1). Couldn't find any info on it but it seems reasonable since it's one assembler operation.

    Read the article

  • C# & ASP.Net - determine linq query generation time

    - by Chris Klepeis
    I'd like to detemine the amount of time it takes for my ASP.Net program to generate certain sql queries using linq.... note - I want the query generation time, not the query execution time. Is this possible, or even feasable (if its usually fast)? My website has some heavy traffic and I want to cover all of my bases.

    Read the article

  • get next/previous month from a Time object

    - by tcurdt
    I have a Time object and would like to find the next/previous month. Adding subtracting days does not work as the days per month vary. time = Time.parse('21-12-2008 10:51 UTC') next_month = time + 31 * 24 * 60 * 60 Incrementing the month also falls down as one would have to take care of the rolling time = Time.parse('21-12-2008 10:51 UTC') next_month = Time.utc(time.year, time.month+1) time = Time.parse('01-12-2008 10:51 UTC') previous_month = Time.utc(time.year, time.month-1) The only thing I found working was time = Time.parse('21-12-2008 10:51 UTC') d = Date.new(time.year, time.month, time.day) d >>= 1 next_month = Time.utc(d.year, d.month, d.day, time.hour, time.min, time.sec, time.usec) Is there a more elegant way of doing this that I am not seeing? How would you do it?

    Read the article

  • time series in python up to microseconds

    - by Abruzzo Forte e Gentile
    Hi All I would like to handle time series in python. I have been suggested to use scikit.timeseries but I need to handle up to microseconds and this last, as far as I know, handles up to milliseconds. Do you know any other library able to do that? At some point I need to merge 2 time series sampled at different time, and I would like to avoid rewriting such kind of features or any new classes from scratch whenever it is possible. I thank you all AFG

    Read the article

  • Real-time Java graph / chart library?

    - by Joonas Pulakka
    There was an earlier thread on Java graph or chart library, where JFreeChart was found to be quite good, but, as stated in its FAQ, it's not meant for real-time rendering. Can anyone recommend a comparable library that supports real-time rendering? Just some basic xy-rendering - for instance, getting a voltage signal from data acquisition system and plotting it as it comes (time on x-axis, voltage on y-axis).

    Read the article

  • SQL Server 2008 - Difference between time(0)

    - by lugeno
    I've a table with working_hours time(0), lunch_hours time(0) What I have to do is the following: If lunch_hours is greater that one hour, I have to calculate the offset Example: lounch_hour = 01:30:00 = offset = 00:30:00 Once done I've to subtract the offset from the working_hours value Example: offset = 00:30:00, working_hours = 07:30:00 = working_hours = 07:00:00 The result must be in time(0) format (hh:mm:ss) I've tried several solutions but still not working. Used DATEDIFF probably didn't used in correct way. Thanks for any help Bye!

    Read the article

  • "variable tracking" is eating my compile time!

    - by wowus
    I have an auto-generated file which looks something like this... static void do_SomeFunc1(void* parameter) { // Do stuff. } // Continues on for another 4000 functions... void dispatch(int id, void* parameter) { switch(id) { case ::SomeClass1::id: return do_SomeFunc1(parameter); case ::SomeClass2::id: return do_SomeFunc2(parameter); // This continues for the next 4000 cases... } } When I build it like this, the build time is enormous. If I inline all the functions automagically into their respective cases using my script, the build time is cut in half. GCC 4.5.0 says ~50% of the build time is being taken up by "variable tracking" when I use -ftime-report. What does this mean and how can I speed compilation while still maintaining the superior cache locality of pulling out the functions from the switch? EDIT: Interestingly enough, the build time has exploded only on debug builds, as per the following profiling information of the whole project (which isn't just the file in question, but still a good metric; the file in question takes the most time to build): Debug: 8 minutes 50 seconds Release: 4 minutes, 25 seconds

    Read the article

  • [C++] Real time plotting/data logging

    - by Paul
    I'm going to write a program that plots data from a sensor connected to the computer. The sensor value is going to be plotted as a function of the time (sensor value on the y-axis, time on the x-axis). I want to be able to add new values to the plot in real time. What would be best to do this with in C++? Edit: And by the way, the program will be running on a Linux machine

    Read the article

  • C++: How would I get unix time?

    - by John D.
    I need a function or way to get the UNIX epoch in seconds, much like how I can in PHP using the time function. I can't find any method except the time() in ctime which seems to only output a formatted date, or the clock() function which has seconds but seems to always be a multiple of 1 million, nothing with any resolution. I wish to measure execution time in a program, I just wanted to calculate the diff between start and end; how would a C++ programmer do this? EDIT: time() and difftime only allow resolution by seconds, not ms or anything too btw.

    Read the article

  • Ruby - Manipulating Time/DateTime by the Hour/Day?

    - by viatropos
    Where can I find some examples on how to manipulate the time objects by days/hours/etc? I would like to do this: time.now_by_hour #=> "Tue Jun 15 23 MST 2010" time.now_by_day #=> ""Tue Jun 15 MST 2010" time.now_by_hour - 4.weeks - 3.days #=> "Sat May 15 MST 2010" What is the recommended order of operations? The reason for this is I would like to run through lists of times and sort them by date to the hour, not to the minute and second.

    Read the article

  • how can I select data from MySQL based on date (unix time record)

    - by bn
    I have a record of data with unix time date in it i want to select the row based on the date/month/year only (not with time) currently Im using something like this select * from tablename where date > '$today' and date < '$tomorow' LIMIT 1; how ever this is not that accurate if the $today and $tomorrow have different time (but same date) is there any better way to do this?

    Read the article

  • Measuring the time to create and destroy a simple object

    - by portoalet
    From Effective Java 2nd Edition Item 7: Avoid Finalizers "Oh, and one more thing: there is a severe performance penalty for using finalizers. On my machine, the time to create and destroy a simple object is about 5.6 ns. Adding a finalizer increases the time to 2,400 ns. In other words, it is about 430 times slower to create and destroy objects with finalizers." How can one measure the time to create and destroy an object? Do you just do: long start = System.nanoTime(); SimpleObject simpleObj = new SimpleObject(); simpleObj.finalize(); long end = System.nanoTime(); long time = end - start;

    Read the article

  • how do i save time to a file?

    - by blood
    hi, i have a program that saves data to file and i want to put a time stamp of the current date/time on that log but when i try to write the time to the file it will not show up. #include <iostream> #include <windows.h> #include <fstream> #include <string> #include <sstream> #include <direct.h> #include <stdio.h> #include <time.h> using namespace std; string header_str = ("NULL"); int main() { for(;;) { stringstream header(stringstream::in | stringstream::out); header << "datasdasdasd_"; time_t rawtime; time ( &rawtime ); header << ctime (&rawtime); header_str = header.str(); fstream filestr; filestr.open ("C:\\test.txt", fstream::in | fstream::out | fstream::app | ios_base::binary | ios_base::out); for(;;) { filestr << (header_str); } filestr.close(); } return 0; } anyone know how to fix this?

    Read the article

  • Calculate the SUM of the Column which has Time DataType:

    - by thevan
    I want to calculate the Sum of the Field which has Time DataType. My Table is Below: TableA: TotalTime ------------- 12:18:00 12:18:00 Here I want to sum the two time fields. I tried the below Query SELECT CAST( DATEADD(MS, SUM(DATEDIFF(MS, '00:00:00.000', CONVERT(TIME, TotalTime))), '00:00:00.000' ) AS TOTALTIME) FROM [TableA] But it gives the Output as TOTALTIME ----------------- 00:36:00.0000000 But My Desired Output would be like below: TOTALTIME ----------------- 24:36:00 How to get this Output?

    Read the article

  • Apache shuts down from time to time

    - by Dugi
    I'm having trouble with my VPS as it keeps shutting apache down at least twice a day. The server is running on CentOS 6 with the latest apache. By shutting down I mean I have to go into SSH and type in this command in order to bring it up again: /sbin/service httpd start I'm not very good with servers and my host doesn't seem to have a nice customer service. Any help would be appreciated as these unexpected downtimes really know to kill one's mood.

    Read the article

  • Scala and Java Real-Time System

    - by portoalet
    Just wondering if anybody has run Scala app or web-app on Java Real-Time system? I assume because scala is bytecode compatible with regular JVM, then it should not take much effort to run it on a Real Time JVM such as Sun Java Real-Time System ?

    Read the article

  • Add 30 seconds to the time with PHP

    - by Sam
    Hey all, just wondering how I can add 30 seconds on to this? $time = date("m/d/Y h:i:s a", time()); Thankyou, again. I wasn't sure how to do it because it is showing lots of different units of time, when I only want to add 30 seconds.

    Read the article

  • adding php time

    - by redcoder
    i have a value store in variables as 11:30. I need to add a minutes to this variable..Example, adding 15 minutes to make it 11:45 can i do that ? i tried to use time() but it will give current time... but i want to add time to the specified variable

    Read the article

  • Is it possible to limit how much CPU a virtual machine can use with VMWare Player?

    - by Raz
    Is it possible to limit how much CPU a virtual machine can use with VMWare Player? I use VMWare to run a Windows XP virtual machine. I want to keep it on in the background all the time. The real computer runs Windows 7 and is sometimes a little bit short of memory. That's why I want to check if I can throttle the VM down to the bare minimum to keep it running in the background constantly without interfering too much.

    Read the article

  • Motion Sensing Fog Machine Increases Savings and Spook Factor

    - by Jason Fitzpatrick
    This DIY add-on switches a standard fog machine from always-on to motion-activated–increase your savings and spook factor at the same time. Courtesy of tinker Greg, this modification involves a new relay and motion sensor mounted onto the existing switch of a store-bought fog machine. When the motion-sensor detects motion the fog machine releases a burst of fog for 5 seconds and then disarms itself for 10 seconds–long enough for the startled victim to move on and for the machine to recharge for the next passerby. Check out the video above to see it in action and then hit up the link below to see the project’s build guide. Motion Sensing Fog Machine Trigger [via Hack A Day] How Hackers Can Disguise Malicious Programs With Fake File Extensions Can Dust Actually Damage My Computer? What To Do If You Get a Virus on Your Computer

    Read the article

  • Can I install a Windows 8 Pro upgrade in a virtual machine?

    - by Dean Schulze
    I bought a Lenovo 430K with Windows 7 Home Premium and upgraded it to Windows 8 Pro. I created a DVD from which I installed the Windows 8 Pro upgrade. I'm underwhelmed with Windows 8, however. I want to install Linux as the host OS and run Windows 8 Pro as a guest OS. Will the Windows 8 Pro DVD that I created install Windows 8 Pro in a virtual machine, or would that virtual machine have to have Windows 7 installed first in order to install the upgrade?

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >