ANY MONTH OF ANY YEAR SPAM Thread

ATS

Corporal
Former Krew Member
<html>
<head>
<title>My Great Web page</title>
</head>
<body>
<div id="fb-root"></div>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-like"></div>
</body>
</html><html>
<head>
<title>My Great Web page</title>
</head>
<body>
<iframe src="http://www.facebook.com/plugins/like.php?href=YOUR_URL"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"></iframe>
</body>
</html><html>
<head>
<title>My Great Web page</title>
</head>
<body>
<iframe src="http://www.facebook.com/plugins/like.php?href=YOUR_URL"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"></iframe>
</body>
</html>
<html>
<head>
<title>My Great Web page</title>
</head>
<body>
<iframe src="http://www.facebook.com/plugins/like.php?href=YOUR_URL"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"></iframe>
</body>
</html>
 

Freeze

Second Lieutenant
Former Krew Member
That's 5 year old coding you use there and you didn't declare a doctype for HTML 5 = FAIL (Replying to ATS)
 

Ethan

Captain
Former Krew Member
<html>
<head>
<title>My Great Web page</title>
</head>
<body>
<div id="fb-root"></div>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-like"></div>
</body>
</html><html>
<head>
<title>My Great Web page</title>
</head>
<body>
<iframe src="http://www.facebook.com/plugins/like.php?href=YOUR_URL"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"></iframe>
</body>
</html><html>
<head>
<title>My Great Web page</title>
</head>
<body>
<iframe src="http://www.facebook.com/plugins/like.php?href=YOUR_URL"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"></iframe>
</body>
</html>
<html>
<head>
<title>My Great Web page</title>
</head>
<body>
<iframe src="http://www.facebook.com/plugins/like.php?href=YOUR_URL"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"></iframe>
</body>
</html>
#include <iostream>
#include <string.h>
#include <conio.h>
#include <fstream>
#include <vector>
#include <windows.h>
#include "resource.h"
#pragma resource "hangman.res"
#define MAX 13
using namespace std;

void LoadFileInResource(int name, int type, int& size, char*& data)
{
HMODULE handle = GetModuleHandle(NULL);
HRSRC rc = FindResource(handle, MAKEINTRESOURCE(name),
MAKEINTRESOURCE(type));
HGLOBAL rcData = LoadResource(handle, rc);
size = ::SizeofResource(handle, rc);
data = (char*)(LockResource(rcData));
}

int lineCount(vector<char*> &fileLines) {
int number_of_lines(0), size(0);
char* lines, *buff, *data(NULL);
int language;
char lang = ' ';

cout << "Select Language\n 1. Romanian\n 2. English\n a. Four letter words\n b. Five letter words\n";
while(lang != '1' && lang != '2' && lang != 'a' && lang != 'b') {
cin >> lang;
switch(lang) {
case '1':
language = ROMANIAN;
break;
case '2':
language = ENGLISH;
break;
case 'a':
language = FOUR;
break;
case 'b':
language = FIVE;
break;
default:
cout << "1 or 2: ";
}
}
LoadFileInResource(language, TEXTFILE, size, data);
buff = new char[size];
cout << buff;
strncpy(buff, data, size);
lines = strtok(buff, "\r\n");

while (lines != NULL) {
++number_of_lines;
fileLines.push_back(lines);
lines = strtok (NULL, "\n");
}
delete[] buff;
return number_of_lines;
}

int main()
{
int count(0), count2(0), tries(7), use(0), pos;
char word[MAX], lines[MAX], used[2*MAX], guess;
char menuChar = ' ', again = ' ';
vector<char*> fileLines;
string menu;
srand(time(0));
bool restart = true;

while(restart) {

restart = false;
//initialize arrays slots as NULL
for(int i=0; i < MAX; i++){
lines = NULL;
word = NULL;
}
for(int i=0; i < 2*MAX; i++)
used = NULL;

//menu
cout << "Press '1' to play alone\nPress '2' to play with a friend\n";
cout << "1 or 2: ";

while(menuChar != '1' && menuChar != '2'){
cin >> menu;
menuChar = menu[0];
switch(menuChar) {
case '1':
pos = rand() % lineCount(fileLines);
memcpy(word, fileLines[pos], strlen(fileLines[pos])-1);
clrscr();
break;
case '2':
cout << "Enter the word to be guessed: ";
cin >> word;
clrscr();
break;
default:
cout << "1 or 2: ";
}
}

//count the number of letters in the word for lines
for(unsigned int i=0; i < MAX; i++) {
if(word != NULL) {
lines = '_';
count2++;
}
}

gallows(tries);
cout << endl << endl << endl;
for(int i=0; i < MAX; i++)
cout << lines << " ";
cout << endl << endl << used << endl;

while (tries > 0) {
cin >> guess;
used[use] = guess;
for(int j=0; j < count2; j++) {
if(guess == word[j])
lines[j] = guess;
if (lines[j] == word[j])
count++;
}
if(!memchr(word, guess, count2) && !memchr(used, guess, use)){
tries--;
}
if(count == count2){
cout << endl << lines << endl;
cout << "\nGood Job!" << endl;
goto END;
}

count = 0;
use++;
clrscr();
gallows(tries);
cout << endl << endl << endl;
for(int i=0; i < MAX; i++)
cout << lines << " ";
cout << endl << endl << used << endl;
}

cout << "\nThe word was: " << word << endl;
END:
cout << "Would you like to play again?(y/n): ";
while(again != 'y' && again != 'n'){
cin >> again;
}
if(again == 'y') { // reset counter and error checking values and clear vector
count = 0;
count2 = 0;
tries = 7;
use = 0;
again = ' ';
menuChar = ' ';
fileLines.clear();
clrscr();
restart = true;
}
}
return 0;
}
#include <iostream>
#include <string.h>
#include <conio.h>
#include <fstream>
#include <vector>
#include <windows.h>
#include "resource.h"
#pragma resource "hangman.res"
#define MAX 13
using namespace std;

void LoadFileInResource(int name, int type, int& size, char*& data)
{
HMODULE handle = GetModuleHandle(NULL);
HRSRC rc = FindResource(handle, MAKEINTRESOURCE(name),
MAKEINTRESOURCE(type));
HGLOBAL rcData = LoadResource(handle, rc);
size = ::SizeofResource(handle, rc);
data = (char*)(LockResource(rcData));
}

int lineCount(vector<char*> &fileLines) {
int number_of_lines(0), size(0);
char* lines, *buff, *data(NULL);
int language;
char lang = ' ';

cout << "Select Language\n 1. Romanian\n 2. English\n a. Four letter words\n b. Five letter words\n";
while(lang != '1' && lang != '2' && lang != 'a' && lang != 'b') {
cin >> lang;
switch(lang) {
case '1':
language = ROMANIAN;
break;
case '2':
language = ENGLISH;
break;
case 'a':
language = FOUR;
break;
case 'b':
language = FIVE;
break;
default:
cout << "1 or 2: ";
}
}
LoadFileInResource(language, TEXTFILE, size, data);
buff = new char[size];
cout << buff;
strncpy(buff, data, size);
lines = strtok(buff, "\r\n");

while (lines != NULL) {
++number_of_lines;
fileLines.push_back(lines);
lines = strtok (NULL, "\n");
}
delete[] buff;
return number_of_lines;
}

int main()
{
int count(0), count2(0), tries(7), use(0), pos;
char word[MAX], lines[MAX], used[2*MAX], guess;
char menuChar = ' ', again = ' ';
vector<char*> fileLines;
string menu;
srand(time(0));
bool restart = true;

while(restart) {

restart = false;
//initialize arrays slots as NULL
for(int i=0; i < MAX; i++){
lines = NULL;
word = NULL;
}
for(int i=0; i < 2*MAX; i++)
used = NULL;

//menu
cout << "Press '1' to play alone\nPress '2' to play with a friend\n";
cout << "1 or 2: ";

while(menuChar != '1' && menuChar != '2'){
cin >> menu;
menuChar = menu[0];
switch(menuChar) {
case '1':
pos = rand() % lineCount(fileLines);
memcpy(word, fileLines[pos], strlen(fileLines[pos])-1);
clrscr();
break;
case '2':
cout << "Enter the word to be guessed: ";
cin >> word;
clrscr();
break;
default:
cout << "1 or 2: ";
}
}

//count the number of letters in the word for lines
for(unsigned int i=0; i < MAX; i++) {
if(word != NULL) {
lines = '_';
count2++;
}
}

gallows(tries);
cout << endl << endl << endl;
for(int i=0; i < MAX; i++)
cout << lines << " ";
cout << endl << endl << used << endl;

while (tries > 0) {
cin >> guess;
used[use] = guess;
for(int j=0; j < count2; j++) {
if(guess == word[j])
lines[j] = guess;
if (lines[j] == word[j])
count++;
}
if(!memchr(word, guess, count2) && !memchr(used, guess, use)){
tries--;
}
if(count == count2){
cout << endl << lines << endl;
cout << "\nGood Job!" << endl;
goto END;
}

count = 0;
use++;
clrscr();
gallows(tries);
cout << endl << endl << endl;
for(int i=0; i < MAX; i++)
cout << lines << " ";
cout << endl << endl << used << endl;
}

cout << "\nThe word was: " << word << endl;
END:
cout << "Would you like to play again?(y/n): ";
while(again != 'y' && again != 'n'){
cin >> again;
}
if(again == 'y') { // reset counter and error checking values and clear vector
count = 0;
count2 = 0;
tries = 7;
use = 0;
again = ' ';
menuChar = ' ';
fileLines.clear();
clrscr();
restart = true;
}
}
return 0;
}
 

Ethan

Captain
Former Krew Member
Oh yeah and:

#include <iostream>
#include <string.h>
#include <conio.h>
#include <fstream>
#include <vector>
#include <windows.h>
#include "resource.h"
#pragma resource "hangman.res"
#define MAX 13
using namespace std;

void LoadFileInResource(int name, int type, int& size, char*& data)
{
HMODULE handle = GetModuleHandle(NULL);
HRSRC rc = FindResource(handle, MAKEINTRESOURCE(name),
MAKEINTRESOURCE(type));
HGLOBAL rcData = LoadResource(handle, rc);
size = ::SizeofResource(handle, rc);
data = (char*)(LockResource(rcData));
}

int lineCount(vector<char*> &fileLines) {
int number_of_lines(0), size(0);
char* lines, *buff, *data(NULL);
int language;
char lang = ' ';

cout << "Select Language\n 1. Romanian\n 2. English\n a. Four letter words\n b. Five letter words\n";
while(lang != '1' && lang != '2' && lang != 'a' && lang != 'b') {
cin >> lang;
switch(lang) {
case '1':
language = ROMANIAN;
break;
case '2':
language = ENGLISH;
break;
case 'a':
language = FOUR;
break;
case 'b':
language = FIVE;
break;
default:
cout << "1 or 2: ";
}
}
LoadFileInResource(language, TEXTFILE, size, data);
buff = new char[size];
cout << buff;
strncpy(buff, data, size);
lines = strtok(buff, "\r\n");

while (lines != NULL) {
++number_of_lines;
fileLines.push_back(lines);
lines = strtok (NULL, "\n");
}
delete[] buff;
return number_of_lines;
}

int main()
{
int count(0), count2(0), tries(7), use(0), pos;
char word[MAX], lines[MAX], used[2*MAX], guess;
char menuChar = ' ', again = ' ';
vector<char*> fileLines;
string menu;
srand(time(0));
bool restart = true;

while(restart) {

restart = false;
//initialize arrays slots as NULL
for(int i=0; i < MAX; i++){
lines = NULL;
word = NULL;
}
for(int i=0; i < 2*MAX; i++)
used = NULL;

//menu
cout << "Press '1' to play alone\nPress '2' to play with a friend\n";
cout << "1 or 2: ";

while(menuChar != '1' && menuChar != '2'){
cin >> menu;
menuChar = menu[0];
switch(menuChar) {
case '1':
pos = rand() % lineCount(fileLines);
memcpy(word, fileLines[pos], strlen(fileLines[pos])-1);
clrscr();
break;
case '2':
cout << "Enter the word to be guessed: ";
cin >> word;
clrscr();
break;
default:
cout << "1 or 2: ";
}
}

//count the number of letters in the word for lines
for(unsigned int i=0; i < MAX; i++) {
if(word != NULL) {
lines = '_';
count2++;
}
}

gallows(tries);
cout << endl << endl << endl;
for(int i=0; i < MAX; i++)
cout << lines << " ";
cout << endl << endl << used << endl;

while (tries > 0) {
cin >> guess;
used[use] = guess;
for(int j=0; j < count2; j++) {
if(guess == word[j])
lines[j] = guess;
if (lines[j] == word[j])
count++;
}
if(!memchr(word, guess, count2) && !memchr(used, guess, use)){
tries--;
}
if(count == count2){
cout << endl << lines << endl;
cout << "\nGood Job!" << endl;
goto END;
}

count = 0;
use++;
clrscr();
gallows(tries);
cout << endl << endl << endl;
for(int i=0; i < MAX; i++)
cout << lines << " ";
cout << endl << endl << used << endl;
}

cout << "\nThe word was: " << word << endl;
END:
cout << "Would you like to play again?(y/n): ";
while(again != 'y' && again != 'n'){
cin >> again;
}
if(again == 'y') { // reset counter and error checking values and clear vector
count = 0;
count2 = 0;
tries = 7;
use = 0;
again = ' ';
menuChar = ' ';
fileLines.clear();
clrscr();
restart = true;
}
}
return 0;
}
 

Ethan

Captain
Former Krew Member
418866_519410164743095_281316979_n.jpg
 

Kreubs

|K3|Minecraft Admin
|K3| Executive
8086 Assembly to print the current date and time

assume cs:code, ds:data
data segment
sun db 'Sunday, ', '$'
mon db 'Monday, ', '$'
tue db 'Tuesday, ', '$'
wed db 'Wednesday, ', '$'
thu db 'Thursday, ', '$'
fri db 'Friday, ', '$'
sat db 'Saturday, ', '$'
days dw sun, mon, tue, wed, thu, fri, sat
dom db ' -$'
month db ' -$'
year db ' $'
a db 10
hh db " :$"
mm db " $"
am db "AM $"
pm db "PM $"
data ends

code segment
start:
mov ax, data
mov ds, ax
mov es, ax

mov ah, 2Ch
int 21h

;convert hours - 12 hour format
lea di, hh
mov ah, 0
mov al, ch
cmp al, 0Ch
jbe hour
sub al, 0Ch
hour:
div a
add al, '0'
stosb
xchg ah, al
add al, '0'
stosb

;convert minutes
mov ah, 0
mov al, cl
div a
lea di, mm
add al, '0'
stosb
xchg ah, al
add al, '0'
stosb

;print time
mov ah, 09h
lea dx, hh
int 21h

mov ah, 09h
lea dx, mm
int 21h

cmp ch, 0Ch
ja other
mov ah, 09h
lea dx, am
int 21h
jmp exit
other:
mov ah, 09h
lea dx, pm
int 21h

exit:
mov ah, 2Ah
int 21h

push dx

;print day of the week
mov bl, al
add bl, al
mov ah, 09h
mov dx, days[bx]
int 21h

pop dx

;print day of the month
mov al, dl
mov ah, 0
div a

lea di, dom
add al, '0'
stosb
xchg ah, al
add al, '0'
stosb

push dx

mov ah, 09h
mov dx, 0
mov dl, offset dom
int 21h

pop dx

;print month
mov al, dh
mov ah, 0
div a

lea di, month
add al, '0'
stosb
xchg al, ah
add al, '0'
stosb

mov ah, 09h
mov dx, 0
mov dl, offset month
int 21h

;print year
mov dx, cx
mov ax, dx
mov cx, 4
mov di, offset year + 3
std
yearX:
div a
xchg al, ah
add al, '0'
stosb
xchg al, ah
mov ah, 0
loop yearX

mov ah, 09h
mov dh, 0
mov dl, offset year
int 21h

mov ax, 4C00h
int 21h
code ends
end start
 

Ethan

Captain
Former Krew Member
We're no strangers to love
You know the rules and so do I
A full commitment's what I'm thinking of
You wouldn't get this from any other guy
I just wanna tell you how I'm feeling
Gotta make you understand

CHORUS
Never gonna give you up,
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry,
Never gonna say goodbye
Never gonna tell a lie and hurt you

We've known each other for so long
Your heart's been aching but you're too shy to say it
Inside we both know what's been going on
We know the game and we're gonna play it
And if you ask me how I'm feeling
Don't tell me you're too blind to see (CHORUS)

CHORUSCHORUS
(Ooh give you up)
(Ooh give you up)
(Ooh) never gonna give, never gonna give
(give you up)
(Ooh) never gonna give, never gonna give
(give you up)

We've known each other for so long
Your heart's been aching but you're too shy to say it
Inside we both know what's been going on
We know the game and we're gonna play it (TO FRONT)
 

Freeze

Second Lieutenant
Former Krew Member
Life it seems will fade away
Drifting further every day
Getting lost within myself
Nothing matters, no one else

I have lost the will to live
Simply nothing more to give
There is nothing more for me
Need the end to set me free

Things not what they used to be
Missing one inside of me
Deathly lost, this can't be real
Cannot stand this hell I feel

Emptiness is filling me
To the point of agony
Growing darkness taking dawn
I was me but now he's gone

No one but me can save myself
But it's too late
Now I can't think
Think why I should even try

Yesterday seems as though
It never existed
Death greets me warm
Now I will just say goodbye
 

The Moment

|K3|Recruit Admin
|K3| Executive
It's in your eyes, a colour fade out
Looks like a new transition
It's starting up and shaking your ground
Turning your head to see a new day calling
Does it feel like a head to lean on
A snapshot from where you were born
I'm looking for your hand in the rough
You're caught in the wire
Well, I'll lift you up

Leading on the action
Caught in a cell phones rays
Bleeding on a sofa
Staring at the waistline
He's coming and she knows it
Even though she knows why
Footsteps in the hallway
Girl you haven't got time

You gotta get out
Go far away
You gotta get out
Go far away

Darkness in the bedroom
Maybe she's resting up
Maybe she was out late
Just come back from the club
I can't hear her breathing
Something doesn't seem right
Killer in the hallway
We're living on a set time

We gotta get out
Go far away
You gotta get out
Go far away
 

Freeze

Second Lieutenant
Former Krew Member
[Push me
And then just touch me
Till I can get my
Satisfaction, satisfaction, satisfaction, satisfaction, satisfaction]

{Push me
And then just touch me
Till I can get my
Satisfaction, satisfaction, satisfaction, satisfaction, satisfaction, satisfaction

[Push me
And then just touch me
Till I can get my
Satisfaction]

{Push me
And then just touch me
Till I can get my
Satisfaction

[Push, push, push, push, push, push, push, push, push,
push, push, push, push, push, push, push, push]
{Push, push, push, push, push, push, push, push, push,
push, push, push, push, push, push, push, push

[Push me
And then just touch me
Till I can get my satisfaction
Satisfaction, satisfaction, satisfaction, satisfaction,
Satisfaction, satisfaction, satisfaction, satisfaction]

[Push me
And then just touch me
Till I can get my satisfaction]

{Push me
And then just touch me
Till I can get my
Satisfaction, satisfaction, satisfaction, satisfaction, satisfaction,
Satisfaction, satisfaction, satisfaction, satisfaction, satisfaction

{Push me
And then just touch me
Till I can get my
Satisfaction

[Push me
And then just touch me
Till I can get my
Satisfaction, satisfaction, satisfaction, satisfaction, satisfaction]

{Push me
And then just touch me
Till I can get my
Satisfaction

[Push me
And then just touch me
Till I can get my
Satisfaction]
 

Ethan

Captain
Former Krew Member
I can't get no satisfaction
I can't get no satisfaction
'Cause I try and I try and I try and I try
I can't get no, I can't get no

When I'm drivin' in my car
And that man comes on the radio
He's tellin' me more and more
About some useless information
Supposed to fire my imagination
I can't get no, oh no, no, no
Hey hey hey, that's what I say

I can't get no satisfaction
I can't get no satisfaction
'Cause I try and I try and I try and I try
I can't get no, I can't get no

When I'm watchin' my T.V.
And that man comes on to tell me
How white my shirts can be
But he can't be a man 'cause he doesn't smoke
The same cigarrettes as me
I can't get no, oh no, no, no
Hey hey hey, that's what I say

I can't get no satisfaction
I can't get no girl reaction
'Cause I try and I try and I try and I try
I can't get no, I can't get no

When I'm ridin' round the world
And I'm doin' this and I'm signing that
And I'm tryin' to make some girl
Who tells me baby better come back later next week
'Cause you see I'm on a losing streak
I can't get no, oh no, no, no
Hey hey hey, that's what I say

I can't get no, I can't get no
I can't get no satisfaction
No satisfaction, no satisfaction, no satisfaction
 

Trasgu

Second Lieutenant
Former Krew Member
Oppan gang-namseutayil
Kang-namseutayil

Naje-neun ttasaroun inkanjeo-gin yeoja
Keopi hanjanye yeoyureuraneun pumkyeok i-nneun yeoja
Bami omyeon shimjangi tteugeowojineun yeoja
Keureon banjeon i-nneun yeoja

Naneun sana-i
Naje-neun neomankeum ttasaroun geureon sana-i
Keopi shikgido jeone wonsyas ttaerineun sana-i
Bami omyeon shimjangi teojyeobeorineun sana-i
Keureon sana-i

Areumdawo sarangseureowo
Keurae neo hey keurae baro neo hey

Areumdawo sarangseureowo
Keurae neo hey keurae baro neo hey

Chigeumbu-teo kal dekkaji kabol-kka

Oppan gang-namseutayil

Kang-namseutayil

Oppan gang-namseutayil

Kang-namseutayil

Oppan gang-namseutayil

Eh- sexy lady
Oppan gang-namseutayil

Eh- sexy lady
O-oo-o

Jeongsu-khae boijiman nol ttaen noneun yeoja
Ittaeda shipeumyeon mukkeot-deon meori puneun yeoja
Karyeot-jiman wen-manhan nochulboda yahan yeoja
Keureon gamkakjeo-gin yeoja

Naneun sana-i
Jeomjanha boijiman nol ttaen noneun sana-i
Ttae-ga dwehmyeon wahnjeon michyeobeorineun sana-i
Keunyukboda sasangi ul-tungbul-tung-han sana-i
Keureon sana-i

Areumdawo sarangseureowo
Keurae neo hey keurae baro neo hey

Areumdawo sarangseureowo
Keurae neo hey keurae baro neo hey

Chigeumbu-teo kal dekkaji kabol-kka

Oppan gang-namseutayil

Kang-namseutayil

Oppan gang-namseutayil

Kang-namseutayil

Oppan gang-namseutayil

Eh- sexy lady
Oppan gang-namseutayil

Eh- sexy lady
O-oo-o

Ttwiineun nom keu wiie naneun nom
Baby baby
Naneun mwol jom aneun nom

Ttwiineun nom keu wiie naneun nom
Baby baby
Naneun mwol jom aneun nom

You know what i’m saying

Oppan gang-namseutayil

Eh- sexy lady
Oppan gang-namseutayil

Eh- sexy lady
Oppan gang-namseutayil
 

SoRude

|KKK|'s Swagga McDaddy
Former Krew Member
What the fuck did you just fucking say about me, you little bitch? I’ll have you know I graduated top of my class in the Navy Seals, and I’ve been involved in numerous secret raids on Al-Quaeda, and I have over 300 confirmed kills. I am trained in gorilla warfare and I’m the top sniper in the entire US armed forces. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words. You think you can get away with saying that shit to me over the Internet? Think again, fucker. As we speak I am contacting my secret network of spies across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your life. You’re fucking dead, kid. I can be anywhere, anytime, and I can kill you in over seven hundred ways, and that’s just with my bare hands. Not only am I extensively trained in unarmed combat, but I have access to the entire arsenal of the United States Marine Corps and I will use it to its full extent to wipe your miserable ass off the face of the continent, you little shit. If only you could have known what unholy retribution your little “clever” comment was about to bring down upon you, maybe you would have held your fucking tongue. But you couldn’t, you didn’t, and now you’re paying the price, you goddamn idiot. I will shit fury all over you and you will drown in it. You’re fucking dead, kiddo.
 

Kreubs

|K3|Minecraft Admin
|K3| Executive
First time ever java networking. I don't even expect it to work lol
Code:
package network;

import java.io.*;
import java.net.Socket;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Observable;
import java.util.Observer;

import main.AgencyException;
import model.Product;
import services.ObserverService;
import services.ProductService;
import services.SalesmanService;

public class ObserverWorker implements ObserverService, Runnable, Observer {
    private ProductService productServer;
    private SalesmanService salesmanServer;
    private Socket client;
    private BufferedReader inFromClient;
    private DataOutputStream outToClient;
   
    public ObserverWorker(ProductService productServer, SalesmanService salesmanServer, Socket client) {
        this.productServer = productServer;
        this.salesmanServer = salesmanServer;
        this.client = client;
    }
   
    @Override
    public void run() {
        try {
            handleRequest();
        } catch (Exception e) {
            e.printStackTrace();
        }       
    }
   
    @Override
    public void update(Observable arg0, Object arg1) {
        Object[] args = (Object[])arg1;

        String action = (String)args[0];
       
        if(action.equals("ADD")) {
            try {
                productAdded((Product)args[1]);
            } catch (IOException e) {
                e.printStackTrace();
            }
        } else if(action.equals("UPDATE")) {
            try {
                productUpdatedFromServer((Product)args[1]);
            } catch (IOException e) {
                e.printStackTrace();
            }
        } else if(action.equals("REMOVE")) {
            try {
                productRemoved((Product)args[1]);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
               
    }
   
    private void handleRequest() throws IOException, AgencyException {
        inFromClient = new BufferedReader(new InputStreamReader(client.getInputStream()));
        String request = inFromClient.readLine();
       
        if(request.equals("LOGIN")) {
           
            authenticate();
           
        }else if(request.equals("LOGOUT")) {
           
            invalidate();
           
        } else if(request.equals("GET")) { //client asks for full product list
           
            productsRequested(productServer.getAllProducts());
           
        } else if(request.equals("UPDATE")) { //client sent updated product
           
            productUpdatedFromClient();
           
        }
       
        inFromClient.close();
    }

    @Override
    public void authenticate() throws IOException {
        inFromClient = new BufferedReader(new InputStreamReader(client.getInputStream()));
        String data = inFromClient.readLine();
       
        String[] info = data.split(",");
        String response;
       
        if(salesmanServer.authenticateSalesman(info[0], info[1])) {
            response = "AUTHSUCCESS";
           
            //register as observer
            productServer.registerClient(this);
        } else {
            response = "AUTHFAIL";
        }
       
        //tell the client if their login was successful or not
        outToClient = new DataOutputStream(client.getOutputStream());
        outToClient.writeBytes(response);
       
        outToClient.close();
        inFromClient.close();
    }
   
    @Override
    public void invalidate() {
        productServer.unregisterClient(this);       
    }
   
    @Override
    public void productsRequested(Map<Integer, Product> products) throws IOException {
        String data = "";
       
        Iterator<Entry<Integer, Product>> it = products.entrySet().iterator();
        while(it.hasNext()) {
          Product prod = it.next().getValue();
          data += prod.toString();
        }
       
        outToClient = new DataOutputStream(client.getOutputStream());
       
        //send the string of all products back to the client
        outToClient.writeBytes(data);
        outToClient.close();
    }
   
    //sends new product to a client
    @Override
    public void productAdded(Product p) throws IOException {
        outToClient = new DataOutputStream(client.getOutputStream());
        outToClient.writeBytes("ADD");
        outToClient.writeBytes(p.toString());
       
        outToClient.close();
    }
   
    //receives updated product from a client
    @Override
    public void productUpdatedFromClient() throws AgencyException, IOException {
        inFromClient = new BufferedReader(new InputStreamReader(client.getInputStream()));
        String data = inFromClient.readLine();
       
        String[] info = data.split(",");
       
        int id = Integer.parseInt(info[0]);
        String name = info[1];
        int quantity = Integer.parseInt(info[2]);
        double price = Double.parseDouble(info[3]);
       
        productServer.updateProduct(id, name, quantity, price);
       
        inFromClient.close();
    }
   
    //send updated product to client
    @Override
    public void productUpdatedFromServer(Product p) throws IOException {
        outToClient = new DataOutputStream(client.getOutputStream());
        outToClient.writeBytes("UPDATE");
        outToClient.writeBytes(p.toString());
       
        outToClient.close();
    }
   
    //tells a client to remove a product, just and ID is sent
    @Override
    public void productRemoved(Product p) throws IOException {
        Integer id = p.getID();
       
        outToClient = new DataOutputStream(client.getOutputStream());
        outToClient.writeBytes("REMOVE");
        outToClient.writeBytes(id.toString());
       
        outToClient.close();
    }
}
 

Storky

Rawr
|K3| Moderator
Recruitment Team
Word game (scrabble similiar) game I made for my undergraduate degree.
Code:
#!/usr/bin/perl -w
 
####################################
#Name:         wordgame.pl
#Purpose:    A word game similiar to Scrabble.
#Author:     Patrick Wragg.
#Date Written:  24/11/2012
####################################
 
print "Lets play a game!\n";
 
my $score_total = 0;
my $score = 0;
my $loop_one = 0;
until ($loop_one) {    #Entire loop for which whole code goes inside.
  
    sub generate_random_letters {        #Function for generating random letters.
        my $length_of_randletters=8;  
 
        my @chars=('a'..'z');
        my $random_string;
        foreach (1..$length_of_randletters) { #Outputs 8 random characters - note foreach referring to the variable (8) above.
            $random_string.=$chars[rand @chars]; #Note rand function here.
        }
  
        return $random_string; #Output of function.
 
    }
 
    my $random_string=&generate_random_letters(8);
 
    print "These are your letters: ---".$random_string."---\n"; #Show random letters to user.
      
    print "\n";
    print "Are you happy with these letters?\n";
    print "Type 'y' to move on, or 'n' to get different characters, or 'q' to quit: ";
    chomp(my $input = <STDIN>); #Asks if user is happy with letters.
 
    if ($input =~ /^[N]?$/i) {   #Non case-sensitive
        print "----------------------------------------------------\n";
            print "More characters!\n";
        print "\n";        #This will repeat the above code giving the user another set of random chars.
        }
 
    elsif ($input =~ /^[Y]$/i) {
            print "Let's move on!\n";
        print "\n";        #User is happy with chars, so next loop is initiated.
       
        my $loop_two = 0;
        until ($loop_two) {
 
            print "\n";
            print "Please enter a word from the letters: $random_string\n";
            chomp(my $word = <STDIN>);     #User asked to input a word made up from the random chars.
      
            if ($word =~ /[$random_string]{1}\b/i) {  #To check IF word is made from 8 chars using RegExs.
                open(FILE,"dict.txt");         #Perl function to access the dictionary file.
 
                if (grep{/$word/} <FILE>) { # If word is in dictionary - then print below, then close file. Using GREP.
                    print "Word is in dictionary.\n";
                    close FILE;
                }
 
                else {                 #If word is NOT in dictionary.                  
                    print "Word not found in dictionary.\n";
                    print "\n";
                    print "Is this a real word?\n";
                    print "Type Y to add it to the dictionary, or any other character to continue: ";
                    chomp(my $dict_request = <STDIN>);    #Asks user if they would like to add word to dictionary.
 
                    if ($dict_request =~ /^[Y]?$/i) {
                              open (FILE, '>>dict.txt');
                        print FILE "$word\n";        #Function to add new word to dictionary file.
                                print "$word added to dictionary.\n";
                        }
 
                    close FILE;                #Since the dictionary file is not being used anymore, this closes it.
                  
                }
 
                $score_total = $score_total + $score;    #Initialises the score as the score total - this is for when the loop iterates again.  
                my $score = length($word);         #To get the number of letters(score) 1 per letter.
                $score_total = $score_total + $score;    #Further adds the new score to the old score total.
                print "\n";
                print "The score for that word is: $score\n";    #Print score for entered word.
 
                print "Would you like to make another word out of the letters?\n";
                print "\n";
                print "Type Y to do so or type any other char to continue: ";
                chomp(my $next_word = <STDIN>);        #Asks user if they would like to make another word out of the letters.
                  
                if ($next_word =~ /^[Y]$/i) {
                    print "Your score so far is: $score_total\n";     #Print score so far.
                    #If user types yes, code reverts back to asking for another word from the chars.
                }
 
                else {
                    print "Your final score is: $score_total\n\n";     #Print final score.
                    print "\n";
                    print "Scores so far:\n";                #Prints past scores below.
                    push (@score_array, $score_total);            #Builds array with incoming elements (score).
                    @score_array = sort {$b <=> $a} (@score_array);        #Sorts array in descending (top score at top)
                    foreach (@score_array) {                #Prints all of array, for each element it adds a new line.
                        print "$_\r\n";
                    }
 
                    print "\n";
                                  
                last;        #exits out of loop to go to next bit
                }
          
            }
 
            else  {
                print "Stop making up letters.\n";     #If user types any character that isn't in the 8 random chars, including numbers etc.
                print "\n";
            }
 
        }
      
        print "Would you like to play again? Type Y to to play again, or any other key to finish: \n";
        chomp(my $final_req = <STDIN>);            #Final request for the user to see if they want to play again.
        if ($final_req =~ /^[Y]$/i) {
            print "Lets start again!\n";
            print "o o\n\n";
            $score_total = 0; #to revert the score total back to 0 so it doesn't overwrite the old score.
        }
 
        else {
            print "Thanks for playing.\n";
            exit 0;                #Exit script if user types anything but Y.
        }  
 
    }
 
      elsif ($input =~ /^[Q]$/i) {
        print "Thanks for playing\n";        #Exit script if user types any variation of Q for quit.
        exit 0;
    }
 
    else {
        print "That wasn't a valid choice.\n";    #Makes the user try again on the first prompt (are these letters acceptable?.
    print "\n";
       }
 
}
 
#End program.
 
Top Bottom