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 - Coco

Pages: 1 ... 596061 6263 ... 86
1801
Yes.
Pizza is considered a vegetable, and ketchup is considered toothpaste.

1802
Gaming / Re: Why PC is objectively better than consoles
« on: March 13, 2015, 02:00:17 PM »

1803
The Flood / Re: Ylyl thread
« on: March 13, 2015, 12:22:22 PM »
Spoiler















"Not a fucking Beyblade"

I lost it...

That's undoubtedly my favorite one :P

1804
The Flood / Re: Ylyl thread
« on: March 13, 2015, 12:07:08 PM »
Spoiler
















1805
Well yeah, it's Turkey.  They ban everything.

1806


Getting a chatbox system implemented into an online game I'm making.

1807
Gaming / Re: Staten's Back on Halo w/Novella
« on: March 12, 2015, 11:02:15 PM »
I'm more than okay with this.

1808
The Flood / Re: Does anybody even enjoy
« on: March 12, 2015, 03:58:04 PM »
considering i

1. don't have any
2. am not one
3. only get called a meme by people in some bizarre attempt at getting a rise out of me even though it hasn't worked at all

i'm indifferent


1809
The Flood / Re: I'M IN LOVE WITH THE COCO
« on: March 11, 2015, 03:11:01 PM »
Coco is for fags.

1810
The Flood / Re: Does coding turn you on?
« on: March 11, 2015, 03:05:45 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.

1811
Gaming / Titanfall is 1 year old today
« on: March 11, 2015, 01:05:20 PM »
And if any of you are still playing it for god knows what reason, you can pick up the season pass for free on Xbox and PC.

1812
I could see it happening.  I could also see several Visceral employees starting up another company and producing something that's actually good once again.

1813
Gaming / Re: I just got my 5th Gjallahorn in Destiny
« on: March 10, 2015, 06:59:12 PM »
I don't see why they're so coveted among the community.  I've seen Xur sell them pretty often: meanwhile, the Suros Regime is the most coveted auto rifle that he stopped selling week 2 of the game.

1814
Gaming / Re: Who wants a copy of This War of Mine?
« on: March 10, 2015, 11:55:06 AM »
Wouldn't say no.

1815
The Flood / Re: There's no more incentive to post here
« on: March 10, 2015, 10:38:14 AM »
See you in a week or two.

1816
Because prudes feel the need to lecture you on maintaining a healthy lifestyle while they melt their eyes from blowing their days away on obscure internet forums.

1817
The Flood / Re: Who is your Sep7agon Best Friend?/s
« on: March 09, 2015, 06:54:46 PM »
Verbatim and I have a special bond.

1818
The Flood / Re: The Best U.S. President?
« on: March 09, 2015, 06:48:50 PM »
G. Double Yuh, clearly.

1819
The Flood / Re: How do I handle this woman?
« on: March 09, 2015, 06:47:03 PM »
She's a bigger girl anyways (did you guys think she would be anything else?)

We'll be the judge of that.

1820
The Flood / Re: If you don't find her hot...
« on: March 09, 2015, 06:38:08 PM »
Careful, that's lonepaul territory.

1821
The Flood / Re: Lets get one thing straight
« on: March 09, 2015, 02:36:03 PM »
They're a fad that I haven't even seen take off.  You look like a massive tool if you're fiddling with your wrist like that, trying to read Facebook posts off a 1" screen.

1822
The Flood / Re: Apple watch is $10000
« on: March 09, 2015, 02:12:36 PM »
You mean $350?

It's a bit of the way down

Quote
The Apple Watch will start shipping on April 24 in many countries. Preorders begin April 10. The Apple Watch Sport (made with aluminum) starts at $349, the Apple Watch (steel) ranges from $549 to $1,049, and the Apple Watch Edition (gold) starts at $10,000.

1823
The Flood / Re: How do I handle this woman?
« on: March 09, 2015, 02:07:25 PM »
Yeah you shouldn't expect that to go anywhere serious.  Have fun with it and post pics.

1824
The Flood / Re: Apple watch is $10000
« on: March 09, 2015, 01:50:46 PM »
Apple knows what they're doing.  That's for the retards who'll drop several thousand dollars on a gold watch, so they told them they could drop several thousand dollars on a gold watch that makes them look "techy" and "high class".

1825
The Flood / Re: Introducing the new MacBook
« on: March 09, 2015, 01:16:55 PM »
Do you think any of those specs even make sense to Apple fanboys?
God no, it's the picture of the thing from the side.  "OMG SO SLEEK.  I BET IT HAS BETTER GRAPHICS AND THE CLOUD.  I COULD BE WATCHING NETFLIX ON IT WITH MINIMAL DISCOMFORT"

1826
The Flood / Re: Home alone all day
« on: March 08, 2015, 03:56:50 PM »
Fap in your parents' bed.  That'll teach them.

1827
Gaming / Re: So how aboot that new Xbox screenshot feature
« on: March 07, 2015, 05:24:54 PM »
It's pretty neat how the snapshot is taken the second you double-tap the home button.

1828
Gaming / Re: Team Beyond Royally Screwed Up
« on: March 06, 2015, 01:20:52 PM »

Frankie got rekt
These stat comparisons are pretty twisted and flawed that it's sad.
These stat comparisons are pretty straight forward and flawless that it's sad.
Except they're not.
It doesn't even specify which gametypes were played and for how long. Breakout matches would significantly lower total time played of the beta, because Breakout is a very quick gametype.
If they kept playing it'd be roughly the same.  Playing 2 half hour matches is the same as 30 2 minute matches.  Plus break out only released the last week of the beta, there wouldn't be a 6x difference.

But consider the beta's shitty matchmaking times disturbing those 30 matches.
Also Breakout was like week 2.  Then Strongholds came in.  And they stayed for a while.

1829
Gaming / Re: What would happen if Halo 5 is a total flop?
« on: March 06, 2015, 01:12:10 PM »
I mean, 343's got a plan for their story for 30 years

They seriously think they'll stay relevant that long?

I would say the same for Marvel and DC right now

To be fair, you can take something like Spiderman, redo the story everyone's heard 1000 times, but modernize the setting since the last series, and plenty will eat it up.

1830
Gaming / Re: Team Beyond Royally Screwed Up
« on: March 06, 2015, 01:09:01 PM »
Lol the drama has duplicated itself here.

-I think Halo 5 was a step in the right direction.  There are compromises, which I feel are fair.  Overall, the game plays nothing like the series used to, but the competitive ideals of the old games, that were discarded with Reach and 4, are there.  Movement is snappy and responsive, aim is incredibly important (even on the retarded automatic weapons, to an extent), people are equal matches are decided by skill rather than randomness, handholding is kept to a minimum, etc...  They've been trying to make sprint a "get into, not away from, the action quicker" mechanic.

-All of that said, PSU: it's obvious that they're not going to ditch sprint and boosters.  They're giving you the option to remove it through customization, though, I believe.  It's been several years since Halo has not featured some extended movement feature, and there's no way they're going to listen to 100% of the e-sports crowd.  If that one mechanic is such a prick in your foot, then hold off on buying the game until a classic mode is more prevalent among the community: it's a shit deal, but with Reach and 4, you're probably used to it by now, because I know I am.  It's pretty ignorant, though, to trash on how hard they've been trying: they've got seasoned Halo pros since the old days designing their game with them, giving valuable input, trying to foster that competitive atmosphere, and in some senses, they've made the competitive mechanics of old way better than they've ever been.

-The people in here going off on PSU and the competitive community are being massive hypocrites.  I don't think you can make the argument that the competitive community is a bunch of abrasive children, and refer to them as "tourneyfags", "elitist tryhard faggots", belittle arguments with dudebro l33tspeak, etc... at the same time.  You're not any bit more mature, or any less elitist, than the community that you're shaking your head at.  Going out of your way to wave off and belittle any feedback that has come in large quantity doesn't make you any less ignorant, snobbish, etc... as the people giving that feedback through bitching.  You should also try to expand your arguments past the ones that have become copy pasta associated with the ignorant apologists that Waypoint has become well known for.  Maybe, just maybe, there's more thought involved with an opinion regarding a set of mechanics than "durr.  It's not Halo 3.5", etc...


DRAMA

Pages: 1 ... 596061 6263 ... 86