Search Results

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

Page 155/335 | < Previous Page | 151 152 153 154 155 156 157 158 159 160 161 162  | Next Page >

  • What features EJB3 bring and also how does EJB3 stack up with Spring Framework ?

    - by Rachel
    I have never worked on ejb, when I started programming Spring was already arrived and all my projects have been with Spring only, recently I had one interview and they wanted knowledge of EJB3.0 and so I want to know how does EJB3.0 stack up with Spring Framework and why many projects now a day are with Spring Framework and not with EJB3.0, do not quote me here as I can be wrong I would really appreciate if difference and benefits of using one over another could be explained from practical perspective.

    Read the article

  • What about buffering FileInputStream?

    - by Pregzt
    I have a piece of code that reads hell of a lot (hundreds of thousand) of relatively small files (couple of KB) from the local file system in a loop. For each file there is a java.io.FileInputStream created to read the content. The process its very slow and take ages. Do you think that wrapping the FIS into java.io.BufferedInputStream would make a significant difference?

    Read the article

  • Equivalent of System.Windows.Forms.Cursor in Web Application(Asp.Net)

    - by Vishwa
    Hi I have a code in windows application now i am trying to implement in web Application but it is showimg that it ths no cursor class (System.Windows.Forms.Cursor )so..wat is the equivalent in web application. Here is my code private void btnGo_Click(System.Object sender, System.EventArgs e) { this.Cursor = Cursors.WaitCursor; Application.DoEvents(); // Load the images. Bitmap bm1 = (Bitmap) (Image.FromFile(txtFile1.Text)); Bitmap bm2 = (Bitmap) (Image.FromFile(txtFile2.Text)); // Make a difference image. int wid = Math.Min(bm1.Width, bm2.Width); int hgt = Math.Min(bm1.Height, bm2.Height); Bitmap bm3 = new Bitmap(wid, hgt); // Create the difference image. bool are_identical = true; int r1; int g1; int b1; int r2; int g2; int b2; int r3; int g3; int b3; Color eq_color = Color.White; Color ne_color = Color.Transparent; for (int x = 0; x <= wid - 1; x++) { for (int y = 0; y <= hgt - 1; y++) { if (bm1.GetPixel(x, y).Equals(bm2.GetPixel(x, y))) { bm3.SetPixel(x, y, eq_color); } else { bm1.SetPixel(x, y, ne_color); are_identical = false; } } } // Display the result. picResult.Image = bm1; Bitmap Logo = new Bitmap(picResult.Image); Logo.MakeTransparent(Logo.GetPixel(1, 1)); picResult.Image = (Image)Logo; this.Cursor = Cursors.Default; if ((bm1.Width != bm2.Width) || (bm1.Height != bm2.Height)) { are_identical = false; } if (are_identical) { MessageBox.Show("The images are identical"); } else { MessageBox.Show("The images are different"); } //bm1.Dispose() // bm2.Dispose() }

    Read the article

  • When to retain a "delegate"

    - by Jose
    I know that in Objective-C you should never retain your delegates because it may cause a retain-cycle, however, how do you know the difference between a delegate and a non-delegate object ? Can't it be said that just sending a message to any object is delegating work to that object ?

    Read the article

  • c++ std::ostringstream vs std::string::append

    - by NickSoft
    In all examples that use some kind of buffering I see they use stream instead of string. How is std::ostringstream and << operator different than using string.append. Which one is faster and which one uses less resourses (memory). One difference I know is that you can output different types into output stream (like integer) rather than the limited types that string::append accepts. Here is an example: std::ostringstream os; os << "Content-Type: " << contentType << ";charset=" << charset << "\r\n"; std::string header = os.str(); vs std::string header("Content-Type: "); header.append(contentType); header.append(";charset="); header.append(charset); header.append("\r\n"); Obviously using stream is shorter, but I think append returns reference to the string so it can be written like this: std::string header("Content-Type: "); header.append(contentType) .append(";charset=") .append(charset) .append("\r\n"); And with output stream you can do: std::string content; ... os << "Content-Length: " << content.length() << "\r\n"; But what about memory usage and speed? Especially when used in a big loop. Update: To be more clear the question is: Which one should I use and why? Is there situations when one is preferred or the other? For performance and memory ... well I think benchmark is the only way since every implementation could be different. Update 2: Well I don't get clear idea what should I use from the answers which means that any of them will do the job, plus vector. Cubbi did nice benchmark with the addition of Dietmar Kühl that the biggest difference is construction of those objects. If you are looking for an answer you should check that too. I'll wait a bit more for other answers (look previous update) and if I don't get one I think I'll accept Tolga's answer because his suggestion to use vector is already done before which means vector should be less resource hungry.

    Read the article

  • LinkedList.contains execution speed

    - by Le_Coeur
    Why Methode LinkedList.contains() runs quickly than such implementation: for (String s : list) if (s.equals(element)) return true; return false; I don't see great difference between this to implementations(i consider that search objects aren't nulls), same iterator and equals operation

    Read the article

  • How to insert time in SQl Derver 2005?

    - by sam
    i am creating windows application .In this i have to subtract two dates .i subtract it successfully ,i used TimeSpan to get subtracted value.But when i insert it in SQl Server 2005 db, it inserted with starting date i.e. 1/1/1900 and the calculated difference which format should i use to insert Time only? Thanks in advance

    Read the article

  • __proto__ of a function

    - by alter
    if I have a class called Person. var Person = function(fname, lname){ this.fname = fname; this.lname = lname; } Person.prototype.mname = "Test"; var p = new Person('Alice','Bob'); Now, p.proto refers to prototype of Person but, when I try to do Person.proto , it points to function(), and Person.constructor points to Function(). can some1 explain what is the difference between function() and Function() and why prototype of a Function() class is a function()

    Read the article

  • Excel Merge() vs MergeCells

    - by sleepp
    Hi, I'm using VSTO, C#, and Excel but VBA probably applies here as well. What's the difference between calling the Merge(missing) method on a range and setting the MergeCells property to true? Does Merge() fail more often? Thanks!

    Read the article

  • speed of map() vs. list comprehension vs. numpy vectorized function in python

    - by mcstrother
    I have a function foo(i) that takes an integer and takes a significant amount of time to execute. Will there be a significant performance difference between any of the following ways of initializing 'a': a = [foo(i) for i in xrange(100)] , a = map(foo, range(100)) , and vfoo = numpy.vectorize(foo) vfoo(range(100)) ? (I don't care whether the output is a list or a numpy array). Is there some other better way of doing this? Thanks.

    Read the article

  • Will First() perform the OrderBy()?

    - by Martin
    Is there any difference in (asymptotic) performance between Orders.OrderBy(order => order.Date).First() and Orders.Where(order => order.Date == Orders.Max(x => x.Date)); i.e. will First() perform the OrderBy()? I'm guessing no. MSDN says enumerating the collection via foreach och GetEnumerator does but the phrasing does not exclude other extensions.

    Read the article

  • Comparing two text files in python

    - by tazim
    Hi, I need to compare two files and redirect the different lines to third file. I know using diff command i can get the difference . But, is there any way of doing it in python ? Any sample code will be helpful

    Read the article

  • I am working with Visual Studio 2008. Actually there is References folder missing

    - by Azhar
    I am working with Visual Studio 2008. Actually there is References folder missing in its solution explorer. When I create a New web Application it has References folder but when I add new .aspx file it also adds .aspx.designer.cs file with it and its does not show master page option in add dialogue. but in the old web application it shows the master page option where master page file is already added. whats the difference between these two solutions.

    Read the article

  • What does plus sign does here in string?

    - by Thanga
    I would like to know, what is the difference between two statements, these may be simple String ss="myname"; char[] charArray = ss.toCharArray(); for ( char character : charArray ) { System.out.println( +character );//Statements are here what does plus refers here: System.out.println( character ); //Statements are here: } I got the output for the code no errors but little doubt on how it works? What happens here? If you would down vote let me know the reason please , Thanks in advance

    Read the article

  • Page rendering time are not steady in IE6

    - by dan
    I have to support IE6 and I calculate rendering time by creating a timestamp in javascript at the beginning of the page and doing the difference when document.ready is fired in jQuery. If I do 3 pages load, the rendering times in milliseconds can look like this : page 1 : 735, 2672, 734 page 2 : 3063, 1516, 3375 page 3 : 8281, 2531, 3703 Why is that? How can I have more consistency?

    Read the article

< Previous Page | 151 152 153 154 155 156 157 158 159 160 161 162  | Next Page >