原创 D3D9---2D編程(畫矩形)

#include <Windows.h> #include <D3D9.h> #pragma comment(lib, "D3D9.lib") const TCHAR *kClassName = L"Rectangle_D3D"; I

原创 Centos7上源碼編譯tensorflow

tensorflow官網: https://www.tensorflow.org/install/source?hl=zh_cn 編譯前概述: 本人編譯的是tensorflowr1.13版本,據我所知,tensorflow每一個版本對構建

原创 像素着色器實現多重紋理

像素着色器實現多重紋理,首先需要用HLSL語法寫出相關代碼,保存爲一個文件,然後調用D3DXCompileShaderFromFile接口進行編譯。還有一種方式是:通過fxc.exe工具編譯那個文件。代碼裏讀取文件,然後直接創建着色器。

原创 c++11 移動拷貝、移動賦值簡單Demo

#include <iostream> using namespace std; class A { public: A() : p_(new int(3)){ cout << "constructor numbe

原创 可變參數模板類

模板遞歸方式數字求和:#include <iostream> using namespace std; template<int... Last> class Sum; template <int First, int... Last>

原创 D3D畫文字

#include <Windows.h> #include <D3D9.h> #include <D3dx9tex.h> #pragma comment(lib, "D3D9.lib") #pragma comment(lib, "D3

原创 簡單的用戶登錄腳本

#!/usr/bin/env python import time db = {} def new_user(): prompt = 'login desired: ' value = [] while Tru

原创 接受一個整型作爲參數, 返回它所有約數的列表,包括1和本身

下面是兩種方式實現,返回所有約數的函數: #/use/bin/env python #-*-coding:utf-8-*- "this is a custom module" import math def getfactors(nu

原创 輸入一個整數值,返回代表該值得英文,數字限定在0---1000

#/use/bin/env python #-*-coding:utf-8-*- "this is a custom module" def number_to_english(num): ''' 輸入一個整數值,返回代

原创 簡單的家庭理財程序

#/user/bin/env python #-*-coding:utf-8-*- "家庭理財程序" import os family_account = 'account.cfg' def Home(): """主頁菜單"

原创 基於D3D技術實現的九宮格算法繪製圖片

九宮格示意圖: 下面是代碼實現: #include <Windows.h> #include <D3D9.h> #include <cstdio> #include <D3dx9tex.h> #pragma comment(lib, "

原创 接受一個整型作爲參數,返回該整數所有素數因子的列表

#/use/bin/env python #-*-coding:utf-8-*- "this is a custom module" import math def isprime(num): if num <= 1:

原创 IP地址轉數字(IP 數字)

#/use/bin/env python #-*-coding:utf-8-*- "this is a custom module" def IpChangeToNumber(ip): '''把一個ip地址轉換成數字,

原创 python 判斷一個正數是不是素數

#/use/bin/env python #-*-coding:utf-8-*- "this is a custom module" import math def isprime(num): if num <= 1:

原创 spring mvc入門框架演示(純java配置)

1、筆記 這是一篇關於spring mvc,用純java配置的學習筆記,之前寫過用xml配置的筆記,地址:spring mvc入門框架演示(xml配置),我參考學習《spring 實戰第4版》,照着書上寫代碼,在最後總是運行出錯;也參考了