difference

What is the difference between these codes?

<input type='text' id='txt' name='txtName' size='20' value='testing'/> <script type="text/javascript" language='javascript'> var val = document.getElementsByName('txtName'); alert(val[0].value); alert(window.txtName.value); </script> In above code we are using alert(val[0].value); alert(window.txtName.value); these two ways ...

What is the difference between these PHP include statements?

include("somefile.php"); include_once("somefile.php"); require("somefile.php"); require_once("somefile.php"); What is the difference between these? ...

Comparing two date / times to find out if 5 mins has lapsed between the two times php

I need to compare two dates to show an edit link if it is within 5 mins after the post was made, in php. If after 5 mins dont show anything. $answer_post_date = get_the_time("Y-m-d"); $current_date = date("Y-m-d"); $formated_current_date = strtotime($answer_post_date); $formated_answer_post_date = strtotime($current_date); At this p...

difference b/w extentions ?

What is the difference b/w these extentions. 1. *.htm or *.html //HTML 2. *.jpg or *.jpeg or *.jpe //Picture format 3. *.pl or *.plx //Perl Thanks, ...

What is difference between output functions in php ?

What is the difference between these code snippets? 1) $f = 12.044545; printf("%f",$f); vprintf("%f",$f); 2) echo("echo"); print("print"); Thanks, ...

onDestroy() won't get called after this.finish()

Hi everyone, I'm wondering why the Motorola Milestone with 2.1-update1 behaves differently from the Emulator or e.g. the Nexus One. I am trying to exit my app with: @Override protected void onPause() { if(mayDestroyActivity) this.finish(); super.onPause(); } This works well on either Emulator or Nexus One. onDestroy() gets ca...

How can I further optimize this color difference function?

I have made this function to calculate color differences in the CIE Lab colorspace, but it lacks speed. Since I'm not a Java expert, I wonder if any Java guru around has some tips that can improve the speed here. The code is based on the matlab function mentioned in the comment block. /** * Compute the CIEDE2000 color-difference betwe...

Differences between iPhone/iPod Simulator and Devices

Hi, since I started iPhone/iPod Development I have come across some differences between how the simulator and how real device react. Maybe I will come across some other differences I will have to figure out as well, maybe other people haven't met these problems here (YET) and can profit from the knowledge, and maybe you know some problem...

Difference between an variable set to nil and 0

if (myFloat == nil){ \\Do Method } In the above situation, the method will run only if myFloat is nil. Will it also run if myFloat was set to 0? ...

Difference between string and StringBuilder

I'd like to know the difference between string and StringBuilder and also need some examples for understanding. ...

Does REGEX differ from PHP to Python

hi there, I found this post: http://stackoverflow.com/questions/118143/python-regex-vs-php-regex but I actually did not get if Python's REGEX syntax matches PHP's REGEX syntax. I started to convert some of my old PHP code to python (due to g's appengine etc.), and now I would like to know whether the regex is 100% convertable, by simpl...

set start and end date for last 30 days ending today with php

Hi I need to generate two dates in the format YYYY-MM-DD example : 2010-06-09 for the last 30 days so end date is today and start date is today - 30 days can you help me generate those two dates in the previous format YYYY-MM-DD thanks folks ...

How to lessen this comparing loop

I need to find which id numbers are missing inside s.data compared to users. Is there a better(smaller code) way to compare? Thanks ;) if(users.length != undefined) { for(y=0;y<users.length;y++) { var left = true; for(y2=0;y2<s.data.length;y2++) { if(users[y].client_id==s.data[y2].client_i...

Hash tables VS associative arrays [PHP]

Recently I have read about hash-tables in a very famous book "Introduction to Algorithms". I haven't used them in any real applications yet, but wanted to. But don't know how to start. Can anyone give me some samples of using it, for example, how to realize dictionary application (like ABBYY Lingvo) using hash-tables? And finally wanted...

c++ Difference between two vector<MyType*> A and B

Dear reader, I've got two vector<MyType*> objects called A and B. The MyType class has a field ID and I want to get the MyType* which are in A but not in B. I'm working on a image analysis application and I was hoping to find a fast/optimized solution. Kind regards, Pollux ...

Formula For Calculating Opposite ("Difference") For Hexadecimal Color

how can i create an opposite of a hexadecimal color? for example, i'd like to convert 0x000000 (black) into 0xFFFFFF (white), or 0xFF0000 (red) into 0x00FFFF (cyan). those are rather basic colors, while variants of colors can have more complex hexadecimal values, such as 0x21B813 (greenish). are bitwise operators required for this? m...

table data gateway and data access object architectural difference

Hi, Can someone describe the main difference between table data gateway (TDG) and data access object (DAO) ? TDG can operate with all row for that table but so and DAO (DAO can save, delete the specified object, but also can do operations on entire table) Regards ...

Calculate the difference between two dates and get the value in years ?

Possible Duplicate: How do I calculate someones age in C#? I want to calculate basically the age of employees - So we have DOB for each employee, So on the C# Side I want to do something like this - int age=Convert.Int32(DateTime.Now-DOB); I can use days and manipulate then get the age...but I wanted to know if there some...

Why is the Asynchronous mode is better than the Synchronous one when handling clients requests ?

I have a client-server project and was searching for the better way to handle the requests from the clients so some people adviced that the Asynchronous mode is better than the synchronous one and the thread pool mode. My question is why ? and is there a disadvantages in the Asynchronous mode ? ...

Storing and retrieving a date in PHP?

This is what I need to do: I need to perform a PHP operation, then retrieve how long ago the last time the operation was performed was. I have it all figured out, except one thing - how do I find the difference between two date/times? Or, is there an easier way to do this? (This is based in Wordpress, so I'm using wp_options to store the...