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
#include <bits/stdc++.h> | |
using namespace std; | |
#define ll long long | |
int main() { | |
ll t; | |
cin>>t; | |
while(t--) | |
{ | |
ll n; | |
cin>>n; |
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
#include <bits/stdc++.h> | |
using namespace std; | |
int main(){ | |
long int t; | |
cin>>t; | |
while(t>0){ | |
long long int c,d,l; | |
cin>>c>>d>>l; | |
long long int minl, maxl; | |
if(c < (2*d)) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
404. | |
A simple multithreaded dead link crawler. | |
""" | |
import os |
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 pymongo import MongoClient | |
CONNECTION = 'mongodb://abhishek:abhishek@ds143388.mlab.com:43388/intreader' | |
client = MongoClient(CONNECTION) | |
db = client.intreader | |
db.books.insert({"id": id , "book_name" : "name_of_the_book" , "pages" : "total_number_of_pages"}) | |
previous_page = db.pages.find().sort('$natural', pymongo.DESCENDING).limit(-1).next() | |
pid = previous_page.id + 1 | |
db.pages.insert({"id": id , "book_id" : "id" , "text" : "page_text" , "page_number": "p" }) |
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 os | |
import pdftotext | |
from collections import defaultdict | |
# Load your PDF | |
def reader(): | |
json = {} | |
with open("Resume.pdf", "rb") as f: |
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 requests | |
def download_file_from_google_drive(id, destination): | |
def get_confirm_token(response): | |
for key, value in response.cookies.items(): | |
if key.startswith('download_warning'): | |
return value | |
return None |
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
<ul class="messages_admin"> | |
<li class="message right appeared"> | |
<div class="text_wrapper"> | |
<div class="text"> | |
What is Vedic Maths? | |
</div> | |
</div> | |
</li> | |
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
require 'net/http' | |
require 'json' | |
class Bots::VedicmathsController < ApplicationController | |
def show | |
@messages = Message.all | |
end | |
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
module ApplicationCable | |
class Connection < ActionCable::Connection::Base | |
identified_by :current_chat | |
identified_by :current_visitor | |
def connect | |
if cookies.signed['chat'] == nil | |
cookies.signed['chat'] = return_random_string | |
end | |
puts cookies.signed['chat'] | |
puts "\n this is from connection.rb file" |
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
#First way | |
#copy this console | |
curl -X POST -H "Content-Type: application/json" -d '{ | |
"setting_type":"greeting", | |
"greeting":{ | |
"text":"Timeless apparel for the masses." | |
} | |
}' "https://graph.facebook.com/v2.6/me/thread_settings?access_token=PAGE_ACCESS_TOKEN" | |
#second way |