- 博客(167)
- 资源 (4)
- 收藏
- 关注
原创 MySQL数据库常用操作
/** * SQL的关键字不区分大小写。 * \g相当于分号; *//** * 整数类型 * 标准SQL:integer(4Byte), smallint(2Byte) * 浮点数类型:float(4Byte), double(8Byte) * 定点数类型:decimal(以字符串的形式存储) * 字符串类型: */ /** * 创建数据库:create databa
2015-05-08 17:06:20
565
原创 Recommendation::Main.java
package pA;import java.util.Scanner;import java.util.Arrays;import java.util.Random;import java.math.*;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;impor
2015-05-07 13:02:48
558
原创 MySQL终端的常用命令
1.查看已存在的数据库show databases;2.查看默认存储引擎show variables like 'storage_engine';3.创建数据库schoolcreate database school;4.删除数据库schooldrop database school;5.进入数据库schooluse school
2015-04-01 21:09:57
587
转载 查看MySQL的端口号
进入mysql cmd1.输入status;将显示当前mysql的version的各种信息。2.输入select version(); 3.输入show global variables like 'port'; 查看MySQL端口号
2015-04-01 17:09:40
780
转载 用Java访问MySQL数据库的实例
import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;public class Main { public static void main(String[]
2015-04-01 16:11:01
955
原创 51单片机 简易温度采集与控制装置
MCU型号:IAP15F2K61S2还好是1T的单片机,不知道换成普通的12T单片机会不会跪。。终于调统了,不过温度采集不太稳定,有1度的波动。/*********************************************************************** 简易温度采集与控制装置文件名:main.c功能概述:
2015-02-26 22:47:02
2483
转载 ds18b20温度传感器应用实例
/********************************************************************************* 文件名:main.c* 描 述:温度传感器DS18B20示例* 备 注:控制DS18B20测量温度并将温度值显示到液晶上**************************************************
2015-02-26 14:49:56
1404
原创 stdint.h
#ifndef STDINT_H_INCLUDED#define STDINT_H_INCLUDEDtypedef unsigned char uint8_t;typedef unsigned int uint16_t;typedef unsigned long uint32_t;typedef char int8_t;typedef int int16_t;typedef lon
2015-02-26 14:47:44
590
转载 ds18b20.c
/********************************************************************************* 文件名:DS18B20.c* 描 述:温度传感器DS18B20驱动模块*****************************************************************************
2015-02-26 14:45:49
769
原创 timer.c
#include #include "utilities.h"#define TIMER0#define TIMER0_MOD1//#define TIMER1//#define TIMER1_MOD1#if defined (TIMER0)uchar T0RH = 0;uchar T0RL = 0;#if defined (TIMER0_MOD1)void setTmr0(
2014-12-03 21:44:24
530
原创 51单片机 带修改错误功能的计算器
utilities.h#ifndef UTILITIES_H_INCLUDED#define UTILITIES_H_INCLUDEDtypedef unsigned char uchar, BYTE, uint8;typedef unsigned int uint, WORD, uint16;typedef unsigned long ulong, DWORD, uint32;typ
2014-12-01 13:02:56
1195
原创 keyBoard.c
#include #include "utilities.h"sbit KEY_OUT_3 = P2^0;sbit KEY_OUT_2 = P2^1;sbit KEY_OUT_1 = P2^2;sbit KEY_OUT_0 = P2^3;sbit KEY_IN_0 = P2^4;sbit KEY_IN_1 = P2^5;sbit KEY_IN_2 = P2^6;sbit KEY
2014-11-30 22:15:36
831
转载 lcd1602.c
#include #include "utilities.h"#define LCD1602_DB P0sbit LCD1602_RS = P1^0;sbit LCD1602_RW = P1^1;sbit LCD1602_E = P1^5;void LCDWaitReady() { uchar state; LCD1602_DB = 0xFF; LCD16
2014-11-30 22:05:34
2046
原创 51单片机 1602液晶显示静态字符
#include #define LCD1602_DB P0typedef unsigned char uchar;typedef unsigned int uint;typedef unsigned long ulong;sbit LCD1602_RS = P1^0;sbit LCD1602_RW = P1^1;sbit LCD1602_E = P1^5;void init
2014-11-29 14:11:18
1401
原创 51单片机 UART串口通信
使用半双工通信/************************************ 使用硬件UART模块和串口中断************************************/#include typedef unsigned int uint;void configUART(uint baud);void main() { EA = 1;
2014-11-26 23:24:05
1572
原创 C语言 文件操作
#include #include #include #include int a[100];int a2[100];void main() { FILE * fp1; FILE * fp2; FILE * fp3; int num, i; int index = 0; float fnum = 1.0f / 7.0f, fnum2
2014-11-25 23:57:16
397
原创 51单片机 漩涡流水点阵
#include typedef unsigned char uchar;typedef unsigned int uint;typedef unsigned long ulong;sbit ADDR0 = P1^0;sbit ADDR1 = P1^1;sbit ADDR2 = P1^2;sbit ADDR3 = P1^3;sbit ENLED = P1^4;uchar i
2014-11-18 20:17:48
656
原创 51单片机之大杂烩
/************************************************************ 程序实现的功能: 用矩阵按键控制 8*8 LED 点阵和数码管, 实现按下1到9的数字键数码管从100或200。。。或900的 倒计时,一秒钟减1,直到减到0为止。 同时LED点阵以呼吸灯的方式渐明渐暗,显示“王”字,
2014-11-14 15:51:51
664
原创 51单片机 LED点阵的呼吸灯效果
STC 89C52RC#include typedef unsigned char uchar;typedef unsigned int uint;typedef unsigned long ulong;sbit ADDR0 = P1^0;sbit ADDR1 = P1^1;sbit ADDR2 = P1^2;sbit ADDR3 = P1^3;sbit ENLED = P
2014-11-14 11:19:54
2983
原创 C语言 单链表的基本操作
typedef int ElemType;typedef struct LNode { ElemType data; struct LNode * next;} LNode, * List;inline int ListLen(List L) { LNode * p = L; int k = 0; while (p) { k++;
2014-11-05 22:39:57
569
原创 51单片机 步进电机旋转角度控制
#include typedef unsigned char uchar;typedef unsigned int uint;typedef unsigned long ulong;uchar code beatCode[8] = { 0xE, 0xC, 0xD, 0x9, 0xB, 0x3, 0x7, 0x6};ulong beats = 0;uchar T0RH =
2014-11-01 21:23:08
10470
1
原创 51单片机 简易加法计算器
#include typedef unsigned char uchar;typedef unsigned int uint;typedef unsigned long ulong;sbit ADDR0 = P1^0;sbit ADDR1 = P1^1;sbit ADDR2 = P1^2;sbit ADDR3 = P1^3;sbit ENLED = P1^4;sbit KEY
2014-11-01 13:28:00
10999
1
原创 C++ 输入输出外挂 整数
#include #include using namespace std;inline void getInt(int* p) { char ch; do { ch = getchar(); } while (ch == ' ' || ch == '\n'); if (ch == '-') { *p = -(getchar
2014-10-28 21:11:48
1433
原创 操作系统实验 批处理作业的调度算法
#include #include #include #include #include #include #include using namespace std;typedef pair pii;const int N = 10000;int num;struct Node { char name[30];//作业的名字 int cTime; //作业进入输
2014-10-22 13:35:49
969
原创 51单片机 矩阵按键的扫描、消抖、动作分离
#include sbit ADDR0 = P1^0;sbit ADDR1 = P1^1;sbit ADDR2 = P1^2;sbit ADDR3 = P1^3;sbit ENLED = P1^4;sbit KEY_IN_1 = P2^4;sbit KEY_IN_2 = P2^5;sbit KEY_IN_3 = P2^6;sbit KEY_IN_4 = P2^7;sb
2014-10-15 13:19:14
2246
原创 ZIGBEE CC2430 使用Timer2定时器进行计数中断设置
#include #define uint unsigned int#define uchar unsigned charuint cnt = 0;uchar tmpFlag;void delay(uint n) { uint i, t; for (i = 0; i < 5; i++) for (t = 0; t < n; t++) ;}
2014-10-12 16:45:45
959
原创 51单片机 8*8LED点阵横向流水 使用位运算生成中间帧
#include sbit ADDR0 = P1^0;sbit ADDR1 = P1^1;sbit ADDR2 = P1^2;sbit ADDR3 = P1^3;sbit ENLED = P1^4;code unsigned char image[5][8] = { {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}, //动画帧0
2014-10-10 11:40:51
975
原创 hdu 4998 Rotate
给n次操作,每次操作为x, y, p即绕点(x,y)旋转p度,经过n次旋转后 相当于绕某个固定点旋转多少度,求固定点坐标和旋转度数。思路:很容易发现不管怎么旋转旋转度数相加就是最终度数(>=2*PI时减去2*PI就行了),那么咱们虚拟一个起始点,然后模拟旋转操作,最后得到一个虚拟终点,又虚拟起点和虚拟终点再加上旋转度数就能算出目标坐标了。
2014-10-02 16:33:49
449
原创 hdu 5017 Ellipsoid 模拟退火算法模板
//109MS 304K#include #include #include #include using namespace std;const double EPS = 1e-9;const double INF = 1e18;const double dx[8] = {1.0, 1.0, 0.0, -1.0, -1.0, -1.0, 0.0, 1.0};const dou
2014-09-24 19:55:31
538
原创 hdu 5017 Ellipsoid 模拟退火算法 西安网络赛
Given a 3-dimension ellipsoid(椭球面)your task is to find the minimal distance between the original point (0,0,0) and points on the ellipsoid. The distance between two points (x1,y1,z1) and (x2,y2,
2014-09-24 13:13:51
844
原创 hdu 5023 A Corrupt Mayor's Performance Art 广州网络赛 线段树的区间覆盖+种类查询
Problem DescriptionThe wall was divided into N segments and the width of each segment was one cun(cun is a Chinese length unit). All segments were numbered from 1 to N, from left to right. There w
2014-09-24 10:57:27
451
原创 Line.h
#ifndef LINE_H_INCLUDED#define LINE_H_INCLUDED//#define Point Vectorstruct Line { Point P; Vector V; //直线的点向式表示 Line(Point P, Vector V) : P(P), V(V) {} Point intersectionOfTwoLin
2014-09-16 17:16:00
539
原创 Vector.h
#ifndef VECTOR_H_INCLUDED#define VECTOR_H_INCLUDEDconst double EPS = 1e-10;struct Vector { double x, y; Point(double x = 0, double y = 0) : x(x), y(y) {} Vector operator +(Vector A,
2014-09-16 16:07:25
651
原创 51单片机C语言开发之花样流水灯程序
#include typedef unsigned char uchar;typedef unsigned int uint; //int是16位的sbit ADDR0 = P1^0;sbit ADDR1 = P1^1;sbit ADDR2 = P1^2;sbit ADDR3 = P1^3;sbit ENLED = P1^4;void main(){ uchar i;
2014-09-10 20:44:48
8799
原创 zoj 3818 Pretty Poem
//AC#include #include #include #include #include using namespace std;char ch[55];string str;int len;void work(){ for(int i=1; 3*i+2<=len; i++){ if((len-3*i) % 2 != 0) continue
2014-09-09 17:34:59
382
原创 头文件定义
#include #include #include #include #include #include #include #include #include #include #include #define mp make_pair#define pb push_back#define X first#define Y second#define rep(i,
2014-08-23 19:09:27
741
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人