Search Results

Search found 63795 results on 2552 pages for 'compile time metaprogramm'.

Page 16/2552 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | 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

  • 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

  • How to compile 'stygmorgan-0.29'?

    - by iwan
    I am trying to compile stygmorgan-0.29.tar.bz2 and got these messages: stygmorganui.cxx:7:28: fatal error: stygmicon128.xpm: No such file or directory compilation terminated. make[2]: *** [stygmorganui.o] Error 1 make[2]: Leaving directory `/home/papa/Downloads/stygmorgan-0.29/src' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/papa/Downloads/stygmorgan-0.29/src' make: *** [all-recursive] Error 1 papa@papa-G31-M7-TE:~/Downloads/stygmorgan-0.29$

    Read the article

  • Jangaroo 0.7.12, l'application Java qui compile l'Actionscript en JavaScript : une alternative à Flash Player

    Jangaroo 0.7.12, l'application Java qui compile l'Actionscript en JavaScript Une alternative à Flash Player Jangaroo est une suite d'outils incorporant un compilateur écrit en java permettant de faire tourner du code as3 dans un environnement Javascript 1.X plus précisement dans les naviguateurs récents. Jangaroo est un projet open sources sous Apache License, Version 2.0. Exemple d'application : version as3 :http://www.box2dflash.org/ version as3 complié en js : http://www.jangaroo.net/files/exa...

    Read the article

  • How to compile deskew plugin for Gimp?

    - by mtone
    I'm interesting in using this Deskew plugin which appears somewhat old, with broken links in the gimp registry. https://github.com/prokoudine/gimp-deskew-plugin How do I go about installing it on Ubuntu 64-bit 12.10 running Gimp 2.8? I can't figure what I have to "configure" or "make" to compile the plugin. I understand the end result should be placed Noob-level: I know how to get around in a terminal, but that's about it. Thanks!

    Read the article

  • Can I get a C++ Compiler to instantiate objects at compile time

    - by gam3
    I am writing some code that has a very large number of reasonably simple objects and I would like them the be created at compile time. I would think that a compiler would be able to do this, but I have not been able to figure out how. In C I could do the the following: #include <stdio.h> typedef struct data_s { int a; int b; char *c; } info; info list[] = { 1, 2, "a", 3, 4, "b", }; main() { int i; for (i = 0; i < sizeof(list)/sizeof(*list); i++) { printf("%d %s\n", i, list[i].c); } } Using #C++* each object has it constructor called rather than just being layed out in memory. #include <iostream> using std::cout; using std::endl; class Info { const int a; const int b; const char *c; public: Info(const int, const int, const char *); const int get_a() { return a; }; const int get_b() { return b; }; const char *get_c() const { return c; }; }; Info::Info(const int a, const int b, const char *c) : a(a), b(b), c(c) {}; Info list[] = { Info(1, 2, "a"), Info(3, 4, "b"), }; main() { for (int i = 0; i < sizeof(list)/sizeof(*list); i++) { cout << i << " " << list[i].get_c() << endl; } } I just don't see what information is not available for the compiler to completely instantiate these objects at compile time, so I assume I am missing something.

    Read the article

  • How do I succesfully compile Slingshot?

    - by Tigull
    I've been trying to compile Slingshot for a preview of Elementary OS. Even after replacing Gtk.Stock.CLEAR and Gtk.Stock.add with Gtk.STOCK_CLEAR and Gtk.Stock_add in slingshot/widget/entries .vala I still get the following error when executing sudo ./build_run: frontend/widgets/Entries.vala:130.13-130.25: error: The name `Stock_add' does not exist in the context of `Gtk' Gtk.Stock_add ({stock_item}); ^^^^^^^^^^^^^ Compilation failed: 1 error(s), 0 warning(s) mv: cannot stat `slingshot': No such file or directory ./build_run: 7: slingshot: not found I haven't found yet a soulution, therefore any help is appreciated, thanks!

    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

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