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
/* | |
ID: yilin.g1 | |
PROG: ride | |
LANG: C++ | |
*/ | |
/* | |
Your Ride Is Here | |
http://train.usaco.org/usacoprob2?a=1riZcYaDeJF&S=ride | |
*/ |
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
/* | |
# Released under MIT License | |
Copyright (c) 2017 insaneyilin. | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and | |
associated documentation files (the "Software"), to deal in the Software without restriction, | |
including without limitation the rights to use, copy, modify, merge, publish, distribute, | |
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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 <stdlib.h> | |
#include <GL/gl.h> | |
#include <GL/glu.h> | |
#include <GL/glut.h> | |
static int width; | |
static int height; | |
static void display(void) { |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <string> | |
#include <iostream> | |
#include <opencv2/core/core.hpp> | |
#include <opencv2/highgui/highgui.hpp> | |
void color_reduce1(const cv::Mat& src_mat, int div, cv::Mat* dst_mat) { |
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
// https://coderwall.com/p/jsxrdq/c-erase-elements-from-containers-by-indices | |
template<typename Cont, typename It> | |
auto ToggleIndices(Cont &cont, It beg, It end) -> decltype(std::end(cont)) | |
{ | |
int helpIndx(0); | |
return std::stable_partition(std::begin(cont), std::end(cont), | |
[&](decltype(*std::begin(cont)) const& val) -> bool { | |
return std::find(beg, end, helpIndx++) == end; | |
}); |
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
# from https://github.com/BVLC/caffe/blob/master/examples/detection.ipynb | |
def nms_detections(dets, overlap=0.3): | |
""" | |
Non-maximum suppression: Greedily select high-scoring detections and | |
skip detections that are significantly covered by a previously | |
selected detection. | |
This version is translated from Matlab code by Tomasz Malisiewicz, | |
who sped up Pedro Felzenszwalb's code. |
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 progress(count, total, status=''): | |
bar_len = 60 | |
filled_len = int(round(bar_len * count / float(total))) | |
percents = round(100.0 * count / float(total), 1) | |
bar = '=' * filled_len + '>' + '-' * (bar_len - filled_len) | |
if count < total: | |
sys.stdout.write('[%s] %s%s ...%s\r' % (bar, percents, '%', status)) | |
else: |
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
# -*- coding: utf-8 -*- | |
# @Author: insaneyilin | |
# Python version 2.7 | |
# Reference: https://www.cnblogs.com/li1992/p/10675769.html | |
import os | |
import sys | |
import argparse | |
import glob |
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
struct Student { | |
int stu_id; | |
int age; | |
float grade; | |
}; | |
std::vector<Student> students; | |
// fill students vector | |
// ... |
OlderNewer