How to Install Maven on Linux

This article will help you to install Maven on Linux Operating System. What is Apache Maven? Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project’s build, reporting and documentation from a central piece of information. Prerequisites:  Maven 3.3 requires…

Read More
Post JSON data via PHP cURL

Post JSON data via PHP cURL

Post JSON data via PHP cURL We can Post JSON data via PHP curl by using header Content-Type: application/json in CURLOPT_HTTPHEADER. Below is working code demonstration of PHP curl with post json field. <?php $url = ‘http://yourdomain.com’; $jsonString = json_encode(array(“key” => “value”)); // You can directly replace your JSON string with $jsonString variable. $ch = curl_init();…

Read More

Check for Anagrams in Python

Check for Anagrams in Python Two strings are anagrams if they contain the same characters in the same frequency, just in a different order. For example, “listen” and “silent” are anagrams. Solution 1: Sort and Compare def is_anagram(s1, s2): return sorted(s1.lower()) == sorted(s2.lower()) print(is_anagram(“listen”, “silent”)) # True print(is_anagram(“hello”, “world”)) # False Solution 2: Using Counter…

Read More
Verified by MonsterInsights