This file contains hidden or 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/python # This is client.py file | |
import socket # Import socket module | |
s = socket.socket() # Create a socket object | |
host = socket.gethostname() # Get local machine name | |
port = 12345 # Reserve a port for your service. | |
s.connect((host, port)) | |
print s.recv(1024) |
This file contains hidden or 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 socket # Import socket module | |
s = socket.socket() # Create a socket object | |
host = socket.gethostname() # Get local machine name | |
port = 6969 # Reserve a port for your service. | |
s.connect((host, port)) | |
s.send("Hello server!") | |
with open('received_file', 'wb') as f: |
This file contains hidden or 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 | |
import socket | |
TCP_IP = 'localhost' | |
TCP_PORT = 6969 | |
BUFFER_SIZE = 1024 | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect((TCP_IP, TCP_PORT)) |
This file contains hidden or 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 pyDes import * | |
from binascii import unhexlify as unhex | |
key = des(unhex("4C1122171220F74E")) | |
data = "0001010011010111010010010001001001111100100111100001101110000010" | |
encrypted = key.encrypt(data) | |
print ("Encrypted: %r" % encrypted) | |
decrypted = key.decrypt(encrypted) |
This file contains hidden or 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<stdio.h> | |
#include<stdlib.h> | |
#include<math.h> | |
#include<string.h> | |
/* Refer to http://www.coders-hub.com/2013/04/c-code-to-encrypt-and-decrypt-message.html#.Vhs81MryNC1 */ | |
long int p,q,n,t,flag,e[100],d[100],temp[100],j,m[100],en[100],i; | |
char msg[100]; | |
int prime(long int); |
This file contains hidden or 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
<html> | |
<head> | |
<title>CA Map</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script> | |
<style> | |
body { | |
background-color: linen; | |
} |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Assignment on HTML</title> | |
</head> | |
<body> | |
<p> | |
<h2>Hi I'm Divyanshu</h2> | |
<img src="div.jpg" alt="User image" width="180px"> | |
<br> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Learning CSS3</title> | |
<style type="text/css"> | |
body { | |
font-family: "Helvetica", sans-serif; | |
} | |
fieldset { |
This file contains hidden or 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 React, { Component } from 'react'; | |
import { | |
ReactiveBase, | |
CategorySearch, | |
RatingsFilter, | |
ResultCard | |
} from '@appbaseio/reactivesearch'; | |
class App extends Component { | |
onData(res) { |
This file contains hidden or 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 auth0 from 'auth0-js'; | |
import history from './history'; | |
export default class Auth { | |
// Please use your own credentials here | |
auth0 = new auth0.WebAuth({ | |
domain: 'divyanshu.auth0.com', | |
clientID: 'TJyKPI6aRiRwgr6SxlT7ExW10NEHW4Vy', | |
redirectUri: process.env.NODE_ENV === 'development' ? 'http://localhost:3000/callback' : 'https://appbaseio-apps.github.io/reactivesearch-auth0-example/callback', |
OlderNewer