Skip to content

Instantly share code, notes, and snippets.

@superrcoop
superrcoop / Inventory System
Last active March 28, 2016 18:55
By using a computerized inventory system, you can replace manual methods of inventory control and reduce the time, cost and effort of inventory management. The new system will be installed in the company’s inventory management to optimize Inventory and data collection records,Reordering,Fixed asset,Perpetual inventory,Loss and theft prevention
/*********************************************************************
Application was compiled in DEV C++ version 5.6.2
Last compile date 15/04/14 09:19
***********************************************************************/
/* HEADERS */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* PRODUCTDATA STRUCTURE DECLARATION */
struct productdata {
@superrcoop
superrcoop / Inventory System 2
Last active April 4, 2016 04:25
The current inventory system doesn’t inform the company on low/out of stock items so when customers request this product there will be none available hence lost is sale and profit also its poor accuracy gives incorrect quotes to customers who indeed to buy products in bulk hence customer dissatisfaction lost in sale and the company’s reliability…
/* ********************************************************************
Application was compiled in DEV C++ version 5.9.2
Last compile date 15/04/15 09:19
***********************************************************************/
/* HEADERS */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@superrcoop
superrcoop / RandomNum
Created March 28, 2016 19:13
Random number generation and sorting in C
#include <stdio.h>
int main()
{
int array[100], n, c, d, swap;
printf("Enter number of elements\n");
scanf("%d", &n);
printf("Enter %d integers\n", n);
@superrcoop
superrcoop / codepython
Created March 28, 2016 19:16
Coding with Python!
#1. Let us begin by creating a constant. Call it Kand assign the value 6174 to it
k=6174
#2. Write a function called gt which accepts two arguments and returns a boolean that indicates
# whether the first argument is greater than the second.
@superrcoop
superrcoop / CounterGame
Created May 14, 2016 15:04
Louise and Richard play a game. They have a counter set to N. Louise gets the first turn and the turns alternate thereafter.Given N, your task is to find the winner of the game.
import java.io.*;
import java.util.*;
import java.lang.*;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int in= scan.nextInt();
@superrcoop
superrcoop / client.py
Last active April 9, 2018 16:15
very simple Diffie - Hellman key exchange. Your client and server will exchange the sequence of messages
# Client to implement simplified Diffie-Hellman protocol and demonstrate socket
# programming in the process
# Author: fokumdt 2016-10-01
# Version: 0.2
#!/usr/bin/python3
import socket
import sys
import math
import random
# Server to implement simplified Diffie-Hellman protocol and demonstrate socket
# programming in the process.
# Author: fokumdt 2016-10-01
# Version: 0.2
#!/usr/bin/python3
import socket
import sys
import random
@superrcoop
superrcoop / scanner.py
Last active April 9, 2018 16:19
Banner scanner is used to locate machines on a network with open, available ports and assess vulnerabilities
import socket
import sys
import os
import timeit
#grab the banner
def grab_banner(ip_address,port):
try:
print 'Creating socket and grabbing banner...'
s=socket.socket()
@superrcoop
superrcoop / cracker.py
Last active April 9, 2018 16:17
very simple password cracker.. see advanced update @https://github.com/superrcoop/crackerjack
import crypt, getpass, pwd
import json,os,sys
import random
ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
def gen_salt():
chars=[]
for i in range(4):
chars.append(random.choice(ALPHABET))
return "".join(chars)
@superrcoop
superrcoop / league-winner.py
Created March 26, 2018 01:50
Calculates the winner and loser of a league
'''
It's March Madness time again, and after watching a game you and a few of your friends decided that you should make your own fantasy league. Being a bit tipsy at the time, you decide to modify the rules a bit.
The number of teams, , can now be between and .
Each team may play multiple games over the course of the league, and each match earns points for both teams.
Standings in the competition are organized based on each team's current overall accumulated points. That is, the team with the largest overall point total will have a rank of 1 and the team with the smallest overall number of points will have rank .
When a match is played, both teams are rewarded league points according to the formula: where is the number of points scored during the match for the team and is the number of points awarded for the result of the match. The number of points awarded for each outcome of a match is defined as follows:
Condition R
Home Win 3000
Away Win 3500