times (1,320)


When should you use 'friend' in C++?

When should you use 'friend' in C++?

I have been reading through the C++ FAQ and was curious about the friend declaration. I personally have never used it, however I am interested in exploring the language. What is a good example of usin…


windows - Copying Files over an Intermittent Network Connection

I am looking for a robust way to copy files over a Windows network share that is tolerant of intermittent connectivity. The application is often used on wireless, mobile workstations in large hospita…


php - sleep() silently hogs CPU

I'm running Apache on Linux within VMWare. One of the PHP pages I'm requesting does a sleep(), and I find that if I attempt to request a second page whilst the first page is sleep()'ing, the second…


Capturing a repeated group

I am attempting to parse a string like the following using a.NET regular expression: H3Y5NC8E-TGA5B6SB-2NVAQ4E0 and return the following using Split: H3Y5NC8E TGA5B6SB 2NVAQ4E0 I validat…


How do I get the difference between two Dates in JavaScript?

I'm creating an application which lets you define events with a time frame. I want to automatically fill in the end date when the user selects or changes the start date. I can't quite figure out, ho…


How do I write a for loop in bash

I'm looking for the basic loop like: for(int i=0; i<MAX; i++){doSomething(i);}but for bash.…



asp.net - Is there a reliable way to prevent cheating in a web based contest where anonymous users can vote?

I'm working on a web-based contest which is supposed to allow anonymous users to vote, but we want to prevent them from voting more than once. IP based limits can be bypassed with anonymous proxies,…


What's the best option for searching in Ruby on Rails?

There are several plugin options for building a search engine into your Ruby on Rails application. Which of these is the best? Thinking Sphinx UltraSphinx Sphincter acts_as_sphinx acts_as_ferret Fe…


c# - Algorithm to find which numbers from a list of size n sum to another number

I have a decimal number(let's call it goal) and an array of other decimal numbers(let's call the array elements) and I need to find all the combinations of numbers from elements which sum to goal.…


xml - Counter inside xsl:for-each loop

How to get a counter inside xsl:for-each loop that would reflect the number of current element processed. For example my source XML is<books><book><title>The Unbearable Lightness of Bei…




multiple how the two and time with number between for