Instantly share code, notes, and snippets.

🎯
Focusing

# hongbominxylcbd

🎯
Focusing
• Sort options
Last active Jul 18, 2017
View cpp_tools
 #pragma once #include #include #include #include #include "dirent.h" std::string replace_all(const std::string& str, const std::string& from, const std::string& to) { std::string result_str = str; size_t start_pos = 0;
Created Mar 1, 2017
visualise optimizer for neural network
View dl_optimizer.py
 #coding:utf-8 import numpy as np import matplotlib.pyplot as plt import math def f(x): return x[0] * x[0] + 50 * x[1] * x[1] def g(x): return np.array([2 * x[0], 100 * x[1]])
Last active Nov 17, 2016
View algorithms_in_program.md

# 程序设计时的常用算法

## 排序

• 冒泡排序
• 快速排序
• 直接插入排序
• 希尔排序
• 简单选择排序
• 桶排序
• 归并排序
Last active Nov 17, 2016
View algorithms_in_machine_learning.md

# 机器学习中的常用算法

## 有监督算法

• SVM
• ANN/CNN/RNN(LSTM)
• 朴素贝叶斯
• 决策树
• Logist
• KNN
• EM
Created Jun 21, 2016
View string_utils.cpp
 static std::string strip(const std::string& content) { if (content.empty()) { return content; } std::string result = content; while (true) { const wchar_t last_char = result[result.size() - 1];
Created Jun 14, 2016
freetype demo
View freetype_demo.cpp
 #include #include // FreeType headers #include #include FT_FREETYPE_H // OpenCV headers #include
Created Mar 28, 2016
View utf16 dump
 #include #include static std::string convertUtf16ToLocal(const unsigned short data) { char dstData[3]; ::wcstombs(dstData, (const wchar_t *)&data, 2); dstData[2] = '\0'; return dstData; } static void dumpUtf16Charset()
Last active Nov 6, 2015
View SIMD指令优化Tips
 1，SIMD指令优化的是计算，对于内存复制之类的问题，限制在内存，使用SIMD指令优化很少； 2，SIMD指令也需要耗费时间，不要把若干移位和一两次乘法变成SIMD乘法，性能急剧下降；
Last active Nov 27, 2015
scope exit lambda
View scope_exit_lambda.cpp
 namespace cxxdetail { template class InnerScopeExit { public: InnerScopeExit(const FuncType _func) :func(_func){} ~InnerScopeExit(){ if (!dismissed){ func(); } } private: FuncType func;
Created Aug 31, 2015
c++11 timeout handler
View timeout_handler.cpp
 template class TimeoutHandler { public: TimeoutHandler(const int _timeout/*ms*/,CALLBACKTYPE _callback, ARGS... _args) { std::thread([](TimeoutHandler* this_object,int _timeout, CALLBACKTYPE _callback, ARGS... _args) { std::this_thread::sleep_for(std::chrono::milliseconds(_timeout)); if (!this_object->exit_flag)
You can’t perform that action at this time.