Skip to content

Instantly share code, notes, and snippets.

from collections import defaultdict
import math
import time
class Pintrust:
# parameter
target_user = 5332 # 5332
alpha = 1e-2
beta = 1e-5
eps = 0.005
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <ctime>
#include <fstream>
#include <cmath>
class FindZero {
private:
ifstream fin;
ofstream fout;
clock_t start;
const string userFactorsFile = "user_factors";
const string itemFactorsFile = "item_factors";
const string zeroFile = "zero_list.txt";
map<ll, int> userMap, itemMap;
vector<vector<double> > users, items;
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <ctime>
using namespace std;
typedef long long ll;
@bowbowbow
bowbowbow / pintrust_v6.cpp
Last active August 12, 2017 12:18
로그버전
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include "BigDecimal.h"
#include <ctime>
#include <cmath>
using namespace std;
@bowbowbow
bowbowbow / fb_posting_remover.js
Created July 5, 2017 08:49
fb_posting_remover extension
var fireEvent = function (element, event) {
if (document.createEventObject) {
var evt = document.createEventObject();
return element.fireEvent("on" + event, evt);
} else {
var evt = document.createEvent("HTMLEvents");
evt.initEvent(event, true, true);
return !element.dispatchEvent(evt);
}
};
#define _ASSERT(cond) ((!(cond)) ? _assert(#cond,__FILE__,__LINE__) : _noassert())
#include "BigDecimal.h"
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <stdio.h>
static int _scale = 100;
static const std::string ONE("1");
#include <iostream>
#include <vector>
#include <map>
using namespace std;
#define mp make_pair
#define MN 1000
int matrix[MN][MN];
#define MAT vector<vector<double> >
@bowbowbow
bowbowbow / practice3_2.cpp
Created June 18, 2017 15:23
그래픽스 태양계 모형 과제
#include <GLUT/GLUT.h>
#include <OpenGL/glu.h>
#include <OpenGL/gl.h>
static int Day = 0, Time = 0;
// 화성의 날짜와 시간
static int MDay = 0, MTime = 0;
void MyDisplay() {
@bowbowbow
bowbowbow / practice3_2_skeletion.cpp
Last active June 18, 2017 15:23
그래픽스 태양계 모형 과제 스켈레톤 코드
#include <GL/freeglut.h>
#include <GL/glu.h>
#include <GL/gl.h>
static int Day = 0, Time = 0;
void MyDisplay()
{
glClear(GL_COLOR_BUFFER_BIT
|GL_DEPTH_BUFFER_BIT);