Search Results

Search found 61036 results on 2442 pages for 'time keeping'.

Page 14/2442 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • [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

  • 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

  • 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

  • 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

  • How to differentiate between time to live and time to idle in ehcache

    - by Jacques René Mesrine
    The docs on ehache says: timeToIdleSeconds: Sets the time to idle for an element before it expires. i.e. The maximum amount of time between accesses before an element expires timeToLiveSeconds: Sets the time to live for an element before it expires. i.e. The maximum time between creation time and when an element expires. I understand timeToIdleSeconds But does it means that after the creation & first access of a cache item, the timeToLiveSeconds is not applicable anymore ?

    Read the article

  • what's the difference between php time and sql time

    - by Ying
    Can anyone tell me why the timestamp generated by the php time() function is so different from SQL datetime? If i do a date('Y-m-d', time()); in php, it gives me the time now, as it should. If I just take the time() portion and do: $now = time(); //then execute this statement 'SELECT * FROM `reservation` WHERE created_at < $now' I get nothing. But hey, so if the value of $now was 1273959833 and I queried 'SELECT * FROM `reservation` WHERE created_at < 127395983300000000' Then I see the records that ive created. I think one is tracked in microseconds vs the other is in seconds, but I cant find any documentation on this! What would be the right conversion between these two?? any help appreciated.

    Read the article

  • How to convert server time to local time?

    - by Lost_in_code
    My php file is hosted in some other part of the world. The date() and time() functions returns the date/time on the server. How do I convert that date so that it's the same as my local date/time? The date on the server is 10 hours behind my local time. I could just hard code and substract this from the server time. But what is the proper way of going about this so that no value has to be hardcoded?

    Read the article

  • Real-time graphing in Java

    - by thodinc
    I have an application which updates a variable about between 5 to 50 times a second and I am looking for some way of drawing a continuous XY plot of this change in real-time. Though JFreeChart is not recommended for such a high update rate, many users still say that it works for them. I've tried using this demo and modified it to display a random variable, but it seems to use up 100% CPU usage all the time. Even if I ignore that, I do not want to be restricted to JFreeChart's ui class for constructing forms (though I'm not sure what its capabilities are exactly). Would it be possible to integrate it with Java's "forms" and drop-down menus? (as are available in VB) Otherwise, are there any alternatives I could look into? EDIT: I'm new to Swing, so I've put together a code just to test the functionality of JFreeChart with it (while avoiding the use of the ApplicationFrame class of JFree since I'm not sure how that will work with Swing's combo boxes and buttons). Right now, the graph is being updated immediately and CPU usage is high. Would it be possible to buffer the value with new Millisecond() and update it maybe twice a second? Also, can I add other components to the rest of the JFrame without disrupting JFreeChart? How would I do that? frame.getContentPane().add(new Button("Click")) seems to overwrite the graph. package graphtest; import java.util.Random; import javax.swing.JFrame; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.ValueAxis; import org.jfree.chart.plot.XYPlot; import org.jfree.data.time.Millisecond; import org.jfree.data.time.TimeSeries; import org.jfree.data.time.TimeSeriesCollection; public class Main { static TimeSeries ts = new TimeSeries("data", Millisecond.class); public static void main(String[] args) throws InterruptedException { gen myGen = new gen(); new Thread(myGen).start(); TimeSeriesCollection dataset = new TimeSeriesCollection(ts); JFreeChart chart = ChartFactory.createTimeSeriesChart( "GraphTest", "Time", "Value", dataset, true, true, false ); final XYPlot plot = chart.getXYPlot(); ValueAxis axis = plot.getDomainAxis(); axis.setAutoRange(true); axis.setFixedAutoRange(60000.0); JFrame frame = new JFrame("GraphTest"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ChartPanel label = new ChartPanel(chart); frame.getContentPane().add(label); //Suppose I add combo boxes and buttons here later frame.pack(); frame.setVisible(true); } static class gen implements Runnable { private Random randGen = new Random(); public void run() { while(true) { int num = randGen.nextInt(1000); System.out.println(num); ts.addOrUpdate(new Millisecond(), num); try { Thread.sleep(20); } catch (InterruptedException ex) { System.out.println(ex); } } } } }

    Read the article

  • How to printf a time_t variable as a floating point number?

    - by soneangel
    Hi guys, I'm using a time_t variable in C (openMP enviroment) to keep cpu execution time...I define a float value sum_tot_time to sum time for all cpu's...I mean sum_tot_time is the sum of cpu's time_t values. The problem is that printing the value sum_tot_time it appear as an integer or long, by the way without its decimal part! I tried in these ways: to printf sum_tot_time as a double being a double value to printf sum_tot_time as float being a float value to printf sum_tot_time as double being a time_t value to printf sum_tot_time as float being a time_t value Please help me!!

    Read the article

  • Keeping crosshairs & GUI onscreen - SFML

    - by nihohit
    I read this question, but didn't understand the implementation suggestions with SFML on c#. For example, right now I'm just trying to make sure that the mouse crosshairs stay onscreen constatnly. I tried using this code: View lastView = this._mainWindow.GetView(); this._mainWindow.SetView(this._mainWindow.DefaultView); this._mainWindow.Draw(crosshair); this._mainWindow.SetView(lastView); after drawing all other sprites and before call this._mainWindow.display(), when beforehand I set crosshair.Position based on its position relative to the window, not the view. This just keeps the screen locked and prevents screen scrolling. Any suggestions?

    Read the article

  • Use IIS Application Initialization for keeping ASP.NET Apps alive

    - by Rick Strahl
    Ever want to run a service-like, always-on application inside of ASP.NET instead of creating a Windows Service or running a Console application? Need to make sure that your ASP.NET application is always running and comes up immediately after an Application Pool restart even if nobody hits your site? The IIS Application Initialization Module provides this functionality in IIS 7 and later, making it much easier to create always-on ASP.NET applications that can act like a service.

    Read the article

  • 3d transformation of game world keeping gameplay 2d - COCOS2D 2.0

    - by samfisher
    Using: COCOS2D + iOS. I want to rotate the game world, may be loading another .tmx file for another dimensions when user want to switch dimension. the effect what I am looking for is something like this:CLICK HERE What I have thought of till now: rotating CCCamera will be mandatory. Question: How will I have the other part of the level in place while the camera rotates/rotating? I can load a CCSprite and rotate it accordingly to the 3rd dimension. phew..!! Question: When the camera and world is rotated, will the player controls work properly.. I think not...? I think a better option would be to checkout with COCOS3D... there I could implement 3d world... right?? Question: Not sure how well 2d dynamics will work there as I want to user Box2d as physics engine.. could anyone provide suggestions? Regards, Sam

    Read the article

  • Keeping up with LibreOffice

    - by user1768076
    Installing LibreOffice manually on Ubuntu 12.04 works great following the advice in this answer: http://askubuntu.com/a/182602/103893 It basically is a matter of downloading the most recent release from the LibreOffice site and running sudo apt-get remove libreoffice-core and sudo dpkg -i *.deb. Doing the above I installed LibreOffice 3.6.3 and it works great. But what is the best way to uninstall this new version of LibreOffice (for when the next release is coming along)? Trying sudo apt-get remove libreoffice-core will not do anything, and sudo apt-get remove libreoffice3.6 does not seem to remove all packages installed with dpkg...?

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >