
代码实例
cloudblaze
这个作者很懒,什么都没留下…
展开
-
[代码实例][WPF]移动控件
MainWindow.xaml<Window x:Class="CBControlDemo.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmln原创 2021-01-01 19:26:10 · 211 阅读 · 1 评论 -
[代码实例][C]Linux实现线程池
ThreadPool.h#ifndef THREADPOOL_H#define THREADPOOL_H#include <stdbool.h>#include <pthread.h>struct ThreadJob{ void* (*CallbackFunction)(void *arg); // 线程回调函数 void * Arg; // 回调函数参数 struct ThreadJob * Next;};typedef struct{原创 2020-11-27 05:16:13 · 192 阅读 · 0 评论 -
[代码实例][C]Linux多线程编程示例
#include <stdio.h>#include <stdlib.h>#include <time.h>#include <stdbool.h>#include <stdint.h>#include <pthread.h>typedef struct{ int * array_num; int count; bool is_front;} thread_arg;#define NUM_COUNT 10原创 2020-11-14 16:18:57 · 173 阅读 · 0 评论 -
[代码实例][HTML][Bootstrap]动态进度条
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Bootstrap Demo 102</title> <meta name="viewport" con.原创 2020-10-11 21:05:56 · 776 阅读 · 0 评论 -
[代码实例][C++]分析C程序源文件(不完善)
#define TEMP 1 /*ABCDEFG*/ #include <cstdlib>#include <fstream>#include <iostream>#include <list>#include <map>#include <sstream>using namespace std;#if (TEMP==1)// Macro definition#define MACRO 0#defi原创 2020-10-08 23:21:32 · 158 阅读 · 2 评论 -
[代码实例][C]Connect Four
国内盛行五子棋的游戏,但国外还有一个名字叫“Connect Four”的游戏,两者的规则差不多。在用C语言实现这个游戏的时候会让程序设计的入门新手体验并并掌握一些技能。说明文档如下:(优快云资源上传需要经过审核,故审核通过后补充这一部分)part1实现代码如下:#define _CRT_SECURE_NO_WARNINGS#include <ctype.h> // C标准库,提供库函数toupper()#include <stdio.h> // C标准库,提供库函数pr原创 2020-10-03 07:01:38 · 1209 阅读 · 0 评论 -
[代码实例][HTML][Bootstrap]广告牌
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Bootstrap Demo 102</title> <meta name="viewport" con.原创 2020-09-23 07:26:23 · 582 阅读 · 0 评论 -
[代码实例][HTML][Bootstrap]表格样式
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Bootstrap Demo 36</title> <meta name="viewport" cont.原创 2020-09-22 03:35:47 · 253 阅读 · 0 评论 -
[代码实例][HTML][Bootstrap]仿QQ登录界面
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Bootstrap Demo 5</title> <meta name="viewport" conte.原创 2020-09-19 16:44:59 · 3187 阅读 · 1 评论 -
自己实现的vsprintf函数(未完待续)
#include <ctype.h>#include <stdarg.h>#include <stdint.h>#include <limits.h>#include <stdbool.h>#include <stdio.h>#include <stdlib.h>#include <strin...原创 2019-05-12 10:58:32 · 1971 阅读 · 2 评论 -
[代码实例][Bash]创建时间相关的目录
时间相关 目录原创 2017-07-16 09:56:28 · 318 阅读 · 0 评论 -
[代码实例][Linux内核编程]内核开发:1、从实模式到保护模式
x86编程,从实模式到保护模式原创 2017-03-16 19:29:03 · 954 阅读 · 0 评论 -
[代码实例][SQLServer]关闭连接
SQLServer 关闭数据库连接原创 2017-01-18 01:16:37 · 930 阅读 · 0 评论 -
[代码实例][.NET]操作Excel文件
.NET操作Excel文件原创 2017-01-14 13:41:02 · 361 阅读 · 0 评论 -
[代码实例][Linux系统编程]判断相对路径或绝对路径
#include <stdio.h>#include <stdlib.h>#include <string.h>#define IS_APATH(p) (*(p) == '/')#define IS_RPATH(p) (!(IS_APATH(p)))int main(int argc, char * argv[]){ if((argc == 2 && strcmp(a原创 2016-06-23 15:42:31 · 752 阅读 · 0 评论 -
[代码实例][Linux系统编程]列出目录下的文件和子目录
系统调用#include <dirent.h>DIR *opendir(const char *name);struct dirent *readdir(DIR *dirp);代码实例#include <stdio.h>#include <stdlib.h>#include <stdbool.h>#include <string.h>#include <errno.h>#include <原创 2016-06-22 13:08:29 · 536 阅读 · 0 评论 -
[代码实例][C++]MD5算法
/* md5.h *//* MD5 converted to C++ class by Frank Thilo (thilo@unix-ag.org) for bzflag (http://www.bzflag.org) based on: md5.h and md5.c reference implementation of RFC 1321 Copyright (C) 1转载 2016-06-22 01:24:42 · 1150 阅读 · 0 评论 -
[代码实例][Linux内核][模块]helloworld程序
Linux内核模块 helloworld程序原创 2016-06-21 01:09:55 · 437 阅读 · 0 评论 -
[代码实例][Linux系统编程]遍历目录
#include <stdio.h>#include <stdlib.h>#include <stdbool.h>#include <string.h>#include <errno.h>#include <unistd.h>#include <limits.h>#include <dirent.h>#define MIN(x,y) (((x) < (y)) ? (x) : (y原创 2016-06-23 16:43:57 · 325 阅读 · 0 评论 -
[代码实例][Linux系统编程]相对路径转绝对路径
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <limits.h>#define MIN(x,y) (((x) < (y)) ? (x) : (y))char * rpath_to_apath(const char * rpath);int main(int argc原创 2016-06-23 02:25:54 · 2316 阅读 · 0 评论 -
[代码实例][C语言]MD5算法
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>#define BITS_PER_BYTE 8#define GROUP_BITS 512#define GROUP_SIZE (GROUP_BITS / BITS_PER_BYTE) // 64#define SUB原创 2016-06-22 01:20:56 · 356 阅读 · 0 评论 -
[代码实例][C语言]计算文件的MD5值
此算法有个BUG#include <stdio.h>#include <stdlib.h>#include <stdbool.h>#include <string.h>#include <math.h>#define BITS_PER_BYTE 8#define GROUP_BITS 512#define GROUP_SIZE (GROUP_BITS / BITS_原创 2016-06-24 05:03:13 · 3379 阅读 · 0 评论 -
[代码实例][gtk+]创建按钮
#include <gtk/gtk.h>static void activate(GtkApplication * app, gpointer user_date);static void print_hello(GtkWidget *widget, gpointer data);int main(int argc, char * argv[]){ GtkApplication * ap原创 2016-06-26 18:22:24 · 435 阅读 · 0 评论 -
[代码实例][gtk+]Grid布局
#include <gtk/gtk.h>static void activate(GtkApplication * app, gpointer user_date);static void print_hello(GtkWidget *widget, gpointer data);int main(int argc, char * argv[]){ GtkApplication * ap原创 2016-06-26 18:46:13 · 977 阅读 · 0 评论 -
[代码实例][gtk+]使用builder创建UI
builder.ui<?xml version="1.0" encoding="UTF-8"?><!-- Generated with glade 3.18.3 --><interface> <requires lib="gtk+" version="3.12"/> <object id="window" class="GtkWindow"> <property name="vis原创 2016-06-26 19:57:33 · 953 阅读 · 0 评论 -
[代码实例][gtk+]画布
#include <gtk/gtk.h>/* Surface to store current scribbles */static cairo_surface_t * surface = NULL;static void activate(GtkApplication * app, gpointer user_data);static void close_window(void);stat原创 2016-06-27 00:06:03 · 1008 阅读 · 0 评论 -
[代码实例][gtk+]创建窗体
#include <gtk/gtk.h>static void activate(GtkApplication* app, gpointer user_data);int main(int argc, char * argv[]){ GtkApplication *app; int status; app = gtk_application_new("org.gtk.exam原创 2016-06-26 17:55:20 · 410 阅读 · 0 评论 -
[代码实例][Linux系统编程]遍历目录并且输出目录下文件MD5值
main.c:#include <stdio.h>#include <stdlib.h>#include <stdbool.h>#include <string.h>#include <errno.h>#include <limits.h>#include <dirent.h>#define MIN(x,y) (((x) < (y)) ? (x) : (y))#define IS_原创 2016-06-28 17:57:34 · 1218 阅读 · 0 评论 -
[代码实例][c语言]获取键盘输入
#define BUF_SIZE 1024 char input_buf[BUF_SIZE + 1] = {0}; void get_input(void) { int ch = 0; int pos = 0; while((ch = getchar()) != '\n' && ch != EOF) i原创 2016-06-20 16:29:48 · 5543 阅读 · 0 评论 -
[代码实例][C语言]读取文本文件
#include <stdio.h>#include <stdlib.h>#include <string.h>#define BUF_SIZE 1024char buf[BUF_SIZE + 1];int main(int argc, char * argv[]){ if(argc != 2) { printf("Usage : %s <input_f原创 2016-06-20 17:53:36 · 601 阅读 · 0 评论 -
[代码实例][C语言]写入文本文件
#include <stdio.h>#include <stdlib.h>#include <string.h>#define BUF_SIZE 1024char buf[BUF_SIZE + 1];int main(int argc, char * argv[]){ if(argc != 2) { printf("Usage : %s <write_f原创 2016-06-20 17:54:54 · 988 阅读 · 0 评论 -
[代码实例][C语言]复制文件
#include <stdio.h>#include <stdlib.h>#define BUF_SIZE 1024char buf[BUF_SIZE + 1];int main(int argc, char * argv[]){ if(argc != 3) { printf("Usage : %s <src_file> <dest_file>\n", a原创 2016-06-20 17:56:09 · 609 阅读 · 0 评论 -
[代码实例][C语言][sqlite3]用SQL语句查询数据库的实例
下载sqlite3源代码https://www.sqlite.org/编译安装sqlite3的MakefileINSTALL_PATH =/usr/localall: installlibsqlite3.so: sqlite3.c sqlite3.h gcc -shared -fPIC $< -o $@install_lib: libsqlite3.so install_headers原创 2016-06-21 00:33:56 · 2533 阅读 · 0 评论