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 sys | |
from socket import socket, AF_INET, SOCK_DGRAM | |
SERVER_IP = '127.0.0.1' | |
PORT_NUMBER = 5000 | |
SIZE = 1024 | |
print("Test client sending packets to IP {0}, via port {1}\n".format(SERVER_IP, PORT_NUMBER)) | |
mySocket = socket(AF_INET, SOCK_DGRAM) |
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 random | |
from itertools import count | |
# Extended Euclidean Algorithm | |
def egcd(a, b): | |
x,y, u,v = 0,1, 1,0 | |
while a != 0: | |
q, r = b//a, b%a | |
m, n = x-u*q, y-v*q | |
b,a, x,y, u,v = a,r, u,v, m,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
#define GLUT_DISABLE_ATEXIT_HACK | |
#include <windows.h> | |
#include <iostream> | |
#include <gl\glut.h> | |
// Initial Position of the Ball | |
float x_position = 0.0; | |
float y_position = 0.0; | |
// Radius of ball |
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
#define GLUT_DISABLE_ATEXIT_HACK | |
#include <windows.h> | |
#include <gl\glut.h> | |
#include <iostream> | |
float x1=-2.0, x2=2.0; | |
static int flag=1; | |
static int i=0; |
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 <GL/glut.h> | |
static float zoom_factor = 0.5; | |
float ver[8][3] = | |
{ | |
{-0.5 , -0.5 , 0.5} , | |
{-0.5 , 0.5 , 0.5} , | |
{0.5 , 0.5 , 0.5} , | |
{0.5 , -0.5 , 0.5} , |
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 <GLUT/glut.h> // glut (gl utility toolkit) basic windows functions, keyboard, mouse. | |
#include <stdio.h> // standard (I/O library) | |
#include <stdlib.h> // standard library (set of standard C functions | |
#include <math.h> // Math library (Higher math functions ) | |
#include <string.h> | |
// lighting | |
GLfloat LightAmbient[]= { 0.5f, 0.5f, 0.5f, 1.0f }; | |
GLfloat LightDiffuse[]= { 0.5f, 0.5f, 0.5f, 1.0f }; | |
GLfloat LightPosition[]= { 5.0f, 25.0f, 5.0f, 1.0f }; |
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 <math.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define WIDTH 600 | |
#define HEIGHT 600 | |
#include <GLUT/glut.h> |