现在位置: 首页 > Rhsdshbe发表的所有文章
  • 07月
  • 24日
综合 ⁄ 共 5353字 评论关闭
基于篇幅,这里我只用两个独立却又关联的activities来作演示: main activitiy:   package mth.android; import android.app.Activity;import android.content.Intent;import android.media.MediaPlayer;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.TextView; public class AndroidActivity extends Activity implements View.OnClickListener {    // Define a media player private MediaPlayer mediaPlayer = null; private int curPos;  /** Called when the act......
阅读全文
  • 07月
  • 23日
综合 ⁄ 共 3231字 评论关闭
在实际的开发中,如果需要 开发的时候,一套配置、测试的时候,一套配置、上线的时候又是一套配置。彼此修改,互不干涉 此时,就可以使用maven的profile 具体做法如下: 一:新建一个maven项目 二:在resources目录里面,新建dev、test、production三个目录,代表三种环境的配置文件,项目结构图如下: 三:分别在dev, test, production里面新建文件:application.properties,分别配置好各自的环境 比如说我这里的配置为: dev/application.properties spring.datasource.driverClassName=org.postgresql.Driver spring.datasou......
阅读全文
  • 02月
  • 20日

综合 ⁄ 共 1078字 评论关闭
#include<cstdio> #include<cstring> #include<iostream> #include<queue> #include<algorithm> using namespace std; #define maxn 1000 struct heap { int element[maxn]; int n; }; heap h; void insert(int x) { if(h.n!=maxn-1){ int i=++h.n; while(i!=1&&x>h.element[i/2]) h.element[i]=h.element[i/2],i/=2; h.element[i]=x; } } int Delemax() { if(h.n==0)return -1; int tmp=h.element[h.n--]; int ans=h.element[1]; int child=2,parent=1; while(child&......
阅读全文
http://www.cppblog.com/biao/archive/2013/07/04/137087.html /* 输出 Original: 黄 彪彪 to unicode: \u9EC4\ \t\u5F6A\u5F6A from unicode: 黄 彪彪 使用命令转换: native2ascii -encoding utf-8 a.txt a.txt Java的properties属性文件会把字符先转换成unicode的形式存储. */ import java.io.UnsupportedEncodingException; public class UnicodeConverter { public static void main(String[] args) throws UnsupportedEncodingException { String s = "黄 \t彪\u5F6A"; System.out.pr......
阅读全文
  • 08月
  • 24日
综合 ⁄ 共 1391字 评论关闭
LPC1788单沿pwm原理和配置         pwm的基本功能:以一定的周期频率,输出不同占空比可调的方波。         Lpc1788中的pwm的时钟(频率)来源于APB总线的时钟(频率),首先要进行分频,或者说预分频,不然直接由APB频率也太大了,肯定是需要通过分频才能达到我们需求的pwm周期频率。         寄存器PWMPR 和PWMPC两个寄存器提供了APB频率分频到PWM中的频率,手册上讲的预分频,也是有道理的,因为到了pwm之后还要进行一次分频,第二次分频才是真正pwm的周期频率。我们把第一次分频得到频率暂且命名为prepwmclk。         第二次分......
阅读全文
  • 07月
  • 29日
综合 ⁄ 共 594字 评论关闭
C++程序的内纯格局通常分为4个区:     1.数据区(Data Area)     2.代码区(Code Area)     3.栈区(Stack Area)     4.堆区(即自由存储区)(Heap Area)全局变量、静态变量、常量存放在数据区,所有类成员函数和非成员函数代码存放在代码区,为运行函数而分配的局部变量、函数参数、返回数据、返回地址等存放在栈区,余下的空间为堆区。因为堆是有限的,它可能变得拥挤,如果堆中没有足够的自由空间以满足内存的需要时,那么此需要失败,并且返回一个空指针。因此,必须在使用NEW生成的指针之前进行检查,方法如下:HeapCla......
阅读全文
  • 06月
  • 08日
综合 ⁄ 共 13110字 评论关闭
文章目录 RandomAccessFile类:  IputStream与OutputStream: 过滤流与包装类: DataInputStream与DataOutputStream: PrintStream: 字节流与字符流的转换: 字符集的编码问题: Decorator设计模式:                                          IO/输出输入  File类:  File类是包IO包中唯一代表磁盘文件本身对象,File类定义了一些与平台无关的操作文件。通过,File类提供的各种方法,我们创建。删除文件、重命名文件、判断文件的读写权限及是否存在。设置和查询最近修改时......
阅读全文
struts2.X心得7--接收请求参数和struts类型转换介绍以及案例分析 1.接收请求参数 •       采用基本类型接收请求参数(get/post) 在Action类中定义与请求参数同名的属性,struts2便能自动接收请求参数并赋予给同名属性。 请求路径: http://localhost:8080/test/view.action?id=78 public class ProductAction {       private Integer id;       public void setId(Integer id) {//struts2通过反射技术调用与请求参数同名的属性的setter方法来获取请求参数值              this.id = id;       }       public Inte......
阅读全文
  • 05月
  • 08日
综合 ⁄ 共 3160字 评论关闭
step1 :下载oclint并安装 下载地址: http://oclint.org/downloads.html 选择mac os x或者darwin的包,下载到本地。 目录类似下面: oclint-release |-bin |-lib |---clang |-----3.4 |-------include |-------lib |---oclint |-----rules |-----reporters 安装官方指南: http://docs.oclint.org/en/dev/intro/installation.html 我们此时在bash(终端terminal)中运行oclint会告诉我们命令找不到,我们需要把它的执行文件路径加入到环境变量或者把执行文件拷贝到系统目录。 方法1(推荐):把路径加到环境变量中(实际是.bash......
阅读全文
  • 04月
  • 25日
综合 ⁄ 共 2680字 评论关闭
蒟蒻表示计算几何一WA就手足无措啊。。还要care一下精度问题。 因为最多旋转十次,直接取一个向量模拟,最后算旋转夹角就行了。注意这里面角度结果的范围是[0,2*pi),而acos的范围是[0,pi),所以最后要根据叉积判断夹角有木有超Pi。 然后旋转中心通过轨迹中垂线求解,我之前把这个和两条直线的交点弄混了。== #include<iostream> #include<stdio.h> #include<cstdio> #include<stdlib.h> #include<vector> #include<string> #include<cstring> #include<cmath> #include<algo......
阅读全文
  • 04月
  • 25日
综合 ⁄ 共 2784字 评论关闭
题意:有n(1<=n<=60000)个矩形散落在大矩形中,保证任意两个矩形没有一个交点,问每块被围出来的小面积的大小是多少。 题解:矩形并=线段树,对于这个题,由于任意两个矩形没有一个交点,着眼于lazy的性质,如果一个矩形能被另一个矩形包围起来,那么当前矩形的lazy一定          比另一个lazy小,遇到矩形的右边的时候再把lazy还原成father,这样搞出来一棵树,然后dfs即可。 Sure原创,转载请注明出处 #include <iostream> #include <cstdio> #include <memory.h> #include <algorithm> #defi......
阅读全文
  • 04月
  • 11日
综合 ⁄ 共 3546字 评论关闭
    When a network connection is not available, U-Boot can be load files via the serial port. U-Boot currently supports two protocols: kermit or y-modem. There are several terminal programs available and most likely your favorite one will work with at least one of these. Here we will cover three of the most common ones: C-Kermit and minicom in Linux and HyperTerminal in Windows. Keep in mind that loading anything but the smallest of files via the serial port can take quite a long time (......
阅读全文