随笔分类 - C++程序设计
记录下学习的点滴
摘要:#!/usr/bin/expect set ip [lindex $argv 0] set password [lindex $argv 1] spawn ssh -o ConnectTimeout=15 -l root ${ip} "hostname" expect { "(yes/no)? "
阅读全文
摘要:#include <iostream>#include <valarray> template<class T> class Slice_iter { std::valarray<T>* v; std::slice s; size_t curr; T& ref(size_t i) const { r
阅读全文
摘要://f(x;W,c,w,b)=w*max{0, W*x+c}+b #include <iostream>#include <vector>#include <algorithm> template <class T>double tanh(T& z) { double ret; ret = (exp
阅读全文
摘要:调用函数时候,传入脚本路径名称或者具体命令。 int shell_call(std::string &cmdstr) { enum { maxline=100 }; char line[maxline]; FILE *fpin; int ret; if((fpin = popen(cmdstr.c_
阅读全文
摘要:#include <iostream>#include <cstdlib> template<class T>void changeLength1D(T*& a, int oldLength, int newLength) { if(newLength<0) { std::cout<<"new le
阅读全文
摘要:#include <iostream>#include <sstream>#include <fstream>#include <cmath>#include <iterator>#include <algorithm> template<class T>class linearList { pub
阅读全文
摘要:#include <iostream>#include <vector>#include <cmath>#include <numeric> template <class T>double VectorCosine(const std::vector<T> &In1, const std::vec
阅读全文
摘要:We can estimate the weight values for our training data using stochastic gradient descent. Stochastic gradient descent requires two parameters: Learni
阅读全文
摘要:第一篇博客:Hello World #include <iostream> int main() { std::cout<<"Hello world!"<<std::endl; return 0; } Know what you want to say. Practice. Imitate good
阅读全文