This file contains hidden or 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
-- Previous tables before this simply included members, events, projects and the auxiliaries. | |
-- I'm beginning to consider migrating this database from SQLite3 to MySQL 5.x | |
CREATE TABLE IF NOT EXISTS member_teams { | |
member_id INTEGER NOT NULL, | |
team_id INTEGER NOT NULL, | |
PRIMARY KEY (member_id, team_id), | |
FOREIGN KEY (member_id) REFERENCES members (member_id), | |
FOREIGN KEY (team_id) REFERENCES teams (team_id) | |
} |
This file contains hidden or 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
class AdversarialSearchAI { | |
private PieceType piece; | |
public AdversarialSearchAI(PieceType piece) { | |
this.piece = piece; | |
} | |
/** | |
* Returns the best move given the state of the game | |
*/ |
This file contains hidden or 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
function GroupMining() { | |
this.member_ids = []; | |
this.semaphore = 0; | |
this.groupsCount = 1; | |
} | |
GroupMining.prototype = { | |
unlock: function() { | |
if (++(this.semaphore) === this.groupsCount) { | |
resultStr = this.member_ids.join(','); |
This file contains hidden or 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
function GroupInvitations() { | |
this.event_id = 517949684905901; | |
this.member_ids = []; | |
this.semaphore = 0; | |
} | |
GroupInvitations.prototype = { | |
unlock: function() { | |
if (++(this.semaphore) === 3) { | |
resultStr = this.member_ids.join(','); |
This file contains hidden or 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 <iostream> | |
#include "emmintrin.h" | |
using namespace std; | |
int main(int argc, char* argv[]) { | |
const LENGTH = 1 << 10; | |
const SSE_LENGTH = LENGTH >> 2; | |
// Set constant vectors |
This file contains hidden or 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
def CreateTree(half_width): | |
for i in range(half_width): | |
print(' ' * (half_width - i), '*' * (2 * i - 1)) | |
for i in range(half_width >> 2): | |
print(' ' * (half_width - 1), '+') | |
# CreateTree(6) | |
# * | |
# *** | |
# ***** |
This file contains hidden or 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
LinearClassify(w, b, x): | |
""" Computes a class of a two-class classifier using an n - 1 dimensional hyperplane """ | |
dot_product = sum(i * j for i, j in zip(w, x)) | |
if dot_product > b: | |
return 1 | |
else: | |
return 0 |
This file contains hidden or 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
Sorted List Tests Running | |
========================= | |
canAdd SUCCESS | |
canIterate SUCCESS | |
canClear SUCCESS | |
canPrintReverse SUCCESS | |
canPrintStrings SUCCESS | |
canCopy SUCCESS | |
canAssign SUCCESS |
This file contains hidden or 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
CppCKPlayer player = new CppCKPlayer(dllNameStr, playerInt, BoardModel model); | |
while (!game.isEnd()) { | |
// Opponent makes a move | |
Cell cell; | |
cell.row = opponentMove.row; | |
cell.col = opponentMove.col; | |
Mark m = (opponentMove.mark == 'X') ? Mark.A : Mark.B; | |
player.updateBoard(cell, mark); | |
Cell c = player.getMove(); |
This file contains hidden or 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
def analyze(other, weights): | |
return reduce(lamda base, items: base + items[0] * items[1], zip(other, weights), 0) | |
def friend_zone(other): | |
friend_zone_dict[other] = True | |
def FriendZone(): | |
while date_is_ongoing: | |
certainty_of_others_feelings_of_me = analyze(other) | |
if certainty_of_others_feelings_of_me >= threshold_of_romantic_felings: |