Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Naru

Pages: 1 ... 329330331 332333 ... 617
9901
Gaming / Re: Making accomplishments in Dank Souls
« on: March 11, 2015, 10:24:18 PM »
I love you guys.

9902
The Flood / Re: Ordered my gun.
« on: March 11, 2015, 10:16:07 PM »
>tfw 18 year old fag

9903
The Flood / Re: forum members you would hang with irl
« on: March 11, 2015, 10:10:26 PM »
Slash
Nasty
AlphaZero
Sandtrap
Gatsbae
Casper and Oss (like totes a double date thang)
Tru
Yutaka (for cholo adventures)
Jive
Koala
Meta
Goji
Turkey
Cheese Poo

...

I forget

9904
The Flood / Re: Proof that Germany is better than the US.
« on: March 11, 2015, 08:47:07 PM »
We've never had a leader who enforced genocide so...
Manifest Destiny
Genocide implies the oppressed are human
>implying Native Americans are human

9905
The Flood / Re: "You have been warned"
« on: March 11, 2015, 08:18:56 PM »
i cri evrytiem

9906
The Flood / Re: Proof that Germany is better than the US.
« on: March 11, 2015, 08:13:44 PM »
We've never had a leader who enforced genocide so...
Manifest Destiny

9907
The Flood / Re: Slavery is alive and well within the US
« on: March 11, 2015, 08:11:54 PM »
Um, no.

And you get paid for jury duty..

Irrelevant with the threat of going to jail for not showing up.
I forgot who is who in the chat..

9908
The Flood / Re: Slavery is alive and well within the US
« on: March 11, 2015, 08:08:14 PM »
Um, no.

And you get paid for jury duty..

9909
The Flood / Re: My TV has ads built into it
« on: March 11, 2015, 07:42:50 PM »
But why are people lazy?
Everybody wants the most benefit for the least cost.

The cost of turning the ads off is obviously higher to some people than simply putting up with the ads.
Jesus Christ I'm learning more and more everyday.

9910
The Flood / Re: My TV has ads built into it
« on: March 11, 2015, 07:40:13 PM »
But ads aren't profitable if you can turns them off.
Depends how Panasonic is being compensated for it.

Let's be honest, if they're getting paid on a per-view basis when it comes to the ads, they're just capitalising on the lazy consumers who won't be assed enough to turn it off.
But why are people lazy?

9911
The Flood / Re: My TV has ads built into it
« on: March 11, 2015, 07:37:32 PM »
So what's the point of profit?
The incentive for profit is literally contained within the definition of the word "profit".

It's profitable.
But ads aren't profitable if you can turns them off.

9912
The Flood / Re: My TV has ads built into it
« on: March 11, 2015, 07:27:52 PM »
So why are there even ads?
I don't know, and I don't care. Panasonic makes some extra bucks?
So what's the point of profit?

9913
The Flood / Re: flood, help me pick up chicks on tinder
« on: March 11, 2015, 07:26:22 PM »
That's perfectly fine, you can call me daddy instead.
let's see where this goes
Spoiler
lmao

9914
The Flood / Re: My TV has ads built into it
« on: March 11, 2015, 07:22:18 PM »
OP bought a fucking TV, there shouldn't be ads if he bought something.
No, OP bought a fucking TV which had optional extra ads on it. That's what he bought.

If OP, or anybody else, doesn't like it there really is a simple solution. Turn off the ads, or buy a different television. Why is everybody acting as if this is some massive fucking injustice? I mean, come on, this is hardly some unprecedented crime that's taking everybody by surprise.
So why are there even ads?


inb4shrekoningbymeta

9915
The Flood / Re: flood, help me pick up chicks on tinder
« on: March 11, 2015, 07:19:02 PM »
That's perfectly fine, you can call me daddy instead.

9916
The Flood / Re: My TV has ads built into it
« on: March 11, 2015, 07:15:51 PM »
ITT: Everyone acts like it's the end of the fucking world.
Yeah but it's still complete bullshit
It's not stopping you from watching your show, what's the big deal?
There's already ads while watching TV, because it's free. OP bought a fucking TV, there shouldn't be ads if he bought something.

9917
The Flood / Re: Pornhub goes green with the wankband
« on: March 11, 2015, 06:34:01 PM »
Wait, why the fuck re you subscribed to PornHub?
Which is coming from the person that has a hentai maid as their avatar image.
It's not hentai, though..
Whatever it is I can tell people watch it for the plot.

Oh yes, great plot.

9918
The Flood / Re: My TV has ads built into it
« on: March 11, 2015, 06:33:01 PM »
Killing yourself helps pass the time before a patch comes to remove them!

9919
The Flood / Re: Pornhub goes green with the wankband
« on: March 11, 2015, 06:30:37 PM »
Wait, why the fuck re you subscribed to PornHub?
Which is coming from the person that has a hentai maid as their avatar image.
It's not hentai, though..

9920
The Flood / Re: Pornhub goes green with the wankband
« on: March 11, 2015, 06:26:02 PM »
Wait, why the fuck re you subscribed to PornHub?

9921
The Flood / Re: Pornhub goes green with the wankband
« on: March 11, 2015, 06:24:27 PM »
This is literally the only thing that can save us now..

9922
The Flood / Re: Perma'd from 4chan lol
« on: March 11, 2015, 04:38:54 PM »
I like that one anon who used Roquefort on his pizza.
What was the anon talking about... Blue cheese?
Roquefort is a type of blue cheese.
You don't use a lot of it, just enough to give it a hint of bite. It's very overpowering otherwise .
It does sound pretty good..

9923
The Flood / Re: Perma'd from 4chan lol
« on: March 11, 2015, 04:35:49 PM »
I like that one anon who used Roquefort on his pizza.
What was the anon talking about... Blue cheese?

9924
The Flood / Perma'd from 4chan lol
« on: March 11, 2015, 03:55:06 PM »
I can't even have a discussion about cheese pizza, fucking Nazi mods...

Discuss moderators on sites.

9925
The Flood / Re: NO MODS ONLINE POST DICKS
« on: March 11, 2015, 03:48:46 PM »
edit: fucking gasai and his changing avatar
What?

9926
The Flood / Re: NO MODS ONLINE POST DICKS
« on: March 11, 2015, 03:45:13 PM »
um, reported

9927
The Flood / Re: Does coding turn you on?
« on: March 11, 2015, 03:10:53 PM »
Code: [Select]

#include "Apriori.h"

using namespace std;

/* FUNCTION: Apriori()
*  PURPOSE: Basic constructor
*  =========================================================== */
Apriori::Apriori()
{
L = new Queue<LinkedList<Item>>;
C = new Queue<LinkedList<Item>>;
}

void Apriori::appendItemsets(Item& item1, Item& item2, LinkedList<Item>& newFrequentItemset)
{
//This will be called in a loop, going through the list of frequent n itemsets
//Ex: 3-itemsets: check if the mDataArray[0] and [1] match between the 2 items
if(headersMatch(item1, item2, item1.getSize() - 1)) //Compare the headers (loops through all elements except the last one)
{
//Make a new item of size n + 1
Item newItem(item1.getSize() + 1);
//Fill newItem's mDataArray with either one of the original item's contents:
for(int i = 0; i < newItem.getSize() - 2; i++)
{
newItem.mDataArray[i] = item1.mDataArray[i];

}
//Append the last element of item2 to newItem
for (int i = newItem.getSize() - 2; i < newItem.getSize(); i++)
{
if (newItem.getSize() % 2 == 0)
{
if (i % 2 == 0)
newItem.mDataArray[i] = item2.mDataArray[i];
else
newItem.mDataArray[i] = item1.mDataArray[i - 1];
}
else
{
if (i % 2 == 0)
newItem.mDataArray[i] = item2.mDataArray[i - 1];
else
newItem.mDataArray[i] = item1.mDataArray[i];
}
}

newFrequentItemset.insert(newItem); //Add the item to the new frequent itemset
}
}

LinkedList<Item>* Apriori::apriori_gen(LinkedList<Item>* originalList)
{
timer.startClock();

LinkedList<Item> *newItemset = new LinkedList<Item>();

for (int i = 0; i < originalList->getCount(); i++)
{
Item temp1, temp2;

temp1 = originalList->getData(i);

for (int j = i + 1; j < originalList->getCount(); j++)
{
temp2 = originalList->getData(j);

appendItemsets(temp1, temp2, *newItemset);
}
}

countFrequency(newItemset);

prune(newItemset);

timeString = timer.getTime();

OutputResults(newItemset);

return newItemset;
}

void Apriori::calcMinSupport(float thresholdPercent, int numTransactions)
{
mMinSupport = (int)(numTransactions * (thresholdPercent / 100));
}


bool Apriori::transactionContains(Item theItem, LinkedList<int>& theTransaction)
{
int frequency = 0;

for(int j = 0; j < theItem.getSize(); j++) //Loop through the Itemset
{
if(theTransaction.isExist(theItem.mDataArray[j]))
{
frequency++; //Find out how many items in the transaction are in the itemset
}
}
if(frequency < theItem.getSize()) //If frequency isn't as big as the itemset, it went through the transaction and couldn't find all of the itemset's contents
{
return false;
}

return true;

}

void Apriori::countFrequency(LinkedList<Item> *tmpItemList)
{

for(int i = 0; i < tmpItemList->getCount(); i++) //Loop through every item in the set
{
for(int j = 0; j < mNumTransactions; j++) //Loop through all of the transactions
{
if(transactionContains(tmpItemList->getData(i), mTransactions[j]))
{
tmpItemList->getData(i).increaseFrequency();
}

}

}

}


LinkedList<Item>* Apriori::genOneItemsets()
{
timer.startClock();

LinkedList<Item> *Ltemp = new LinkedList<Item>();; //Stores unique item structures

Item *Itemp; //Dynamically allocated Item to popullate Ltemp with

bool found = false; //Used to tell whether or not a number from mDataSet is unique or not
int index; //Index at where a non-unique number can be "placed" in Ltemp

for (int i = 0; i < mNumTransactions; i++) //Runs through entire mDataSet list
{
for (int j = 0; j < mTransactions[i].getCount(); j++)
{
if (Ltemp->getCount() == 0) //If Ltemp is empty
{
if (mTransactions->getCount() == 0) //If mDataset is empty
{
return Ltemp; //Empty list
}

else
{
//Initialization of new dynamically allocated Item
Itemp = new Item(1);
Itemp->append(mTransactions[i].getData(j));
Itemp->increaseFrequency();

//Inserts new Item into Ltemp
Ltemp->insert(*Itemp);
}
}

else
{
for (int k = 0; k < Ltemp->getCount(); k++) //Runs through every Item in Ltemp
{
if (Ltemp->getData(k).mDataArray[0] == mTransactions[i].getData(j)) //Compares Ltemp Item numbers with current number in mDataSet
{
found = true;
index = k; //set index to current Item in Ltemp
k = Ltemp->getCount(); //jump out of loop
}
}

if (found)
{
Item temp = Ltemp->getData(index); //increase count
temp.increaseFrequency();
Ltemp->setData(index, temp);
}

else
{
//Initialization of new dynamically allocated Item
Itemp = new Item(1);
Itemp->append(mTransactions[i].getData(j));
Itemp->increaseFrequency();

//Inserts new Item into Ltemp
Ltemp->insert(*Itemp);
}
}
}

//reset found
found = false;
}

prune(Ltemp);

timeString = timer.getTime();

OutputResults(Ltemp);

return Ltemp;
}

LinkedList<Item>* Apriori::genTwoItemsets(LinkedList<Item>* tmpList)
{
timer.startClock();

Item *templateItem = new Item(2);
LinkedList<Item>* setArray = new LinkedList<Item>;

for (int i = 0; i < tmpList->getCount(); i++)
{
for (int j = i + 1; j < tmpList->getCount(); j++)
{
templateItem->mDataArray[0] = tmpList->getData(i).mDataArray[0];
templateItem->mDataArray[1] = tmpList->getData(j).mDataArray[0];
setArray->insert(*templateItem);
templateItem = new Item(2);
}
}

countFrequency(setArray);

prune(setArray);

timeString = timer.getTime();

OutputResults(setArray);

return setArray;
}

void Apriori::GetInput()
{
LinkedList<int> tmp;
string filename, filenameData, filenameInfo;
float thresholdPercent;

// First have the user input the dataset filename and the minimum threshold percent
cout << "Enter input file name (w/o file extension): ";
cin >> filename;
cout << "Enter minimum threshold percent: ";
cin >> thresholdPercent;


cout << "Enter output file name (w/o file extension):";
cin >> outputFile;

outputFile = outputFile + ".txt";
output.open(outputFile);

// The .dat file is the actual data, .input is the information about the data
filenameData = filename + ".dat";
filenameInfo = filename + ".input";


ifstream input;
input.open(filenameInfo);

int averageTransLength, numUniqueItems, numTransactions;

// retrieve info from .input file
input >> averageTransLength;
input >> numUniqueItems;
input >> numTransactions;

mTransactions = new LinkedList<int>[numTransactions];

input.close();

input.open(filenameData);

mNumTransactions = numTransactions;

calcMinSupport(thresholdPercent, numTransactions);

int i = 0;

// Load everything from .dat into a LinkedList in the Apriori class
if(input.good())
{
string temp;
while (!input.eof()) //!input.eof()
{
input >> temp;

tmp.insert(atoi(temp.c_str()));

mTransactions[i].insert(atoi(temp.c_str()));

if (input.peek() == '\n')
{
i++;
}
}

input.close();
}
else if(input.fail())
{
cout << "\nERROR READING FROM FILE\n";
}
}

bool Apriori::headersMatch(Item& item1, Item& item2, int headerSize)
{
for (int i = 0; i < headerSize; i++)
{
if(item1.mDataArray[i] != item2.mDataArray[i])
return false;
}
return true;
}

void Apriori::OutputResults(LinkedList<Item>* itemset)
{
if(output.good() && !itemset->isEmpty())
{
Item* tmp = new Item(itemset->getData(0).getSize());
for (int i = 0; i < itemset->getCount(); i++)
{
*tmp = itemset->getData(i);
output << *tmp << endl; //Write the item's contents on one line
}
output << "Time: " << timeString << endl;
}
}

void Apriori::prune(LinkedList<Item> *itemset)
{
for (int i = 0; i < itemset->getCount(); i++)
{
if (itemset->getData(i).getFrequency() < mMinSupport)
{
itemset->removeElementAt(i);
i--;
}
}
}

void Apriori::RunAlgorithm()
{
// put the frequent 1-itemsets into L
L->enqueue(genOneItemsets());

L->enqueue(genTwoItemsets(L->dequeue()));

while (L->mHead->mData.getCount() != 0) // this process will repeat until the pruning of C finds nothing frequent, at which point we have found all of our frequen itemsets
{
// take the current itemset, and in apriori_gen find all of its subsets, and then put that set of subsets into C
// in apriori_gen remember to call OutputResults(*1-itemset*) and append the time taken onto timeStrings, so that we have a record of it in our output file
C->enqueue(apriori_gen(L->dequeue()));

// prune C so that only the items that meet the min support remain, then put that into L
L->enqueue(C->dequeue());

}

output.close();
}

Bitches love data structures.
i came

9928
The Flood / Re: >They think I'll fall for that shit
« on: March 11, 2015, 02:46:33 PM »
Muted

9929
The Flood / Re: Does coding turn you on?
« on: March 11, 2015, 01:44:57 PM »
Code: [Select]
OP is a niggermanRate my coding.
0/10

No instance variables declared. Kill yourself.

9930
The Flood / Re: I did 15 push ups
« on: March 11, 2015, 01:44:12 PM »
I can do 20.

Pages: 1 ... 329330331 332333 ... 617