This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
for ping in range(1,10): | |
address = "127.0.0." + str(ping) | |
res = subprocess.call(['ping', '-c', '3', address]) | |
if res == 0: | |
print ("ping to", address, "OK") | |
elif res == 2: | |
print ("no response from", address) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup as soup | |
from urllib.request import urlopen as uReq | |
my_Url = ("http://agmarknet.gov.in/agnew/namticker.aspx") | |
Client = uReq(my_Url) | |
html = Client.read() | |
Client.close() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
userDatabase.addValueEventListener(new ValueEventListener() { | |
@Override | |
public void onDataChange(DataSnapshot dataSnapshot) | |
{ | |
String name =dataSnapshot.child("name").getValue().toString(); | |
String status =dataSnapshot.child("status").getValue().toString(); | |
String image =dataSnapshot.child("image").getValue().toString(); | |
String thumb_image =dataSnapshot.child("thumbnail").getValue().toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyPDF2 | |
newFile - open('x.pdf','r') | |
pdfreader = PyPDF2.PdfFileReader(newFile) | |
print(pdfreader.getNumPages()) | |
pageObj = pdfreader.getPage(0) | |
x = pageObj.extractText() | |
print(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arr = [4,6,9,2,5,4,6,8,9] | |
seenSet = set() | |
def firstDuplicate(a): | |
for i in a: | |
if i in seenSet: | |
return i | |
else: | |
seenSet.add(i) | |
return -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def firstNotRepeatingCharacter(s): | |
charArray = [] | |
charCount = {} | |
for i in s: | |
if i in charCount: | |
charCount[i] +=1 | |
else: | |
charCount[i] = 1 | |
charArray.append(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def AnagramCheck(s1,s2): | |
if(sorted(s1.lower())== sorted(s2.lower())): | |
print("Anagram") | |
else: | |
print("Not An Anagram") | |
s1 = input("String 1: ") | |
s2 = input("String 2: ") | |
print(AnagramCheck(s1,s2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wikipedia | |
import spacy | |
import textacy.extract | |
# f= open("facts.txt","a+") | |
# Load the large English NLP model | |
nlp = spacy.load('en_core_web_sm') | |
# Detail of the searched word | |
content =wikipedia.page("Apple Inc").content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here are the things I know about Apple: | |
-well known for its size and revenues | |
-the world's largest technology company by revenue and one of the world's most valuable companies | |
-a distant third place competitor to Commodore and Tandy | |
-only weeks away from bankruptcy when Jobs returned. | |
-the third-largest mobile handset supplier in the world due to the popularity of the iPhone | |
-a sign for the “promise of knowledge” that an Apple user may gain from the product. | |
-more than just a company because its founding has some of the qualities of myth | |
-a marketing company |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1: | |
# implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' | |
Step 2 : | |
# <activity | |
android:name="com.theartofdev.edmodo.cropper.CropImageActivity" | |
android:theme="@style/Base.Theme.AppCompat" /> | |
Step 3 : |
OlderNewer