D
Size: a a a
D
M
Unknown topic.
Do you mean one of these topics maybe?
* finger 67
* logger 67
* ranger 67
RB
D
M
/*
* Unknown cheat sheet.
* Please try to reformulate your query
*/
D
D
M
Unknown topic.
Do you mean one of these topics maybe?
* leave 73
* lvs 67
* psql/views 63
D
M
/*
* Is there an O(n) integer sorting algorithm?
*
* Yes, radix sort and counting sort are O(N). They are NOT comparison-
* based sorts, which have been proven to have Ω(N log N) lower bound.
*
* To be precise, radix sort is O(kN), where k is the number of digits in
* the values to be sorted. Counting sort is O(N + k), where k is the
* range of the numbers to be sorted.
*
* There are specific applications where k is small enough that both
* radix sort and counting sort exhibit linear-time performance in
* practice.
*
* [polygenelubricants] [so/q/2352313] [cc by-sa 3.0]
*/
RB
M
# tar
# Archiving utility.
# Often combined with a compression method, such as gzip or bzip.
# More information: <https://www.gnu.org/software/tar>.
# Create an archive from files:
tar cf target.tar file1 file2 file3
# Create a gzipped archive:
tar czf target.tar.gz file1 file2 file3
# Create a gzipped archive from a directory using relative paths:
tar czf target.tar.gz -C path/to/directory .
# Extract a (compressed) archive into the current directory:
tar xf source.tar[.gz|.bz2|.xz]
# Extract a (compressed) archive into the target directory:
tar xf source.tar[.gz|.bz2|.xz] -C directory
# Create a compressed archive, using archive suffix to determine the compression program:
tar caf target.tar.xz file1 file2 file3
# List the contents of a tar file:
tar tvf source.tar
# Extract files matching a pattern:
tar xf source.tar --wildcards "*.html"
# Extract a specific file without preserving the folder structure:
tar xf source.tar source.tar/path/to/extract --strip-components=depth_to_strip
D
M
/*
* A RW lock for c++11 threads
*
* std::shared_mutex will be part of the C++14 Standard Library. It did
* not make it to C++11 just because there was no time to formulate a
* proposal and discuss it thoroughly.
*
* You can still use boost::shared_mutex though. Under Windows, if you
* are working with Windows Vista or later, you can use Slim Read-Write
* Locks (http://msdn.microsoft.com/en-
* us/library/windows/desktop/aa904937%28v=vs.85%29.aspx), which are
* optimized for speed and memory consumption.
*
* [Andy Prowl] [so/q/16774469] [cc by-sa 3.0]
*/
RB
D
M
/*
* Generate all string of given length, from given characters
* ...stackoverflow.com › questions › generate-all-string-of-...
*
* No need of use multithreading for this algorithm. The for loop is only
* for generating string for required length. In java the code is like
* this.
*/
import java.util.Random;
public class RandomString2 {
static String[] option = {"a","b","v","k"};
static String getRandomElement()
{
int idx = new Random().nextInt(option.length);
return option[idx];
}
static String getRandomString(int length)
{
String result="";
for(int i = 1; i<=length ; i++)
{
result += getRandomElement();
}
return result;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(getRandomString(5)); // pass string length as parameter
}
}
/* [Shahbaz Hashmi] [so/q/38229883] [cc by-sa 3.0] */
RB
IG
M
Unknown topic.
Do you mean one of these topics maybe?
* pt 67
* apt 57
* gap/ 57