An efficient way to show a random value from an array, using PHP’s array_rand() functions.
Sort an Array of Strings in Reverse Order
Learn how to sort an array efficiently using the sort() method and a custom Comparator in Java.
Standardize string to a strict format
Some file systems don’t accept spaces and make no difference between lowercase and uppercase characters. Also when doing mod_rewrite and you would like to standardize an URL, it’s a good idea (although not always necessary) to remove white spaces and other special characters. This PHP function standardizes a string using a series of function calls and regular expressions.
Extract the file extension using PHP
Extract the file extension of the specified file name / file path using the pathinfo() function.
Find Twin Primes
Find the first 1000 twin prime numbers in Java using an isPrime function for the primality check and a value comparison between the prime numbers.
FTP Connection Using PHP
This sample code shows you how to connect to a remote FTP server using PHP’s built-in functions, retrieve a text file and save it on the current server.
Docker Leads with GenAI Stack: A New Era for Developers
In a groundbreaking announcement, Docker, in collaboration with its strategic partners, has introduced the GenAI Stack to the world. This platform is a beacon of innovation, designed to streamline the development process for generative AI applications. It’s a bold step towards a future where developers can quickly turn their AI concepts into reality, without the […]
Convert RGB Color Value To Hexadecimal
A simple way to convert RGB colors to their hexadecimal values by using the dechex() function.
Extended Euclidean Algorithm Function
A function for finding the modular multiplicative inverse, based on an extended version of the Euclidean algorithm.
Round Floating Point Numbers
Custom floating point rounding based on three functions that allow you to round to a certain precision, round up and round down.