Search Results

Search found 8367 results on 335 pages for 'temporal difference'.

Page 40/335 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • Timer in java ,time difference problem

    - by javatechi
    I want to create a timer for my app. The sample code is shown below. When the method datetwo() is called the same time in milliseconds is shown as there in the main method. Please help me out with this import java.util.Date; import java.util.Timer; public class TimerChe { Timer timer; static Date date = new Date(); static Date date2 = new Date(); public static void timerMethod(){ new Thread() { public void run() { try { while (true) { sleep(10000); datetwo(); } } catch (InterruptedException ex) { } } }.start(); } public static void datetwo() { System.out.println ("OK, It's time to do something!") ; System.out.println("The Time is " + date2.getTime() + " milliseconds since 1970/01/01"); } public static void main(String args[]) throws Exception { System.out.println("The Time is " + date.getTime() + " milliseconds since 1970/01/01" ); System.out.println ("Schedule something to do in the mean time.") ; timerMethod(); } }

    Read the article

  • Time difference in seconds (as a floating point)

    - by pocoa
    >>> from datetime import datetime >>> t1 = datetime.now() >>> t2 = datetime.now() >>> delta = t2 - t1 >>> delta.seconds 7 >>> delta.microseconds 631000 Is there any way to get that as 7.631000 ? I can use time module, but I also need that t1 and t2 variables as DateTime objects. So if there is a way to do it with datettime, that would be great.

    Read the article

  • Strange difference between optimized/non optimized microsoft c++ code

    - by Anders Forsgren
    I have a c++ program with a method that looks something like this: int myMethod(int* arr1, int* arr2, int* index) { arr1--; arr2--; int val = arr1[*index]; int val2 = arr2[val]; doMoreThings(val); } With optimizations enabled (/O2) the first line where the first pointer is decremented is not executed. I assume the compiler believes that the arr1 array is not used since it thinks it can remove the decrement. Am I violating some convention in the above code? What could cause this behavior? It is a very old piece of f2c-translated code, the pointer decrement is due to the 1-based indexing of the original code.

    Read the article

  • Difference between var and Class class in object creation

    - by Divine
    Its a silly question, however shocked to see different behaviors. Learning a lot. Lets say I have two classes below Class A { public void Display() { } } Class B : A { public void Display() { } } Class C : B { public void Display() { } } Class Final { static void Main() { var c = new C(); // B c = new C(); //My doubt is, both of the above gives different results. May I know B c = new C() creates object of B or C? What I understood is, it creates object of B. Then why we say "new C()"? I agree with C c = new C(); But I thought, B b = new C(); creates object of B. Where we use this style? Only when utilizing runtime polymorphism? (Overriding methods)? } }

    Read the article

  • Small line-height cross-browser difference

    - by AESM
    So basicly my problem is that the line-heights in Firefox are a little bittle "larger" than in other browsers even though they're all fixed line-heights. For example, you have a block element which has a height from 100px and the line-height is set to 102px. Now, in Firefox the vertical alignment of text is perfect. But in the latest Chrome and Safari 4, the text stands 2px or so higher. Isn't there any way to fix this? Thanks.

    Read the article

  • difference between 2 pieces Python code

    - by draw
    Hello, I'm doing an exercise as following: # B. front_x # Given a list of strings, return a list with the strings # in sorted order, except group all the strings that begin with 'x' first. # e.g. ['mix', 'xyz', 'apple', 'xanadu', 'aardvark'] yields # ['xanadu', 'xyz', 'aardvark', 'apple', 'mix'] # Hint: this can be done by making 2 lists and sorting each of them # before combining them. sample solution: def front_x(words): listX = [] listO = [] for w in words: if w.startswith('x'): listX.append(w) else: listO.append(w) listX.sort() listO.sort() return listX + listO my solution: def front_x(words): listX = [] for w in words: if w.startswith('x'): listX.append(w) words.remove(w) listX.sort() words.sort() return listX + words as I tested my solution, the result is a little weird. Here is the source code with my solution: http://dl.dropbox.com/u/559353/list1.py. You might want to try it out.

    Read the article

  • date difference and match with value in javascript

    - by Lalit Dhake
    Hi I have the Drop down with values as "One year ", "Two year",...etc.. Ok? also i have two ajax textbox with calender extender . I want to popup alert message if dropdown selected value is "One year" and duration between the both textbox value Means dates not matches. getting what i mean ? please help me. How can i get this scenario in javascript ??

    Read the article

  • difference why.............

    - by gcc
    char x; for(i=0;i<256;i+=10) {x=i; if(x==i) printf("%d liii\n",i); else printf("%d sfffi\n",i); } 0 liii 10 liii 20 liii 30 liii 40 liii 50 liii 60 liii 70 liii 80 liii 90 liii 100 liii 110 liii 120 liii 130 sfffi 140 sfffi 150 sfffi 160 sfffi 170 sfffi 180 sfffi 190 sfffi 200 sfffi 210 sfffi 220 sfffi 230 sfffi 240 sfffi 250 sfffi

    Read the article

  • What's the difference between C and C++

    - by Dinah
    I know that C++ has the concept of objects but C doesn't. I also know that pretty much all there is to know about C fits into K & R but the C++ library is vastly more complex. There have got to be other big differences though. What are the major differences between C and C++?

    Read the article

  • What is the difference?

    - by Eragonio
    I try out CakePHP. I follow this Tutorial and can't find out why this code doesn't work. The code from the tutorial works fine. echo $html -> link('Löschen', array('action' => 'delete', 'id' => $post['Post']['id']), null, 'Sind Sie sicher?' );

    Read the article

  • what's the difference between DEFAULT_SIZE and PREFERRED_SIZE?

    - by CD1
    hi, I'm using Swing GroupLayout and I'm confused about the values GroupLayout.DEFAULT_SIZE and GroupLayout.PREFERRED_SIZE. I never know when to use each one of them in methods like GroupLayout.addComponent(Component, int, int, int). suppose I have this code: GroupLayout l = ...; l.setHorizontalGroup(l.createSequentialGroup() .addComponent(tf1) .addComponent(tf2)); l.setVerticalGroup(l.createParallelGroup() .addComponent(tf1) .addComponent(tf2)); there are two JTextFields on a single line laid out with GroupLayout (one sequential group horizontally and one parallel group vertically). if I resize the window now, both components get the available space (50% each). but I want only the first text field to grow/shrink horizontally and only the second text field to grow/shrink vertically. what values of min, pref and max should I use to accomplish that? I know I can just try it and see what combination works but I'd like to know the reasoning behind this problem.

    Read the article

  • Difference between User Control and Custom Control Library

    - by Rod
    I'm working on creating a date/time user control in WPF using C# 2008. My first user control. I'm also using Matthew MacDonald's book, "Pro WPF in C# 2008". In that book he strongly recommended creating a user control using the WPF Custom Control Library project template; so I followed his suggestion. I've finished writing the code which would go into what I think of as the code-behind file. Now I'm ready to write the XAML. The only problem is, I just discovered there is no corresponding .xaml file? So, I don't get why using a WPF Custom Control Library project is better, or prefered, when writing a user control?

    Read the article

  • What's the difference between these SQL conditions?

    - by wesley luan
    Select * from Example where 1 = Case when :index = 0 then Case when DateEx Between :pDat1 and :pDate2 then 1 end else Case When :index = 1 or :index = 2 then Case When DateEx >= :pDat1 then 1 end end end And Select * from Example where 1 = Case when :index = 0 then Case when DateEx Between :pDat1 and :pDat2 then 1 end else 1 end and 1 = Case When :index = 1 or :index = 2 then Case When DateEx >= :pDat1 then 1 end end

    Read the article

  • Difference between a Deprecated and Legacy API?

    - by Vaibhav Bajpai
    I was studying the legacy API's in the Java's Collection Framework and I learnt that classes such as Vector and HashTable have been superseded by ArrayList and HashMap. However still they are NOT deprecated, and deemed as legacy when essentially, deprecation is applied to software features that are superseded and should be avoided, so, I am not sure when is a API deemed legacy and when it is deprecated.

    Read the article

  • mysterious difference between rake test and ruby

    - by standup75
    Here is the mysterious: I have a scope which looks like this (in Image.rb) scope :moderate_all, delegates.where("moderation_flag = #{$moderation_flags[:not_moderated]}") Note that delegates is another scope that I am defining before moderate_all When I leave it like this, I can run my test that checks if an image has been "checked-out" it is not available anymore. I don't put the code of the test, because it does not matter actually. With this code, when I run "rake test" it fails, but if I do "ruby test/unit/image_test.rb" it works! I was thinking I am starting to have a bad day. Then I tried scope :moderate_all, lambda { delegates.where("moderation_flag = #{$moderation_flags[:not_moderated]}") } And "rake test" passes! So my problem is solved, but why?

    Read the article

  • Difference in displaying inner div between IE and Chrome

    - by Gaara
    I have this code that has one "outerDIV" that contains an "innerDIV". On chrome the "innerDIV" size is 491px, whereas on IE it is 425px (same as outerDIV). Hence, on Chrome I can see the first two children of "innerdiv": "My test string #1" and "test2". But for IE I can only see the first child. I am not quite sure what the "right" behavior should be, as firefox does the same as IE. However I would like to have IE do the same as Chrome. I have been experimenting with some css styles (mainly overflow and display), but still can't make it right: IE will expand its height instead of its width to make the elements fit. Can you guys help me figure out a way to change the css so that IE will wraps the div elements inline? As a restriction though, I cannot change the width on the HTML. As a benefit, I am using a css that only loads for IE to patch these kind of IE inconsistencies. The same css will NOT load for chrome, so I don't need to worry about messing with chrome when changing the IE CSS. Thanks in advance! <html> <head> <style type="text/css"> <!-- body { font-family: helvetica; } .myContainer { overflow: hidden; border: 1px solid rgba(0, 0, 0, .5); font-size: 14pt; height: 49px; line-height: 49px; overflow: hidden; display: block; } .myContainer > DIV { float: left; white-space: nowrap; display: block; } .myContainer .item:first-child { padding-left: 10px; } .myContainer .item { float: left; padding-right: 32px; } --> </style> </head> <body> <div id="outerDIV" class="myContainer" style="display: block; width: 425px;"> <div id="innerDIV"> <div class="item"> --------My test string #1-------- </div> <div class="item"> ------test2------- </div> <div class="item"> test </div> </div> </div> </body> </html>

    Read the article

< Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >