首页 > 其他
两个数字交换(不使用临时变量)
#include<stdio.h> #include<stdlib.h> voidswap(int*a,int*b)//普通交换 { inttmp=*a; *a=*b; *b=tmp; } //不使用临时变量 voidswap1(int*a,int*b)//使用加减法 { *a=*a+*b; *b=*a-*b; *a=*a-*b; } voidswap2(int*a,int*b)//使用异或 { *a=*a^*b; *b=*a^*b; *..
分类:其他   时间:2016-02-11 06:52:15    收藏:0  评论:0  赞:0  阅读:123
磁盘管理
终端类型: console:控制台 pty:物理终端(VGA) tty#:虚拟终端(VGA) ttyS#:串行终端 pts/#:伪终端 shell: ln[-s-v]SRCDEST硬链接: 1、只能对文件创建,不能应用于目录; 2、不能跨文件系统; 3、创建硬链接会增加文件被链接的次数; 符号链接: 1、可应用于目录; 2、可以跨文..
分类:其他   时间:2016-02-11 06:50:14    收藏:0  评论:0  赞:0  阅读:205
文件系统管理
文件系统管理重新创建文件系统会损坏原有文件mkfs:makefilesystem -tFSTYPE mkfs-text2=mkfs.ext2mkfs-text3=mkfs.ext3专门管理ext系列文件:mke2fs -j:创建ext3类型文件系统 -bBLOCK_SIZE:指定块大小,默认为4096;可用取值为1024、2048或4096; -LLABEL:指定分区卷标; -m#:..
分类:其他   时间:2016-02-11 06:50:04    收藏:0  评论:0  赞:0  阅读:265
Struts2异常处理实例
一介绍javaee项目在某些情况下难免会产生一些异常,如果某些异常我们没有进行处理,那么将会抛给服务器,最后服务器会将异常信息直接在前台页面打印出来,比如说这样:像这种直接将异常打印出来是非常不好的,不仅因为普通用户看不懂,而且还会将服务器的一些内部信息暴露出来..
分类:其他   时间:2016-02-11 06:49:43    收藏:0  评论:0  赞:0  阅读:351
nginx1.6.2编译安装
1、安装依赖包yuminstallgccopenssl*pcre*zlib*libgdgdgd-devel2、创建nginx用户groupaddnginxuseradd-gnginx-d/usr/local/nginx3、下载fair模块(http://wiki.nginx.org/HttpUpstreamFairModule)wgetgnosek-nginx-upstream-fair-a18b409.tar4、编译./configure--prefix=/usr/lo..
分类:其他   时间:2016-02-11 06:48:23    收藏:0  评论:0  赞:0  阅读:343
haproxy ssl 配置方式
haproxy代理ssl有两种方式1、haproxy本身提供ssl证书,后面的web服务器走正常的http2、haproxy本身只提供代理,后面的web服务器https第一种方式需要编译haproxy支持ssl,编译参数:makeTARGET=linux26USE_OPENSSL=1ADDLIB=-lzlddhaproxy|grepssllibssl.so.10=>/usr/lib64/li..
分类:其他   时间:2016-02-11 06:46:31    收藏:0  评论:0  赞:0  阅读:186
haproxy 配置文件说明
####################全局配置信息###############################参数是进程级的,通常和操作系统(OS)相关#########globalmaxconn20480#默认最大连接数log127.0.0.1local3#[errwarninginfodebug]chroot/var/haproxy#chroot运行的路径uid99#所属运行的用户uidgid99#所属运行..
分类:其他   时间:2016-02-11 06:46:21    收藏:0  评论:0  赞:0  阅读:252
创建haproxy启动脚本
vim/etc/init.d/haproxy#!/bin/bash##haproxy##chkconfig:358515#description:HAProxyisafree,veryfastandreliablesolution\#offeringhighavailability,loadbalancing,and\#proxyingforTCPandHTTP-basedapplications#processname:haproxy#config:/etc/haproxy.cfg#pidfile:/var..
分类:其他   时间:2016-02-11 06:46:11    收藏:0  评论:0  赞:0  阅读:334
haproxy日志配置
vim/etc/syslog.conf添加:local3.*/var/log/haproxy.loglocal0.*/var/log/haproxy.log[root@cacti~]#vim/etc/sysconfig/syslog修改:SYSLOGD_OPTIONS="-r-m0"servicesyslogrestart
分类:其他   时间:2016-02-11 06:46:01    收藏:0  评论:0  赞:0  阅读:280
vmstat命令各项解释
不知道总结得对不对,自己感觉有点别扭,有清楚其中含义的烦请指正一下vmstat15#1秒钟显示5次第一列r:代表1秒钟内平均有多少个进程在使用cpu(排队或者正在运行),CPU是否瓶颈第二列b(block,被阻塞):I/O、磁盘、网速带宽有关也会阻塞(阻塞任务有几个),CPU是否瓶颈第三列sw..
分类:其他   时间:2016-02-11 06:45:10    收藏:0  评论:0  赞:0  阅读:170
HackerRank "Vertical Rooks"
Please note: VROOK cannot go back-ward - that leads to a simple variation to Game of Nim: just XOR. t = int(input()) for _ in range(t): n = int(input(
分类:其他   时间:2016-02-11 06:43:38    收藏:0  评论:0  赞:0  阅读:252
ng-repeat的group
http://blog.csdn.net/violet_day/article/details/17023219 一、obj包含 [html] view plain copy <!doctype html> <html ng-app> <head> <script src="lib/angular/
分类:其他   时间:2016-02-11 06:43:21    收藏:0  评论:0  赞:0  阅读:234
UNDER THE HOOD OF THE NEW AZURE PORTAL
http://jbeckwith.com/2014/09/20/how-the-azure-portal-works/ So - I haven’t been doing much blogging or speaking on WebMatrix or node recently. For the
分类:其他   时间:2016-02-11 06:43:08    收藏:0  评论:0  赞:0  阅读:199
Visual Studio Code
Visual Studio Code Visual Studio Code for Windows Code editing redefined and optimized for building and debugging modern web and cloud applications. V
分类:其他   时间:2016-02-11 06:42:58    收藏:0  评论:0  赞:0  阅读:506
LeetCode Flip Game II
原题链接在这里:https://leetcode.com/problems/flip-game-ii/ 类似Flip Game. 若是有一段"++", 剩下的段和"--"组合 can not win, 那么返回true. 从头到尾试遍了没找到这么一段"++", 返回false. Time Compl
分类:其他   时间:2016-02-11 06:42:48    收藏:0  评论:0  赞:0  阅读:222
LeetCode Flip Game
原题链接在这里:https://leetcode.com/problems/flip-game/ 若是连着的"++", 就把这段用"--"替代放到res中. Time Complexity: O(n). Space: O(1) regardless res. AC Java: 1 public cl
分类:其他   时间:2016-02-11 06:42:37    收藏:0  评论:0  赞:0  阅读:212
hdu1874 最短路模板题
之所以做了第二道模板题还要写是因为发现了一些自己的问题 用的是dij 最简单的松弛 需要注意的地方是松弛的时候 判断dis[i]<dis[w]+tance[w][i]时 还要再判断 vis[i] 要保证这个点没有成为过最小点 即这个点不会是已经被松弛过的点 输入的时候要注意 可能会有重边的输入 每次
分类:其他   时间:2016-02-11 06:42:28    收藏:0  评论:0  赞:0  阅读:143
ORCHARD 是什么?
Orchard 是由微软公司创建,基于 ASP.NET MVC 技术的免费开源内容管理系统: 可用于建设博客、新闻门户、企业门户、行业网站门户等各种网站 简单易用的后台界面 性能稳定,功能齐全 热拔插模块化架构提供超强可扩展性 BSD 协议授权,可用于商业闭源项目 http://dotnetnuke
分类:其他   时间:2016-02-11 06:42:17    收藏:0  评论:0  赞:0  阅读:168
poj 3253 初涉二叉堆 模板题
这道题很久以前就做过了 当时是百度学习了优先队列 后来发现其实还有个用sort的办法 就是默认sort排序后 a[i]+=a[i-1] 然后sort(a+i,a+i+n) (大概可以这样...答案忘了...) 嗯...其实标准解法是二叉堆.. 主函数里面的while里面wa了好多次.. 每次都选最小
分类:其他   时间:2016-02-11 06:41:47    收藏:0  评论:0  赞:0  阅读:131
Educational Codeforces Round 7、
A - Infinite Sequence 题意:有一种这样的无限序列数 1,1,2,1,2,3..... (如果最大数n,那么就有从1到n的所有1到n的数); 思路:题意只给了1秒、直接模拟肯定超时,我用的是二分找下界 1 #include<iostream> 2 using namespace
分类:其他   时间:2016-02-11 01:38:32    收藏:0  评论:0  赞:0  阅读:130
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!