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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#define MAX 65535 | |
// https://github.com/OsandaMalith | |
void banner() { | |
static const char *banner = |
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 <windows.h> | |
#include <stdio.h> | |
#define BUF_SIZE 8192 | |
// http://osandamalith.wordpress.com | |
int main(int argc, LPTSTR argv[]) | |
{ | |
HANDLE hIn, hOut; | |
DWORD nIn, nOut; | |
CHAR buffer[BUF_SIZE]; | |
if (argc != 3) { |
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
#BlueBook code decryption | |
import sys | |
def sieve(n): | |
x = [1] * n | |
x[1] = 0 | |
for i in range(2,n/2): | |
j = 2 * i | |
while j < n: | |
x[j]=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
// Paste this in the JS Console - Tested with Chrome and Firefox | |
for(i = 0; i < navigator.plugins.length; i++) console.log(navigator.plugins[i].name + ' :: ' + navigator.plugins[i].filename); | |
// Printing as HTML - works only with Chrome | |
for(i = 0; i < navigator.plugins.length; i++) document.write(navigator.plugins[i].name + ' :: ' + navigator.plugins[i].filename + '<br>'); |
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
# Flags util (for .gdbinit) | |
# set of commands for easy manipulation on FLAGS | |
# CC-BY: hasherezade | |
# Modified by: @OsandaMalith | |
# Added options for setting and unsetting flags | |
define translate_flag | |
if $argc == 0 | |
help translate_flag | |
else |
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 python2.7 | |
# A 8x8 Chessboard coded for fun | |
# @OsandaMalith | |
## | |
# main | |
## | |
if __name__ == "__main__": | |
for i in range(1,9): | |
for j in range(1,9): |
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
package SRectangle; | |
// CC-BY : Osanda Malith Jayathissa | |
public class Point { | |
private int x, y; | |
public Point(int x, int y) { | |
this.x=(x); | |
this.y=(y); | |
} | |
public int getX() { |
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
sNonKillableProcess('notepad.exe') | |
Func sNonKillableProcess($sProcess) | |
Local $sProcessHandle , $sPid , $sAccess , $sSignedvalue , $ProcessIoPriority , $sProcessInformationLength , $sStruct | |
If Not @Compiled Then Exit |
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
// CC-BY : Osanda Malith Jayathissa (@OsandaMalith) | |
public class Company { | |
// member variables | |
private double[][] sales; | |
private int salesPerson; | |
private int product; | |
private double value; | |
public Company() { | |
this.sales = new double[4][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
import java.util.Random; | |
public class dice { | |
// Codded by Osanda Malith Jayathissa (@OsandaMalith) | |
/* | |
Write a program that simulates the rolling of two dice. The program should use rand to roll the first die and should use rand again to roll the second die. The sum of two values should then be calculated. [Note : Each die can show an integer value from 1 to 6, so the sum of the two values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 being the least frequent sums.] Note that there are 36 possible combinations of the two dice. Your program should roll the two dice 3,600 times. Use a one_dimensional array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also, determine if the totals are reasonable (i.e., there are six ways to roll a 7, so approximately one-sixth of all the rolls should be 7). | |
http://www.freemathhelp.com/rolling-dice.html | |
Outcome List of Combinations Total | |
2 1+1 1 | |
3 1+2, 2+1 2 |
OlderNewer